From 67dddee1984d4e0d043d7b965cfd75bd1562adc3 Mon Sep 17 00:00:00 2001 From: rtel Date: Thu, 14 Apr 2016 11:14:58 +0000 Subject: [PATCH] Add SAMA5D2 Xplained IAR demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2441 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../AtmelFiles/ChangeLog.md | 94 + .../AtmelFiles/README.md | 166 ++ .../AtmelFiles/SAMA5D2-BGA196.bsdl | 803 +++++++++ .../AtmelFiles/SAMA5D2-BGA256.bsdl | 842 +++++++++ .../AtmelFiles/SAMA5D2-BGA289.bsdl | 865 +++++++++ .../AtmelFiles/drivers/Makefile.inc | 51 + .../AtmelFiles/drivers/cortex-a/Makefile.inc | 34 + .../drivers/cortex-a/cortexa5_interrupts.c | 194 ++ .../drivers/cortex-a/cortexa5_interrupts.h | 49 + .../AtmelFiles/drivers/cortex-a/cp15.c | 350 ++++ .../AtmelFiles/drivers/cortex-a/cp15.h | 318 ++++ .../drivers/cortex-a/cp15_asm_gcc.S | 412 +++++ .../drivers/cortex-a/cp15_asm_iar.s | 420 +++++ .../AtmelFiles/drivers/cortex-a/cp15_pmu.c | 252 +++ .../AtmelFiles/drivers/cortex-a/cp15_pmu.h | 106 ++ .../AtmelFiles/drivers/cortex-a/cpsr.h | 43 + .../AtmelFiles/drivers/cortex-a/cpsr_gcc.S | 55 + .../AtmelFiles/drivers/cortex-a/cpsr_iar.s | 63 + .../AtmelFiles/drivers/cortex-a/mmu.c | 89 + .../AtmelFiles/drivers/cortex-a/mmu.h | 79 + .../AtmelFiles/drivers/misc/Makefile.inc | 32 + .../AtmelFiles/drivers/misc/bmp280.c | 1162 ++++++++++++ .../AtmelFiles/drivers/misc/bmp280.h | 444 +++++ .../AtmelFiles/drivers/misc/console.c | 372 ++++ .../AtmelFiles/drivers/misc/console.h | 74 + .../AtmelFiles/drivers/misc/led.c | 149 ++ .../AtmelFiles/drivers/misc/led.h | 68 + .../drivers/peripherals/Makefile.inc | 74 + .../AtmelFiles/drivers/peripherals/acc.c | 135 ++ .../AtmelFiles/drivers/peripherals/acc.h | 143 ++ .../AtmelFiles/drivers/peripherals/adc.c | 639 +++++++ .../AtmelFiles/drivers/peripherals/adc.h | 399 +++++ .../AtmelFiles/drivers/peripherals/aes.c | 201 +++ .../AtmelFiles/drivers/peripherals/aes.h | 155 ++ .../AtmelFiles/drivers/peripherals/aic.c | 429 +++++ .../AtmelFiles/drivers/peripherals/aic.h | 79 + .../AtmelFiles/drivers/peripherals/classd.c | 386 ++++ .../AtmelFiles/drivers/peripherals/classd.h | 125 ++ .../AtmelFiles/drivers/peripherals/flexcom.c | 82 + .../AtmelFiles/drivers/peripherals/flexcom.h | 75 + .../AtmelFiles/drivers/peripherals/gmac.c | 518 ++++++ .../AtmelFiles/drivers/peripherals/gmac.h | 361 ++++ .../AtmelFiles/drivers/peripherals/gmacd.c | 823 +++++++++ .../AtmelFiles/drivers/peripherals/gmacd.h | 189 ++ .../AtmelFiles/drivers/peripherals/hsmc.c | 250 +++ .../AtmelFiles/drivers/peripherals/hsmc.h | 139 ++ .../AtmelFiles/drivers/peripherals/isc.c | 694 ++++++++ .../AtmelFiles/drivers/peripherals/isc.h | 281 +++ .../AtmelFiles/drivers/peripherals/l2cc.c | 433 +++++ .../AtmelFiles/drivers/peripherals/l2cc.h | 347 ++++ .../AtmelFiles/drivers/peripherals/matrix.c | 100 ++ .../AtmelFiles/drivers/peripherals/matrix.h | 88 + .../AtmelFiles/drivers/peripherals/mcan.c | 749 ++++++++ .../AtmelFiles/drivers/peripherals/mcan.h | 439 +++++ .../AtmelFiles/drivers/peripherals/mpddrc.c | 359 ++++ .../AtmelFiles/drivers/peripherals/mpddrc.h | 57 + .../AtmelFiles/drivers/peripherals/pio.h | 205 +++ .../AtmelFiles/drivers/peripherals/pio4.c | 601 +++++++ .../AtmelFiles/drivers/peripherals/pio4.h | 164 ++ .../AtmelFiles/drivers/peripherals/pit.c | 128 ++ .../AtmelFiles/drivers/peripherals/pit.h | 121 ++ .../AtmelFiles/drivers/peripherals/pmc.c | 978 ++++++++++ .../AtmelFiles/drivers/peripherals/pmc.h | 466 +++++ .../AtmelFiles/drivers/peripherals/pmecc.c | 749 ++++++++ .../AtmelFiles/drivers/peripherals/pmecc.h | 66 + .../peripherals/pmecc_gallois_field_1024.h | 52 + .../peripherals/pmecc_gallois_field_512.h | 52 + .../AtmelFiles/drivers/peripherals/pwmc.c | 147 ++ .../AtmelFiles/drivers/peripherals/pwmc.h | 157 ++ .../AtmelFiles/drivers/peripherals/qspi.c | 233 +++ .../AtmelFiles/drivers/peripherals/qspi.h | 143 ++ .../AtmelFiles/drivers/peripherals/rstc.c | 131 ++ .../AtmelFiles/drivers/peripherals/rstc.h | 53 + .../AtmelFiles/drivers/peripherals/rtc.c | 554 ++++++ .../AtmelFiles/drivers/peripherals/rtc.h | 305 ++++ .../AtmelFiles/drivers/peripherals/sdmmc.c | 1414 +++++++++++++++ .../AtmelFiles/drivers/peripherals/sdmmc.h | 109 ++ .../AtmelFiles/drivers/peripherals/sfrbu.c | 56 + .../AtmelFiles/drivers/peripherals/sfrbu.h | 62 + .../AtmelFiles/drivers/peripherals/sha.c | 135 ++ .../AtmelFiles/drivers/peripherals/sha.h | 98 + .../AtmelFiles/drivers/peripherals/shdwc.c | 100 ++ .../AtmelFiles/drivers/peripherals/shdwc.h | 72 + .../AtmelFiles/drivers/peripherals/spi.c | 451 +++++ .../AtmelFiles/drivers/peripherals/spi.h | 214 +++ .../AtmelFiles/drivers/peripherals/spid.c | 368 ++++ .../AtmelFiles/drivers/peripherals/spid.h | 101 ++ .../AtmelFiles/drivers/peripherals/tc.c | 228 +++ .../AtmelFiles/drivers/peripherals/tc.h | 74 + .../AtmelFiles/drivers/peripherals/tdes.c | 164 ++ .../AtmelFiles/drivers/peripherals/tdes.h | 125 ++ .../AtmelFiles/drivers/peripherals/trng.c | 128 ++ .../AtmelFiles/drivers/peripherals/trng.h | 81 + .../AtmelFiles/drivers/peripherals/twi.c | 500 ++++++ .../AtmelFiles/drivers/peripherals/twi.h | 111 ++ .../AtmelFiles/drivers/peripherals/twid.c | 409 +++++ .../AtmelFiles/drivers/peripherals/twid.h | 95 + .../drivers/peripherals/twid_legacy.c | 675 +++++++ .../drivers/peripherals/twid_legacy.h | 128 ++ .../AtmelFiles/drivers/peripherals/uart.c | 135 ++ .../AtmelFiles/drivers/peripherals/uart.h | 70 + .../AtmelFiles/drivers/peripherals/usart.c | 825 +++++++++ .../AtmelFiles/drivers/peripherals/usart.h | 137 ++ .../drivers/peripherals/usart_iso7816_4.c | 620 +++++++ .../drivers/peripherals/usart_iso7816_4.h | 131 ++ .../drivers/peripherals/usart_lin.c | 387 ++++ .../drivers/peripherals/usart_lin.h | 93 + .../AtmelFiles/drivers/peripherals/usartd.c | 303 ++++ .../AtmelFiles/drivers/peripherals/usartd.h | 77 + .../AtmelFiles/drivers/peripherals/wdt.c | 121 ++ .../AtmelFiles/drivers/peripherals/wdt.h | 101 ++ .../AtmelFiles/drivers/peripherals/xdmac.c | 365 ++++ .../AtmelFiles/drivers/peripherals/xdmac.h | 440 +++++ .../AtmelFiles/drivers/peripherals/xdmad.c | 420 +++++ .../AtmelFiles/drivers/peripherals/xdmad.h | 260 +++ .../AtmelFiles/drivers/power/Makefile.inc | 30 + .../AtmelFiles/drivers/power/act8945a.c | 890 +++++++++ .../AtmelFiles/drivers/power/act8945a.h | 126 ++ .../AtmelFiles/target/Makefile.inc | 49 + .../AtmelFiles/target/sama5d2/Makefile.inc | 64 + .../AtmelFiles/target/sama5d2/board.h | 47 + .../target/sama5d2/board_lowlevel.c | 179 ++ .../target/sama5d2/board_lowlevel.h | 59 + .../target/sama5d2/board_memories.c | 371 ++++ .../target/sama5d2/board_memories.h | 72 + .../target/sama5d2/board_sama5d2-ptc-engi.h | 193 ++ .../target/sama5d2/board_sama5d2-vb-bga196.h | 185 ++ .../target/sama5d2/board_sama5d2-vb-bga289.h | 194 ++ .../sama5d2/board_sama5d2-xplained-proto.h | 325 ++++ .../target/sama5d2/board_sama5d2-xplained.h | 362 ++++ .../AtmelFiles/target/sama5d2/bootstrap.c | 38 + .../AtmelFiles/target/sama5d2/chip.c | 418 +++++ .../AtmelFiles/target/sama5d2/chip.h | 370 ++++ .../AtmelFiles/target/sama5d2/chip_pins.h | 1316 ++++++++++++++ .../target/sama5d2/component/component_acc.h | 127 ++ .../target/sama5d2/component/component_adc.h | 629 +++++++ .../target/sama5d2/component/component_aes.h | 236 +++ .../target/sama5d2/component/component_aesb.h | 150 ++ .../target/sama5d2/component/component_aic.h | 272 +++ .../sama5d2/component/component_aximx.h | 51 + .../sama5d2/component/component_chipid.h | 121 ++ .../sama5d2/component/component_classd.h | 158 ++ .../sama5d2/component/component_flexcom.h | 1075 +++++++++++ .../target/sama5d2/component/component_gmac.h | 1284 +++++++++++++ .../target/sama5d2/component/component_i2sc.h | 185 ++ .../target/sama5d2/component/component_icm.h | 226 +++ .../target/sama5d2/component/component_isc.h | 568 ++++++ .../target/sama5d2/component/component_l2cc.h | 354 ++++ .../target/sama5d2/component/component_lcdc.h | 1499 ++++++++++++++++ .../sama5d2/component/component_matrix.h | 1520 ++++++++++++++++ .../target/sama5d2/component/component_mcan.h | 961 ++++++++++ .../sama5d2/component/component_mpddrc.h | 855 +++++++++ .../sama5d2/component/component_pdmic.h | 125 ++ .../target/sama5d2/component/component_pio.h | 1161 ++++++++++++ .../target/sama5d2/component/component_pit.h | 70 + .../target/sama5d2/component/component_pmc.h | 577 ++++++ .../target/sama5d2/component/component_pwm.h | 651 +++++++ .../target/sama5d2/component/component_qspi.h | 224 +++ .../target/sama5d2/component/component_rstc.h | 76 + .../target/sama5d2/component/component_rtc.h | 290 +++ .../target/sama5d2/component/component_rxlp.h | 100 ++ .../target/sama5d2/component/component_sckc.h | 53 + .../sama5d2/component/component_sdmmc.h | 522 ++++++ .../target/sama5d2/component/component_sfc.h | 98 + .../target/sama5d2/component/component_sfr.h | 195 ++ .../sama5d2/component/component_sfrbu.h | 59 + .../target/sama5d2/component/component_sha.h | 147 ++ .../sama5d2/component/component_shdwc.h | 177 ++ .../target/sama5d2/component/component_smc.h | 743 ++++++++ .../target/sama5d2/component/component_spi.h | 262 +++ .../target/sama5d2/component/component_ssc.h | 287 +++ .../target/sama5d2/component/component_tc.h | 360 ++++ .../target/sama5d2/component/component_tdes.h | 175 ++ .../target/sama5d2/component/component_trng.h | 80 + .../sama5d2/component/component_twihs.h | 373 ++++ .../target/sama5d2/component/component_uart.h | 173 ++ .../sama5d2/component/component_udphs.h | 399 +++++ .../target/sama5d2/component/component_wdt.h | 74 + .../sama5d2/component/component_xdmac.h | 489 +++++ .../target/sama5d2/pio/pio_sama5d21.h | 816 +++++++++ .../target/sama5d2/pio/pio_sama5d22.h | 819 +++++++++ .../target/sama5d2/pio/pio_sama5d23.h | 819 +++++++++ .../target/sama5d2/pio/pio_sama5d24.h | 908 ++++++++++ .../target/sama5d2/pio/pio_sama5d26.h | 954 ++++++++++ .../target/sama5d2/pio/pio_sama5d27.h | 962 ++++++++++ .../target/sama5d2/pio/pio_sama5d28.h | 962 ++++++++++ .../AtmelFiles/target/sama5d2/sama5d21.h | 269 +++ .../AtmelFiles/target/sama5d2/sama5d22.h | 248 +++ .../AtmelFiles/target/sama5d2/sama5d23.h | 247 +++ .../AtmelFiles/target/sama5d2/sama5d24.h | 249 +++ .../AtmelFiles/target/sama5d2/sama5d26.h | 249 +++ .../AtmelFiles/target/sama5d2/sama5d27.h | 269 +++ .../AtmelFiles/target/sama5d2/sama5d28.h | 252 +++ .../target/sama5d2/toolchain/gnu/common.gdb | 102 ++ .../target/sama5d2/toolchain/gnu/cstartup.S | 291 +++ .../target/sama5d2/toolchain/gnu/ddram.gdb | 12 + .../target/sama5d2/toolchain/gnu/ddram.ld | 196 ++ .../target/sama5d2/toolchain/gnu/sram.gdb | 15 + .../target/sama5d2/toolchain/gnu/sram.ld | 194 ++ .../target/sama5d2/toolchain/iar/cstartup.s | 290 +++ .../target/sama5d2/toolchain/iar/ddram.icf | 65 + .../toolchain/iar/ddram_sama5d2-xplained.mac | 499 ++++++ .../target/sama5d2/toolchain/iar/sram.icf | 65 + .../target/sama5d2/toolchain/iar/sram.mac | 75 + .../AtmelFiles/utils/Makefile.inc | 54 + .../AtmelFiles/utils/README.utils.md | 0 .../AtmelFiles/utils/async.c | 54 + .../AtmelFiles/utils/async.h | 76 + .../AtmelFiles/utils/compiler.h | 68 + .../AtmelFiles/utils/crc.c | 92 + .../AtmelFiles/utils/crc.h | 41 + .../AtmelFiles/utils/dbg_util.c | 292 +++ .../AtmelFiles/utils/dbg_util.h | 64 + .../AtmelFiles/utils/font.c | 555 ++++++ .../AtmelFiles/utils/font.h | 71 + .../AtmelFiles/utils/hamming.c | 320 ++++ .../AtmelFiles/utils/hamming.h | 67 + .../AtmelFiles/utils/intmath.h | 97 + .../AtmelFiles/utils/io.h | 32 + .../AtmelFiles/utils/lcd_color.h | 197 ++ .../AtmelFiles/utils/lcd_draw.c | 828 +++++++++ .../AtmelFiles/utils/lcd_draw.h | 125 ++ .../AtmelFiles/utils/lcd_font.c | 204 +++ .../AtmelFiles/utils/lcd_font.h | 112 ++ .../AtmelFiles/utils/mutex.c | 35 + .../AtmelFiles/utils/mutex.h | 43 + .../AtmelFiles/utils/mutex_gcc.S | 52 + .../AtmelFiles/utils/mutex_iar.s | 59 + .../AtmelFiles/utils/rand.c | 68 + .../AtmelFiles/utils/rand.h | 50 + .../AtmelFiles/utils/ring.h | 81 + .../AtmelFiles/utils/syscalls.c | 159 ++ .../AtmelFiles/utils/timer.c | 141 ++ .../AtmelFiles/utils/timer.h | 121 ++ .../AtmelFiles/utils/trace.c | 46 + .../AtmelFiles/utils/trace.h | 158 ++ .../AtmelFiles/utils/wav.c | 107 ++ .../AtmelFiles/utils/wav.h | 82 + .../FreeRTOSConfig.h | 204 +++ .../FreeRTOS_tick_config.c | 139 ++ .../Full_Demo/IntQueueTimer.c | 208 +++ .../Full_Demo/IntQueueTimer.h | 78 + .../Full_Demo/main_full.c | 517 ++++++ .../Full_Demo/reg_test.S | 468 +++++ .../CORTEX_A5_SAMA5D2x_Xplained_IAR/LEDs.c | 117 ++ .../RTOSDemo.ewd | 1585 +++++++++++++++++ .../RTOSDemo.ewp | 1505 ++++++++++++++++ .../RTOSDemo.eww | 10 + .../blinky_demo/main_blinky.c | 249 +++ .../cstartup_with_FreeRTOS_vectors.s | 159 ++ .../CORTEX_A5_SAMA5D2x_Xplained_IAR/main.c | 321 ++++ .../settings/RTOSDemo.crun | 16 + .../settings/RTOSDemo.dbgdt | 71 + .../settings/RTOSDemo.ddram.cspy.bat | 24 + .../settings/RTOSDemo.dni | 101 ++ .../settings/RTOSDemo.sram.cspy.bat | 40 + .../settings/RTOSDemo.sram.driver.xcl | 35 + .../settings/RTOSDemo.sram.general.xcl | 15 + .../settings/RTOSDemo.wsdt | 78 + .../settings/RTOSDemo.wspos | 2 + .../settings/RTOSDemo_sram.jlink | 34 + 261 files changed, 75876 insertions(+) create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/ChangeLog.md create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/README.md create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA196.bsdl create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA256.bsdl create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA289.bsdl create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_gcc.S create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_iar.s create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_gcc.S create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_iar.s create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/console.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/console.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_1024.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_512.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-ptc-engi.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga196.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga289.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained-proto.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/bootstrap.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip_pins.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_acc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_adc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aes.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aesb.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aic.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aximx.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_chipid.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_classd.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_flexcom.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_gmac.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_i2sc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_icm.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_isc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_l2cc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_lcdc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_matrix.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mcan.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mpddrc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pdmic.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pio.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pit.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pmc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pwm.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_qspi.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rstc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rtc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rxlp.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sckc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sdmmc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfr.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfrbu.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sha.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_shdwc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_smc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_spi.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_ssc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tdes.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_trng.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_twihs.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_uart.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_udphs.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_wdt.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_xdmac.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d21.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d22.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d23.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d24.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d26.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d27.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d28.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d21.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d22.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d23.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d24.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d26.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d27.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d28.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/common.gdb create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/cstartup.S create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.gdb create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.ld create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.gdb create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.ld create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/cstartup.s create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram.icf create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram_sama5d2-xplained.mac create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.icf create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.mac create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/Makefile.inc create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/README.utils.md create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/compiler.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/intmath.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/io.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_color.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_gcc.S create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_iar.s create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/ring.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/syscalls.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOS_tick_config.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.h create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/main_full.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/reg_test.S create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/LEDs.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewd create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewp create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.eww create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/blinky_demo/main_blinky.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/cstartup_with_FreeRTOS_vectors.s create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/main.c create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.crun create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dbgdt create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.ddram.cspy.bat create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dni create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.cspy.bat create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.driver.xcl create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.general.xcl create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wsdt create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wspos create mode 100644 FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo_sram.jlink diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/ChangeLog.md b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/ChangeLog.md new file mode 100644 index 000000000..d1c52a0a5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/ChangeLog.md @@ -0,0 +1,94 @@ +# Atmel SAMA5D2x Software Package + + +## Version 1.2 - 2015-12 + +### New drivers/examples + +- USB Device examples and stack: CDC Serial, HID Keyboard, HID Mouse, Audio, + Mass Storage and some composite examples. +- NAND flash driver and examples: supports MLC/SLC, up to 32-bit ECC. +- SDMMC/eMMC driver and example +- Low Power examples: power_consumption_pll, pmc_clock_switching, + low_power_mode +- New storagemedia library to abstract storage devices (only supports RAM disk + for now, but will support SDMMC/eMMC and NAND flash in later releases) + +### Enhancements + +- Several new functions in PMC driver, notably 'pmc_set_custom_pck_mck' that + allow changing easily the main clock settings. +- IAR project generator now uses defines and include directories from + CFLAGS_DEFS and CFLAGS_INC mkefile variables. It also generates projects with + CMSIS-DAP debugger selected and proper optimization level. + +### Fixes + +- Fix CP15 driver to invalidate caches before enable. This fixes some lock-ups + when caches were previously enabled and still contain stale data. + + + +## Version 1.1 - 2015-10 + +### New drivers + +- Class-D audio driver + example + +### Enhancements + +- Support for ISO7816 and LIN modes to UART driver + example +- Several functions added to PMC driver, mostly UPLL and AudioPLL support +- ISC/sensors: support for new capture modes / resolutions + +### Fixes + +- Several fixes to ADC driver and example +- Fixed MMU setup (some memory regions where not defined) + + + +## Version 1.0 - 2015-09 + +### New drivers + +- MCAN driver + example + +### Changes + +- sama5d2-xplained target adapted for final revA board + +### Enhancements + +- Clock initialization changed to be more reliable +- PMC driver now supports setting generated clocks on sama5d2 +- Add support for new memory models to at25 driver (MX25L12835F, MX25L4005, + N25Q032, S25FL127S) + + + +## Version 0.3 -- 2015-08 + +### New drivers + +- ACC driver +- ADC driver + example +- AES / TDES / SHA drivers + examples +- L2CC driver +- GMAC driver + examples (using ad-hoc / LWIP / UIP stacks) +- QT1070 driver +- SHDWC driver + +### Enhancements + +- FPU is now enabled in GCC startup (was already enabled for IAR) +- ISC example now demonstrates Auto White Balance / Auto Exposure +- SPID/TWID/USARTD drivers now switch the Flexcom mode when appropriate +- MMU is now has a non-cacheable DDR region (used by LCD and GMAC examples) + +### Fixes + +- RAM timings / configuration adjusted for sama5d2-xplained target +- Component headers in target/sama5d2/components updated to reflect latest + datasheet updates +- PIO and TRNG callbacks now have a configurable user-defined argument diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/README.md b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/README.md new file mode 100644 index 000000000..1c7dec4c7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/README.md @@ -0,0 +1,166 @@ +Copyright (c) 2015, Atmel Corporation 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 disclaimer below. +* +* Atmel's name may not be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +* DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + + +# Atmel SAMA5D2x Software Package + +## Overview + +This softpack comes as an early delivery and all presented APIs are subject to change. + +Each software module is provided with full source code, example of usage, and ready-to-use projects. + +### Supported Platforms + +Windows and Linux with the gnu GCC ARM Embedded toolchain. It is downloadable at this address: https://launchpad.net/gcc-arm-embedded (Mac OS X should also work but as not been tested yet). +Dependencies: +- GNU make (from MinGW, Cygwin or GnuWin32 for Windows architectures) +- bash (from MinGW, Cygwin for Windows architectures) + +Windows with IAR Embedded Workbench. +Dependencies: +- IAR Embedded Workbench (Tested on version 7.40) +- bash (from MinGW, Cygwin or GnuWin32) for IAR project generation +- GNU make (from MinGW, Cygwin or GnuWin32) for IAR project generation +- mktemp (from MinGW, Cygwin or GnuWin32) for IAR project generation + +Notice: This softpack comes as an early delivery and all presented APIs are subject to change. + +## Contents + +### Directory Architecture + +- target/sama5d2 + All chip and board specific source files + +- target/sama5d2/toolchain/ + Linker and debugger scripts + +- scripts/ + generators and build script templates (Makefiles) + +- drivers/ + Driver source files + +- examples/ + All examples + +### Examples + +This release contains the following examples: + +adc: Example using ADC + +can: Example using CAN + +crypto_aes: AES hardware computation (with and without DMA) + +crypto_sha: SHA hardware computation (with and without DMA) + +crypto_tdes: Triple-DES hardware computation (with and without DMA) + +fifo: Test Flexcom USART FIFO + +gettting-started: LED blink (uses PIT and PIO) + +gmac: GMAC example using a simple IP stack + +gmac_lwip: GMAC example using LWIP stack + +gmac_uip_helloworld: GMAC example using UIP stack (UIP helloworld example) + +gmac_uip_telnetd: GMAC example using UIP stack (UIP telnetd example) + +gmac_uip_webserver: GMAC example using UIP stack (UIP webserver example) + +isc: Example using ISC controller (OV7740 sensor) + +lcd: Example using LCD controller + +qspi_flash: Read/Write/Delete commands to a QSPI serial flash + +rtc: RTC Example + +spi_serialflash: Read/Write/Delete commands to an SPI serial flash + +trng: Example using hardware RNG (interrupt mode) + +twi_eeprom: Read/Write/Delete commands to an Two-Wire EEPROM + +wdt: Example using watchdog timer + +xdma: Memory-to-memory DMA transfert example + +xdma_usart: Bidirectionnal Usart-memory DMA transfert example + +## Usage (GCC ARM Embedded) + +### Environment Variable + +TARGET: Name of the wanted target (sama5d2-xplained for samad52 XPLAINED ULTRA boards). This variable is mandatory to launch any build. + +DEBUG: Build with debug flags (default). + +TRACE_LEVEL: The wanted log level, 5 correspond to full, 0 to none (default to 5) + +RELEASE: Build with the release flags + +only TARGET must be provided or set at each make invocation. + +### Build + +Run: + +make +#or +make TARGET=wanted_target # if TARGET is not set + +### Run and Debug (with GDB) + +To run examples with gdb, first, JLinkGDBServer must be started. It can be downloaded for each platform at http://www.segger.com + +A make target is provided to launch the test with the correct gdb command arguments, run: + +make debug +#or +make TARGET=wanted_target debug # if TARGET is not set + +## Usage (IAR) + +The Win version of this softpack release comes with pregenerated IAR projects compatible with IAR Systems Embedded Workbench for ARM version 7.40. + +The C-SPY device description files and device selections files are not included and must be installed manually. + +### IAR Project generation + +An IAR project can be generated with GNU make, run in the example directory: + +make iar +#or +make TARGET=wanted_target iar # if TARGET is not set + +All needed IAR project files will be put in the example directory, including a default workspace one. + +Notice: +GNU make may fail on Windows platforms if the Makefile contains UNIX line endings. +You can use unix2dos on all Makefile files in scripts/ directory to fix this issue. diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA196.bsdl b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA196.bsdl new file mode 100644 index 000000000..e24e93c00 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA196.bsdl @@ -0,0 +1,803 @@ +-- ***************************************************************************** + +-- BSDL file for design top + +-- Created by Synopsys Version I-2013.12-SP3 (Apr 18, 2014) + +-- Designer: +-- Company: + +-- Date: Thu Feb 5 22:28:17 2015 + +-- ***************************************************************************** + + + entity top is + +-- This section identifies the default device package selected. + + generic (PHYSICAL_PIN_MAP: string:= "BGA196"); + +-- This section declares all the ports in the design. + + port ( + PD14 : in bit; + PD15 : in bit; + PD17 : in bit; + PD18 : in bit; + -- PA0 : linkage bit; -- NC Port + -- PA1 : linkage bit; -- NC Port + -- PA10 : linkage bit; -- NC Port + -- PA11 : linkage bit; -- NC Port + -- PA12 : linkage bit; -- NC Port + -- PA13 : linkage bit; -- NC Port + -- PA14 : linkage bit; -- NC Port + -- PA15 : linkage bit; -- NC Port + -- PA16 : linkage bit; -- NC Port + -- PA17 : linkage bit; -- NC Port + PA18 : inout bit; + PA19 : inout bit; + -- PA2 : linkage bit; -- NC Port + PA20 : inout bit; + PA21 : inout bit; + PA22 : inout bit; + PA23 : inout bit; + PA24 : inout bit; + PA25 : inout bit; + PA26 : inout bit; + PA27 : inout bit; + PA28 : inout bit; + PA29 : inout bit; + -- PA3 : linkage bit; -- NC Port + PA30 : inout bit; + PA31 : inout bit; + -- PA4 : linkage bit; -- NC Port + -- PA5 : linkage bit; -- NC Port + -- PA6 : linkage bit; -- NC Port + -- PA7 : linkage bit; -- NC Port + -- PA8 : linkage bit; -- NC Port + -- PA9 : linkage bit; -- NC Port + PB0 : inout bit; + PB1 : inout bit; + PB10 : inout bit; + PB11 : inout bit; + PB12 : inout bit; + PB13 : inout bit; + PB14 : inout bit; + PB15 : inout bit; + PB16 : inout bit; + PB17 : inout bit; + PB18 : inout bit; + PB19 : inout bit; + PB2 : inout bit; + PB20 : inout bit; + PB21 : inout bit; + PB22 : inout bit; + PB23 : inout bit; + PB24 : inout bit; + PB25 : inout bit; + PB26 : inout bit; + PB27 : inout bit; + PB28 : inout bit; + PB29 : inout bit; + PB3 : inout bit; + PB30 : inout bit; + PB31 : inout bit; + PB4 : inout bit; + PB5 : inout bit; + PB6 : inout bit; + PB7 : inout bit; + PB8 : inout bit; + PB9 : inout bit; + PC0 : inout bit; + PC1 : inout bit; + -- PC10 : linkage bit; -- NC Port + -- PC11 : linkage bit; -- NC Port + -- PC12 : linkage bit; -- NC Port + -- PC13 : linkage bit; -- NC Port + -- PC14 : linkage bit; -- NC Port + -- PC15 : linkage bit; -- NC Port + -- PC16 : linkage bit; -- NC Port + -- PC17 : linkage bit; -- NC Port + -- PC18 : linkage bit; -- NC Port + -- PC19 : linkage bit; -- NC Port + PC2 : inout bit; + -- PC20 : linkage bit; -- NC Port + -- PC21 : linkage bit; -- NC Port + -- PC22 : linkage bit; -- NC Port + -- PC23 : linkage bit; -- NC Port + -- PC24 : linkage bit; -- NC Port + -- PC25 : linkage bit; -- NC Port + -- PC26 : linkage bit; -- NC Port + -- PC27 : linkage bit; -- NC Port + -- PC28 : linkage bit; -- NC Port + -- PC29 : linkage bit; -- NC Port + PC3 : inout bit; + -- PC30 : linkage bit; -- NC Port + -- PC31 : linkage bit; -- NC Port + PC4 : inout bit; + PC5 : inout bit; + PC6 : inout bit; + PC7 : inout bit; + PC8 : inout bit; + -- PC9 : linkage bit; -- NC Port + -- PD0 : linkage bit; -- NC Port + -- PD1 : linkage bit; -- NC Port + PD10 : inout bit; + PD11 : inout bit; + PD12 : inout bit; + PD13 : inout bit; + PD19 : inout bit; + -- PD2 : linkage bit; -- NC Port + PD20 : inout bit; + PD21 : inout bit; + PD22 : inout bit; + PD23 : inout bit; + -- PD24 : linkage bit; -- NC Port + -- PD25 : linkage bit; -- NC Port + -- PD26 : linkage bit; -- NC Port + -- PD27 : linkage bit; -- NC Port + -- PD28 : linkage bit; -- NC Port + -- PD29 : linkage bit; -- NC Port + -- PD3 : linkage bit; -- NC Port + -- PD30 : linkage bit; -- NC Port + -- PD31 : linkage bit; -- NC Port + -- PD4 : linkage bit; -- NC Port + -- PD5 : linkage bit; -- NC Port + -- PD6 : linkage bit; -- NC Port + PD7 : inout bit; + PD8 : inout bit; + PD9 : inout bit; + DDR_D : inout bit_vector (0 to 15); + DDR_DQS : inout bit_vector (0 to 1); + DDR_DQSN : inout bit_vector (0 to 1); + DDR_CAS : out bit; + DDR_CKE : out bit; + DDR_CLK : out bit; + DDR_CLKN : out bit; + DDR_CS : out bit; + DDR_RAS : out bit; + DDR_RESETN : out bit; + DDR_WE : out bit; + PD16 : out bit; + DDR_A : out bit_vector (0 to 13); + DDR_BA : out bit_vector (0 to 2); + DDR_DQM : out bit_vector (0 to 1); + -- ADVREFN : linkage bit; + ADVREFP : linkage bit; + CLK_AUDIO : linkage bit; + COMPN : linkage bit; + COMPP : linkage bit; + DDR_CAL : linkage bit; + DDR_VREF : linkage bit; -- DDR_VREFB0 : linkage bit; + -- DDR_VREFB1 : linkage bit; + -- DDR_VREFB2 : linkage bit; + -- DDR_VREFB3 : linkage bit; + -- DDR_VREFCM : linkage bit; + HHSDMA : linkage bit; + HHSDMB : linkage bit; + -- HHSDMSTRC : linkage bit; -- NC Port + HHSDPA : linkage bit; + HHSDPB : linkage bit; + -- HHSDPDATC : linkage bit; -- NC Port + JTAGSEL : in bit; + NRST : linkage bit; + -- RXD : linkage bit; -- NC Port + -- SDCAL : linkage bit; -- NC Port + SHDN : linkage bit; + TST : in bit; + VBG : linkage bit; + WKUP : linkage bit; + XIN : linkage bit; + XIN32 : linkage bit; + XOUT : linkage bit; + XOUT32 : linkage bit; + -- tst_drst_ana : linkage bit; -- NC Port + -- tst_drst_ddr : linkage bit; -- NC Port + -- tst_drst_iop0 : linkage bit; -- NC Port + -- tst_drst_iop1 : linkage bit; -- NC Port + -- tst_drst_iop2 : linkage bit; -- NC Port + -- tst_drst_isi : linkage bit; -- NC Port + -- tst_drst_osc : linkage bit; -- NC Port + -- tst_drst_sdhc : linkage bit; -- NC Port + -- tst_lft_plla : linkage bit; -- NC Port + -- tst_lft_utmi : linkage bit; -- NC Port + -- tst_por_1v2 : linkage bit; -- NC Port + -- tst_por_1v8 : linkage bit; -- NC Port + -- tst_por_bu : linkage bit; -- NC Port + -- tst_psw_bu : linkage bit; -- NC Port + -- tst_psw_fuse : linkage bit; -- NC Port + PIOBU : linkage bit_vector (0 to 5) + ); + + use STD_1149_1_1994.all; + + attribute COMPONENT_CONFORMANCE of top: entity is "STD_1149_1_1993"; + + attribute PIN_MAP of top: entity is PHYSICAL_PIN_MAP; + +-- This section specifies the pin map for each port. This information is +-- extracted from the port-to-pin map file that was read in using the +-- "read_pin_map" command. + + constant BGA196: PIN_MAP_STRING := + "PD14 : G6," & + "PD15 : H5," & + "PD17 : G2," & + "PD18 : G3," & + "PA18 : L9," & + "PA19 : N9," & + "PA20 : M9," & + "PA21 : M10," & + "PA22 : P9," & + "PA23 : P10," & + "PA24 : N10," & + "PA25 : L10," & + "PA26 : P11," & + "PA27 : P12," & + "PA28 : M11," & + "PA29 : N11," & + "PA30 : N12," & + "PA31 : M12," & + "PB0 : A6," & + "PB1 : A5," & + "PB10 : A1," & + "PB11 : B1," & + "PB12 : B2," & + "PB13 : C1," & + "PB14 : D5," & + "PB15 : E5," & + "PB16 : C5," & + "PB17 : C2," & + "PB18 : D4," & + "PB19 : C4," & + "PB2 : B6," & + "PB20 : C3," & + "PB21 : D1," & + "PB22 : D2," & + "PB23 : E1," & + "PB24 : D3," & + "PB25 : E3," & + "PB26 : E2," & + "PB27 : E6," & + "PB28 : F1," & + "PB29 : F6," & + "PB3 : B5," & + "PB30 : F2," & + "PB31 : F7," & + "PB4 : A4," & + "PB5 : D6," & + "PB6 : A3," & + "PB7 : B4," & + "PB8 : A2," & + "PB9 : B3," & + "PC0 : M13," & + "PC1 : P13," & + "PC2 : N13," & + "PC3 : K10," & + "PC4 : P14," & + "PC5 : J8," & + "PC6 : N14," & + "PC7 : M14," & + "PC8 : J9," & + "PD10 : G4," & + "PD11 : H1," & + "PD12 : H6," & + "PD13 : H3," & + "PD19 : H4," & + "PD20 : J1," & + "PD21 : K1," & + "PD22 : J3," & + "PD23 : K2," & + "PD7 : F5," & + "PD8 : F3," & + "PD9 : G5," & + "DDR_D : (B7, A7, C8, B9, A9, C9, A10, B10, H13, H14, J13, J14, L13, L14, J12, K12)," & + "DDR_DQS : (B8, K14)," & + "DDR_DQSN : (A8, K13)," & + "DDR_CAS : C13," & + "DDR_CKE : E14," & + "DDR_CLK : A13," & + "DDR_CLKN : B13," & + "DDR_CS : F11," & + "DDR_DQM : (D8, G14)," & + "DDR_RAS : C14," & + "DDR_RESETN : D13," & + "DDR_WE : A14," & + "PD16 : G1," & + "DDR_A : (E11, C11, B12, A12, D11, D14, B14, D9, C10, D10, " & + "F9, A11, B11, E13)," & + "DDR_BA : (F13, G13, F14)," & + "ADVREFP : L2," & + "CLK_AUDIO : J7," & + "COMPN : P2," & + "COMPP : N2," & + "DDR_CAL : F10," & + "HHSDMA : P7," & + "HHSDMB : P8," & + "HHSDPA : N7," & + "HHSDPB : N8," & + "JTAGSEL : L4," & + "NRST : N3," & + "SHDN : N1," & + "TST : M2," & + "VBG : L7," & + "WKUP : P1," & + "XIN : P5," & + "XIN32 : M1," & + "XOUT : P6," & + "XOUT32 : L1," & + "PIOBU : (K5, L3, M3, N4, L5, M6)"; + +-- This section specifies the differential IO port groupings. + + attribute PORT_GROUPING of top: entity is + "Differential_Voltage ( " & + "(DDR_CLK,DDR_CLKN))"; + +-- This section specifies the TAP ports. For the TAP TCK port, the parameters in +-- the brackets are: +-- First Field : Maximum TCK frequency. +-- Second Field: Allowable states TCK may be stopped in. + + attribute TAP_SCAN_CLOCK of PD14: signal is (10.0e6, BOTH); + attribute TAP_SCAN_IN of PD15: signal is true; + attribute TAP_SCAN_MODE of PD17: signal is true; + attribute TAP_SCAN_OUT of PD16: signal is true; + attribute TAP_SCAN_RESET of PD18: signal is true; + +-- Specifies the compliance enable patterns for the design. It lists a set of +-- design ports and the values that they should be set to, in order to enable +-- compliance to IEEE Std 1149.1 + + attribute COMPLIANCE_PATTERNS of top: entity is + "(JTAGSEL, TST) (10)"; + +-- Specifies the number of bits in the instruction register. + + attribute INSTRUCTION_LENGTH of top: entity is 4; + +-- Specifies the boundary-scan instructions implemented in the design and their +-- opcodes. + + attribute INSTRUCTION_OPCODE of top: entity is + "BYPASS (1111, 0001, 0101, 0110, 1100, 0111, 1101, 1000, 1001, 1011, " & + "1110)," & + "EXTEST (0000)," & + "SAMPLE (0100)," & + "INTEST (0010)," & + "IDCODE (0011)," & + "RUNBIST (1010)"; + +-- Specifies the bit pattern that is loaded into the instruction register when +-- the TAP controller passes through the Capture-IR state. The standard mandates +-- that the two LSBs must be "01". The remaining bits are design specific. + + attribute INSTRUCTION_CAPTURE of top: entity is "0001"; + +-- Specifies the bit pattern that is loaded into the DEVICE_ID register during +-- the IDCODE instruction when the TAP controller passes through the Capture-DR +-- state. + + attribute IDCODE_REGISTER of top: entity is + "0000" & + -- 4-bit version number + "0101101100111111" & + -- 16-bit part number + "00000011111" & + -- 11-bit identity of the manufacturer + "1"; + -- Required by IEEE Std 1149.1 + +-- This section specifies the test data register placed between TDI and TDO for +-- each implemented instruction. + + attribute REGISTER_ACCESS of top: entity is + "BYPASS (BYPASS)," & + "BOUNDARY (EXTEST, SAMPLE, INTEST)," & + "DEVICE_ID (IDCODE)," & + "UTDR1[41] (RUNBIST)"; + +-- Specifies the length of the boundary scan register. + + attribute BOUNDARY_LENGTH of top: entity is 374; + +-- The following list specifies the characteristics of each cell in the boundary +-- scan register from TDI to TDO. The following is a description of the label +-- fields: +-- num : Is the cell number. +-- cell : Is the cell type as defined by the standard. +-- port : Is the design port name. Control cells do not have a port +-- name. +-- function: Is the function of the cell as defined by the standard. Is one +-- of input, output2, output3, bidir, control or controlr. +-- safe : Specifies the value that the BSR cell should be loaded with +-- for safe operation when the software might otherwise choose a +-- random value. +-- ccell : The control cell number. Specifies the control cell that +-- drives the output enable for this port. +-- disval : Specifies the value that is loaded into the control cell to +-- disable the output enable for the corresponding port. +-- rslt : Resulting state. Shows the state of the driver when it is +-- disabled. + + attribute BOUNDARY_REGISTER of top: entity is +-- +-- num cell port function safe [ccell disval rslt] +-- + "373 (BC_1, *, control, 1), " & + "372 (BC_7, PD13, bidir, X, 373, 1, Z), " & + "371 (BC_1, *, control, 1), " & + "370 (BC_7, PD12, bidir, X, 371, 1, Z), " & + "369 (BC_1, *, control, 1), " & + "368 (BC_7, PD11, bidir, X, 369, 1, Z), " & + "367 (BC_1, *, control, 1), " & + "366 (BC_7, PD19, bidir, X, 367, 1, Z), " & + "365 (BC_1, *, control, 1), " & + "364 (BC_7, PD20, bidir, X, 365, 1, Z), " & + "363 (BC_0, *, internal, X), " & + "362 (BC_0, *, internal, X), " & + "361 (BC_1, *, control, 1), " & + "360 (BC_7, PD21, bidir, X, 361, 1, Z), " & + "359 (BC_0, *, internal, X), " & + "358 (BC_0, *, internal, X), " & + "357 (BC_0, *, internal, X), " & + "356 (BC_0, *, internal, X), " & + "355 (BC_1, *, control, 1), " & + "354 (BC_7, PD22, bidir, X, 355, 1, Z), " & + "353 (BC_0, *, internal, X), " & + "352 (BC_0, *, internal, X), " & + "351 (BC_1, *, control, 1), " & + "350 (BC_7, PD23, bidir, X, 351, 1, Z), " & + "349 (BC_0, *, internal, X), " & + "348 (BC_0, *, internal, X), " & + "347 (BC_0, *, internal, X), " & + "346 (BC_0, *, internal, X), " & + "345 (BC_0, *, internal, X), " & + "344 (BC_0, *, internal, X), " & + "343 (BC_0, *, internal, X), " & + "342 (BC_0, *, internal, X), " & + "341 (BC_0, *, internal, X), " & + "340 (BC_0, *, internal, X), " & + "339 (BC_0, *, internal, X), " & + "338 (BC_0, *, internal, X), " & + "337 (BC_0, *, internal, X), " & + "336 (BC_0, *, internal, X), " & + "335 (BC_0, *, internal, X), " & + "334 (BC_0, *, internal, X), " & + "333 (BC_0, *, internal, X), " & + "332 (BC_0, *, internal, X), " & + "331 (BC_0, *, internal, X), " & + "330 (BC_0, *, internal, X), " & + "329 (BC_0, *, internal, X), " & + "328 (BC_0, *, internal, X), " & + "327 (BC_0, *, internal, X), " & + "326 (BC_0, *, internal, X), " & + "325 (BC_0, *, internal, X), " & + "324 (BC_0, *, internal, X), " & + "323 (BC_0, *, internal, X), " & + "322 (BC_0, *, internal, X), " & + "321 (BC_0, *, internal, X), " & + "320 (BC_0, *, internal, X), " & + "319 (BC_1, *, control, 1), " & + "318 (BC_7, PA18, bidir, X, 319, 1, Z), " & + "317 (BC_1, *, control, 1), " & + "316 (BC_7, PA20, bidir, X, 317, 1, Z), " & + "315 (BC_1, *, control, 1), " & + "314 (BC_7, PA19, bidir, X, 315, 1, Z), " & + "313 (BC_1, *, control, 1), " & + "312 (BC_7, PA21, bidir, X, 313, 1, Z), " & + "311 (BC_1, *, control, 1), " & + "310 (BC_7, PA22, bidir, X, 311, 1, Z), " & + "309 (BC_1, *, control, 1), " & + "308 (BC_7, PA23, bidir, X, 309, 1, Z), " & + "307 (BC_1, *, control, 1), " & + "306 (BC_7, PA24, bidir, X, 307, 1, Z), " & + "305 (BC_1, *, control, 1), " & + "304 (BC_7, PA25, bidir, X, 305, 1, Z), " & + "303 (BC_1, *, control, 1), " & + "302 (BC_7, PA26, bidir, X, 303, 1, Z), " & + "301 (BC_1, *, control, 1), " & + "300 (BC_7, PA27, bidir, X, 301, 1, Z), " & + "299 (BC_1, *, control, 1), " & + "298 (BC_7, PA28, bidir, X, 299, 1, Z), " & + "297 (BC_1, *, control, 1), " & + "296 (BC_7, PA30, bidir, X, 297, 1, Z), " & + "295 (BC_1, *, control, 1), " & + "294 (BC_7, PA29, bidir, X, 295, 1, Z), " & + "293 (BC_1, *, control, 1), " & + "292 (BC_7, PA31, bidir, X, 293, 1, Z), " & + "291 (BC_1, *, control, 1), " & + "290 (BC_7, PC0, bidir, X, 291, 1, Z), " & + "289 (BC_0, *, internal, X), " & + "288 (BC_0, *, internal, X), " & + "287 (BC_1, *, control, 1), " & + "286 (BC_7, PC1, bidir, X, 287, 1, Z), " & + "285 (BC_0, *, internal, X), " & + "284 (BC_0, *, internal, X), " & + "283 (BC_0, *, internal, X), " & + "282 (BC_0, *, internal, X), " & + "281 (BC_1, *, control, 1), " & + "280 (BC_7, PC2, bidir, X, 281, 1, Z), " & + "279 (BC_0, *, internal, X), " & + "278 (BC_0, *, internal, X), " & + "277 (BC_0, *, internal, X), " & + "276 (BC_0, *, internal, X), " & + "275 (BC_1, *, control, 1), " & + "274 (BC_7, PC3, bidir, X, 275, 1, Z), " & + "273 (BC_1, *, control, 1), " & + "272 (BC_7, PC4, bidir, X, 273, 1, Z), " & + "271 (BC_0, *, internal, X), " & + "270 (BC_0, *, internal, X), " & + "269 (BC_0, *, internal, X), " & + "268 (BC_0, *, internal, X), " & + "267 (BC_1, *, control, 1), " & + "266 (BC_7, PC5, bidir, X, 267, 1, Z), " & + "265 (BC_1, *, control, 1), " & + "264 (BC_7, PC7, bidir, X, 265, 1, Z), " & + "263 (BC_1, *, control, 1), " & + "262 (BC_7, PC6, bidir, X, 263, 1, Z), " & + "261 (BC_1, *, control, 1), " & + "260 (BC_7, PC8, bidir, X, 261, 1, Z), " & + "259 (BC_0, *, internal, X), " & + "258 (BC_0, *, internal, X), " & + "257 (BC_0, *, internal, X), " & + "256 (BC_0, *, internal, X), " & + "255 (BC_0, *, internal, X), " & + "254 (BC_0, *, internal, X), " & + "253 (BC_0, *, internal, X), " & + "252 (BC_0, *, internal, X), " & + "251 (BC_0, *, internal, X), " & + "250 (BC_0, *, internal, X), " & + "249 (BC_0, *, internal, X), " & + "248 (BC_0, *, internal, X), " & + "247 (BC_0, *, internal, X), " & + "246 (BC_0, *, internal, X), " & + "245 (BC_0, *, internal, X), " & + "244 (BC_0, *, internal, X), " & + "243 (BC_0, *, internal, X), " & + "242 (BC_0, *, internal, X), " & + "241 (BC_0, *, internal, X), " & + "240 (BC_0, *, internal, X), " & + "239 (BC_1, *, control, 1), " & + "238 (BC_7, DDR_D(15), bidir, X, 239, 1, Z), " & + "237 (BC_1, *, control, 1), " & + "236 (BC_7, DDR_D(14), bidir, X, 237, 1, Z), " & + "235 (BC_1, *, control, 1), " & + "234 (BC_7, DDR_D(13), bidir, X, 235, 1, Z), " & + "233 (BC_1, *, control, 1), " & + "232 (BC_7, DDR_D(12), bidir, X, 233, 1, Z), " & + "231 (BC_1, *, control, 1), " & + "230 (BC_7, DDR_DQS(1), bidir, X, 231, 1, Z), " & + "229 (BC_1, *, control, 1), " & + "228 (BC_7, DDR_D(11), bidir, X, 229, 1, Z), " & + "227 (BC_1, *, control, 1), " & + "226 (BC_7, DDR_D(10), bidir, X, 227, 1, Z), " & + "225 (BC_1, *, control, 1), " & + "224 (BC_7, DDR_D(9), bidir, X, 225, 1, Z), " & + "223 (BC_1, *, control, 1), " & + "222 (BC_7, DDR_D(8), bidir, X, 223, 1, Z), " & + "221 (BC_0, *, control, 1), " & + "220 (BC_0, DDR_DQM(1), output3, X, 221, 1, Z), " & + "219 (BC_0, *, control, 1), " & + "218 (BC_0, DDR_BA(2), output3, X, 219, 1, Z), " & + "217 (BC_0, *, control, 1), " & + "216 (BC_0, DDR_BA(1), output3, X, 217, 1, Z), " & + "215 (BC_0, *, control, 1), " & + "214 (BC_0, DDR_BA(0), output3, X, 215, 1, Z), " & + "213 (BC_0, *, control, 1), " & + "212 (BC_0, DDR_CKE, output3, X, 213, 1, Z), " & + "211 (BC_0, *, control, 1), " & + "210 (BC_0, DDR_CS, output3, X, 211, 1, Z), " & + "209 (BC_0, *, control, 1), " & + "208 (BC_0, DDR_A(13), output3, X, 209, 1, Z), " & + "207 (BC_0, *, control, 1), " & + "206 (BC_0, DDR_RESETN, output3, X, 207, 1, Z), " & + "205 (BC_0, *, control, 1), " & + "204 (BC_0, DDR_A(5), output3, X, 205, 1, Z), " & + "203 (BC_0, *, control, 1), " & + "202 (BC_0, DDR_A(6), output3, X, 203, 1, Z), " & + "201 (BC_0, *, control, 1), " & + "200 (BC_0, DDR_RAS, output3, X, 201, 1, Z), " & + "199 (BC_0, *, control, 1), " & + "198 (BC_0, DDR_CAS, output3, X, 199, 1, Z), " & + "197 (BC_0, *, control, 1), " & + "196 (BC_0, DDR_WE, output3, X, 197, 1, Z), " & + "195 (BC_0, *, control, 1), " & + "194 (BC_0, DDR_CLK, output3, X, 195, 1, Z), " & + "193 (BC_0, *, control, 1), " & + "192 (BC_0, DDR_A(0), output3, X, 193, 1, Z), " & + "191 (BC_0, *, control, 1), " & + "190 (BC_0, DDR_A(1), output3, X, 191, 1, Z), " & + "189 (BC_0, *, control, 1), " & + "188 (BC_0, DDR_A(2), output3, X, 189, 1, Z), " & + "187 (BC_0, *, control, 1), " & + "186 (BC_0, DDR_A(3), output3, X, 187, 1, Z), " & + "185 (BC_0, *, control, 1), " & + "184 (BC_0, DDR_A(4), output3, X, 185, 1, Z), " & + "183 (BC_0, *, control, 1), " & + "182 (BC_0, DDR_A(12), output3, X, 183, 1, Z), " & + "181 (BC_0, *, control, 1), " & + "180 (BC_0, DDR_A(11), output3, X, 181, 1, Z), " & + "179 (BC_0, *, control, 1), " & + "178 (BC_0, DDR_A(10), output3, X, 179, 1, Z), " & + "177 (BC_0, *, control, 1), " & + "176 (BC_0, DDR_A(9), output3, X, 177, 1, Z), " & + "175 (BC_0, *, control, 1), " & + "174 (BC_0, DDR_A(8), output3, X, 175, 1, Z), " & + "173 (BC_0, *, control, 1), " & + "172 (BC_0, DDR_A(7), output3, X, 173, 1, Z), " & + "171 (BC_1, *, control, 1), " & + "170 (BC_7, DDR_D(7), bidir, X, 171, 1, Z), " & + "169 (BC_1, *, control, 1), " & + "168 (BC_7, DDR_D(6), bidir, X, 169, 1, Z), " & + "167 (BC_1, *, control, 1), " & + "166 (BC_7, DDR_D(5), bidir, X, 167, 1, Z), " & + "165 (BC_1, *, control, 1), " & + "164 (BC_7, DDR_D(4), bidir, X, 165, 1, Z), " & + "163 (BC_1, *, control, 1), " & + "162 (BC_7, DDR_DQS(0), bidir, X, 163, 1, Z), " & + "161 (BC_1, *, control, 1), " & + "160 (BC_7, DDR_D(3), bidir, X, 161, 1, Z), " & + "159 (BC_1, *, control, 1), " & + "158 (BC_7, DDR_D(2), bidir, X, 159, 1, Z), " & + "157 (BC_1, *, control, 1), " & + "156 (BC_7, DDR_D(1), bidir, X, 157, 1, Z), " & + "155 (BC_1, *, control, 1), " & + "154 (BC_7, DDR_D(0), bidir, X, 155, 1, Z), " & + "153 (BC_0, *, control, 1), " & + "152 (BC_0, DDR_DQM(0), output3, X, 153, 1, Z), " & + "151 (BC_0, *, internal, X), " & + "150 (BC_0, *, internal, X), " & + "149 (BC_0, *, internal, X), " & + "148 (BC_0, *, internal, X), " & + "147 (BC_0, *, internal, X), " & + "146 (BC_0, *, internal, X), " & + "145 (BC_0, *, internal, X), " & + "144 (BC_0, *, internal, X), " & + "143 (BC_0, *, internal, X), " & + "142 (BC_0, *, internal, X), " & + "141 (BC_0, *, internal, X), " & + "140 (BC_0, *, internal, X), " & + "139 (BC_0, *, internal, X), " & + "138 (BC_0, *, internal, X), " & + "137 (BC_0, *, internal, X), " & + "136 (BC_0, *, internal, X), " & + "135 (BC_0, *, internal, X), " & + "134 (BC_0, *, internal, X), " & + "133 (BC_0, *, internal, X), " & + "132 (BC_0, *, internal, X), " & + "131 (BC_0, *, internal, X), " & + "130 (BC_0, *, internal, X), " & + "129 (BC_0, *, internal, X), " & + "128 (BC_0, *, internal, X), " & + "127 (BC_0, *, internal, X), " & + "126 (BC_0, *, internal, X), " & + "125 (BC_0, *, internal, X), " & + "124 (BC_0, *, internal, X), " & + "123 (BC_0, *, internal, X), " & + "122 (BC_0, *, internal, X), " & + "121 (BC_0, *, internal, X), " & + "120 (BC_0, *, internal, X), " & + "119 (BC_0, *, internal, X), " & + "118 (BC_0, *, internal, X), " & + "117 (BC_0, *, internal, X), " & + "116 (BC_0, *, internal, X), " & + "115 (BC_0, *, internal, X), " & + "114 (BC_0, *, internal, X), " & + "113 (BC_1, *, control, 1), " & + "112 (BC_7, PB0, bidir, X, 113, 1, Z), " & + "111 (BC_1, *, control, 1), " & + "110 (BC_7, PB2, bidir, X, 111, 1, Z), " & + "109 (BC_1, *, control, 1), " & + "108 (BC_7, PB1, bidir, X, 109, 1, Z), " & + "107 (BC_1, *, control, 1), " & + "106 (BC_7, PB3, bidir, X, 107, 1, Z), " & + "105 (BC_1, *, control, 1), " & + "104 (BC_7, PB4, bidir, X, 105, 1, Z), " & + "103 (BC_1, *, control, 1), " & + "102 (BC_7, PB5, bidir, X, 103, 1, Z), " & + "101 (BC_1, *, control, 1), " & + "100 (BC_7, PB6, bidir, X, 101, 1, Z), " & + "99 (BC_1, *, control, 1), " & + "98 (BC_7, PB8, bidir, X, 99, 1, Z), " & + "97 (BC_1, *, control, 1), " & + "96 (BC_7, PB7, bidir, X, 97, 1, Z), " & + "95 (BC_1, *, control, 1), " & + "94 (BC_7, PB10, bidir, X, 95, 1, Z), " & + "93 (BC_1, *, control, 1), " & + "92 (BC_7, PB9, bidir, X, 93, 1, Z), " & + "91 (BC_1, *, control, 1), " & + "90 (BC_7, PB11, bidir, X, 91, 1, Z), " & + "89 (BC_1, *, control, 1), " & + "88 (BC_7, PB12, bidir, X, 89, 1, Z), " & + "87 (BC_1, *, control, 1), " & + "86 (BC_7, PB14, bidir, X, 87, 1, Z), " & + "85 (BC_1, *, control, 1), " & + "84 (BC_7, PB13, bidir, X, 85, 1, Z), " & + "83 (BC_1, *, control, 1), " & + "82 (BC_7, PB15, bidir, X, 83, 1, Z), " & + "81 (BC_1, *, control, 1), " & + "80 (BC_7, PB16, bidir, X, 81, 1, Z), " & + "79 (BC_1, *, control, 1), " & + "78 (BC_7, PB17, bidir, X, 79, 1, Z), " & + "77 (BC_1, *, control, 1), " & + "76 (BC_7, PB19, bidir, X, 77, 1, Z), " & + "75 (BC_1, *, control, 1), " & + "74 (BC_7, PB18, bidir, X, 75, 1, Z), " & + "73 (BC_1, *, control, 1), " & + "72 (BC_7, PB20, bidir, X, 73, 1, Z), " & + "71 (BC_1, *, control, 1), " & + "70 (BC_7, PB21, bidir, X, 71, 1, Z), " & + "69 (BC_1, *, control, 1), " & + "68 (BC_7, PB23, bidir, X, 69, 1, Z), " & + "67 (BC_1, *, control, 1), " & + "66 (BC_7, PB22, bidir, X, 67, 1, Z), " & + "65 (BC_1, *, control, 1), " & + "64 (BC_7, PB25, bidir, X, 65, 1, Z), " & + "63 (BC_1, *, control, 1), " & + "62 (BC_7, PB24, bidir, X, 63, 1, Z), " & + "61 (BC_1, *, control, 1), " & + "60 (BC_7, PB26, bidir, X, 61, 1, Z), " & + "59 (BC_1, *, control, 1), " & + "58 (BC_7, PB28, bidir, X, 59, 1, Z), " & + "57 (BC_1, *, control, 1), " & + "56 (BC_7, PB27, bidir, X, 57, 1, Z), " & + "55 (BC_1, *, control, 1), " & + "54 (BC_7, PB30, bidir, X, 55, 1, Z), " & + "53 (BC_1, *, control, 1), " & + "52 (BC_7, PB29, bidir, X, 53, 1, Z), " & + "51 (BC_1, *, control, 1), " & + "50 (BC_7, PB31, bidir, X, 51, 1, Z), " & + "49 (BC_0, *, internal, X), " & + "48 (BC_0, *, internal, X), " & + "47 (BC_0, *, internal, X), " & + "46 (BC_0, *, internal, X), " & + "45 (BC_0, *, internal, X), " & + "44 (BC_0, *, internal, X), " & + "43 (BC_0, *, internal, X), " & + "42 (BC_0, *, internal, X), " & + "41 (BC_0, *, internal, X), " & + "40 (BC_0, *, internal, X), " & + "39 (BC_0, *, internal, X), " & + "38 (BC_0, *, internal, X), " & + "37 (BC_0, *, internal, X), " & + "36 (BC_0, *, internal, X), " & + "35 (BC_0, *, internal, X), " & + "34 (BC_0, *, internal, X), " & + "33 (BC_0, *, internal, X), " & + "32 (BC_0, *, internal, X), " & + "31 (BC_0, *, internal, X), " & + "30 (BC_0, *, internal, X), " & + "29 (BC_0, *, internal, X), " & + "28 (BC_0, *, internal, X), " & + "27 (BC_0, *, internal, X), " & + "26 (BC_0, *, internal, X), " & + "25 (BC_0, *, internal, X), " & + "24 (BC_0, *, internal, X), " & + "23 (BC_0, *, internal, X), " & + "22 (BC_0, *, internal, X), " & + "21 (BC_0, *, internal, X), " & + "20 (BC_0, *, internal, X), " & + "19 (BC_0, *, internal, X), " & + "18 (BC_0, *, internal, X), " & + "17 (BC_0, *, internal, X), " & + "16 (BC_0, *, internal, X), " & + "15 (BC_1, *, control, 1), " & + "14 (BC_7, PD10, bidir, X, 15, 1, Z), " & + "13 (BC_1, *, control, 1), " & + "12 (BC_7, PD9, bidir, X, 13, 1, Z), " & + "11 (BC_1, *, control, 1), " & + "10 (BC_7, PD8, bidir, X, 11, 1, Z), " & + "9 (BC_1, *, control, 1), " & + "8 (BC_7, PD7, bidir, X, 9, 1, Z), " & + "7 (BC_0, *, internal, X), " & + "6 (BC_0, *, internal, X), " & + "5 (BC_0, *, internal, X), " & + "4 (BC_0, *, internal, X), " & + "3 (BC_0, *, internal, X), " & + "2 (BC_0, *, internal, X), " & + "1 (BC_0, *, internal, X), " & + "0 (BC_0, *, internal, X) "; + + end top; diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA256.bsdl b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA256.bsdl new file mode 100644 index 000000000..ed789b839 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA256.bsdl @@ -0,0 +1,842 @@ +-- ***************************************************************************** + +-- BSDL file for design top + +-- Created by Synopsys Version I-2013.12-SP3 (Apr 18, 2014) + +-- Designer: +-- Company: + +-- Date: Thu Feb 5 22:56:11 2015 + +-- ***************************************************************************** + + + entity top is + +-- This section identifies the default device package selected. + + generic (PHYSICAL_PIN_MAP: string:= "BGA256"); + +-- This section declares all the ports in the design. + + port ( + PD14 : in bit; + PD15 : in bit; + PD17 : in bit; + PD18 : in bit; + PA0 : inout bit; + PA1 : inout bit; + PA10 : inout bit; + PA11 : inout bit; + PA12 : inout bit; + PA13 : inout bit; + PA14 : inout bit; + PA15 : inout bit; + PA16 : inout bit; + PA17 : inout bit; + PA18 : inout bit; + PA19 : inout bit; + PA2 : inout bit; + PA20 : inout bit; + PA21 : inout bit; + PA22 : inout bit; + PA23 : inout bit; + PA24 : inout bit; + PA25 : inout bit; + PA26 : inout bit; + PA27 : inout bit; + PA28 : inout bit; + PA29 : inout bit; + PA3 : inout bit; + PA30 : inout bit; + PA31 : inout bit; + PA4 : inout bit; + PA5 : inout bit; + PA6 : inout bit; + PA7 : inout bit; + PA8 : inout bit; + PA9 : inout bit; + PB0 : inout bit; + PB1 : inout bit; + PB10 : inout bit; + PB11 : inout bit; + PB12 : inout bit; + PB13 : inout bit; + PB14 : inout bit; + PB15 : inout bit; + PB16 : inout bit; + PB17 : inout bit; + PB18 : inout bit; + PB19 : inout bit; + PB2 : inout bit; + PB20 : inout bit; + PB21 : inout bit; + PB22 : inout bit; + PB23 : inout bit; + PB24 : inout bit; + PB25 : inout bit; + PB26 : inout bit; + PB27 : inout bit; + PB28 : inout bit; + PB29 : inout bit; + PB3 : inout bit; + PB30 : inout bit; + PB31 : inout bit; + PB4 : inout bit; + PB5 : inout bit; + PB6 : inout bit; + PB7 : inout bit; + PB8 : inout bit; + PB9 : inout bit; + PC0 : inout bit; + PC1 : inout bit; + -- PC10 : linkage bit; -- NC(No Connect) Port + -- PC11 : linkage bit; -- NC Port + -- PC12 : linkage bit; -- NC Port + -- PC13 : linkage bit; -- NC Port + -- PC14 : linkage bit; -- NC Port + -- PC15 : linkage bit; -- NC Port + -- PC16 : linkage bit; -- NC Port + -- PC17 : linkage bit; -- NC Port + -- PC18 : linkage bit; -- NC Port + -- PC19 : linkage bit; -- NC Port + PC2 : inout bit; + -- PC20 : linkage bit; -- NC Port + -- PC21 : linkage bit; -- NC Port + -- PC22 : linkage bit; -- NC Port + -- PC23 : linkage bit; -- NC Port + -- PC24 : linkage bit; -- NC Port + -- PC25 : linkage bit; -- NC Port + -- PC26 : linkage bit; -- NC Port + -- PC27 : linkage bit; -- NC Port + -- PC28 : linkage bit; -- NC Port + -- PC29 : linkage bit; -- NC Port + PC3 : inout bit; + -- PC30 : linkage bit; -- NC Port + -- PC31 : linkage bit; -- NC Port + PC4 : inout bit; + PC5 : inout bit; + PC6 : inout bit; + PC7 : inout bit; + PC8 : inout bit; + -- PC9 : linkage bit; -- NC Port + PD0 : inout bit; + PD1 : inout bit; + PD10 : inout bit; + PD11 : inout bit; + PD12 : inout bit; + PD13 : inout bit; + PD19 : inout bit; + PD2 : inout bit; + PD20 : inout bit; + PD21 : inout bit; + PD22 : inout bit; + PD23 : inout bit; + PD24 : inout bit; + PD25 : inout bit; + PD26 : inout bit; + PD27 : inout bit; + PD28 : inout bit; + PD29 : inout bit; + PD3 : inout bit; + PD30 : inout bit; + PD31 : inout bit; + PD4 : inout bit; + PD5 : inout bit; + PD6 : inout bit; + PD7 : inout bit; + PD8 : inout bit; + PD9 : inout bit; + DDR_D : inout bit_vector (0 to 31); + DDR_DQS : inout bit_vector (0 to 3); + DDR_DQSN : inout bit_vector (0 to 3); + DDR_CAS : out bit; + DDR_CKE : out bit; + DDR_CLK : out bit; + DDR_CLKN : out bit; + DDR_CS : out bit; + DDR_RAS : out bit; + DDR_RESETN : out bit; + DDR_WE : out bit; + PD16 : out bit; + DDR_A : out bit_vector (0 to 13); + DDR_BA : out bit_vector (0 to 2); + DDR_DQM : out bit_vector (0 to 3); + -- ADVREFN : linkage bit; + ADVREFP : linkage bit; + CLK_AUDIO : linkage bit; + COMPN : linkage bit; + COMPP : linkage bit; + DDR_CAL : linkage bit; + DDR_VREF : linkage bit; -- DDR_VREFB0 : linkage bit; + -- DDR_VREFB1 : linkage bit; + -- DDR_VREFB2 : linkage bit; + -- DDR_VREFB3 : linkage bit; + -- DDR_VREFCM : linkage bit; + HHSDMA : linkage bit; + HHSDMB : linkage bit; + HHSDMSTRC : linkage bit; + HHSDPA : linkage bit; + HHSDPB : linkage bit; + HHSDPDATC : linkage bit; + JTAGSEL : in bit; + NRST : linkage bit; + RXD : linkage bit; + SDCAL : linkage bit; + SHDN : linkage bit; + TST : in bit; + VBG : linkage bit; + WKUP : linkage bit; + XIN : linkage bit; + XIN32 : linkage bit; + XOUT : linkage bit; + XOUT32 : linkage bit; + -- tst_drst_ana : linkage bit; -- NC Port + -- tst_drst_ddr : linkage bit; -- NC Port + -- tst_drst_iop0 : linkage bit; -- NC Port + -- tst_drst_iop1 : linkage bit; -- NC Port + -- tst_drst_iop2 : linkage bit; -- NC Port + -- tst_drst_isi : linkage bit; -- NC Port + -- tst_drst_osc : linkage bit; -- NC Port + -- tst_drst_sdhc : linkage bit; -- NC Port + -- tst_lft_plla : linkage bit; -- NC Port + -- tst_lft_utmi : linkage bit; -- NC Port + -- tst_por_1v2 : linkage bit; -- NC Port + -- tst_por_1v8 : linkage bit; -- NC Port + -- tst_por_bu : linkage bit; -- NC Port + -- tst_psw_bu : linkage bit; -- NC Port + -- tst_psw_fuse : linkage bit; -- NC Port + PIOBU : linkage bit_vector (0 to 1) + ); + + use STD_1149_1_1994.all; + + attribute COMPONENT_CONFORMANCE of top: entity is "STD_1149_1_1993"; + + attribute PIN_MAP of top: entity is PHYSICAL_PIN_MAP; + +-- This section specifies the pin map for each port. This information is +-- extracted from the port-to-pin map file that was read in using the +-- "read_pin_map" command. + + constant BGA256: PIN_MAP_STRING := + "PD14 : K6," & + "PD15 : K4," & + "PD17 : K2," & + "PD18 : L5," & + "PA0 : R10," & + "PA1 : R9," & + "PA10 : U13," & + "PA11 : R14," & + "PA12 : N13," & + "PA13 : P14," & + "PA14 : P17," & + "PA15 : R18," & + "PA16 : N15," & + "PA17 : P18," & + "PA18 : M9," & + "PA19 : V13," & + "PA2 : U11," & + "PA20 : L9," & + "PA21 : M10," & + "PA22 : V14," & + "PA23 : U14," & + "PA24 : R13," & + "PA25 : U15," & + "PA26 : L10," & + "PA27 : V17," & + "PA28 : U16," & + "PA29 : U17," & + "PA3 : P10," & + "PA30 : V18," & + "PA31 : U18," & + "PA4 : P11," & + "PA5 : V11," & + "PA6 : U12," & + "PA7 : V12," & + "PA8 : N11," & + "PA9 : P12," & + "PB0 : G9," & + "PB1 : A7," & + "PB10 : D6," & + "PB11 : A4," & + "PB12 : B3," & + "PB13 : A3," & + "PB14 : B4," & + "PB15 : G8," & + "PB16 : E5," & + "PB17 : G7," & + "PB18 : A2," & + "PB19 : H7," & + "PB2 : B7," & + "PB20 : A1," & + "PB21 : D2," & + "PB22 : G5," & + "PB23 : C2," & + "PB24 : F4," & + "PB25 : C1," & + "PB26 : E4," & + "PB27 : F1," & + "PB28 : D1," & + "PB29 : F2," & + "PB3 : B6," & + "PB30 : E2," & + "PB31 : E1," & + "PB4 : A6," & + "PB5 : D7," & + "PB6 : B5," & + "PB7 : A5," & + "PB8 : E7," & + "PB9 : F6," & + "PC0 : R15," & + "PC1 : M11," & + "PC2 : P15," & + "PC3 : K9," & + "PC4 : K10," & + "PC5 : L11," & + "PC6 : L12," & + "PC7 : M12," & + "PC8 : K11," & + "PD0 : E9," & + "PD1 : F8," & + "PD10 : G2," & + "PD11 : H2," & + "PD12 : K5," & + "PD13 : J5," & + "PD19 : L4," & + "PD2 : F9," & + "PD20 : M1," & + "PD21 : M2," & + "PD22 : M4," & + "PD23 : P1," & + "PD24 : L6," & + "PD25 : M5," & + "PD26 : N1," & + "PD27 : N2," & + "PD28 : P2," & + "PD29 : R1," & + "PD3 : J4," & + "PD30 : N4," & + "PD31 : T1," & + "PD4 : H6," & + "PD5 : H1," & + "PD6 : G4," & + "PD7 : H5," & + "PD8 : G1," & + "PD9 : H4," & + "DDR_D : (B12, B13, D13, A13, A15, D14, B15, B16, G18, K17, " & + "J13, H15, J15, J14, K13, K18, A8, B9, D9, A9, B11, D10, A11, A12, " & + "L18, K15, K14, M18, N17, M14, M15, N18)," & + "DDR_DQS : (A14, H18, A10, M17)," & + "DDR_DQSN : (B14, J18, B10, L17)," & + "DDR_CAS : E17," & + "DDR_CKE : F18," & + "DDR_CLK : C18," & + "DDR_CLKN : C17," & + "DDR_CS : J12," & + "DDR_RAS : E18," & + "DDR_RESETN : F17," & + "DDR_WE : D18," & + "PD16 : K1," & + "DDR_A : (D17, A17, A18, F15, G12, H12, F13, H10, A16, E12, " & + "H11, J10, D15, J11)," & + "DDR_BA : (H13, K12, H17)," & + "DDR_DQM : (D11, H14, B8, L13)," & + "ADVREFP : P5," & + "CLK_AUDIO : M8," & + "COMPN : V4," & + "COMPP : V3," & + "DDR_CAL : G17," & + "HHSDMA : V8," & + "HHSDMB : V9," & + "HHSDMSTRC : V10," & + "HHSDPA : U8," & + "HHSDPB : U9," & + "HHSDPDATC : U10," & + "JTAGSEL : V2," & + "NRST : V1," & + "RXD : U2," & + "SDCAL : N10," & + "SHDN : U1," & + "TST : P4," & + "VBG : R7," & + "WKUP : R5," & + "XIN : V7," & + "XIN32 : T2," & + "XOUT : V6," & + "XOUT32 : R2," & + "PIOBU : (R6, R4)"; + +-- This section specifies the differential IO port groupings. + + attribute PORT_GROUPING of top: entity is + "Differential_Voltage ( " & + "(DDR_CLK,DDR_CLKN))"; + +-- This section specifies the TAP ports. For the TAP TCK port, the parameters in +-- the brackets are: +-- First Field : Maximum TCK frequency. +-- Second Field: Allowable states TCK may be stopped in. + + attribute TAP_SCAN_CLOCK of PD14: signal is (10.0e6, BOTH); + attribute TAP_SCAN_IN of PD15: signal is true; + attribute TAP_SCAN_MODE of PD17: signal is true; + attribute TAP_SCAN_OUT of PD16: signal is true; + attribute TAP_SCAN_RESET of PD18: signal is true; + +-- Specifies the compliance enable patterns for the design. It lists a set of +-- design ports and the values that they should be set to, in order to enable +-- compliance to IEEE Std 1149.1 + + attribute COMPLIANCE_PATTERNS of top: entity is + "(JTAGSEL, TST) (10)"; + +-- Specifies the number of bits in the instruction register. + + attribute INSTRUCTION_LENGTH of top: entity is 4; + +-- Specifies the boundary-scan instructions implemented in the design and their +-- opcodes. + + attribute INSTRUCTION_OPCODE of top: entity is + "BYPASS (1111, 0001, 0101, 0110, 1100, 0111, 1101, 1000, 1001, 1011, " & + "1110)," & + "EXTEST (0000)," & + "SAMPLE (0100)," & + "INTEST (0010)," & + "IDCODE (0011)," & + "RUNBIST (1010)"; + +-- Specifies the bit pattern that is loaded into the instruction register when +-- the TAP controller passes through the Capture-IR state. The standard mandates +-- that the two LSBs must be "01". The remaining bits are design specific. + + attribute INSTRUCTION_CAPTURE of top: entity is "0001"; + +-- Specifies the bit pattern that is loaded into the DEVICE_ID register during +-- the IDCODE instruction when the TAP controller passes through the Capture-DR +-- state. + + attribute IDCODE_REGISTER of top: entity is + "0000" & + -- 4-bit version number + "0101101100111111" & + -- 16-bit part number + "00000011111" & + -- 11-bit identity of the manufacturer + "1"; + -- Required by IEEE Std 1149.1 + +-- This section specifies the test data register placed between TDI and TDO for +-- each implemented instruction. + + attribute REGISTER_ACCESS of top: entity is + "BYPASS (BYPASS)," & + "BOUNDARY (EXTEST, SAMPLE, INTEST)," & + "DEVICE_ID (IDCODE)," & + "UTDR1[41] (RUNBIST)"; + +-- Specifies the length of the boundary scan register. + + attribute BOUNDARY_LENGTH of top: entity is 374; + +-- The following list specifies the characteristics of each cell in the boundary +-- scan register from TDI to TDO. The following is a description of the label +-- fields: +-- num : Is the cell number. +-- cell : Is the cell type as defined by the standard. +-- port : Is the design port name. Control cells do not have a port +-- name. +-- function: Is the function of the cell as defined by the standard. Is one +-- of input, output2, output3, bidir, control or controlr. +-- safe : Specifies the value that the BSR cell should be loaded with +-- for safe operation when the software might otherwise choose a +-- random value. +-- ccell : The control cell number. Specifies the control cell that +-- drives the output enable for this port. +-- disval : Specifies the value that is loaded into the control cell to +-- disable the output enable for the corresponding port. +-- rslt : Resulting state. Shows the state of the driver when it is +-- disabled. + + attribute BOUNDARY_REGISTER of top: entity is +-- +-- num cell port function safe [ccell disval rslt] +-- + "373 (BC_1, *, control, 1), " & + "372 (BC_7, PD13, bidir, X, 373, 1, Z), " & + "371 (BC_1, *, control, 1), " & + "370 (BC_7, PD12, bidir, X, 371, 1, Z), " & + "369 (BC_1, *, control, 1), " & + "368 (BC_7, PD11, bidir, X, 369, 1, Z), " & + "367 (BC_1, *, control, 1), " & + "366 (BC_7, PD19, bidir, X, 367, 1, Z), " & + "365 (BC_1, *, control, 1), " & + "364 (BC_7, PD20, bidir, X, 365, 1, Z), " & + "363 (BC_1, *, control, 1), " & + "362 (BC_7, PD24, bidir, X, 363, 1, Z), " & + "361 (BC_1, *, control, 1), " & + "360 (BC_7, PD21, bidir, X, 361, 1, Z), " & + "359 (BC_1, *, control, 1), " & + "358 (BC_7, PD25, bidir, X, 359, 1, Z), " & + "357 (BC_1, *, control, 1), " & + "356 (BC_7, PD26, bidir, X, 357, 1, Z), " & + "355 (BC_1, *, control, 1), " & + "354 (BC_7, PD22, bidir, X, 355, 1, Z), " & + "353 (BC_1, *, control, 1), " & + "352 (BC_7, PD27, bidir, X, 353, 1, Z), " & + "351 (BC_1, *, control, 1), " & + "350 (BC_7, PD23, bidir, X, 351, 1, Z), " & + "349 (BC_1, *, control, 1), " & + "348 (BC_7, PD28, bidir, X, 349, 1, Z), " & + "347 (BC_1, *, control, 1), " & + "346 (BC_7, PD30, bidir, X, 347, 1, Z), " & + "345 (BC_1, *, control, 1), " & + "344 (BC_7, PD29, bidir, X, 345, 1, Z), " & + "343 (BC_1, *, control, 1), " & + "342 (BC_7, PD31, bidir, X, 343, 1, Z), " & + "341 (BC_1, *, control, 1), " & + "340 (BC_7, PA0, bidir, X, 341, 1, Z), " & + "339 (BC_1, *, control, 1), " & + "338 (BC_7, PA1, bidir, X, 339, 1, Z), " & + "337 (BC_1, *, control, 1), " & + "336 (BC_7, PA2, bidir, X, 337, 1, Z), " & + "335 (BC_1, *, control, 1), " & + "334 (BC_7, PA3, bidir, X, 335, 1, Z), " & + "333 (BC_1, *, control, 1), " & + "332 (BC_7, PA4, bidir, X, 333, 1, Z), " & + "331 (BC_1, *, control, 1), " & + "330 (BC_7, PA5, bidir, X, 331, 1, Z), " & + "329 (BC_1, *, control, 1), " & + "328 (BC_7, PA6, bidir, X, 329, 1, Z), " & + "327 (BC_1, *, control, 1), " & + "326 (BC_7, PA7, bidir, X, 327, 1, Z), " & + "325 (BC_1, *, control, 1), " & + "324 (BC_7, PA8, bidir, X, 325, 1, Z), " & + "323 (BC_1, *, control, 1), " & + "322 (BC_7, PA9, bidir, X, 323, 1, Z), " & + "321 (BC_1, *, control, 1), " & + "320 (BC_7, PA10, bidir, X, 321, 1, Z), " & + "319 (BC_1, *, control, 1), " & + "318 (BC_7, PA18, bidir, X, 319, 1, Z), " & + "317 (BC_1, *, control, 1), " & + "316 (BC_7, PA20, bidir, X, 317, 1, Z), " & + "315 (BC_1, *, control, 1), " & + "314 (BC_7, PA19, bidir, X, 315, 1, Z), " & + "313 (BC_1, *, control, 1), " & + "312 (BC_7, PA21, bidir, X, 313, 1, Z), " & + "311 (BC_1, *, control, 1), " & + "310 (BC_7, PA22, bidir, X, 311, 1, Z), " & + "309 (BC_1, *, control, 1), " & + "308 (BC_7, PA23, bidir, X, 309, 1, Z), " & + "307 (BC_1, *, control, 1), " & + "306 (BC_7, PA24, bidir, X, 307, 1, Z), " & + "305 (BC_1, *, control, 1), " & + "304 (BC_7, PA25, bidir, X, 305, 1, Z), " & + "303 (BC_1, *, control, 1), " & + "302 (BC_7, PA26, bidir, X, 303, 1, Z), " & + "301 (BC_1, *, control, 1), " & + "300 (BC_7, PA27, bidir, X, 301, 1, Z), " & + "299 (BC_1, *, control, 1), " & + "298 (BC_7, PA28, bidir, X, 299, 1, Z), " & + "297 (BC_1, *, control, 1), " & + "296 (BC_7, PA30, bidir, X, 297, 1, Z), " & + "295 (BC_1, *, control, 1), " & + "294 (BC_7, PA29, bidir, X, 295, 1, Z), " & + "293 (BC_1, *, control, 1), " & + "292 (BC_7, PA31, bidir, X, 293, 1, Z), " & + "291 (BC_1, *, control, 1), " & + "290 (BC_7, PC0, bidir, X, 291, 1, Z), " & + "289 (BC_1, *, control, 1), " & + "288 (BC_7, PA11, bidir, X, 289, 1, Z), " & + "287 (BC_1, *, control, 1), " & + "286 (BC_7, PC1, bidir, X, 287, 1, Z), " & + "285 (BC_1, *, control, 1), " & + "284 (BC_7, PA13, bidir, X, 285, 1, Z), " & + "283 (BC_1, *, control, 1), " & + "282 (BC_7, PA12, bidir, X, 283, 1, Z), " & + "281 (BC_1, *, control, 1), " & + "280 (BC_7, PC2, bidir, X, 281, 1, Z), " & + "279 (BC_1, *, control, 1), " & + "278 (BC_7, PA14, bidir, X, 279, 1, Z), " & + "277 (BC_1, *, control, 1), " & + "276 (BC_7, PA15, bidir, X, 277, 1, Z), " & + "275 (BC_1, *, control, 1), " & + "274 (BC_7, PC3, bidir, X, 275, 1, Z), " & + "273 (BC_1, *, control, 1), " & + "272 (BC_7, PC4, bidir, X, 273, 1, Z), " & + "271 (BC_1, *, control, 1), " & + "270 (BC_7, PA16, bidir, X, 271, 1, Z), " & + "269 (BC_1, *, control, 1), " & + "268 (BC_7, PA17, bidir, X, 269, 1, Z), " & + "267 (BC_1, *, control, 1), " & + "266 (BC_7, PC5, bidir, X, 267, 1, Z), " & + "265 (BC_1, *, control, 1), " & + "264 (BC_7, PC7, bidir, X, 265, 1, Z), " & + "263 (BC_1, *, control, 1), " & + "262 (BC_7, PC6, bidir, X, 263, 1, Z), " & + "261 (BC_1, *, control, 1), " & + "260 (BC_7, PC8, bidir, X, 261, 1, Z), " & + "259 (BC_1, *, control, 1), " & + "258 (BC_7, DDR_D(31), bidir, X, 259, 1, Z), " & + "257 (BC_1, *, control, 1), " & + "256 (BC_7, DDR_D(30), bidir, X, 257, 1, Z), " & + "255 (BC_1, *, control, 1), " & + "254 (BC_7, DDR_D(29), bidir, X, 255, 1, Z), " & + "253 (BC_1, *, control, 1), " & + "252 (BC_7, DDR_D(28), bidir, X, 253, 1, Z), " & + "251 (BC_1, *, control, 1), " & + "250 (BC_7, DDR_DQS(3), bidir, X, 251, 1, Z), " & + "249 (BC_1, *, control, 1), " & + "248 (BC_7, DDR_D(27), bidir, X, 249, 1, Z), " & + "247 (BC_1, *, control, 1), " & + "246 (BC_7, DDR_D(26), bidir, X, 247, 1, Z), " & + "245 (BC_1, *, control, 1), " & + "244 (BC_7, DDR_D(25), bidir, X, 245, 1, Z), " & + "243 (BC_1, *, control, 1), " & + "242 (BC_7, DDR_D(24), bidir, X, 243, 1, Z), " & + "241 (BC_0, *, control, 1), " & + "240 (BC_0, DDR_DQM(3), output3, X, 241, 1, Z), " & + "239 (BC_1, *, control, 1), " & + "238 (BC_7, DDR_D(15), bidir, X, 239, 1, Z), " & + "237 (BC_1, *, control, 1), " & + "236 (BC_7, DDR_D(14), bidir, X, 237, 1, Z), " & + "235 (BC_1, *, control, 1), " & + "234 (BC_7, DDR_D(13), bidir, X, 235, 1, Z), " & + "233 (BC_1, *, control, 1), " & + "232 (BC_7, DDR_D(12), bidir, X, 233, 1, Z), " & + "231 (BC_1, *, control, 1), " & + "230 (BC_7, DDR_DQS(1), bidir, X, 231, 1, Z), " & + "229 (BC_1, *, control, 1), " & + "228 (BC_7, DDR_D(11), bidir, X, 229, 1, Z), " & + "227 (BC_1, *, control, 1), " & + "226 (BC_7, DDR_D(10), bidir, X, 227, 1, Z), " & + "225 (BC_1, *, control, 1), " & + "224 (BC_7, DDR_D(9), bidir, X, 225, 1, Z), " & + "223 (BC_1, *, control, 1), " & + "222 (BC_7, DDR_D(8), bidir, X, 223, 1, Z), " & + "221 (BC_0, *, control, 1), " & + "220 (BC_0, DDR_DQM(1), output3, X, 221, 1, Z), " & + "219 (BC_0, *, control, 1), " & + "218 (BC_0, DDR_BA(2), output3, X, 219, 1, Z), " & + "217 (BC_0, *, control, 1), " & + "216 (BC_0, DDR_BA(1), output3, X, 217, 1, Z), " & + "215 (BC_0, *, control, 1), " & + "214 (BC_0, DDR_BA(0), output3, X, 215, 1, Z), " & + "213 (BC_0, *, control, 1), " & + "212 (BC_0, DDR_CKE, output3, X, 213, 1, Z), " & + "211 (BC_0, *, control, 1), " & + "210 (BC_0, DDR_CS, output3, X, 211, 1, Z), " & + "209 (BC_0, *, control, 1), " & + "208 (BC_0, DDR_A(13), output3, X, 209, 1, Z), " & + "207 (BC_0, *, control, 1), " & + "206 (BC_0, DDR_RESETN, output3, X, 207, 1, Z), " & + "205 (BC_0, *, control, 1), " & + "204 (BC_0, DDR_A(5), output3, X, 205, 1, Z), " & + "203 (BC_0, *, control, 1), " & + "202 (BC_0, DDR_A(6), output3, X, 203, 1, Z), " & + "201 (BC_0, *, control, 1), " & + "200 (BC_0, DDR_RAS, output3, X, 201, 1, Z), " & + "199 (BC_0, *, control, 1), " & + "198 (BC_0, DDR_CAS, output3, X, 199, 1, Z), " & + "197 (BC_0, *, control, 1), " & + "196 (BC_0, DDR_WE, output3, X, 197, 1, Z), " & + "195 (BC_0, *, control, 1), " & + "194 (BC_0, DDR_CLK, output3, X, 195, 1, Z), " & + "193 (BC_0, *, control, 1), " & + "192 (BC_0, DDR_A(0), output3, X, 193, 1, Z), " & + "191 (BC_0, *, control, 1), " & + "190 (BC_0, DDR_A(1), output3, X, 191, 1, Z), " & + "189 (BC_0, *, control, 1), " & + "188 (BC_0, DDR_A(2), output3, X, 189, 1, Z), " & + "187 (BC_0, *, control, 1), " & + "186 (BC_0, DDR_A(3), output3, X, 187, 1, Z), " & + "185 (BC_0, *, control, 1), " & + "184 (BC_0, DDR_A(4), output3, X, 185, 1, Z), " & + "183 (BC_0, *, control, 1), " & + "182 (BC_0, DDR_A(12), output3, X, 183, 1, Z), " & + "181 (BC_0, *, control, 1), " & + "180 (BC_0, DDR_A(11), output3, X, 181, 1, Z), " & + "179 (BC_0, *, control, 1), " & + "178 (BC_0, DDR_A(10), output3, X, 179, 1, Z), " & + "177 (BC_0, *, control, 1), " & + "176 (BC_0, DDR_A(9), output3, X, 177, 1, Z), " & + "175 (BC_0, *, control, 1), " & + "174 (BC_0, DDR_A(8), output3, X, 175, 1, Z), " & + "173 (BC_0, *, control, 1), " & + "172 (BC_0, DDR_A(7), output3, X, 173, 1, Z), " & + "171 (BC_1, *, control, 1), " & + "170 (BC_7, DDR_D(7), bidir, X, 171, 1, Z), " & + "169 (BC_1, *, control, 1), " & + "168 (BC_7, DDR_D(6), bidir, X, 169, 1, Z), " & + "167 (BC_1, *, control, 1), " & + "166 (BC_7, DDR_D(5), bidir, X, 167, 1, Z), " & + "165 (BC_1, *, control, 1), " & + "164 (BC_7, DDR_D(4), bidir, X, 165, 1, Z), " & + "163 (BC_1, *, control, 1), " & + "162 (BC_7, DDR_DQS(0), bidir, X, 163, 1, Z), " & + "161 (BC_1, *, control, 1), " & + "160 (BC_7, DDR_D(3), bidir, X, 161, 1, Z), " & + "159 (BC_1, *, control, 1), " & + "158 (BC_7, DDR_D(2), bidir, X, 159, 1, Z), " & + "157 (BC_1, *, control, 1), " & + "156 (BC_7, DDR_D(1), bidir, X, 157, 1, Z), " & + "155 (BC_1, *, control, 1), " & + "154 (BC_7, DDR_D(0), bidir, X, 155, 1, Z), " & + "153 (BC_0, *, control, 1), " & + "152 (BC_0, DDR_DQM(0), output3, X, 153, 1, Z), " & + "151 (BC_1, *, control, 1), " & + "150 (BC_7, DDR_D(23), bidir, X, 151, 1, Z), " & + "149 (BC_1, *, control, 1), " & + "148 (BC_7, DDR_D(22), bidir, X, 149, 1, Z), " & + "147 (BC_1, *, control, 1), " & + "146 (BC_7, DDR_D(21), bidir, X, 147, 1, Z), " & + "145 (BC_1, *, control, 1), " & + "144 (BC_7, DDR_D(20), bidir, X, 145, 1, Z), " & + "143 (BC_1, *, control, 1), " & + "142 (BC_7, DDR_DQS(2), bidir, X, 143, 1, Z), " & + "141 (BC_1, *, control, 1), " & + "140 (BC_7, DDR_D(19), bidir, X, 141, 1, Z), " & + "139 (BC_1, *, control, 1), " & + "138 (BC_7, DDR_D(18), bidir, X, 139, 1, Z), " & + "137 (BC_1, *, control, 1), " & + "136 (BC_7, DDR_D(17), bidir, X, 137, 1, Z), " & + "135 (BC_1, *, control, 1), " & + "134 (BC_7, DDR_D(16), bidir, X, 135, 1, Z), " & + "133 (BC_0, *, control, 1), " & + "132 (BC_0, DDR_DQM(2), output3, X, 133, 1, Z), " & + "131 (BC_1, *, control, 1), " & + "130 (BC_7, PD0, bidir, X, 131, 1, Z), " & + "129 (BC_1, *, control, 1), " & + "128 (BC_7, PD1, bidir, X, 129, 1, Z), " & + "127 (BC_1, *, control, 1), " & + "126 (BC_7, PD2, bidir, X, 127, 1, Z), " & + "125 (BC_0, *, internal, X), " & + "124 (BC_0, *, internal, X), " & + "123 (BC_0, *, internal, X), " & + "122 (BC_0, *, internal, X), " & + "121 (BC_0, *, internal, X), " & + "120 (BC_0, *, internal, X), " & + "119 (BC_0, *, internal, X), " & + "118 (BC_0, *, internal, X), " & + "117 (BC_0, *, internal, X), " & + "116 (BC_0, *, internal, X), " & + "115 (BC_0, *, internal, X), " & + "114 (BC_0, *, internal, X), " & + "113 (BC_1, *, control, 1), " & + "112 (BC_7, PB0, bidir, X, 113, 1, Z), " & + "111 (BC_1, *, control, 1), " & + "110 (BC_7, PB2, bidir, X, 111, 1, Z), " & + "109 (BC_1, *, control, 1), " & + "108 (BC_7, PB1, bidir, X, 109, 1, Z), " & + "107 (BC_1, *, control, 1), " & + "106 (BC_7, PB3, bidir, X, 107, 1, Z), " & + "105 (BC_1, *, control, 1), " & + "104 (BC_7, PB4, bidir, X, 105, 1, Z), " & + "103 (BC_1, *, control, 1), " & + "102 (BC_7, PB5, bidir, X, 103, 1, Z), " & + "101 (BC_1, *, control, 1), " & + "100 (BC_7, PB6, bidir, X, 101, 1, Z), " & + "99 (BC_1, *, control, 1), " & + "98 (BC_7, PB8, bidir, X, 99, 1, Z), " & + "97 (BC_1, *, control, 1), " & + "96 (BC_7, PB7, bidir, X, 97, 1, Z), " & + "95 (BC_1, *, control, 1), " & + "94 (BC_7, PB10, bidir, X, 95, 1, Z), " & + "93 (BC_1, *, control, 1), " & + "92 (BC_7, PB9, bidir, X, 93, 1, Z), " & + "91 (BC_1, *, control, 1), " & + "90 (BC_7, PB11, bidir, X, 91, 1, Z), " & + "89 (BC_1, *, control, 1), " & + "88 (BC_7, PB12, bidir, X, 89, 1, Z), " & + "87 (BC_1, *, control, 1), " & + "86 (BC_7, PB14, bidir, X, 87, 1, Z), " & + "85 (BC_1, *, control, 1), " & + "84 (BC_7, PB13, bidir, X, 85, 1, Z), " & + "83 (BC_1, *, control, 1), " & + "82 (BC_7, PB15, bidir, X, 83, 1, Z), " & + "81 (BC_1, *, control, 1), " & + "80 (BC_7, PB16, bidir, X, 81, 1, Z), " & + "79 (BC_1, *, control, 1), " & + "78 (BC_7, PB17, bidir, X, 79, 1, Z), " & + "77 (BC_1, *, control, 1), " & + "76 (BC_7, PB19, bidir, X, 77, 1, Z), " & + "75 (BC_1, *, control, 1), " & + "74 (BC_7, PB18, bidir, X, 75, 1, Z), " & + "73 (BC_1, *, control, 1), " & + "72 (BC_7, PB20, bidir, X, 73, 1, Z), " & + "71 (BC_1, *, control, 1), " & + "70 (BC_7, PB21, bidir, X, 71, 1, Z), " & + "69 (BC_1, *, control, 1), " & + "68 (BC_7, PB23, bidir, X, 69, 1, Z), " & + "67 (BC_1, *, control, 1), " & + "66 (BC_7, PB22, bidir, X, 67, 1, Z), " & + "65 (BC_1, *, control, 1), " & + "64 (BC_7, PB25, bidir, X, 65, 1, Z), " & + "63 (BC_1, *, control, 1), " & + "62 (BC_7, PB24, bidir, X, 63, 1, Z), " & + "61 (BC_1, *, control, 1), " & + "60 (BC_7, PB26, bidir, X, 61, 1, Z), " & + "59 (BC_1, *, control, 1), " & + "58 (BC_7, PB28, bidir, X, 59, 1, Z), " & + "57 (BC_1, *, control, 1), " & + "56 (BC_7, PB27, bidir, X, 57, 1, Z), " & + "55 (BC_1, *, control, 1), " & + "54 (BC_7, PB30, bidir, X, 55, 1, Z), " & + "53 (BC_1, *, control, 1), " & + "52 (BC_7, PB29, bidir, X, 53, 1, Z), " & + "51 (BC_1, *, control, 1), " & + "50 (BC_7, PB31, bidir, X, 51, 1, Z), " & + "49 (BC_0, *, internal, X), " & + "48 (BC_0, *, internal, X), " & + "47 (BC_0, *, internal, X), " & + "46 (BC_0, *, internal, X), " & + "45 (BC_0, *, internal, X), " & + "44 (BC_0, *, internal, X), " & + "43 (BC_0, *, internal, X), " & + "42 (BC_0, *, internal, X), " & + "41 (BC_0, *, internal, X), " & + "40 (BC_0, *, internal, X), " & + "39 (BC_0, *, internal, X), " & + "38 (BC_0, *, internal, X), " & + "37 (BC_0, *, internal, X), " & + "36 (BC_0, *, internal, X), " & + "35 (BC_0, *, internal, X), " & + "34 (BC_0, *, internal, X), " & + "33 (BC_0, *, internal, X), " & + "32 (BC_0, *, internal, X), " & + "31 (BC_0, *, internal, X), " & + "30 (BC_0, *, internal, X), " & + "29 (BC_0, *, internal, X), " & + "28 (BC_0, *, internal, X), " & + "27 (BC_0, *, internal, X), " & + "26 (BC_0, *, internal, X), " & + "25 (BC_0, *, internal, X), " & + "24 (BC_0, *, internal, X), " & + "23 (BC_0, *, internal, X), " & + "22 (BC_0, *, internal, X), " & + "21 (BC_0, *, internal, X), " & + "20 (BC_0, *, internal, X), " & + "19 (BC_0, *, internal, X), " & + "18 (BC_0, *, internal, X), " & + "17 (BC_0, *, internal, X), " & + "16 (BC_0, *, internal, X), " & + "15 (BC_1, *, control, 1), " & + "14 (BC_7, PD10, bidir, X, 15, 1, Z), " & + "13 (BC_1, *, control, 1), " & + "12 (BC_7, PD9, bidir, X, 13, 1, Z), " & + "11 (BC_1, *, control, 1), " & + "10 (BC_7, PD8, bidir, X, 11, 1, Z), " & + "9 (BC_1, *, control, 1), " & + "8 (BC_7, PD7, bidir, X, 9, 1, Z), " & + "7 (BC_1, *, control, 1), " & + "6 (BC_7, PD6, bidir, X, 7, 1, Z), " & + "5 (BC_1, *, control, 1), " & + "4 (BC_7, PD5, bidir, X, 5, 1, Z), " & + "3 (BC_1, *, control, 1), " & + "2 (BC_7, PD4, bidir, X, 3, 1, Z), " & + "1 (BC_1, *, control, 1), " & + "0 (BC_7, PD3, bidir, X, 1, 1, Z) "; + + end top; diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA289.bsdl b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA289.bsdl new file mode 100644 index 000000000..b349163c5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/SAMA5D2-BGA289.bsdl @@ -0,0 +1,865 @@ +-- ***************************************************************************** + +-- BSDL file for design top + +-- Created by Synopsys Version I-2013.12-SP3 (Apr 18, 2014) + +-- Designer: +-- Company: + +-- Date: Thu Feb 5 23:41:59 2015 + +-- ***************************************************************************** + + + entity top is + +-- This section identifies the default device package selected. + + generic (PHYSICAL_PIN_MAP: string:= "BGA289"); + +-- This section declares all the ports in the design. + + port ( + PD14 : in bit; + PD15 : in bit; + PD17 : in bit; + PD18 : in bit; + PA0 : inout bit; + PA1 : inout bit; + PA10 : inout bit; + PA11 : inout bit; + PA12 : inout bit; + PA13 : inout bit; + PA14 : inout bit; + PA15 : inout bit; + PA16 : inout bit; + PA17 : inout bit; + PA18 : inout bit; + PA19 : inout bit; + PA2 : inout bit; + PA20 : inout bit; + PA21 : inout bit; + PA22 : inout bit; + PA23 : inout bit; + PA24 : inout bit; + PA25 : inout bit; + PA26 : inout bit; + PA27 : inout bit; + PA28 : inout bit; + PA29 : inout bit; + PA3 : inout bit; + PA30 : inout bit; + PA31 : inout bit; + PA4 : inout bit; + PA5 : inout bit; + PA6 : inout bit; + PA7 : inout bit; + PA8 : inout bit; + PA9 : inout bit; + PB0 : inout bit; + PB1 : inout bit; + PB10 : inout bit; + PB11 : inout bit; + PB12 : inout bit; + PB13 : inout bit; + PB14 : inout bit; + PB15 : inout bit; + PB16 : inout bit; + PB17 : inout bit; + PB18 : inout bit; + PB19 : inout bit; + PB2 : inout bit; + PB20 : inout bit; + PB21 : inout bit; + PB22 : inout bit; + PB23 : inout bit; + PB24 : inout bit; + PB25 : inout bit; + PB26 : inout bit; + PB27 : inout bit; + PB28 : inout bit; + PB29 : inout bit; + PB3 : inout bit; + PB30 : inout bit; + PB31 : inout bit; + PB4 : inout bit; + PB5 : inout bit; + PB6 : inout bit; + PB7 : inout bit; + PB8 : inout bit; + PB9 : inout bit; + PC0 : inout bit; + PC1 : inout bit; + PC10 : inout bit; + PC11 : inout bit; + PC12 : inout bit; + PC13 : inout bit; + PC14 : inout bit; + PC15 : inout bit; + PC16 : inout bit; + PC17 : inout bit; + PC18 : inout bit; + PC19 : inout bit; + PC2 : inout bit; + PC20 : inout bit; + PC21 : inout bit; + PC22 : inout bit; + PC23 : inout bit; + PC24 : inout bit; + PC25 : inout bit; + PC26 : inout bit; + PC27 : inout bit; + PC28 : inout bit; + PC29 : inout bit; + PC3 : inout bit; + PC30 : inout bit; + PC31 : inout bit; + PC4 : inout bit; + PC5 : inout bit; + PC6 : inout bit; + PC7 : inout bit; + PC8 : inout bit; + PC9 : inout bit; + PD0 : inout bit; + PD1 : inout bit; + PD10 : inout bit; + PD11 : inout bit; + PD12 : inout bit; + PD13 : inout bit; + PD19 : inout bit; + PD2 : inout bit; + PD20 : inout bit; + PD21 : inout bit; + PD22 : inout bit; + PD23 : inout bit; + PD24 : inout bit; + PD25 : inout bit; + PD26 : inout bit; + PD27 : inout bit; + PD28 : inout bit; + PD29 : inout bit; + PD3 : inout bit; + PD30 : inout bit; + PD31 : inout bit; + PD4 : inout bit; + PD5 : inout bit; + PD6 : inout bit; + PD7 : inout bit; + PD8 : inout bit; + PD9 : inout bit; + DDR_D : inout bit_vector (0 to 31); + DDR_DQS : inout bit_vector (0 to 3); + DDR_DQSN : inout bit_vector (0 to 3); + DDR_CAS : out bit; + DDR_CKE : out bit; + DDR_CLK : out bit; + DDR_CLKN : out bit; + DDR_CS : out bit; + DDR_RAS : out bit; + DDR_RESETN : out bit; + DDR_WE : out bit; + PD16 : out bit; + DDR_A : out bit_vector (0 to 13); + DDR_BA : out bit_vector (0 to 2); + DDR_DQM : out bit_vector (0 to 3); + -- ADVREFN : linkage bit; + ADVREFP : linkage bit; + CLK_AUDIO : linkage bit; + COMPN : linkage bit; + COMPP : linkage bit; + DDR_CAL : linkage bit; + DDR_VREF : linkage bit; -- DDR_VREFB0 : linkage bit; + -- DDR_VREFB1 : linkage bit; + -- DDR_VREFB2 : linkage bit; + -- DDR_VREFB3 : linkage bit; + -- DDR_VREFCM : linkage bit; + HHSDMA : linkage bit; + HHSDMB : linkage bit; + HHSDMSTRC : linkage bit; + HHSDPA : linkage bit; + HHSDPB : linkage bit; + HHSDPDATC : linkage bit; + JTAGSEL : in bit; + NRST : linkage bit; + RXD : linkage bit; + SDCAL : linkage bit; + SHDN : linkage bit; + TST : in bit; + VBG : linkage bit; + WKUP : linkage bit; + XIN : linkage bit; + XIN32 : linkage bit; + XOUT : linkage bit; + XOUT32 : linkage bit; + -- tst_drst_ana : linkage bit; -- NC Port + -- tst_drst_ddr : linkage bit; -- NC Port + -- tst_drst_iop0 : linkage bit; -- NC Port + -- tst_drst_iop1 : linkage bit; -- NC Port + -- tst_drst_iop2 : linkage bit; -- NC Port + -- tst_drst_isi : linkage bit; -- NC Port + -- tst_drst_osc : linkage bit; -- NC Port + -- tst_drst_sdhc : linkage bit; -- NC Port + -- tst_lft_plla : linkage bit; -- NC Port + -- tst_lft_utmi : linkage bit; -- NC Port + -- tst_por_1v2 : linkage bit; -- NC Port + -- tst_por_1v8 : linkage bit; -- NC Port + -- tst_por_bu : linkage bit; -- NC Port + -- tst_psw_bu : linkage bit; -- NC Port + -- tst_psw_fuse : linkage bit; -- NC Port + PIOBU : linkage bit_vector (0 to 7) + ); + + use STD_1149_1_1994.all; + + attribute COMPONENT_CONFORMANCE of top: entity is "STD_1149_1_1993"; + + attribute PIN_MAP of top: entity is PHYSICAL_PIN_MAP; + +-- This section specifies the pin map for each port. This information is +-- extracted from the port-to-pin map file that was read in using the +-- "read_pin_map" command. + + constant BGA289: PIN_MAP_STRING := + "PD14 : K4," & + "PD15 : K7," & + "PD17 : K2," & + "PD18 : J5," & + "PA0 : U11," & + "PA1 : P10," & + "PA10 : U13," & + "PA11 : P15," & + "PA12 : N15," & + "PA13 : P16," & + "PA14 : M14," & + "PA15 : N16," & + "PA16 : M10," & + "PA17 : N17," & + "PA18 : U14," & + "PA19 : T14," & + "PA2 : T11," & + "PA20 : P12," & + "PA21 : R13," & + "PA22 : U15," & + "PA23 : U16," & + "PA24 : T15," & + "PA25 : U17," & + "PA26 : P13," & + "PA27 : T16," & + "PA28 : R16," & + "PA29 : T17," & + "PA3 : R10," & + "PA30 : R15," & + "PA31 : R17," & + "PA4 : U12," & + "PA5 : T12," & + "PA6 : R12," & + "PA7 : T13," & + "PA8 : N10," & + "PA9 : N11," & + "PB0 : J8," & + "PB1 : A8," & + "PB10 : H8," & + "PB11 : B5," & + "PB12 : D6," & + "PB13 : B4," & + "PB14 : C5," & + "PB15 : H7," & + "PB16 : D5," & + "PB17 : C4," & + "PB18 : A3," & + "PB19 : D4," & + "PB2 : A7," & + "PB20 : B3," & + "PB21 : A2," & + "PB22 : C3," & + "PB23 : A1," & + "PB24 : E5," & + "PB25 : B2," & + "PB26 : E4," & + "PB27 : B1," & + "PB28 : C2," & + "PB29 : D3," & + "PB3 : A6," & + "PB30 : D2," & + "PB31 : C1," & + "PB4 : B6," & + "PB5 : B7," & + "PB6 : C7," & + "PB7 : C6," & + "PB8 : A5," & + "PB9 : A4," & + "PC0 : P17," & + "PC1 : N12," & + "PC10 : E3," & + "PC11 : E2," & + "PC12 : E1," & + "PC13 : F3," & + "PC14 : F5," & + "PC15 : F2," & + "PC16 : G6," & + "PC17 : F1," & + "PC18 : H6," & + "PC19 : G2," & + "PC2 : N14," & + "PC20 : G3," & + "PC21 : G1," & + "PC22 : H2," & + "PC23 : G5," & + "PC24 : H1," & + "PC25 : H5," & + "PC26 : J9," & + "PC27 : H9," & + "PC28 : E8," & + "PC29 : G8," & + "PC3 : M15," & + "PC30 : F8," & + "PC31 : D8," & + "PC4 : M11," & + "PC5 : L10," & + "PC6 : K10," & + "PC7 : M16," & + "PC8 : J10," & + "PC9 : D1," & + "PD0 : G10," & + "PD1 : E10," & + "PD10 : J3," & + "PD11 : M1," & + "PD12 : K8," & + "PD13 : L2," & + "PD19 : K6," & + "PD2 : G9," & + "PD20 : M2," & + "PD21 : N1," & + "PD22 : L4," & + "PD23 : M3," & + "PD24 : L7," & + "PD25 : L6," & + "PD26 : N2," & + "PD27 : L8," & + "PD28 : M4," & + "PD29 : N3," & + "PD3 : K1," & + "PD30 : L9," & + "PD31 : M7," & + "PD4 : J6," & + "PD5 : J4," & + "PD6 : J2," & + "PD7 : J7," & + "PD8 : J1," & + "PD9 : K9," & + "DDR_D : (B12, A12, C12, A13, A14, C13, A15, B15, G17, G16, " & + "H17, K17, K16, J13, K14, K15, B8, B9, C9, A9, A10, D10, B11, A11, " & + "J12, H10, J11, K11, L13, L11, L12, M17)," & + "DDR_DQS : (B13, J17, C10, L17)," & + "DDR_DQSN : (B14, J16, B10, L16)," & + "DDR_CAS : G12," & + "DDR_CKE : F16," & + "DDR_CLK : E17," & + "DDR_CLKN : D17," & + "DDR_CS : G13," & + "DDR_RAS : F13," & + "DDR_RESETN : E16," & + "DDR_WE : F15," & + "PD16 : L1," & + "DDR_A : (F12, C17, B17, B16, C16, G14, F14, F11, C14, D13, " & + "C15, A16, A17, G11)," & + "DDR_BA : (H12, H13, F17)," & + "DDR_DQM : (C11, G15, C8, H11)," & + "ADVREFP : M6," & + "CLK_AUDIO : U3," & + "COMPN : U1," & + "COMPP : T1," & + "DDR_CAL : E13," & + "HHSDMA : R8," & + "HHSDMB : U9," & + "HHSDMSTRC : U10," & + "HHSDPA : T8," & + "HHSDPB : U8," & + "HHSDPDATC : T9," & + "JTAGSEL : T2," & + "NRST : U2," & + "RXD : N4," & + "SDCAL : T10," & + "SHDN : R1," & + "TST : P3," & + "VBG : R6," & + "WKUP : P4," & + "XIN : U7," & + "XIN32 : P1," & + "XOUT : U6," & + "XOUT32 : P2," & + "PIOBU : (R3, N8, R2, R5, R4, P5, P6, M8)"; + +-- This section specifies the differential IO port groupings. + + attribute PORT_GROUPING of top: entity is + "Differential_Voltage ( " & + "(DDR_CLK,DDR_CLKN))"; + +-- This section specifies the TAP ports. For the TAP TCK port, the parameters in +-- the brackets are: +-- First Field : Maximum TCK frequency. +-- Second Field: Allowable states TCK may be stopped in. + + attribute TAP_SCAN_CLOCK of PD14: signal is (10.0e6, BOTH); + attribute TAP_SCAN_IN of PD15: signal is true; + attribute TAP_SCAN_MODE of PD17: signal is true; + attribute TAP_SCAN_OUT of PD16: signal is true; + attribute TAP_SCAN_RESET of PD18: signal is true; + +-- Specifies the compliance enable patterns for the design. It lists a set of +-- design ports and the values that they should be set to, in order to enable +-- compliance to IEEE Std 1149.1 + + attribute COMPLIANCE_PATTERNS of top: entity is + "(JTAGSEL, TST) (10)"; + +-- Specifies the number of bits in the instruction register. + + attribute INSTRUCTION_LENGTH of top: entity is 4; + +-- Specifies the boundary-scan instructions implemented in the design and their +-- opcodes. + + attribute INSTRUCTION_OPCODE of top: entity is + "BYPASS (1111, 0001, 0101, 0110, 1100, 0111, 1101, 1000, 1001, 1011, " & + "1110)," & + "EXTEST (0000)," & + "SAMPLE (0100)," & + "INTEST (0010)," & + "IDCODE (0011)," & + "RUNBIST (1010)"; + +-- Specifies the bit pattern that is loaded into the instruction register when +-- the TAP controller passes through the Capture-IR state. The standard mandates +-- that the two LSBs must be "01". The remaining bits are design specific. + + attribute INSTRUCTION_CAPTURE of top: entity is "0001"; + +-- Specifies the bit pattern that is loaded into the DEVICE_ID register during +-- the IDCODE instruction when the TAP controller passes through the Capture-DR +-- state. + + attribute IDCODE_REGISTER of top: entity is + "0000" & + -- 4-bit version number + "0101101100111111" & + -- 16-bit part number + "00000011111" & + -- 11-bit identity of the manufacturer + "1"; + -- Required by IEEE Std 1149.1 + +-- This section specifies the test data register placed between TDI and TDO for +-- each implemented instruction. + + attribute REGISTER_ACCESS of top: entity is + "BYPASS (BYPASS)," & + "BOUNDARY (EXTEST, SAMPLE, INTEST)," & + "DEVICE_ID (IDCODE)," & + "UTDR1[41] (RUNBIST)"; + +-- Specifies the length of the boundary scan register. + + attribute BOUNDARY_LENGTH of top: entity is 374; + +-- The following list specifies the characteristics of each cell in the boundary +-- scan register from TDI to TDO. The following is a description of the label +-- fields: +-- num : Is the cell number. +-- cell : Is the cell type as defined by the standard. +-- port : Is the design port name. Control cells do not have a port +-- name. +-- function: Is the function of the cell as defined by the standard. Is one +-- of input, output2, output3, bidir, control or controlr. +-- safe : Specifies the value that the BSR cell should be loaded with +-- for safe operation when the software might otherwise choose a +-- random value. +-- ccell : The control cell number. Specifies the control cell that +-- drives the output enable for this port. +-- disval : Specifies the value that is loaded into the control cell to +-- disable the output enable for the corresponding port. +-- rslt : Resulting state. Shows the state of the driver when it is +-- disabled. + + attribute BOUNDARY_REGISTER of top: entity is +-- +-- num cell port function safe [ccell disval rslt] +-- + "373 (BC_1, *, control, 1), " & + "372 (BC_7, PD13, bidir, X, 373, 1, Z), " & + "371 (BC_1, *, control, 1), " & + "370 (BC_7, PD12, bidir, X, 371, 1, Z), " & + "369 (BC_1, *, control, 1), " & + "368 (BC_7, PD11, bidir, X, 369, 1, Z), " & + "367 (BC_1, *, control, 1), " & + "366 (BC_7, PD19, bidir, X, 367, 1, Z), " & + "365 (BC_1, *, control, 1), " & + "364 (BC_7, PD20, bidir, X, 365, 1, Z), " & + "363 (BC_1, *, control, 1), " & + "362 (BC_7, PD24, bidir, X, 363, 1, Z), " & + "361 (BC_1, *, control, 1), " & + "360 (BC_7, PD21, bidir, X, 361, 1, Z), " & + "359 (BC_1, *, control, 1), " & + "358 (BC_7, PD25, bidir, X, 359, 1, Z), " & + "357 (BC_1, *, control, 1), " & + "356 (BC_7, PD26, bidir, X, 357, 1, Z), " & + "355 (BC_1, *, control, 1), " & + "354 (BC_7, PD22, bidir, X, 355, 1, Z), " & + "353 (BC_1, *, control, 1), " & + "352 (BC_7, PD27, bidir, X, 353, 1, Z), " & + "351 (BC_1, *, control, 1), " & + "350 (BC_7, PD23, bidir, X, 351, 1, Z), " & + "349 (BC_1, *, control, 1), " & + "348 (BC_7, PD28, bidir, X, 349, 1, Z), " & + "347 (BC_1, *, control, 1), " & + "346 (BC_7, PD30, bidir, X, 347, 1, Z), " & + "345 (BC_1, *, control, 1), " & + "344 (BC_7, PD29, bidir, X, 345, 1, Z), " & + "343 (BC_1, *, control, 1), " & + "342 (BC_7, PD31, bidir, X, 343, 1, Z), " & + "341 (BC_1, *, control, 1), " & + "340 (BC_7, PA0, bidir, X, 341, 1, Z), " & + "339 (BC_1, *, control, 1), " & + "338 (BC_7, PA1, bidir, X, 339, 1, Z), " & + "337 (BC_1, *, control, 1), " & + "336 (BC_7, PA2, bidir, X, 337, 1, Z), " & + "335 (BC_1, *, control, 1), " & + "334 (BC_7, PA3, bidir, X, 335, 1, Z), " & + "333 (BC_1, *, control, 1), " & + "332 (BC_7, PA4, bidir, X, 333, 1, Z), " & + "331 (BC_1, *, control, 1), " & + "330 (BC_7, PA5, bidir, X, 331, 1, Z), " & + "329 (BC_1, *, control, 1), " & + "328 (BC_7, PA6, bidir, X, 329, 1, Z), " & + "327 (BC_1, *, control, 1), " & + "326 (BC_7, PA7, bidir, X, 327, 1, Z), " & + "325 (BC_1, *, control, 1), " & + "324 (BC_7, PA8, bidir, X, 325, 1, Z), " & + "323 (BC_1, *, control, 1), " & + "322 (BC_7, PA9, bidir, X, 323, 1, Z), " & + "321 (BC_1, *, control, 1), " & + "320 (BC_7, PA10, bidir, X, 321, 1, Z), " & + "319 (BC_1, *, control, 1), " & + "318 (BC_7, PA18, bidir, X, 319, 1, Z), " & + "317 (BC_1, *, control, 1), " & + "316 (BC_7, PA20, bidir, X, 317, 1, Z), " & + "315 (BC_1, *, control, 1), " & + "314 (BC_7, PA19, bidir, X, 315, 1, Z), " & + "313 (BC_1, *, control, 1), " & + "312 (BC_7, PA21, bidir, X, 313, 1, Z), " & + "311 (BC_1, *, control, 1), " & + "310 (BC_7, PA22, bidir, X, 311, 1, Z), " & + "309 (BC_1, *, control, 1), " & + "308 (BC_7, PA23, bidir, X, 309, 1, Z), " & + "307 (BC_1, *, control, 1), " & + "306 (BC_7, PA24, bidir, X, 307, 1, Z), " & + "305 (BC_1, *, control, 1), " & + "304 (BC_7, PA25, bidir, X, 305, 1, Z), " & + "303 (BC_1, *, control, 1), " & + "302 (BC_7, PA26, bidir, X, 303, 1, Z), " & + "301 (BC_1, *, control, 1), " & + "300 (BC_7, PA27, bidir, X, 301, 1, Z), " & + "299 (BC_1, *, control, 1), " & + "298 (BC_7, PA28, bidir, X, 299, 1, Z), " & + "297 (BC_1, *, control, 1), " & + "296 (BC_7, PA30, bidir, X, 297, 1, Z), " & + "295 (BC_1, *, control, 1), " & + "294 (BC_7, PA29, bidir, X, 295, 1, Z), " & + "293 (BC_1, *, control, 1), " & + "292 (BC_7, PA31, bidir, X, 293, 1, Z), " & + "291 (BC_1, *, control, 1), " & + "290 (BC_7, PC0, bidir, X, 291, 1, Z), " & + "289 (BC_1, *, control, 1), " & + "288 (BC_7, PA11, bidir, X, 289, 1, Z), " & + "287 (BC_1, *, control, 1), " & + "286 (BC_7, PC1, bidir, X, 287, 1, Z), " & + "285 (BC_1, *, control, 1), " & + "284 (BC_7, PA13, bidir, X, 285, 1, Z), " & + "283 (BC_1, *, control, 1), " & + "282 (BC_7, PA12, bidir, X, 283, 1, Z), " & + "281 (BC_1, *, control, 1), " & + "280 (BC_7, PC2, bidir, X, 281, 1, Z), " & + "279 (BC_1, *, control, 1), " & + "278 (BC_7, PA14, bidir, X, 279, 1, Z), " & + "277 (BC_1, *, control, 1), " & + "276 (BC_7, PA15, bidir, X, 277, 1, Z), " & + "275 (BC_1, *, control, 1), " & + "274 (BC_7, PC3, bidir, X, 275, 1, Z), " & + "273 (BC_1, *, control, 1), " & + "272 (BC_7, PC4, bidir, X, 273, 1, Z), " & + "271 (BC_1, *, control, 1), " & + "270 (BC_7, PA16, bidir, X, 271, 1, Z), " & + "269 (BC_1, *, control, 1), " & + "268 (BC_7, PA17, bidir, X, 269, 1, Z), " & + "267 (BC_1, *, control, 1), " & + "266 (BC_7, PC5, bidir, X, 267, 1, Z), " & + "265 (BC_1, *, control, 1), " & + "264 (BC_7, PC7, bidir, X, 265, 1, Z), " & + "263 (BC_1, *, control, 1), " & + "262 (BC_7, PC6, bidir, X, 263, 1, Z), " & + "261 (BC_1, *, control, 1), " & + "260 (BC_7, PC8, bidir, X, 261, 1, Z), " & + "259 (BC_1, *, control, 1), " & + "258 (BC_7, DDR_D(31), bidir, X, 259, 1, Z), " & + "257 (BC_1, *, control, 1), " & + "256 (BC_7, DDR_D(30), bidir, X, 257, 1, Z), " & + "255 (BC_1, *, control, 1), " & + "254 (BC_7, DDR_D(29), bidir, X, 255, 1, Z), " & + "253 (BC_1, *, control, 1), " & + "252 (BC_7, DDR_D(28), bidir, X, 253, 1, Z), " & + "251 (BC_1, *, control, 1), " & + "250 (BC_7, DDR_DQS(3), bidir, X, 251, 1, Z), " & + "249 (BC_1, *, control, 1), " & + "248 (BC_7, DDR_D(27), bidir, X, 249, 1, Z), " & + "247 (BC_1, *, control, 1), " & + "246 (BC_7, DDR_D(26), bidir, X, 247, 1, Z), " & + "245 (BC_1, *, control, 1), " & + "244 (BC_7, DDR_D(25), bidir, X, 245, 1, Z), " & + "243 (BC_1, *, control, 1), " & + "242 (BC_7, DDR_D(24), bidir, X, 243, 1, Z), " & + "241 (BC_0, *, control, 1), " & + "240 (BC_0, DDR_DQM(3), output3, X, 241, 1, Z), " & + "239 (BC_1, *, control, 1), " & + "238 (BC_7, DDR_D(15), bidir, X, 239, 1, Z), " & + "237 (BC_1, *, control, 1), " & + "236 (BC_7, DDR_D(14), bidir, X, 237, 1, Z), " & + "235 (BC_1, *, control, 1), " & + "234 (BC_7, DDR_D(13), bidir, X, 235, 1, Z), " & + "233 (BC_1, *, control, 1), " & + "232 (BC_7, DDR_D(12), bidir, X, 233, 1, Z), " & + "231 (BC_1, *, control, 1), " & + "230 (BC_7, DDR_DQS(1), bidir, X, 231, 1, Z), " & + "229 (BC_1, *, control, 1), " & + "228 (BC_7, DDR_D(11), bidir, X, 229, 1, Z), " & + "227 (BC_1, *, control, 1), " & + "226 (BC_7, DDR_D(10), bidir, X, 227, 1, Z), " & + "225 (BC_1, *, control, 1), " & + "224 (BC_7, DDR_D(9), bidir, X, 225, 1, Z), " & + "223 (BC_1, *, control, 1), " & + "222 (BC_7, DDR_D(8), bidir, X, 223, 1, Z), " & + "221 (BC_0, *, control, 1), " & + "220 (BC_0, DDR_DQM(1), output3, X, 221, 1, Z), " & + "219 (BC_0, *, control, 1), " & + "218 (BC_0, DDR_BA(2), output3, X, 219, 1, Z), " & + "217 (BC_0, *, control, 1), " & + "216 (BC_0, DDR_BA(1), output3, X, 217, 1, Z), " & + "215 (BC_0, *, control, 1), " & + "214 (BC_0, DDR_BA(0), output3, X, 215, 1, Z), " & + "213 (BC_0, *, control, 1), " & + "212 (BC_0, DDR_CKE, output3, X, 213, 1, Z), " & + "211 (BC_0, *, control, 1), " & + "210 (BC_0, DDR_CS, output3, X, 211, 1, Z), " & + "209 (BC_0, *, control, 1), " & + "208 (BC_0, DDR_A(13), output3, X, 209, 1, Z), " & + "207 (BC_0, *, control, 1), " & + "206 (BC_0, DDR_RESETN, output3, X, 207, 1, Z), " & + "205 (BC_0, *, control, 1), " & + "204 (BC_0, DDR_A(5), output3, X, 205, 1, Z), " & + "203 (BC_0, *, control, 1), " & + "202 (BC_0, DDR_A(6), output3, X, 203, 1, Z), " & + "201 (BC_0, *, control, 1), " & + "200 (BC_0, DDR_RAS, output3, X, 201, 1, Z), " & + "199 (BC_0, *, control, 1), " & + "198 (BC_0, DDR_CAS, output3, X, 199, 1, Z), " & + "197 (BC_0, *, control, 1), " & + "196 (BC_0, DDR_WE, output3, X, 197, 1, Z), " & + "195 (BC_0, *, control, 1), " & + "194 (BC_0, DDR_CLK, output3, X, 195, 1, Z), " & + "193 (BC_0, *, control, 1), " & + "192 (BC_0, DDR_A(0), output3, X, 193, 1, Z), " & + "191 (BC_0, *, control, 1), " & + "190 (BC_0, DDR_A(1), output3, X, 191, 1, Z), " & + "189 (BC_0, *, control, 1), " & + "188 (BC_0, DDR_A(2), output3, X, 189, 1, Z), " & + "187 (BC_0, *, control, 1), " & + "186 (BC_0, DDR_A(3), output3, X, 187, 1, Z), " & + "185 (BC_0, *, control, 1), " & + "184 (BC_0, DDR_A(4), output3, X, 185, 1, Z), " & + "183 (BC_0, *, control, 1), " & + "182 (BC_0, DDR_A(12), output3, X, 183, 1, Z), " & + "181 (BC_0, *, control, 1), " & + "180 (BC_0, DDR_A(11), output3, X, 181, 1, Z), " & + "179 (BC_0, *, control, 1), " & + "178 (BC_0, DDR_A(10), output3, X, 179, 1, Z), " & + "177 (BC_0, *, control, 1), " & + "176 (BC_0, DDR_A(9), output3, X, 177, 1, Z), " & + "175 (BC_0, *, control, 1), " & + "174 (BC_0, DDR_A(8), output3, X, 175, 1, Z), " & + "173 (BC_0, *, control, 1), " & + "172 (BC_0, DDR_A(7), output3, X, 173, 1, Z), " & + "171 (BC_1, *, control, 1), " & + "170 (BC_7, DDR_D(7), bidir, X, 171, 1, Z), " & + "169 (BC_1, *, control, 1), " & + "168 (BC_7, DDR_D(6), bidir, X, 169, 1, Z), " & + "167 (BC_1, *, control, 1), " & + "166 (BC_7, DDR_D(5), bidir, X, 167, 1, Z), " & + "165 (BC_1, *, control, 1), " & + "164 (BC_7, DDR_D(4), bidir, X, 165, 1, Z), " & + "163 (BC_1, *, control, 1), " & + "162 (BC_7, DDR_DQS(0), bidir, X, 163, 1, Z), " & + "161 (BC_1, *, control, 1), " & + "160 (BC_7, DDR_D(3), bidir, X, 161, 1, Z), " & + "159 (BC_1, *, control, 1), " & + "158 (BC_7, DDR_D(2), bidir, X, 159, 1, Z), " & + "157 (BC_1, *, control, 1), " & + "156 (BC_7, DDR_D(1), bidir, X, 157, 1, Z), " & + "155 (BC_1, *, control, 1), " & + "154 (BC_7, DDR_D(0), bidir, X, 155, 1, Z), " & + "153 (BC_0, *, control, 1), " & + "152 (BC_0, DDR_DQM(0), output3, X, 153, 1, Z), " & + "151 (BC_1, *, control, 1), " & + "150 (BC_7, DDR_D(23), bidir, X, 151, 1, Z), " & + "149 (BC_1, *, control, 1), " & + "148 (BC_7, DDR_D(22), bidir, X, 149, 1, Z), " & + "147 (BC_1, *, control, 1), " & + "146 (BC_7, DDR_D(21), bidir, X, 147, 1, Z), " & + "145 (BC_1, *, control, 1), " & + "144 (BC_7, DDR_D(20), bidir, X, 145, 1, Z), " & + "143 (BC_1, *, control, 1), " & + "142 (BC_7, DDR_DQS(2), bidir, X, 143, 1, Z), " & + "141 (BC_1, *, control, 1), " & + "140 (BC_7, DDR_D(19), bidir, X, 141, 1, Z), " & + "139 (BC_1, *, control, 1), " & + "138 (BC_7, DDR_D(18), bidir, X, 139, 1, Z), " & + "137 (BC_1, *, control, 1), " & + "136 (BC_7, DDR_D(17), bidir, X, 137, 1, Z), " & + "135 (BC_1, *, control, 1), " & + "134 (BC_7, DDR_D(16), bidir, X, 135, 1, Z), " & + "133 (BC_0, *, control, 1), " & + "132 (BC_0, DDR_DQM(2), output3, X, 133, 1, Z), " & + "131 (BC_1, *, control, 1), " & + "130 (BC_7, PD0, bidir, X, 131, 1, Z), " & + "129 (BC_1, *, control, 1), " & + "128 (BC_7, PD1, bidir, X, 129, 1, Z), " & + "127 (BC_1, *, control, 1), " & + "126 (BC_7, PD2, bidir, X, 127, 1, Z), " & + "125 (BC_1, *, control, 1), " & + "124 (BC_7, PC26, bidir, X, 125, 1, Z), " & + "123 (BC_1, *, control, 1), " & + "122 (BC_7, PC27, bidir, X, 123, 1, Z), " & + "121 (BC_1, *, control, 1), " & + "120 (BC_7, PC28, bidir, X, 121, 1, Z), " & + "119 (BC_1, *, control, 1), " & + "118 (BC_7, PC29, bidir, X, 119, 1, Z), " & + "117 (BC_1, *, control, 1), " & + "116 (BC_7, PC30, bidir, X, 117, 1, Z), " & + "115 (BC_1, *, control, 1), " & + "114 (BC_7, PC31, bidir, X, 115, 1, Z), " & + "113 (BC_1, *, control, 1), " & + "112 (BC_7, PB0, bidir, X, 113, 1, Z), " & + "111 (BC_1, *, control, 1), " & + "110 (BC_7, PB2, bidir, X, 111, 1, Z), " & + "109 (BC_1, *, control, 1), " & + "108 (BC_7, PB1, bidir, X, 109, 1, Z), " & + "107 (BC_1, *, control, 1), " & + "106 (BC_7, PB3, bidir, X, 107, 1, Z), " & + "105 (BC_1, *, control, 1), " & + "104 (BC_7, PB4, bidir, X, 105, 1, Z), " & + "103 (BC_1, *, control, 1), " & + "102 (BC_7, PB5, bidir, X, 103, 1, Z), " & + "101 (BC_1, *, control, 1), " & + "100 (BC_7, PB6, bidir, X, 101, 1, Z), " & + "99 (BC_1, *, control, 1), " & + "98 (BC_7, PB8, bidir, X, 99, 1, Z), " & + "97 (BC_1, *, control, 1), " & + "96 (BC_7, PB7, bidir, X, 97, 1, Z), " & + "95 (BC_1, *, control, 1), " & + "94 (BC_7, PB10, bidir, X, 95, 1, Z), " & + "93 (BC_1, *, control, 1), " & + "92 (BC_7, PB9, bidir, X, 93, 1, Z), " & + "91 (BC_1, *, control, 1), " & + "90 (BC_7, PB11, bidir, X, 91, 1, Z), " & + "89 (BC_1, *, control, 1), " & + "88 (BC_7, PB12, bidir, X, 89, 1, Z), " & + "87 (BC_1, *, control, 1), " & + "86 (BC_7, PB14, bidir, X, 87, 1, Z), " & + "85 (BC_1, *, control, 1), " & + "84 (BC_7, PB13, bidir, X, 85, 1, Z), " & + "83 (BC_1, *, control, 1), " & + "82 (BC_7, PB15, bidir, X, 83, 1, Z), " & + "81 (BC_1, *, control, 1), " & + "80 (BC_7, PB16, bidir, X, 81, 1, Z), " & + "79 (BC_1, *, control, 1), " & + "78 (BC_7, PB17, bidir, X, 79, 1, Z), " & + "77 (BC_1, *, control, 1), " & + "76 (BC_7, PB19, bidir, X, 77, 1, Z), " & + "75 (BC_1, *, control, 1), " & + "74 (BC_7, PB18, bidir, X, 75, 1, Z), " & + "73 (BC_1, *, control, 1), " & + "72 (BC_7, PB20, bidir, X, 73, 1, Z), " & + "71 (BC_1, *, control, 1), " & + "70 (BC_7, PB21, bidir, X, 71, 1, Z), " & + "69 (BC_1, *, control, 1), " & + "68 (BC_7, PB23, bidir, X, 69, 1, Z), " & + "67 (BC_1, *, control, 1), " & + "66 (BC_7, PB22, bidir, X, 67, 1, Z), " & + "65 (BC_1, *, control, 1), " & + "64 (BC_7, PB25, bidir, X, 65, 1, Z), " & + "63 (BC_1, *, control, 1), " & + "62 (BC_7, PB24, bidir, X, 63, 1, Z), " & + "61 (BC_1, *, control, 1), " & + "60 (BC_7, PB26, bidir, X, 61, 1, Z), " & + "59 (BC_1, *, control, 1), " & + "58 (BC_7, PB28, bidir, X, 59, 1, Z), " & + "57 (BC_1, *, control, 1), " & + "56 (BC_7, PB27, bidir, X, 57, 1, Z), " & + "55 (BC_1, *, control, 1), " & + "54 (BC_7, PB30, bidir, X, 55, 1, Z), " & + "53 (BC_1, *, control, 1), " & + "52 (BC_7, PB29, bidir, X, 53, 1, Z), " & + "51 (BC_1, *, control, 1), " & + "50 (BC_7, PB31, bidir, X, 51, 1, Z), " & + "49 (BC_1, *, control, 1), " & + "48 (BC_7, PC9, bidir, X, 49, 1, Z), " & + "47 (BC_1, *, control, 1), " & + "46 (BC_7, PC11, bidir, X, 47, 1, Z), " & + "45 (BC_1, *, control, 1), " & + "44 (BC_7, PC10, bidir, X, 45, 1, Z), " & + "43 (BC_1, *, control, 1), " & + "42 (BC_7, PC12, bidir, X, 43, 1, Z), " & + "41 (BC_1, *, control, 1), " & + "40 (BC_7, PC13, bidir, X, 41, 1, Z), " & + "39 (BC_1, *, control, 1), " & + "38 (BC_7, PC14, bidir, X, 39, 1, Z), " & + "37 (BC_1, *, control, 1), " & + "36 (BC_7, PC15, bidir, X, 37, 1, Z), " & + "35 (BC_1, *, control, 1), " & + "34 (BC_7, PC17, bidir, X, 35, 1, Z), " & + "33 (BC_1, *, control, 1), " & + "32 (BC_7, PC16, bidir, X, 33, 1, Z), " & + "31 (BC_1, *, control, 1), " & + "30 (BC_7, PC19, bidir, X, 31, 1, Z), " & + "29 (BC_1, *, control, 1), " & + "28 (BC_7, PC18, bidir, X, 29, 1, Z), " & + "27 (BC_1, *, control, 1), " & + "26 (BC_7, PC20, bidir, X, 27, 1, Z), " & + "25 (BC_1, *, control, 1), " & + "24 (BC_7, PC21, bidir, X, 25, 1, Z), " & + "23 (BC_1, *, control, 1), " & + "22 (BC_7, PC22, bidir, X, 23, 1, Z), " & + "21 (BC_1, *, control, 1), " & + "20 (BC_7, PC23, bidir, X, 21, 1, Z), " & + "19 (BC_1, *, control, 1), " & + "18 (BC_7, PC24, bidir, X, 19, 1, Z), " & + "17 (BC_1, *, control, 1), " & + "16 (BC_7, PC25, bidir, X, 17, 1, Z), " & + "15 (BC_1, *, control, 1), " & + "14 (BC_7, PD10, bidir, X, 15, 1, Z), " & + "13 (BC_1, *, control, 1), " & + "12 (BC_7, PD9, bidir, X, 13, 1, Z), " & + "11 (BC_1, *, control, 1), " & + "10 (BC_7, PD8, bidir, X, 11, 1, Z), " & + "9 (BC_1, *, control, 1), " & + "8 (BC_7, PD7, bidir, X, 9, 1, Z), " & + "7 (BC_1, *, control, 1), " & + "6 (BC_7, PD6, bidir, X, 7, 1, Z), " & + "5 (BC_1, *, control, 1), " & + "4 (BC_7, PD5, bidir, X, 5, 1, Z), " & + "3 (BC_1, *, control, 1), " & + "2 (BC_7, PD4, bidir, X, 3, 1, Z), " & + "1 (BC_1, *, control, 1), " & + "0 (BC_7, PD3, bidir, X, 1, 1, Z) "; + + end top; diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/Makefile.inc new file mode 100644 index 000000000..ee3361b0a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/Makefile.inc @@ -0,0 +1,51 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2013, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +CFLAGS_INC += -I$(TOP)/drivers + +lib-y += drivers/drivers.a + +drivers-y := + +include $(TOP)/drivers/cortex-a/Makefile.inc +include $(TOP)/drivers/memories/Makefile.inc +include $(TOP)/drivers/misc/Makefile.inc +include $(TOP)/drivers/network/Makefile.inc +include $(TOP)/drivers/peripherals/Makefile.inc +include $(TOP)/drivers/power/Makefile.inc +include $(TOP)/drivers/video/Makefile.inc +include $(TOP)/drivers/usb/Makefile.inc + +DRIVERS_OBJS := $(addprefix $(BUILDDIR)/,$(drivers-y)) + +-include $(DRIVERS_OBJS:.o=.d) + +$(BUILDDIR)/drivers/drivers.a: $(DRIVERS_OBJS) + @mkdir -p $(BUILDDIR)/drivers + $(ECHO) AR $@ + $(Q)$(AR) -cr $@ $^ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/Makefile.inc new file mode 100644 index 000000000..142663a7e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/Makefile.inc @@ -0,0 +1,34 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2015, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +drivers-y += drivers/cortex-a/cortexa5_interrupts.o +drivers-y += drivers/cortex-a/cp15.o +drivers-y += drivers/cortex-a/cp15_asm_gcc.o +drivers-y += drivers/cortex-a/cp15_pmu.o +drivers-y += drivers/cortex-a/cpsr_gcc.o +drivers-y += drivers/cortex-a/mmu.o diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.c new file mode 100644 index 000000000..07a62856a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.c @@ -0,0 +1,194 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Provides the low-level initialization function that called on chip startup. + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "compiler.h" +#include "peripherals/aic.h" +#include "cortexa5_interrupts.h" +#include + +/*---------------------------------------------------------------------------- + * Constants + *----------------------------------------------------------------------------*/ + +/* IFSR status */ +static const char* _prefetch_abort_status[32] = { + NULL, + NULL, + "debug event", + "access flag fault, section", + NULL, + "translation fault, section", + "access flag fault, page", + "translation fault, page", + "synchronous external abort", + "domain fault, section", + NULL, + "domain fault, page", + "L1 translation, synchronous external abort", + "permission fault, section", + "L2 translation, synchronous external abort", + "permission fault, page", +}; + +/* DFSR status */ +static const char* _data_abort_status[32] = { + NULL, + "alignment fault", + "debug event", + "access flag fault, section", + "instruction cache maintenance fault", + "translation fault, section", + "access flag fault, page", + "translation fault, page", + "synchronous external abort, nontranslation", + "domain fault, section", + NULL, + "domain fault, page", + "1st level translation, synchronous external abort", + "permission fault, section", + "2nd level translation, synchronous external abort", + "permission fault, page", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "asynchronous external abort" +}; + +/*---------------------------------------------------------------------------- + * Functions Prototypes + *----------------------------------------------------------------------------*/ + +void default_undefined_instruction_irq_handler(void); +void default_software_interrupt_irq_handler(void); +void default_data_abort_irq_handler(void); +void default_prefetch_abort_irq_handler(void); + +#pragma weak undefined_instruction_irq_handler=default_undefined_instruction_irq_handler +#pragma weak software_interrupt_irq_handler=default_software_interrupt_irq_handler +#pragma weak data_abort_irq_handler=default_data_abort_irq_handler +#pragma weak prefetch_abort_irq_handler=default_prefetch_abort_irq_handler + +/*---------------------------------------------------------------------------- + * Functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Default handler for "Undefined Instruction" exception + */ +void default_undefined_instruction_irq_handler(void) +{ + printf("\n\r"); + printf("#####################\n\r"); + printf("Undefined Instruction\n\r"); + printf("#####################\n\r"); + + asm("bkpt #0"); + while(1); +} + + +/** + * \brief Default handler for "Software Interrupt" exception + */ +void default_software_interrupt_irq_handler(void) +{ + printf("\n\r"); + printf("##################\n\r"); + printf("Software Interrupt\n\r"); + printf("##################\n\r"); + + asm("bkpt #0"); + while(1); +} + +/** + * \brief Default handler for "Data Abort" exception + */ +void default_data_abort_irq_handler(void) +{ + uint32_t v1, v2, dfsr; + + asm("mrc p15, 0, %0, c5, c0, 0" : "=r"(v1)); + asm("mrc p15, 0, %0, c6, c0, 0" : "=r"(v2)); + + printf("\n\r"); + printf("####################\n\r"); + dfsr = ((v1 >> 4) & 0x0F); + printf("Data Fault occured in %x domain\n\r", (unsigned int)dfsr); + dfsr = (((v1 & 0x400) >> 6) | (v1 & 0x0F)); + if (_data_abort_status[dfsr]) + printf("Data Fault reason is: %s\n\r", _data_abort_status[dfsr]); + else + printf("Data Fault reason is unknown\n\r"); + printf("Data Fault occured at address: 0x%08x\n\n\r", (unsigned int)v2); + printf("Data Fault status register value: 0x%x\n\r", (unsigned int)v1); + printf("####################\n\r"); + + asm("bkpt #0"); + while(1); +} + +/** + * \brief Default handler for "Prefetch Abort" exception + */ +void default_prefetch_abort_irq_handler(void) +{ + uint32_t v1, v2, ifsr; + + asm("mrc p15, 0, %0, c5, c0, 1" : "=r"(v1)); + asm("mrc p15, 0, %0, c6, c0, 2" : "=r"(v2)); + + printf("\n\r"); + printf("####################\n\r"); + ifsr = (((v1 & 0x400) >> 6) | (v1 & 0x0F)); + if (_prefetch_abort_status[ifsr]) + printf("Prefetch Fault reason is: %s\n\r", _prefetch_abort_status[ifsr]); + else + printf("Prefetch Fault reason is unknown\n\r"); + printf("prefetch Fault occured at address: 0x%08x\n\n\r", (unsigned int)v2); + printf("Prefetch Fault status register value: 0x%x\n\r", (unsigned int)v1); + printf("####################\n\r"); + + asm("bkpt #0"); + while(1); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.h new file mode 100644 index 000000000..fdf35d735 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cortexa5_interrupts.h @@ -0,0 +1,49 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Cortex-A5 core interrupt handlers + * + */ + +#ifndef INTERRUPTS_CORTEXA5_H +#define INTERRUPTS_CORTEXA5_H + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +extern WEAK void undefined_instruction_irq_handler(void); +extern WEAK void software_interrupt_irq_handler(void); +extern WEAK void prefetch_abort_irq_handler(void); +extern WEAK void data_abort_irq_handler(void); + +#endif /* INTERRUPTS_CORTEXA5_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.c new file mode 100644 index 000000000..4404c7dd4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.c @@ -0,0 +1,350 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +//----------------------------------------------------------------------------- +// Reg Reads Writes +//---------------------------------------------------------------------------- +// 0 ID code Unpredictable +// 0 cache type Unpredictable +// 0 TCM status Unpredictable +// 1 Control Control +// 2 Translation table base Translation table base +// 3 Domain access control Domain access control +// 4 (Reserved) +// 5 Data fault status Data fault status +// 5 Instruction fault status Instruction fault status +// 6 Fault address Fault address +// 7 cache operations cache operations +// 8 Unpredictable TLB operations +// 9 cache lockdown cache lockdown +// 9 TCM region TCM region +// 10 TLB lockdown TLB lockdown +// 11 (Reserved) +// 12 (Reserved) +// 13 FCSE PID FCSE PID +// 13 Context ID Context ID +// 14 (Reserved) +// 15 Test configuration Test configuration +//----------------------------------------------------------------------------- + +/** \page cp15_f CP15 Functions + * + * \section CP15 function Usage + * + * Methods to manage the Coprocessor 15. Coprocessor 15, or System Control + * Coprocessor CP15, is used to configure and control all the items in the + * list below: + * + * \section Usage + * + * -# Enable or disable D cache with cp15_enable_dcache() and cp15_disable_dcache() + * -# Enable or disable I cache with cp15_enable_icache() and cp15_disable_icache() + * + * Related files:\n + * \ref cp15.h\n + * \ref cp15.c\n + */ + +/** \file */ + +/** + * \addtogroup cp15_cache L1 Cache Operations + * \ingroup cache_module + * + * \section Usage + * + * They are performed as MCR instructions and only operate on a level 1 cache associated with + * ATM v7 processor. + * The supported operations are: + * + * + * Related files:\n + * \ref cp15.h\n + * \ref cp15_asm_gcc.S \n + * \ref cp15_asm_iar.s \n + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#if defined(__ICCARM__) + #include +#endif + +#include "cortex-a/cp15.h" +#include "trace.h" + +#include + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Check Instruction cache + * \return 0 if I_cache disable, 1 if I_cache enable + */ +unsigned int cp15_is_icached_enabled(void) +{ + unsigned int control; + control = cp15_read_control(); + return ((control & (1 << CP15_I_BIT)) != 0); +} + +/** + * \brief Enable Instruction cache + */ +void cp15_enable_icache(void) +{ + unsigned int control; + control = cp15_read_control(); + // Check if cache is disabled + if ((control & (1 << CP15_I_BIT)) == 0) { + cp15_icache_invalidate(); + control |= (1 << CP15_I_BIT); + cp15_write_control(control); + trace_info("I cache enabled.\n\r"); + } else { + + trace_info("I cache is already enabled.\n\r"); + } +} + +/** + * \brief Disable Instruction cache + */ +void cp15_disable_icache(void) +{ + unsigned int control; + control = cp15_read_control(); + // Check if cache is enabled + if ((control & (1 << CP15_I_BIT)) != 0) { + + control &= ~(1ul << CP15_I_BIT); + cp15_write_control(control); + trace_info("I cache disabled.\n\r"); + } else { + + trace_info("I cache is already disabled.\n\r"); + } +} + +/** + * \brief Check MMU + * \return 0 if MMU disable, 1 if MMU enable + */ +unsigned int cp15_is_mmu_enabled(void) +{ + unsigned int control; + control = cp15_read_control(); + return ((control & (1 << CP15_M_BIT)) != 0); +} + +/** + * \brief Enable MMU + */ +void cp15_enable_mmu(void) +{ + unsigned int control; + control = cp15_read_control(); + // Check if MMU is disabled + if ((control & (1 << CP15_M_BIT)) == 0) { + + control |= (1 << CP15_M_BIT); + cp15_write_control(control); + trace_info("MMU enabled.\n\r"); + } else { + trace_info("MMU is already enabled.\n\r"); + } +} + +/** + * \brief Disable MMU + */ +void cp15_disable_mmu(void) +{ + unsigned int control; + control = cp15_read_control(); + // Check if MMU is enabled + if ((control & (1 << CP15_M_BIT)) != 0) { + + control &= ~(1ul << CP15_M_BIT); + control &= ~(1ul << CP15_C_BIT); + cp15_write_control(control); + trace_info("MMU disabled.\n\r"); + } else { + trace_info("MMU is already disabled.\n\r"); + } +} + +/** + * \brief Check D_cache + * \return 0 if D_cache disable, 1 if D_cache enable (with MMU of course) + */ +unsigned int cp15_is_dcache_enabled(void) +{ + unsigned int control; + control = cp15_read_control(); + return ((control & ((1 << CP15_C_BIT) || (1 << CP15_M_BIT))) != 0); +} + +/** + * \brief Enable Data cache + */ +void cp15_enable_dcache(void) +{ + unsigned int control; + control = cp15_read_control(); + if (!cp15_is_mmu_enabled()) { + trace_error("Do nothing: MMU not enabled\n\r"); + } else { + // Check if cache is disabled + if ((control & (1 << CP15_C_BIT)) == 0) { + cp15_dcache_invalidate(); + control |= (1 << CP15_C_BIT); + cp15_write_control(control); + trace_info("D cache enabled.\n\r"); + } else { + trace_info("D cache is already enabled.\n\r"); + } + } +} + +/** + * \brief Disable Data cache + */ +void cp15_disable_dcache(void) +{ + unsigned int control; + control = cp15_read_control(); + // Check if cache is enabled + if ((control & (1 << CP15_C_BIT)) != 0) { + + control &= ~(1ul << CP15_C_BIT); + cp15_write_control(control); + trace_info("D cache disabled.\n\r"); + } else { + + trace_info("D cache is already disabled.\n\r"); + } +} + +/** + * \brief Clean Data cache + */ +void cp15_dcache_clean(void) +{ + cp15_select_dcache(); + cp15_clean_dcache_by_set_way(); + asm("DSB"); +} + +/** + * \brief Invalidate Icache + */ +void cp15_icache_invalidate(void) +{ + cp15_select_icache(); + cp15_invalid_icache_inner_sharable(); + asm ("ISB"); +} + +/** + * \brief Invalidate Dcache + */ +void cp15_dcache_invalidate(void) +{ + cp15_select_dcache(); + cp15_invalid_dcache_by_set_way(); + asm ("DSB"); +} + +/** + * \brief Flush(Clean and invalidate) Data cache + */ +void cp15_dcache_flush(void) +{ + cp15_select_dcache(); + cp15_clean_invalid_dcache_by_set_way(); + asm("DSB"); + +} + +/** + * \brief Invalidate Data cache by address + */ +void cp15_invalid_dcache_by_va(uint32_t S_Add, uint32_t E_Add) +{ + cp15_select_dcache(); + cp15_invalid_dcache_by_mva(S_Add, E_Add); +} + +/** + * \brief Clean Data cache by address + */ +void cp15_clean_dcache_by_va(uint32_t S_Add, uint32_t E_Add) +{ + cp15_select_dcache(); + cp15_clean_dcache_by_mva(S_Add, E_Add); +} + +/** + * \brief Flush Data cache by address + */ + +void cp15_flush_dcache_by_va(uint32_t S_Add, uint32_t E_Add) +{ + cp15_select_dcache(); + cp15_clean_invalid_dcache_by_mva(S_Add, E_Add); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.h new file mode 100644 index 000000000..60e7a39c7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15.h @@ -0,0 +1,318 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CP15_H +#define _CP15_H + +#include + +/*---------------------------------------------------------------------------- + * Definition + *----------------------------------------------------------------------------*/ +#define CP15_L4_BIT 15 // Determines if the T bit is set when load instructions +// change the PC: +// 0 = loads to PC set the T bit +// 1 = loads to PC do not set T bit + +#define CP15_RR_BIT 14 // RR bit Replacement strategy for Icache and Dcache: +// 0 = Random replacement +// 1 = Round-robin replacement. + +#define CP15_V_BIT 13 // V bit Location of exception vectors: +// 0 = Normal exception vectors selected address range = 0x0000 0000 to 0x0000 001C +// 1 = High exception vect selected, address range = 0xFFFF 0000 to 0xFFFF 001C + +#define CP15_I_BIT 12 // I bit Icache enable/disable: +// 0 = Icache disabled +// 1 = Icache enabled + +#define CP15_R_BIT 9 // R bit ROM protection + +#define CP15_S_BIT 8 // S bit System protection + +#define CP15_B_BIT 7 // B bit Endianness: +// 0 = Little-endian operation +// 1 = Big-endian operation. + +#define CP15_C_BIT 2 // C bit Dcache enable/disable: +// 0 = cache disabled +// 1 = cache enabled + +#define CP15_A_BIT 1 // A bit Alignment fault enable/disable: +// 0 = Data address alignment fault checking disabled +// 1 = Data address alignment fault checking enabled + +#define CP15_M_BIT 0 // M bit MMU enable/disable: 0 = disabled 1 = enabled. +// 0 = disabled +// 1 = enabled + +/** No access Any access generates a domain fault. */ +#define CP15_DOMAIN_NO_ACCESS 0x00 +/** Client Accesses are checked against the access permission bits in the section or page descriptor. */ +#define CP15_DOMAIN_CLIENT_ACCESS 0x01 +/** Manager Accesses are not checked against the access permission bits so a permission fault cannot be generated. */ +#define CP15_DOMAIN_MANAGER_ACCESS 0x03 + +#define CP15_ICache 1 +#define CP15_DCache 0 + +#define CP15_PMCNTENSET_ENABLE 31 +#define CP15_PMCR_DIVIDER 3 +#define CP15_PMCR_RESET 2 +#define CP15_PMCR_ENABLE 0 + +/*------------------------------------------------------------------------------ */ +/* Exported functions */ +/*------------------------------------------------------------------------------ */ + +/** + * \brief Read the Main ID Register (MIDR). + * \return register contents + */ +extern unsigned int cp15_read_id(void); + +/** + * \brief Read the System Control Register (SCTLR). + * \return register contents + */ +extern unsigned int cp15_read_control(void); + +/** + * \brief Indicate CPU that L2 is in exclusive caching mode. + */ +extern void cp15_exclusive_cache(void); + +/** + * \brief Allow data to reside in the L1 and L2 caches at the same time. + */ +extern void cp15_non_exclusive_cache(void); + +/** + * \brief Instruction Synchronization Barrier operation. + */ +extern void cp15_isb(void); + +/** + * \brief Data Synchronization Barrier operation. + */ +extern void cp15_dsb(void); + +/** + * \brief Data Memory Barrier operation. + */ +extern void cp15_dmb(void); + +/** + * \brief Invalidate unified Translation Lookaside Buffer. + */ +extern void cp15_invalidate_tlb(void); + +/** + * \brief Select the data cache as the one to later retrieve architecture + * information about. + */ +extern void cp15_select_dcache(void); + +/** + * \brief Select the instruction cache as the one to later retrieve architecture + * information about. + */ +extern void cp15_select_icache(void); + +/** + * \brief Modify the System Control Register (SCTLR). + * This register specifies the configuration used to enable and disable the + * caches and MMU. + * It is recommended that you access this register using a read-modify- + * write sequence. + * \param value new value for SCTLR + */ +extern void cp15_write_control(unsigned int value); + +/** + * \brief ARMv7A architecture supports two translation tables. + * Configure translation table base (TTB) control register 0. + * \param value address of our page table base + */ +extern void cp15_write_ttb(unsigned int value); + +/** + * \brief Modify the Domain Access Control Register (DACR). + * \param value new value for DACR + */ +extern void cp15_write_domain_access_control(unsigned int value); + +/** + * \brief Invalidate I cache predictor array to point of unification Inner + * Shareable. + */ +extern void cp15_invalid_icache_inner_sharable(void); + +/** + * \brief Invalidate entire branch predictor array Inner Shareable + */ +extern void cp15_invalid_btb_inner_sharable(void); + +/** + * \brief Invalidate all instruction caches to point of unification. + * Also flush branch target cache. + */ +extern void cp15_invalid_icache(void); + +/** + * \brief Invalidate instruction caches by virtual address to point of + * unification. + */ +extern void cp15_invalid_icache_by_mva(void); + +/** + * \brief Invalidate entire branch predictor array. + */ +extern void cp15_invalid_btb(void); + +/** + * \brief Invalidate branch predictor array entry by modified virtual address. + * \param addr virtual address + */ +extern void cp15_invalid_btb_by_mva(uint32_t addr); + +/** + * \brief Invalidate entire data cache by set/way. + * Should be called further to cp15_select_dcache(), not + * cp15_select_icache(). + */ +extern void cp15_invalid_dcache_by_set_way(void); + +/** + * \brief Clean entire data cache by set/way. + * Should be called further to cp15_select_dcache(), not + * cp15_select_icache(). + */ +extern void cp15_clean_dcache_by_set_way(void); + +/** + * \brief Clean and invalidate entire data cache by set/way + * Should be called further to cp15_select_dcache(), not + * cp15_select_icache(). + */ +extern void cp15_clean_invalid_dcache_by_set_way(void); + +/** + * \brief Invalidate data cache by virtual address to point of coherency. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_invalid_dcache_by_mva(uint32_t start, uint32_t end); + +/** + * \brief Clean data cache by modified virtual address to point of coherency. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_clean_dcache_by_mva(uint32_t start, uint32_t end); + +/** + * \brief Clean and invalidate data cache by virtual address to point of + * coherency. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_clean_invalid_dcache_by_mva(uint32_t start, uint32_t end); + +/** + * \brief Clean unified cache by modified virtual address to point of + * unification. + */ +extern void cp15_clean_dcache_umva(void); + +/** + * \brief Ensure that the I and D caches are coherent within the specified + * region. This is typically used when code has been written to + * a memory region, and will be executed. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_coherent_dcache_for_dma(uint32_t start, uint32_t end); + +/** + * \brief Invalidate the data cache within the specified region; we will + * be performing a DMA operation in this region and we want to purge the + * cache of old data. Cache data will be discarded, not flushed. + * The specified region should be aligned on cache lines. Otherwise mind + * the data loss that may occur in the collateral part of start/end lines, + * since cache data won't be flushed. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_invalidate_dcache_for_dma(uint32_t start, uint32_t end); + +/** + * \brief Clean the data cache within the specified region. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_clean_dcache_for_dma(uint32_t start, uint32_t end); + +/** + * \brief Flush, i.e. clean and invalidate, the data cache within the specified + * region. + * \param start virtual start address of region + * \param end virtual end address of region + */ +extern void cp15_flush_dcache_for_dma(uint32_t start, uint32_t end); + +/*------------------------------------------------------------------------------ */ +/* Exported functions from CP15.c */ +/*------------------------------------------------------------------------------ */ + +/** MMU (Status/Enable/Disable) */ +extern unsigned int cp15_is_mmu_enabled(void); +extern void cp15_enable_mmu(void); +extern void cp15_disable_mmu(void); + +/** I cache (Status/Enable/Disable) */ +extern unsigned int cp15_is_icached_enabled(void); +extern void cp15_enable_icache(void); +extern void cp15_disable_icache(void); + +/** D cache (Status/Enable/Disable) */ +extern unsigned int cp15_is_dcache_enabled(void); +extern void cp15_enable_dcache(void); +extern void cp15_disable_dcache(void); + +extern void cp15_dcache_clean(void); +extern void cp15_dcache_invalidate(void); +extern void cp15_icache_invalidate(void); +extern void cp15_dcache_flush(void); +extern void cp15_invalid_dcache_by_va(uint32_t S_Add, uint32_t E_Add); +extern void cp15_clean_dcache_by_va(uint32_t S_Add, uint32_t E_Add); +extern void cp15_flush_dcache_by_va(uint32_t S_Add, uint32_t E_Add); + +#endif // #ifndef _CP15_H diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_gcc.S b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_gcc.S new file mode 100644 index 000000000..19e406bc6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_gcc.S @@ -0,0 +1,412 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Functions to access CP15 coprocessor register + *----------------------------------------------------------------------------*/ + + .section .text.cp15_read_id + .global cp15_read_id +cp15_read_id: + mov r0, #0 + mrc p15, 0, r0, c0, c0, 0 // read MIDR + bx lr + + .section .text.cp15_isb + .global cp15_isb +cp15_isb: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 4 // CP15ISB() + nop + bx lr + + .section .text.cp15_dsb + .global cp15_dsb +cp15_dsb: + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 // CP15DSB() + nop + bx lr + + .section .text.cp15_dmb + .global cp15_dmb +cp15_dmb: + mov r0, #0 + mcr p15, 0, r0, c7, c10, 5 // CP15DMB + nop + bx lr + + .section .text.cp15_invalidate_tlb + .global cp15_invalidate_tlb +cp15_invalidate_tlb: + mov r0, #0 + mcr p15, 0, r0, c8, c7, 0 // TLBIALL() + dsb + bx lr + + .section .text.cp15_exclusive_cache + .global cp15_exclusive_cache +cp15_exclusive_cache: + mov r0, #0 + mrc p15, 0, r0, c1, c0, 1 // Read ACTLR + orr r0, r0, #0x00000080 // Set EXCL + mcr p15, 0, r0, c1, c0, 1 // Write ACTLR + nop + bx lr + + .section .text.cp15_non_exclusive_cache + .global cp15_non_exclusive_cache +cp15_non_exclusive_cache: + mov r0, #0 + mrc p15, 0, r0, c1, c0, 1 // Read ACTLR + bic r0, r0, #0x00000080 // Clear EXCL + mcr p15, 0, r0, c1, c0, 1 // Write ACTLR + nop + bx lr + + .section .text.cp15_select_icache + .global cp15_select_icache +cp15_select_icache: + mrc p15, 2, r0, c0, c0, 0 // Read CSSELR + orr r0, r0, #0x1 // Set InD: cache type = ICache + mcr p15, 2, r0, c0, c0, 0 // Write CSSELR + nop + bx lr + + .section .text.cp15_select_dcache + .global cp15_select_dcache +cp15_select_dcache: + mrc p15, 2, r0, c0, c0, 0 // Read CSSELR + and r0, r0, #0xFFFFFFFE // Clear InD: cache type = DCache + mcr p15, 2, r0, c0, c0, 0 // Write CSSELR + nop + bx lr + + .section .text.cp15_read_control + .global cp15_read_control +cp15_read_control: + mov r0, #0 + mrc p15, 0, r0, c1, c0, 0 // read SCTLR + bx lr + + .section .text.cp15_write_control + .global cp15_write_control +cp15_write_control: + mcr p15, 0, r0, c1, c0, 0 // rewrite SCTLR + nop + nop + nop + nop + nop + nop + nop + nop + bx lr + + .section .text.cp15_write_domain_access_control + .global cp15_write_domain_access_control +cp15_write_domain_access_control: + mcr p15, 0, r0, c3, c0, 0 // rewrite DACR + nop + nop + nop + nop + nop + nop + nop + nop + bx lr + + .section .text.cp15_write_ttb + .global cp15_write_ttb +cp15_write_ttb: + mcr p15, 0, r0, c2, c0, 0 // rewrite TTBR0 + nop + nop + nop + nop + nop + nop + nop + nop + bx lr + + .section .text.cp15_invalid_icache_inner_sharable + .global cp15_invalid_icache_inner_sharable +cp15_invalid_icache_inner_sharable: + mov r0, #0 + mcr p15, 0, r0, c7, c1, 0 // ICIALLUIS() + bx lr + + .section .text.cp15_invalid_btb_inner_sharable + .global cp15_invalid_btb_inner_sharable +cp15_invalid_btb_inner_sharable: + mov r0, #0 + mcr p15, 0, r0, c7, c1, 6 // BPIALLIS() + bx lr + + .section .text.cp15_invalid_icache + .global cp15_invalid_icache +cp15_invalid_icache: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 0 // ICIALLU() + bx lr + + .section .text.cp15_invalid_icache_by_mva + .global cp15_invalid_icache_by_mva +cp15_invalid_icache_by_mva: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 1 // ICIMVAU() + bx lr + + .section .text.cp15_invalid_btb + .global cp15_invalid_btb +cp15_invalid_btb: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 6 // BPIALL() + bx lr + + .section .text.cp15_invalid_btb_by_mva + .global cp15_invalid_btb_by_mva +cp15_invalid_btb_by_mva: + mcr p15, 0, r0, c7, c5, 7 // BPIMVA() + bx lr + +/*********************************************************** + * Data Cache related maintenance functions + ***********************************************************/ + + .section .text.cp15_invalid_dcache_by_set_way + .global cp15_invalid_dcache_by_set_way +cp15_invalid_dcache_by_set_way: + push {r1-r4} + mrc p15, 1, r0, c0, c0, 0 // Read CCSIDR + mov r1, r0, lsr #3 // Get Associativity (num of ways) + and r1, r1, #3 // 3 is specific to CortexA5 with 32 KB + mov r2, r0, lsr #13 // Get NumSets (num of sets) + and r2, r2, #0xFF // 8bit is specific to CortexA5 with 32 KB + mov r0, #0 // 0:SHL:5 +1: + lsl r4, r1, #30 + mov r3, r2 +2: + orr r0, r4, r3, lsl #5 + mcr p15, 0, r0, c7, c6, 2 // DCISW() + subs r3, r3, #1 // 1:SHL:30 + bpl 2b + subs r1, r1, #1 + bpl 1b + dsb + pop {r1-r4} + bx lr + + .section .text.cp15_clean_dcache_by_set_way + .global cp15_clean_dcache_by_set_way +cp15_clean_dcache_by_set_way: + push {r1-r4} + mrc p15, 1, r0, c0, c0, 0 // Read CCSIDR + mov r1, r0, lsr #3 // Get Associativity (num of ways) + and r1, r1, #3 // 3 is specific to CortexA5 with 32 KB + mov r2, r0, lsr #13 // Get NumSets (num of sets) + and r2, r2, #0xFF // 8bit is specific to CortexA5 with 32 KB + mov r0, #0 // 0:SHL:5 +1: + lsl r4, r1, #30 + mov r3, r2 +2: + orr r0, r4, r3, lsl #5 + mcr p15, 0, r0, c7, c10, 2 // DCCSW() + subs r3, r3, #1 // 1:SHL:30 + bpl 2b + subs r1, r1, #1 + bpl 1b + dsb + pop {r1-r4} + bx lr + + .section .text.cp15_clean_invalid_dcache_by_set_way + .global cp15_clean_invalid_dcache_by_set_way +cp15_clean_invalid_dcache_by_set_way: + push {r1-r4} + mrc p15, 1, r0, c0, c0, 0 // Read CCSIDR + mov r1, r0, lsr #3 // Get Associativity (num of ways) + and r1, r1, #3 // 3 is specific to CortexA5 with 32 KB + mov r2, r0, lsr #13 // Get NumSets (num of sets) + and r2, r2, #0xFF // 8bit is specific to CortexA5 with 32 KB + mov r0, #0 // 0:SHL:5 +1: + lsl r4, r1, #30 + mov r3, r2 +2: + orr r0, r4, r3, lsl #5 + mcr p15, 0, r0, c7, c14, 2 // DCCISW() + subs r3, r3, #1 // 1:SHL:30 + bpl 2b + subs r1, r1, #1 + bpl 1b + dsb + pop {r1-r4} + bx lr + + .section .text.cp15_invalid_dcache_by_mva + .global cp15_invalid_dcache_by_mva +cp15_invalid_dcache_by_mva: + mov r2, #0x20 // Eight words per line, Cortex-A5 L1 Line Size 32 Bytes + mov r3, r0 +inv_loop: + mcr p15, 0, r0, c7, c6, 1 // DCIMVAC() + add r3, r3, r2 + cmp r3, r1 + bls inv_loop + bx lr + + .section .text.cp15_clean_dcache_by_mva + .global cp15_clean_dcache_by_mva +cp15_clean_dcache_by_mva: + mov r2, #0x20 // Eight words per line, Cortex-A5 L1 Line Size 32 Bytes + mov r3, r0 +clean_loop: + mcr p15, 0, r0, c7, c10, 1 // DCCMVAC() + add r3, r3, r2 + cmp r3, r1 + bls clean_loop + bx lr + + .section .text.cp15_clean_dcache_umva + .global cp15_clean_dcache_umva +cp15_clean_dcache_umva: + mov r0, #0 + mcr p15, 0, r0, c7, c11, 1 // DCCMVAU() + bx lr + + .section .text.cp15_clean_invalid_dcache_by_mva + .global cp15_clean_invalid_dcache_by_mva +cp15_clean_invalid_dcache_by_mva: + mov r2, #0x20 // Eight words per line, Cortex-A5 L1 Line Size 32 Bytes + mov r3, r0 +clinv_loop: + mcr p15, 0, r0, c7, c14, 1 // DCCIMVAC() + add r3, r3, r2 + cmp r3, r1 + bls clinv_loop + bx lr + + .section .text.cp15_coherent_dcache_for_dma + .global cp15_coherent_dcache_for_dma +cp15_coherent_dcache_for_dma: + push {r2-r4} + mrc p15, 0, r3, c0, c0, 1 // read Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf // DminLine + mov r2, #4 + mov r2, r2, lsl r3 // cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 // cache line mask + bic r4, r0, r3 // address of the first cache line +1: + mcr p15, 0, r4, c7, c11, 1 // DCCMVAU() + add r4, r4, r2 + cmp r4, r1 + blo 1b + dsb + + bic r4, r0, r3 +2: + mcr p15, 0, r4, c7, c5, 1 // ICIMVAU() + add r4, r4, r2 + cmp r4, r1 + blo 2b + mov r0, #0 + mcr p15, 0, r0, c7, c1, 6 // BPIALLIS() + mcr p15, 0, r0, c7, c5, 6 // BPIALL() + dsb + isb + pop {r2-r4} + bx lr + + .section .text.cp15_invalidate_dcache_for_dma + .global cp15_invalidate_dcache_for_dma +cp15_invalidate_dcache_for_dma: + push {r2-r3} + mrc p15, 0, r3, c0, c0, 1 // read CP15 Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf // DminLine + mov r2, #4 + mov r2, r2, lsl r3 // cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 // cache line mask + bic r0, r0, r3 // address of the first cache line +3: + mcr p15, 0, r0, c7, c6, 1 // CP15:DCIMVAC(r0) + add r0, r0, r2 + cmp r0, r1 // while ('cache line address' < 'end') + blo 3b + dsb + pop {r2-r3} + bx lr + + .section .text.cp15_clean_dcache_for_dma + .global cp15_clean_dcache_for_dma +cp15_clean_dcache_for_dma: + mrc p15, 0, r3, c0, c0, 1 // read Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf // DminLine + mov r2, #4 + mov r2, r2, lsl r3 // cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 // cache line mask + bic r0, r0, r3 // address of the first cache line +4: + mcr p15, 0, r0, c7, c10, 1 // DCCMVAC() + add r0, r0, r2 + cmp r0, r1 + blo 4b + dsb + bx lr + + .section .text.cp15_flush_dcache_for_dma + .global cp15_flush_dcache_for_dma +cp15_flush_dcache_for_dma: + mrc p15, 0, r3, c0, c0, 1 // read Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf // DminLine + mov r2, #4 + mov r2, r2, lsl r3 // cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 // cache line mask + bic r0, r0, r3 // address of the first cache line +5: + mcr p15, 0, r0, c7, c14, 1 // DCCIMVAC() + add r0, r0, r2 + cmp r0, r1 + blo 5b + dsb + bx lr diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_iar.s b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_iar.s new file mode 100644 index 000000000..bd54aebc7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_asm_iar.s @@ -0,0 +1,420 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + + MODULE ?cp15 + + /* Forward declaration of sections. */ + SECTION IRQ_STACK:DATA:NOROOT(2) + SECTION CSTACK:DATA:NOROOT(3) + +/*---------------------------------------------------------------------------- + * Functions to access CP15 coprocessor register + *----------------------------------------------------------------------------*/ + + SECTION .cp15_read_id:CODE:NOROOT(2) + PUBLIC cp15_read_id +cp15_read_id: + mov r0, #0 + mrc p15, 0, r0, c0, c0, 0 ; read MIDR + bx lr + + SECTION .cp15_isb:CODE:NOROOT(2) + PUBLIC cp15_isb +cp15_isb: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 4 ; CP15ISB() + nop + bx lr + + SECTION .cp15_dsb:CODE:NOROOT(2) + PUBLIC cp15_dsb +cp15_dsb: + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 ; CP15DSB() + nop + bx lr + + SECTION .cp15_dmb:CODE:NOROOT(2) + PUBLIC cp15_dmb +cp15_dmb: + mov r0, #0 + mcr p15, 0, r0, c7, c10, 5 ; CP15DMB() + nop + bx lr + + SECTION .cp15_invalidate_tlb:CODE:NOROOT(2) + PUBLIC cp15_invalidate_tlb +cp15_invalidate_tlb: + mov r0, #0 + mcr p15, 0, r0, c8, c7, 0 ; TLBIALL() + dsb + bx lr + + SECTION .cp15_exclusive_cache:CODE:NOROOT(2) + PUBLIC cp15_exclusive_cache +cp15_exclusive_cache: + mov r0, #0 + mrc p15, 0, r0, c1, c0, 1 ; Read ACTLR + orr r0, r0, #0x00000080 ; Set EXCL + mcr p15, 0, r0, c1, c0, 1 ; Write ACTLR + nop + bx lr + + SECTION .cp15_non_exclusive_cache:CODE:NOROOT(2) + PUBLIC cp15_non_exclusive_cache +cp15_non_exclusive_cache: + mov r0, #0 + mrc p15, 0, r0, c1, c0, 1 ; Read ACTLR + bic r0, r0, #0x00000080 ; Clear EXCL + mcr p15, 0, r0, c1, c0, 1 ; Write ACTLR + nop + bx lr + + SECTION .cp15_select_icache:CODE:NOROOT(2) + PUBLIC cp15_select_icache +cp15_select_icache: + mrc p15, 2, r0, c0, c0, 0 ; Read CSSELR + orr r0, r0, #0x1 ; Set InD: cache type = ICache + mcr p15, 2, r0, c0, c0, 0 ; Write CSSELR + nop + bx lr + + SECTION .cp15_select_dcache:CODE:NOROOT(2) + PUBLIC cp15_select_dcache +cp15_select_dcache: + mrc p15, 2, r0, c0, c0, 0 ; Read CSSELR + and r0, r0, #0xFFFFFFFE ; Clear InD: cache type = DCache + mcr p15, 2, r0, c0, c0, 0 ; Write CSSELR + nop + bx lr + + SECTION .cp15_read_control:CODE:NOROOT(2) + PUBLIC cp15_read_control +cp15_read_control: + mov r0, #0 + mrc p15, 0, r0, c1, c0, 0 ; read SCTLR + bx lr + + SECTION .cp15_write_control:CODE:NOROOT(2) + PUBLIC cp15_write_control +cp15_write_control: + mcr p15, 0, r0, c1, c0, 0 ; rewrite SCTLR + nop + nop + nop + nop + nop + nop + nop + nop + bx lr + + SECTION .cp15_write_domain_access_control:CODE:NOROOT(2) + PUBLIC cp15_write_domain_access_control +cp15_write_domain_access_control: + mcr p15, 0, r0, c3, c0, 0 ; rewrite DACR + nop + nop + nop + nop + nop + nop + nop + nop + bx lr + + SECTION .cp15_write_ttb:CODE:NOROOT(2) + PUBLIC cp15_write_ttb +cp15_write_ttb: + mcr p15, 0, r0, c2, c0, 0 ; rewrite TTBR0 + nop + nop + nop + nop + nop + nop + nop + nop + bx lr + + SECTION .cp15_invalid_icache_inner_sharable:CODE:NOROOT(2) + PUBLIC cp15_invalid_icache_inner_sharable +cp15_invalid_icache_inner_sharable: + mov r0, #0 + mcr p15, 0, r0, c7, c1, 0 ; ICIALLUIS() + bx lr + + SECTION .cp15_invalid_btb_inner_sharable:CODE:NOROOT(2) + PUBLIC cp15_invalid_btb_inner_sharable +cp15_invalid_btb_inner_sharable: + mov r0, #0 + mcr p15, 0, r0, c7, c1, 6 ; BPIALLIS() + bx lr + + SECTION .cp15_invalid_icache:CODE:NOROOT(2) + PUBLIC cp15_invalid_icache +cp15_invalid_icache: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 0 ; ICIALLU() + bx lr + + SECTION .cp15_invalid_icache_by_mva:CODE:NOROOT(2) + PUBLIC cp15_invalid_icache_by_mva +cp15_invalid_icache_by_mva: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 1 ; ICIMVAU() + bx lr + + SECTION .cp15_invalid_btb:CODE:NOROOT(2) + PUBLIC cp15_invalid_btb +cp15_invalid_btb: + mov r0, #0 + mcr p15, 0, r0, c7, c5, 6 ; BPIALL() + bx lr + + SECTION .cp15_invalid_btb_by_mva:CODE:NOROOT(2) + PUBLIC cp15_invalid_btb_by_mva +cp15_invalid_btb_by_mva: + mcr p15, 0, r0, c7, c5, 7 ; BPIMVA() + bx lr + +/*********************************************************** + * Data Cache related maintenance functions + ***********************************************************/ + + SECTION .cp15_invalid_dcache_by_set_way:CODE:NOROOT(2) + PUBLIC cp15_invalid_dcache_by_set_way +cp15_invalid_dcache_by_set_way: + push {r1-r4} + mrc p15, 1, r0, c0, c0, 0 ; Read CCSIDR + mov r1, r0, lsr #3 ; Get Associativity (num of ways) + and r1, r1, #3 ; 3 is specific to CortexA5 with 32 KB + mov r2, r0, lsr #13 ; Get NumSets (num of sets) + and r2, r2, #0xFF ; 8bit is specific to CortexA5 with 32 KB + mov r0, #0 ; 0:SHL:5 +dinv_way_loop: + lsl r4, r1, #30 + mov r3, r2 +dinv_set_loop: + orr r0, r4, r3, lsl #5 + mcr p15, 0, r0, c7, c6, 2 ; DCISW() + subs r3, r3, #1 ; 1:SHL:30 + bpl dinv_set_loop + subs r1, r1, #1 + bpl dinv_way_loop + dsb + pop {r1-r4} + bx lr + + SECTION .cp15_clean_dcache_by_set_way:CODE:NOROOT(2) + PUBLIC cp15_clean_dcache_by_set_way +cp15_clean_dcache_by_set_way: + push {r1-r4} + mrc p15, 1, r0, c0, c0, 0 ; Read CCSIDR + mov r1, r0, lsr #3 ; Get Associativity (num of ways) + and r1, r1, #3 ; 3 is specific to CortexA5 with 32 KB + mov r2, r0, lsr #13 ; Get NumSets (num of sets) + and r2, r2, #0xFF ; 8bit is specific to CortexA5 with 32 KB + mov r0, #0 ; 0:SHL:5 +dclean_way_loop: + lsl r4, r1, #30 + mov r3, r2 +dclean_set_loop: + orr r0, r4, r3, lsl #5 + mcr p15, 0, r0, c7, c10, 2 ; DCCSW() + subs r3, r3, #1 ; 1:SHL:30 + bpl dclean_set_loop + subs r1, r1, #1 + bpl dclean_way_loop + dsb + pop {r1-r4} + bx lr + + SECTION .cp15_clean_invalid_dcache_by_set_way:CODE:NOROOT(2) + PUBLIC cp15_clean_invalid_dcache_by_set_way +cp15_clean_invalid_dcache_by_set_way: + push {r1-r4} + mrc p15, 1, r0, c0, c0, 0 ; Read CCSIDR + mov r1, r0, lsr #3 ; Get Associativity (num of ways) + and r1, r1, #3 ; 3 is specific to CortexA5 with 32 KB + mov r2, r0, lsr #13 ; Get NumSets (num of sets) + and r2, r2, #0xFF ; 8bit is specific to CortexA5 with 32 KB + mov r0, #0 ; 0:SHL:5 +dclinv_way_loop: + lsl r4, r1, #30 + mov r3, r2 +dclinv_set_loop: + orr r0, r4, r3, lsl #5 + mcr p15, 0, r0, c7, c14, 2 ; DCCISW() + subs r3, r3, #1 ; 1:SHL:30 + bpl dclinv_set_loop + subs r1, r1, #1 + bpl dclinv_way_loop + dsb + pop {r1-r4} + bx lr + + SECTION .cp15_invalid_dcache_by_mva:CODE:NOROOT(2) + PUBLIC cp15_invalid_dcache_by_mva +cp15_invalid_dcache_by_mva: + mov r2, #0x20 ; Eight words per line, Cortex-A5 L1 Line Size 32 Bytes + mov r3, r0 +inv_loop: + mcr p15, 0, r0, c7, c6, 1 ; DCIMVAC() + add r3, r3, r2 + cmp r3, r1 + bls inv_loop + bx lr + + SECTION .cp15_clean_dcache_by_mva:CODE:NOROOT(2) + PUBLIC cp15_clean_dcache_by_mva +cp15_clean_dcache_by_mva: + mov r2, #0x20 ; Eight words per line, Cortex-A5 L1 Line Size 32 Bytes + mov r3, r0 +clean_loop: + mcr p15, 0, r0, c7, c10, 1 ; DCCMVAC() + add r3, r3, r2 + cmp r3, r1 + bls clean_loop + bx lr + + SECTION .cp15_clean_dcache_umva:CODE:NOROOT(2) + PUBLIC cp15_clean_dcache_umva +cp15_clean_dcache_umva: + mov r0, #0 + mcr p15, 0, r0, c7, c11, 1 ; DCCMVAU() + bx lr + + SECTION .cp15_clean_invalid_dcache_by_mva:CODE:NOROOT(2) + PUBLIC cp15_clean_invalid_dcache_by_mva +cp15_clean_invalid_dcache_by_mva: + mov r2, #0x20 ; Eight words per line, Cortex-A5 L1 Line Size 32 Bytes + mov r3, r0 +clinv_loop: + mcr p15, 0, r0, c7, c14, 1 ; DCCIMVAC() + add r3, r3, r2 + cmp r3, r1 + bls clinv_loop + bx lr + + SECTION .cp15_coherent_dcache_for_dma:CODE:NOROOT(2) + PUBLIC cp15_coherent_dcache_for_dma +cp15_coherent_dcache_for_dma: + push {r2-r4} + mrc p15, 0, r3, c0, c0, 1 ; read Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf ; DminLine + mov r2, #4 + mov r2, r2, lsl r3 ; cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 ; cache line mask + bic r4, r0, r3 ; address of the first cache line +loop1: + mcr p15, 0, r4, c7, c11, 1 ; DCCMVAU() + add r4, r4, r2 + cmp r4, r1 + blo loop1 + dsb + + bic r4, r0, r3 +loop2: + mcr p15, 0, r4, c7, c5, 1 ; ICIMVAU() + add r4, r4, r2 + cmp r4, r1 + blo loop2 + mov r0, #0 + mcr p15, 0, r0, c7, c1, 6 ; BPIALLIS() + mcr p15, 0, r0, c7, c5, 6 ; BPIALL() + dsb + isb + pop {r2-r4} + bx lr + + SECTION .cp15_invalidate_dcache_for_dma:CODE:NOROOT(2) + PUBLIC cp15_invalidate_dcache_for_dma +cp15_invalidate_dcache_for_dma: + push {r2-r3} + mrc p15, 0, r3, c0, c0, 1 ; read CP15 Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf ; DminLine + mov r2, #4 + mov r2, r2, lsl r3 ; cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 ; cache line mask + bic r0, r0, r3 ; address of the first cache line +loop3: + mcr p15, 0, r0, c7, c6, 1 ; CP15:DCIMVAC(r0) + add r0, r0, r2 + cmp r0, r1 ; while ('cache line address' < 'end') + blo loop3 + dsb + pop {r2-r3} + bx lr + + SECTION .cp15_clean_dcache_for_dma:CODE:NOROOT(2) + PUBLIC cp15_clean_dcache_for_dma +cp15_clean_dcache_for_dma: + mrc p15, 0, r3, c0, c0, 1 ; read Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf ; DminLine + mov r2, #4 + mov r2, r2, lsl r3 ; cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 ; cache line mask + bic r0, r0, r3 ; address of the first cache line +loop4: + mcr p15, 0, r0, c7, c10, 1 ; DCCMVAC() + add r0, r0, r2 + cmp r0, r1 + blo loop4 + dsb + bx lr + + SECTION .cp15_flush_dcache_for_dma:CODE:NOROOT(2) + PUBLIC cp15_flush_dcache_for_dma +cp15_flush_dcache_for_dma: + mrc p15, 0, r3, c0, c0, 1 ; read Cache Type Register + lsr r3, r3, #16 + and r3, r3, #0xf ; DminLine + mov r2, #4 + mov r2, r2, lsl r3 ; cache line size, in bytes (4*2^DminLine) + + sub r3, r2, #1 ; cache line mask + bic r0, r0, r3 ; address of the first cache line +loop5: + mcr p15, 0, r0, c7, c14, 1 ; DCCIMVAC() + add r0, r0, r2 + cmp r0, r1 + blo loop5 + dsb + bx lr + + END diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.c new file mode 100644 index 000000000..d48023e2a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.c @@ -0,0 +1,252 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#if defined(__ICCARM__) +#include +#endif + +#include "cortex-a/cp15_pmu.h" + +#include + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Resets the counter and enables/disables all counters including PMCCNTR. + * \param ResetCounterType CounterType: Performance or Cycle counter + */ +static void cp15_pmu_control(uint8_t ResetCounterType, uint8_t EnableCounter) +{ + uint32_t PMU_Value = 0; + + asm("mrc p15, 0, %0, c9, c12, 0":"=r"(PMU_Value)); + PMU_Value |= ((ResetCounterType << 1) | EnableCounter); + asm("mcr p15, 0, %0, c9, c12, 0": :"r"(PMU_Value)); +} + +/** + * \brief Select Cycle Count divider + * \param Divider 0 for increment of counter at every single cycle or 1 for at every 64th cycle + */ +static void cp15_cycle_count_divider(uint8_t Divider) +{ + uint32_t PMU_Value = 0; + assert((Divider > 1 ? 0 : 1)); + asm("mrc p15, 0, %0, c9, c12, 0":"=r"(PMU_Value)); + PMU_Value |= (Divider << 3); + asm("mcr p15, 0, %0, c9, c12, 0": :"r"(PMU_Value)); +} + +/** + * \brief Enables PMCCNTR. + */ +static void cp15_enable_PMCNT(void) +{ + uint32_t CNT_Value = 0; + asm("mrc p15, 0, %0, c9, c12, 1":"=r"(CNT_Value)); + CNT_Value |= (uint32_t) ((1 << CP15_PMCNTENSET)); + asm("mcr p15, 0, %0, c9, c12, 1": :"r"(CNT_Value)); +} + +/** + * \brief Enables PMCCNTR. + */ +static void cp15_enable_counter(uint8_t Counter) +{ + uint32_t CNT_Value = 0; + asm("mrc p15, 0, %0, c9, c12, 1":"=r"(CNT_Value)); + CNT_Value |= Counter; + asm("mcr p15, 0, %0, c9, c12, 1": :"r"(CNT_Value)); +} + +/** + * \brief Disables/clear PMCCNTR. + * \param Counter 0 or 1 to selct counter + */ + +static void cp15_clear_PMCNT(void) +{ + uint32_t CNT_Value = 0; + asm("mrc p15, 0, %0, c9, c12, 2":"=r"(CNT_Value)); + CNT_Value |= (uint32_t) (1 << CP15_PMCNTENCLEAR); + asm("mcr p15, 0, %0, c9, c12, 2": :"r"(CNT_Value)); +} + +/** + * \brief Disables/Enables overflow flag. + * \param Enable Enables or disables the flag option + * \param ClearCounterFlag selects the counter flag to clear + */ +void cp15_overflow_status(uint8_t Enable, uint8_t ClearCounterFlag) +{ + uint32_t OFW_Value = 0; + asm("mrc p15, 0, %0, c9, c12, 3":"=r"(OFW_Value)); + OFW_Value |= ((Enable << 31) | ClearCounterFlag); + asm("mcr p15, 0, %0, c9, c12, 3": :"r"(OFW_Value)); +} + +/** + * \brief Disables/Enables overflow flag. + * \param EventCounter Counter of the events + */ +uint32_t cp15_read_overflow_status(uint8_t EventCounter) +{ + uint32_t OFW_Value = 0; + asm("mrc p15, 0, %0, c9, c12, 3":"=r"(OFW_Value)); + OFW_Value = ((OFW_Value & EventCounter) >> (EventCounter - 1)); + return OFW_Value; +} + +/** + * \brief Increments the count of a performance monitor count register. + * \param IncrCounter 0 or 1 counters + */ +void cp15_soft_incr(uint8_t IncrCounter) +{ + uint32_t INRC_Value = 0; + asm("mrc p15, 0, %0, c9, c12, 4":"=r"(INRC_Value)); + INRC_Value |= IncrCounter; + asm("mcr p15, 0, %0, c9, c12, 4": :"r"(INRC_Value)); +} + +/** + * \brief Increments the count of a performance monitor count register. + * \param EventType Select Event Type + * \param Counter 0 or 1 counters + */ +static void cp15_select_event(PerfEventType EventType, uint8_t Counter) +{ + uint32_t CounterSelect = 0; + assert((Counter == 1) || (Counter == 2)); + CounterSelect = (Counter & 0x1F); + asm("mcr p15, 0, %0, c9, c12, 5": :"r"(CounterSelect)); + CounterSelect = (EventType & 0xFF); + asm("mcr p15, 0, %0, c9, c13, 1": :"r"(CounterSelect)); + // PMXEVTYPER + asm("mrc p15, 0, %0, c9, c13, 1":"=r"(CounterSelect)); + // PMXEVTYPER +} + +/** + * \brief Enables USER mode + */ +void cp15_enable_user_mode(void) +{ + uint8_t Value = 1; + asm("mcr p15, 0, %0, c9, c14, 0": :"r"(Value)); +} + +/** + * \brief Enables Oveflows interrupt + * \param Enable Enables the Interrupt + * \param Counter 0 or 1 counters + */ +void cp15_enable_interrupt(uint8_t Enable, uint8_t Counter) +{ + uint32_t ITE_Value = 0; + ITE_Value |= ((Enable << 31) | Counter); + asm("mcr p15, 0, %0, c9, c14, 1": :"r"(ITE_Value)); +} + +/** + * \brief Disables Oveflows interrupt + * \param Disable Disables the Interrupt + * \param Counter 0 or 1 counters + */ +void cp15_disable_interrupt(uint8_t Disable, uint8_t Counter) +{ + uint32_t ITE_Value = 0; + ITE_Value |= ((Disable << 31) | Counter); + asm("mcr p15, 0, %0, c9, c14, 2": :"r"(ITE_Value)); +} + +/** + * \brief Initialize Cycle counter with Divider 64 + */ +uint32_t cp15_init_cycle_counter(void) +{ + uint32_t value; + cp15_clear_PMCNT(); + cp15_enable_PMCNT(); + cp15_overflow_status(true, CP15_BothCounter); + cp15_cycle_count_divider(CP15_CountDivider64); + cp15_pmu_control(CP15_ResetCycCounter, true); + + asm("mrc p15, 0, %0, c9, c13, 0":"=r"(value)); + return value; + +} + +/** + * \brief Initialize Performance monitor counter with Divider 64 + * \param Event Event type + * \param Counter 0 or 1 counters + */ + +void cp15_init_perf_counter(PerfEventType Event, uint8_t Counter) +{ + cp15_pmu_control(CP15_ResetPerCounter, true); + cp15_select_event(Event, Counter); + cp15_overflow_status(false, CP15_BothCounter); + cp15_enable_counter(Counter); +} + +/** + * \brief gives total number of event count + * \param Counter 0 or 1 counters + */ +uint32_t cp15_count_evt(uint8_t Counter) +{ + uint32_t value; + asm("mcr p15, 0, %0, c9, c12, 5": :"r"(Counter)); + asm("mrc p15, 0, %0, c9, c13, 2":"=r"(value)); + // PMXEVTYPER + return (value); +} + +/** + * \brief gives total number of cycle count + + */ +uint32_t cp15_get_cycle_counter(void) +{ + uint32_t value; + asm("mrc p15, 0, %0, c9, c13, 0":"=r"(value)); + return value; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.h new file mode 100644 index 000000000..bf97dd5d5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cp15_pmu.h @@ -0,0 +1,106 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CP15_PMU_H +#define _CP15_PMU_H + +/*---------------------------------------------------------------------------- + * Definition + *----------------------------------------------------------------------------*/ + +#define CP15_PMCNTENSET 31 +#define CP15_PMCNTENCLEAR 31 +#define CP15_PMCR_DIVIDER 3 +#define CP15_PMCR_RESET 2 +#define CP15_PMCR_ENABLE 0 + +#define CP15_NoReset 0 +#define CP15_ResetPerCounter 1 +#define CP15_ResetCycCounter 2 +#define CP15_ResetPerCycCounter 3 + +#define CP15_CountDividerSingle 0 +#define CP15_CountDivider64 1 + +#define CP15_CounterNone 0 +#define CP15_Counter0 1 +#define CP15_Counter1 2 +#define CP15_BothCounter 3 + +typedef enum { + L1_IC_FILL, // Level 1 instruction cache refill + L1_ITLB_FILL, // Level 1 instruction TLB refill + L1_DC_FILL, // Level 1 data cache refill + L1_DC_ACC, // Level 1 data cache access + L1_DTLB_FILL, // Level 1 data TLB refill + LOAD, // Load + STORE, // Store + InstArchExec, // Instruction architecturally executed + ExcepetionTaken, // Exception taken + ExcepetionRet, // Exception return + WrCONTEXTIDR, // Write to CONTEXTIDR + SoftPCChange, // Software change of the PC + ImmBr, // Immediate branch + ProcRet, // Procedure return + UnalingedLdStr, // Unaligned load or store + MispredictedBranchExec, // Mispredicted or not predicted branch speculatively executed + PredictedBranchExec, // Predictable branch speculatively executed + DataMemAcc, // Data memory access. + ICAcc, // Instruction Cache access. + DCEviction, // Data cache eviction. + IRQException, // IRQ exception taken. + FIQException, // FIQ exception taken. + ExtMemReq, // External memory request. + NCExtMemReq, // Non-cacheable external memory request + PrefetchLineFill, // Linefill because of prefetch. + PrefetchLineDrop, // Prefetch linefill dropped. + EnteringRAmode, // Entering read allocate mode. + RAmode, // Read allocate mode. + reserved, // Reserved, do not use + DWstallSBFfull // Data Write operation that stalls the pipeline because the store buffer is full. +} PerfEventType; + +/*---------------------------------------------------------------------------- + * Functions + *----------------------------------------------------------------------------*/ + +extern uint32_t cp15_init_cycle_counter(void); +extern uint32_t cp15_get_cycle_counter(void); + +extern uint32_t cp15_read_overflow_status(uint8_t EventCounter); +extern void cp15_overflow_status(uint8_t Enable, uint8_t ClearCounterFlag); +extern void cp15_soft_incr(uint8_t IncrCounter); + +extern uint32_t cp15_count_evt(uint8_t Counter); +extern void cp15_enable_user_mode(void); +extern void cp15_enable_interrupt(uint8_t Enable, uint8_t Counter); +extern void cp15_disable_interrupt(uint8_t Disable, uint8_t Counter); +extern void cp15_init_perf_counter(PerfEventType Event, uint8_t Counter); + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr.h new file mode 100644 index 000000000..8d99d04a5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr.h @@ -0,0 +1,43 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 CPSR_HEARDER_ +#define CPSR_HEARDER_ + +#include + +#define CPSR_MASK_IRQ 0x00000080 +#define CPSR_MASK_FIQ 0x00000040 + +extern void v_arm_clr_cpsr_bits(uint32_t mask); + +extern void v_arm_set_cpsr_bits(uint32_t mask); + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_gcc.S b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_gcc.S new file mode 100644 index 000000000..2d59b9eba --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_gcc.S @@ -0,0 +1,55 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Functions to access CPSR + *----------------------------------------------------------------------------*/ + + .section .text.v_arm_clr_cpsr_bits + .global v_arm_clr_cpsr_bits +v_arm_clr_cpsr_bits: + push {r1} + mrs r1, cpsr + mvn r0, r0 + and r1, r1,r0 + msr CPSR_c, r1 + pop {r1} + bx lr + + .section .text.v_arm_set_cpsr_bits + .global v_arm_set_cpsr_bits +v_arm_set_cpsr_bits: + push {r1} + mrs r1, cpsr + orr r1, r1, r0 + msr cpsr_c, r1 + pop {r1} + bx lr diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_iar.s b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_iar.s new file mode 100644 index 000000000..9aefc138d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/cpsr_iar.s @@ -0,0 +1,63 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + + MODULE ?cpsr + + /* Forward declaration of sections. */ + SECTION IRQ_STACK:DATA:NOROOT(2) + SECTION CSTACK:DATA:NOROOT(3) + +/*---------------------------------------------------------------------------- + * Functions to access CPSR + *----------------------------------------------------------------------------*/ + + SECTION .v_arm_clr_cpsr_bits:CODE:NOROOT(2) + PUBLIC v_arm_clr_cpsr_bits +v_arm_clr_cpsr_bits: + push {r1} + mrs r1, cpsr + mvn r0, r0 + and r1, r1,r0 + msr CPSR_c, r1 + pop {r1} + bx lr + + SECTION .v_arm_set_cpsr_bits:CODE:NOROOT(2) + PUBLIC v_arm_set_cpsr_bits +v_arm_set_cpsr_bits: + push {r1} + mrs r1, cpsr + orr r1, r1, r0 + msr cpsr_c, r1 + pop {r1} + bx lr + + END diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.c new file mode 100644 index 000000000..505792075 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.c @@ -0,0 +1,89 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/** + * \addtogroup mmu MMU Initialization + * + * \section Usage + * + * Translation Lookaside Buffers (TLBs) are an implementation technique that caches translations or + * translation table entries. TLBs avoid the requirement for every memory access to perform a translation table + * lookup. The ARM architecture does not specify the exact form of the TLB structures for any design. In a + * similar way to the requirements for caches, the architecture only defines certain principles for TLBs: + * + * The MMU supports memory accesses based on memory sections or pages: + * Supersections Consist of 16MB blocks of memory. Support for Supersections is optional. + * -# Sections Consist of 1MB blocks of memory. + * -# Large pages Consist of 64KB blocks of memory. + * -# Small pages Consist of 4KB blocks of memory. + * + * Access to a memory region is controlled by the access permission bits and the domain field in the TLB entry. + * Memory region attributes + * Each TLB entry has an associated set of memory region attributes. These control accesses to the caches, + * how the write buffer is used, and if the memory region is Shareable and therefore must be kept coherent. + * + * Related files:\n + * \ref mmu.c\n + * \ref mmu.h \n + */ + +/*------------------------------------------------------------------------------ */ +/* Headers */ +/*------------------------------------------------------------------------------ */ + +#include "chip.h" +#include "board.h" +#include "cortex-a/cp15.h" +#include "cortex-a/mmu.h" + +#include "compiler.h" + +/*------------------------------------------------------------------------------ */ +/* Local variables */ +/*------------------------------------------------------------------------------ */ + +ALIGNED(16384) static uint32_t _tlb[4096]; + +/*------------------------------------------------------------------------------ */ +/* Exported functions */ +/*------------------------------------------------------------------------------ */ + +void mmu_initialize(void) +{ + board_setup_tlb(_tlb); + cp15_write_ttb((unsigned int)_tlb); + /* Program the domain access register */ + /* only domain 15: access are not checked */ + cp15_write_domain_access_control(0xC0000000); + asm volatile("": : :"memory"); + asm("dsb"); + asm("isb"); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.h new file mode 100644 index 000000000..9053fb264 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/cortex-a/mmu.h @@ -0,0 +1,79 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _MMU_ +#define _MMU_ + +/*---------------------------------------------------------------------------- + * Exported definitions + *----------------------------------------------------------------------------*/ + +#define TTB_TYPE(x) ((x) << 0) +#define TTB_TYPE_SECT TTB_TYPE(2) + +#define TTB_SECT_B(x) ((x) << 2) +#define TTB_SECT_WRITE_THROUGH TTB_SECT_B(0) +#define TTB_SECT_WRITE_BACK TTB_SECT_B(1) + +#define TTB_SECT_C(x) ((x) << 3) +#define TTB_SECT_NON_CACHEABLE TTB_SECT_C(0) +#define TTB_SECT_CACHEABLE TTB_SECT_C(1) + +#define TTB_SECT_XN(x) ((x) << 4) +#define TTB_SECT_EXEC TTB_SECT_XN(0) +#define TTB_SECT_EXEC_NEVER TTB_SECT_XN(1) + +#define TTB_SECT_DOMAIN(x) ((x) << 5) + +#define TTB_SECT_AP(x) ((x) << 10) +#define TTB_SECT_APX(x) ((x) << 15) +#define TTB_SECT_AP_PRIV_ONLY (TTB_SECT_APX(0) | TTB_SECT_AP(1)) +#define TTB_SECT_AP_NO_USER_WRITE (TTB_SECT_APX(0) | TTB_SECT_AP(2)) +#define TTB_SECT_AP_FULL_ACCESS (TTB_SECT_APX(0) | TTB_SECT_AP(3)) +#define TTB_SECT_AP_PRIV_READ_ONLY (TTB_SECT_APX(1) | TTB_SECT_AP(1)) +#define TTB_SECT_AP_READ_ONLY (TTB_SECT_APX(1) | TTB_SECT_AP(2)) + +#define TTB_SECT_TEX(x) ((x) << 12) +#define TTB_SECT_STRONGLY_ORDERED (TTB_SECT_TEX(0) | TTB_SECT_NON_CACHEABLE | TTB_SECT_WRITE_THROUGH) +#define TTB_SECT_SHAREABLE_DEVICE (TTB_SECT_TEX(0) | TTB_SECT_NON_CACHEABLE | TTB_SECT_WRITE_BACK) +#define TTB_SECT_CACHEABLE_WT (TTB_SECT_TEX(0) | TTB_SECT_CACHEABLE | TTB_SECT_WRITE_THROUGH) +#define TTB_SECT_CACHEABLE_WB (TTB_SECT_TEX(0) | TTB_SECT_CACHEABLE | TTB_SECT_WRITE_BACK) + +#define TTB_SECT_ADDR(x) ((x) & 0xFFF00000) + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief initializes the MMU + */ +extern void mmu_initialize(void); + +#endif /* #ifndef _MMU_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/Makefile.inc new file mode 100644 index 000000000..fb30396a3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/Makefile.inc @@ -0,0 +1,32 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2015, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +drivers-y += drivers/misc/console.o +drivers-y += drivers/misc/led.o + +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/misc/bmp280.o \ No newline at end of file diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.c new file mode 100644 index 000000000..8789389d5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.c @@ -0,0 +1,1162 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Implementation BMP280 driver. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "chip.h" +#include "math.h" +#include "misc/bmp280.h" +#include "peripherals/pio.h" +#include "peripherals/twid.h" +#include "peripherals/twi.h" +#include +#include +#include +#include + +/*------------------------------------------------------------------------------ + * Local definitions + *----------------------------------------------------------------------------*/ + +#define EPSILON (1e-10) + +/*------------------------------------------------------------------------------ + * Local functions + *----------------------------------------------------------------------------*/ + +static uint8_t _bmp280_read(struct _bmp280* bmp280, uint8_t* buffer, uint32_t len) +{ + struct _buffer in = { + .data = buffer, + .size = len + }; + return (uint8_t)twid_transfert(bmp280->twid, &in, 0, twid_finish_transfert_callback, 0); +} + +static uint8_t _bmp280_write(struct _bmp280* bmp280, const uint8_t* buffer, uint32_t len) +{ + struct _buffer out = { + .data = (uint8_t*)buffer, + .size = len + }; + return (uint8_t)twid_transfert(bmp280->twid, 0, &out, twid_finish_transfert_callback, 0); +} + +/*------------------------------------------------------------------------------ + * Global functions + *----------------------------------------------------------------------------*/ + +/* Write the data to the given register + * + * Param addr -> Address of the register + * data -> The data from the register + * len -> no of bytes to read + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_write_register(struct _bmp280* bmp280, uint8_t addr, uint8_t* pdata, uint8_t len) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = addr; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, pdata, len); + } + return com_rslt; +} + +/* Reads the data from the given register + * + * Param addr -> Address of the register + * data -> The data from the register + * len -> no of bytes to read + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_read_register(struct _bmp280* bmp280, uint8_t addr, uint8_t* pdata, uint8_t len) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = addr; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, pdata, len); + } + return com_rslt; +} + +/* + * Read uncompensated temperature in the registers + * 0xFA, 0xFB and 0xFC + * 0xFA -> MSB -> bit from 0 to 7 + * 0xFB -> LSB -> bit from 0 to 7 + * 0xFC -> LSB -> bit from 4 to 7 + * + * Param uncT : The uncompensated temperature. + * + * Return results of bus communication function + * 0 -> Success + * -1 -> Error + */ +uint8_t bmp280_read_uncompensed_temperature (struct _bmp280* bmp280, int32_t* uncT) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + /* Array holding the MSB and LSb value + dt[0] - Temperature MSB + dt[1] - Temperature LSB + dt[2] - Temperature LSB + */ + uint8_t dt[3] = {0}; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read temperature data */ + bmp280->twid->iaddr = BMP280_TEMPERATURE_MSB_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &dt[0], 3); + *uncT = (int32_t)((((uint32_t) (dt[0])) << 12) | + (((uint32_t)(dt[1])) << 4) | ((uint32_t)dt[2] >> 4)); + } + return com_rslt; +} + +/* Reads actual temperature from uncompensated temperature + * Returns the value in 0.01 degree Centigrade + * Output value of "5123" equals 51.23 DegC. + * + * param uncT : value of uncompensated temperature + * + * return Actual temperature output as s32 + */ +int32_t bmp280_compensate_temperatureC (struct _bmp280* bmp280, int32_t uncT) +{ + int32_t x1 = 0; + int32_t x2 = 0; + int32_t temperature = 0; + + /* calculate true temperature*/ + x1 = ((((uncT >> 3) - ((int32_t)bmp280->calpar.dig_T1 + << 1))) * ((int32_t)bmp280->calpar.dig_T2)) >> 11; + x2 = (((((uncT >> 4) - ((int32_t)bmp280->calpar.dig_T1)) * + ((uncT >> 4) - ((int32_t)bmp280->calpar.dig_T1))) + >> 12) * ((int32_t)bmp280->calpar.dig_T3)) >> 14; + bmp280->calpar.t_fine = x1 + x2; + temperature = (bmp280->calpar.t_fine * BMP280_DEC_TRUE_TEMP_5 + + BMP280_DEC_TRUE_TEMP_128) >> 8; + return temperature; +} + +/* Read uncompensated pressure. + * in the registers 0xF7, 0xF8 and 0xF9 + * 0xF7 -> MSB -> bit from 0 to 7 + * 0xF8 -> LSB -> bit from 0 to 7 + * 0xF9 -> LSB -> bit from 4 to 7 + * + * param uncP : The value of uncompensated pressure + * + * return results of bus communication function + * 0 -> Success + * -1 -> Error + */ +uint8_t bmp280_read_uncompensed_pressure (struct _bmp280* bmp280, int32_t* uncP) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + /* Array holding the MSB and LSb value + dt[0] - Pressure MSB + dt[1] - Pressure LSB + dt[2] - Pressure LSB + */ + uint8_t dt[3] = {0}; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_PRESSURE_MSB_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &dt[0], 3); + *uncP = (int32_t)((((uint32_t)(dt[0])) << 12) | + (((uint32_t)(dt[1])) << 4) | ((uint32_t)dt[2] >> 4)); + } + return com_rslt; +} + +/* + * Reads actual pressure from uncompensated pressure and returns the value in + * Pascal(Pa) + * + * Note: Output value of "96386" equals 96386 Pa = 963.86 hPa = 963.86 millibar + * + * Param uncP: value of uncompensated pressure + * + * Return Returns the Actual pressure out put as s32 + */ +uint32_t bmp280_compensate_pressureP (struct _bmp280* bmp280, int32_t uncP) +{ + int32_t x1 = 0; + int32_t x2 = 0; + uint32_t pressure = 0; + + /* calculate true pressure*/ + x1 = (((int32_t)bmp280->calpar.t_fine) >> 1) - (int32_t)BMP280_DEC_TRUE_PRES_64000; + x2 = (((x1 >> 2) * (x1 >> 2)) >> 11) * ((int32_t)bmp280->calpar.dig_P6); + x2 = x2 + ((x1 * ((int32_t)bmp280->calpar.dig_P5)) << 1); + x2 = (x2 >> 2) + (((int32_t)bmp280->calpar.dig_P4) << 16); + x1 = (((bmp280->calpar.dig_P3 * (((x1 >> 2) * (x1 >> 2)) >> 13)) >> 3) + + ((((int32_t)bmp280->calpar.dig_P2) * x1) >> 1)) >> 18; + x1 = ((((BMP280_DEC_TRUE_PRES_32768 + x1)) * ((int32_t)bmp280->calpar.dig_P1)) >> 15); + pressure = (((uint32_t)(((int32_t)BMP280_DEC_TRUE_PRES_1048576) - uncP) - + (x2 >> 12))) * BMP280_DEC_TRUE_PRES_3125; + + if (pressure < BMP280_HEX_TRUE_PRES_8M) + /* Avoid exception caused by division by zero */ + if (x1 != 0) + pressure = (pressure << 1) / ((uint32_t)x1); + else + return 0; + else + /* Avoid exception caused by division by zero */ + if (x1 != 0) + pressure = (pressure / (uint32_t)x1) * BMP280_DEC_TRUE_PRES_2; + else + return 0; + + x1 = (((int32_t)bmp280->calpar.dig_P9)* ((int32_t)(((pressure>>3)* (pressure>>3))>>13)))>>12 ; + x2 = (((int32_t)(pressure >> 2))*((int32_t)bmp280->calpar.dig_P8))>>13; + pressure = (uint32_t)((int32_t)pressure + ((x1 + x2 + bmp280->calpar.dig_P7)>>4)); + + return pressure; +} + + +/* + * Reads uncompensated pressure and temperature + * + * Param uncP: The value of uncompensated pressure. + * uncT: The value of uncompensated temperature. + * + * Return results of bus communication function + * 0 -> Success + * -1 -> Error + */ +uint8_t bmp280_read_uncompensed_pressure_temperature (struct _bmp280* bmp280, int32_t* uncP, int32_t* uncT) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + + /* Array holding the temperature and pressure data + dt[0] - Pressure MSB + dt[1] - Pressure LSB + dt[2] - Pressure LSB + dt[3] - Temperature MSB + dt[4] - Temperature LSB + dt[5] - Temperature LSB + */ + uint8_t dt[6] = {0}; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_PRESSURE_MSB_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &dt[0], 6); + /*Pressure*/ + *uncP = (int32_t)((((uint32_t)(dt[0]))<<12) | (((uint32_t)(dt[1]))<<4) | ((uint32_t)dt[2]>>4)); + /* Temperature */ + *uncT = (int32_t)((((uint32_t)(dt[3]))<<12) | (((uint32_t)(dt[4]))<<4) | ((uint32_t)dt[5]>>4)); + } + return com_rslt; +} + +/* + * Reads the true pressure and temperature + * + * Param pressure : The value of compensated pressure. + * temperature : The value of compensated temperature. + * + * Return results of bus communication function + * 0 -> Success + * -1 -> Error + */ + +uint8_t bmp280_read_pressure_temperature (struct _bmp280* bmp280, uint32_t* pressure, int32_t* temperature) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + int32_t uncP = 0; + int32_t uncT = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read uncompensated pressure and temperature*/ + com_rslt = bmp280_read_uncompensed_pressure_temperature(bmp280, &uncP, &uncT); + /* read true pressure and temperature*/ + *temperature = bmp280_compensate_temperatureC(bmp280, uncT); + *pressure = bmp280_compensate_pressureP(bmp280, uncP); + } + return com_rslt; +} + +/* + * Calibration parameters used for calculation in the registers + * + * parameter | Register address | bit + *------------|------------------|---------------- + * dig_T1 | 0x88 and 0x89 | from 0 : 7 to 8: 15 + * dig_T2 | 0x8A and 0x8B | from 0 : 7 to 8: 15 + * dig_T3 | 0x8C and 0x8D | from 0 : 7 to 8: 15 + * dig_P1 | 0x8E and 0x8F | from 0 : 7 to 8: 15 + * dig_P2 | 0x90 and 0x91 | from 0 : 7 to 8: 15 + * dig_P3 | 0x92 and 0x93 | from 0 : 7 to 8: 15 + * dig_P4 | 0x94 and 0x95 | from 0 : 7 to 8: 15 + * dig_P5 | 0x96 and 0x97 | from 0 : 7 to 8: 15 + * dig_P6 | 0x98 and 0x99 | from 0 : 7 to 8: 15 + * dig_P7 | 0x9A and 0x9B | from 0 : 7 to 8: 15 + * dig_P8 | 0x9C and 0x9D | from 0 : 7 to 8: 15 + * dig_P9 | 0x9E and 0x9F | from 0 : 7 to 8: 15 + * + * Return results of bus communication function + * 0 -> Success + * -1 -> Error + */ +uint8_t bmp280_get_calpar (struct _bmp280* bmp280) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t dt[26] = {0}; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_DIG_T1_LSB_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &dt[0], 24); + /* read calibration values*/ + bmp280->calpar.dig_T1 = (uint16_t)((((uint16_t)((uint8_t)dt[1])) << 8) | dt[0]); + bmp280->calpar.dig_T2 = (int16_t)((((int16_t)((int8_t)dt[3])) << 8) | dt[2]); + bmp280->calpar.dig_T3 = (int16_t)((((int16_t)((int8_t)dt[5])) << 8) | dt[4]); + bmp280->calpar.dig_P1 = (uint16_t)((((uint16_t)((uint8_t)dt[7])) << 8) | dt[6]); + bmp280->calpar.dig_P2 = (int16_t)((((int16_t)((int8_t)dt[9])) << 8) | dt[8]); + bmp280->calpar.dig_P3 = (int16_t)((((int16_t)((int8_t)dt[11])) << 8) | dt[10]); + bmp280->calpar.dig_P4 = (int16_t)((((int16_t)((int8_t)dt[13])) << 8) | dt[12]); + bmp280->calpar.dig_P5 = (int16_t)((((int16_t)((int8_t)dt[15])) << 8) | dt[14]); + bmp280->calpar.dig_P6 = (int16_t)((((int16_t)((int8_t)dt[17])) << 8) | dt[16]); + bmp280->calpar.dig_P7 = (int16_t)((((int16_t)((int8_t)dt[19])) << 8) | dt[18]); + bmp280->calpar.dig_P8 = (int16_t)((((int16_t)((int8_t)dt[21])) << 8) | dt[20]); + bmp280->calpar.dig_P9 = (int16_t)((((int16_t)((int8_t)dt[23])) << 8) | dt[22]); + } + return com_rslt; +} + +/* Get the temperature oversampling setting in the register 0xF4 + * bits from 5 to 7 + * + * value | Temperature oversampling + * ------------------------|------------------------------ + * 0x00 | Skipped + * 0x01 | BMP280_OVERSAMP_1X + * 0x02 | BMP280_OVERSAMP_2X + * 0x03 | BMP280_OVERSAMP_4X + * 0x04 | BMP280_OVERSAMP_8X + * 0x05,0x06 and 0x07 | BMP280_OVERSAMP_16X + * + * Param: value :The value of temperature over sampling + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_overs_temp (struct _bmp280* bmp280, uint8_t* value) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read temperature over sampling*/ + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_OVRS_TEMP__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + *value = BMP280_GET_BITSLICE(data, BMP280_CTRL_MEAS_REG_OVRS_TEMP); + /* assign temperature oversampling*/ + bmp280->overs_temp = *value; + } + return com_rslt; +} + +/* Set the temperature oversampling setting in the register 0xF4 + * bits from 5 to 7 + * + * value | Temperature oversampling + * ------------------------|------------------------------ + * 0x00 | Skipped + * 0x01 | BMP280_OVERSAMP_1X + * 0x02 | BMP280_OVERSAMP_2X + * 0x03 | BMP280_OVERSAMP_4X + * 0x04 | BMP280_OVERSAMP_8X + * 0x05,0x06 and 0x07 | BMP280_OVERSAMP_16X + * + * Param: value :The value of temperature over sampling + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_overs_temp (struct _bmp280* bmp280, uint8_t value) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_OVRS_TEMP__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + if (com_rslt == SUCCESS) { + /* write over sampling*/ + data = BMP280_SET_BITSLICE(data, BMP280_CTRL_MEAS_REG_OVRS_TEMP, value); + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_OVRS_TEMP__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + bmp280->overs_temp = value; + } + } + return com_rslt; +} + +/* Get the pressure oversampling setting in the register 0xF4 + * bits from 2 to 4 + * + * value | Pressure oversampling + * ------------------------|------------------------------ + * 0x00 | Skipped + * 0x01 | BMP280_OVERSAMP_1X + * 0x02 | BMP280_OVERSAMP_2X + * 0x03 | BMP280_OVERSAMP_4X + * 0x04 | BMP280_OVERSAMP_8X + * 0x05,0x06 and 0x07 | BMP280_OVERSAMP_16X + * + * Param: value : The value of pressure over sampling + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_overs_pres (struct _bmp280* bmp280, uint8_t* value) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read pressure over sampling */ + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_OVRS_PRES__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + *value = BMP280_GET_BITSLICE(data, BMP280_CTRL_MEAS_REG_OVRS_PRES); + bmp280->overs_pres = *value; + } + return com_rslt; +} + +/* Set the pressure oversampling setting in the register 0xF4 + * bits from 2 to 4 + * + * value | Pressure oversampling + * ------------------------|------------------------------ + * 0x00 | Skipped + * 0x01 | BMP280_OVERSAMP_1X + * 0x02 | BMP280_OVERSAMP_2X + * 0x03 | BMP280_OVERSAMP_4X + * 0x04 | BMP280_OVERSAMP_8X + * 0x05,0x06 and 0x07 | BMP280_OVERSAMP_16X + * + * Param: value : The value of pressure over sampling + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_overs_pres (struct _bmp280* bmp280, uint8_t value) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_OVRS_PRES__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + if (com_rslt == SUCCESS) { + /* write pressure over sampling */ + data = BMP280_SET_BITSLICE(data, BMP280_CTRL_MEAS_REG_OVRS_PRES, value); + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_OVRS_PRES__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + bmp280->overs_pres = value; + } + } + return com_rslt; +} + +/* Get the operational Mode from the sensor in the register 0xF4 bit 0 and 1 + * + * Param: power_mode : The value of power mode value + * value | Power mode + * ------------------|------------------ + * 0x00 | BMP280_SLEEP_MODE + * 0x01 and 0x02 | BMP280_FORCED_MODE + * 0x03 | BMP280_NORMAL_MODE + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_power_mode(struct _bmp280* bmp280, uint8_t* power_mode) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t mode = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read the power mode*/ + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_POWER_MODE__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &mode, 1); + *power_mode = BMP280_GET_BITSLICE(mode, BMP280_CTRL_MEAS_REG_POWER_MODE); + } + return com_rslt; +} + +/* Set the operational Mode from the sensor in the register 0xF4 bit 0 and 1 + * + * Param: power_mode : The value of power mode value + * value | Power mode + * ------------------|------------------ + * 0x00 | BMP280_SLEEP_MODE + * 0x01 and 0x02 | BMP280_FORCED_MODE + * 0x03 | BMP280_NORMAL_MODE + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_power_mode (struct _bmp280* bmp280, uint8_t power_mode) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t mode = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else + { + if (power_mode < 4) { + /* write the power mode*/ + mode = (bmp280->overs_temp << 5) + (bmp280->overs_pres << 2) + power_mode; + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG_POWER_MODE__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &mode, 1); + } + else { + com_rslt = E_BMP280_OUT_OF_RANGE; + } + } + return com_rslt; +} + +/* Reset the sensor + * The value 0xB6 is written to the 0xE0 register the device is reset using the + * complete power-on-reset procedure. + * Softreset can be easily set using bmp280_set_softreset(). + * + * Note Usage Hint : bmp280_set_softreset() + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_soft_rst (struct _bmp280* bmp280) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = BMP280_SOFT_RESET_CODE; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* write soft reset */ + bmp280->twid->iaddr = BMP280_RST_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + } + return com_rslt; +} + +/* Get the sensor SPI mode(communication type) in the register 0xF5 bit 0 + * + * Param: enable_disable : The spi3 enable or disable state + * value | Description + * -----------|--------------- + * 0 | Disable + * 1 | Enable + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_spi3 (struct _bmp280* bmp280, uint8_t* enable_disable) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_CONFIG_REG_SPI3_ENABLE__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + *enable_disable = BMP280_GET_BITSLICE(data, BMP280_CONFIG_REG_SPI3_ENABLE); + } + return com_rslt; +} + +/* Set the sensor SPI mode(communication type) in the register 0xF5 bit 0 + * + * Param: enable_disable : The spi3 enable or disable state + * value | Description + * -----------|--------------- + * 0 | Disable + * 1 | Enable + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_spi3 (struct _bmp280* bmp280, uint8_t enable_disable) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + bmp280->twid->iaddr = BMP280_CONFIG_REG_SPI3_ENABLE__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + if (com_rslt == SUCCESS) { + data = BMP280_SET_BITSLICE(data, BMP280_CONFIG_REG_SPI3_ENABLE, enable_disable); + bmp280->twid->iaddr = BMP280_CONFIG_REG_SPI3_ENABLE__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + } + } + return com_rslt; +} + +/* Reads filter setting in the register 0xF5 bit 3 and 4 + * + * Param value : The value of filter coefficient + * value | Filter coefficient + * -------------|------------------------- + * 0x00 | BMP280_FILTER_COEFF_OFF + * 0x01 | BMP280_FILTER_COEFF_2 + * 0x02 | BMP280_FILTER_COEFF_4 + * 0x03 | BMP280_FILTER_COEFF_8 + * 0x04 | BMP280_FILTER_COEFF_16 + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_filter (struct _bmp280* bmp280, uint8_t *value) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read filter*/ + bmp280->twid->iaddr = BMP280_CONFIG_REG_FILTER__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + *value = BMP280_GET_BITSLICE(data, BMP280_CONFIG_REG_FILTER); + } + return com_rslt; +} + +/* Write filter setting in the register 0xF5 bit 3 and 4 + * + * Param value : The value of filter coefficient + * value | Filter coefficient + * -------------|------------------------- + * 0x00 | BMP280_FILTER_COEFF_OFF + * 0x01 | BMP280_FILTER_COEFF_2 + * 0x02 | BMP280_FILTER_COEFF_4 + * 0x03 | BMP280_FILTER_COEFF_8 + * 0x04 | BMP280_FILTER_COEFF_16 + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_filter (struct _bmp280* bmp280, uint8_t value) +{ + uint8_t com_rslt = SUCCESS; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* write filter*/ + bmp280->twid->iaddr = BMP280_CONFIG_REG_FILTER__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + if (com_rslt == SUCCESS) { + data = BMP280_SET_BITSLICE(data, BMP280_CONFIG_REG_FILTER, value); + bmp280->twid->iaddr = BMP280_CONFIG_REG_FILTER__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + } + } + return com_rslt; +} + +/* Read the standby duration time from the sensor in the register 0xF5 bit 5 to 7 + * + * Param standby_durn : The standby duration time value. + * value | standby duration + * -----------|-------------------- + * 0x00 | BMP280_STANDBYTIME_1_MS + * 0x01 | BMP280_STANDBYTIME_63_MS + * 0x02 | BMP280_STANDBYTIME_125_MS + * 0x03 | BMP280_STANDBYTIME_250_MS + * 0x04 | BMP280_STANDBYTIME_500_MS + * 0x05 | BMP280_STANDBYTIME_1000_MS + * 0x06 | BMP280_STANDBYTIME_2000_MS + * 0x07 | BMP280_STANDBYTIME_4000_MS + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_standby_durn(struct _bmp280* bmp280, uint8_t* standby_durn) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read the standby duration*/ + bmp280->twid->iaddr = BMP280_CONFIG_REG_STANDBY_DURN__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + *standby_durn = BMP280_GET_BITSLICE(data, BMP280_CONFIG_REG_STANDBY_DURN); + } + return com_rslt; +} + +/* Read the standby duration time from the sensor in the register 0xF5 bit 5 to 7 + * + * Note Normal mode comprises an automated perpetual cycling between an (active) + * Measurement period and an (inactive) standby period. + * Note The standby time is determined by the contents of the register t_sb. + * Standby time can be set using BME280_STANDBYTIME_125_MS. + * Note bme280_set_standby_durN(BME280_STANDBYTIME_125_MS) + * + * Param standby_durn : The standby duration time value. + * value | standby duration + * -----------|-------------------- + * 0x00 | BMP280_STANDBYTIME_1_MS + * 0x01 | BMP280_STANDBYTIME_63_MS + * 0x02 | BMP280_STANDBYTIME_125_MS + * 0x03 | BMP280_STANDBYTIME_250_MS + * 0x04 | BMP280_STANDBYTIME_500_MS + * 0x05 | BMP280_STANDBYTIME_1000_MS + * 0x06 | BMP280_STANDBYTIME_2000_MS + * 0x07 | BMP280_STANDBYTIME_4000_MS + * + * @return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_standby_durn (struct _bmp280* bmp280, uint8_t standby_durn) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* write the standby duration*/ + bmp280->twid->iaddr = BMP280_CONFIG_REG_STANDBY_DURN__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + if (com_rslt == SUCCESS) { + data = BMP280_SET_BITSLICE(data, BMP280_CONFIG_REG_STANDBY_DURN, standby_durn); + bmp280->twid->iaddr = BMP280_CONFIG_REG_STANDBY_DURN__REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + } + } + return com_rslt; +} + +/* Write the working mode of the sensor + * + * Param work_mode : The value of work mode + * value | mode + * -------------|------------- + * 0 | BMP280_ULTRA_LOW_POWER_MODE + * 1 | BMP280_LOW_POWER_MODE + * 2 | BMP280_STANDARD_RESOLUTION_MODE + * 3 | BMP280_HIGH_RESOLUTION_MODE + * 4 | BMP280_ULTRA_HIGH_RESOLUTION_MODE + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_set_work_mode (struct _bmp280* bmp280, uint8_t work_mode) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + if (work_mode <= 4) { + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + if (com_rslt == SUCCESS) + { + switch (work_mode) { + /* write work mode*/ + case BMP280_ULTRA_LOW_POWER_MODE: + bmp280->overs_temp = BMP280_ULTRALOWPOWER_OVRS_TEMP; + bmp280->overs_pres = BMP280_ULTRALOWPOWER_OVRS_PRES; + break; + case BMP280_LOW_POWER_MODE: + bmp280->overs_temp = BMP280_LOWPOWER_OVRS_TEMP; + bmp280->overs_pres = BMP280_LOWPOWER_OVRS_PRES; + break; + case BMP280_STANDARD_RESOLUTION_MODE: + bmp280->overs_temp = BMP280_STANDARDRESOLUTION_OVRS_TEMP; + bmp280->overs_pres = BMP280_STANDARDRESOLUTION_OVRS_PRES; + break; + case BMP280_HIGH_RESOLUTION_MODE: + bmp280->overs_temp = BMP280_HIGHRESOLUTION_OVRS_TEMP; + bmp280->overs_pres = BMP280_HIGHRESOLUTION_OVRS_PRES; + break; + case BMP280_ULTRA_HIGH_RESOLUTION_MODE: + bmp280->overs_temp = BMP280_ULTRAHIGHRESOLUTION_OVRS_TEMP; + bmp280->overs_pres = BMP280_ULTRAHIGHRESOLUTION_OVRS_PRES; + break; + } + data = BMP280_SET_BITSLICE(data, BMP280_CTRL_MEAS_REG_OVRS_TEMP, bmp280->overs_temp); + data = BMP280_SET_BITSLICE(data, BMP280_CTRL_MEAS_REG_OVRS_PRES, bmp280->overs_pres); + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + } + } + else { + com_rslt = E_BMP280_OUT_OF_RANGE; + } + } + return com_rslt; +} + +/* Read both uncompensated pressure and temperature in forced mode + * + * Param uncP: The value of uncompensated pressure. + * uncT: The value of uncompensated temperature + * + * Return results of bus communication function + * @retval 0 -> Success + * @retval -1 -> Error + */ +uint8_t bmp280_get_forced_uncP_temperature(struct _bmp280* bmp280, int32_t* uncP, int32_t* uncT) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = ERROR; + uint8_t data = 0; + uint8_t waittime = 0; + + /* check the bmp280 struct pointer as NULL*/ + if (bmp280 == BMP280_NULL) + return E_BMP280_NULL_PTR; + else { + /* read pressure and temperature*/ + data = (bmp280->overs_temp << 5) + (bmp280->overs_pres << 2) + BMP280_FORCED_MODE; + bmp280->twid->iaddr = BMP280_CTRL_MEAS_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_write(bmp280, &data, 1); + bmp280_compute_wait_time(bmp280, &waittime); + bmp280->delay_msec(waittime); + com_rslt += bmp280_read_uncompensed_pressure_temperature(bmp280, uncP, uncT); + } + return com_rslt; +} + + +#ifdef BMP280_ENABLE_FLOAT +/* Read actual temperature from uncompensated temperature + * + * Note Returns the value in Degree centigrade + * Output value of "51.23" equals 51.23 DegC. + * + * Param uncT : value of uncompensated temperature + * + * Return Actual temperature in floating point + */ +double bmp280_compensate_T_double(struct _bmp280* bmp280, int32_t uncT) +{ + double x1 = 0; + double x2 = 0; + double temperature = 0; + + x1 = (((double)uncT) / BMP280_FLOAT_TRUE_TEMP_16384 - + ((double)bmp280->calpar.dig_T1) / BMP280_FLOAT_TRUE_TEMP_1024) * + ((double)bmp280->calpar.dig_T2); + x2 = ((((double)uncT) / BMP280_FLOAT_TRUE_TEMP_131072 - + ((double)bmp280->calpar.dig_T1) / BMP280_FLOAT_TRUE_TEMP_8192) * + (((double)uncT) / BMP280_FLOAT_TRUE_TEMP_131072 - + ((double)bmp280->calpar.dig_T1) / BMP280_FLOAT_TRUE_TEMP_8192)) * + ((double)bmp280->calpar.dig_T3); + bmp280->calpar.t_fine = (int32_t)(x1 + x2); + temperature = (x1 + x2) / BMP280_FLOAT_TRUE_TEMP_5120; + return temperature; +} + +/* Reads actual pressure from uncompensated pressure and returns pressure in + * Pa as double. + * + * Note Output value of "96386.2" equals 96386.2 Pa = 963.862 hPa. + * + * Param uncP : value of uncompensated pressure + * + * Return Actual pressure in floating point + */ +double bmp280_compensate_P_double(struct _bmp280* bmp280, int32_t uncP) +{ + double x1 = 0; + double x2 = 0; + double pressure = 0; + + x1 = ((double)bmp280->calpar.t_fine / BMP280_FLOAT_TRUE_PRES_2) - + BMP280_FLOAT_TRUE_PRES_64000; + x2 = x1 * x1 * ((double)bmp280->calpar.dig_P6) / + BMP280_FLOAT_TRUE_PRES_32768; + x2 = x2 + x1 * ((double)bmp280->calpar.dig_P5) + * BMP280_FLOAT_TRUE_PRES_2; + x2 = (x2 / BMP280_FLOAT_TRUE_PRES_4) + ((double)bmp280->calpar.dig_P4) + * BMP280_FLOAT_TRUE_PRES_65536; + x1 = (((double)bmp280->calpar.dig_P3) * x1 * x1 + / BMP280_FLOAT_TRUE_PRES_524288 + ((double)bmp280->calpar.dig_P2) * x1) + / BMP280_FLOAT_TRUE_PRES_524288; + x1 = (BMP280_FLOAT_TRUE_PRES_1 + x1 / BMP280_FLOAT_TRUE_PRES_32768) * + ((double)bmp280->calpar.dig_P1); + pressure = BMP280_FLOAT_TRUE_PRES_1048576 - (double)uncP; + /* Avoid exception caused by division by zero */ + if (fabs(x1) >= EPSILON) + pressure = (pressure - (x2 / BMP280_FLOAT_TRUE_PRES_4096)) * + BMP280_FLOAT_TRUE_PRES_6250 / x1; + else + return BMP280_FLOAT_TRUE_PRES_0; + x1 = ((double)bmp280->calpar.dig_P9) * pressure * pressure / + BMP280_FLOAT_TRUE_PRES_2147483648; + x2 = pressure * ((double)bmp280->calpar.dig_P8) / BMP280_FLOAT_TRUE_PRES_32768; + pressure = pressure + (x1 + x2 + ((double)bmp280->calpar.dig_P7)) + / BMP280_FLOAT_TRUE_PRES_1_6; + + return pressure; +} +#endif + + +#if defined(BMP280_ENABLE_INT64) && defined(BMP280_64BITSUPPORT_PRESENT) +/* Read actual pressure from uncompensated pressure + * + * Note returns the value in Pa as unsigned 32 bit integer in Q24.8 format + * (24 integer bits and 8 fractional bits). Output value of "24674867" + * represents 24674867 / 256 = 96386.2 Pa = 963.862 hPa + * + * Param uncP : value of uncompensated pressure + * + * Return actual pressure as 64bit output + */ +uint32_t bmp280_compensate_P_int64(struct _bmp280* bmp280, int32_t uncP) +{ + int64_t x1_s64r = 0; + int64_t x2_s64r = 0; + int64_t pressure = 0; + + x1_s64r = ((int64_t)bmp280->calpar.t_fine) - + BMP280_TRUE_PRES_128000; + x2_s64r = x1_s64r * x1_s64r * (int64_t)bmp280->calpar.dig_P6; + x2_s64r = x2_s64r + ((x1_s64r * (int64_t)bmp280->calpar.dig_P5) << 17); + x2_s64r = x2_s64r + (((int64_t)bmp280->calpar.dig_P4) << 35); + x1_s64r = ((x1_s64r * x1_s64r * (int64_t)bmp280->calpar.dig_P3) >> 8) + + ((x1_s64r * (int64_t)bmp280->calpar.dig_P2) << 12); + x1_s64r = (((((int64_t)BMP280_TRUE_PRES_1) << 47) + x1_s64r)) * + ((int64_t)bmp280->calpar.dig_P1) >> 33; + pressure = BMP280_TRUE_PRES_1048576 - uncP; + + if (x1_s64r != 0) +#if defined __KERNEL__ + pressure = div64_s64((((pressure << 31) - x2_s64r) + * BMP280_TRUE_PRES_3125), x1_s64r); +#else + pressure = (((pressure << 31) - x2_s64r) + * BMP280_TRUE_PRES_3125) / x1_s64r; +#endif + else + return 0; + + x1_s64r = (((int64_t)bmp280->calpar.dig_P9) * (pressure >> 13) * + (pressure >> 13)) >> 25; + x2_s64r = (((int64_t)bmp280->calpar.dig_P8) * pressure) >> 19; + pressure = ((pressure + x1_s64r + x2_s64r) >> 8) + + (((int64_t)bmp280->calpar.dig_P7) << 4); + return (uint32_t)pressure; +} +#endif + +/* Computing waiting time for sensor data read + * + * Param delaytimer: The value of delay time + * + * Return 0 + */ +uint8_t bmp280_compute_wait_time (struct _bmp280* bmp280, uint8_t* delaytimer) +{ + /* variable used to return communication result*/ + uint8_t com_rslt = SUCCESS; + + *delaytimer = (T_INIT_MAX + T_MEASURE_PER_OSRS_MAX * + (((1 << bmp280->overs_temp) >> 1) + + ((1 << bmp280->overs_pres) >> 1)) + + (bmp280->overs_pres ? T_SETUP_PRESSURE_MAX : 0) + 15) / 16; + return com_rslt; +} + +/* + * Read ID and Calibration parameters + * Return results of bus communication function + * 0 -> Success + * -1 -> Error + */ +uint8_t bmp280_read_id_get_calib_param (struct _bmp280* bmp280) +{ + /* variable used to return communication result*/ + uint8_t com_rslt; + uint8_t data = 0; + + /* read chip id */ + bmp280->twid->iaddr = BMP280_CHIP_ID_REG; + bmp280->twid->isize = 1; + com_rslt = _bmp280_read(bmp280, &data, 1); + bmp280->chip_id = data; + if ( data != BMP280_CHIP_ID ) { + printf(" -E- Error Chip ID : 0x%x \n\r", data); + com_rslt = ERROR; + } + else { + printf(" -I- Chip ID: 0x%x \n\r", data); + /* readout bmp280 calibration parameter structure */ + com_rslt += bmp280_get_calpar(bmp280); + } + return com_rslt; +} + +// End of file diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.h new file mode 100644 index 000000000..b9617dead --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/bmp280.h @@ -0,0 +1,444 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ +/*! \file bmp280.h + \brief BMP280 Sensor Driver Support Header File */ + +#ifndef __BMP280_H__ +#define __BMP280_H__ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Definition + *----------------------------------------------------------------------------*/ + +#define BMP280_64BITSUPPORT_PRESENT + +/********************************************/ +/**\name ENABLE FLATING OUTPUT */ +/**************************************/ + +// If the user wants to support floating point calculations, please set the following define. +#define BMP280_ENABLE_FLOAT + +// If the user wants to support 64 bit integer calculation (needed for optimal pressure accuracy) +// please set the following definition. If int64 calculation is not wanted (e.g. because it would include +// large libraries), please do not set the definition. +#define BMP280_ENABLE_INT64 + +/****************************************/ +/**\name DELAY */ +/****************************************/ + +// defines the return parameter type of the BMP280_DELAY_FUNCTION +#define BMP280_DELAY_RETURN_TYPE void + +// defines the calling parameter types of the BMP280_DELAY_FUNCTION +#define BMP280_DELAY_PARAM_TYPES uint16_t + +/***************************************************************/ +/**\name GET AND SET BITSLICE FUNCTIONS */ +/***************************************************************/ + +/* never change this line */ +#define BMP280_DELAY_FUNC(delay_in_msec) delay_func(delay_in_msec) + +#define BMP280_GET_BITSLICE(regvar, bitname) ((regvar & bitname##__MSK) >> bitname##__POS) + +#define BMP280_SET_BITSLICE(regvar, bitname, val) ((regvar & ~bitname##__MSK) | ((val< + +/*---------------------------------------------------------------------------- +* Variables +*----------------------------------------------------------------------------*/ + +typedef void (*_init_handler) (void*,uint32_t,uint32_t); +typedef void (*_put_char_handler) (void*, uint8_t); +typedef uint32_t (*_get_char_handler) (void*); +typedef uint32_t (*_rx_ready_handler) (void*); +typedef void (*_enable_it_handler) (void*,uint32_t); + +/* Initialize console structure according to board configuration */ +#if CONSOLE_DRIVER == DRV_USART +#include "peripherals/usart.h" +static const struct _console console = { + CONSOLE_PER_ADD, + (_init_handler) usart_configure, + (_put_char_handler) usart_put_char, + (_get_char_handler) usart_get_char, + (_rx_ready_handler) usart_is_rx_ready, + (_enable_it_handler) usart_enable_it +}; +#elif CONSOLE_DRIVER == DRV_UART +#include "peripherals/uart.h" +static const struct _console console = { + CONSOLE_PER_ADD, + (_init_handler) uart_configure, + (_put_char_handler) uart_put_char, + (_get_char_handler) uart_get_char, + (_rx_ready_handler) uart_is_rx_ready, + (_enable_it_handler) uart_set_int +}; +#elif CONSOLE_DRIVER == DRV_DBGU +#include "peripherals/dbgu.h" +static const struct _console console = { + CONSOLE_PER_ADD, + (_init_handler) dbgu_configure, + (_put_char_handler) dbgu_put_char, + (_get_char_handler) dbgu_get_char, + (_rx_ready_handler) dbgu_is_rx_ready, + (_enable_it_handler) dbgu_enable_it +}; +#endif + +/** Pins for CONSOLE */ +static const struct _pin pinsConsole[] = PINS_CONSOLE; + +/** Console initialize status */ +static uint8_t _bConsoleIsInitialized = 0; + +/*------------------------------------------------------------------------------ +* Exported functions +*------------------------------------------------------------------------------*/ + +/** +* \brief Configures a CONSOLE peripheral with the specified parameters. +* +* \param baudrate Baudrate at which the CONSOLE should operate (in Hz). +*/ +void console_configure(uint32_t baudrate) +{ + /* Configure PIO */ + pio_configure(pinsConsole, ARRAY_SIZE(pinsConsole)); + + pmc_enable_peripheral(CONSOLE_ID); + + uint32_t mode; +#if CONSOLE_DRIVER != DRV_DBGU + mode = US_MR_CHMODE_NORMAL | US_MR_PAR_NO | US_MR_CHRL_8_BIT; +#else + mode = US_MR_CHMODE_NORMAL | US_MR_PAR_NO; +#endif + +#if CONSOLE_DRIVER == DRV_UART + uint32_t mr; + mr = mode & US_MR_FILTER ? UART_MR_FILTER_ENABLED + : UART_MR_FILTER_DISABLED; + mr |= UART_MR_PAR((mode & US_MR_PAR_Msk) >> US_MR_PAR_Pos); + if ((mode & US_MR_USCLKS_Msk) == US_MR_USCLKS_PMC_PCK) + mr |= UART_MR_BRSRCCK_PMC_PCK; + else + mr |= UART_MR_BRSRCCK_PERIPH_CLK; + mr |= UART_MR_CHMODE((mode & US_MR_CHMODE_Msk) >> US_MR_CHMODE_Pos); + mode = mr; +#endif + + /* Initialize driver to use */ + console.init(console.addr, mode, baudrate); + + /* Finally */ + _bConsoleIsInitialized = 1; +} + +/** +* \brief Outputs a character on the CONSOLE line. +* +* \note This function is synchronous (i.e. uses polling). +* \param c Character to send. +*/ +void console_put_char(uint8_t c) +{ + if (!_bConsoleIsInitialized) + console_configure(CONSOLE_BAUDRATE); + + console.put_char(console.addr, c); +} + +/** +* \brief Input a character from the CONSOLE line. +* +* \note This function is synchronous +* \return character received. +*/ +extern uint32_t console_get_char(void) +{ + if (!_bConsoleIsInitialized) + console_configure(CONSOLE_BAUDRATE); + return console.get_char(console.addr); +} + +/** +* \brief Check if there is Input from DBGU line. +* +* \return true if there is Input. +*/ +extern uint32_t console_is_rx_ready(void) +{ + if (!_bConsoleIsInitialized) + console_configure(CONSOLE_BAUDRATE); + return console.is_rx_ready(console.addr); +} + +/** +* Displays the content of the given frame on the DBGU. +* +* \param pucFrame Pointer to the frame to dump. +* \param size Buffer size in bytes. +*/ +void console_dump_frame(uint8_t * pframe, uint32_t size) +{ + uint32_t dw; + + for (dw = 0; dw < size; dw++) { + printf("%02X ", pframe[dw]); + } + printf("\n\r"); +} + +/** +* Displays the content of the given buffer on the DBGU. +* +* \param pbuffer Pointer to the buffer to dump. +* \param size Buffer size in bytes. +* \param address Start address to display +*/ +void console_dump_memory(uint8_t * pbuffer, uint32_t size, + uint32_t address) +{ + uint32_t i, j; + uint32_t last_line_start; + uint8_t *tmp; + + for (i = 0; i < (size / 16); i++) { + printf("0x%08X: ", (unsigned int)(address + (i * 16))); + tmp = (uint8_t *) & pbuffer[i * 16]; + for (j = 0; j < 4; j++) { + printf("%02X%02X%02X%02X ", tmp[0], tmp[1], tmp[2], + tmp[3]); + tmp += 4; + } + tmp = (uint8_t *) & pbuffer[i * 16]; + for (j = 0; j < 16; j++) { + console_put_char(*tmp++); + } + printf("\n\r"); + } + if ((size % 16) != 0) { + last_line_start = size - (size % 16); + printf("0x%08X: ", (unsigned int)(address + last_line_start)); + for (j = last_line_start; j < last_line_start + 16; j++) { + if ((j != last_line_start) && (j % 4 == 0)) { + printf(" "); + } + if (j < size) + printf("%02X", pbuffer[j]); + else + printf(" "); + } + printf(" "); + for (j = last_line_start; j < size; j++) { + console_put_char(pbuffer[j]); + } + printf("\n\r"); + } +} + +/** +* Reads an integer +* +* \param pvalue Pointer to the uint32_t variable to contain the input value. +*/ +extern uint32_t console_get_integer(uint32_t * pvalue) +{ + uint8_t key; + uint8_t nb = 0; + uint32_t value = 0; + + while (1) { + key = console_get_char(); + console_put_char(key); + + if (key >= '0' && key <= '9') { + value = (value * 10) + (key - '0'); + nb++; + } else { + if (key == 0x0D || key == ' ') { + if (nb == 0) { + printf + ("\n\rWrite a number and press ENTER or SPACE!\n\r"); + return 0; + } else { + printf("\n\r"); + *pvalue = value; + return 1; + } + } else { + printf("\n\r'%c' not a number!\n\r", key); + return 0; + } + } + } +} + +/** +* Reads an integer and check the value +* +* \param pvalue Pointer to the uint32_t variable to contain the input value. +* \param dwMin Minimum value +* \param dwMax Maximum value +*/ +extern uint32_t console_get_integer_min_max(uint32_t * pvalue, uint32_t min, + uint32_t max) +{ + uint32_t value = 0; + + if (console_get_integer(&value) == 0) + return 0; + if (value < min || value > max) { + printf("\n\rThe number have to be between %u and %u\n\r", + (unsigned int)min, (unsigned int)max); + return 0; + } + printf("\n\r"); + *pvalue = value; + return 1; +} + +void console_enable_interrupts(uint32_t mask) +{ + console.enable_interrupts(console.addr, mask); +} + +/** +* Reads an hexadecimal number +* +* \param pvalue Pointer to the uint32_t variable to contain the input value. +*/ +extern uint32_t console_get_hexa_32(uint32_t * pvalue) +{ + uint8_t key; + uint32_t dw = 0; + uint32_t value = 0; + + for (dw = 0; dw < 8; dw++) { + key = console_get_char(); + console_put_char(key); + + if (key >= '0' && key <= '9') { + value = (value * 16) + (key - '0'); + } else { + if (key >= 'A' && key <= 'F') { + value = (value * 16) + (key - 'A' + 10); + } else { + if (key >= 'a' && key <= 'f') { + value = (value * 16) + (key - 'a' + 10); + } else { + printf + ("\n\rIt is not a hexa character!\n\r"); + return 0; + } + } + } + } + printf("\n\r"); + *pvalue = value; + return 1; +} + +void console_clear_screen(void) +{ + printf("\033[2J\033[0;0f"); +} + +void console_reset_cursor(void) +{ + printf("\033[0;0f"); +} + +void console_echo(uint8_t c) +{ + switch (c) { + case '\r': + case '\n': + printf("\r\n"); + break; + case 0x7F: + printf("\033[1D\033[K"); + break; + case '\b': + printf("\033[1D\033[K"); + break; + default: + console_put_char(c); + } +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/console.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/console.h new file mode 100644 index 000000000..6adbf6283 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/console.h @@ -0,0 +1,74 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CONSOLE_H_ +#define _CONSOLE_H_ + +/*----------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +#define DRV_UART (1) +#define DRV_USART (2) +#define DRV_DBGU (3) +//#define DRV_FLEXCOM (4) + +struct _console { + void* addr; + void (*init)(void*, uint32_t, uint32_t); + void (*put_char)(void*, uint8_t); + uint32_t (*get_char)(void*); + uint32_t (*is_rx_ready)(void*); + void (*enable_interrupts)(void*, uint32_t); +}; + +/* ---------------------------------------------------------------------------- + * Global function + * ---------------------------------------------------------------------------*/ + +extern void console_configure(uint32_t baudrate); +extern void console_put_char(uint8_t uc); +extern uint32_t console_get_char(void); +extern uint32_t console_is_rx_ready(void); +extern void console_enable_interrupts(uint32_t mask); +extern void console_dump_frame(uint8_t * pframe, uint32_t size); +extern void console_dump_memory(uint8_t * pbuffer, uint32_t size, + uint32_t address); +extern uint32_t console_get_integer(uint32_t * pvalue); +extern uint32_t console_get_integer_min_max(uint32_t * pvalue, uint32_t min, + uint32_t max); +extern uint32_t console_get_hexa_32(uint32_t * pvalue); + +extern void console_echo(uint8_t c); +extern void console_clear_screen(void); +extern void console_reset_cursor(void); + +#endif /* _CONSOLE_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.c new file mode 100644 index 000000000..643ded3da --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.c @@ -0,0 +1,149 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + */ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "board.h" +#include "misc/led.h" +#include "peripherals/pio.h" + +/*------------------------------------------------------------------------------ + * Local Variables + *------------------------------------------------------------------------------*/ + +#ifdef PINS_LEDS +static const struct _pin pinsLeds[] = PINS_LEDS; + +static const uint32_t numLeds = ARRAY_SIZE(pinsLeds); +#endif + +/*------------------------------------------------------------------------------ + * Global Functions + *------------------------------------------------------------------------------*/ + +/** + * Configures the pin associated with the given LED number. If the LED does + * not exist on the board, the function does nothing. + * \param dwLed Number of the LED to configure. + * \return 1 if the LED exists and has been configured; otherwise 0. + */ +extern uint32_t led_configure (uint32_t led) +{ +#ifdef PINS_LEDS + // Check that LED exists + if (led >= numLeds) { + return 0; + } + // Configure LED + return pio_configure(&pinsLeds[led], 1); +#else + return 0; +#endif +} + +/** + * Turns the given LED on if it exists; otherwise does nothing. + * \param dwLed Number of the LED to turn on. + * \return 1 if the LED has been turned on; 0 otherwise. + */ +extern uint32_t led_set(uint32_t led) +{ +#ifdef PINS_LEDS + /* Check if LED exists */ + if (led >= numLeds) { + return 0; + } + + /* Turn LED on */ + if (pinsLeds[led].type == PIO_OUTPUT_0) { + pio_set(&pinsLeds[led]); + } else { + pio_clear(&pinsLeds[led]); + } + return 1; +#else + return 0; +#endif +} + +/** + * Turns a LED off. + * + * \param dwLed Number of the LED to turn off. + * \return 1 if the LED has been turned off; 0 otherwise. + */ +extern uint32_t led_clear (uint32_t led) +{ +#ifdef PINS_LEDS + /* Check if LED exists */ + if (led >= numLeds) { + return 0; + } + /* Turn LED off */ + if (pinsLeds[led].type == PIO_OUTPUT_0) { + pio_clear(&pinsLeds[led]); + } else { + pio_set(&pinsLeds[led]); + } + return 1; +#else + return 0; +#endif +} + +/** + * Toggles the current state of a LED. + * + * \param dwLed Number of the LED to toggle. + * \return 1 if the LED has been toggled; otherwise 0. + */ +extern uint32_t led_toggle(uint32_t led) +{ +#ifdef PINS_LEDS + /* Check if LED exists */ + if (led >= numLeds) { + return 0; + } + /* Toggle LED */ + if (pio_get_output_data_status(&pinsLeds[led])) { + pio_clear(&pinsLeds[led]); + } else { + pio_set(&pinsLeds[led]); + } + return 1; +#else + return 0; +#endif +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.h new file mode 100644 index 000000000..7d0c8fac9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/misc/led.h @@ -0,0 +1,68 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * Small set of functions for simple and portable LED usage. + * + * \section Usage + * + * -# Configure one or more LEDs using led_configure and + * LED_ConfigureAll. + * -# Set, clear and toggle LEDs using led_set, led_clear and + * led_toggle. + * + * LEDs are numbered starting from 0; the number of LEDs depend on the + * board being used. All the functions defined here will compile properly + * regardless of whether the LED is defined or not; they will simply + * return 0 when a LED which does not exist is given as an argument. + * Also, these functions take into account how each LED is connected on to + * board; thus, \ref led_set might change the level on the corresponding pin + * to 0 or 1, but it will always light the LED on; same thing for the other + * methods. + */ + +#ifndef _LED_ +#define _LED_ + +#include + +//------------------------------------------------------------------------------ +// Global Functions +//------------------------------------------------------------------------------ + +extern uint32_t led_configure(uint32_t led); +extern uint32_t led_set(uint32_t led); +extern uint32_t led_clear(uint32_t led); +extern uint32_t led_toggle(uint32_t led); + +#endif /* #ifndef LED_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/Makefile.inc new file mode 100644 index 000000000..bafc2ea87 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/Makefile.inc @@ -0,0 +1,74 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2015, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +drivers-y += drivers/peripherals/adc.o +drivers-y += drivers/peripherals/aes.o +drivers-y += drivers/peripherals/aic.o +drivers-y += drivers/peripherals/gmacd.o +drivers-y += drivers/peripherals/gmac.o +drivers-y += drivers/peripherals/l2cc.o +drivers-y += drivers/peripherals/matrix.o +drivers-y += drivers/peripherals/mpddrc.o +drivers-y += drivers/peripherals/pit.o +drivers-y += drivers/peripherals/pmc.o +drivers-y += drivers/peripherals/pmecc.o +drivers-y += drivers/peripherals/pmecc_gallois_field_512.o +drivers-y += drivers/peripherals/pmecc_gallois_field_1024.o +drivers-y += drivers/peripherals/pwmc.o +drivers-y += drivers/peripherals/rstc.o +drivers-y += drivers/peripherals/rtc.o +drivers-y += drivers/peripherals/sha.o +drivers-y += drivers/peripherals/hsmc.o +drivers-y += drivers/peripherals/spid.o +drivers-y += drivers/peripherals/spi.o +drivers-y += drivers/peripherals/tc.o +drivers-y += drivers/peripherals/tdes.o +drivers-y += drivers/peripherals/trng.o +drivers-y += drivers/peripherals/twid_legacy.o +drivers-y += drivers/peripherals/twi.o +drivers-y += drivers/peripherals/uart.o +drivers-y += drivers/peripherals/usartd.o +drivers-y += drivers/peripherals/usart_iso7816_4.o +drivers-y += drivers/peripherals/usart.o +drivers-y += drivers/peripherals/wdt.o +drivers-y += drivers/peripherals/xdmac.o +drivers-y += drivers/peripherals/xdmad.o + +drivers-$(CONFIG_HAVE_FLEXCOM) += drivers/peripherals/flexcom.o +drivers-$(CONFIG_HAVE_USART_LIN) += drivers/peripherals/usart_lin.o +drivers-$(CONFIG_HAVE_PIO4) += drivers/peripherals/pio4.o +drivers-$(CONFIG_HAVE_QSPI) += drivers/peripherals/qspi.o +drivers-$(CONFIG_HAVE_MCAN) += drivers/peripherals/mcan.o +drivers-$(CONFIG_HAVE_SDMMC) += drivers/peripherals/sdmmc.o + +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/peripherals/acc.o +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/peripherals/classd.o +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/peripherals/isc.o +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/peripherals/sfrbu.o +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/peripherals/shdwc.o +drivers-$(CONFIG_SOC_SAMA5D2) += drivers/peripherals/twid.o diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.c new file mode 100644 index 000000000..59ae7eb99 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.c @@ -0,0 +1,135 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/acc.h" + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +#define ACC_MR_INV_Pos 12 /* ACC invert output (reg offset) */ + +#define ACC_ACR_HYST_0mv_max 0x00 /* Hysteresis levels */ +#define ACC_ACR_HYST_50mv_max 0x01 +#define ACC_ACR_HYST_90mv_max 0x11 + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void acc_init(Acc *p_acc, uint32_t select_plus, uint32_t select_minus, + uint32_t edge_type, uint32_t invert) +{ + /* Reset the controller */ + p_acc->ACC_CR |= ACC_CR_SWRST; + + /* Write to the MR register */ + p_acc->ACC_MR = (((select_plus << ACC_MR_SELPLUS_Pos) & ACC_MR_SELPLUS_Msk) | + ((select_minus << ACC_MR_SELMINUS_Pos) & ACC_MR_SELMINUS_Msk) | + ((edge_type << ACC_MR_EDGETYP_Pos) & ACC_MR_EDGETYP_Msk) | + ((invert << ACC_MR_INV_Pos) & ACC_MR_INV)); + + /* Set hysteresis and current selection (ISEL) */ + p_acc->ACC_ACR = (ACC_ACR_ISEL_HISP | ACC_ACR_HYST(ACC_ACR_HYST_50mv_max)); + + /* Automatic Output Masking Period */ + while (p_acc->ACC_ISR & (uint32_t)ACC_ISR_MASK) ; +} + +void acc_enable(Acc *p_acc) +{ + p_acc->ACC_MR |= ACC_MR_ACEN_EN; +} + +void acc_disable(Acc *p_acc) +{ + p_acc->ACC_MR &= ~ACC_MR_ACEN_EN; +} + +void acc_reset(Acc *p_acc) +{ + p_acc->ACC_CR = ACC_CR_SWRST; +} + +void acc_set_input(Acc *p_acc, uint32_t select_minus, uint32_t select_plus) +{ + p_acc->ACC_MR &= ~(ACC_MR_SELMINUS_Msk & ACC_MR_SELPLUS_Msk); + p_acc->ACC_MR |= select_plus | select_minus; +} + +void acc_set_output(Acc *p_acc, uint32_t invert, uint32_t fault_enable, + uint32_t fault_source) +{ + p_acc->ACC_MR &= ~(ACC_MR_INV_EN & ACC_MR_FE_EN & ACC_MR_SELFS_OUTPUT); + p_acc->ACC_MR |= invert | fault_source | fault_enable; +} + +uint32_t acc_get_comparison_result(Acc *p_acc) +{ + uint32_t temp = p_acc->ACC_MR; + uint32_t status = p_acc->ACC_ISR; + + if ((temp & ACC_MR_INV_EN) == ACC_MR_INV_EN) + return status & ACC_ISR_SCO ? 0 : 1; + else + return status & ACC_ISR_SCO ? 1 : 0; +} + +void acc_enable_interrupt(Acc *p_acc) +{ + p_acc->ACC_IER = ACC_IER_CE; +} + +void acc_disable_interrupt(Acc *p_acc) +{ + p_acc->ACC_IDR = ACC_IDR_CE; +} + +uint32_t acc_get_interrupt_status(Acc *p_acc) +{ + return p_acc->ACC_ISR; +} + +void acc_set_write_protect(Acc *p_acc, uint32_t enable) +{ + if (enable) + p_acc->ACC_WPMR = ACC_WPMR_WPKEY_PASSWD | ACC_WPMR_WPEN; + else + p_acc->ACC_WPMR = ACC_WPMR_WPKEY_PASSWD; +} + +uint32_t acc_get_write_protect_status(Acc *p_acc) +{ + return p_acc->ACC_WPSR & ACC_WPSR_WPVS; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.h new file mode 100644 index 000000000..18276f811 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/acc.h @@ -0,0 +1,143 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** +* \file +* +* Implementation of Analog Comparator Controller (ACC). +* +*/ + +#ifndef _ACC_H +#define _ACC_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Initialize the Analog Comparator Controller. + * \param p_acc Pointer to an Acc instance. + * \param select_plus Input connected to inp, 0~7. + * \param select_minus Input connected to inm, 0~7. + * \param edge_type CF flag triggering mode + * Use pattern defined in the device header file. + * \param invert Invert comparator output. + */ +extern void acc_init(Acc *p_acc, uint32_t select_plus, uint32_t select_minus, + uint32_t edge_type, uint32_t invert); + +/** + * \brief Enable the ACC. + * \param p_acc Pointer to ACC registers set instance. + */ +extern void acc_enable(Acc *p_acc); + +/** + * \brief Disable the ACC. + * \param p_acc Pointer to ACC registers set instance. + */ +extern void acc_disable(Acc *p_acc); + +/** + * \brief Reset the ACC. + * \param p_acc Pointer to ACC registers set instance. + */ +extern void acc_reset(Acc *p_acc); + +/** + * \brief Set the input source. + * \param p_acc Pointer to ACC registers set instance. + * \param select_minus Selection for minus comparator input. + * \param select_plus Selection for plus comparator input. + */ +extern void acc_set_input(Acc *p_acc, uint32_t select_minus, + uint32_t select_plus); + +/** + * \brief Set the output of the ACC. + * \param p_acc Pointer to ACC registers set instance. + * \param invert Invert comparator output, 0 for disable, 1 for enable. + * \param fault_enable Fault enable, 0 for disable, 1 for enable. + * \param fault_source Selection of fault source, 0 for CF, 1 for output. + */ +extern void acc_set_output(Acc *p_acc, uint32_t invert, uint32_t fault_enable, + uint32_t fault_source); + +/** + * \brief Get the comparison result. + * \param p_acc Pointer to ACC registers set instance. + * \return Result of the comparison, 0 for inn > inp, 1 for inp > inn. + */ +extern uint32_t acc_get_comparison_result(Acc *p_acc); + +/** + * \brief Enable the interrupt. + * \param p_acc Pointer to ACC registers set instance. + */ +extern void acc_enable_interrupt(Acc *p_acc); + +/** + * \brief Disable the interrupt. + * \param p_acc Pointer to ACC registers set instance. + */ +extern void acc_disable_interrupt(Acc *p_acc); + +/** + * \brief Get the interrupt status. + * \param p_acc Pointer to ACC registers set instance. + * \return Contents of the Interrupt Status Register. + */ +extern uint32_t acc_get_interrupt_status(Acc *p_acc); + +/** + * \brief Write-protect the Mode Register and the Analog Control Register. + * \param p_acc Pointer to ACC registers set instance. + * \param enable 1 to enable, 0 to disable. + */ +extern void acc_set_write_protect(Acc *p_acc, uint32_t enable); + +/** + * \brief Return write protect status. + * \param p_acc Pointer to ACC registers set instance. + * \retval 0 No write protection violation occurred. + * \retval 1 At least one write attempt to a write-protected register has been + * detected, since the previous call to this function. + */ +extern uint32_t acc_get_write_protect_status(Acc *p_acc); + +#endif /* _ACC_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.c new file mode 100644 index 000000000..9aa239f98 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.c @@ -0,0 +1,639 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup adc_module Working with ADC + * \ingroup peripherals_module + * \section Purpose + * The ADC driver provides the interface to configure and use the ADC peripheral. + * \n + * + * It converts the analog input to digital format. The converted result could be + * 12bit. + * + * To Enable a ADC conversion,the user has to follow these few steps: + *
    + *
  • Select an appropriate reference voltage on ADVREF
  • + *
  • Configure the ADC according to its requirements and special needs,which + * could be broken down into several parts: + * -# Select the resolution by setting or clearing ADC_MR_LOWRES bit in + * ADC_MR (Mode Register) + * -# Set ADC clock by setting ADC_MR_PRESCAL bits in ADC_MR, the clock is + * calculated with ADCClock = MCK / ( (PRESCAL+1) * 2 ) + * -# Set Startup Time,Tracking Clock cycles and Transfer Clock respectively + * in ADC_MR. +
  • + *
  • Start conversion by setting ADC_CR_START in ADC_CR.
  • + *
+ * + * \section Usage + *
    + *
  • Initialize the ADC controller using adc_initialize(). + *
  • ADC clock and timing configuration using adc_set_clock() and adc_set_timing(). + *
  • For ADC trigger using adc_set_trigger(), adc_set_trigger_mode() and + * adc_set_trigger_period(). + *
  • For ADC sequence mode using adc_set_sequence_mode(), adc_set_sequence() and + * adc_set_sequence_by_list(). + *
  • For ADC compare mode using adc_set_compare_channel(), adc_set_compare_mode() + * and adc_set_comparison_window(). + *
  • ADC works with touchscreen using adc_ts_calibration(), adc_set_ts_mode(), + * adc_set_ts_debounce(), adc_set_ts_pen_detect(), adc_set_ts_average(), + * adc_get_ts_xposition(), adc_get_ts_yposition() and adc_get_ts_pressure(). + *
  • + *
+ * + * For more accurate information, please look at the ADC section of the + * Datasheet. + * + * Related files :\n + * \ref adc.c\n + * \ref adc.h\n + */ +/** + * \file + * + * Implementation of Analog-to-Digital Converter (ADC). + * + */ +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/adc.h" +#include "peripherals/pmc.h" + +#include "trace.h" + +#include + +/*---------------------------------------------------------------------------- + * Local definitions + *----------------------------------------------------------------------------*/ + +#ifndef ADC_MR_TRANSFER +/* for compatibility with older peripheral versions */ +#define ADC_MR_TRANSFER(x) 0 +#endif + +/*---------------------------------------------------------------------------- + * Local variables + *----------------------------------------------------------------------------*/ + +/** Current working clock */ +static uint32_t _adc_clock = 0; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +uint32_t adc_num_channels(void) +{ + return ARRAY_SIZE(ADC->ADC_CDR); +} + +/** + * \brief Initialize the ADC controller + * + */ +void adc_initialize(void) +{ + /* Enable peripheral clock */ + pmc_enable_peripheral(ID_ADC); + + /* Reset the controller */ + ADC->ADC_CR = ADC_CR_SWRST; + + /* Reset Mode Register */ + ADC->ADC_MR = 0; + +} + +/** + * \brief Set ADC clock. + * + * \param clk adc clock frequency + * + * \return ADC clock + */ +uint32_t adc_set_clock(uint32_t clk) +{ + uint32_t prescale, mode_reg; + uint32_t mck = pmc_get_peripheral_clock(ID_ADC); + /* Formula for PRESCAL is: + ADCClock = MCK / ( (PRESCAL+1) * 2 ) + PRESCAL = (MCK / (2 * ADCCLK)) + 1 + First, we do the division, multiplied by 10 to get higher precision + If the last digit is not zero, we round up to avoid generating a higher + than required frequency. */ + prescale = (mck * 5) / clk; + if (prescale % 10) + prescale = prescale / 10; + else { + if (prescale == 0) + return 0; + prescale = prescale / 10 - 1; + } + + mode_reg = ADC_MR_PRESCAL(prescale); + if (mode_reg == 0) + return 0; + + mode_reg |= (ADC->ADC_MR & ~ADC_MR_PRESCAL_Msk); + ADC->ADC_MR = mode_reg; + + _adc_clock = mck / (prescale + 1) / 2; + //_adc_clock = _adc_clock / 1000 * 1000; + return _adc_clock; +} + +void adc_enable_it(uint32_t mask) +{ + ADC->ADC_IER |= mask; +} + +void adc_disable_it(uint32_t mask) +{ + ADC->ADC_IER &= ~mask; +} + +/** + * \brief Set ADC timing. + * + * \param startup startup value + * \param tracking tracking value + * \param settling settling value + */ +void adc_set_timing(uint32_t startup, uint32_t tracking, uint32_t settling) +{ + uint32_t mode_reg; + +#ifndef CONFIG_HAVE_ADC_SETTLING_TIME + if (settling) { + settling = 0; + trace_warning("adc: Analog settling time not supported, IGNORED!\r\n"); + } +#endif + + mode_reg = ADC->ADC_MR; + mode_reg &= (~ADC_MR_STARTUP_Msk) & (~ADC_MR_TRACKTIM_Msk); + + /* Formula: + * Startup Time = startup value / ADCClock + * Transfer Time = (TRANSFER * 2 + 3) / ADCClock + * Tracking Time = (TRACKTIM + 1) / ADCClock + * Settling Time = settling value / ADCClock + */ + mode_reg |= ADC_MR_STARTUP(startup); + mode_reg |= ADC_MR_TRACKTIM(tracking); + mode_reg |= ADC_MR_TRANSFER(2); +#ifdef CONFIG_HAVE_ADC_SETTLING_TIME + mode_reg |= ADC_MR_SETTLING(settling); +#endif + ADC->ADC_MR |= mode_reg; +} + +void adc_set_trigger_mode(uint32_t mode) +{ + uint32_t trg_reg = ADC->ADC_TRGR & ~ADC_TRGR_TRGMOD_Msk; + ADC->ADC_TRGR = trg_reg | mode; +} + +void adc_set_sleep_mode(uint8_t enable) +{ + if (enable) { + ADC->ADC_MR |= ADC_MR_SLEEP; + } else { + ADC->ADC_MR &= ~ADC_MR_SLEEP; + } +} + +/** + * \brief Enable/Disable seqnence mode. + * + * \param enable Enable/Disable seqnence mode. + */ +void adc_set_sequence_mode(uint8_t enable) +{ + if (enable) { + /* User Sequence Mode: The sequence respects what is defined in + ADC_SEQR1 and ADC_SEQR2 */ + ADC->ADC_MR |= ADC_MR_USEQ; + } else { + /* Normal Mode: The controller converts channels in a simple numeric order. */ + ADC->ADC_MR &= ~ADC_MR_USEQ; + } +} + +/** + * \brief Set channel sequence. + * + * \param seq1 Sequence 1 ~ 8 channel number. + * \param seq2 Sequence 9 ~ 16 channel number. + */ + +void adc_set_sequence(uint32_t seq1, uint32_t seq2) +{ + ADC->ADC_SEQR1 = seq1; +#ifdef CONFIG_HAVE_ADC_SEQ_REG2 + ADC->ADC_SEQR2 = seq2; +#endif +} + +/** + * \brief Set channel sequence by given channel list. + * + * \param channel_list Channel list. + * \param len Number of channels in list. + */ + +void adc_set_sequence_by_list(uint8_t channel_list[], uint8_t len) +{ + uint8_t i; + uint8_t shift; + + if (len <= 8) { + ADC->ADC_SEQR1 = 0; + for (i = 0, shift = 0; i < len; i++, shift += 4) { + if (i >= len) return; + ADC->ADC_SEQR1 |= channel_list[i] << shift; + } + } + else { + ADC->ADC_SEQR1 = 0; + for (i = 0, shift = 0; i < 8; i++, shift += 4) { + if (i >= len) return; + ADC->ADC_SEQR1 |= channel_list[i] << shift; + } +#ifdef CONFIG_HAVE_ADC_SEQ_REG2 + ADC->ADC_SEQR2 = 0; + for (i = 0, shift = 0; i < (len-8); i++, shift += 4) { + if (i >= len) return; + ADC->ADC_SEQR2 |= channel_list[8+i] << shift; + } +#endif + } +} + +void adc_set_tag_enable(uint8_t enable) +{ + if (enable) { + ADC->ADC_EMR |= ADC_EMR_TAG; + } else { + ADC->ADC_EMR &= ~ADC_EMR_TAG; + } +} + +/** + * \brief Set compare channel. + * + * \param channel channel number to be set, xx for all channels + */ +void adc_set_compare_channel(uint32_t channel) +{ + assert(channel <= adc_num_channels()); + + if (channel < adc_num_channels()) { + ADC->ADC_EMR &= ~(ADC_EMR_CMPALL); + ADC->ADC_EMR &= ~(ADC_EMR_CMPSEL_Msk); + ADC->ADC_EMR |= (channel << ADC_EMR_CMPSEL_Pos); + } else { + ADC->ADC_EMR |= ADC_EMR_CMPALL; + } +} + +/** + * \brief Set compare mode. + * + * \param mode compare mode + */ +void adc_set_compare_mode(uint32_t mode) +{ + ADC->ADC_EMR &= ~(ADC_EMR_CMPMODE_Msk); + ADC->ADC_EMR |= (mode & ADC_EMR_CMPMODE_Msk); +} + +void adc_set_comparison_window(uint32_t window) +{ + ADC->ADC_CWR = window; +} + +uint8_t adc_check_configuration(void) +{ + uint32_t mode_reg; + uint32_t prescale; + uint32_t clock; + uint32_t mck = pmc_get_peripheral_clock(ID_ADC); + + mode_reg = ADC->ADC_MR; + + prescale = (mode_reg & ADC_MR_PRESCAL_Msk) >> ADC_MR_PRESCAL_Pos; + /* Formula: ADCClock = MCK / ( (PRESCAL+1) * 2 ) */ + clock = mck / ((prescale + 1) * 2); + if (clock > ADC_CLOCK_MAX) { + printf ("ADC clock is too high (out of specification: %d Hz)\r\n", + (int) ADC_CLOCK_MAX); + return 1; + } + + return 0; +} + +uint32_t adc_get_converted_data(uint32_t channel) +{ + assert(channel < adc_num_channels()); + + if (channel < adc_num_channels()) { + return ADC->ADC_CDR[channel]; + } else { + return 0; + } +} + +void adc_set_startup_time(uint32_t startup) +{ + uint32_t start; + uint32_t mode_reg; + + if (_adc_clock == 0) + return; + /* Formula for STARTUP is: + STARTUP = (time x ADCCLK) / (1000000) - 1 + Division multiplied by 10 for higher precision */ + + start = (startup * _adc_clock) / (100000); + if (start % 10) + start /= 10; + else { + start /= 10; + if (start) + start--; + } + if (start > 896) + mode_reg = ADC_MR_STARTUP_SUT960; + else if (start > 832) + mode_reg = ADC_MR_STARTUP_SUT896; + else if (start > 768) + mode_reg = ADC_MR_STARTUP_SUT832; + else if (start > 704) + mode_reg = ADC_MR_STARTUP_SUT768; + else if (start > 640) + mode_reg = ADC_MR_STARTUP_SUT704; + else if (start > 576) + mode_reg = ADC_MR_STARTUP_SUT640; + else if (start > 512) + mode_reg = ADC_MR_STARTUP_SUT576; + else if (start > 112) + mode_reg = ADC_MR_STARTUP_SUT512; + else if (start > 96) + mode_reg = ADC_MR_STARTUP_SUT112; + else if (start > 80) + mode_reg = ADC_MR_STARTUP_SUT96; + else if (start > 64) + mode_reg = ADC_MR_STARTUP_SUT80; + else if (start > 24) + mode_reg = ADC_MR_STARTUP_SUT64; + else if (start > 16) + mode_reg = ADC_MR_STARTUP_SUT24; + else if (start > 8) + mode_reg = ADC_MR_STARTUP_SUT16; + else if (start > 0) + mode_reg = ADC_MR_STARTUP_SUT8; + else + mode_reg = ADC_MR_STARTUP_SUT0; + + mode_reg |= ADC->ADC_MR & ~ADC_MR_STARTUP_Msk; + ADC->ADC_MR = mode_reg; +} + +#ifdef CONFIG_HAVE_ADC_INPUT_OFFSET +/** + * \brief Enable differential input for the specified channel. + * + * \param channel ADC channel number. + */ +void adc_enable_channel_differential_input (uint32_t channel) +{ + /* (ADC_COR) Differential Inputs for Channel n */ + ADC->ADC_COR |= 0x01u << (16 + channel); +} + +/** + * \brief Disable differential input for the specified channel. + * + * \param channel ADC channel number. + */ +void adc_disable_channel_differential_input(uint32_t channel) +{ + uint32_t temp; + temp = ADC->ADC_COR; + ADC->ADC_COR &= 0xFFFEFFFFu << channel; + ADC->ADC_COR |= temp; +} + +/** + * \brief Enable analog signal offset for the specified channel. + * + * \param channel ADC channel number. + */ +void adc_enable_channel_input_offset (uint32_t channel) +{ + ADC->ADC_COR |= 0x01u << channel; +} + +/** + * \brief Disable analog signal offset for the specified channel. + * + * \param channel ADC channel number. + */ +void adc_disable_channel_input_offset (uint32_t channel) +{ + uint32_t temp; + temp = ADC->ADC_COR; + ADC->ADC_COR &= (0xFFFFFFFEu << channel); + ADC->ADC_COR |= temp; +} +#endif /* CONFIG_HAVE_ADC_INPUT_OFFSET */ + +#ifdef CONFIG_HAVE_ADC_INPUT_GAIN +/** + * \brief Configure input gain for the specified channel. + * + * \param channel ADC channel number. + * \param gain Gain value for the input. + */ +void adc_set_channel_input_gain (uint32_t channel, uint32_t gain) +{ + assert(gain < 3); + uint32_t temp; + temp = ADC->ADC_CGR; + temp |= gain << (2 * channel); + ADC->ADC_CGR = temp; +} +#endif /* CONFIG_HAVE_ADC_INPUT_GAIN */ + +void adc_set_tracking_time(uint32_t dwNs) +{ + uint32_t dwShtim; + uint32_t mode_reg; + + if (_adc_clock == 0) + return; + /* Formula for SHTIM is: + SHTIM = (time x ADCCLK) / (1000000000) - 1 + Since 1 billion is close to the maximum value for an integer, we first + divide ADCCLK by 1000 to avoid an overflow */ + dwShtim = (dwNs * (_adc_clock / 1000)) / 100000; + if (dwShtim % 10) + dwShtim /= 10; + else { + dwShtim /= 10; + if (dwShtim) + dwShtim--; + } + mode_reg = ADC_MR_TRACKTIM(dwShtim); + mode_reg |= ADC->ADC_MR & ~ADC_MR_TRACKTIM_Msk; + ADC->ADC_MR = mode_reg; +} + +void adc_set_trigger_period(uint32_t period) +{ + uint32_t trg_period; + uint32_t trg_reg; + if (_adc_clock == 0) + return; + trg_period = period * (_adc_clock/1000) - 1; + trg_reg = ADC->ADC_TRGR & ~ADC_TRGR_TRGPER_Msk; + trg_reg |= ADC_TRGR_TRGPER(trg_period); + ADC->ADC_TRGR = trg_reg; +} + +void adc_ts_calibration(void) +{ + ADC->ADC_CR = ADC_CR_TSCALIB; +} + +void adc_set_ts_mode(uint32_t mode) +{ + ADC->ADC_TSMR = (ADC->ADC_TSMR & ~ADC_TSMR_TSMODE_Msk) | mode; +} + +void adc_configure_ext_mode(uint32_t mode) +{ + ADC->ADC_EMR = mode; +} + +void adc_set_ts_debounce(uint32_t time) +{ + uint32_t div = 1000000000; + uint32_t clk = _adc_clock; + uint32_t dwPenbc = 0; + uint32_t target, current; + uint32_t tsmr; + if (time == 0 || _adc_clock == 0) + return; + /* Divide time & ADCCLK to avoid overflows */ + while ((div > 1) && ((time % 10) == 0)) { + time /= 10; + div /= 10; + } + while ((div > 1) && ((clk & 10) == 0)) { + clk /= 10; + div /= 10; + } + /* Compute PENDBC */ + target = time * clk / div; + current = 1; + while (current < target) { + dwPenbc++; + current *= 2; + } + tsmr = ADC_TSMR_PENDBC(dwPenbc); + if (tsmr == 0) + return; + tsmr |= ADC->ADC_TSMR & ~ADC_TSMR_PENDBC_Msk; + ADC->ADC_TSMR = tsmr; +} + +void adc_set_ts_pen_detect(uint8_t enable) +{ + if (enable) + ADC->ADC_TSMR |= ADC_TSMR_PENDET; + else + ADC->ADC_TSMR &= ~ADC_TSMR_PENDET; +} + +void adc_set_ts_average(uint32_t avg_2_conv) +{ + uint32_t mode_reg = ADC->ADC_TSMR & ~ADC_TSMR_TSAV_Msk; + uint32_t ts_av = avg_2_conv >> ADC_TSMR_TSAV_Pos; + uint32_t ts_freq = (mode_reg & ADC_TSMR_TSFREQ_Msk) >> ADC_TSMR_TSFREQ_Pos; + if (ts_av) { + if (ts_av > ts_freq) { + mode_reg &= ~ADC_TSMR_TSFREQ_Msk; + mode_reg |= ADC_TSMR_TSFREQ(ts_av); + } + } + ADC->ADC_TSMR = mode_reg | avg_2_conv; +} + +uint32_t adc_get_ts_xposition(void) +{ + return ADC->ADC_XPOSR; +} + +uint32_t adc_get_ts_yposition(void) +{ + return ADC->ADC_YPOSR; +} + +uint32_t adc_get_ts_pressure(void) +{ + return ADC->ADC_PRESSR; +} + +void adc_set_trigger(uint32_t trigger) +{ + uint32_t mode_reg; + + mode_reg = ADC->ADC_MR; + mode_reg &= ~ADC_MR_TRGSEL_Msk; + mode_reg |= trigger; + ADC->ADC_MR |= mode_reg; +} + +#ifdef CONFIG_HAVE_ADC_LOW_RES +void adc_set_low_resolution(uint8_t enable) +{ + if (enable) { + ADC->ADC_MR |= ADC_MR_LOWRES; + } else { + ADC->ADC_MR &= ~ADC_MR_LOWRES; + } +} +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.h new file mode 100644 index 000000000..62d5b5af1 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/adc.h @@ -0,0 +1,399 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * Interface for configuration the Analog-to-Digital Converter (ADC) peripheral. + * + * \section Usage + * + * -# Configurate the pins for ADC. + * -# Initialize the ADC with adc_initialize(). + * -# Set ADC clock and timing with adc_set_clock() and adc_set_timing(). + * -# Select the active channel using adc_enable_channel(). + * -# Start the conversion with adc_start_conversion(). + * -# Wait the end of the conversion by polling status with adc_get_status(). + * -# Finally, get the converted data using adc_get_converted_data() or adc_get_last_converted_data(). + * +*/ +#ifndef _ADC_ +#define _ADC_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ +#include +#include + +/*------------------------------------------------------------------------------ + * Definitions + *------------------------------------------------------------------------------*/ + +/* Max. ADC Clock Frequency (Hz) */ +#define ADC_CLOCK_MAX 20000000 + +/* Max. normal ADC startup time (us) */ +#define ADC_STARTUP_NORMAL_MAX 40 +/* Max. fast ADC startup time (us) */ +#define ADC_STARTUP_FAST_MAX 12 + +/* Definitions for ADC channels */ +#define ADC_CHANNEL_0 0 +#define ADC_CHANNEL_1 1 +#define ADC_CHANNEL_2 2 +#define ADC_CHANNEL_3 3 +#define ADC_CHANNEL_4 4 +#define ADC_CHANNEL_5 5 +#define ADC_CHANNEL_6 6 +#define ADC_CHANNEL_7 7 +#define ADC_CHANNEL_8 8 +#define ADC_CHANNEL_9 9 +#define ADC_CHANNEL_10 10 +#define ADC_CHANNEL_11 11 + +#ifdef __cplusplus +extern "C" { +#endif + +/*------------------------------------------------------------------------------ + * Macros function of register access + *------------------------------------------------------------------------------*/ + +#define adc_get_mode_reg() (ADC->ADC_MR) + +#define adc_start_conversion() (ADC->ADC_CR = ADC_CR_START) + +#define adc_enable_channel(channel) { \ + ADC->ADC_CHER = (1 << (channel)); \ + } + +#define adc_disable_channel(channel) { \ + ADC->ADC_CHDR = (1 << (channel)); \ + } + +#define adc_enable_interrupt(mode) { \ + ADC->ADC_IER = (mode); \ + } + +#define adc_disable_interrupt(mode) { \ + ADC->ADC_IDR = (mode); \ + } + +#define adc_set_channel_gain(mode) { \ + ADC->ADC_CGR = mode; \ + } + +#define adc_enable_data_ready_it() (ADC->ADC_IER = ADC_IER_DRDY) + +#define adc_get_status() (ADC->ADC_ISR) + +#define adc_get_compare_mode() ((ADC->ADC_EMR)& (ADC_EMR_CMPMODE_Msk)) + +#define adc_get_channel_status() (ADC->ADC_CHSR) + +#define adc_interrupt_mask_status() (ADC->ADC_IMR) + +#define adc_get_last_converted_data() (ADC->ADC_LCDR) + +#define adc_get_overrun_status() (ADC->ADC_OVER) + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +/** + * \brief Returns the number of ADC channels + */ +extern uint32_t adc_num_channels(void); + +/** + * \brief Initialize the ADC controller + */ +extern void adc_initialize(void); + +/** + * \brief Set ADC clock. + * + * \param clk Desired ADC clock frequency. + * + * \return ADC clock + */ +extern uint32_t adc_set_clock(uint32_t clk); + +/** + * \brief Enable ADC interrupt sources + * + * \param mask bitmask of the sources to enable + */ +extern void adc_enable_it(uint32_t mask); + +/** + * \brief Disable ADC interrupt sources + * + * \param mask bitmask of the sources to disable + */ +extern void adc_disable_it(uint32_t mask); + +/** + * \brief Set ADC timing. + * + * \param startup startup value + * \param tracking tracking value + * \param settling settling value + */ +extern void adc_set_timing(uint32_t startup, uint32_t tracking, + uint32_t settling); + +/** + * Sets the trigger mode to following: + * - \ref ADC_TRGR_TRGMOD_NO_TRIGGER + * - \ref ADC_TRGR_TRGMOD_EXT_TRIG_RISE + * - \ref ADC_TRGR_TRGMOD_EXT_TRIG_FALL + * - \ref ADC_TRGR_TRGMOD_EXT_TRIG_ANY + * - \ref ADC_TRGR_TRGMOD_PEN_TRIG + * - \ref ADC_TRGR_TRGMOD_PERIOD_TRIG + * - \ref ADC_TRGR_TRGMOD_CONTINUOUS + * \param mode Trigger mode. + */ +extern void adc_set_trigger_mode(uint32_t mode); + +/** + * \brief Enable/Disable sleep mode. + * + * \param enable Enable/Disable sleep mode. + */ +extern void adc_set_sleep_mode(uint8_t enable); + +extern void adc_set_fast_wakeup(uint8_t enable); + +/** + * \brief Enable/Disable seqnence mode. + * + * \param enable Enable/Disable seqnence mode. + */ +extern void adc_set_sequence_mode(uint8_t enable); + +/** + * \brief Set channel sequence. + * + * \param seq1 Sequence 1 ~ 8 channel number. + * \param seq2 Sequence 9 ~ 16 channel number. + */ +extern void adc_set_sequence(uint32_t seq1, uint32_t seq2); + +/** + * \brief Set channel sequence by given channel list. + * + * \param channel_list Channel list. + * \param len Number of channels in list. + */ +extern void adc_set_sequence_by_list(uint8_t channel_list[], + uint8_t len); + +/** + * \brief Set "TAG" mode, show channel number in last data or not. + * + * \param enable Enable/Disable TAG value. + */ +extern void adc_set_tag_enable(uint8_t enable); + +/** + * Configure extended mode register + * \param mode ADC extended mode. + */ +extern void adc_configure_ext_mode(uint32_t mode); + +/** + * \brief Set compare channel. + * + * \param channel channel number to be set,16 for all channels + */ +extern void adc_set_compare_channel(uint32_t channel); + +/** + * \brief Set compare mode. + * + * \param mode compare mode + */ +extern void adc_set_compare_mode(uint32_t mode); + +/** + * \brief Set comparsion window. + * + * \param window Comparison Window + */extern void adc_set_comparison_window(uint32_t window); + +/** + * \brief Check if ADC configuration is right. + * + * \return 0 if check ok, others if not ok. + */ +extern uint8_t adc_check_configuration(void); + +/** + * \brief Return the Channel Converted Data + * + * \param channel channel to get converted value + */ +extern uint32_t adc_get_converted_data(uint32_t channel); + +#ifdef CONFIG_HAVE_ADC_INPUT_OFFSET +/** + * \brief Enable differential input for the specified channel. + * + * \param channel ADC channel number. + */ +extern void adc_enable_channel_differential_input (uint32_t channel); + +/** + * \brief Disable differential input for the specified channel. + * + * \param channel ADC channel number. + */ +extern void adc_disable_channel_differential_input(uint32_t channel); + +/** + * \brief Enable analog signal offset for the specified channel. + * + * \param channel ADC channel number. + */ +extern void adc_enable_channel_input_offset (uint32_t channel); + +/** + * \brief Disable analog signal offset for the specified channel. + * + * \param channel ADC channel number. + */ +extern void adc_disable_channel_input_offset (uint32_t channel); +#endif /* CONFIG_HAVE_ADC_INPUT_OFFSET */ + +#ifdef CONFIG_HAVE_ADC_INPUT_GAIN +/** + * \brief Configure input gain for the specified channel. + * + * \param channel ADC channel number. + * \param gain Gain value for the input. + */ +extern void adc_set_channel_input_gain (uint32_t channel, uint32_t gain); +#endif /* CONFIG_HAVE_ADC_INPUT_GAIN */ + +/** + * Sets the average of the touch screen ADC. The mode can be: + * - \ref ADC_TSMR_TSAV_NO_FILTER (No filtering) + * - \ref ADC_TSMR_TSAV_AVG2CONV (Average 2 conversions) + * - \ref ADC_TSMR_TSAV_AVG4CONV (Average 4 conversions) + * - \ref ADC_TSMR_TSAV_AVG8CONV (Average 8 conversions) + * \param avg_2_conv Average mode for touch screen + */ +extern void adc_set_ts_average(uint32_t avg_2_conv); + +/** + * Return X measurement position value. + */ +extern uint32_t adc_get_ts_xposition(void); + +/** + * Return Y measurement position value. + */ +extern uint32_t adc_get_ts_yposition(void); + +/** + * Return Z measurement position value. + */ +extern uint32_t adc_get_ts_pressure(void); + +/** + * Sets the touchscreen pan debounce time. + * \param time Debounce time in nS. + */ +extern void adc_set_ts_debounce(uint32_t time); + +/** + * Enable/Disable touch screen pen detection. + * \param enable If true, pen detection is enabled; + * in normal mode otherwise. + */ +extern void adc_set_ts_pen_detect(uint8_t enable); + +/** + * Sets the ADC startup time. + * \param startup Startup time in uS. + */ +extern void adc_set_startup_time(uint32_t startup); + +/** + * Set ADC tracking time + * \param dwNs Tracking time in nS. + */ +extern void adc_set_tracking_time(uint32_t dwNs); + +/** + * Sets the trigger period. + * \param period Trigger period in nS. + */ +extern void adc_set_trigger_period(uint32_t period); + +/** + * Sets the operation mode of the touch screen ADC. The mode can be: + * - \ref ADC_TSMR_TSMODE_NONE (TSADC off) + * - \ref ADC_TSMR_TSMODE_4_WIRE_NO_PM + * - \ref ADC_TSMR_TSMODE_4_WIRE (CH 0~3 used) + * - \ref ADC_TSMR_TSMODE_5_WIRE (CH 0~4 used) + * \param mode Desired mode + */ +extern void adc_set_ts_mode(uint32_t mode); + +/** + * Start screen calibration (VDD/GND measurement) + */ +extern void adc_ts_calibration(void); + +/** + * \brief Set ADC trigger. + * + * \param trigger Trigger selection + */ +extern void adc_set_trigger(uint32_t trigger); + +#ifdef CONFIG_HAVE_ADC_LOW_RES +/** + * \brief Enable/Disable low resolution. + * + * \param enable Enable/Disable low resolution. + */ +extern void adc_set_low_resolution(uint8_t enable); +#endif /* CONFIG_HAVE_ADC_LOW_RES */ + +#ifdef __cplusplus +} +#endif +#endif /* _ADC_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.c new file mode 100644 index 000000000..8f3c96b21 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.c @@ -0,0 +1,201 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup aes_module Working with AES + * \ingroup peripherals_module + * The AES driver provides the interface to configure and use the AES + * peripheral. + * \n + * + * The Advanced Encryption Standard (AES) specifies a FIPS-approved + * cryptographic algorithm that can be used to protect electronic data. The AES + * algorithm is a symmetric block cipher that can encrypt (encipher) and decrypt + * (decipher) information. + * Encryption converts data to an unintelligible form called ciphertext. + * Decrypting the ciphertext converts the data back into its original form, + * called plaintext. The CIPHER bit in the AES Mode Register (AES_MR) allows + * selection between the encryption and the decryption processes. The AES is + * capable of using cryptographic keys of 128/192/256 bits to encrypt and + * decrypt data in blocks of 128 bits. + * This 128-bit/192-bit/256-bit key is defined in the Key Registers (AES_KEYWRx) + * and set by aes_write_key(). The input to the encryption processes of the CBC, + * CFB, and OFB modes includes, in addition to the plaintext, a 128-bit data + * block called the initialization vector (IV), which must be set using + * aes_set_vector(). The initialization vector is used in an initial step in the + * encryption of a message and in the corresponding decryption of the message. + * The Initialization Vector Registers are also used by the CTR mode to set the + * counter value. + * + * To enable AES encryption and decryption, the user has to follow these few + * steps: + *
    + *
  • A software triggered hardware reset of the AES interface is performed by + * aes_soft_reset().
  • + *
  • Configure AES algorithm mode, key mode, start mode and operation mode + * with aes_configure().
  • + *
  • Input AES data for encryption and decryption with function + * aes_set_input().
  • + *
  • Set AES key with fucntion aes_write_key().
  • + *
  • To start the encryption or the decryption process with aes_start().
  • + *
  • To get the encryption or decryption result by aes_get_output().
  • + *
+ * + * + * For more accurate information, please look at the AES section of the + * Datasheet. + * + * Related files :\n + * \ref aes.c\n + * \ref aes.h\n + */ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of Advanced Encryption Standard (AES) + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/aes.h" + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void aes_start(void) +{ + AES->AES_CR = AES_CR_START; +} + +void aes_soft_reset(void) +{ + AES->AES_CR = AES_CR_SWRST; +} + +void aes_configure(uint32_t mode) +{ + AES->AES_MR = mode; +} + +void aes_enable_it(uint32_t sources) +{ + AES->AES_IER = sources; +} + +void aes_disable_it(uint32_t sources) +{ + AES->AES_IDR = sources; +} + +uint32_t aes_get_status(void) +{ + return AES->AES_ISR; +} + +void aes_write_key(const uint32_t * key, uint32_t len) +{ + AES->AES_KEYWR[0] = key[0]; + AES->AES_KEYWR[1] = key[1]; + AES->AES_KEYWR[2] = key[2]; + AES->AES_KEYWR[3] = key[3]; + + if (len >= 24) { + AES->AES_KEYWR[4] = key[4]; + AES->AES_KEYWR[5] = key[5]; + } + if (len == 32) { + AES->AES_KEYWR[6] = key[6]; + AES->AES_KEYWR[7] = key[7]; + } +} + +void aes_set_input(uint32_t * data) +{ + uint8_t i; + for (i = 0; i < 4; i++) + AES->AES_IDATAR[i] = data[i]; +} + +void aes_get_output(uint32_t * data) +{ + uint8_t i; + for (i = 0; i < 4; i++) + data[i] = AES->AES_ODATAR[i]; +} + +void aes_set_vector(const uint32_t * vector) +{ + AES->AES_IVR[0] = vector[0]; + AES->AES_IVR[1] = vector[1]; + AES->AES_IVR[2] = vector[2]; + AES->AES_IVR[3] = vector[3]; +} + +void aes_set_aad_len(uint32_t len) +{ + AES->AES_AADLENR = len; +} + +void aes_set_data_len(uint32_t len) +{ + AES->AES_CLENR = len; +} + +void aes_set_gcm_hash(uint32_t * hash) +{ + uint8_t i; + for (i = 0; i < 4; i++) + AES->AES_GHASHR[i] = hash[i]; +} + +void aes_get_gcm_tag(uint32_t * tag) +{ + uint8_t i; + for (i = 0; i < 4; i++) + tag[i] = AES->AES_TAGR[i]; +} + +void aes_get_gcm_counter(uint32_t * counter) +{ + *counter = AES->AES_CTRR; +} + +void aes_get_gcm_hash_subkey(uint32_t * h) +{ + uint8_t i; + for (i = 0; i < 4; i++) + h[i] = AES->AES_GCMHR[i]; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.h new file mode 100644 index 000000000..e51cbe536 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aes.h @@ -0,0 +1,155 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _AES_ +#define _AES_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +/*------------------------------------------------------------------------------*/ +/* Definition */ +/*------------------------------------------------------------------------------*/ +#define AES_MR_CIPHER_ENCRYPT 1 +#define AES_MR_CIPHER_DECRYPT 0 +/*------------------------------------------------------------------------------*/ +/* Exported functions */ +/*------------------------------------------------------------------------------*/ + +/** + * \brief Starts Manual encryption/decryption process. + */ +void aes_start(void); + +/** + * \brief Resets the AES. + * A software triggered hardware reset of the AES interface is performed. + */ +void aes_soft_reset(void); + +/** + * \brief Configures an AES peripheral with the specified parameters. + * \param mode Desired value for the AES mode register (see the datasheet). + */ +void aes_configure(uint32_t mode); + +/** + * \brief Enables the selected interrupts sources on a AES peripheral. + * \param sources Bitwise OR of selected interrupt sources. + */ +void aes_enable_it(uint32_t sources); + +/** + * \brief Disables the selected interrupts sources on a AES peripheral. + * \param sources Bitwise OR of selected interrupt sources. + */ +void aes_disable_it(uint32_t sources); + +/** + * \brief Get the current status register of the given AES peripheral. + * \return AES status register. + */ +extern uint32_t aes_get_status(void); + +/** + * \brief Set the 128-bit/192-bit/256-bit cryptographic key used for + * encryption/decryption. + * \param key Pointer to a 16/24/32 bytes cipher key. + * \param len Length of the key, in bytes. + */ +void aes_write_key(const uint32_t * key, uint32_t len); + +/** + * \brief Set the for 32-bit input Data allow to set the 128-bit data block used + * for encryption/decryption. + * \param data Pointer to the 16-bytes data to cipher/decipher. + */ +void aes_set_input(uint32_t * data); + +/** + * \brief Get the four 32-bit data contain the 128-bit data block which has + * been encrypted/decrypted. + * \param data Pointer to the word that has been encrypted/decrypted.. + */ +void aes_get_output(uint32_t * data); + +/** + * \brief Set four 64-bit initialization vector data block, which is used by + * some modes of operation as an additional initial input. + * \param vector Pointer to the word of the initialization vector. + */ +void aes_set_vector(const uint32_t * vector); + +/** + * \brief Set Length in bytes of the Additional Authenticated Data that are to + * be processed. + * \param len Length. + */ +void aes_set_aad_len(uint32_t len); + +/** + * \brief Set Length in bytes of the plaintext/ciphertext data (that is, the C + * portion of the message) that are to be processed. + * \param len Length. + */ +void aes_set_data_len(uint32_t len); + +/** + * \brief Set The four 32-bit Hash Word registers expose the intermediate GHASH + * value. May be read to save the current GHASH value so processing can later be + * resumed, presumably on a later message fragment. + * Modes of operation as an additional initial input. + * \param hash Pointer to the word of the hash. + */ +void aes_set_gcm_hash(uint32_t * hash); + +/** + * \brief Get The four 32-bit Tag which contain the final 128-bit GCM + * Authentication tag 'T' when GCM processing is complete. + * \param tag Pointer to the word of the tag. + */ +void aes_get_gcm_tag(uint32_t * tag); + +/** + * \brief Reports the current value of the 32-bit GCM counter. + * \param counter Pointer to value of GCM counter. + */ +void aes_get_gcm_counter(uint32_t * counter); + +/** + * \brief Get the four 32-bit data containing the 128-bit H value computed from + * the KEYW value. + * \param h Pointer to the word that has been encrypted/decrypted. + */ +void aes_get_gcm_hash_subkey(uint32_t * h); + +#endif /* #ifndef _AES_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.c new file mode 100644 index 000000000..e13dc77c2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.c @@ -0,0 +1,429 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup aic_module + * + * \section Purpose + * The Advanced Interrupt Controller (AIC) is an 8-level priority, individually + * maskable, vectored interrupt controller, providing handling of up to thirty-two interrupt sources. + * + * \section Usage + *
    + *
  • Each interrupt source can be enabled or disabled by using the aic_enable() and aic_disable()
  • + *
+ * + * For more accurate information, please look at the AIC section of the + * Datasheet. + * + * Related files :\n + * \ref aic.c\n + * \ref aic.h\n + */ +/*@{*/ +/*@}*/ + +/** +* \file +* +* Implementation of Advanced Interrupt Controller (AIC) controller. +* +*/ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/aic.h" +#include "peripherals/matrix.h" +#include "cortex-a/cp15.h" +#include "cortex-a/cp15_pmu.h" +#include "cortex-a/cpsr.h" + +#include +#include + +/*------------------------------------------------------------------------------ + * Local functions + *------------------------------------------------------------------------------*/ + +/** + * \brief Default interrupt handler. + */ +static void _aic_default_irq_handler(void) +{ + while (1); +} + +/** + * \brief Interrupt Init. + */ +static void _aic_initialize(Aic* aic) +{ + uint32_t i; + + /* Disable all interrupts */ + for (i = 1; i < ID_PERIPH_COUNT; i++) + { + aic->AIC_SSR = i; + aic->AIC_IDCR = AIC_IDCR_INTD; + } + + /* Clear All pending interrupts flags */ + for (i = 0; i < ID_PERIPH_COUNT; i++) + { + aic->AIC_SSR = i; + aic->AIC_ICCR = AIC_ICCR_INTCLR; + } + + /* Perform 8 IT acknowledge (write any value in EOICR) (VPy) */ + for (i = 0; i < 8; i++) + aic->AIC_EOICR = 0; + + /* Assign default handler */ + for (i = 0; i < ID_PERIPH_COUNT; i++) + { + aic->AIC_SSR = i; + aic->AIC_SVR = (uint32_t)_aic_default_irq_handler; + } + aic->AIC_SPU = (uint32_t)_aic_default_irq_handler; +} + +/** + * \brief Configures an interrupt in the AIC. The interrupt is identified by its + * source (ID_xxx) and is configured to use the specified mode and + * interrupt handler function. Mode is the value that will be put in AIC_SMRx + * and the function address will be set in AIC_SVRx. + * The interrupt is disabled before configuration, so it is useless + * to do it before calling this function. When aic_configure returns, the + * interrupt will always be disabled and cleared; it must be enabled by a + * call to aic_enable(). + * + * \param source Interrupt source to configure. + * \param mode Triggering mode and priority of the interrupt. + * \param handler Interrupt handler function. + */ + +static void _aic_configure_it(uint32_t source, uint8_t mode) +{ + AIC->AIC_SSR = source; + /* Disable the interrupt first */ + AIC->AIC_IDCR = AIC_IDCR_INTD; + /* Configure mode and handler */ + AIC->AIC_SMR = mode; + /* Clear interrupt */ + AIC->AIC_ICCR = AIC_ICCR_INTCLR; +} + +/** + * \brief Enables interrupts coming from the given AIC and (unique) source (ID_xxx). + * + * \param aic AIC instance. + * \param source Interrupt source to enable. + */ +static void _aic_enable_it(Aic * aic, uint32_t source) +{ + aic->AIC_SSR = AIC_SSR_INTSEL(source); + aic->AIC_IECR = AIC_IECR_INTEN; +} + +/** + * \brief Disables interrupts coming from the given AIC and (unique) source (ID_xxx). + * + * \param aic AIC instance. + * \param source Interrupt source to disable. + */ +static void _aic_disable_it(Aic * aic, uint32_t source) +{ + aic->AIC_SSR = AIC_SSR_INTSEL(source); + aic->AIC_IDCR = AIC_IDCR_INTD; +} + +/** + * \brief Configure corresponding handler for the interrupts coming from the given (unique) source (ID_xxx). + * + * \param aic AIC instance. + * \param source Interrupt source to configure. + * \param handler handler for the interrupt. + */ +static void _aic_set_source_vector(Aic * aic, uint32_t source, void (*handler)(void)) +{ + if (aic->AIC_WPMR & AIC_WPMR_WPEN) { + aic_write_protection(aic, 1); + } + aic->AIC_SSR = AIC_SSR_INTSEL(source); + aic->AIC_SVR = (uint32_t)handler; +} + +/** + * \brief Configure the spurious interrupt handler + * + * \param aic AIC instance. + * \param handler handler for the interrupt. + */ +static void _aic_set_spurious_vector(Aic * aic, void (*handler)(void)) +{ + if (aic->AIC_WPMR & AIC_WPMR_WPEN) { + aic_write_protection(aic, 1); + } + aic->AIC_SPU = (uint32_t)handler; +} + +/** + * \brief Clears interrupts coming from the given AIC and (unique) source (ID_xxx). + * + * \param aic AIC instance. + * \param source Interrupt source to disable. + */ +static void _aic_clear_it(Aic * aic, uint32_t source) +{ + aic->AIC_SSR = AIC_SSR_INTSEL(source); + aic->AIC_ICCR = AIC_ICCR_INTCLR; +} + +/** + * \brief Sets interrupts coming from the given AIC and (unique) source (ID_xxx). + * + * \param aic AIC instance. + * \param source Interrupt source to disable. + */ +static void _aic_set_it(Aic * aic, uint32_t source) +{ + aic->AIC_SSR = AIC_SSR_INTSEL(source); + aic->AIC_ISCR = AIC_ISCR_INTSET; +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Set the default handler for all interrupts + */ +void aic_initialize(void) +{ + /* Disable IRQ and FIQ at core level */ + v_arm_set_cpsr_bits(CPSR_MASK_IRQ | CPSR_MASK_FIQ); + + /* Set default vectors */ + _aic_initialize(AIC); + _aic_initialize(SAIC); + + /* Redirect all interrupts to Non-secure AIC */ + SFR->SFR_AICREDIR = (SFR_AICREDIR_AICREDIRKEY(AICREDIR_KEY) ^ SFR->SFR_SN1) | + SFR_AICREDIR_NSAIC; + + /* Enable IRQ and FIQ at core level */ + v_arm_clr_cpsr_bits(CPSR_MASK_IRQ | CPSR_MASK_FIQ); +} + +/** + * \brief Enables interrupts coming from the given (unique) source (ID_xxx). + * + * \param source Interrupt source to enable. + */ +void aic_enable(uint32_t source) +{ + if (SFR->SFR_AICREDIR) { + _aic_enable_it(AIC, source); + return; + } + + Matrix* matrix = get_peripheral_matrix(source); + if (!matrix_is_peripheral_secured(matrix, source)) { + _aic_enable_it(AIC, source); + } else { + _aic_enable_it(SAIC, source); + } +} + +/** + * \brief Disables interrupts coming from the given (unique) source (ID_xxx). + * + * \param source Interrupt source to disable. + */ +void aic_disable(uint32_t source) +{ + if (SFR->SFR_AICREDIR) { + _aic_disable_it(AIC, source); + return; + } + + Matrix* matrix = get_peripheral_matrix(source); + if (!matrix_is_peripheral_secured(matrix, source)) { + _aic_disable_it(AIC, source); + } else { + _aic_disable_it(SAIC, source); + } +} + +/** + * \brief Configure interrupts' source mode. + * + * \param source Interrupt source to configure. + * \param mode mode combined of priority level and interrupt source type. + */ +void aic_configure(uint32_t source, uint8_t mode) +{ + if (SFR->SFR_AICREDIR) { + _aic_configure_it(source, mode); + return; + } + + Matrix* matrix = get_peripheral_matrix(source); + if (!matrix_is_peripheral_secured(matrix, source)) { + _aic_configure_it(source, mode); + } else { + // Does not apply for SAIC + } +} + +/** + * \brief Configure corresponding handler for the interrupts coming from the given (unique) source (ID_xxx). + * + * \param source Interrupt source to configure. + * \param handler handler for the interrupt. + */ +void aic_set_source_vector(uint32_t source, void (*handler)(void)) +{ + Aic *aic = AIC; + + if (SFR->SFR_AICREDIR == 0) { + Matrix* matrix = get_peripheral_matrix(source); + if (matrix_is_peripheral_secured(matrix, source)) + aic = SAIC; + } + _aic_set_source_vector(aic, source, handler); +} + +/** + * \brief Configure the spurious interrupt handler + * + * \param handler handler for the interrupt. + */ +void aic_set_spurious_vector(void (*handler)(void)) +{ + Aic *aic = AIC; + + if (SFR->SFR_AICREDIR == 0) { + aic = SAIC; + } + + _aic_set_spurious_vector(aic, handler); +} + +/** + * \brief Configure interrupts' source mode. + * + * \param source Interrupt source to configure. + * \param mode mode combined of priority level and interrupt source type. + */ +void aic_set_or_clear(uint32_t source, uint8_t set) +{ + Aic *aic = AIC; + + if (SFR->SFR_AICREDIR == 0) { + Matrix* matrix = get_peripheral_matrix(source); + if (matrix_is_peripheral_secured(matrix, source)) + aic = SAIC; + } + + if (set) { + _aic_set_it(aic, source); + } else { + _aic_clear_it(aic, source); + } +} + +/** + * \brief Indicate treatment completion for interrupts coming from the given AIC and (unique) source (ID_xxx). + * + * \param aic AIC instance. + */ +void aic_end_interrupt(Aic * aic) +{ + aic->AIC_EOICR = AIC_EOICR_ENDIT; +} + +/** + * \brief Configuration of protection mode and general interrupt mask for debug. + * + * \param aic AIC instance. + * \param protect Enable/Disable protection mode. + * \param mask Enable/Disable mask IRQ and FIQ. + * + * \retval 0 - succeed. 1 - failed. + */ +uint32_t aic_debug_config(Aic * aic, uint8_t protect, uint8_t mask) +{ + uint32_t tmp; + + /* return in case the "Write Protection Mode" is enabled */ + if (aic->AIC_WPMR & AIC_WPMR_WPEN) + return 1; + + tmp = protect ? (1 << 1) : (0 << 1); + if (mask) + tmp++; + aic->AIC_DCR = tmp; + return 0; +} + +/** + * \brief Enable/Disable AIC write protection mode. + * + * \param aic AIC instance. + * \param enable Enable/Disable AIC write protection mode. + */ +void aic_write_protection(Aic * aic, uint32_t enable) +{ + if (enable) { + aic->AIC_WPMR = AIC_WPMR_WPKEY_PASSWD | AIC_WPMR_WPEN; + } else { + aic->AIC_WPMR = AIC_WPMR_WPKEY_PASSWD; + } +} + +/** + * \brief Get AIC Write Protection Status. + * + * \param aic AIC instance. + * \param pViolationSource pointer to address to store the violation source + * + * \retval 0 - No violation occured. 1 - violation occured. + */ +uint32_t aic_violation_occured(Aic * aic, uint32_t * pViolationSource) +{ + if (aic->AIC_WPSR & AIC_WPSR_WPVS) { + *pViolationSource = + (aic-> + AIC_WPSR & AIC_WPSR_WPVSRC_Msk) >> AIC_WPSR_WPVSRC_Pos; + } + return 0; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.h new file mode 100644 index 000000000..20204c1a2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/aic.h @@ -0,0 +1,79 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * Methods and definitions for configuring interrupts. + * + * \section Usage + * -# Enable or disable interrupt generation of a particular source with + * IRQ_EnableIT and IRQ_DisableIT. + */ + +#ifndef AIC_H +#define AIC_H + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +typedef void(*aic_handler_t)(void); + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void aic_initialize(void); +extern void aic_enable(uint32_t source); +extern void aic_disable(uint32_t source); +extern void aic_configure(uint32_t source, uint8_t mode); +extern void aic_set_source_vector(uint32_t source, void (*handler)(void)); +extern void aic_set_spurious_vector(void (*handler)(void)); +extern void aic_set_or_clear(uint32_t source, uint8_t set); +extern void aic_end_interrupt(Aic * aic); +extern uint32_t aic_debug_config(Aic * aic, uint8_t protect, uint8_t mask); +extern void aic_write_protection(Aic * aic, uint32_t enable); +extern uint32_t aic_violation_occured(Aic * aic, uint32_t * pViolationSource); + +#ifdef __cplusplus +} +#endif + +#endif //#ifndef AIC_H diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.c new file mode 100644 index 000000000..276c731be --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.c @@ -0,0 +1,386 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "board.h" +#include "trace.h" + +#include "peripherals/classd.h" +#include "peripherals/pmc.h" + +#include +#include + +/*---------------------------------------------------------------------------- + * Local constants + *----------------------------------------------------------------------------*/ + +static const struct { + uint32_t rate; + uint32_t sample_rate; + uint32_t dsp_clk; +} audio_info[] = { + { 8000, CLASSD_INTPMR_FRAME_FRAME_8K, CLASSD_INTPMR_DSPCLKFREQ_12M288 }, + { 16000, CLASSD_INTPMR_FRAME_FRAME_16K, CLASSD_INTPMR_DSPCLKFREQ_12M288 }, + { 32000, CLASSD_INTPMR_FRAME_FRAME_32K, CLASSD_INTPMR_DSPCLKFREQ_12M288 }, + { 48000, CLASSD_INTPMR_FRAME_FRAME_48K, CLASSD_INTPMR_DSPCLKFREQ_12M288 }, + { 96000, CLASSD_INTPMR_FRAME_FRAME_96K, CLASSD_INTPMR_DSPCLKFREQ_12M288 }, + { 22050, CLASSD_INTPMR_FRAME_FRAME_22K, CLASSD_INTPMR_DSPCLKFREQ_11M2896 }, + { 44100, CLASSD_INTPMR_FRAME_FRAME_44K, CLASSD_INTPMR_DSPCLKFREQ_11M2896 }, + { 88200, CLASSD_INTPMR_FRAME_FRAME_88K, CLASSD_INTPMR_DSPCLKFREQ_11M2896 }, +}; + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static bool _dspclk_configure(uint32_t dsp_clk) +{ + struct _pmc_audio_cfg cfg; + + /* Pad Clock: not used */ + cfg.div = 0; + cfg.qdaudio = 0; + + /* PMC Clock: */ + /* 12Mhz * (ND + 1 + FRACR/2^22) / (QDPMC + 1) = 8 * DSPCLK */ + switch (dsp_clk) { + case CLASSD_INTPMR_DSPCLKFREQ_12M288: + /* 12Mhz * (56 + 1 + 1442841/2^22) / (6 + 1) = 8 * 12.288Mhz */ + cfg.nd = 56; + cfg.fracr = 1442841; + cfg.qdpmc = 6; + break; + case CLASSD_INTPMR_DSPCLKFREQ_11M2896: + /* 12Mhz * (59 + 1 + 885837/2^22) / (7 + 1) = 8 * 11.2896Mhz */ + cfg.nd = 59; + cfg.fracr = 885837; + cfg.qdpmc = 7; + break; + default: + return false; + } + + pmc_configure_audio(&cfg); + pmc_enable_audio(true, false); + +#ifndef NDEBUG + { + uint32_t clk; + clk = pmc_get_audio_pmc_clock(); + trace_debug("Configured Audio PLL PMC Clock: %u (= 8 * %u)\r\n", + (unsigned)clk, (unsigned)(clk >> 3)); + } +#endif + + return true; +} + +static bool _set_eqcfg_bits(enum _classd_eqcfg eqcfg, volatile uint32_t *intpmr) +{ + uint32_t mask = CLASSD_INTPMR_EQCFG_Msk; + uint32_t bits = 0; + + switch (eqcfg) { + case CLASSD_EQCFG_FLAT: + bits = CLASSD_INTPMR_EQCFG_FLAT; + break; + case CLASSD_EQCFG_BBOOST12: + bits = CLASSD_INTPMR_EQCFG_BBOOST12; + break; + case CLASSD_EQCFG_BBOOST6: + bits = CLASSD_INTPMR_EQCFG_BBOOST6; + break; + case CLASSD_EQCFG_BCUT12: + bits = CLASSD_INTPMR_EQCFG_BCUT12; + break; + case CLASSD_EQCFG_BCUT6: + bits = CLASSD_INTPMR_EQCFG_BCUT6; + break; + case CLASSD_EQCFG_MBOOST3: + bits = CLASSD_INTPMR_EQCFG_MBOOST3; + break; + case CLASSD_EQCFG_MBOOST8: + bits = CLASSD_INTPMR_EQCFG_MBOOST8; + break; + case CLASSD_EQCFG_MCUT3: + bits = CLASSD_INTPMR_EQCFG_MCUT3; + break; + case CLASSD_EQCFG_MCUT8: + bits = CLASSD_INTPMR_EQCFG_MCUT8; + break; + case CLASSD_EQCFG_TBOOST12: + bits = CLASSD_INTPMR_EQCFG_TBOOST12; + break; + case CLASSD_EQCFG_TBOOST6: + bits = CLASSD_INTPMR_EQCFG_TBOOST6; + break; + case CLASSD_EQCFG_TCUT12: + bits = CLASSD_INTPMR_EQCFG_TCUT12; + break; + case CLASSD_EQCFG_TCUT6: + bits = CLASSD_INTPMR_EQCFG_TCUT6; + break; + default: + trace_warning("classd: invalid equalizer config %u\r\n", + (unsigned)eqcfg); + return false; + }; + + *intpmr = (*intpmr & ~mask) | bits; + return true; +} + +static bool _set_mono_bits(bool mono, enum _classd_mono mono_mode, volatile uint32_t *intpmr) +{ + uint32_t mask = CLASSD_INTPMR_MONO_ENABLED | CLASSD_INTPMR_MONOMODE_Msk; + uint32_t bits = 0; + + if (mono) { + bits = CLASSD_INTPMR_MONO_ENABLED; + switch (mono_mode) { + case CLASSD_MONO_MIXED: + bits |= CLASSD_INTPMR_MONOMODE_MONOMIX; + break; + case CLASSD_MONO_SAT: + bits |= CLASSD_INTPMR_MONOMODE_MONOSAT; + break; + case CLASSD_MONO_LEFT: + bits |= CLASSD_INTPMR_MONOMODE_MONOLEFT; + break; + case CLASSD_MONO_RIGHT: + bits |= CLASSD_INTPMR_MONOMODE_MONORIGHT; + break; + default: + trace_warning("classd: invalid mono mode %u\r\n", + (unsigned)mono_mode); + return false; + } + } + + *intpmr = (*intpmr & ~mask) | bits; + return true; +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +bool classd_configure(struct _classd_desc *desc) +{ + uint8_t i; + uint32_t mr, intpmr, dsp_clk_set, frame_set; + + for (i = 0; i < ARRAY_SIZE(audio_info); i++) { + if (audio_info[i].rate == desc->sample_rate) { + dsp_clk_set = audio_info[i].dsp_clk; + frame_set = audio_info[i].sample_rate; + break; + } + } + if(i == ARRAY_SIZE(audio_info)) + return false; + + if (!_dspclk_configure(dsp_clk_set)) + return false; + + /* enable peripheral clock, disable audio clock for now */ + pmc_enable_peripheral(ID_CLASSD); + pmc_disable_gck(ID_CLASSD); + pmc_configure_gck(ID_CLASSD, PMC_PCR_GCKCSS_AUDIO_CLK, 0); + + /* perform soft reset */ + CLASSD->CLASSD_CR = CLASSD_CR_SWRST; + CLASSD->CLASSD_IDR = CLASSD_IDR_DATRDY; + + /* initial MR/INTPMR values */ + mr = 0; + intpmr = dsp_clk_set | frame_set; + + /* configure output mode */ + switch (desc->mode) { + case CLASSD_OUTPUT_SINGLE_ENDED: + break; + case CLASSD_OUTPUT_DIFFERENTIAL: + mr |= CLASSD_MR_PWMTYP; + break; + case CLASSD_OUTPUT_HALF_BRIDGE: + mr |= CLASSD_MR_NON_OVERLAP; + break; + case CLASSD_OUTPUT_FULL_BRIDGE: + mr |= CLASSD_MR_PWMTYP | CLASSD_MR_NON_OVERLAP; + break; + default: + trace_warning("classd: invalid mode %u\n", (unsigned)desc->mode); + return false; + } + + /* configure non-overlapping time */ + if (mr & CLASSD_MR_NON_OVERLAP) { + switch (desc->non_ovr) { + case CLASSD_NONOVR_5NS: + mr |= CLASSD_MR_NOVRVAL_5NS; + break; + case CLASSD_NONOVR_10NS: + mr |= CLASSD_MR_NOVRVAL_10NS; + break; + case CLASSD_NONOVR_15NS: + mr |= CLASSD_MR_NOVRVAL_15NS; + break; + case CLASSD_NONOVR_20NS: + mr |= CLASSD_MR_NOVRVAL_20NS; + break; + default: + trace_warning("classd: invalid non overlap value %u\r\n", + (unsigned)desc->non_ovr); + return false; + } + } + + /* configure mono/stereo */ + if (desc->swap_channels) + intpmr |= CLASSD_INTPMR_SWAP; + if (!_set_mono_bits(desc->mono, desc->mono_mode, &intpmr)) + return false; + + /* configure left channel (muted, max attn) */ + if (desc->left_enable) + mr |= CLASSD_MR_LEN; + mr |= CLASSD_MR_LMUTE; + intpmr |= CLASSD_INTPMR_ATTL(CLASSD_INTPMR_ATTL_Msk); + + /* configure right channel (muted, max attn) */ + if (desc->right_enable) + mr |= CLASSD_MR_REN; + mr |= CLASSD_MR_RMUTE; + intpmr |= CLASSD_INTPMR_ATTR(CLASSD_INTPMR_ATTL_Msk); + + /* write configuration */ + CLASSD->CLASSD_MR = mr; + CLASSD->CLASSD_INTPMR = intpmr; + + /* enable audio clock */ + pmc_enable_gck(ID_CLASSD); + + return (CLASSD->CLASSD_INTSR & CLASSD_INTSR_CFGERR) == 0; +} + +void classd_disable(void) +{ + pmc_disable_audio(); + pmc_disable_gck(ID_CLASSD); + pmc_disable_peripheral(ID_CLASSD); +} + +void classd_swap_channels(bool swap) +{ + if (swap) { + CLASSD->CLASSD_INTPMR |= CLASSD_INTPMR_SWAP; + } else { + CLASSD->CLASSD_INTPMR &= ~CLASSD_INTPMR_SWAP; + } +} + +void classd_enable_mono(enum _classd_mono mono_mode) +{ + _set_mono_bits(true, mono_mode, &CLASSD->CLASSD_INTPMR); +} + +void classd_disable_mono(void) +{ + _set_mono_bits(false, CLASSD_MONO_MIXED, &CLASSD->CLASSD_INTPMR); +} + +void classd_set_equalizer(enum _classd_eqcfg eqcfg) +{ + _set_eqcfg_bits(eqcfg, &CLASSD->CLASSD_INTPMR); +} + +void classd_enable_channels(bool left, bool right) +{ + uint32_t bits = 0; + if (left) + bits |= CLASSD_MR_LEN; + if (right) + bits |= CLASSD_MR_REN; + CLASSD->CLASSD_MR |= bits; +} + +void classd_disable_channels(bool left, bool right) +{ + uint32_t bits = 0; + if (left) + bits |= CLASSD_MR_LEN; + if (right) + bits |= CLASSD_MR_REN; + CLASSD->CLASSD_MR &= ~bits; +} + +void classd_set_left_attenuation(uint8_t attn) +{ + if (attn < 1 || attn > 0x3f) + return; + + uint32_t intpmr = CLASSD->CLASSD_INTPMR & ~CLASSD_INTPMR_ATTL_Msk; + CLASSD->CLASSD_INTPMR = intpmr | CLASSD_INTPMR_ATTL(attn); +} + +void classd_set_right_attenuation(uint8_t attn) +{ + if (attn < 1 || attn > 0x3f) + return; + + uint32_t intpmr = CLASSD->CLASSD_INTPMR & ~CLASSD_INTPMR_ATTR_Msk; + CLASSD->CLASSD_INTPMR = intpmr | CLASSD_INTPMR_ATTR(attn); +} + +void classd_volume_mute(bool left, bool right) +{ + uint32_t bits = 0; + if (left) + bits |= CLASSD_MR_LMUTE; + if (right) + bits |= CLASSD_MR_RMUTE; + CLASSD->CLASSD_MR |= bits; +} + +void classd_volume_unmute(bool left, bool right) +{ + uint32_t bits = 0; + if (left) + bits |= CLASSD_MR_LMUTE; + if (right) + bits |= CLASSD_MR_RMUTE; + CLASSD->CLASSD_MR &= ~bits; +} + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.h new file mode 100644 index 000000000..45a2ac6df --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/classd.h @@ -0,0 +1,125 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CLASSD_H +#define _CLASSD_H + +/*--------------------------------------------------------------------------- + * Includes + *---------------------------------------------------------------------------*/ + +#include +#include + +/*--------------------------------------------------------------------------- + * Types + *---------------------------------------------------------------------------*/ + +enum _classd_mode +{ + CLASSD_OUTPUT_SINGLE_ENDED, + CLASSD_OUTPUT_DIFFERENTIAL, + CLASSD_OUTPUT_HALF_BRIDGE, + CLASSD_OUTPUT_FULL_BRIDGE, +}; + +enum _classd_non_ovr +{ + CLASSD_NONOVR_5NS, + CLASSD_NONOVR_10NS, + CLASSD_NONOVR_15NS, + CLASSD_NONOVR_20NS, +}; + +enum _classd_eqcfg +{ + CLASSD_EQCFG_FLAT, + CLASSD_EQCFG_BBOOST12, + CLASSD_EQCFG_BBOOST6, + CLASSD_EQCFG_BCUT12, + CLASSD_EQCFG_BCUT6, + CLASSD_EQCFG_MBOOST3, + CLASSD_EQCFG_MBOOST8, + CLASSD_EQCFG_MCUT3, + CLASSD_EQCFG_MCUT8, + CLASSD_EQCFG_TBOOST12, + CLASSD_EQCFG_TBOOST6, + CLASSD_EQCFG_TCUT12, + CLASSD_EQCFG_TCUT6, +}; + +enum _classd_mono +{ + CLASSD_MONO_MIXED, + CLASSD_MONO_SAT, + CLASSD_MONO_LEFT, + CLASSD_MONO_RIGHT, +}; + +struct _classd_desc +{ + uint32_t sample_rate; + enum _classd_mode mode; + enum _classd_non_ovr non_ovr; + bool swap_channels; + bool mono; + enum _classd_mono mono_mode; + bool left_enable; + bool right_enable; +}; + +/*--------------------------------------------------------------------------- + * Exported functions + *---------------------------------------------------------------------------*/ + +extern bool classd_configure(struct _classd_desc *desc); + +extern void classd_disable(void); + +extern void classd_swap_channels(bool swap); + +extern void classd_enable_mono(enum _classd_mono mono_mode); + +extern void classd_disable_mono(void); + +extern void classd_set_equalizer(enum _classd_eqcfg eqcfg); + +extern void classd_enable_channels(bool left, bool right); + +extern void classd_disable_channels(bool left, bool right); + +extern void classd_set_left_attenuation(uint8_t attn); + +extern void classd_set_right_attenuation(uint8_t attn); + +extern void classd_volume_mute(bool left, bool right); + +extern void classd_volume_unmute(bool left, bool right); + +#endif /* _CLASSD_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.c new file mode 100644 index 000000000..ab04f26a9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.c @@ -0,0 +1,82 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/flexcom.h" + +#include "peripherals/usart.h" +#include "peripherals/spi.h" +#include "peripherals/twi.h" + +#include + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +/** + * \brief Select a protocol for a FLEXCOM device + * + * + * \param flexcom Pointer to FLEXCOM peripheral to configure. + * \param protocol Protocol to use. + */ +void flexcom_select(Flexcom * flexcom, uint32_t protocol) +{ + assert(flexcom); + uint32_t current_protocol = flexcom->FLEX_MR; + + usart_set_receiver_enabled(&flexcom->usart, 0u); + + /* Shutdown previous protocol */ + switch (current_protocol) { + case FLEX_MR_OPMODE_USART: + usart_set_receiver_enabled(&flexcom->usart, 0u); + usart_set_transmitter_enabled(&flexcom->usart, 0u); + break; + case FLEX_MR_OPMODE_SPI: + spi_disable(&flexcom->spi); + break; + case FLEX_MR_OPMODE_TWI: + twi_stop(&flexcom->twi); + default: + break; + } + + assert(protocol & FLEX_MR_OPMODE_NO_COM || + protocol & FLEX_MR_OPMODE_USART || + FLEX_MR_OPMODE_SPI || FLEX_MR_OPMODE_TWI); + + /* Activate the new mode () */ + flexcom->FLEX_MR = protocol; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.h new file mode 100644 index 000000000..75b92a1ba --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/flexcom.h @@ -0,0 +1,75 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * This module provides several definitions and methods for using an USART + * peripheral. + * + * \par Usage + * + * -# Enable the USART peripheral clock in the PMC. + * -# Enable the required USART PIOs (see pio.h). + * -# Configure the UART by calling usart_configure. + * -# Enable the transmitter and/or the receiver of the USART using + * usart_set_transmitter_enabled and usart_set_receiver_enabled. + * -# Send data through the USART using the usart_write methods. + * -# Receive data from the USART using the usart_read functions; the availability of data can be polled + * with usart_is_data_available. + * -# Disable the transmitter and/or the receiver of the USART with + * usart_set_transmitter_enabled and usart_set_receiver_enabled. + */ + +#ifndef _FLEXCOM_ +#define _FLEXCOM_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*------------------------------------------------------------------------------*/ +/* Exported functions */ +/*------------------------------------------------------------------------------*/ + +extern void flexcom_select(Flexcom * flexcom, uint32_t protocol); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _FLEXCOM_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.c new file mode 100644 index 000000000..02e9a2601 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.c @@ -0,0 +1,518 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "trace.h" +#include "peripherals/gmac.h" +#include "peripherals/pmc.h" +#include +#include +#include + +/*---------------------------------------------------------------------------- + * Local definitions + *----------------------------------------------------------------------------*/ + +/* some IP versions don't have this configuration flag and instead expect 0 */ +#ifndef GMAC_NCFGR_DBW_DBW32 +#define GMAC_NCFGR_DBW_DBW32 0 +#endif + +/* some IP versions don't have this error flag, set it to 0 to ignore it */ +#ifndef GMAC_TSR_UND +#define GMAC_TSR_UND 0 +#endif + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static bool _gmac_configure_mdc_clock(Gmac *gmac) +{ + uint32_t mck, clk; + + mck = pmc_get_peripheral_clock(get_gmac_id_from_addr(gmac)); + + /* Disable RX/TX */ + gmac->GMAC_NCR &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + /* Find divider */ + if (mck <= 20000000) { + clk = GMAC_NCFGR_CLK_MCK_8; // MCK/8 + } else if (mck <= 40000000) { + clk = GMAC_NCFGR_CLK_MCK_16; // MCK/16 + } else if (mck <= 80000000) { + clk = GMAC_NCFGR_CLK_MCK_32; // MCK/32 + } else if (mck <= 120000000) { + clk = GMAC_NCFGR_CLK_MCK_48; // MCK/48 + } else if (mck <= 160000000) { + clk = GMAC_NCFGR_CLK_MCK_64; // MCK/64 + } else if (mck <= 240000000) { + clk = GMAC_NCFGR_CLK_MCK_96; // MCK/96 + } else { + trace_error("MCK too high, cannot configure MDC clock.\r\n"); + return false; + } + + /* configure MDC clock divider and enable RX/TX */ + gmac->GMAC_NCFGR = (gmac->GMAC_NCFGR & ~GMAC_NCFGR_CLK_Msk) | clk; + gmac->GMAC_NCR |= (GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + return true; +} + +static bool _gmac_phy_wait_idle(Gmac* gmac, uint32_t retries) +{ + uint32_t count = 0; + while ((gmac->GMAC_NSR & GMAC_NSR_IDLE) == 0) { + if (retries > 0 && count > retries) { + trace_debug("Timeout reached while waiting for PHY management logic to become idle"); + return false; + } + count++; + } + return true; +} + +static void _gmac_set_link_speed(Gmac* gmac, enum _gmac_speed speed, enum _gmac_duplex duplex) +{ + /* Configure duplex */ + switch (duplex) { + case GMAC_DUPLEX_HALF: + gmac->GMAC_NCFGR &= ~GMAC_NCFGR_FD; + break; + case GMAC_DUPLEX_FULL: + gmac->GMAC_NCFGR |= GMAC_NCFGR_FD; + break; + default: + trace_error("Invalid duplex value %d\r\n", duplex); + return; + } + + /* Configure speed */ + switch (speed) { + case GMAC_SPEED_10M: + gmac->GMAC_NCFGR &= ~GMAC_NCFGR_SPD; + break; + case GMAC_SPEED_100M: + gmac->GMAC_NCFGR |= GMAC_NCFGR_SPD; + break; + default: + trace_error("Invalid speed value %d\r\n", speed); + return; + } +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +bool gmac_configure(Gmac* gmac) +{ + pmc_enable_peripheral(get_gmac_id_from_addr(gmac)); + + /* Disable TX & RX and more */ + gmac_set_network_control_register(gmac, 0); + gmac_set_network_config_register(gmac, GMAC_NCFGR_DBW_DBW32); + + /* Disable interrupts */ + gmac_disable_it(gmac, 0, ~0u); +#ifdef CONFIG_HAVE_GMAC_QUEUES + gmac_disable_it(gmac, 1, ~0u); + gmac_disable_it(gmac, 2, ~0u); +#endif + + /* Clear statistics */ + gmac_clear_statistics(gmac); + + /* Clear all status bits in the receive status register. */ + gmac_clear_rx_status(gmac, GMAC_RSR_RXOVR | GMAC_RSR_REC | + GMAC_RSR_BNA | GMAC_RSR_HNO); + + /* Clear all status bits in the transmit status register */ + gmac_clear_tx_status(gmac, GMAC_TSR_UBR | GMAC_TSR_COL | + GMAC_TSR_RLE | GMAC_TSR_TXGO | GMAC_TSR_TFC | + GMAC_TSR_TXCOMP | GMAC_TSR_UND | GMAC_TSR_HRESP); + + /* Clear interrupts */ + gmac_get_it_status(gmac, 0); +#ifdef CONFIG_HAVE_GMAC_QUEUES + gmac_get_it_status(gmac, 1); + gmac_get_it_status(gmac, 2); +#endif + + return _gmac_configure_mdc_clock(gmac); +} + +void gmac_set_network_control_register(Gmac* gmac, uint32_t ncr) +{ + gmac->GMAC_NCR = ncr; +} + +uint32_t gmac_get_network_control_register(Gmac* gmac) +{ + return gmac->GMAC_NCR; +} + +void gmac_set_network_config_register(Gmac* gmac, uint32_t ncfgr) +{ + gmac->GMAC_NCFGR = ncfgr; +} + +uint32_t gmac_get_network_config_register(Gmac* gmac) +{ + return gmac->GMAC_NCFGR; +} + +void gmac_enable_mdio(Gmac* gmac) +{ + /* Disable RX/TX */ + gmac->GMAC_NCR &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + /* Enable MDIO */ + gmac->GMAC_NCR |= GMAC_NCR_MPE; + + /* Enable RX/TX */ + gmac->GMAC_NCR |= (GMAC_NCR_RXEN | GMAC_NCR_TXEN); +} + +void gmac_disable_mdio(Gmac* gmac) +{ + /* Disable RX/TX */ + gmac->GMAC_NCR &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + /* Disable MDIO */ + gmac->GMAC_NCR &= ~GMAC_NCR_MPE; + + /* Enable RX/TX */ + gmac->GMAC_NCR |= (GMAC_NCR_RXEN | GMAC_NCR_TXEN); +} + +bool gmac_phy_read(Gmac* gmac, uint8_t phy_addr, uint8_t reg_addr, uint16_t* data, + uint32_t retries) +{ + /* Wait until idle */ + if (!_gmac_phy_wait_idle(gmac, retries)) + return false; + + /* Write maintenance register */ + gmac->GMAC_MAN = GMAC_MAN_CLTTO | + GMAC_MAN_OP(2) | + GMAC_MAN_WTN(2) | + GMAC_MAN_PHYA(phy_addr) | + GMAC_MAN_REGA(reg_addr); + + /* Wait until idle */ + if (!_gmac_phy_wait_idle(gmac, retries)) + return false; + + *data = (gmac->GMAC_MAN & GMAC_MAN_DATA_Msk) >> GMAC_MAN_DATA_Pos; + return true; +} + +bool gmac_phy_write(Gmac* gmac, uint8_t phy_addr, uint8_t reg_addr, uint16_t data, + uint32_t retries) +{ + /* Wait until idle */ + if (!_gmac_phy_wait_idle(gmac, retries)) + return false; + + /* Write maintenance register */ + gmac->GMAC_MAN = GMAC_MAN_CLTTO | + GMAC_MAN_OP(1) | + GMAC_MAN_WTN(2) | + GMAC_MAN_PHYA(phy_addr) | + GMAC_MAN_REGA(reg_addr) | + GMAC_MAN_DATA(data); + + /* Wait until idle */ + return _gmac_phy_wait_idle(gmac, retries); +} + +void gmac_enable_mii(Gmac* gmac) +{ + /* Disable RX/TX */ + gmac->GMAC_NCR &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + /* Disable RMII */ + gmac->GMAC_UR &= ~GMAC_UR_RMII; + + /* Enable RX/TX */ + gmac->GMAC_NCR |= (GMAC_NCR_RXEN | GMAC_NCR_TXEN); +} + +void gmac_enable_rmii(Gmac* gmac, enum _gmac_speed speed, enum _gmac_duplex duplex) +{ + /* Disable RX/TX */ + gmac->GMAC_NCR &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + /* Configure speed/duplex */ + _gmac_set_link_speed(gmac, speed, duplex); + + /* Enable RMII */ + gmac->GMAC_UR |= GMAC_UR_RMII; + + /* Enable RX/TX */ + gmac->GMAC_NCR |= (GMAC_NCR_RXEN | GMAC_NCR_TXEN); +} + +void gmac_set_link_speed(Gmac* gmac, enum _gmac_speed speed, enum _gmac_duplex duplex) +{ + /* Disable RX/TX */ + gmac->GMAC_NCR &= ~(GMAC_NCR_RXEN | GMAC_NCR_TXEN); + + /* Configure speed/duplex */ + _gmac_set_link_speed(gmac, speed, duplex); + + /* Enable RX/TX */ + gmac->GMAC_NCR |= (GMAC_NCR_RXEN | GMAC_NCR_TXEN); +} + +void gmac_enable_local_loopback(Gmac* gmac) +{ + gmac->GMAC_NCR |= GMAC_NCR_LBL; +} + +void gmac_disable_local_loopback(Gmac* gmac) +{ + gmac->GMAC_NCR &= ~GMAC_NCR_LBL; +} + +uint32_t gmac_get_tx_status(Gmac* gmac) +{ + return gmac->GMAC_TSR; +} + +void gmac_clear_tx_status(Gmac* gmac, uint32_t mask) +{ + gmac->GMAC_TSR = mask; +} + +uint32_t gmac_get_rx_status(Gmac* gmac) +{ + return gmac->GMAC_RSR; +} + +void gmac_clear_rx_status(Gmac* gmac, uint32_t mask) +{ + gmac->GMAC_RSR = mask; +} + +void gmac_receive_enable(Gmac* gmac, bool enable) +{ + if (enable) + gmac->GMAC_NCR |= GMAC_NCR_RXEN; + else + gmac->GMAC_NCR &= ~GMAC_NCR_RXEN; +} + +void gmac_transmit_enable(Gmac* gmac, bool enable) +{ + if (enable) + gmac->GMAC_NCR |= GMAC_NCR_TXEN; + else + gmac->GMAC_NCR &= ~GMAC_NCR_TXEN; +} + +void gmac_set_rx_desc(Gmac* gmac, uint8_t queue, struct _gmac_desc* desc) +{ + if (queue == 0) { + gmac->GMAC_RBQB = ((uint32_t)desc) & GMAC_RBQB_ADDR_Msk; + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + gmac->GMAC_RBQBAPQ[queue - 1] = ((uint32_t)desc) & GMAC_RBQBAPQ_RXBQBA_Msk; + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + } +} + +struct _gmac_desc* gmac_get_rx_desc(Gmac* gmac, uint8_t queue) +{ + if (queue == 0) { + return (struct _gmac_desc*)(gmac->GMAC_RBQB & GMAC_RBQB_ADDR_Msk); + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + return (struct _gmac_desc*)(gmac->GMAC_RBQBAPQ[queue - 1] & GMAC_RBQBAPQ_RXBQBA_Msk); + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + return NULL; + } +} + +void gmac_set_tx_desc(Gmac* gmac, uint8_t queue, struct _gmac_desc* desc) +{ + if (queue == 0) { + gmac->GMAC_TBQB = ((uint32_t)desc) & GMAC_TBQB_ADDR_Msk; + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + gmac->GMAC_TBQBAPQ[queue - 1] = ((uint32_t)desc) & GMAC_TBQBAPQ_TXBQBA_Msk; + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + } +} + +struct _gmac_desc* gmac_get_tx_desc(Gmac* gmac, uint8_t queue) +{ + if (queue == 0) { + return (struct _gmac_desc*)(gmac->GMAC_TBQB & GMAC_TBQB_ADDR_Msk); + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + return (struct _gmac_desc*)(gmac->GMAC_TBQBAPQ[queue - 1] & GMAC_TBQBAPQ_TXBQBA_Msk); + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + return NULL; + } +} + +uint32_t gmac_get_it_mask(Gmac* gmac, uint8_t queue) +{ + if (queue == 0) { + return gmac->GMAC_IMR; + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + return gmac->GMAC_IMRPQ[queue - 1]; + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + return 0; + } +} + +void gmac_enable_it(Gmac* gmac, uint8_t queue, uint32_t mask) +{ + if (queue == 0) { + gmac->GMAC_IER = mask; + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + gmac->GMAC_IERPQ[queue - 1] = mask; + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + } +} + +void gmac_disable_it(Gmac * gmac, uint8_t queue, uint32_t mask) +{ + if (queue == 0) { + gmac->GMAC_IDR = mask; + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + gmac->GMAC_IDRPQ[queue - 1] = mask; + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + } +} + +uint32_t gmac_get_it_status(Gmac* gmac, uint8_t queue) +{ + if (queue == 0) { + return gmac->GMAC_ISR; + } +#ifdef CONFIG_HAVE_GMAC_QUEUES + else if (queue <= GMAC_NUM_QUEUES) { + return gmac->GMAC_ISRPQ[queue - 1]; + } +#endif + else { + trace_debug("Invalid queue number %d\r\n", queue); + return 0; + } +} + +void gmac_set_mac_addr(Gmac* gmac, uint8_t sa_idx, uint8_t* mac) +{ + gmac->GMAC_SA[sa_idx].GMAC_SAB = (mac[3] << 24) | + (mac[2] << 16) | (mac[1] << 8) | mac[0]; + gmac->GMAC_SA[sa_idx].GMAC_SAT = (mac[5] << 8) | + mac[4]; +} + +void gmac_set_mac_addr32(Gmac* gmac, uint8_t sa_idx, + uint32_t mac_top, uint32_t mac_bottom) +{ + gmac->GMAC_SA[sa_idx].GMAC_SAB = mac_bottom; + gmac->GMAC_SA[sa_idx].GMAC_SAT = mac_top; +} + +void gmac_set_mac_addr64(Gmac* gmac, uint8_t sa_idx, uint64_t mac) +{ + gmac->GMAC_SA[sa_idx].GMAC_SAB = (uint32_t)(mac & 0xffffffff); + gmac->GMAC_SA[sa_idx].GMAC_SAT = (uint32_t)(mac >> 32); +} + +void gmac_clear_statistics(Gmac* gmac) +{ + gmac->GMAC_NCR |= GMAC_NCR_CLRSTAT; +} + +void gmac_increase_statistics(Gmac* gmac) +{ + gmac->GMAC_NCR |= GMAC_NCR_INCSTAT; +} + +void gmac_enable_statistics_write(Gmac* gmac, bool enable) +{ + if (enable) + gmac->GMAC_NCR |= GMAC_NCR_WESTAT; + else + gmac->GMAC_NCR &= ~GMAC_NCR_WESTAT; +} + +void gmac_start_transmission(Gmac * gmac) +{ + gmac->GMAC_NCR |= GMAC_NCR_TSTART; +} + +void gmac_halt_transmission(Gmac * gmac) +{ + gmac->GMAC_NCR |= GMAC_NCR_THALT; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.h new file mode 100644 index 000000000..8e99534d7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmac.h @@ -0,0 +1,361 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/** \addtogroup gmac_module + * @{ + * Provides the interface to configure and use the GMAC peripheral. + * + * \section gmac_usage Usage + * - Configure Gmac::GMAC_NCFG with gmac_configure(), some of related controls + * are also available, such as: + * - gmac_set_link_speed(): Setup GMAC working clock. + * - gmac_full_duplex_enable(): Working in full duplex or not. + * - gmac_cpy_all_enable(): Copying all valid frames (\ref GMAC_NCFG_CAF). + * - ... + * - Setup Gmac::GMAC_NCR with gmac_network_control(), more related controls + * can modify with: + * - gmac_receive_enable(): Enable/Disable Rx. + * - gmac_transmit_enable(): Enable/Disable Tx. + * - gmac_broadcast_disable(): Enable/Disable broadcast receiving. + * - ... + * - Manage GMAC interrupts with GMAC_EnableIt(), gmac_disable_it(), + * gmac_get_it_mask() and gmac_get_it_status(). + * - Manage GMAC Tx/Rx status with gmac_get_tx_status(), gmac_get_rx_status() + * gmac_clear_tx_status() and gmac_clear_rx_status(). + * - Manage GMAC Queue with gmac_set_tx_queue(), GMAC_GetTxQueue(), + * gmac_set_rx_queue() and GMAC_GetRxQueue(), the queue descriptor can define + * by \ref _gmac_rx_descriptor and \ref _gmac_tx_descriptor. + * - Manage PHY through GMAC is performed by + * - gmac_management_enable(): Enable/Disable PHY management. + * - gmac_phy_maintain(): Execute PHY management commands. + * - gmac_phy_data(): Return PHY management data. + * - gmac_is_idle(): Check if PHY is idle. + * - Setup GMAC parameters with following functions: + * - gmac_set_hash(): Set Hash value. + * - gmac_set_address(): Set MAC address. + * - Enable/Disable GMAC transceiver clock via GMAC_TransceiverClockEnable() + * - Switch GMAC MII/RMII mode through gmac_enable_rgmii() + * + * For more accurate information, please look at the GMAC section of the + * Datasheet. + * + * \sa \ref gmacd_module + * + * Related files:\n + * gmac.c\n + * gmac.h.\n + * + * \defgroup gmac_defines GMAC Defines + * \defgroup gmac_structs GMAC Data Structs + * \defgroup gmac_functions GMAC Functions + */ +/**@}*/ + +#ifndef _GMAC_H_ +#define _GMAC_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include +#include + +/*---------------------------------------------------------------------------- + * Defines + *----------------------------------------------------------------------------*/ + +/** \addtogroup gmac_defines + @{*/ + +#ifdef CONFIG_HAVE_GMAC_QUEUES +#define GMAC_NUM_QUEUES 3 +#else +#define GMAC_NUM_QUEUES 1 +#endif + +#define GMAC_MAX_FRAME_LENGTH 1536 +#define GMAC_MAX_JUMBO_FRAME_LENGTH 10240 + +enum _gmac_duplex { + GMAC_DUPLEX_HALF = 0, + GMAC_DUPLEX_FULL = 1, +}; + +enum _gmac_speed { + GMAC_SPEED_10M = 0, + GMAC_SPEED_100M = 1, +}; + +/* Bits contained in struct _gmac_desc addr when used for RX*/ +#define GMAC_RX_ADDR_OWN (1u << 0) +#define GMAC_RX_ADDR_WRAP (1u << 1) +#define GMAC_RX_ADDR_MASK 0xfffffffcu + +/* Bits contained in struct _gmac_desc status when used for RX */ +#define GMAC_RX_STATUS_LENGTH_MASK 0x3fffu +#define GMAC_RX_STATUS_SOF (1u << 14) +#define GMAC_RX_STATUS_EOF (1u << 15) + +/* Bits contained in struct _gmac_desc status when used for TX */ +#define GMAC_TX_STATUS_LASTBUF (1u << 15) +#define GMAC_TX_STATUS_WRAP (1u << 30) +#define GMAC_TX_STATUS_USED (1u << 31) + +/**@}*/ + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** \addtogroup gmac_structs + @{*/ + +/** Transmit/Receive buffer descriptor struct */ +struct _gmac_desc { + uint32_t addr; + uint32_t status; +}; + +/** @}*/ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * TODO + */ +extern bool gmac_configure(Gmac *gmac); + +/** + * \brief Write NCR register value + */ +extern void gmac_set_network_control_register(Gmac * gmac, uint32_t ncr); + +/** + * \brief Get NCR register value + */ +extern uint32_t gmac_get_network_control_register(Gmac * gmac); + +/** + * \brief Set network configuration register + */ +extern void gmac_set_network_config_register(Gmac* gmac, uint32_t ncfgr); + +/** + * \brief Get network configuration register + */ + +extern uint32_t gmac_get_network_config_register(Gmac* gmac); + +/** + * \brief Enable MDI with PHY + * \param gmac Pointer to an Gmac instance. + */ +extern void gmac_enable_mdio(Gmac* gmac); + +/** + * \brief Disable MDI with PHY + * \param gmac Pointer to an Gmac instance. + */ +extern void gmac_disable_mdio(Gmac* gmac); + +/** + * \brief Execute PHY read command + */ +extern bool gmac_phy_read(Gmac* gmac, uint8_t phy_addr, uint8_t reg_addr, + uint16_t* data, uint32_t retries); + +/** + * \brief Execute PHY write command + */ +extern bool gmac_phy_write(Gmac* gmac, uint8_t phy_addr, uint8_t reg_addr, + uint16_t data, uint32_t retries); + +/** + * \brief Enable MII mode for GMAC, called once after autonegotiate + * \param gmac Pointer to an Gmac instance. + */ +extern void gmac_enable_mii(Gmac* gmac); + +/** + * \brief Enable RMII mode for GMAC, called once after autonegotiate + * \param gmac Pointer to an Gmac instance. + * \param duplex: 1 full duplex 0 half duplex + * \param speed: 0 10M 1 100M + */ +extern void gmac_enable_rmii(Gmac* gmac, enum _gmac_speed speed, + enum _gmac_duplex duplex); + +/** + * \brief Setup the GMAC for the link : speed 100M/10M and Full/Half duplex + * \param gmac Pointer to an Gmac instance. + * \param speed Link speed, 0 for 10M, 1 for 100M + * \param fullduplex 1 for Full Duplex mode + */ +extern void gmac_set_link_speed(Gmac* gmac, enum _gmac_speed speed, + enum _gmac_duplex duplex); + +/** + * \brief Enable local loop back + * \param gmac Pointer to an Gmac instance. + */ +extern void gmac_enable_local_loopback(Gmac* gmac); + +/** + * \brief Disable local loop back + * \param gmac Pointer to an Gmac instance. + */ +extern void gmac_disable_local_loopback(Gmac* gmac); + +/** + * \brief Return transmit status + */ +extern uint32_t gmac_get_tx_status(Gmac* gmac); + +/** + * \brief Clear transmit status + */ +extern void gmac_clear_tx_status(Gmac* gmac, uint32_t mask); + +/** + * \brief Return receive status + */ +extern uint32_t gmac_get_rx_status(Gmac* gmac); + +/** + * \brief Clear receive status + */ +extern void gmac_clear_rx_status(Gmac* gmac, uint32_t mask); + +/** + * \brief Enable/Disable GMAC receive. + */ +extern void gmac_receive_enable(Gmac* gmac, bool enable); + +/** + * \brief Enable/Disable GMAC transmit. + */ +extern void gmac_transmit_enable(Gmac* gmac, bool enable); + +/** + * \brief Set RX descriptor address + */ +void gmac_set_rx_desc(Gmac* gmac, uint8_t queue, struct _gmac_desc* desc); + +/** + * \brief Get RX descriptor address + */ +struct _gmac_desc* gmac_get_rx_desc(Gmac* gmac, uint8_t queue); + +/** + * \brief Set TX descriptor address + */ +void gmac_set_tx_desc(Gmac* gmac, uint8_t queue, struct _gmac_desc* desc); + +/** + * \brief Get TX descriptor address + */ +struct _gmac_desc* gmac_get_tx_desc(Gmac* gmac, uint8_t queue); + +/** + * \brief Return interrupt mask. + */ +extern uint32_t gmac_get_it_mask(Gmac* gmac, uint8_t queue); + +/** + * \brief Enable interrupt(s). + */ +extern void gmac_enable_it(Gmac* gmac, uint8_t queue, uint32_t mask); + +/** + * \brief Disable interrupt(s). + */ +extern void gmac_disable_it(Gmac * gmac, uint8_t queue, uint32_t mask); + +/** + * \brief Return interrupt status mask. + */ +extern uint32_t gmac_get_it_status(Gmac* gmac, uint8_t queue); + +/** + * \brief Set MAC Address + */ +extern void gmac_set_mac_addr(Gmac* gmac, uint8_t sa_idx, uint8_t* mac); + +/** + * \brief Set MAC Address using two 32-bit integers + */ +extern void gmac_set_mac_addr32(Gmac* gmac, uint8_t sa_idx, + uint32_t mac_top, uint32_t mac_bottom); + +/** + * \brief Set MAC Address using a 64-bit integer + */ +extern void gmac_set_mac_addr64(Gmac* gmac, uint8_t sa_idx, uint64_t mac); + +/** + * \brief Clear all statistics registers + */ +extern void gmac_clear_statistics(Gmac* gmac); + +/** + * \brief Increase all statistics registers + */ +extern void gmac_increase_statistics(Gmac* gmac); + +/** + * \brief Enable/Disable statistics registers writing. + */ +extern void gmac_enable_statistics_write(Gmac* gmac, bool enable); + +/** + * \brief Start transmission + */ +extern void gmac_start_transmission(Gmac* gmac); + +/** + * \brief Halt transmission + */ +extern void gmac_halt_transmission(Gmac* gmac); + +#ifdef __cplusplus +} +#endif + +#endif /* _GMAC_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.c new file mode 100644 index 000000000..b55187517 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.c @@ -0,0 +1,823 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*--------------------------------------------------------------------------- + * Headers + *---------------------------------------------------------------------------*/ + +#include "chip.h" +#include "trace.h" +#include "ring.h" + +#include "peripherals/aic.h" +#include "peripherals/gmacd.h" +#include "peripherals/gmac.h" +#include "peripherals/l2cc.h" +#include "peripherals/pmc.h" + +#include +#include + +//------------------------------------------------------------------------------ +// Definitions +//------------------------------------------------------------------------------ + +// Interrupt bits +#define GMAC_INT_RX_BITS (GMAC_IER_RCOMP | GMAC_IER_RXUBR | GMAC_IER_ROVR) +#define GMAC_INT_TX_ERR_BITS (GMAC_IER_TUR | GMAC_IER_RLEX | GMAC_IER_TFC) +#define GMAC_INT_TX_BITS (GMAC_INT_TX_ERR_BITS | GMAC_IER_TCOMP) + +/*--------------------------------------------------------------------------- + * Types + *---------------------------------------------------------------------------*/ + +struct _gmacd_irq_handler { + Gmac* addr; + struct _gmacd** gmacd; + uint32_t irq; + aic_handler_t handler; +}; + +/*--------------------------------------------------------------------------- + * IRQ Handlers + *---------------------------------------------------------------------------*/ + +#ifdef CONFIG_HAVE_GMAC_QUEUES +#if GMAC_NUM_QUEUES != 3 +#error This driver assumes that GMAC_NUM_QUEUES is 3 +#endif +#endif + +static struct _gmacd* _gmacd0; +#ifdef GMAC1 +static struct _gmacd* _gmacd1; +#endif + +static void _gmacd_handler(struct _gmacd* gmacd, uint8_t queue); + +static void _gmacd_gmac0_irq_handler(void) +{ + _gmacd_handler(_gmacd0, 0); +} + +#ifdef CONFIG_HAVE_GMAC_QUEUES +static void _gmacd_gmac0q1_irq_handler(void) +{ + _gmacd_handler(_gmacd0, 1); +} + +static void _gmacd_gmac0q2_irq_handler(void) +{ + _gmacd_handler(_gmacd0, 2); +} +#endif + +#ifdef GMAC1 +static void _gmacd_gmac1_irq_handler(void) +{ + _gmacd_handler(_gmacd1, 0); +} + +#ifdef CONFIG_HAVE_GMAC_QUEUES +static void _gmacd_gmac1q1_irq_handler(void) +{ + _gmacd_handler(_gmacd1, 1); +} + +static void _gmacd_gmac1q2_irq_handler(void) +{ + _gmacd_handler(_gmacd1, 2); +} +#endif +#endif + +static const struct _gmacd_irq_handler _gmacd_irq_handlers[] = { + { GMAC0, &_gmacd0, ID_GMAC0, _gmacd_gmac0_irq_handler }, +#ifdef CONFIG_HAVE_GMAC_QUEUES + { GMAC0, &_gmacd0, ID_GMAC0_Q1, _gmacd_gmac0q1_irq_handler }, + { GMAC0, &_gmacd0, ID_GMAC0_Q2, _gmacd_gmac0q2_irq_handler }, +#endif +#ifdef GMAC1 + { GMAC1, &_gmacd1, ID_GMAC1, _gmacd_gmac1_irq_handler }, +#ifdef CONFIG_HAVE_GMAC_QUEUES + { GMAC1, &_gmacd1, ID_GMAC1_Q1, _gmacd_gmac1q1_irq_handler }, + { GMAC1, &_gmacd1, ID_GMAC1_Q2, _gmacd_gmac1q2_irq_handler }, +#endif +#endif +}; + +/*--------------------------------------------------------------------------- + * Dummy Buffers for unconfigured queues + *---------------------------------------------------------------------------*/ + +#define DUMMY_BUFFERS 2 +#define DUMMY_UNITSIZE 128 + +/** TX descriptors list */ +ALIGNED(8) SECTION(".region_ddr_nocache") +static struct _gmac_desc dummy_tx_desc[DUMMY_BUFFERS]; + +/** RX descriptors list */ +ALIGNED(8) SECTION(".region_ddr_nocache") +static struct _gmac_desc dummy_rx_desc[DUMMY_BUFFERS]; + +/** Send Buffer */ +ALIGNED(32) +static uint8_t dummy_buffer[DUMMY_BUFFERS * DUMMY_UNITSIZE]; + +/*--------------------------------------------------------------------------- + * Local functions + *---------------------------------------------------------------------------*/ + +/** + * \brief Disable TX & reset registers and descriptor list + * \param gmacd Pointer to GMAC Driver instance. + */ +static void _gmacd_reset_tx(struct _gmacd* gmacd, uint8_t queue) +{ + struct _gmacd_queue* q = &gmacd->queues[queue]; + uint32_t addr = (uint32_t)q->tx_buffer; + uint32_t i; + + /* Disable TX */ + gmac_transmit_enable(gmacd->gmac, false); + + /* Setup the TX descriptors */ + RING_CLEAR(q->tx_head, q->tx_tail); + for (i = 0; i < q->tx_size; i++) { + q->tx_desc[i].addr = addr; + DSB(); + q->tx_desc[i].status = GMAC_TX_STATUS_USED; + addr += GMAC_TX_UNITSIZE; + } + q->tx_desc[q->tx_size - 1].status |= GMAC_TX_STATUS_WRAP; + + /* Transmit Buffer Queue Pointer Register */ + gmac_set_tx_desc(gmacd->gmac, queue, q->tx_desc); +} + +/** + * \brief Disable RX & reset registers and descriptor list + * \param gmacd Pointer to GMAC Driver instance. + */ +static void _gmacd_reset_rx(struct _gmacd* gmacd, uint8_t queue) +{ + struct _gmacd_queue* q = &gmacd->queues[queue]; + uint32_t addr = (uint32_t)q->rx_buffer; + uint32_t i; + + /* Disable RX */ + gmac_receive_enable(gmacd->gmac, false); + + /* Setup the RX descriptors */ + q->rx_head = 0; + for (i = 0; i < q->rx_size; i++) { + q->rx_desc[i].addr = addr & GMAC_RX_ADDR_MASK; + DSB(); + q->rx_desc[i].status = 0; + addr += GMAC_RX_UNITSIZE; + } + q->rx_desc[q->rx_size - 1].addr |= GMAC_RX_ADDR_WRAP; + + /* Receive Buffer Queue Pointer Register */ + gmac_set_rx_desc(gmacd->gmac, queue, q->rx_desc); +} + +/** + * \brief Process successfully sent packets + * \param gmacd Pointer to GMAC Driver instance. + */ +static void _gmacd_tx_complete_handler(struct _gmacd* gmacd, uint8_t queue) +{ + Gmac* gmac = gmacd->gmac; + struct _gmacd_queue* q = &gmacd->queues[queue]; + struct _gmac_desc *desc; + gmacd_callback_t callback; + uint32_t tsr; + + //printf("\r\n"); + + /* Clear status */ + tsr = gmac_get_tx_status(gmac); + gmac_clear_tx_status(gmac, tsr); + + while (!RING_EMPTY(q->tx_head, q->tx_tail)) { + desc = &q->tx_desc[q->tx_tail]; + + /* Exit if frame has not been sent yet: + * On TX completion, the GMAC set the USED bit only into the + * very first buffer descriptor of the sent frame. + * Otherwise it updates this descriptor with status error bits. + * This is the descriptor writeback. + */ + if ((desc->status & GMAC_TX_STATUS_USED) == 0) + break; + + /* Process all buffers of the current transmitted frame */ + while ((desc->status & GMAC_TX_STATUS_LASTBUF) == 0) { + RING_INC(q->tx_tail, q->tx_size); + desc = &q->tx_desc[q->tx_tail]; + } + + /* Notify upper layer that a frame has been sent */ + if (q->tx_callbacks) { + callback = q->tx_callbacks[q->tx_tail]; + if (callback) + callback(queue, tsr); + } + + /* Go to next frame */ + RING_INC(q->tx_tail, q->tx_size); + } + + /* If a wakeup callback has been set, notify upper layer that it can + send more packets now */ + if (q->tx_wakeup_callback) { + if (RING_SPACE(q->tx_head, q->tx_tail, q->tx_size) >= + q->tx_wakeup_threshold) { + q->tx_wakeup_callback(queue); + } + } +} + +/** + * \brief Reset TX queue when errors are detected + * \param gmacd Pointer to GMAC Driver instance. + */ +static void _gmacd_tx_error_handler(struct _gmacd* gmacd, uint8_t queue) +{ + Gmac *gmac = gmacd->gmac; + struct _gmacd_queue* q = &gmacd->queues[queue]; + struct _gmac_desc* desc; + gmacd_callback_t callback; + uint32_t tsr; + + printf("\r\n"); + + /* Clear TXEN bit into the Network Configuration Register: + * this is a workaround to recover from TX lockups that + * occur on sama5d4 gmac (r1p24f2) when using scatter-gather. + * This issue has never been seen on sama5d4 gmac (r1p31). + */ + gmac_transmit_enable(gmac, false); + + /* The following step should be optional since this function is called + * directly by the IRQ handler. Indeed, according to Cadence + * documentation, the transmission is halted on errors such as + * too many retries or transmit under run. + * However it would become mandatory if the call of this function + * were scheduled as a task by the IRQ handler (this is how Linux + * driver works). Then this function might compete with GMACD_Send(). + * + * Setting bit 10, tx_halt, of the Network Control Register is not enough: + * We should wait for bit 3, tx_go, of the Transmit Status Register to + * be cleared at transmit completion if a frame is being transmitted. + */ + gmac_halt_transmission(gmac); + while (gmac_get_tx_status(gmac) & GMAC_TSR_TXGO); + + /* Treat frames in TX queue including the ones that caused the error. */ + while (!RING_EMPTY(q->tx_head, q->tx_tail)) { + int tx_completed = 0; + desc = &q->tx_desc[q->tx_tail]; + + /* Check USED bit on the very first buffer descriptor to validate + * TX completion. + */ + if (desc->status & GMAC_TX_STATUS_USED) + tx_completed = 1; + + /* Go to the last buffer descriptor of the frame */ + while ((desc->status & GMAC_TX_STATUS_LASTBUF) == 0) { + RING_INC(q->tx_tail, q->tx_size); + desc = &q->tx_desc[q->tx_tail]; + } + + /* Notify upper layer that a frame status */ + // TODO: which error to notify? + if (q->tx_callbacks) { + callback = q->tx_callbacks[q->tx_tail]; + if (callback) + callback(queue, tx_completed ? GMAC_TSR_TXCOMP : 0); + } + + /* Go to next frame */ + RING_INC(q->tx_tail, q->tx_size); + } + + /* Reset TX queue */ + _gmacd_reset_tx(gmacd, queue); + + /* Clear status */ + tsr = gmac_get_tx_status(gmac); + gmac_clear_tx_status(gmac, tsr); + + /* Now we are ready to start transmission again */ + gmac_transmit_enable(gmac, true); + if (q->tx_wakeup_callback) + q->tx_wakeup_callback(queue); +} + +/*--------------------------------------------------------------------------- + * Exported functions + *---------------------------------------------------------------------------*/ + +/** + * \brief GMAC Interrupt handler + * \param gmacd Pointer to GMAC Driver instance. + */ +static void _gmacd_handler(struct _gmacd * gmacd, uint8_t queue) +{ + Gmac *gmac = gmacd->gmac; + struct _gmacd_queue* q = &gmacd->queues[queue]; + uint32_t isr; + uint32_t rsr; + + /* Interrupt Status Register is cleared on read */ + while ((isr = gmac_get_it_status(gmac, queue)) != 0) { + /* RX packet */ + if (isr & GMAC_INT_RX_BITS) { + /* Clear status */ + rsr = gmac_get_rx_status(gmac); + gmac_clear_rx_status(gmac, rsr); + + /* Invoke callback */ + if (q->rx_callback) + q->rx_callback(queue, rsr); + } + + /* TX error */ + if (isr & GMAC_INT_TX_ERR_BITS) { + _gmacd_tx_error_handler(gmacd, queue); + break; + } + + /* TX packet */ + if (isr & GMAC_IER_TCOMP) { + _gmacd_tx_complete_handler(gmacd, queue); + } + + /* HRESP not OK */ + if (isr & GMAC_IER_HRESP) { + trace_error("HRESP not OK\n\r"); + } + } +} + +/** + * \brief Initialize the GMAC with the Gmac controller address + * \param gmacd Pointer to GMAC Driver instance. + * \param gmac Pointer to HW address for registers. + * \param enableCAF Enable/Disable CopyAllFrame. + * \param enableNBC Enable/Disable NoBroadCast. + */ +void gmacd_configure(struct _gmacd * gmacd, + Gmac * gmac, uint8_t enableCAF, uint8_t enableNBC) +{ + uint32_t ncfgr; + int i; + + /* Initialize struct */ + gmacd->gmac = gmac; + + gmac_configure(gmac); + + uint32_t id = get_gmac_id_from_addr(gmac); + for (i = 0; i < ARRAY_SIZE(_gmacd_irq_handlers); i++) { + if (_gmacd_irq_handlers[i].addr == gmac) { + *_gmacd_irq_handlers[i].gmacd = gmacd; + aic_set_source_vector(_gmacd_irq_handlers[i].irq, + _gmacd_irq_handlers[i].handler); + } + } + aic_enable(id); + + /* Enable the copy of data into the buffers + ignore broadcasts, and don't copy FCS. */ + ncfgr = gmac_get_network_config_register(gmac); + ncfgr |= GMAC_NCFGR_FD; + if (enableCAF) { + ncfgr |= GMAC_NCFGR_CAF; + } + if (enableNBC) { + ncfgr |= GMAC_NCFGR_NBC; + } + gmac_set_network_config_register(gmac, ncfgr); + + for (i = 0; i < GMAC_NUM_QUEUES; i++) { + gmacd_setup_queue(gmacd, i, + DUMMY_BUFFERS, dummy_buffer, dummy_rx_desc, + DUMMY_BUFFERS, dummy_buffer, dummy_tx_desc, + NULL); + } +} + +/** + * Initialize necessary allocated buffer lists for GMAC Driver to transfer data. + * Must be invoked after GMACD_Init() but before RX/TX start. + * \param gmacd Pointer to GMAC Driver instance. + * \param rx_buffer Pointer to allocated buffer for RX. The address should + * be 8-byte aligned and the size should be + * GMAC_RX_UNITSIZE * wRxSize. + * \param rx_desc Pointer to allocated RX descriptor list. + * \param wRxSize RX size, in number of registered units (RX descriptors). + * \param tx_buffer Pointer to allocated buffer for TX. The address should + * be 8-byte aligned and the size should be + * GMAC_TX_UNITSIZE * wTxSize. + * \param tx_desc Pointer to allocated TX descriptor list. + * \param pTxCb Pointer to allocated TX callback list. + * \param wTxSize TX size, in number of registered units (TX descriptors). + * \return GMACD_OK or GMACD_PARAM. + * \note If input address is not 8-byte aligned the address is automatically + * adjusted and the list size is reduced by one. + */ + + +uint8_t gmacd_setup_queue(struct _gmacd* gmacd, uint8_t queue, + uint16_t rx_size, uint8_t* rx_buffer, struct _gmac_desc* rx_desc, + uint16_t tx_size, uint8_t* tx_buffer, struct _gmac_desc* tx_desc, + gmacd_callback_t *tx_callbacks) +{ + Gmac *gmac = gmacd->gmac; + struct _gmacd_queue* q = &gmacd->queues[queue]; + + if (rx_size <= 1 || tx_size <= 1) + return GMACD_PARAM; + + /* Assign RX buffers */ + if (((uint32_t)rx_buffer & 0x7) + || ((uint32_t)rx_desc & 0x7)) { + rx_size--; + trace_debug("RX list address adjusted\n\r"); + } + q->rx_buffer = (uint8_t*)((uint32_t)rx_buffer & 0xFFFFFFF8); + q->rx_desc = (struct _gmac_desc *)((uint32_t)rx_desc & 0xFFFFFFF8); + q->rx_size = rx_size; + q->rx_callback = NULL; + + /* Assign TX buffers */ + if (((uint32_t)tx_buffer & 0x7) + || ((uint32_t)tx_desc & 0x7)) { + tx_size--; + trace_debug("TX list address adjusted\n\r"); + } + q->tx_buffer = (uint8_t*)((uint32_t)tx_buffer & 0xFFFFFFF8); + q->tx_desc = (struct _gmac_desc*)((uint32_t)tx_desc & 0xFFFFFFF8); + q->tx_size = tx_size; + q->tx_callbacks = tx_callbacks; + q->tx_wakeup_callback = NULL; + + /* Reset TX & RX */ + _gmacd_reset_rx(gmacd, queue); + _gmacd_reset_tx(gmacd, queue); + + /* Setup the interrupts for RX/TX completion (and errors) */ + gmac_enable_it(gmac, queue, GMAC_INT_RX_BITS | GMAC_INT_TX_BITS | GMAC_IER_HRESP); + + return GMACD_OK; +} + +void gmacd_start(struct _gmacd * gmacd) +{ + /* Enable Rx and Tx, plus the stats register. */ + gmac_transmit_enable(gmacd->gmac, true); + gmac_receive_enable(gmacd->gmac, true); + gmac_enable_statistics_write(gmacd->gmac, true); +} + +/** + * Reset TX & RX queue & statistics + * \param gmacd Pointer to GMAC Driver instance. + */ +void gmacd_reset(struct _gmacd* gmacd) +{ + int i; + for (i = 0; i < GMAC_NUM_QUEUES; i++) { + _gmacd_reset_rx(gmacd, i); + _gmacd_reset_tx(gmacd, i); + } + + gmac_set_network_control_register(gmacd->gmac, GMAC_NCR_TXEN | GMAC_NCR_RXEN | + GMAC_NCR_WESTAT | GMAC_NCR_CLRSTAT); +} + +/** + * \brief Send a frame splitted into buffers. If the frame size is larger than transfer buffer size + * error returned. If frame transfer status is monitored, specify callback for each frame. + * \param gmacd Pointer to GMAC Driver instance. + * \param sgl Pointer to a scatter-gather list describing the buffers of the ethernet frame. + * \param fTxCb Pointer to callback function. + */ +uint8_t gmacd_send_sg(struct _gmacd* gmacd, uint8_t queue, + const struct _gmac_sg_list* sgl, gmacd_callback_t callback) +{ + Gmac* gmac = gmacd->gmac; + struct _gmacd_queue* q = &gmacd->queues[queue]; + struct _gmac_desc* desc; + uint16_t idx, tx_head; + int i; + + if (callback && !q->tx_callbacks) { + trace_error("Cannot set send callback, no tx_callbacks "\ + "buffer configured for queue %u", queue); + } + + /* Check parameter */ + if (!sgl->size) { + trace_error("gmacd_send_sg: ethernet frame is empty.\r\n"); + return GMACD_PARAM; + } + if (sgl->size >= q->tx_size) { + trace_error("gmacd_send_sg: ethernet frame has too many buffers.\r\n"); + return GMACD_PARAM; + } + + /* Check available space */ + if (RING_SPACE(q->tx_head, q->tx_tail, q->tx_size) < sgl->size) { + trace_error("gmacd_send_sg: not enough free buffers in TX queue.\r\n"); + return GMACD_TX_BUSY; + } + + /* Tag end of TX queue */ + tx_head = fixed_mod(q->tx_head + sgl->size, q->tx_size); + idx = tx_head; + if (q->tx_callbacks) + q->tx_callbacks[idx] = NULL; + desc = &q->tx_desc[idx]; + desc->status |= GMAC_TX_STATUS_USED; + + /* Update buffer descriptors in reverse order to avoid a race + * condition with hardware. + */ + for (i = sgl->size - 1; i >= 0; i--) { + const struct _gmac_sg *sg = &sgl->entries[i]; + uint32_t status; + + if (sg->size > GMAC_TX_UNITSIZE) { + trace_error("gmacd_send_sg: buffer size is too big.\r\n"); + return GMACD_PARAM; + } + + RING_DEC(idx, q->tx_size); + + /* Reset TX callback */ + if (q->tx_callbacks) + q->tx_callbacks[idx] = NULL; + + desc = &q->tx_desc[idx]; + + /* Copy data into transmittion buffer */ + if (sg->buffer && sg->size) { + memcpy((void*)desc->addr, sg->buffer, sg->size); + l2cc_clean_region(desc->addr, desc->addr + sg->size); + } + + /* Compute buffer descriptor status word */ + status = sg->size & GMAC_RX_STATUS_LENGTH_MASK; + if (i == (sgl->size - 1)) { + status |= GMAC_TX_STATUS_LASTBUF; + if (q->tx_callbacks) + q->tx_callbacks[idx] = callback; + } + if (idx == (q->tx_size - 1)) { + status |= GMAC_TX_STATUS_WRAP; + } + + /* Update buffer descriptor status word: clear USED bit */ + desc->status = status; + DSB(); + } + + /* Update TX ring buffer pointers */ + q->tx_head = tx_head; + + /* Now start to transmit if it is not already done */ + gmac_start_transmission(gmac); + + return GMACD_OK; +} + +/** + * \brief Send a packet with GMAC. If the packet size is larger than transfer buffer size + * error returned. If packet transfer status is monitored, specify callback for each packet. + * \param gmacd Pointer to GMAC Driver instance. + * \param pBuffer The buffer to be send + * \param size The size of buffer to be send + * \param fTxCb Threshold Wakeup callback + * \return OK, Busy or invalid packet + */ +uint8_t gmacd_send(struct _gmacd* gmacd, uint8_t queue, void *buffer, + uint32_t size, gmacd_callback_t callback) +{ + struct _gmac_sg sg; + struct _gmac_sg_list sgl; + + /* Init single entry scatter-gather list */ + sg.size = size; + sg.buffer = buffer; + sgl.size = 1; + sgl.entries = &sg; + + return gmacd_send_sg(gmacd, queue, &sgl, callback); +} + +/** + * Return current load of TX. + * \param gmacd Pointer to GMAC Driver instance. + */ +uint32_t gmacd_get_tx_load(struct _gmacd* gmacd, uint8_t queue) +{ + struct _gmacd_queue* q = &gmacd->queues[queue]; + return RING_CNT(q->tx_head, q->tx_tail, q->tx_size); +} + +/** + * \brief Receive a packet with GMAC. + * If not enough buffer for the packet, the remaining data is lost but right + * frame length is returned. + * \param gmacd Pointer to GMAC Driver instance. + * \param pFrame Buffer to store the frame + * \param frameSize Size of the frame + * \param pRcvSize Received size + * \return OK, no data, or frame too small + */ +uint8_t gmacd_poll(struct _gmacd* gmacd, uint8_t queue, + uint8_t* buffer, uint32_t buffer_size, uint32_t* recv_size) +{ + struct _gmacd_queue* q = &gmacd->queues[queue]; + struct _gmac_desc *desc; + uint32_t idx; + uint32_t cur_frame_size = 0; + uint8_t *cur_frame = 0; + + if (!buffer) + return GMACD_PARAM; + + /* Set the default return value */ + *recv_size = 0; + + /* Process RX descriptors */ + idx = q->rx_head; + desc = &q->rx_desc[idx]; + while (desc->addr & GMAC_RX_ADDR_OWN) { + /* A start of frame has been received, discard previous fragments */ + if (desc->status & GMAC_RX_STATUS_SOF) { + /* Skip previous fragment */ + while (idx != q->rx_head) { + desc = &q->rx_desc[q->rx_head]; + desc->addr &= ~GMAC_RX_ADDR_OWN; + RING_INC(q->rx_head, q->rx_size); + } + cur_frame = buffer; + cur_frame_size = 0; + } + + /* Increment the index */ + RING_INC(idx, q->rx_size); + + /* Copy data in the frame buffer */ + if (cur_frame) { + if (idx == q->rx_head) { + trace_info("no EOF (buffers probably too small)\r\n"); + + do { + desc = &q->rx_desc[q->rx_head]; + desc->addr &= ~GMAC_RX_ADDR_OWN; + RING_INC(q->rx_head, q->rx_size); + } while (idx != q->rx_head); + return GMACD_RX_NULL; + } + + /* Copy the buffer into the application frame */ + uint32_t length = GMAC_RX_UNITSIZE; + if ((cur_frame_size + length) > buffer_size) { + length = buffer_size - cur_frame_size; + } + + uint32_t addr = desc->addr & GMAC_RX_ADDR_MASK; + l2cc_invalidate_region(addr, addr + length); + memcpy(cur_frame, (void*)addr, length); + cur_frame += length; + cur_frame_size += length; + + /* An end of frame has been received, return the data */ + if (desc->status & GMAC_RX_STATUS_EOF) { + /* Frame size from the GMAC */ + *recv_size = desc->status & GMAC_RX_STATUS_LENGTH_MASK; + + /* Application frame buffer is too small all + * data have not been copied */ + if (cur_frame_size < *recv_size) { + return GMACD_SIZE_TOO_SMALL; + } + + /* All data have been copied in the application + * frame buffer => release descriptors */ + while (q->rx_head != idx) { + desc = &q->rx_desc[q->rx_head]; + desc->addr &= ~GMAC_RX_ADDR_OWN; + RING_INC(q->rx_head, q->rx_size); + } + + return GMACD_OK; + } + } + + /* SOF has not been detected, skip the fragment */ + else { + desc->addr &= ~GMAC_RX_ADDR_OWN; + q->rx_head = idx; + } + + /* Process the next buffer */ + desc = &q->rx_desc[idx]; + } + return GMACD_RX_NULL; +} + +/** + * \brief Registers pRxCb callback. Callback will be invoked after the next received + * frame. When GMAC_Poll() returns GMAC_RX_NO_DATA the application task call GMAC_Set_RxCb() + * to register pRxCb() callback and enters suspend state. The callback is in charge + * to resume the task once a new frame has been received. The next time GMAC_Poll() + * is called, it will be successful. + * \param gmacd Pointer to GMAC Driver instance. + * \param fRxCb Pointer to callback function + * \return OK, no data, or frame too small + */ + +void gmacd_set_rx_callback(struct _gmacd* gmacd, uint8_t queue, gmacd_callback_t callback) +{ + struct _gmacd_queue* q = &gmacd->queues[queue]; + if (!callback) { + gmac_disable_it(gmacd->gmac, queue, GMAC_IDR_RCOMP); + q->rx_callback = NULL; + } else { + q->rx_callback = callback; + gmac_enable_it(gmacd->gmac, queue, GMAC_IER_RCOMP); + } +} + +/** + * Register/Clear TX wakeup callback. + * + * When GMACD_Send() returns GMACD_TX_BUSY (all TD busy) the application + * task calls GMACD_SetTxWakeupCallback() to register fWakeup() callback and + * enters suspend state. The callback is in charge to resume the task once + * several TD have been released. The next time GMACD_Send() will be called, + * it shall be successful. + * + * This function is usually invoked with NULL callback from the TX wakeup + * callback itself, to unregister. Once the callback has resumed the + * application task, there is no need to invoke the callback again. + * + * \param gmacd Pointer to GMAC Driver instance. + * \param fWakeup Wakeup callback. + * \param bThreshold Number of free TD before wakeup callback invoked. + * \return GMACD_OK, GMACD_PARAM on parameter error. + */ +uint8_t gmacd_set_tx_wakeup_callback(struct _gmacd* gmacd, uint8_t queue, + gmacd_wakeup_cb_t callback, uint16_t threshold) +{ + struct _gmacd_queue* q = &gmacd->queues[queue]; + if (!callback) { + q->tx_wakeup_callback = NULL; + } else { + if (threshold <= q->tx_size) { + q->tx_wakeup_callback = callback; + q->tx_wakeup_threshold = threshold; + } else { + return GMACD_PARAM; + } + } + + return GMACD_OK; +} + +/**@}*/ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.h new file mode 100644 index 000000000..084214253 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/gmacd.h @@ -0,0 +1,189 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2012, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/** \addtogroup gmacd_module + * @{ + * Implement GMAC data transfer and PHY management functions. + * + * \section Usage + * -# Implement GMAC interrupt handler, which must invoke GMACD_Handler() + * to handle GMAC interrupt events. + * -# Implement struct _gmacd instance in application. + * -# Initialize the instance with GMACD_Init() and GMACD_InitTransfer(), + * so that GMAC data can be transmitted/received. + * -# Some management callbacks can be set by GMACD_SetRxCallback() + * and GMACD_SetTxWakeupCallback(). + * -# Send ethernet packets using GMACD_Send(), GMACD_TxLoad() is used + * to check the free space in TX queue. + * -# Check and obtain received ethernet packets via GMACD_Poll(). + * + * \sa \ref gmacb_module, \ref gmac_module + * + * Related files:\n + * \ref gmacd.c\n + * \ref gmacd.h.\n + * + * \defgroup gmacd_defines GMAC Driver Defines + * \defgroup gmacd_types GMAC Driver Types + * \defgroup gmacd_functions GMAC Driver Functions + */ +/**@}*/ + +#ifndef _GMACD_H_ +#define _GMACD_H_ + +/*--------------------------------------------------------------------------- + * Headers + *---------------------------------------------------------------------------*/ + +#include "peripherals/gmac.h" +#include + +/*--------------------------------------------------------------------------- + * Definitions + *---------------------------------------------------------------------------*/ +/** \addtogroup gmacd_defines + @{*/ + +/** \addtogroup gmacd_buf_size GMACD Default Buffer Size + @{*/ +#define GMAC_RX_UNITSIZE 128 /**< RX buffer size, must be 128 */ +#define GMAC_TX_UNITSIZE 1536 /**< TX buffer size, must be multiple + of 32 (cache line) */ +/** @}*/ + +/** \addtogroup gmacd_rc GMACD Return Codes + @{*/ +#define GMACD_OK 0 /**< Operation OK */ +#define GMACD_TX_BUSY 1 /**< TX in progress */ +#define GMACD_RX_NULL 1 /**< No data received */ +/** Buffer size not enough */ +#define GMACD_SIZE_TOO_SMALL 2 +/** Parameter error, TX packet invalid or RX size too small */ +#define GMACD_PARAM 3 +/** Transter is not initialized */ +#define GMACD_NOT_INITIALIZED 4 +/** @}*/ + +/** @}*/ + +/*--------------------------------------------------------------------------- + * Types + *---------------------------------------------------------------------------*/ +/** \addtogroup gmacd_types + @{*/ + +/** RX/TX callback */ +typedef void (*gmacd_callback_t)(uint8_t queue, uint32_t status); + +/** TX Wakeup callback */ +typedef void (*gmacd_wakeup_cb_t)(uint8_t queue); + +/** GMAC scatter-gather entry */ +struct _gmac_sg { + uint32_t size; + void *buffer; + struct _gmac_sg *next; +}; + +/** GMAC scatter-gather list */ +struct _gmac_sg_list { + uint32_t size; + struct _gmac_sg *entries; +}; + +struct _gmacd_queue { + uint8_t *rx_buffer; + struct _gmac_desc *rx_desc; + uint16_t rx_size; + uint16_t rx_head; + gmacd_callback_t rx_callback; + + uint8_t *tx_buffer; + struct _gmac_desc *tx_desc; + uint16_t tx_size; + uint16_t tx_head; + uint16_t tx_tail; + gmacd_callback_t *tx_callbacks; + + gmacd_wakeup_cb_t tx_wakeup_callback; + uint16_t tx_wakeup_threshold; +}; + +/** + * GMAC driver struct. + */ +struct _gmacd { + Gmac* gmac; /**< GMAC instance */ + struct _gmacd_queue queues[GMAC_NUM_QUEUES]; +}; + +/** @}*/ + +/** \addtogroup gmacd_functions + @{*/ + +/*--------------------------------------------------------------------------- + * GMAC Exported functions + *---------------------------------------------------------------------------*/ + +extern void gmacd_configure(struct _gmacd* gmacd, Gmac *pHw, uint8_t enableCAF, uint8_t enableNBC); + +extern uint8_t gmacd_setup_queue(struct _gmacd* gmacd, uint8_t queue, + uint16_t rx_size, uint8_t* rx_buffer, struct _gmac_desc* rx_desc, + uint16_t tx_size, uint8_t* tx_buffer, struct _gmac_desc* tx_desc, + gmacd_callback_t *tx_callbacks); + +extern void gmacd_start(struct _gmacd* gmacd); + +extern void gmacd_reset(struct _gmacd* gmacd); + +extern uint8_t gmacd_send_sg(struct _gmacd* gmacd, uint8_t queue, + const struct _gmac_sg_list* sgl, gmacd_callback_t callback); + +extern uint8_t gmacd_send(struct _gmacd* gmacd, uint8_t queue, void *buffer, + uint32_t size, gmacd_callback_t callback); + +extern uint32_t gmacd_get_tx_load(struct _gmacd* gmacd, uint8_t queue); + +extern uint8_t gmacd_poll(struct _gmacd* gmacd, uint8_t queue, + uint8_t* buffer, uint32_t buffer_size, uint32_t* recv_size); + +extern void gmacd_set_rx_callback(struct _gmacd *gmacd, uint8_t queue, + gmacd_callback_t callback); + +extern uint8_t gmacd_set_tx_wakeup_callback(struct _gmacd *gmacd, + uint8_t queue, gmacd_wakeup_cb_t wakeup_callback, + uint16_t threshold); + +/** @}*/ + +#endif /* _GMACD_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.c new file mode 100644 index 000000000..047e8d315 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.c @@ -0,0 +1,250 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Implementation of HSMC functions. + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "peripherals/pmc.h" +#include "peripherals/hsmc.h" + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static uint32_t _nfc_read_cmd(uint32_t cmd) +{ + return *(volatile uint32_t*)(NFC_ADDR + cmd); +} + +static void _nfc_write_cmd(uint32_t cmd, uint32_t value) +{ + *(volatile uint32_t*)(NFC_ADDR + cmd) = value; +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Sets SMC timing for NAND FLASH. + * \param cs chip select. + * \param bus_width bus width 8/16. + */ +void hsmc_nand_configure(uint8_t cs, uint8_t bus_width) +{ + pmc_enable_peripheral(ID_HSMC); + + HSMC->SMC_CS_NUMBER[cs].HSMC_SETUP = + HSMC_SETUP_NWE_SETUP(2) | + HSMC_SETUP_NCS_WR_SETUP(2) | + HSMC_SETUP_NRD_SETUP(2) | + HSMC_SETUP_NCS_RD_SETUP(2); + + HSMC->SMC_CS_NUMBER[cs].HSMC_PULSE = + HSMC_PULSE_NWE_PULSE(7) | + HSMC_PULSE_NCS_WR_PULSE(7) | + HSMC_PULSE_NRD_PULSE(7) | + HSMC_PULSE_NCS_RD_PULSE(7); + + HSMC->SMC_CS_NUMBER[cs].HSMC_CYCLE = + HSMC_CYCLE_NWE_CYCLE(13) | + HSMC_CYCLE_NRD_CYCLE(13); + + HSMC->SMC_CS_NUMBER[cs].HSMC_TIMINGS = + HSMC_TIMINGS_TCLR(3) | + HSMC_TIMINGS_TADL(27) | + HSMC_TIMINGS_TAR(3) | + HSMC_TIMINGS_TRR(6) | + HSMC_TIMINGS_TWB(5) | + HSMC_TIMINGS_RBNSEL(3) | + HSMC_TIMINGS_NFSEL; + + HSMC->SMC_CS_NUMBER[cs].HSMC_MODE = + HSMC_MODE_READ_MODE | + HSMC_MODE_WRITE_MODE | + ((bus_width == 8 ) ? HSMC_MODE_DBW_BIT_8 : HSMC_MODE_DBW_BIT_16) | + HSMC_MODE_TDF_CYCLES(1); +} + +/** + * \brief Sets SMC timing for NOR FLASH. + * \param cs chip select. + * \param bus_width bus width 8/16. + */ +void hsmc_nor_configure(uint8_t cs, uint8_t bus_width) +{ + pmc_enable_peripheral(ID_HSMC); + + HSMC->SMC_CS_NUMBER[cs].HSMC_SETUP = + HSMC_SETUP_NWE_SETUP(1) | + HSMC_SETUP_NCS_WR_SETUP(0) | + HSMC_SETUP_NRD_SETUP(2) | + HSMC_SETUP_NCS_RD_SETUP(0); + + HSMC->SMC_CS_NUMBER[cs].HSMC_PULSE = + HSMC_PULSE_NWE_PULSE(10) | + HSMC_PULSE_NCS_WR_PULSE(10) | + HSMC_PULSE_NRD_PULSE(11) | + HSMC_PULSE_NCS_RD_PULSE(11); + + HSMC->SMC_CS_NUMBER[cs].HSMC_CYCLE = + HSMC_CYCLE_NWE_CYCLE(11) | + HSMC_CYCLE_NRD_CYCLE(14); + + HSMC->SMC_CS_NUMBER[cs].HSMC_TIMINGS = 0; + + HSMC->SMC_CS_NUMBER[cs].HSMC_MODE = + HSMC_MODE_READ_MODE | + HSMC_MODE_WRITE_MODE | + (bus_width == 8 ? HSMC_MODE_DBW_BIT_8 : HSMC_MODE_DBW_BIT_16) | + HSMC_MODE_EXNW_MODE_DISABLED | + HSMC_MODE_TDF_CYCLES(1); +} + +/** + * \brief Reset NFC controller. + */ +void hsmc_nfc_reset(void) +{ + /* Disable all the SMC NFC interrupts */ + HSMC->HSMC_IDR = 0xFFFFFFFF; + HSMC->HSMC_CTRL = 0; +} + +/** + * \brief Check if spare area be read in read mode. + * + * \return Returns true if NFC controller reads both main and spare area in + * read mode, otherwise returns false. + */ +bool hsmc_nfc_is_spare_read_enabled(void) +{ + return (((HSMC->HSMC_CFG) >> 9) & 0x1) != 0; +} + +/** + * \brief Check if spare area be written in write mode. + * + * \return Returns true if NFC controller writes both main and spare area in + * write mode, otherwise returns false. + */ +bool hsmc_nfc_is_spare_write_enabled(void) +{ + return (((HSMC->HSMC_CFG) >> 8) & 0x1) != 0; +} + +/** + * \brief Check if NFC Controller is busy. + * + * \return Returns 1 if NFC Controller is activated and accesses the memory device, + * otherwise returns 0. + */ +bool hsmc_nfc_is_nfc_busy(void) +{ + return ((HSMC->HSMC_SR & HSMC_SR_NFCBUSY) == HSMC_SR_NFCBUSY); +} + +/** + * \brief Check if the host controller is busy. + * \return Returns 1 if the host controller is busy, otherwise returns 0. + */ +static bool smc_nfc_is_host_busy(void) +{ + return (_nfc_read_cmd(NFCADDR_CMD_NFCCMD) & 0x8000000) == 0x8000000; +} + +/** + * \brief Wait for Ready-busy pin falling and then rising. + */ +void hsmc_wait_rb(void) +{ + /* Wait for RB pin falling */ + while ((HSMC->HSMC_SR & HSMC_SR_RB_FALL) != HSMC_SR_RB_FALL); + + /* Wait for RB pin rising */ + while ((HSMC->HSMC_SR & HSMC_SR_RB_RISE) != HSMC_SR_RB_RISE); +} + +/** + * \brief Wait for NFC command has done. + */ +void hsmc_nfc_wait_cmd_done(void) +{ + while ((HSMC->HSMC_SR & HSMC_SR_CMDDONE) != HSMC_SR_CMDDONE); +} + +/** + * \brief Wait for NFC Data Transfer Terminated. + */ +void hsmc_nfc_wait_xfr_done(void) +{ + while ((HSMC->HSMC_SR & HSMC_SR_XFRDONE) != HSMC_SR_XFRDONE); +} + +/** + * \brief Wait for NFC Ready/Busy Line 3 Edge Detected. + */ +void hsmc_nfc_wait_rb_busy(void) +{ + while ((HSMC->HSMC_SR & HSMC_SR_RB_EDGE0) != HSMC_SR_RB_EDGE0); +} + +/** + * \brief Wait for PMECC ready. + */ +void hsmc_pmecc_wait_ready(void) +{ + while((HSMC->HSMC_PMECCSR) & HSMC_PMECCSR_BUSY); +} + +/** + * \brief Uses the HOST NANDFLASH controller to send a command to the NFC. + * \param cmd command to send. + * \param address_cycle address cycle when command access id decoded. + * \param cycle0 address at first cycle. + */ +void hsmc_nfc_send_cmd(uint32_t cmd, uint32_t address_cycle, uint32_t cycle0) +{ + /* Wait until host controller is not busy. */ + while (smc_nfc_is_host_busy()); + + /* Send the command plus the ADDR_CYCLE */ + HSMC->HSMC_ADDR = cycle0; + _nfc_write_cmd(cmd, address_cycle); + hsmc_nfc_wait_cmd_done(); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.h new file mode 100644 index 000000000..022a76908 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/hsmc.h @@ -0,0 +1,139 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** +* \file +* +* Definitions and function prototype for smc module +*/ + +#ifndef _HSMC_ +#define _HSMC_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include +#include + +/*---------------------------------------------------------------------------- + * Macros + *----------------------------------------------------------------------------*/ + +#define hsmc_nfc_configure(mode) {HSMC->HSMC_CFG = mode ;} +#define hsmc_nfc_enable() {HSMC->HSMC_CTRL |= HSMC_CTRL_NFCEN;} +#define hsmc_nfc_disable() {HSMC->HSMC_CTRL |= HSMC_CTRL_NFCDIS;} +#define hsmc_nfc_get_status() {HSMC->HSMC_SR;} + +#define hsmc_nfc_enable_spare_read() {HSMC->HSMC_CFG |= HSMC_CFG_RSPARE;} +#define hsmc_nfc_disable_spare_read() {HSMC->HSMC_CFG &= (~HSMC_CFG_RSPARE);} +#define hsmc_nfc_enable_spare_write() {HSMC->HSMC_CFG |= HSMC_CFG_WSPARE;} +#define hsmc_nfc_disable_spare_write() {HSMC->HSMC_CFG &= (~HSMC_CFG_WSPARE);} + +#define hsmc_pmecc_reset() {HSMC->HSMC_PMECCTRL = HSMC_PMECCTRL_RST; } +#define hsmc_pmecc_or_reset() {HSMC->HSMC_PMECCTRL |= HSMC_PMECCTRL_RST; } +#define hsmc_pmecc_data_phase() {HSMC->HSMC_PMECCTRL |= HSMC_PMECCTRL_DATA; } +#define hsmc_pmecc_enable_write() {HSMC->HSMC_PMECCFG |= HSMC_PMECCFG_NANDWR;} +#define hsmc_pmecc_enable_read() {HSMC->HSMC_PMECCFG &= (~HSMC_PMECCFG_NANDWR);} + +#define hsmc_pmecc_error_status() (HSMC->HSMC_PMECCISR ) +#define hsmc_pmecc_enable() {HSMC->HSMC_PMECCTRL = HSMC_PMECCTRL_ENABLE;} +#define hsmc_pmecc_disable() {HSMC->HSMC_PMECCTRL = HSMC_PMECCTRL_DISABLE;} +#define hsmc_pmecc_auto_enable() {HSMC->HSMC_PMECCFG |= HSMC_PMECCFG_AUTO;} +#define hsmc_pmecc_auto_disable() {HSMC->HSMC_PMECCFG &= (~HSMC_PMECCFG_AUTO);} +#define hsmc_pmecc_auto_apare_en() ((HSMC->HSMC_PMECCFG & HSMC_PMECCFG_SPAREEN) == HSMC_PMECCFG_SPAREEN) +#define hsmc_pmecc(i) (HSMC->SMC_PMECC[i]) + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +#define HSMC_SR_RB_EDGE0 (0x1u << 24) + +/* -------- NFCADDR_CMD : NFC Address Command -------- */ + +#define NFCADDR_CMD_CMD1 (0xFFu << 2) /* Command Register Value for Cycle 1 */ +#define NFCADDR_CMD_CMD2 (0xFFu << 10) /* Command Register Value for Cycle 2 */ +#define NFCADDR_CMD_VCMD2 (0x1u << 18) /* Valid Cycle 2 Command */ +#define NFCADDR_CMD_ACYCLE (0x7u << 19) /* Number of Address required for the current command */ +#define NFCADDR_CMD_ACYCLE_NONE (0x0u << 19) /* No address cycle */ +#define NFCADDR_CMD_ACYCLE_ONE (0x1u << 19) /* One address cycle */ +#define NFCADDR_CMD_ACYCLE_TWO (0x2u << 19) /* Two address cycles */ +#define NFCADDR_CMD_ACYCLE_THREE (0x3u << 19) /* Three address cycles */ +#define NFCADDR_CMD_ACYCLE_FOUR (0x4u << 19) /* Four address cycles */ +#define NFCADDR_CMD_ACYCLE_FIVE (0x5u << 19) /* Five address cycles */ +#define NFCADDR_CMD_CSID (0x7u << 22) /* Chip Select Identifier */ +#define NFCADDR_CMD_CSID_0 (0x0u << 22) /* CS0 */ +#define NFCADDR_CMD_CSID_1 (0x1u << 22) /* CS1 */ +#define NFCADDR_CMD_CSID_2 (0x2u << 22) /* CS2 */ +#define NFCADDR_CMD_CSID_3 (0x3u << 22) /* CS3 */ +#define NFCADDR_CMD_CSID_4 (0x4u << 22) /* CS4 */ +#define NFCADDR_CMD_CSID_5 (0x5u << 22) /* CS5 */ +#define NFCADDR_CMD_CSID_6 (0x6u << 22) /* CS6 */ +#define NFCADDR_CMD_CSID_7 (0x7u << 22) /* CS7 */ +#define NFCADDR_CMD_DATAEN (0x1u << 25) /* NFC Data Enable */ +#define NFCADDR_CMD_DATADIS (0x0u << 25) /* NFC Data disable */ +#define NFCADDR_CMD_NFCRD (0x0u << 26) /* NFC Read Enable */ +#define NFCADDR_CMD_NFCWR (0x1u << 26) /* NFC Write Enable */ +#define NFCADDR_CMD_NFCCMD (0x1u << 27) /* NFC Command Enable */ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +extern void hsmc_nand_configure(uint8_t cs, uint8_t bus_width); + +extern void hsmc_nor_configure(uint8_t cs, uint8_t bus_width); + +extern void hsmc_nfc_reset(void); + +extern bool hsmc_nfc_is_spare_read_enabled(void); + +extern bool hsmc_nfc_is_spare_write_enabled(void); + +extern bool hsmc_nfc_is_nfc_busy(void); + +extern void hsmc_wait_rb(void); + +extern void hsmc_nfc_send_cmd(uint32_t cmd, uint32_t address_cycle, uint32_t cycle0); + +extern void hsmc_nfc_wait_cmd_done(void); + +extern void hsmc_nfc_wait_xfr_done(void); + +extern void hsmc_nfc_wait_rb_busy(void); + +extern void hsmc_nfc_wait_hamming_ready(void); + +extern void hsmc_pmecc_wait_ready(void); + +#endif /* _HSMC_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.c new file mode 100644 index 000000000..82566646f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.c @@ -0,0 +1,694 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2013, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/isc.h" + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + + +/*---------------------------------------------------------------------------- + * Export functions + *----------------------------------------------------------------------------*/ + +/*------------------------------------------ + * ISC Control functions + *----------------------------------------*/ +/** + * \brief Send Capture Input Stream Command to start a single shot capture or a + * multiple frame. + */ +void isc_start_capture(void) +{ + ISC->ISC_CTRLEN = ISC_CTRLEN_CAPTURE; +} + +/** + * \brief end the capture at the next Vertical Synchronization Detection. + */ +void isc_stop_capture(void) +{ + ISC->ISC_CTRLDIS = ISC_CTRLDIS_DISABLE; +} + +/** + * \brief Returns ISC Control Status. + */ +uint32_t isc_get_ctrl_status(void) +{ + return (ISC->ISC_CTRLSR); +} + +/** + * \brief update the color profile. + */ +void isc_update_profile(void) +{ + ISC->ISC_CTRLEN = ISC_CTRLEN_UPPRO; + while((ISC->ISC_CTRLSR & ISC_CTRLSR_UPPRO) == ISC_CTRLSR_UPPRO); +} + +/** + * \brief Perform software reset of the interface. + */ +void isc_software_reset(void) +{ + ISC->ISC_CTRLDIS = ISC_CTRLDIS_SWRST; +} + +/*------------------------------------------ + * PFE(Parallel Front End) functions + *----------------------------------------*/ + +/** + * \brief configure PFE(Parallel Front End) video mode. + * \param vmode: Parallel Front End Mode + */ +void isc_pfe_set_video_mode(uint32_t vmode) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_MODE_Msk; + ISC->ISC_PFE_CFG0 |= vmode; +} + +/** + * \brief set PFE(Parallel Front End) H/V synchronization polarity. + * \param hpol: Horizontal Synchronization Polarity + * \param vpol: Vertical Synchronization Polarity + */ +void isc_pfe_set_sync_polarity(uint32_t hpol, uint32_t vpol) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_HPOL; + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_VPOL; + ISC->ISC_PFE_CFG0 |= hpol | vpol; +} + +/** + * \brief set PFE(Parallel Front End) pixel clock polarity. + * \param ppol: pixel clock Polarity, The pixel stream is sampled on the + * rising or falling edge of the pixel clock + */ +void isc_pfe_set_pixel_polarity(uint32_t ppol) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_PPOL; + ISC->ISC_PFE_CFG0 |= ppol ; +} + +/** + * \brief set PFE(Parallel Front End) field polarity. + * \param fpol: Top/bottom field polarity configuration. + */ +void isc_pfe_set_field_polarity(uint32_t fpol) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_FPOL; + ISC->ISC_PFE_CFG0 |= fpol ; +} + + +/** + * \brief Enables/disable PFE(Parallel Front End) cropping + * \param enCol: Column Cropping enable/disable(1/0) + * \param enRow: Row Cropping enable/disable(1/0) + */ +void isc_pfe_set_cropping_enabled(uint8_t enCol, uint8_t enRow) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_COLEN; + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_ROWEN; + if (enCol) ISC->ISC_PFE_CFG0 |=ISC_PFE_CFG0_COLEN; + if (enRow) ISC->ISC_PFE_CFG0 |=ISC_PFE_CFG0_ROWEN; +} + +/** + * \brief set PFE(Parallel Front End) Bits Per Sample. + * \param bps: Bits Per Sample. + */ +void isc_pfe_set_bps(uint32_t bps) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_BPS_Msk; + ISC->ISC_PFE_CFG0 |= bps ; +} + +/** + * \brief set PFE(Parallel Front End)in single shot mode + */ +void isc_pfe_set_single_shot(void) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_CONT; +} + +/** + * \brief set PFE(Parallel Front End)in continuous mode + */ +void isc_pfe_set_continuous_shot(void) +{ + ISC->ISC_PFE_CFG0 |= ISC_PFE_CFG0_CONT; +} + + +/** + * \brief set PFE(Parallel Front End) gated clock. + * \param en: enable/disable gated clock. + */ +void isc_pfe_set_gated_clock(uint8_t en) +{ + ISC->ISC_PFE_CFG0 &= ~ISC_PFE_CFG0_GATED; + if (en) ISC->ISC_PFE_CFG0 |= ISC_PFE_CFG0_GATED ; +} +/** + * \brief configure PFE(Parallel Front End) cropping area. + * \param Hstart: Horizontal starting position of the cropping area + * \param Hend: Horizontal ending position of the cropping area + * \param Vstart: Vertical starting position of the cropping area + * \param Hend: Vertical ending position of the cropping area + */ +void isc_pfe_set_cropping_area( + uint32_t Hstart, uint32_t Hend, uint32_t Vstart, uint32_t Vend) +{ + ISC->ISC_PFE_CFG1 = ISC_PFE_CFG1_COLMIN(Hstart) | ISC_PFE_CFG1_COLMAX(Hend); + ISC->ISC_PFE_CFG2 = ISC_PFE_CFG2_ROWMIN(Vstart) | ISC_PFE_CFG2_ROWMAX(Vend); +} + +/*------------------------------------------ + * Clock configuration functions + *----------------------------------------*/ + +/** + * \brief Configure the ISP clock. + * \param ispClockDiv ISP Clock Divider. + * \param ispClockSelection ISP Clock Selection. + 0: HCLOCK is selected. + 1: GCK is selected. + */ +void isc_configure_isp_clock(uint32_t ispClockDiv, uint32_t ispClockSelection) +{ + ISC->ISC_CLKCFG |= ISC_CLKCFG_ICDIV(ispClockDiv) | (ispClockSelection << 8); +} + +/** + * \brief Enables the ISP clock. + */ +void isc_enable_isp_clock(void) +{ + ISC->ISC_CLKEN = ISC_CLKEN_ICEN; +} + +/** + * \brief Disables the ISP clock. + */ +void isc_disable_isp_clock(void) +{ + ISC->ISC_CLKDIS = ISC_CLKDIS_ICDIS; +} + +/** + * \brief Software reset the ISP clock. + */ +void isc_reset_isp_clock(void) +{ + ISC->ISC_CLKDIS = ISC_CLKDIS_ICSWRST; +} + +/** + * \brief Configure the Master clock. + * \param masterClockDiv Master Clock Divider. + * \param masterClockSelection Master Clock Selection. + 0: HCLOCK is selected. + 1: GCK is selected. + 2: 480-MHz system clock is selected. + */ +void isc_configure_master_clock(uint32_t masterClockDiv, uint32_t masterClockSelection) +{ + ISC->ISC_CLKCFG |= ISC_CLKCFG_MCDIV(masterClockDiv) + | ISC_CLKCFG_MCSEL(masterClockSelection); +} + +/** + * \brief Enables the master clock. + */ +void isc_enable_master_clock(void) +{ + ISC->ISC_CLKEN = ISC_CLKEN_MCEN; +} + +/** + * \brief Disables the master clock. + */ +void isc_disable_master_clock(void) +{ + ISC->ISC_CLKDIS = ISC_CLKDIS_MCDIS; +} + +/** + * \brief Software reset the master clock. + */ +void isc_reset_master_clock(void) +{ + ISC->ISC_CLKDIS = ISC_CLKDIS_MCSWRST; +} + +/** + * \brief Returns ISC clock Status. + */ +uint32_t isc_get_clock_status(void) +{ + return (ISC->ISC_CLKSR); +} + +/*------------------------------------------ + * Interrupt functions + *----------------------------------------*/ +/** + * \brief Enable ISC interrupt + * \param flag of interrupt to enable + */ +void isc_enable_interrupt(uint32_t flag) +{ + ISC->ISC_INTEN = flag; +} + +/** + * \brief Disable ISC interrupt + * \param flag of interrupt to disable + */ +void isc_disable_interrupt(uint32_t flag) +{ + ISC->ISC_INTDIS = flag; +} + +/** + * \brief Return ISC status register + * \return Status of ISC register + */ +uint32_t isc_interrupt_status(void) +{ + return(ISC->ISC_INTSR); +} + + +/*------------------------------------------ + * White Balance functions + *----------------------------------------*/ +/** + * \brief Enables/disable White Balance. + */ +void isc_wb_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_WB_CTRL = ISC_WB_CTRL_ENABLE; + else + ISC->ISC_WB_CTRL = 0; +} + +/** + * \brief White Balance Bayer Configuration (Pixel Color Pattern). + */ +void isc_wb_set_bayer_pattern(uint8_t pattern) +{ + ISC->ISC_WB_CFG = pattern; +} + +/** + * \brief adjust White Balance with color component. + * \param rOffset Offset Red Component (signed 13 bits 1:12:0) + * \param grOffset Offset Green Component for Red Row (signed 13 bits 1:12:0) + * \param bOffset Offset Blue Component (signed 13 bits, 1:12:0) + * \param gbOffset Offset Green Component for Blue Row (signed 13 bits, 1:12:0) + * \param rGain Red Component Gain (unsigned 13 bits, 0:4:9) + * \param grGain Green Component (Red row) Gain (unsigned 13 bits, 0:4:9) + * \param bGain Blue Component Gain (unsigned 13 bits, 0:4:9) + * \param gbGain Green Component (Blue row) Gain (unsigned 13 bits, 0:4:9) + */ +void isc_wb_adjust_bayer_color(uint32_t rOffset, uint32_t grOffset, + uint32_t bOffset, uint32_t gbOffset, + uint32_t rGain, uint32_t grGain, + uint32_t bGain, uint32_t gbGain) +{ + ISC->ISC_WB_O_RGR = + ISC_WB_O_RGR_ROFST(rOffset) | ISC_WB_O_RGR_GROFST(grOffset); + ISC->ISC_WB_O_BGB = + ISC_WB_O_BGB_BOFST(bOffset) | ISC_WB_O_BGB_GBOFST(gbOffset); + ISC->ISC_WB_G_RGR = + ISC_WB_G_RGR_RGAIN(rGain) | ISC_WB_G_RGR_GRGAIN(grGain); + ISC->ISC_WB_G_BGB = + ISC_WB_G_BGB_BGAIN(bGain) | ISC_WB_G_BGB_GBGAIN(gbGain); +} + +/*------------------------------------------ + * Color Filter Array functions + *----------------------------------------*/ +/** + * \brief Enables/disable Color Filter Array Interpolation. + */ +void isc_cfa_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_CFA_CTRL = ISC_CFA_CTRL_ENABLE; + else + ISC->ISC_CFA_CTRL = 0; +} + +/** + * \brief configure color filter array interpolation. + * \param pattern Color Filter Array Pattern + * \param edge Edge Interpolation + 0: Edges are not interpolated. + 1: Edge interpolation is performed. + */ +void isc_cfa_configure(uint8_t pattern, uint8_t edge) +{ + ISC->ISC_CFA_CFG = pattern | (edge << 4); +} + +/*------------------------------------------ + * Color Correction functions + *----------------------------------------*/ +/** + * \brief Enables/disable Color Correction. + */ +void isc_cc_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_CC_CTRL = ISC_CC_CTRL_ENABLE; + else + ISC->ISC_CFA_CTRL = 0; +} + +/** + * \brief Color correction with color component. + * \param cc Pointer to structure _color_correct + */ +void isc_cc_configure(struct _color_correct* cc) +{ + ISC->ISC_CC_RR_RG = + ISC_CC_RR_RG_RRGAIN(cc->rrGain) | ISC_CC_RR_RG_RGGAIN(cc->rgGain); + ISC->ISC_CC_RB_OR = + ISC_CC_RB_OR_RBGAIN(cc->rbGain) | ISC_CC_RB_OR_ROFST(cc->rOffset); + ISC->ISC_CC_GR_GG = + ISC_CC_GR_GG_GRGAIN(cc->grGain) | ISC_CC_GR_GG_GGGAIN(cc->ggGain); + ISC->ISC_CC_GB_OG = + ISC_CC_GB_OG_GBGAIN(cc->gbGain) | ISC_CC_GB_OG_ROFST(cc->gOffset); + ISC->ISC_CC_BR_BG = + ISC_CC_BR_BG_BRGAIN(cc->brGain) | ISC_CC_BR_BG_BGGAIN(cc->bgGain); + ISC->ISC_CC_BB_OB = + ISC_CC_BB_OB_BBGAIN(cc->bbGain) | ISC_CC_BB_OB_BOFST(cc->bOffset); +} + +/*------------------------------------------ + * Gamma Correction functions + *----------------------------------------*/ +/** + * \brief Enables/disable Gamma Correction with giving channels. + * \param enabled 1: enable, 0: disable + * \param channels ISC_GAM_CTRL_BENABLE/ISC_GAM_CTRL_GENABLE/ISC_GAM_CTRL_RENABLE + */ +void isc_gamma_enabled(uint8_t enabled, uint8_t channels) +{ + if (enabled) + ISC->ISC_GAM_CTRL |= ISC_GAM_CTRL_ENABLE | channels; + else + ISC->ISC_GAM_CTRL = 0; +} + +/** + * \brief Configure gamma correction with give table. + * \param rGamConstant Pointer to red Color Constant instance (64 half-word). + * \param rGamSlope Pointer to red Color Slope instance (64 half-word). + * \param gGamConstant Pointer to green Color Constant instance (64 half-word). + * \param gGamSlope Pointer to green Color Slope instance (64 half-word). + * \param bGamConstant Pointer to blue Color Constant instance (64 half-word). + * \param bGamSlope Pointer to blue Color Slope instance (64 half-word). + */ +void isc_gamma_configure(uint16_t* rGamConstant, uint16_t* rGamSlope, + uint16_t* gGamConstant, uint16_t* gGamSlope, + uint16_t* bGamConstant, uint16_t* bGamSlope) +{ + uint8_t i; + for (i = 0; i < 64 ; i++) { + ISC->ISC_GAM_BENTRY[i] = + ISC_GAM_BENTRY_BCONSTANT(bGamConstant[i]) + | ISC_GAM_BENTRY_BSLOPE(bGamSlope[i]); + ISC->ISC_GAM_GENTRY[i] = + ISC_GAM_GENTRY_GCONSTANT(bGamConstant[i]) + | ISC_GAM_GENTRY_GSLOPE(bGamSlope[i]); + ISC->ISC_GAM_RENTRY[i] = + ISC_GAM_RENTRY_RCONSTANT(bGamConstant[i]) + | ISC_GAM_RENTRY_RSLOPE(bGamSlope[i]); + } +} + +/*------------------------------------------ + * Color Space Conversion functions + *----------------------------------------*/ +/** + * \brief Enables/disable Color Space Conversion. + */ +void isc_csc_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_CSC_CTRL = ISC_CSC_CTRL_ENABLE; + else + ISC->ISC_CSC_CTRL = 0; +} + +/** + * \brief Color space convert with color space component. + * \param cs Pointer to structure _color_space + */ +void isc_csc_configure(struct _color_space* cs) +{ + ISC->ISC_CSC_YR_YG = ISC_CSC_YR_YG_YRGAIN(cs->YrGain) + | ISC_CSC_YR_YG_YGGAIN(cs->YgGain); + ISC->ISC_CSC_YB_OY = ISC_CSC_YB_OY_YBGAIN(cs->YbGain) + | ISC_CSC_YB_OY_YOFST(cs->Yoffset); + ISC->ISC_CSC_CBR_CBG = ISC_CSC_CBR_CBG_CBRGAIN(cs->cbrGain) + | ISC_CSC_CBR_CBG_CBGGAIN(cs->cbgGain); + ISC->ISC_CSC_CBB_OCB = ISC_CSC_CBB_OCB_CBBGAIN(cs->cbbGain) + | ISC_CSC_CBB_OCB_CBOFST(cs->cbOffset); + ISC->ISC_CSC_CRR_CRG = ISC_CSC_CRR_CRG_CRRGAIN(cs->crrGain) + | ISC_CSC_CRR_CRG_CRGGAIN(cs->crgGain); + ISC->ISC_CSC_CRB_OCR = ISC_CSC_CRB_OCR_CRBGAIN(cs->crbGain) + | ISC_CSC_CRB_OCR_CROFST(cs->crOffset); +} + +/*------------------------------------------ + * Contrast And Brightness functions + *----------------------------------------*/ +/** + * \brief Enables/disable contrast and brightness control. + */ +void isc_cbc_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_CBC_CTRL = ISC_CBC_CTRL_ENABLE; + else + ISC->ISC_CBC_CTRL = 0; +} + +/** + * \brief Configure Contrast and brightness with give parameter. + * \param ccir656 CCIR656 Stream Enable. + 0: Raw mode + 1: CCIR mode + * \param byteOrder CCIR656 Byte Ordering. + * \param brightness Brightness Control (signed 11 bits 1:10:0). + * \param Contrast Contrast (signed 12 bits 1:3:8). + */ +void isc_cbc_configure(uint8_t ccir656, uint8_t byteOrder, + uint16_t brightness, uint16_t contrast) +{ + if (ccir656) + ISC->ISC_CBC_CFG = ISC_CBC_CFG_CCIR | byteOrder ; + else + ISC->ISC_CBC_CFG = 0; + ISC->ISC_CBC_BRIGHT = ISC_CBC_BRIGHT_BRIGHT(brightness); + ISC->ISC_CBC_CONTRAST = ISC_CBC_CONTRAST_CONTRAST(contrast); +} + +/*------------------------------------------ + * Sub-sampling functions + *----------------------------------------*/ +/** + * \brief Enables/disable 4:4:4 to 4:2:2 Chrominance Horizontal Subsampling Filter Enable. + */ +void isc_sub422_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_SUB422_CTRL = ISC_SUB422_CTRL_ENABLE; + else + ISC->ISC_SUB422_CTRL = 0; +} + +/** + * \brief Configure Subsampling 4:4:4 to 4:2:2 with giving value. + * \param ccir656 CCIR656 Stream Enable. + 0: Raw mode + 1: CCIR mode + * \param byteOrder CCIR656 Byte Ordering. + * \param lpf Low Pass Filter Selection. + */ +void isc_sub422_configure(uint8_t ccir656, uint8_t byteOrder, uint8_t lpf) +{ + if (ccir656) + ISC->ISC_SUB422_CFG = ISC_SUB422_CFG_CCIR | byteOrder ; + else + ISC->ISC_SUB422_CFG = 0; + ISC->ISC_SUB422_CFG |= lpf; +} + +/** + * \brief Configure 4:2:2 to 4:2:0 Vertical Subsampling Filter Enable + (Center Aligned) with giving value. + * \param enabled Subsampler enabled. + 0: disabled + 1: enabled + * \param filter Interlaced or Progressive Chrominance Filter. + 0: Progressive filter {0.5, 0.5} + 1: Field-dependent filter, top field filter is {0.75, 0.25}, + bottom field filter is {0.25, 0.75} + */ +void isc_sub420_configure(uint8_t enabled, uint8_t filter) +{ + if (enabled){ + ISC->ISC_SUB420_CTRL = ISC_SUB420_CTRL_ENABLE; + if (filter){ + ISC->ISC_SUB420_CTRL |= ISC_SUB420_CTRL_FILTER; + } + } else { + ISC->ISC_SUB420_CTRL = 0; + } +} + +/*------------------------------------------ + * Rounding, Limiting and Packing functions + *----------------------------------------*/ +/** + * \brief Configure Rounding, Limiting and Packing Mode. + * \param rlpMode Rounding, Limiting and Packing Mode. + * \param alpha Alpha Value for Alpha-enabled RGB Mode. + */ +void isc_rlp_configure(uint8_t rlpMode, uint8_t alpha) +{ + ISC->ISC_RLP_CFG = rlpMode; + if (alpha) + ISC->ISC_RLP_CFG |= ISC_RLP_CFG_ALPHA(alpha); +} + +/*------------------------------------------ + * Histogram functions + *----------------------------------------*/ +/** + * \brief Enables/disable Histogram + */ +void isc_histogram_enabled(uint8_t enabled) +{ + if (enabled) + ISC->ISC_HIS_CTRL = ISC_HIS_CTRL_ENABLE; + else + ISC->ISC_HIS_CTRL = 0; +} + +/** + * \brief Configure Histogram. + * \param mode Histogram Operating Mode. + * \param baySel Bayer Color Component Selection. + * \param reset Histogram Reset After Read + 0: Reset after read mode is disabled + 1: Reset after read mode is enabled. + */ +void isc_histogram_configure(uint8_t mode, uint8_t baySel, uint8_t reset) +{ + ISC->ISC_HIS_CFG = mode | baySel; + if (reset) + ISC->ISC_HIS_CFG |= ISC_HIS_CFG_RAR; +} + + /** + * \brief update the histogram table. + */ +void isc_update_histogram_table(void) +{ + while((ISC->ISC_CTRLSR & ISC_CTRLSR_HISREQ) == ISC_CTRLSR_HISREQ); + ISC->ISC_CTRLEN = ISC_CTRLEN_HISREQ; +} + +/** + * \brief clear the histogram table. + */ +void isc_clear_histogram_table(void) +{ + ISC->ISC_CTRLEN = ISC_CTRLEN_HISCLR; +} + +/*------------------------------------------ + * DMA functions + *----------------------------------------*/ +/** + * \brief Configure ISC DMA input mode. + * \param mode Operating Mode. + */ +void isc_dma_configure_input_mode(uint32_t mode) +{ + ISC->ISC_DCFG = mode; +} + +/** + * \brief Configure ISC DMA with giving entry. + * \param descEntry entry of DMA descriptor VIEW. + */ +void isc_dma_configure_desc_entry(uint32_t desc_entry) +{ + ISC->ISC_DNDA = desc_entry; +} + +/** + * \brief Enable ISC DMA with giving view. + * \param ctrl setting for DMA descriptor VIEW. + */ +void isc_dma_enable(uint32_t ctrl) +{ + ISC->ISC_DCTRL = ctrl; +} + +/** + * \brief Configure ISC DMA start address. + * \param channel channel number. + * \param address address for giving channel. + * \param stride stride for giving channel. + */ +void isc_dma_adderss(uint8_t channel, uint32_t address, uint32_t stride) +{ + ISC->ISC_SUB0[channel].ISC_DAD = address; + ISC->ISC_SUB0[channel].ISC_DST = stride; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.h new file mode 100644 index 000000000..e536ae6c3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/isc.h @@ -0,0 +1,281 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2013, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/** \addtogroup isc_module + * @{ + * \section isc_usage Usage + * - isc_start_capture: Send Capture Input Stream Command to start a single + * shot capture or a multiple frame + */ +/**@}*/ + +#ifndef ISC_H +#define ISC_H + +#include + +/*------------------------------------------------------------------------------ + * Type + *----------------------------------------------------------------------------*/ +/** color correction components structure */ +struct _color_correct { + /** Red Component Offset (signed 13 bits, 1:12:0) */ + uint16_t rOffset; + /** Green Component Offset (signed 13 bits, 1:12:0)*/ + uint16_t gOffset; + /** Green Component Offset (signed 13 bits, 1:12:0)*/ + uint16_t bOffset; + /** Red Gain for Red Component (signed 12 bits, 1:3:8)*/ + uint16_t rrGain; + /** Green Component (Red row) Gain (unsigned 13 bits, 0:4:9)*/ + uint16_t rgGain; + /** Blue Gain for Red Component (signed 12 bits, 1:3:8)*/ + uint16_t rbGain; + /** Green Gain for Green Component (signed 12 bits, 1:3:8)*/ + uint16_t ggGain; + /** Red Gain for Green Component (signed 12 bits, 1:3:8)*/ + uint16_t grGain; + /** Blue Gain for Green Component (signed 12 bits, 1:3:8)*/ + uint16_t gbGain; + /** Green Gain for Blue Component (signed 12 bits, 1:3:8) */ + uint16_t bgGain; + /** Red Gain for Blue Component (signed 12 bits, 1:3:8) */ + uint16_t brGain; + /** Blue Gain for Blue Component (signed 12 bits, 1:3:8)*/ + uint16_t bbGain; +}; + +/** color space convertion components structure */ +struct _color_space { + /** Red Gain for Luminance (signed 12 bits 1:3:8) */ + uint16_t YrGain; + /** Green Gain for Luminance (signed 12 bits 1:3:8)*/ + uint16_t YgGain; + /** Blue Gain for Luminance Component (12 bits signed 1:3:8)*/ + uint16_t YbGain; + /** Luminance Offset (11 bits signed 1:10:0)*/ + uint16_t Yoffset; + /** Green Gain for Blue Chrominance (signed 12 bits 1:3:8)*/ + uint16_t cbrGain; + /** Red Gain for Blue Chrominance (signed 12 bits, 1:3:8)*/ + uint16_t cbgGain; + /** Blue Gain for Blue Chrominance (signed 12 bits 1:3:8)*/ + uint16_t cbbGain; + /** Blue Chrominance Offset (signed 11 bits 1:10:0)*/ + uint16_t cbOffset; + /** Red Gain for Red Chrominance (signed 12 bits 1:3:8)*/ + uint16_t crrGain; + /** Green Gain for Red Chrominance (signed 12 bits 1:3:8)*/ + uint16_t crgGain; + /** Blue Gain for Red Chrominance (signed 12 bits 1:3:8)*/ + uint16_t crbGain; + /** Red Chrominance Offset (signed 11 bits 1:10:0)*/ + uint16_t crOffset; +}; + +/** \brief Structure for ISC DMA descriptor view0 that can be + * performed when the pixel or data stream is packed.*/ +struct _isc_dma_view0 +{ + /** ISC DMA Control. */ + uint32_t ctrl; + /** Next ISC DMA Descriptor Address number. */ + uint32_t next_desc; + /** Transfer Address. */ + uint32_t addr; + /** stride . */ + uint32_t stride; +}; + +/** \brief Structure for ISC DMA descriptor view1 that can be + * performed for YCbCr semi-planar pixel stream.*/ +struct _isc_dma_view1 +{ + /** ISC DMA Control. */ + uint32_t ctrl; + /** Next ISC DMA Descriptor Address number. */ + uint32_t next_desc; + /** Transfer Address 0. */ + uint32_t addr0; + /** stride 0 . */ + uint32_t stride0; + /** Transfer Address 1. */ + uint32_t addr1; + /** stride 1 . */ + uint32_t stride1; + +}; + +/** \brief Structure for ISC DMA descriptor view2 that can be + * performed for used for YCbCr planar pixel stream.*/ +struct _isc_dma_view2 +{ + /** ISC DMA Control. */ + uint32_t ctrl; + /** Next ISC DMA Descriptor Address number. */ + uint32_t next_desc; + /** Transfer Address 0. */ + uint32_t addr0; + /** stride 0. */ + uint32_t stride0; + /** Transfer Address 1. */ + uint32_t addr1; + /** stride 1 . */ + uint32_t stride1; + /** Transfer Address 2. */ + uint32_t addr2; + /** stride 2. */ + uint32_t stride2; +}; + +/*------------------------------------------------------------------------------ + * Exported functions + *----------------------------------------------------------------------------*/ +/*------------------------------------------ + * ISC Control functions + *----------------------------------------*/ +extern void isc_start_capture(void); +extern void isc_stop_capture(void); +extern uint32_t isc_get_ctrl_status(void); +extern void isc_update_profile(void); +extern void isc_software_reset(void); + +/*------------------------------------------ + * PFE(Parallel Front End) functions + *----------------------------------------*/ +extern void isc_pfe_set_video_mode(uint32_t vmode); +extern void isc_pfe_set_sync_polarity(uint32_t hpol, uint32_t vpol); +extern void isc_pfe_set_pixel_polarity(uint32_t ppol); +extern void isc_pfe_set_field_polarity(uint32_t fpol); +extern void isc_pfe_set_gated_clock(uint8_t en); +extern void isc_pfe_set_cropping_enabled(uint8_t enCol, uint8_t enRow); +extern void isc_pfe_set_bps(uint32_t bps); +extern void isc_pfe_set_single_shot(void); +extern void isc_pfe_set_continuous_shot(void); +extern void isc_pfe_set_cropping_area(uint32_t Hstart, uint32_t Hend, + uint32_t Vstart, uint32_t Vend); + +/*------------------------------------------ + * Clock configuration functions + *----------------------------------------*/ + extern void isc_configure_isp_clock(uint32_t isp_clk_div, + uint32_t isp_clk_sel); +extern void isc_enable_isp_clock(void); +extern void isc_disable_isp_clock(void); +extern void isc_reset_isp_clock(void); +extern void isc_configure_master_clock(uint32_t master_clk_div, + uint32_t master_clk_sel); +extern void isc_enable_master_clock(void); +extern void isc_disable_master_clock(void); +extern void isc_reset_master_clock(void); +extern uint32_t isc_get_clock_status(void); + +/*------------------------------------------ + * Interrupt functions + *----------------------------------------*/ +extern void isc_enable_interrupt(uint32_t flag); +extern void isc_disable_interrupt(uint32_t flag); +extern uint32_t isc_interrupt_status(void); + +/*------------------------------------------ + * White Balance functions + *----------------------------------------*/ +extern void isc_wb_enabled(uint8_t enabled); +extern void isc_wb_set_bayer_pattern(uint8_t pattern); +extern void isc_wb_adjust_bayer_color(uint32_t rOffset, uint32_t grOffset, + uint32_t bOffset, uint32_t gbOffset, + uint32_t rGain, uint32_t grGain, + uint32_t bGain, uint32_t gbGain); + +/*------------------------------------------ + * Color Filter Array functions + *----------------------------------------*/ +extern void isc_cfa_enabled(uint8_t enabled); +extern void isc_cfa_configure(uint8_t pattern, uint8_t edge); + +/*------------------------------------------ + * Color Correction functions + *----------------------------------------*/ +extern void isc_cc_enabled(uint8_t enabled); +extern void isc_cc_configure(struct _color_correct* cc); + +/*------------------------------------------ + * Gamma Correction functions + *----------------------------------------*/ +extern void isc_gamma_enabled(uint8_t enabled, uint8_t channels); +extern void isc_gamma_configure(uint16_t* rGamConstant, uint16_t* rGamSlope, + uint16_t* gGamConstant, uint16_t* gGamSlope, + uint16_t* bGamConstant, uint16_t* bGamSlope); + +/*------------------------------------------ + * Color Space Conversion functions + *----------------------------------------*/ +extern void isc_csc_enabled(uint8_t enabled); +extern void isc_csc_configure(struct _color_space* cs); + +/*------------------------------------------ + * Contrast And Brightness functions + *----------------------------------------*/ +extern void isc_cbc_enabled(uint8_t enabled); +extern void isc_cbc_configure(uint8_t ccir656, uint8_t byteOrder, + uint16_t brightness, uint16_t contrast); + +/*------------------------------------------ + * Sub-sampling functions + *----------------------------------------*/ +extern void isc_sub422_enabled(uint8_t enabled); +extern void isc_sub422_configure(uint8_t ccir656, uint8_t byte_order, + uint8_t lpf); +extern void isc_sub420_configure(uint8_t enabled, uint8_t filter); + +/*------------------------------------------ + * Rounding, Limiting and Packing functions + *----------------------------------------*/ +extern void isc_rlp_configure(uint8_t rlpMode, uint8_t alpha); + +/*------------------------------------------ + * Histogram functions + *----------------------------------------*/ +extern void isc_histogram_enabled(uint8_t enabled); +extern void isc_histogram_configure(uint8_t mode, uint8_t bay_sel, + uint8_t reset); +extern void isc_update_histogram_table(void); +extern void isc_clear_histogram_table(void); + +/*------------------------------------------ + * DMA functions + *----------------------------------------*/ +extern void isc_dma_configure_input_mode(uint32_t mode); +extern void isc_dma_configure_desc_entry(uint32_t desc_entry); +extern void isc_dma_enable(uint32_t ctrl); +extern void isc_dma_adderss(uint8_t channel, uint32_t address, uint32_t stride); + +#endif //#ifndef ISC_H diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.c new file mode 100644 index 000000000..d87677bea --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.c @@ -0,0 +1,433 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/l2cc.h" +#include "cortex-a/cp15.h" +#include "trace.h" + +#include +#include +#include + +/*---------------------------------------------------------------------------- + * Functions + *----------------------------------------------------------------------------*/ + +uint32_t l2cc_is_enabled(void) +{ + return ((L2CC->L2CC_CR) & L2CC_CR_L2CEN); +} + +void l2cc_enable(void) +{ + L2CC->L2CC_CR |= L2CC_CR_L2CEN; + asm volatile("": : :"memory"); + asm("dsb"); + asm("isb"); + trace_info("L2 cache is enabled\r\n"); +} + +void l2cc_disable(void) +{ + L2CC->L2CC_CR &= ~L2CC_CR_L2CEN; + asm volatile("": : :"memory"); + asm("dsb"); + asm("isb"); + trace_info("L2 cache is disabled\r\n"); +} + +void l2cc_exclusive_cache(uint8_t enable) +{ + uint32_t cfg; + if (l2cc_is_enabled()) { + l2cc_disable(); + } + cfg = L2CC->L2CC_ACR; + if (enable) { + cp15_exclusive_cache(); + cfg |= L2CC_ACR_EXCC; + trace_info("L2 Exclusive mode enabled\n\r"); + } else { + cp15_non_exclusive_cache(); + cfg &= ~L2CC_ACR_EXCC; + trace_info("L2 Exclusive mode disabled\n\r"); + } + L2CC->L2CC_ACR |= cfg; +} + +void l2cc_config_lat_ram(struct _ram_latency_control * latencies) +{ + if (l2cc_is_enabled()) { + l2cc_disable(); + } + + L2CC->L2CC_TRCR = + (L2CC_TRCR_TSETLAT(latencies->tag.setup) | + L2CC_TRCR_TRDLAT(latencies->tag.read) | + L2CC_TRCR_TWRLAT(latencies->tag.write)); + L2CC->L2CC_DRCR = + (L2CC_DRCR_DSETLAT(latencies->data.setup) | + L2CC_DRCR_DRDLAT(latencies->data.read) | + L2CC_DRCR_DWRLAT(latencies->data.write)); +} + +void l2cc_set_config(const struct _l2cc_control* cfg) +{ + uint32_t aux_control, debug_control, prefetch_control, power_control; + + if (cfg->offset > 31) { + assert(0); + } + if ((cfg->offset > 7) && (cfg->offset < 15)) { + assert(0); + } + if ((cfg->offset > 15) && (cfg->offset < 23)) { + assert(0); + } + if ((cfg->offset > 23) && (cfg->offset < 31)) { + assert(0); + } + + if (l2cc_is_enabled()) { + l2cc_disable(); + } + + aux_control = ((cfg->high_prior_so << 10) | + (cfg->store_buff_dev_limit << 11) | + (cfg->shared_attr_invalidate << 13) | + (cfg->evt_mon_bus << 20) | + (cfg->parity << 21) | + (cfg->shared_attr_override << 22) | + (L2CC_ACR_FWA(cfg->force_write_alloc)) | + (cfg->cache_replacement << 25) | + (cfg->non_sec_lockdown << 26) | + (cfg->it_acces_non_sec << 27) | + (cfg->data_prefetch << 28) | + (cfg->instruct_prefetch << 29)); + + debug_control = ((cfg->no_cache_linefill << 0) | + (cfg->no_write_back << 1)); + + prefetch_control = ((L2CC_PCR_OFFSET(cfg->offset << 0)) | + (cfg->exclusive_seq_same_id << 21) | + (cfg->incr_double_linefill << 23) | + (cfg->prefetch_drop << 24) | + (cfg->DLFWRDIS << 27) | + (cfg->data_prefetch << 28) | + (cfg->instruct_prefetch << 29) | + (cfg->double_linefill << 30)); + + power_control = ((cfg->standby_mode << 0) | + (cfg->dyn_clock_gating << 1)); + + L2CC->L2CC_ACR = aux_control; + L2CC->L2CC_DCR = debug_control; + L2CC->L2CC_PCR = prefetch_control; + L2CC->L2CC_POWCR = power_control; +} + +void l2cc_data_prefetch_enable(void) +{ + L2CC->L2CC_PCR |= L2CC_PCR_DATPEN; +} + +void l2cc_inst_prefetch_enable(void) +{ + L2CC->L2CC_PCR |= L2CC_PCR_INSPEN; +} + +void l2cc_enable_reset_counter(uint8_t event_counter) +{ + assert((event_counter > 3) ? 0 : 1); + L2CC->L2CC_ECR = (L2CC_ECR_EVCEN | (event_counter << 1)); +} + +void l2cc_event_config(uint8_t event_counter, uint8_t source, uint8_t it) +{ + if (l2cc_is_enabled()) { + L2CC->L2CC_CR = false; + } + assert((event_counter > 1) ? 0 : 1); + if (!event_counter) { + L2CC->L2CC_ECFGR0 = (source | it); + } else { + L2CC->L2CC_ECFGR1 = (source | it); + } + +} + +uint32_t l2cc_event_counter_value(uint8_t event_counter) +{ + assert((event_counter > 1) ? 0 : 1); + if (!event_counter) { + return L2CC->L2CC_EVR0; + } else { + return L2CC->L2CC_EVR1; + } +} + +void l2cc_enable_it(uint16_t sources) +{ + L2CC->L2CC_IMR |= sources; +} + +void l2cc_disable_it(uint16_t sources) +{ + L2CC->L2CC_IMR &= (!sources); +} + +unsigned short l2cc_it_status_raw(uint16_t sources) +{ + return ((L2CC->L2CC_RISR) & sources) ? 1 : 0; +} + +uint16_t l2cc_it_status_mask(uint16_t sources) +{ + return ((L2CC->L2CC_MISR) & sources) ? 1 : 0; +} + +void l2cc_it_clear(uint16_t sources) +{ + L2CC->L2CC_ICR |= sources; +} + +uint8_t l2cc_poll_spniden() +{ + return ((L2CC->L2CC_DCR & L2CC_DCR_SPNIDEN) >> 2); +} + +void l2cc_cache_sync() +{ + while ((L2CC->L2CC_CSR) & L2CC_CSR_C) ; + L2CC->L2CC_CSR = L2CC_CSR_C; + while ((L2CC->L2CC_CSR) & L2CC_CSR_C) ; +} + +void l2cc_invalidate_pal(uint32_t phys_addr) +{ + static uint32_t Tag; + static uint16_t Index; + Tag = (phys_addr >> (OFFSET_BIT + INDEX_BIT)); + Index = (phys_addr >> OFFSET_BIT) & ((1 << INDEX_BIT) - 1); + L2CC->L2CC_IPALR = (L2CC_IPALR_TAG(Tag) | L2CC_IPALR_IDX(Index) | L2CC_IPALR_C); + while ((L2CC->L2CC_IPALR) & L2CC_IPALR_C) ; +} + +void l2cc_clean_pal(uint32_t phys_addr) +{ + static uint32_t Tag; + static uint16_t Index; + + Tag = (phys_addr >> (OFFSET_BIT + INDEX_BIT)); + Index = (phys_addr >> OFFSET_BIT) & ((1 << INDEX_BIT) - 1); + L2CC->L2CC_CPALR = + (L2CC_CPALR_TAG(Tag) | L2CC_CPALR_IDX(Index) | L2CC_CPALR_C); + while ((L2CC->L2CC_CPALR) & L2CC_CPALR_C) ; +} + +void l2cc_clean_ix(uint32_t phys_addr) +{ + static uint32_t Tag; + static uint16_t Index; + + Tag = (phys_addr >> (OFFSET_BIT + INDEX_BIT)); + Index = (phys_addr >> OFFSET_BIT) & ((1 << INDEX_BIT) - 1); + L2CC->L2CC_CIPALR = + (L2CC_CIPALR_TAG(Tag) | L2CC_CIPALR_IDX(Index) | L2CC_CIPALR_C); + while ((L2CC->L2CC_CIPALR) & L2CC_CIPALR_C) ; +} + +void l2cc_invalidate_way(uint8_t way) +{ + L2CC->L2CC_IWR = way; + while (L2CC->L2CC_IWR) ; + while (L2CC->L2CC_CSR) ; +} + +void l2cc_clean_way(uint8_t way) +{ + L2CC->L2CC_CWR = way; + while (L2CC->L2CC_CWR) ; + while (L2CC->L2CC_CSR) ; +} + +/** + * \brief Clean Invalidate cache by way + * \param way way number + */ +static void l2cc_clean_invalidate_way(uint8_t way) +{ + L2CC->L2CC_CIWR = way; + while (L2CC->L2CC_CSR) ; +} + +void l2cc_clean_index(uint32_t phys_addr, uint8_t way) +{ + static uint16_t Index; + + Index = (phys_addr >> OFFSET_BIT) & ((1 << INDEX_BIT) - 1); + L2CC->L2CC_CIR = + (L2CC_CIR_IDX(Index) | L2CC_CIR_WAY(way) | L2CC_CIR_C); + while ((L2CC->L2CC_CIR) & L2CC_CIR_C) ; +} + +void l2cc_clean_invalidate_index(uint32_t phys_addr, uint8_t way) +{ + static uint16_t Index; + + (void) way; + Index = (phys_addr >> OFFSET_BIT) & ((1 << INDEX_BIT) - 1); + L2CC->L2CC_CIIR = + (L2CC_CIIR_IDX(Index) | L2CC_CIIR_WAY(Index) | L2CC_CIIR_C); + while ((L2CC->L2CC_CIIR) & L2CC_CIIR_C) ; +} + +void l2cc_data_lockdown(uint8_t way) +{ + L2CC->L2CC_DLKR = way; + while (L2CC->L2CC_CSR) ; +} + +void l2cc_instruction_lockdown(uint8_t way) +{ + L2CC->L2CC_ILKR = way; + while (L2CC->L2CC_CSR) ; +} + +static void l2cc_clean(void) +{ + // Clean of L1; This is broadcast within the cluster + cp15_dcache_clean(); + if (l2cc_is_enabled()) { + // forces the address out past level 2 + l2cc_clean_way(0xFF); + // Ensures completion of the L2 clean + l2cc_cache_sync(); + } +} + +static void l2cc_invalidate(void) +{ + if (l2cc_is_enabled()) { + // forces the address out past level 2 + l2cc_invalidate_way(0xFF); + // Ensures completion of the L2 inval + l2cc_cache_sync(); + } + // Inval of L1; This is broadcast within the cluster + cp15_dcache_invalidate(); +} + +static void l2cc_clean_invalidate(void) +{ + /* Clean of L1; This is broadcast within the cluster */ + cp15_dcache_clean(); + + if (l2cc_is_enabled()) { + /* forces the address out past level 2 */ + l2cc_clean_invalidate_way(0xFF); + /* Ensures completion of the L2 inval */ + l2cc_cache_sync(); + } + + /* Inval of L1; This is broadcast within the cluster */ + cp15_dcache_invalidate(); +} + +void l2cc_cache_maintenance(enum _maint_op maintenance) +{ + switch (maintenance) { + case L2CC_DCACHE_CLEAN: + l2cc_clean(); + break; + case L2CC_DCACHE_INVAL: + l2cc_invalidate(); + break; + case L2CC_DCACHE_FLUSH: + l2cc_clean_invalidate(); + break; + } +} + +void l2cc_invalidate_region(uint32_t start, uint32_t end) +{ + assert(start < end); + uint32_t current = start & ~0x1fUL; + if (l2cc_is_enabled()) { + while (current <= end) { + l2cc_invalidate_pal(current); + current += 32; + } + l2cc_invalidate_pal(end); + } + cp15_invalidate_dcache_for_dma(start, end); +} + +void l2cc_clean_region(uint32_t start, uint32_t end) +{ + assert(start < end); + uint32_t current = start & ~0x1fUL; + if (l2cc_is_enabled()) { + while (current <= end) { + l2cc_clean_pal(current); + current += 32; + } + l2cc_clean_pal(end); + } + cp15_clean_dcache_for_dma(start, end); +} + +void l2cc_configure(const struct _l2cc_control* cfg) +{ + l2cc_event_config(0, L2CC_ECFGR0_ESRC_SRC_DRHIT, + L2CC_ECFGR0_EIGEN_INT_DIS); + l2cc_event_config(1, L2CC_ECFGR0_ESRC_SRC_DWHIT, + L2CC_ECFGR0_EIGEN_INT_DIS); + + l2cc_enable_reset_counter(L2CC_RESET_BOTH_COUNTER); + l2cc_set_config(cfg); + /* Enable Prefetch */ + l2cc_inst_prefetch_enable(); + l2cc_data_prefetch_enable(); + /* Invalidate whole L2CC */ + l2cc_invalidate_way(0xFF); + /* Disable all L2CC Interrupt */ + l2cc_disable_it(0x1FF); + /* Clear all L2CC Interrupt */ + l2cc_it_clear(0xFF); + l2cc_exclusive_cache(true); + l2cc_enable(); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.h new file mode 100644 index 000000000..14ed53840 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/l2cc.h @@ -0,0 +1,347 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for Level 2 cache (L2CC) controller. + * + */ + +/** \addtogroup l2cc_module L2 Cache Operations + * \ingroup cache_module + * \section Usage + * - Enable or disable L2CC with L2CC_Enable() or L2CC_Disable(). + * - Check if L2CC is enabled with L2CC_IsEnabled(). + * - Enable or disable L2CC interrupt with L2CC_EnableIT() or L2CC_DisableIT(). + * - Enable data or instruction prefetch with L2CC_DataPrefetchEnable() or L2CC_InstPrefetchEnable(). + * + * Related files:\n + * \ref l2cc.h\n + * \ref l2cc.c\n + */ + +#ifndef _L2CC_H +#define _L2CC_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ +#include "chip.h" + +#include + +/*---------------------------------------------------------------------------- + * Define + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define OFFSET_BIT 5 +#define INDEX_BIT 9 +#define TAG_BIT 18 + +#define L2CC_RESET_EVCOUNTER0 0 +#define L2CC_RESET_EVCOUNTER1 1 +#define L2CC_RESET_BOTH_COUNTER 3 + +#define FWA_DEFAULT 0u +#define FWA_NO_ALLOCATE 1u +#define FWA_FORCE_ALLOCATE 2u +#define FWA_INTERNALLY_MAPPED 3u + +/*---------------------------------------------------------------------------- +* Types +*----------------------------------------------------------------------------*/ + +enum _maint_op { + L2CC_DCACHE_CLEAN, + L2CC_DCACHE_INVAL, + L2CC_DCACHE_FLUSH +}; + +struct _latency { + uint8_t setup; + uint8_t read; + uint8_t write; +}; + +struct _ram_latency_control { + struct _latency tag; + struct _latency data; +}; + +/** L2CC structure */ +struct _l2cc_control { + /** High Priority for SO and Dev Reads Enable */ + uint32_t high_prior_so: 1, + /** Store Buffer Device Limitation Enable */ + store_buff_dev_limit: 1, + /** Shared Attribute Invalidate Enable */ + shared_attr_invalidate: 1, + /** Event Monitor Bus Enable */ + evt_mon_bus: 1, + /** Parity Enable */ + parity: 1, + /** Shared Attribute Override Enable */ + shared_attr_override: 1, + /** Force Write Allocate */ + force_write_alloc: 2, + /** Cache Replacement Policy */ + cache_replacement: 1, + /** Non-Secure Lockdown Enable*/ + non_sec_lockdown: 1, + /** Non-Secure Interrupt Access Control */ + it_acces_non_sec: 1, + /** Data Prefetch Enable*/ + data_prefetch: 1, + /** Instruction Prefetch Enable */ + instruct_prefetch: 1, + /** Prefetch Offset */ + offset: 5, + /** Not Same ID on Exclusive Sequence Enable */ + exclusive_seq_same_id: 1, + /** INCR Double Linefill Enable */ + incr_double_linefill: 1, + /** Prefetch Drop Enable*/ + prefetch_drop: 1, + /** Double Linefill on WRAP Read Disable */ + DLFWRDIS: 1, + /** Double linefill Enable */ + double_linefill: 1, + /** Standby Mode Enable */ + standby_mode: 1, + /** Dynamic Clock Gating Enable */ + dyn_clock_gating: 1, + /** Disable Cache Linefill*/ + no_cache_linefill: 1, + /** Disable Write-back, Force Write-through */ + no_write_back: 1; +}; +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Check if Level 2 cache is enable. + */ +extern uint32_t l2cc_is_enabled(void); + +/** + * \brief Enable Level 2 cache. + */ +extern void l2cc_enable(void); + +/** + * \brief Disable Level 2 cache. + */ +extern void l2cc_disable(void); + +/** + * \brief Configures Level 2 cache as exclusive cache. + * \param Enable Enable/disable exclusive cache. + */ +extern void l2cc_exclusive_cache(uint8_t enable); + +/** + * \brief Configures Level 2 cache RAM Latency (Tag and Data). + * \param latencies Structure containing RAM Tag and Data latencies + */ +extern void l2cc_config_lat_ram(struct _ram_latency_control * latencies); + +/** + * \brief Configures Level 2 cache. + * \param cfg Configuration values to put in Auxiliary, prefetch, + * debug and powercontrol registers. + */ +extern void l2cc_set_config(const struct _l2cc_control* cfg); + +/** + * \brief Enables Data prefetch on L2 + */ +extern void l2cc_data_prefetch_enable(void); + +/** + * \brief Enables instruction prefetch on L2 + */ +extern void l2cc_inst_prefetch_enable(void); + +/** + * \brief Enables instruction prefetch on L2 + * \param event_counter Counter of the events. + */ +extern void l2cc_enable_reset_counter(uint8_t event_counter); + +/** + * \brief Configures Event of Level 2 cache. + * \param event_counter Eventcounter 1 or 0 + * \param source Event Genration source + * \param it Event Counter Interrupt Generation condition + */ +extern void l2cc_event_config(uint8_t event_counter, uint8_t source, + uint8_t it); + +/** + * \brief Reads Event Counter value. + * \param event_counter choose Eventcounter 1 or 0 + */ +extern uint32_t l2cc_event_counter_value(uint8_t event_counter); + +/** + * \brief Enable interrupts + * \param sources Interrupt source + */ +extern void l2cc_enable_it(uint16_t sources); + +/** + * \brief Disable interrupts + * \param sources Interrupt source + */ +extern void l2cc_disable_it(uint16_t sources); + +/** + * \brief Enabled interrupt's raw status + * \param sources Interrupt source + */ +extern uint16_t l2cc_it_status_raw(uint16_t sources); + +/** + * \brief Status of masked interrupts + * \param sources Interrupt source + */ +extern uint16_t l2cc_it_status_mask(uint16_t sources); + +/** + * \brief Clear interrupts + * \param sources Interrupt source + */ +extern void l2cc_it_clear(uint16_t sources); + +/** + * \brief Poll SPNIDEN signal + */ +extern uint8_t l2cc_poll_spniden(void); + +/** + * \brief Synchronizes the L2 cache + */ +extern void l2cc_cache_sync(void); + +/** + * \brief Invalidate cache by way + * \param way way number + */ +extern void l2cc_invalidate_way(uint8_t way); + +/** + * \brief Clean cache by way + * \param way way number + */ +extern void l2cc_clean_way(uint8_t way); + +/** + * \brief Invalidate cache by Physical addersse + * \param phys_addr Physical addresse + */ +extern void l2cc_invalidate_pal(uint32_t phys_addr); + +/** + * \brief Clean cache by Physical addersse + * \param phys_addr Physical addresse + */ +extern void l2cc_clean_pal(uint32_t phys_addr); + +/** + * \brief Clean index cache by Physical addersse + * \param phys_addr Physical addresse + */ +extern void l2cc_clean_ix(uint32_t phys_addr); + +/** + * \brief Clean cache by Index + * \param phys_addr Physical addresse + * \param way way number + */ +extern void l2cc_clean_index(uint32_t phys_addr, uint8_t way); + +/** + * \brief Clean Invalidate cache by index + * \param phys_addr Physical address + * \param way way number + */ +extern void l2cc_clean_invalidate_index(uint32_t phys_addr, uint8_t way); + +/** + * \brief cache Data lockdown + * \param way way number + */ +extern void l2cc_data_lockdown(uint8_t way); + +/** + * \brief cache instruction lockdown + * \param way way number + */ +extern void l2cc_instruction_lockdown(uint8_t way); + +/** + * \brief L2 DCache maintenance (clean/invalidate/flush) + * + * \param maintenance Maintenance operation to apply: \sa #_maint_op + */ +extern void l2cc_cache_maintenance(enum _maint_op maintenance); + +/** + * \brief Invalidate cache lines corresponding to a memory region + * + * \param start Beginning of the memory region + * \param end End of the memory region + */ +extern void l2cc_invalidate_region(uint32_t start, uint32_t end); + +/** + * \brief Clean cache lines corresponding to a memory region + * + * \param start Beginning of the memory region + * \param end End of the memory region + */ +extern void l2cc_clean_region(uint32_t start, uint32_t end); + +/** + * \brief Enable level two cache controller (L2CC) + * + * \param cfg configuration to apply: \sa #_l2cc_control + */ +extern void l2cc_configure(const struct _l2cc_control* cfg); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _L2CC_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.c new file mode 100644 index 000000000..d16a460f7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.c @@ -0,0 +1,100 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +#include "peripherals/matrix.h" + +#include + +void matrix_configure_slave_sec(Matrix* mtx, uint8_t slave_id, + uint8_t sel_mask, uint8_t read_mask, + uint8_t write_mask) +{ + mtx->MATRIX_SSR[slave_id] = sel_mask | (read_mask << 8) | + (write_mask << 16); +} + +void matrix_set_slave_split_addr(Matrix* mtx, uint8_t slave_id, + uint8_t area_size, uint8_t mask) +{ + uint8_t i = mask, j = 0; + uint32_t value = 0; + for (i = 1; (i <= mask) && (j < 32); i <<= 1, j += 4) { + if (i & mask) + value |= area_size << j; + } + mtx->MATRIX_SASSR[slave_id] = value; +} + +void matrix_set_slave_region_size(Matrix* mtx, uint8_t slave_id, + uint8_t area_size, uint8_t mask) +{ + assert(slave_id != 0); + uint8_t i = mask, j = 0; + uint32_t value = 0; + for (i = 1; (i <= mask) && (j < 32 ); i <<= 1, j += 4) { + if (i & mask) + value |= area_size << j; + } + mtx->MATRIX_SRTSR[slave_id] = value; +} + +uint8_t matrix_is_peripheral_secured(Matrix* mtx, uint32_t periph_id) +{ + if (mtx->MATRIX_SPSELR[periph_id / 32] & (1 << (periph_id % 32))) { + return 0; + } else { + return 1; + } +} + +void matrix_remove_write_protection(Matrix* mtx) +{ + mtx->MATRIX_WPMR = MATRIX_WPMR_WPKEY_PASSWD; +} + +/** + * \brief Changes the mapping of the chip so that the remap area mirrors the + * internal ROM or the EBI CS0. + */ +void matrix_remap_rom(void) +{ + AXIMX->AXIMX_REMAP = 0; +} + +/** + * \brief Changes the mapping of the chip so that the remap area mirrors the + * internal RAM. + */ + +void matrix_remap_ram(void) +{ + volatile uint32_t i; + AXIMX->AXIMX_REMAP = AXIMX_REMAP_REMAP0; + for(i=1000;--i;); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.h new file mode 100644 index 000000000..641bde801 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/matrix.h @@ -0,0 +1,88 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 MATRIX_HEADER_ +#define MATRIX_HEADER_ + +#include "chip.h" +#include + + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +#define MATRIX_AREA_4K (0x0u) /* 0x1000 */ +#define MATRIX_AREA_8K (0x1u) /* 0x2000 */ +#define MATRIX_AREA_16K (0x2u) /* 0x4000 */ +#define MATRIX_AREA_32K (0x3u) /* 0x8000 */ +#define MATRIX_AREA_64K (0x4u) /* 0x10000 */ +#define MATRIX_AREA_128K (0x5u) /* 0x20000 */ +#define MATRIX_AREA_256K (0x6u) /* 0x40000 */ +#define MATRIX_AREA_512K (0x7u) /* 0x80000 */ +#define MATRIX_AREA_1M (0x8u) /* 0x100000 */ +#define MATRIX_AREA_2M (0x9u) /* 0x200000 */ +#define MATRIX_AREA_4M (0xAu) /* 0x400000 */ +#define MATRIX_AREA_8M (0xBu) /* 0x800000 */ +#define MATRIX_AREA_16M (0xCu) /* 0x1000000 */ +#define MATRIX_AREA_32M (0xDu) /* 0x2000000 */ +#define MATRIX_AREA_64M (0xEu) /* 0x4000000 */ +#define MATRIX_AREA_128M (0xFu) /* 0x8000000 */ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void matrix_configure_slave_sec(Matrix* mtx, uint8_t slave_id, + uint8_t sel_mask, uint8_t read_mask, + uint8_t write_mask); + +extern void matrix_set_slave_split_addr(Matrix* mtx, uint8_t slave_id, + uint8_t area, uint8_t mask); + +extern void matrix_set_slave_region_size(Matrix* mtx, uint8_t slave_id, + uint8_t area, uint8_t mask); + +extern uint8_t matrix_is_peripheral_secured(Matrix* mtx, uint32_t periph_id); + +extern void matrix_remove_write_protection(Matrix* mtx); + +extern void matrix_remap_rom(void); + +extern void matrix_remap_ram(void); + +#ifdef __cplusplus +} +#endif + +#endif /* MATRIX_HEADER_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.c new file mode 100644 index 000000000..b957ed48b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.c @@ -0,0 +1,749 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file + * Implements functions for Controller Area Network with Flexible Data-rate, + * relying on the MCAN peripheral. + */ +/** \addtogroup can_module + *@{*/ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "chip.h" +#include "mcan.h" +#include "pmc.h" + +#include +#include + +/*--------------------------------------------------------------------------- + * Local definitions + *---------------------------------------------------------------------------*/ + +enum mcan_dlc +{ + CAN_DLC_0 = 0, + CAN_DLC_1 = 1, + CAN_DLC_2 = 2, + CAN_DLC_3 = 3, + CAN_DLC_4 = 4, + CAN_DLC_5 = 5, + CAN_DLC_6 = 6, + CAN_DLC_7 = 7, + CAN_DLC_8 = 8, + CAN_DLC_12 = 9, + CAN_DLC_16 = 10, + CAN_DLC_20 = 11, + CAN_DLC_24 = 12, + CAN_DLC_32 = 13, + CAN_DLC_48 = 14, + CAN_DLC_64 = 15 +}; + +/*--------------------------------------------------------------------------- + * Local functions + *---------------------------------------------------------------------------*/ + +/** + * \brief Convert data length to Data Length Code. + * \param len length, in bytes + * \param dlc address where the matching Data Length Code will be written + * \return true if a code matched the provided length, false if this exact + * length is not supported. + */ +static bool get_length_code(uint8_t len, enum mcan_dlc *dlc) +{ + assert(dlc); + + if (len <= 8) { + *dlc = (enum mcan_dlc)len; + return true; + } + if (len % 4) + return false; + len /= 4; + if (len <= 6) { + *dlc = (enum mcan_dlc)(len + 6); + return true; + } + if (len % 4) + return false; + len /= 4; + if (len > 4) + return false; + *dlc = (enum mcan_dlc)(len + 11); + return true; +} + +/** + * \brief Convert Data Length Code to actual data length. + * \param dlc CAN_DLC_xx enum value + * \return Data length, expressed in bytes. + */ +static uint8_t get_data_length(enum mcan_dlc dlc) +{ + assert((dlc == CAN_DLC_0 || dlc > CAN_DLC_0) && dlc <= CAN_DLC_64); + + if (dlc <= CAN_DLC_8) + return (uint8_t)dlc; + if (dlc <= CAN_DLC_24) + return ((uint8_t)dlc - 6) * 4; + return ((uint8_t)dlc - 11) * 16; +} + +/** + * \brief Compute the size of the Message RAM, depending on the application. + * \param set Pointer to a MCAN instance that will be setup accordingly. + * \param cfg MCAN configuration to be considered. Only integer size parameters + * need to be configured. The other parameters can be left blank at this stage. + * \param size address where the required size of the Message RAM will be + * written, expressed in (32-bit) words. + * \return true if successful, false if a parameter is set to an unsupported + * value. + */ +static bool configure_ram(struct mcan_set *set, + const struct mcan_config *cfg, uint32_t *size) +{ + if (cfg->array_size_filt_std > 128 || cfg->array_size_filt_ext > 64 + || cfg->fifo_size_rx0 > 64 || cfg->fifo_size_rx1 > 64 + || cfg->array_size_rx > 64 || cfg->fifo_size_tx_evt > 32 + || cfg->array_size_tx > 32 || cfg->fifo_size_tx > 32 + || cfg->array_size_tx + cfg->fifo_size_tx > 32 + || cfg->buf_size_rx_fifo0 > 64 || cfg->buf_size_rx_fifo1 > 64 + || cfg->buf_size_rx > 64 || cfg->buf_size_tx > 64) + return false; + + set->ram_filt_std = cfg->msg_ram; + *size = (uint32_t)cfg->array_size_filt_std * MCAN_RAM_FILT_STD_SIZE; + set->ram_filt_ext = cfg->msg_ram + *size; + *size += (uint32_t)cfg->array_size_filt_ext * MCAN_RAM_FILT_EXT_SIZE; + set->ram_fifo_rx0 = cfg->msg_ram + *size; + *size += (uint32_t)cfg->fifo_size_rx0 * (MCAN_RAM_BUF_HDR_SIZE + + cfg->buf_size_rx_fifo0 / 4); + set->ram_fifo_rx1 = cfg->msg_ram + *size; + *size += (uint32_t)cfg->fifo_size_rx1 * (MCAN_RAM_BUF_HDR_SIZE + + cfg->buf_size_rx_fifo1 / 4); + set->ram_array_rx = cfg->msg_ram + *size; + *size += (uint32_t)cfg->array_size_rx * (MCAN_RAM_BUF_HDR_SIZE + + cfg->buf_size_rx / 4); + set->ram_fifo_tx_evt = cfg->msg_ram + *size; + *size += (uint32_t)cfg->fifo_size_tx_evt * MCAN_RAM_TX_EVT_SIZE; + set->ram_array_tx = cfg->msg_ram + *size; + *size += (uint32_t)cfg->array_size_tx * (MCAN_RAM_BUF_HDR_SIZE + + cfg->buf_size_tx / 4); + *size += (uint32_t)cfg->fifo_size_tx * (MCAN_RAM_BUF_HDR_SIZE + + cfg->buf_size_tx / 4); + return true; +} + +/*--------------------------------------------------------------------------- + * Exported Functions + *---------------------------------------------------------------------------*/ + +bool mcan_configure_msg_ram(const struct mcan_config *cfg, uint32_t *size) +{ + assert(cfg); + assert(size); + + struct mcan_set tmp_set = { .cfg = { 0 } }; + + return configure_ram(&tmp_set, cfg, size); +} + +bool mcan_initialize(struct mcan_set *set, const struct mcan_config *cfg) +{ + assert(set); + assert(cfg); + assert(cfg->regs); + assert(cfg->msg_ram); + + Mcan *mcan = cfg->regs; + uint32_t *element = NULL, *elem_end = NULL; + uint32_t freq, regVal32; + enum mcan_dlc dlc; + + memset(set, 0, sizeof(*set)); + if (!configure_ram(set, cfg, ®Val32)) + return false; + set->cfg = *cfg; + + /* Configure the MSB of the Message RAM Base Address */ + regVal32 = (uint32_t)cfg->msg_ram >> 16; + if (cfg->id == ID_CAN0_INT0 || cfg->id == ID_CAN0_INT1) + regVal32 = (SFR->SFR_CAN & ~SFR_CAN_EXT_MEM_CAN0_ADDR_Msk) + | SFR_CAN_EXT_MEM_CAN0_ADDR(regVal32); + else + regVal32 = (SFR->SFR_CAN & ~SFR_CAN_EXT_MEM_CAN1_ADDR_Msk) + | SFR_CAN_EXT_MEM_CAN1_ADDR(regVal32); + SFR->SFR_CAN = regVal32; + + /* Reset the CC Control Register */ + mcan->MCAN_CCCR = 0 | MCAN_CCCR_INIT_ENABLED; + + mcan_disable(set); + mcan_reconfigure(set); + + /* Global Filter Configuration: Reject remote frames, reject non-matching frames */ + mcan->MCAN_GFC = MCAN_GFC_RRFE_REJECT | MCAN_GFC_RRFS_REJECT + | MCAN_GFC_ANFE(2) | MCAN_GFC_ANFS(2); + + /* Extended ID Filter AND mask */ + mcan->MCAN_XIDAM = 0x1FFFFFFF; + + /* Interrupt configuration - leave initialization with all interrupts off + * Disable all interrupts */ + mcan->MCAN_IE = 0; + mcan->MCAN_TXBTIE = 0x00000000; + /* All interrupts directed to Line 0 */ + mcan->MCAN_ILS = 0x00000000; + /* Disable both interrupt LINE 0 & LINE 1 */ + mcan->MCAN_ILE = 0x00; + /* Clear all interrupt flags */ + mcan->MCAN_IR = 0xFFCFFFFF; + + /* Configure CAN bit timing */ + if (cfg->bit_rate == 0 + || cfg->quanta_before_sp < 3 || cfg->quanta_before_sp > 257 + || cfg->quanta_after_sp < 1 || cfg->quanta_after_sp > 128 + || cfg->quanta_sync_jump < 1 || cfg->quanta_sync_jump > 128) + return false; + /* Retrieve the frequency of the CAN core clock i.e. the Generated Clock */ + freq = pmc_get_gck_clock(cfg->id); + /* Compute the Nominal Baud Rate Prescaler */ + regVal32 = ROUND_INT_DIV(freq, cfg->bit_rate + * (cfg->quanta_before_sp + cfg->quanta_after_sp)); + if (regVal32 < 1 || regVal32 > 512) + return false; + /* Apply bit timing configuration */ + mcan->MCAN_NBTP = MCAN_NBTP_NBRP(regVal32 - 1) + | MCAN_NBTP_NTSEG1(cfg->quanta_before_sp - 1 - 1) + | MCAN_NBTP_NTSEG2(cfg->quanta_after_sp - 1) + | MCAN_NBTP_NSJW(cfg->quanta_sync_jump - 1); + + /* Configure fast CAN FD bit timing */ + if (cfg->bit_rate_fd < cfg->bit_rate + || cfg->quanta_before_sp_fd < 3 || cfg->quanta_before_sp_fd > 33 + || cfg->quanta_after_sp_fd < 1 || cfg->quanta_after_sp_fd > 16 + || cfg->quanta_sync_jump_fd < 1 || cfg->quanta_sync_jump_fd > 8) + return false; + /* Compute the Fast Baud Rate Prescaler */ + regVal32 = ROUND_INT_DIV(freq, cfg->bit_rate_fd + * (cfg->quanta_before_sp_fd + cfg->quanta_after_sp_fd)); + if (regVal32 < 1 || regVal32 > 32) + return false; + /* Apply bit timing configuration */ + mcan->MCAN_DBTP = MCAN_DBTP_FBRP(regVal32 - 1) + | MCAN_DBTP_DTSEG1(cfg->quanta_before_sp_fd - 1 - 1) + | MCAN_DBTP_DTSEG2(cfg->quanta_after_sp_fd - 1) + | MCAN_DBTP_DSJW(cfg->quanta_sync_jump_fd - 1); + + /* Configure Message RAM starting addresses and element count */ + /* 11-bit Message ID Rx Filters */ + mcan->MCAN_SIDFC = + MCAN_SIDFC_FLSSA((uint32_t)set->ram_filt_std >> 2) + | MCAN_SIDFC_LSS(cfg->array_size_filt_std); + /* 29-bit Message ID Rx Filters */ + mcan->MCAN_XIDFC = + MCAN_XIDFC_FLESA((uint32_t)set->ram_filt_ext >> 2) + | MCAN_XIDFC_LSE(cfg->array_size_filt_ext); + /* Rx FIFO 0 */ + mcan->MCAN_RXF0C = + MCAN_RXF0C_F0SA((uint32_t)set->ram_fifo_rx0 >> 2) + | MCAN_RXF0C_F0S(cfg->fifo_size_rx0) + | MCAN_RXF0C_F0WM(0) + | 0; /* clear MCAN_RXF0C_F0OM */ + /* Rx FIFO 1 */ + mcan->MCAN_RXF1C = + MCAN_RXF1C_F1SA((uint32_t)set->ram_fifo_rx1 >> 2) + | MCAN_RXF1C_F1S(cfg->fifo_size_rx1) + | MCAN_RXF1C_F1WM(0) + | 0; /* clear MCAN_RXF1C_F1OM */ + /* Dedicated Rx Buffers + * Note: the HW does not know (and does not care about) how many + * dedicated Rx Buffers are used by the application. */ + mcan->MCAN_RXBC = + MCAN_RXBC_RBSA((uint32_t)set->ram_array_rx >> 2); + /* Tx Event FIFO */ + mcan->MCAN_TXEFC = + MCAN_TXEFC_EFSA((uint32_t)set->ram_fifo_tx_evt >> 2) + | MCAN_TXEFC_EFS(cfg->fifo_size_tx_evt) + | MCAN_TXEFC_EFWM(0); + /* Tx Buffers */ + mcan->MCAN_TXBC = + MCAN_TXBC_TBSA((uint32_t)set->ram_array_tx >> 2) + | MCAN_TXBC_NDTB(cfg->array_size_tx) + | MCAN_TXBC_TFQS(cfg->fifo_size_tx) + | 0; /* clear MCAN_TXBC_TFQM */ + + /* Configure the size of data fields in Rx and Tx Buffer Elements */ + if (!get_length_code(cfg->buf_size_rx_fifo0, &dlc)) + return false; + regVal32 = MCAN_RXESC_F0DS(dlc < CAN_DLC_8 ? 0 : dlc - CAN_DLC_8); + if (!get_length_code(cfg->buf_size_rx_fifo1, &dlc)) + return false; + regVal32 |= MCAN_RXESC_F1DS(dlc < CAN_DLC_8 ? 0 : dlc - CAN_DLC_8); + if (!get_length_code(cfg->buf_size_rx, &dlc)) + return false; + regVal32 |= MCAN_RXESC_RBDS(dlc < CAN_DLC_8 ? 0 : dlc - CAN_DLC_8); + mcan->MCAN_RXESC = regVal32; + if (!get_length_code(cfg->buf_size_tx, &dlc)) + return false; + mcan->MCAN_TXESC = + MCAN_TXESC_TBDS(dlc < CAN_DLC_8 ? 0 : dlc - CAN_DLC_8); + + /* Configure Message ID Filters + * ...Disable all standard filters */ + for (element = set->ram_filt_std, elem_end = set->ram_filt_std + + (uint32_t)cfg->array_size_filt_std * MCAN_RAM_FILT_STD_SIZE; + element < elem_end; + element += MCAN_RAM_FILT_STD_SIZE) + element[0] = MCAN_RAM_FILT_SFEC_DIS; + /* ...Disable all extended filters */ + for (element = set->ram_filt_ext, elem_end = set->ram_filt_ext + + (uint32_t)cfg->array_size_filt_ext * MCAN_RAM_FILT_EXT_SIZE; + element < elem_end; + element += MCAN_RAM_FILT_EXT_SIZE) + element[0] = MCAN_RAM_FILT_EFEC_DIS; + + mcan->MCAN_NDAT1 = 0xFFFFFFFF; /* clear new (rx) data flags */ + mcan->MCAN_NDAT2 = 0xFFFFFFFF; /* clear new (rx) data flags */ + + regVal32 = mcan->MCAN_CCCR & ~(MCAN_CCCR_BRSE | MCAN_CCCR_FDOE); + mcan->MCAN_CCCR = regVal32 | MCAN_CCCR_PXHD | MCAN_CCCR_BRSE_DISABLED + | MCAN_CCCR_FDOE_DISABLED; + + DSB(); + ISB(); + return true; +} + +void mcan_reconfigure(struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + uint32_t regVal32; + + regVal32 = mcan->MCAN_CCCR & ~MCAN_CCCR_CCE; + assert((regVal32 & MCAN_CCCR_INIT) == MCAN_CCCR_INIT_ENABLED); + /* Enable writing to configuration registers */ + mcan->MCAN_CCCR = regVal32 | MCAN_CCCR_CCE_CONFIGURABLE; +} + +void mcan_set_mode(struct mcan_set *set, enum mcan_can_mode mode) +{ + Mcan *mcan = set->cfg.regs; + uint32_t regVal32; + + regVal32 = mcan->MCAN_CCCR & ~(MCAN_CCCR_BRSE | MCAN_CCCR_FDOE); + switch (mode) { + case MCAN_MODE_CAN: + regVal32 |= MCAN_CCCR_BRSE_DISABLED | MCAN_CCCR_FDOE_DISABLED; + break; + case MCAN_MODE_EXT_LEN_CONST_RATE: + regVal32 |= MCAN_CCCR_BRSE_DISABLED | MCAN_CCCR_FDOE_ENABLED; + break; + case MCAN_MODE_EXT_LEN_DUAL_RATE: + regVal32 |= MCAN_CCCR_BRSE_ENABLED | MCAN_CCCR_FDOE_ENABLED; + break; + default: + return; + } + mcan->MCAN_CCCR = regVal32; +} + +enum mcan_can_mode mcan_get_mode(const struct mcan_set *set) +{ + const uint32_t cccr = set->cfg.regs->MCAN_CCCR; + + if ((cccr & MCAN_CCCR_FDOE) == MCAN_CCCR_FDOE_DISABLED) + return MCAN_MODE_CAN; + if ((cccr & MCAN_CCCR_BRSE) == MCAN_CCCR_BRSE_DISABLED) + return MCAN_MODE_EXT_LEN_CONST_RATE; + return MCAN_MODE_EXT_LEN_DUAL_RATE; +} + +void mcan_init_loopback(struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + + mcan->MCAN_CCCR |= MCAN_CCCR_TEST_ENABLED; +#if 0 + mcan->MCAN_CCCR |= MCAN_CCCR_MON_ENABLED; /* for internal loop back */ +#endif + mcan->MCAN_TEST |= MCAN_TEST_LBCK_ENABLED; +} + +void mcan_set_tx_queue_mode(struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + mcan->MCAN_TXBC |= MCAN_TXBC_TFQM; +} + +void mcan_enable(struct mcan_set *set) +{ + uint32_t index, val; + + /* Depending on bus condition, the HW may switch back to the + * Initialization state, by itself. Therefore, upon timeout, return. + * [Using an arbitrary timeout criterion.] */ + for (index = 0; index < 1024; index++) { + val = set->cfg.regs->MCAN_CCCR; + if ((val & MCAN_CCCR_INIT) == MCAN_CCCR_INIT_DISABLED) + break; + if (index == 0) + set->cfg.regs->MCAN_CCCR = (val & ~MCAN_CCCR_INIT) + | MCAN_CCCR_INIT_DISABLED; + } +} + +void mcan_disable(struct mcan_set *set) +{ + uint32_t val; + bool initial; + + for (initial = true; true; initial = false) { + val = set->cfg.regs->MCAN_CCCR; + if ((val & MCAN_CCCR_INIT) == MCAN_CCCR_INIT_ENABLED) + break; + if (initial) + set->cfg.regs->MCAN_CCCR = (val & ~MCAN_CCCR_INIT) + | MCAN_CCCR_INIT_ENABLED; + } +} + +void mcan_loopback_on(struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + mcan->MCAN_TEST |= MCAN_TEST_LBCK_ENABLED; +} + +void mcan_loopback_off(struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + mcan->MCAN_TEST &= ~MCAN_TEST_LBCK_ENABLED; +} + +void mcan_enable_rx_array_flag(struct mcan_set *set, uint8_t line) +{ + assert(line == 0 || line == 1); + + Mcan *mcan = set->cfg.regs; + if (line) { + mcan->MCAN_ILS |= MCAN_ILS_DRXL; + mcan->MCAN_ILE |= MCAN_ILE_EINT1; + } else { + mcan->MCAN_ILS &= ~MCAN_ILS_DRXL; + mcan->MCAN_ILE |= MCAN_ILE_EINT0; + } + mcan->MCAN_IR = MCAN_IR_DRX; /* clear previous flag */ + mcan->MCAN_IE |= MCAN_IE_DRXE; /* enable it */ +} + +uint8_t * mcan_prepare_tx_buffer(struct mcan_set *set, uint8_t buf_idx, + uint32_t id, uint8_t len) +{ + assert(buf_idx < set->cfg.array_size_tx); + assert(len <= set->cfg.buf_size_tx); + + Mcan *mcan = set->cfg.regs; + uint32_t *pThisTxBuf = 0; + uint32_t val; + const enum mcan_can_mode mode = mcan_get_mode(set); + enum mcan_dlc dlc; + + if (buf_idx >= set->cfg.array_size_tx) + return NULL; + if (!get_length_code(len, &dlc)) + dlc = CAN_DLC_0; + pThisTxBuf = set->ram_array_tx + buf_idx + * (MCAN_RAM_BUF_HDR_SIZE + set->cfg.buf_size_tx / 4); + if (mcan_is_extended_id(id)) + *pThisTxBuf++ = MCAN_RAM_BUF_XTD | MCAN_RAM_BUF_ID_XTD(id); + else + *pThisTxBuf++ = MCAN_RAM_BUF_ID_STD(id); + val = MCAN_RAM_BUF_MM(0) | MCAN_RAM_BUF_DLC((uint32_t)dlc); + if (mode == MCAN_MODE_EXT_LEN_CONST_RATE) + val |= MCAN_RAM_BUF_FDF; + else if (mode == MCAN_MODE_EXT_LEN_DUAL_RATE) + val |= MCAN_RAM_BUF_FDF | MCAN_RAM_BUF_BRS; + *pThisTxBuf++ = val; + /* enable transmit from buffer to set TC interrupt bit in IR, + * but interrupt will not happen unless TC interrupt is enabled */ + mcan->MCAN_TXBTIE = (1 << buf_idx); + return (uint8_t *)pThisTxBuf; /* now it points to the data field */ +} + +void mcan_send_tx_buffer(struct mcan_set *set, uint8_t buf_idx) +{ + Mcan *mcan = set->cfg.regs; + + if (buf_idx < set->cfg.array_size_tx) + mcan->MCAN_TXBAR = (1 << buf_idx); +} + +uint8_t mcan_enqueue_outgoing_msg(struct mcan_set *set, uint32_t id, + uint8_t len, const uint8_t *data) +{ + assert(len <= set->cfg.buf_size_tx); + + Mcan *mcan = set->cfg.regs; + uint32_t val; + uint32_t *pThisTxBuf = 0; + const enum mcan_can_mode mode = mcan_get_mode(set); + enum mcan_dlc dlc; + uint8_t putIdx = 255; + + if (!get_length_code(len, &dlc)) + dlc = CAN_DLC_0; + /* Configured for FifoQ and FifoQ not full? */ + if (set->cfg.fifo_size_tx == 0 || (mcan->MCAN_TXFQS & MCAN_TXFQS_TFQF)) + return putIdx; + putIdx = (uint8_t)((mcan->MCAN_TXFQS & MCAN_TXFQS_TFQPI_Msk) + >> MCAN_TXFQS_TFQPI_Pos); + pThisTxBuf = set->ram_array_tx + (uint32_t) + putIdx * (MCAN_RAM_BUF_HDR_SIZE + set->cfg.buf_size_tx / 4); + if (mcan_is_extended_id(id)) + *pThisTxBuf++ = MCAN_RAM_BUF_XTD | MCAN_RAM_BUF_ID_XTD(id); + else + *pThisTxBuf++ = MCAN_RAM_BUF_ID_STD(id); + val = MCAN_RAM_BUF_MM(0) | MCAN_RAM_BUF_DLC((uint32_t)dlc); + if (mode == MCAN_MODE_EXT_LEN_CONST_RATE) + val |= MCAN_RAM_BUF_FDF; + else if (mode == MCAN_MODE_EXT_LEN_DUAL_RATE) + val |= MCAN_RAM_BUF_FDF | MCAN_RAM_BUF_BRS; + *pThisTxBuf++ = val; + memcpy(pThisTxBuf, data, len); + /* enable transmit from buffer to set TC interrupt bit in IR, + * but interrupt will not happen unless TC interrupt is enabled + */ + mcan->MCAN_TXBTIE = (1 << putIdx); + /* request to send */ + mcan->MCAN_TXBAR = (1 << putIdx); + return putIdx; +} + +bool mcan_is_buffer_sent(const struct mcan_set *set, uint8_t buf_idx) +{ + Mcan *mcan = set->cfg.regs; + return mcan->MCAN_TXBTO & (1 << buf_idx) ? true : false; +} + +void mcan_filter_single_id(struct mcan_set *set, + uint8_t buf_idx, uint8_t filter, uint32_t id) +{ + assert(buf_idx < set->cfg.array_size_rx); + assert(id & CAN_EXT_MSG_ID ? filter < set->cfg.array_size_filt_ext + : filter < set->cfg.array_size_filt_std); + assert(id & CAN_EXT_MSG_ID ? (id & ~CAN_EXT_MSG_ID) <= 0x1fffffff : + id <= 0x7ff); + + uint32_t *pThisRxFilt = 0; + + if (buf_idx >= set->cfg.array_size_rx) + return; + if (mcan_is_extended_id(id)) { + pThisRxFilt = set->ram_filt_ext + filter + * MCAN_RAM_FILT_EXT_SIZE; + *pThisRxFilt++ = MCAN_RAM_FILT_EFEC_BUF + | MCAN_RAM_FILT_EFID1(id); + *pThisRxFilt = MCAN_RAM_FILT_EFID2_BUF + | MCAN_RAM_FILT_EFID2_BUF_IDX(buf_idx); + } else { + pThisRxFilt = set->ram_filt_std + filter + * MCAN_RAM_FILT_STD_SIZE; + *pThisRxFilt = MCAN_RAM_FILT_SFEC_BUF + | MCAN_RAM_FILT_SFID1(id) + | MCAN_RAM_FILT_SFID2_BUF + | MCAN_RAM_FILT_SFID2_BUF_IDX(buf_idx); + } +} + +void mcan_filter_id_mask(struct mcan_set *set, uint8_t fifo, uint8_t filter, + uint32_t id, uint32_t mask) +{ + assert(fifo == 0 || fifo == 1); + assert(id & CAN_EXT_MSG_ID ? filter < set->cfg.array_size_filt_ext + : filter < set->cfg.array_size_filt_std); + assert(id & CAN_EXT_MSG_ID ? (id & ~CAN_EXT_MSG_ID) <= 0x1fffffff : + id <= 0x7ff); + assert(id & CAN_EXT_MSG_ID ? mask <= 0x1fffffff : mask <= 0x7ff); + + uint32_t *pThisRxFilt = 0; + uint32_t val; + + if (mcan_is_extended_id(id)) { + pThisRxFilt = set->ram_filt_ext + filter + * MCAN_RAM_FILT_EXT_SIZE; + *pThisRxFilt++ = (fifo ? MCAN_RAM_FILT_EFEC_FIFO1 + : MCAN_RAM_FILT_EFEC_FIFO0) | MCAN_RAM_FILT_EFID1(id); + *pThisRxFilt = MCAN_RAM_FILT_EFT_CLASSIC + | MCAN_RAM_FILT_EFID2(mask); + } else { + pThisRxFilt = set->ram_filt_std + filter + * MCAN_RAM_FILT_STD_SIZE; + val = MCAN_RAM_FILT_SFT_CLASSIC + | MCAN_RAM_FILT_SFID1(id) + | MCAN_RAM_FILT_SFID2(mask); + *pThisRxFilt = (fifo ? MCAN_RAM_FILT_SFEC_FIFO1 + : MCAN_RAM_FILT_SFEC_FIFO0) | val; + } +} + +bool mcan_rx_buffer_data(const struct mcan_set *set, uint8_t buf_idx) +{ + Mcan *mcan = set->cfg.regs; + + if (buf_idx < 32) + return mcan->MCAN_NDAT1 & (1 << buf_idx) ? true : false; + else if (buf_idx < 64) + return mcan->MCAN_NDAT2 & (1 << (buf_idx - 32)) ? true : false; + else + return false; +} + +void mcan_read_rx_buffer(struct mcan_set *set, uint8_t buf_idx, + struct mcan_msg_info *msg) +{ + assert(buf_idx < set->cfg.array_size_rx); + + Mcan *mcan = set->cfg.regs; + const uint32_t *pThisRxBuf = 0; + uint32_t tempRy; /* temp copy of RX buffer word */ + uint8_t len; + + if (buf_idx >= set->cfg.array_size_rx) { + msg->id = 0; + msg->timestamp = 0; + msg->full_len = 0; + msg->data_len = 0; + return; + } + pThisRxBuf = set->ram_array_rx + (buf_idx + * (MCAN_RAM_BUF_HDR_SIZE + set->cfg.buf_size_rx / 4)); + tempRy = *pThisRxBuf++; /* word R0 contains ID */ + if (tempRy & MCAN_RAM_BUF_XTD) + msg->id = CAN_EXT_MSG_ID | (tempRy & MCAN_RAM_BUF_ID_XTD_Msk) + >> MCAN_RAM_BUF_ID_XTD_Pos; + else + msg->id = (tempRy & MCAN_RAM_BUF_ID_STD_Msk) + >> MCAN_RAM_BUF_ID_STD_Pos; + tempRy = *pThisRxBuf++; /* word R1 contains DLC & time stamp */ + msg->full_len = len = get_data_length((enum mcan_dlc) + ((tempRy & MCAN_RAM_BUF_DLC_Msk) >> MCAN_RAM_BUF_DLC_Pos)); + msg->timestamp = (tempRy & MCAN_RAM_BUF_RXTS_Msk) + >> MCAN_RAM_BUF_RXTS_Pos; + if (msg->data) { + /* copy the data from the Rx Buffer Element to the + * application-owned buffer */ + if (len > set->cfg.buf_size_rx) + len = set->cfg.buf_size_rx; + if (len > msg->data_len) + len = msg->data_len; + memcpy(msg->data, pThisRxBuf, len); + msg->data_len = len; + } + else + msg->data_len = 0; + /* clear the new data flag for the buffer */ + if (buf_idx < 32) + mcan->MCAN_NDAT1 = (1 << buf_idx); + else + mcan->MCAN_NDAT2 = (1 << (buf_idx - 32)); +} + +uint8_t mcan_dequeue_received_msg(struct mcan_set *set, uint8_t fifo, + struct mcan_msg_info *msg) +{ + assert(fifo == 0 || fifo == 1); + + Mcan *mcan = set->cfg.regs; + uint32_t *pThisRxBuf = 0; + uint32_t tempRy; /* temp copy of RX buffer word */ + uint8_t buf_elem_data_size, len; + uint32_t *fifo_ack_reg; + uint32_t get_index; + uint8_t fill_level = 0; /* default: fifo empty */ + + if (fifo) { + get_index = (mcan->MCAN_RXF1S & MCAN_RXF1S_F1GI_Msk) >> + MCAN_RXF1S_F1GI_Pos; + fill_level = (uint8_t)((mcan->MCAN_RXF1S & MCAN_RXF1S_F1FL_Msk) + >> MCAN_RXF1S_F1FL_Pos); + pThisRxBuf = set->ram_fifo_rx1; + buf_elem_data_size = set->cfg.buf_size_rx_fifo1; + fifo_ack_reg = (uint32_t *) & mcan->MCAN_RXF1A; + } else { + get_index = (mcan->MCAN_RXF0S & MCAN_RXF0S_F0GI_Msk) + >> MCAN_RXF0S_F0GI_Pos; + fill_level = (uint8_t)((mcan->MCAN_RXF0S & MCAN_RXF0S_F0FL_Msk) + >> MCAN_RXF0S_F0FL_Pos); + pThisRxBuf = set->ram_fifo_rx0; + buf_elem_data_size = set->cfg.buf_size_rx_fifo0; + fifo_ack_reg = (uint32_t *) & mcan->MCAN_RXF0A; + } + + if (fill_level == 0) + return 0; + + pThisRxBuf += get_index * (MCAN_RAM_BUF_HDR_SIZE + buf_elem_data_size + / 4); + tempRy = *pThisRxBuf++; /* word R0 contains ID */ + if (tempRy & MCAN_RAM_BUF_XTD) + msg->id = CAN_EXT_MSG_ID | (tempRy & MCAN_RAM_BUF_ID_XTD_Msk) + >> MCAN_RAM_BUF_ID_XTD_Pos; + else + msg->id = (tempRy & MCAN_RAM_BUF_ID_STD_Msk) + >> MCAN_RAM_BUF_ID_STD_Pos; + tempRy = *pThisRxBuf++; /* word R1 contains DLC & timestamps */ + msg->full_len = len = get_data_length((enum mcan_dlc) + ((tempRy & MCAN_RAM_BUF_DLC_Msk) >> MCAN_RAM_BUF_DLC_Pos)); + msg->timestamp = (tempRy & MCAN_RAM_BUF_RXTS_Msk) + >> MCAN_RAM_BUF_RXTS_Pos; + if (msg->data) { + /* copy the data from the Rx Buffer Element to the + * application-owned buffer */ + if (len > buf_elem_data_size) + len = buf_elem_data_size; + if (len > msg->data_len) + len = msg->data_len; + memcpy(msg->data, pThisRxBuf, len); + msg->data_len = len; + } + else + msg->data_len = 0; + /* acknowledge reading the fifo entry */ + *fifo_ack_reg = get_index; + /* return entries remaining in FIFO */ + return (fill_level); +} + +/**@}*/ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.h new file mode 100644 index 000000000..23dc63f0a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mcan.h @@ -0,0 +1,439 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * Controller Area Network with Flexible Data-rate. + * Interface for configuring and using the MCAN peripheral. + */ + +#ifndef _MCAN_H_ +#define _MCAN_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +enum mcan_can_mode +{ + /* ISO 11898-1 CAN mode */ + MCAN_MODE_CAN, + + /* Long CAN FD frame. + * - TX and RX payloads up to 64 bytes. + * - Slow transmitter: TX frames are sent at constant bit rate. + * - Fast receiver: both constant-rate (slow) and dual-rate (fast) + * RX frames are supported and received. */ + MCAN_MODE_EXT_LEN_CONST_RATE, + + /* Long and fast CAN FD frame. + * - TX and RX payloads up to 64 bytes. + * - Fast transmitter: control, data and CRC fields are transmitted at a + * higher bit rate. + * - Fast receiver. */ + MCAN_MODE_EXT_LEN_DUAL_RATE, +}; + +/* Flag signalling a standard (11-bit) message identifiers */ +#define CAN_STD_MSG_ID (0x0u << 30) +/* Flag to be bitwise or'ed to extended (29-bit) message identifiers */ +#define CAN_EXT_MSG_ID (0x1u << 30) + +struct mcan_msg_info +{ + uint32_t id; + uint32_t timestamp; + uint8_t *data; + uint8_t full_len; + uint8_t data_len; +}; + +struct mcan_config +{ + uint32_t id; /* peripheral ID (ID_xxx) */ + Mcan *regs; /* set of MCAN hardware registers */ + uint32_t *msg_ram; /* base address of the Message RAM to be + * assigned to this MCAN instance */ + + uint8_t array_size_filt_std; /* # of 11-bit Message ID Rx Filters */ + uint8_t array_size_filt_ext; /* # of 29-bit Message ID Rx Filters */ + uint8_t fifo_size_rx0; /* # of Rx Buffers in Rx FIFO 0 */ + uint8_t fifo_size_rx1; /* # of Rx Buffers in Rx FIFO 1 */ + uint8_t array_size_rx; /* # of dedicated Rx Buffers */ + uint8_t fifo_size_tx_evt; /* # of Tx Event Elements in the Tx Event + * FIFO */ + uint8_t array_size_tx; /* # of dedicated Tx Buffers */ + uint8_t fifo_size_tx; /* # of Tx Buffers in the Tx FIFO or Tx + * Queue */ + + uint8_t buf_size_rx_fifo0; /* size of the data field in each Rx + * Buffer of Rx FIFO 0, in bytes */ + uint8_t buf_size_rx_fifo1; /* size of the data field in each Rx + * Buffer of Rx FIFO 1, in bytes */ + uint8_t buf_size_rx; /* size of the data field in each + * dedicated Rx Buffer, in bytes */ + uint8_t buf_size_tx; /* size of the data field in each Tx + * Buffer, in bytes. Applies to all Tx + * Buffers, dedicated and in Tx FIFO / + * Queue. */ + + uint32_t bit_rate; /* requested CAN bit rate in CAN mode, + * in bps */ + uint16_t quanta_before_sp; /* duration of the time segment before the + * sample point (Sync_Seg + Prop_Seg + + * Phase_Seg1), while in CAN mode, + * expressed in CAN time quanta */ + uint8_t quanta_after_sp; /* duration of the time segment after the + * sample point (Phase_Seg2), while in CAN + * mode, expressed in CAN time quanta */ + + uint32_t bit_rate_fd; /* requested CAN bit rate in fast CAN FD + * mode, in bps */ + uint8_t quanta_before_sp_fd; /* duration of the time segment before the + * sample point (Sync_Seg + Prop_Seg + + * Phase_Seg1), while in fast CAN FD mode, + * expressed in CAN time quanta */ + uint8_t quanta_after_sp_fd; /* duration of the time segment after the + * sample point (Phase_Seg2), while in + * fast CAN FD mode, expressed in CAN time + * quanta */ + + uint8_t quanta_sync_jump; /* duration of a (re)synchronization jump, + * while in CAN mode, expressed in CAN + * time quanta */ + uint8_t quanta_sync_jump_fd; /* duration of a (re)synchronization jump, + * while in fast CAN FD mode, expressed in + * CAN time quanta */ +}; + +/* This structure is private to the MCAN Driver. + * Allocate it but ignore its members. */ +struct mcan_set +{ + struct mcan_config cfg; + uint32_t *ram_filt_std; + uint32_t *ram_filt_ext; + uint32_t *ram_fifo_rx0; + uint32_t *ram_fifo_rx1; + uint32_t *ram_array_rx; + uint32_t *ram_fifo_tx_evt; + uint32_t *ram_array_tx; +}; + +/*---------------------------------------------------------------------------- + * Exported symbols + *----------------------------------------------------------------------------*/ + +static inline bool mcan_is_enabled(const struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + return ((mcan->MCAN_CCCR & MCAN_CCCR_INIT) == MCAN_CCCR_INIT_DISABLED); +} + +static inline bool mcan_is_extended_id(uint32_t msg_id) +{ + return msg_id & CAN_EXT_MSG_ID ? true : false; +} + +static inline uint32_t mcan_get_id(uint32_t msg_id) +{ + return msg_id & CAN_EXT_MSG_ID ? msg_id & 0x1fffffff : msg_id & 0x7ff; +} + +static inline bool mcan_is_tx_complete(const struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + return mcan->MCAN_IR & MCAN_IR_TC ? true : false; +} + +static inline void mcan_clear_tx_flag(const struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + mcan->MCAN_IR = MCAN_IR_TC; +} + +static inline bool mcan_rx_array_data(const struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + return mcan->MCAN_IR & MCAN_IR_DRX ? true : false; +} + +static inline void mcan_clear_rx_array_flag(const struct mcan_set *set) +{ + Mcan *mcan = set->cfg.regs; + mcan->MCAN_IR = MCAN_IR_DRX; +} + +static inline bool mcan_rx_fifo_data(const struct mcan_set *set, uint8_t fifo) +{ + assert(fifo == 0 || fifo == 1); + + Mcan *mcan = set->cfg.regs; + + return mcan->MCAN_IR & (fifo ? MCAN_IR_RF1N : MCAN_IR_RF0N) ? true + : false; +} + +static inline void mcan_clear_rx_fifo_flag(const struct mcan_set *set, + uint8_t fifo) +{ + assert(fifo == 0 || fifo == 1); + + Mcan *mcan = set->cfg.regs; + + mcan->MCAN_IR = fifo ? MCAN_IR_RF1N : MCAN_IR_RF0N; +} + +/** + * \brief Compute the size of the Message RAM to be assigned to the MCAN. + * \param cfg MCAN configuration to be considered. Only integer size parameters + * need to be configured. The other parameters can be left blank at this stage. + * \param size address where the required size of the Message RAM will be + * written, expressed in (32-bit) words. + * \return true if successful, false if a parameter is set to an unsupported + * value. + */ +bool mcan_configure_msg_ram(const struct mcan_config *cfg, uint32_t *size); + +/** + * \brief Initialize the MCAN hardware for the given peripheral. + * Default: Non-FD, ISO 11898-1 CAN mode; mixed mode TX Buffer + FIFO. + * \param set Pointer to uninitialized driver instance data. + * \param cfg MCAN configuration to be used. + * \return true if successful, false if a parameter is set to an unsupported + * value. + */ +bool mcan_initialize(struct mcan_set *set, const struct mcan_config *cfg); + +/** + * \brief Unlock the peripheral configuration so it can be altered. + * Prerequisite: the peripheral shall be disabled. In case the device has been + * enabled, call mcan_disable. + * \param set Pointer to driver instance data. + */ +void mcan_reconfigure(struct mcan_set *set); + +/** + * \brief Select either the legacy ISO 11898-1 CAN mode or the CAN-FD mode, + * along with the FD variant in the latter case. + * Should be called further to mcan_initialize() or mcan_reconfigure(), before + * mcan_enable(). + * \param set Pointer to driver instance data. + * \param mode CAN mode, and FD variant in case of FD mode. + */ +void mcan_set_mode(struct mcan_set *set, enum mcan_can_mode mode); + +/** + * \brief Query the current CAN mode. + * \param set Pointer to driver instance data. + * \return Currently selected CAN mode, and FD variant in case of CAN FD mode. + */ +enum mcan_can_mode mcan_get_mode(const struct mcan_set *set); + +/** + * \brief Select the TX Queue mode, disable TX FIFO mode. + * INIT must be set - so this should be called between mcan_initialize() and + * mcan_enable(). + * \param set Pointer to driver instance data. + */ +void mcan_set_tx_queue_mode(struct mcan_set *set); + +/** + * \brief Initialize the MCAN in loop back mode. + * INIT must be set - so this should be called between mcan_initialize() and + * mcan_enable(). + * \param set Pointer to driver instance data. + */ +void mcan_init_loopback(struct mcan_set *set); + +/** + * \brief Enable the peripheral I/O stage. Synchronize with the bus. + * INIT must be set - so this should be called after mcan_initialize(). + * \param set Pointer to driver instance data. + */ +void mcan_enable(struct mcan_set *set); + +/** + * \brief Disable the peripheral I/O stage. Go Bus_Off. + * \note Subsequent operations may include reconfiguring the peripheral + * (mcan_reconfigure) and/or re-enabling it (mcan_enable). + * \param set Pointer to driver instance data. + */ +void mcan_disable(struct mcan_set *set); + +/** + * \brief Turn the loop-back mode ON. + * \note TEST must be set in MCAN_CCCR. This mode should have been enabled upon + * initialization. + * \param set Pointer to driver instance data. + */ +void mcan_loopback_on(struct mcan_set *set); + +/** + * \brief Turn the loop-back mode OFF. + * \param set Pointer to driver instance data. + */ +void mcan_loopback_off(struct mcan_set *set); + +/** + * \brief Select either the m_can_int0 or the m_can_int1 interrupt line. + * Also, enable the 'Message stored to Dedicated Receive Buffer' specific + * interrupt. + * \param set Pointer to driver instance data. + * \param int_line The interrupt line to be enabled: + * 0 -> m_can_int0 + * 1 -> m_can_int1. + */ +void mcan_enable_rx_array_flag(struct mcan_set *set, uint8_t int_line); + +/** + * \brief Configure a Dedicated TX Buffer. + * \param set Pointer to driver instance data. + * \param buf_idx Index of the dedicated transmit buffer to be used. + * \param id Message ID. + * \param len Data length, in bytes. + * \return Address of data byte 0, part of the transmit buffer. + */ +uint8_t * mcan_prepare_tx_buffer(struct mcan_set *set, uint8_t buf_idx, + uint32_t id, uint8_t len); + +/** + * \brief Start the transmission of a Dedicated TX Buffer. + * \param set Pointer to driver instance data. + * \param buf_idx Index of the dedicated transmit buffer to be used. + */ +void mcan_send_tx_buffer(struct mcan_set *set, uint8_t buf_idx); + +/** + * \brief Append the provided message to the TX FIFO, or to the TX Queue, + * depending on whether mcan_set_tx_queue_mode() has been invoked or not. + * \param set Pointer to driver instance data. + * \param id Message ID. + * \param len Data length, in bytes. + * \param data Pointer to data. + * \return Index of the assigned transmit buffer, part of the FIFO / queue. + * Or 0xff if the TX FIFO / queue was full, or an error occurred. + */ +uint8_t mcan_enqueue_outgoing_msg(struct mcan_set *set, uint32_t id, + uint8_t len, const uint8_t *data); + +/** + * \brief Check if message transmitted from the specified TX Buffer, either + * dedicated or part of the TX FIFO or TX Queue. + * \param set Pointer to driver instance data. + * \param buf_idx Index of the transmit buffer to be queried. + * \return true if the message has been successfully transmitted, false + * otherwise. + */ +bool mcan_is_buffer_sent(const struct mcan_set *set, uint8_t buf_idx); + +/** + * \brief Configure RX buffer filter. + * \param set Pointer to driver instance data. + * \param buf_idx Index of the receive buffer to be used as the recipient. + * \param filter Index of the filter to be configured. + * \param id Single message identifier. Incoming message need to match exactly + * to be accepted. + */ +void mcan_filter_single_id(struct mcan_set *set, uint8_t buf_idx, + uint8_t filter, uint32_t id); + +/** + * \brief Configure classic RX filter. + * The classic filters direct the accepted messages to a FIFO, and include both + * an ID and an ID mask. + * \param set Pointer to driver instance data. + * \param fifo Index of the RX FIFO to be used as the recipient. + * \param filter Index of the filter to be configured. + * \param id Message identifier. + * \param mask Message identifier mask to be matched. + */ +void mcan_filter_id_mask(struct mcan_set *set, uint8_t fifo, uint8_t filter, + uint32_t id, uint32_t mask); + +/** + * \brief Check whether some data has been received into the specified RX + * Buffer. + * \param set Pointer to driver instance data. + * \param buf_idx Index of the receive buffer to be queried. + * \return true if the receive buffer is flagged as containing an unfetched + * frame, and false otherwise. + */ +bool mcan_rx_buffer_data(const struct mcan_set *set, uint8_t buf_idx); + +/** + * \brief Get RX buffer. + * \param set Pointer to driver instance data. + * \param buf_idx Index of the receive buffer to be read. + * \param msg Address where the CAN message properties will be written. + * The msg->data and msg->data_len parameters shall be initialized prior to + * calling this function. Message contents will be copied to msg->data if + * msg->data is not null and if msg->data_len is large enough. + */ +void mcan_read_rx_buffer(struct mcan_set *set, uint8_t buf_idx, + struct mcan_msg_info *msg); + +/** + * \brief Detach one received message from the specified RX FIFO, and copy it to + * a buffer owned by the application. + * \param set Pointer to driver instance data. + * \param fifo Index of the RX FIFO to dequeue from. + * \param msg Address where the CAN message properties will be written. + * The msg->data and msg->data_len parameters shall be initialized prior to + * calling this function. Message contents will be copied to msg->data if + * msg->data is not null and if msg->data_len is large enough. + * \return: # of FIFO entries at the time the function was entered: + * 0 -> The FIFO was initially empty. + * 1 -> The FIFO had 1 entry upon entry, but is empty upon exit. + * 2 to 64 -> The FIFO had several entries upon entry, and still holds one + * or more entries upon exit. + */ +uint8_t mcan_dequeue_received_msg(struct mcan_set *set, uint8_t fifo, + struct mcan_msg_info *msg); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifndef _MCAN_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.c new file mode 100644 index 000000000..8b92b0831 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.c @@ -0,0 +1,359 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +#include "chip.h" +#include "peripherals/mpddrc.h" +#include "peripherals/sfrbu.h" +#include "peripherals/pmc.h" +#include "trace.h" +#include "timer.h" +#include "compiler.h" +#include + +static void _set_ddr_timings(struct _mpddrc_desc* desc) +{ + MPDDRC->MPDDRC_TPR0 = desc->tpr0; + MPDDRC->MPDDRC_TPR1 = desc->tpr1; + MPDDRC->MPDDRC_TPR2 = desc->tpr2; +} + +static uint32_t _compute_ba_offset(void) +{ + /* Compute BA[] offset according to CR configuration */ + uint32_t offset = (MPDDRC->MPDDRC_CR & MPDDRC_CR_NC_Msk) + 9; + if (!(MPDDRC->MPDDRC_CR & MPDDRC_CR_DECOD_INTERLEAVED)) + offset += ((MPDDRC->MPDDRC_CR & MPDDRC_CR_NR_Msk) >> 2) + 11; + + offset += (MPDDRC->MPDDRC_MD & MPDDRC_MD_DBW) ? 1 : 2; + + return offset; +} + +/** + * \brief Send a NOP command + */ +static void _send_nop_cmd(void) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_NOP_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0; +} + +static void _send_lmr_cmd(void) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_LMR_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0u; +} + +static void _send_ext_lmr_cmd(uint32_t opcode, uint32_t ba_offset) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_EXT_LMR_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)(DDR_CS_ADDR + (opcode << ba_offset))) = 0u; +} + +static void _send_normal_cmd(void) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_NORMAL_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0; +} + +static void _send_precharge_cmd(void) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_PRCGALL_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0; +} + +static void _send_refresh_cmd(void) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_RFSH_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0; +} + +#ifdef CONFIG_HAVE_DDR3 + +static void _send_calib_cmd(void) +{ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_DEEP_CALIB_MD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0; +} + +static void _configure_ddr3(struct _mpddrc_desc* desc) +{ + /* Timings */ + _set_ddr_timings(desc); + uint32_t ba_offset = _compute_ba_offset(); + + /* + * Step 3: Issue a NOP command to the memory controller using + * its mode register (MPDDRC_MR). + */ + _send_nop_cmd(); + + /* + * Step 4: A pause of at least 500us must be observed before a + * single toggle. + */ + timer_sleep(50); + /* + * Step 5: Issue a NOP command to the memory controller using + * its mode register (MPDDRC_MR). CKE is now driven high. + */ + _send_nop_cmd(); + timer_sleep(1); + /* + * Step 6: Issue Extended Mode Register Set 2 (EMRS2) cycle to + * choose between commercial or high temperature + * operations. + */ + _send_ext_lmr_cmd(0x2, ba_offset); + timer_sleep(1); + /* + * Step 7: Issue Extended Mode Register Set 3 (EMRS3) cycle to set + * the Extended Mode Register to 0. + */ + _send_ext_lmr_cmd(0x3, ba_offset); + timer_sleep(1); + /* + * Step 8: Issue Extended Mode Register Set 1 (EMRS1) cycle to + * disable and to program O.D.S. (Output Driver Strength). + */ + _send_ext_lmr_cmd(0x1, ba_offset); + timer_sleep(1); + /* + * Step 9: Write a one to the DLL bit (enable DLL reset) in the MPDDRC + * Configuration Register (MPDDRC_CR) + */ + /* Not done for DDR3 */ + + /* + * Step 10: Issue a Mode Register Set (MRS) cycle to reset DLL. + */ + _send_lmr_cmd(); + timer_sleep(5); + /* + * Step 11: Issue a Calibration command (MRS) cycle to calibrate RTT and + * RON values for the Process Voltage Temperature (PVT). + */ + _send_calib_cmd(); + timer_sleep(1); + + /* + * Step 12: A Normal Mode command is provided. + * Program the Normal mode in the MPDDRC_MR and perform a write access + * to any DDR3-SDRAM address to acknowledge this command. + */ + _send_normal_cmd(); + /* + * Step 13: Perform a write access to any DDR3-SDRAM address. + */ + *((uint32_t *)(DDR_CS_ADDR)) = 0; +} + +#endif + +static void _configure_ddr2(struct _mpddrc_desc* desc) +{ + /* Timings */ + _set_ddr_timings(desc); + uint32_t ba_offset = _compute_ba_offset(); + + /* Step 3: An NOP command is issued to the DDR2-SDRAM. Program + * the NOP command into the Mode Register and wait minimum 200 + * us */ + _send_nop_cmd(); + timer_sleep(20); + + /* Step 4: Issue a NOP command. */ + _send_nop_cmd(); + timer_sleep(1); + + /* Step 5: Issue all banks precharge command. */ + _send_precharge_cmd(); + timer_sleep(1); + + /* Step 6: Issue an Extended Mode Register set (EMRS2) cycle + * to chose between commercialor high temperature + * operations. */ + _send_ext_lmr_cmd(0x2, ba_offset); + timer_sleep(1); + + /* Step 7: Issue an Extended Mode Register set (EMRS3) cycle + * to set all registers to 0. */ + _send_ext_lmr_cmd(0x3, ba_offset); + timer_sleep(1); + + /* Step 8: Issue an Extended Mode Register set (EMRS1) cycle + * to enable DLL. */ + _send_ext_lmr_cmd(0x1, ba_offset); + timer_sleep(1); + + /* Step 9: Program DLL field into the Configuration Register. */ + MPDDRC->MPDDRC_CR |= MPDDRC_CR_DLL_RESET_ENABLED; + + /* Step 10: A Mode Register set (MRS) cycle is issued to reset DLL. */ + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_LMR_CMD; + /* Perform a write to a DDR memory access to acknoledge the command */ + *((uint32_t *)DDR_CS_ADDR) = 0; + + timer_sleep(1); + + /* Step 11: Issue all banks precharge command to the DDR2-SDRAM. */ + _send_precharge_cmd(); + timer_sleep(1); + + /* Step 12: Two auto-refresh (CBR) cycles are + * provided. Program the auto refresh command (CBR) into the + * Mode Register. */ + _send_refresh_cmd(); + timer_sleep(1); + _send_refresh_cmd(); + timer_sleep(1); + + /* Step 13: Program DLL field into the Configuration Register + * to low(Disable DLL reset). */ + MPDDRC->MPDDRC_CR &= ~MPDDRC_CR_DLL_RESET_ENABLED; + + /* Step 14: Issue a Mode Register set (MRS) cycle to program + * the parameters of the DDR2-SDRAM devices. */ + _send_lmr_cmd(); + timer_sleep(1); + + /* Step 15: Program OCD field into the Configuration Register + * to high (OCD calibration default). */ + MPDDRC->MPDDRC_CR |= MPDDRC_CR_OCD_DDR2_DEFAULT_CALIB; + + /* Step 16: An Extended Mode Register set (EMRS1) cycle is + * issued to OCD default value. */ + _send_ext_lmr_cmd(0x1, ba_offset); + timer_sleep(1); + + /* Step 19,20: A mode Normal command is provided. Program the + * Normal mode into Mode Register. */ + _send_normal_cmd(); + timer_sleep(1); +} + +extern void mpddrc_configure(struct _mpddrc_desc* desc) +{ + /* Retrieve the current resolution to put it back later */ + uint32_t resolution = timer_get_resolution(); + /* Configure time to have 10 microseconds resolution */ + timer_configure(10); + + /* controller and DDR clock */ + pmc_enable_peripheral(ID_MPDDRC); + pmc_enable_system_clock(PMC_SYSTEM_CLOCK_DDR); + + /* Step1: Program memory device type */ + MPDDRC->MPDDRC_MD = desc->mode; + + /* set driver impedance */ + uint32_t value = MPDDRC->MPDDRC_IO_CALIBR; + value &= ~MPDDRC_IO_CALIBR_RDIV_Msk; + value &= ~MPDDRC_IO_CALIBR_TZQIO_Msk; + value &= ~MPDDRC_IO_CALIBR_CALCODEP_Msk; + value &= ~MPDDRC_IO_CALIBR_CALCODEN_Msk; + value |= desc->io_calibr; + MPDDRC->MPDDRC_IO_CALIBR = value; + + MPDDRC->MPDDRC_RD_DATA_PATH = desc->data_path; + + /* Step 2: Program features of the DDR3-SDRAM device in the + * configuration register and timing parameter registers (TPR0 + * ans TPR1) */ + + /* Configurations */ + MPDDRC->MPDDRC_CR = desc->control; + +#ifdef CONFIG_HAVE_DDR3_SELFREFRESH + if (sfrbu_is_ddr_backup_enabled()) + /* DDR memory had been initilized and in backup mode */ + MPDDRC->MPDDRC_LPR = + MPDDRC_LPR_LPCB_SELFREFRESH | + MPDDRC_LPR_CLK_FR_ENABLED | + MPDDRC_LPR_PASR(0) | + MPDDRC_LPR_DS(2) | + MPDDRC_LPR_TIMEOUT_NONE | + MPDDRC_LPR_APDE_DDR2_FAST_EXIT | + MPDDRC_LPR_UPD_MR(0); + else + /* DDR memory is not in backup mode */ + MPDDRC->MPDDRC_LPR = + MPDDRC_LPR_LPCB_SELFREFRESH | + MPDDRC_LPR_CLK_FR_ENABLED | + MPDDRC_LPR_PASR(0) | + MPDDRC_LPR_DS(2) | + MPDDRC_LPR_TIMEOUT_DELAY_128_CLK | + MPDDRC_LPR_APDE_DDR2_SLOW_EXIT | + MPDDRC_LPR_UPD_MR(0); +#endif + + switch(desc->type) { +#ifdef CONFIG_HAVE_DDR3 + case MPDDRC_TYPE_DDR3: +#ifdef CONFIG_HAVE_DDR3_SELFREFRESH + _set_ddr_timings(desc); + /* Initialize DDR chip when needed */ + if (!sfrbu_is_ddr_backup_enabled()) +#endif + _configure_ddr3(desc); + break; +#endif + case MPDDRC_TYPE_DDR2: + _configure_ddr2(desc); + break; + default: + trace_error("Device not handled\r\n"); + abort(); + } + + /* Last step: Write the refresh rate */ + /* Refresh Timer is (64ms / (bank_size)) * master_clock */ + uint32_t master_clock = pmc_get_master_clock()/1000000; + MPDDRC->MPDDRC_RTR = MPDDRC_RTR_COUNT(64000*master_clock/desc->bank); + + /* wait for end of calibration */ + timer_sleep(1); + + /* Restore resolution or put the default one if not already set */ + timer_configure(resolution); + +#ifdef CONFIG_HAVE_DDR3_SELFREFRESH + if (sfrbu_is_ddr_backup_enabled()) { + MPDDRC->MPDDRC_MR = MPDDRC_MR_MODE_NORMAL_CMD; + sfrbu_disable_ddr_backup(); + } +#endif +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.h new file mode 100644 index 000000000..19cec94ca --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/mpddrc.h @@ -0,0 +1,57 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 MPDDRC_HEADER_ +#define MPDDRC_HEADER_ + +#include + +enum _ram_type { + MPDDRC_TYPE_DDR3, + MPDDRC_TYPE_LPDDR3, + MPDDRC_TYPE_DDR2, + MPDDRC_TYPE_LPDDR2, + MPDDRC_TYPE_DDR +}; + +struct _mpddrc_desc { + enum _ram_type type; + uint32_t io_calibr; + uint32_t data_path; + uint32_t mode; + uint32_t control; + uint32_t bank; + uint32_t tpr0; + uint32_t tpr1; + uint32_t tpr2; +}; + +extern void mpddrc_configure(struct _mpddrc_desc* desc); + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio.h new file mode 100644 index 000000000..9804696ca --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio.h @@ -0,0 +1,205 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _PIO_H +#define _PIO_H + +#define IRQ_PIO_HANDLERS_SIZE 16 + +/*------------------------------------------------------------------------------ + * Global Types + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +struct _pin +{ + uint8_t group; /*< The IO group containing the pins you want to use. */ + uint32_t mask; /*< Bitmask indicating which pin(s) to configure. */ + uint8_t type; /*< Pin type */ + uint32_t attribute; /*< Pin config attribute. */ +}; + +typedef void(*pio_handler_t)(uint32_t, uint32_t, void*); + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#if defined(CONFIG_HAVE_PIO4) +#include "peripherals/pio4.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +/** + * \brief Configures a list of Pin instances. + * + * \details Each of them can either hold a single pin or a group of + * pins, depending on the mask value; all pins are configured by this + * function. The size of the array must also be provided and is easily + * computed using ARRAY_SIZE whenever its length is not known in + * advance. + * + * \param list Pointer to a list of Pin instances. + * \param size Size of the Pin list (calculated using ARRAY_SIZE). + * + * \return 1 if the pins have been configured properly; otherwise 0. + */ +extern uint8_t pio_configure(const struct _pin *list, uint32_t size); + +/** + * \brief Sets a high output level on all the PIOs defined in the + * given Pin instance. + * + * \details This has no immediate effects on PIOs that are not output, + * but the PIO controller will memorize the value they are changed to + * outputs. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +extern void pio_set(const struct _pin *pin); + +/** + * \brief Sets a low output level on all the PIOs defined in the given + * Pin instance. + * + * \details This has no immediate effects on PIOs that are not output, + * but the PIO controller will memorize the value they are changed to + * outputs. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +extern void pio_clear(const struct _pin *pin); + +/** + * \brief Returns 1 if one or more PIO of the given Pin instance currently have + * a high level; otherwise returns 0. This method returns the actual value that + * is being read on the pin. To return the supposed output value of a pin, use + * \ref pio_get_output_date_status() instead. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * + * \return 1 if the Pin instance contains at least one PIO that currently has + * a high level; otherwise 0. + */ +extern uint8_t pio_get(const struct _pin *pin); + +/** + * \brief Returns 1 if one or more PIO of the given Pin are configured to output a + * high level (even if they are not output). + * To get the actual value of the pin, use pio_get() instead. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * + * \return 1 if the Pin instance contains at least one PIO that is configured + * to output a high level; otherwise 0. + */ +extern uint8_t pio_get_output_data_status(const struct _pin *pin); + +/** + * \brief Configures Glitch or Debouncing filter for input. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * \param cuttoff Cutt off frequency for debounce filter. + */ +extern void pio_set_debounce_filter(const struct _pin *pin, uint32_t cuttoff); + +/** + * \brief Enable write protect. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +extern void pio_enable_write_protect(const struct _pin *pin); + +/** + * \brief Disable write protect. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +extern void pio_disable_write_protect(const struct _pin *pin); + +/** + * \brief Get write protect violation information. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +extern uint32_t pio_get_write_protect_violation_info(const struct _pin * pin); + +/** + * \brief Configure all pio outputs low + * + * \param group PIO group number + * \param mask Bitmask of one or more pin(s) to configure. + */ +extern void pio_output_low(uint32_t group, uint32_t mask); + +extern void pio_add_handler_to_group(uint32_t group, uint32_t mask, + pio_handler_t handler, void* user_arg); + +extern void pio_reset_all_it(void); + +/** + * \brief Generate an interrupt on status change for a PIO or a group + * of PIO. + + * \details The provided interrupt handler will be called with the + * triggering pin as its parameter (enabling different pin instances + * to share the same handler). + * + * \param pin Pointer to a _pin instance. + */ +extern void pio_configure_it(const struct _pin * pin); + + +/** + * Enables the given interrupt source if it has been configured. The status + * register of the corresponding PIO controller is cleared prior to enabling + * the interrupt. + * \param pin Interrupt source to enable. + */ +extern void pio_enable_it(const struct _pin * pin); + +/** + * Disables a given interrupt source, with no added side effects. + * + * \param pin Interrupt source to disable. + */ +extern void pio_disable_it(const struct _pin * pin); + +#ifdef __cplusplus +} +#endif +#endif /* _PIO_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.c new file mode 100644 index 000000000..7640690e7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.c @@ -0,0 +1,601 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup pio_module Working with PIO + * \section Purpose + * The PIO driver provides the Interface for configuration the Parallel Input/Output + * Controller (PIO). + * + * \section Usage + *
    + *
  • Initialize the PIO with the desired period using pio_configure(). + *
  • Set a high or low output level on the given PIO using pio_set() or pio_clear(). + *
  • Get the level of the given PIOs using pio_get() or pio_get_output_date_status(). + *
  • Configures Glitch or Debouncing filter for given input PIO using pio_set_debounce_filter(). + *
  • Enable & disable write protect of the given PIOs using pio_enable_write_protect() or pio_disable_write_protect(). + *
  • Get write protect violation information of given PIO using pio_get_write_protect_violation_info(). + *
  • + *
+ * + * For more accurate information, please look at the PIT section of the Datasheet. + * + * Related files :\n + * \ref pio.c\n + * \ref pio3.h\n +*/ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of PIO V3 (Parallel Input/Output) controller. + * + */ +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/pio.h" +#include "peripherals/pmc.h" +#include "peripherals/aic.h" +#include "peripherals/matrix.h" + +#include "trace.h" +#include "compiler.h" + +#include +#include +#include + +/*---------------------------------------------------------------------------- + * Local types + *----------------------------------------------------------------------------*/ + +struct _bitfield_pio_cfgr_func { + uint32_t + func : 3, + rfu3_7 : 5, + dir : 1, + puen : 1, + pden : 1, + rfu11 : 1, + ifen : 1, + ifscen : 1, + opd : 1, + schmitt : 1, + drvstr : 2, + rfu18_23 : 6, + evtsel : 3, + rfu27_28 : 2, + pcfs : 1, + icfs : 1, + tampen : 1; +}; + +union _pio_cfg { + struct _bitfield_pio_cfgr_func bitfield; + uint32_t uint32_value; +}; + +/*---------------------------------------------------------------------------- + * Local functions declarations + *----------------------------------------------------------------------------*/ + +#ifdef ID_PIOA +static void _pioa_handler(void); +#endif +#ifdef ID_PIOB +static void _piob_handler(void); +#endif +#ifdef ID_PIOC +static void _pioc_handler(void); +#endif +#ifdef ID_PIOD +static void _piod_handler(void); +#endif + +/*---------------------------------------------------------------------------- + * Local variables + *----------------------------------------------------------------------------*/ +struct _handler { + uint32_t mask; + pio_handler_t handler; + void *user_arg; +}; +static struct _handler _handlers[IRQ_PIO_HANDLERS_SIZE]; + +static const aic_handler_t _generic_handlers[PIO_GROUP_LENGTH] = { +#ifdef ID_PIOA + _pioa_handler, +#endif +#ifdef ID_PIOB + _piob_handler, +#endif +#ifdef ID_PIOC + _pioc_handler, +#endif +#ifdef ID_PIOD + _piod_handler, +#endif +}; + +/*---------------------------------------------------------------------------- + * Local functions definitions + *----------------------------------------------------------------------------*/ + +static void _handler_push(void (*handler)(uint32_t, uint32_t, void*), + uint32_t mask, void* user_arg) +{ + static int i = 0; + _handlers[i].mask = mask; + _handlers[i].handler = handler; + _handlers[i].user_arg = user_arg; + ++i; + assert(i < ARRAY_SIZE(_handlers)); +} + +#ifdef ID_PIOA +static void _pioa_handler(void) +{ + uint32_t status = 0; + unsigned int i = 0; + if (matrix_is_peripheral_secured(MATRIX1, ID_PIOA)) + status = PIOA->PIO_PIO_[PIO_GROUP_A].S_PIO_ISR; + else + status = PIOA->PIO_IO_GROUP[PIO_GROUP_A].PIO_ISR; + + for (i = 0; i < ARRAY_SIZE(_handlers); ++i) { + if (_handlers[i].mask & status) { + _handlers[i].handler(PIO_GROUP_A, status, + _handlers[i].user_arg); + } + } +} +#endif +#ifdef ID_PIOB +static void _piob_handler(void) +{ + uint32_t status = 0; + unsigned int i = 0; + if (matrix_is_peripheral_secured(MATRIX1, ID_PIOB)) + status = PIOA->PIO_PIO_[PIO_GROUP_B].S_PIO_ISR; + else + status = PIOA->PIO_IO_GROUP[PIO_GROUP_B].PIO_ISR; + + for (i = 0; i < ARRAY_SIZE(_handlers); ++i) { + if (_handlers[i].mask & status) { + _handlers[i].handler(PIO_GROUP_B, status, + _handlers[i].user_arg); + } + } + +} +#endif +#ifdef ID_PIOC +static void _pioc_handler(void) +{ + uint32_t status = 0; + unsigned int i = 0; + if (matrix_is_peripheral_secured(MATRIX1, ID_PIOC)) + status = PIOA->PIO_PIO_[PIO_GROUP_C].S_PIO_ISR; + else + status = PIOA->PIO_IO_GROUP[PIO_GROUP_C].PIO_ISR; + + for (i = 0; i < ARRAY_SIZE(_handlers); ++i) { + if (_handlers[i].mask & status) { + _handlers[i].handler(PIO_GROUP_C, status, + _handlers[i].user_arg); + } + } +} +#endif +#ifdef ID_PIOD +static void _piod_handler(void) +{ + uint32_t status = 0; + unsigned int i = 0; + if (matrix_is_peripheral_secured(MATRIX1, ID_PIOD)) + status = PIOA->PIO_PIO_[PIO_GROUP_D].S_PIO_ISR; + else + status = PIOA->PIO_IO_GROUP[PIO_GROUP_D].PIO_ISR; + + for (i = 0; i < ARRAY_SIZE(_handlers); ++i) { + if (_handlers[i].mask & status) { + _handlers[i].handler(PIO_GROUP_D, status, + _handlers[i].user_arg); + } + } +} +#endif + +static inline uint32_t _pio_group_to_id(int group) +{ + switch(group) { + case PIO_GROUP_A: + return ID_PIOA; + case PIO_GROUP_B: + return ID_PIOB; + case PIO_GROUP_C: + return ID_PIOC; + case PIO_GROUP_D: + return ID_PIOD; + default: + return (unsigned int)-1; + }; +} + +static void* _pio_configure_pins(const struct _pin *pin, uint32_t periph_id) +{ + PioPio_* piogroup = &PIOA->PIO_PIO_[pin->group]; + if (!matrix_is_peripheral_secured(MATRIX1, periph_id)) { + piogroup->S_PIO_SIONR = pin->mask; + return (void*) &PIOA->PIO_IO_GROUP[pin->group]; + } else { + piogroup->S_PIO_SIOSR = pin->mask; + return (void*) piogroup; + } +} + +static void* _pio_retrive_group(const struct _pin *pin, uint32_t periph_id) +{ + if (!matrix_is_peripheral_secured(MATRIX1, periph_id)) { + return (void*) &PIOA->PIO_IO_GROUP[pin->group]; + } else { + return (void*) &PIOA->PIO_PIO_[pin->group]; + } +} +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Configures a list of Pin instances, each of which can either + * hold a single pin or a group of pins, depending on the mask value; + * all pins are configured by this function. The size of the array + * must also be provided and is easily computed using ARRAY_SIZE + * whenever its length is not known in advance. + * + * \param list Pointer to a list of _pin instances. + * \param size Size of the _pin list (calculated using PIN_LISTSIZE). + * + * \return 1 if the pins have been configured properly; otherwise 0. + */ +uint8_t pio_configure(const struct _pin *pin_list, uint32_t size) +{ + union _pio_cfg cfg; + PioIo_group* pioiog; + + /* Configure pins */ + while (size--) + { + /* Enable the PIO group if needed */ + uint32_t periph_id = _pio_group_to_id(pin_list->group); + + assert(pin_list->group < PIO_GROUP_LENGTH); + cfg.uint32_value = 0; + pioiog = (PioIo_group*) _pio_configure_pins(pin_list, periph_id); + + if ( pin_list->attribute != PIO_DEFAULT) { + cfg.bitfield.puen = (pin_list->attribute & PIO_PULLUP)? 1:0; + cfg.bitfield.pden = (pin_list->attribute & PIO_PULLDOWN)? 1:0; + cfg.bitfield.ifen = (pin_list->attribute & PIO_DEGLITCH)? 1:0; + cfg.bitfield.ifscen = (pin_list->attribute & PIO_DEBOUNCE)? 1:0; + cfg.bitfield.opd = (pin_list->attribute & PIO_OPENDRAIN)? 1:0; + cfg.bitfield.schmitt =(pin_list->attribute & PIO_TRIGGER_DIS)? 1:0; + + switch (pin_list->attribute & PIO_DRVSTR_Msk) { + case PIO_DRVSTR_HI: + cfg.bitfield.drvstr = PIO_CFGR_DRVSTR_HI >> PIO_CFGR_DRVSTR_Pos; + break; + case PIO_DRVSTR_ME: + cfg.bitfield.drvstr = PIO_CFGR_DRVSTR_ME >> PIO_CFGR_DRVSTR_Pos; + break; + case PIO_DRVSTR_LO: + default: + cfg.bitfield.drvstr = PIO_CFGR_DRVSTR_LO >> PIO_CFGR_DRVSTR_Pos; + break; + } + + switch (pin_list->attribute & PIO_EVTSEL_Msk) { + case PIO_IT_HIGH_LEVEL: + cfg.bitfield.evtsel = PIO_CFGR_EVTSEL_HIGH >> PIO_CFGR_EVTSEL_Pos; + break; + case PIO_IT_LOW_LEVEL: + cfg.bitfield.evtsel = PIO_CFGR_EVTSEL_LOW >> PIO_CFGR_EVTSEL_Pos; + break; + case PIO_IT_BOTH_EDGE: + cfg.bitfield.evtsel = PIO_CFGR_EVTSEL_BOTH >> PIO_CFGR_EVTSEL_Pos; + break; + case PIO_IT_RISE_EDGE: + cfg.bitfield.evtsel = PIO_CFGR_EVTSEL_RISING >> PIO_CFGR_EVTSEL_Pos; + break; + case PIO_IT_FALL_EDGE: + default: + cfg.bitfield.evtsel = PIO_CFGR_EVTSEL_FALLING >> PIO_CFGR_EVTSEL_Pos; + break; + } + } + + switch (pin_list->type){ + + case PIO_PERIPH_A: + cfg.bitfield.func = PIO_CFGR_FUNC_PERIPH_A >> PIO_CFGR_FUNC_Pos; + break; + case PIO_PERIPH_B: + cfg.bitfield.func = PIO_CFGR_FUNC_PERIPH_B >> PIO_CFGR_FUNC_Pos; + break; + case PIO_PERIPH_C: + cfg.bitfield.func = PIO_CFGR_FUNC_PERIPH_C >> PIO_CFGR_FUNC_Pos; + break; + case PIO_PERIPH_D: + cfg.bitfield.func = PIO_CFGR_FUNC_PERIPH_D >> PIO_CFGR_FUNC_Pos; + break; + case PIO_PERIPH_E: + cfg.bitfield.func = PIO_CFGR_FUNC_PERIPH_E >> PIO_CFGR_FUNC_Pos; + break; + case PIO_PERIPH_F: + cfg.bitfield.func = PIO_CFGR_FUNC_PERIPH_F >> PIO_CFGR_FUNC_Pos; + break; + case PIO_GENERIC: + case PIO_INPUT: + cfg.bitfield.dir = 0; + break; + + case PIO_OUTPUT_0: + cfg.bitfield.dir = 1; + pio_clear(pin_list); + break; + + case PIO_OUTPUT_1: + cfg.bitfield.dir = 1; + pio_set(pin_list); + break; + + default: + case PIO_PERIPH_G: + return 0; + } + + pioiog->PIO_MSKR = pin_list->mask; + pioiog->PIO_CFGR = cfg.uint32_value; + pmc_enable_peripheral(periph_id); + + ++pin_list; + } + return 1; +} + +/** + * \brief Sets a high output level on all the PIOs defined in the + * given Pin instance. This has no immediate effects on PIOs that are + * not output, but the PIO controller will memorize the value they are + * changed to outputs. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +void pio_set(const struct _pin *pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + uint32_t periph_id = _pio_group_to_id(pin->group); + PioIo_group* pioiog = (PioIo_group*) _pio_retrive_group(pin, periph_id); + pioiog->PIO_SODR = pin->mask; +} + +/** + * \brief Sets a low output level on all the PIOs defined in the given + * Pin instance. This has no immediate effects on PIOs that are not + * output, but the PIO controller will memorize the value they are + * changed to outputs. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +void pio_clear(const struct _pin *pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + uint32_t periph_id = _pio_group_to_id(pin->group); + PioIo_group* pioiog = (PioIo_group*) _pio_retrive_group(pin, periph_id); + pioiog->PIO_CODR = pin->mask; +} + +/** + * \brief Returns 1 if one or more PIO of the given Pin instance currently have + * a high level; otherwise returns 0. This method returns the actual value that + * is being read on the pin. To return the supposed output value of a pin, use + * pio_get_output_date_status() instead. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * + * \return 1 if the Pin instance contains at least one PIO that currently has + * a high level; otherwise 0. + */ +uint8_t pio_get(const struct _pin *pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + uint32_t reg ; + uint32_t periph_id = _pio_group_to_id(pin->group); + PioIo_group* pioiog = (PioIo_group*) _pio_retrive_group(pin, periph_id); + + if ((pin->type == PIO_OUTPUT_0) || (pin->type == PIO_OUTPUT_1)) { + reg = pioiog->PIO_ODSR ; + } + else { + reg = pioiog->PIO_PDSR ; + } + if ( (reg & pin->mask) == 0 ) { + return 0 ; + } + else { + return 1 ; + } +} + +/** + * \brief Returns 1 if one or more PIO of the given Pin are configured + * to output a high level (even if they are not output). To get the + * actual value of the pin, use pio_get() instead. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * + * \return 1 if the Pin instance contains at least one PIO that is configured + * to output a high level; otherwise 0. + */ +uint8_t pio_get_output_data_status(const struct _pin *pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + uint32_t periph_id = _pio_group_to_id(pin->group); + PioIo_group* pioiog = (PioIo_group*) _pio_retrive_group(pin, periph_id); + + if ((pioiog->PIO_ODSR & pin->mask) == 0) { + return 0; + } + else { + return 1; + } +} + +/** + * \brief Configures Glitch or Debouncing filter for input. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * \param cuttoff Cutt off frequency for debounce filter. + */ +void pio_set_debounce_filter(const struct _pin *pin, uint32_t cuttoff) +{ + assert(pin->group < PIO_GROUP_LENGTH); + if (cuttoff == 0) { + PIOA->S_PIO_SCDR = 0; + } + else { + /* the lowest 14 bits work */ + PIOA->S_PIO_SCDR = + ((pmc_get_slow_clock()/(2*(cuttoff))) - 1) & 0x3FFF; + } +} + +/** + * \brief Enable write protect. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +void pio_enable_write_protect(const struct _pin *pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + PIOA->PIO_WPMR = (PIO_WPMR_WPKEY_VALID | PIO_WPMR_WPEN_EN ); +} + +/** + * \brief Disable write protect. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +void pio_disable_write_protect(const struct _pin *pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + PIOA->PIO_WPMR = (PIO_WPMR_WPKEY_VALID | PIO_WPMR_WPEN_DIS ); +} + +/** + * \brief Get write protect violation information. + * + * \param pin Pointer to a Pin instance describing one or more pins. + */ +uint32_t pio_get_write_protect_violation_info(const struct _pin * pin) +{ + assert(pin->group < PIO_GROUP_LENGTH); + return PIOA->PIO_WPSR; +} + +void pio_add_handler_to_group(uint32_t group, uint32_t mask, + pio_handler_t handler, void* user_arg) +{ + trace_debug("Enter in pio_add_handler_to_group()\n\r"); + assert(group < + (sizeof(_generic_handlers)/sizeof(_generic_handlers[0]))); + _handler_push(handler, mask, user_arg); + uint32_t id = _pio_group_to_id(group); + aic_set_source_vector(id, + (aic_handler_t)_generic_handlers[group]); + aic_enable(id); +} + +void pio_reset_all_it(void) +{ + int i = 0; + for (i = 0; i < PIO_GROUP_LENGTH; ++i) { + PIOA->PIO_IO_GROUP[i].PIO_ISR; + PIOA->PIO_IO_GROUP[i].PIO_IDR = ~0UL; + } +} + +/** + * Configures a PIO or a group of PIO to generate an interrupt on status + * change. The provided interrupt handler will be called with the triggering + * pin as its parameter (enabling different pin instances to share the same + * handler). + * \param pin Pointer to a _pin instance. + */ +void pio_configure_it(const struct _pin *pin) +{ + trace_debug("Enter in pio_configure_it()\n\r"); + assert(pin != NULL); +} + +/** + * Enables the given interrupt source if it has been configured. The status + * register of the corresponding PIO controller is cleared prior to enabling + * the interrupt. + * \param pin Interrupt source to enable. + */ +void pio_enable_it(const struct _pin *pin) +{ + trace_debug("pio_enable_it() \n\r"); + assert(pin != NULL); + uint32_t periph_id = _pio_group_to_id(pin->group); + PioIo_group* pioiog = (PioIo_group*) _pio_retrive_group(pin, periph_id); + + pioiog->PIO_ISR; + /* Configure interrupt enable register */ + pioiog->PIO_IER = pin->mask; /* enable interrupt register */ +} + +/** + * Disables a given interrupt source, with no added side effects. + * + * \param pin Interrupt source to disable. + */ +void pio_disable_it(const struct _pin *pin) +{ + trace_debug("pio_enable_it()\n\r"); + assert(pin != NULL); + uint32_t periph_id = _pio_group_to_id(pin->group); + PioIo_group* pioiog = (PioIo_group*) _pio_retrive_group(pin, periph_id); + pioiog->PIO_IDR = pin->mask; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.h new file mode 100644 index 000000000..cf179fd1f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pio4.h @@ -0,0 +1,164 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * This file provides a basic API for PIO configuration and usage of + * user-controlled pins. Please refer to the board.h file for a list of + * available pin definitions. + * + * \section Usage + * + * -# Define a constant pin description array such as the following one, using + * the existing definitions provided by the board.h file if possible: + * \code + * const struct _pin pins[] = {PIN_USART0_TXD, PIN_USART0_RXD}; + * \endcode + * Alternatively, it is possible to add new pins by provided the full Pin + * structure: + * \code + * // Pin instance to configure PA10 & PA11 as inputs with the internal + * // pull-up enabled. + * const Pin pins = { + * (1 << 10) | (1 << 11), + * REG_PIOA, + * ID_PIOA, + * PIO_INPUT, + * PIO_PULLUP + * }; + * \endcode + * -# Configure a pin array by calling pio_configure() with a pointer to the + * array and its size (which is computed using the ARRAY_SIZE macro). + * -# Change and get the value of a user-controlled pin using the pio_set, + * pio_clear and pio_get methods. + * -# Get the level being currently output by a user-controlled pin configured + * as an output using pio_get_output_date_status(). + */ + +#ifndef _PIO_H +#error "pio3.h cannot be included. pio.h should be used instead" +#endif + +#ifndef _PIO4_H +#define _PIO4_H + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" +#include + +/*------------------------------------------------------------------------------ + * Definitions + *------------------------------------------------------------------------------*/ + +/* The IO group is A (or 0) */ +#define PIO_GROUP_A 0 +/* The IO group is B (or 1) */ +#define PIO_GROUP_B 1 +/* The IO group is C (or 2) */ +#define PIO_GROUP_C 2 +/* The IO group is D (or 3) */ +#define PIO_GROUP_D 3 + +#define PIO_GROUP_LENGTH PIOIO_GROUP_NUMBER + +/* The pin is controlled by the generic PIO. */ +#define PIO_GENERIC 0 +/* The pin is controlled by the associated signal of peripheral A. */ +#define PIO_PERIPH_A 1 +/* The pin is controlled by the associated signal of peripheral B. */ +#define PIO_PERIPH_B 2 +/* The pin is controlled by the associated signal of peripheral C. */ +#define PIO_PERIPH_C 3 +/* The pin is controlled by the associated signal of peripheral D. */ +#define PIO_PERIPH_D 4 +/* The pin is controlled by the associated signal of peripheral E. */ +#define PIO_PERIPH_E 5 +/* The pin is controlled by the associated signal of peripheral F. */ +#define PIO_PERIPH_F 6 +/* The pin is controlled by the associated signal of peripheral G. */ +#define PIO_PERIPH_G 7 + +/* The pin is an input. */ +#define PIO_INPUT 10 +/* The pin is an output. */ +#define PIO_OUTPUT 11 +/* The pin is an output and has a default level of 0. */ +#define PIO_OUTPUT_0 11 +/* The pin is an output and has a default level of 1. */ +#define PIO_OUTPUT_1 12 + + +/* Default pin configuration (no attribute). */ +#define PIO_DEFAULT (0x0u << 0) +/* The internal pin pull-up is active. */ +#define PIO_PULLUP (0x1u << 0) +/* The internal pin pull-down is active. */ +#define PIO_PULLDOWN (0x1u << 1) +/* The pin is open-drain. */ +#define PIO_OPENDRAIN (0x1u << 2) +/* The internal glitch filter is active. */ +#define PIO_DEGLITCH (0x1u << 3) +/* The internal Debounce filter is active. */ +#define PIO_DEBOUNCE (0x1u << 4) +/* The internal Schmitt trigger is disable. */ +#define PIO_TRIGGER_DIS (0x1u << 5) + +/* Drive Strength. */ +#define PIO_DRVSTR_Pos 10 +#define PIO_DRVSTR_Msk (0x3u << 10) +#define PIO_DRVSTR_HI (0x2u << 10) /* High drive */ +#define PIO_DRVSTR_ME (0x1u << 10) /* Medium drive */ +#define PIO_DRVSTR_LO (0x0u << 10) /* Low drive */ + +#define PIO_EVTSEL_Pos 12 +#define PIO_EVTSEL_Msk (0x7u << 12) +/* Event detection on input falling edge. */ +#define PIO_IT_FALL_EDGE (0x0u << 12) +/* Event detection on input rising edge. */ +#define PIO_IT_RISE_EDGE (0x1u << 12) +/* Event detection on input both edge. */ +#define PIO_IT_BOTH_EDGE (0x2u << 12) +/* Event detection on low level input. */ +#define PIO_IT_LOW_LEVEL (0x3u << 12) +/*Event detection on high level input. */ +#define PIO_IT_HIGH_LEVEL (0x4u << 12) + +#define PIO_WPMR_WPEN_EN ( 0x01 << 0 ) + +#define PIO_WPMR_WPEN_DIS ( 0x00 << 0 ) + +#define PIO_WPMR_WPKEY_VALID ( 0x50494F << 8 ) + +#endif /* #ifndef _PIO4_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.c new file mode 100644 index 000000000..cf34b1e41 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.c @@ -0,0 +1,128 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup pit_module Working with PIT + * \section Purpose + * The PIT driver provides the Interface for configuration the Periodic + * Interval Timer (PIT) peripheral. + * + * \section Usage + *
    + *
  • Initialize the PIT with the desired period using pit_init(). + * Alternatively, the Periodic Interval Value (PIV) can be configured + * manually using pit_set_piv().
  • + *
  • Start the PIT counting using pit_enable(). + *
  • Enable & disable the PIT interrupt using pit_enable_it() and + * pit_disable_it().
  • + *
  • Retrieve the current status of the PIT using pit_get_status().
  • + *
  • To get the current value of the internal counter and the number of ticks + * that have occurred, use either pit_get_pivr() or pit_get_piir() depending + * on whether you want the values to be cleared or not.
  • + * + *
+ * For more accurate information, please look at the PIT section of the + * Datasheet. + * + * Related files :\n + * \ref pit.c\n + * \ref pit.h.\n +*/ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of PIT (Periodic Interval Timer) controller. + * + */ +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/pit.h" +#include "peripherals/pmc.h" + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +void pit_init(uint32_t period) +{ + uint32_t pit_frequency = pmc_get_peripheral_clock(ID_PIT) / 1000000; + PIT->PIT_MR = period ? (period * pit_frequency + 8) >> 4 : 0; + PIT->PIT_MR |= PIT_MR_PITEN; +} + +void pit_set_piv(uint32_t piv) +{ + uint32_t dwMr = PIT->PIT_MR & (~PIT_MR_PIV_Msk); + PIT->PIT_MR = dwMr | PIT_MR_PIV(piv); +} + +void pit_enable(void) +{ + PIT->PIT_MR |= PIT_MR_PITEN; +} + +void pit_disable(void) +{ + PIT->PIT_MR &= ~PIT_MR_PITEN; +} + +void pit_enable_it(void) +{ + PIT->PIT_MR |= PIT_MR_PITIEN; +} + +void pit_disable_it(void) +{ + PIT->PIT_MR &= ~PIT_MR_PITIEN; +} + +uint32_t pit_get_mode(void) +{ + return PIT->PIT_MR; +} + +uint32_t pit_get_status(void) +{ + return PIT->PIT_SR; +} + +uint32_t pit_get_piir(void) +{ + return PIT->PIT_PIIR; +} + +uint32_t pit_get_pivr(void) +{ + return PIT->PIT_PIVR; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.h new file mode 100644 index 000000000..80b357ec2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pit.h @@ -0,0 +1,121 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _PIT_H_ +#define _PIT_H_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** +* \brief Initialize the Periodic Interval Timer to generate a tick at the +* specified period, given the current master clock frequency. +* +* \param period Period in micro seconds. +*/ +extern void pit_init(uint32_t period); + +/** + * \brief Set the Periodic Interval Value of the PIT. + * + * \param piv PIV value to set. + */ +extern void pit_set_piv(uint32_t piv); + +/** + * \brief Enables the PIT if this is not already the case. + * + */ +extern void pit_enable(void); + +/** + * \brief Disnables the PIT when PIV value is reached. + * + */ +extern void pit_disable(void); + +/** + * \brief Enable the PIT periodic interrupt. + * + */ +extern void pit_enable_it(void); + +/** + * \brief Disables the PIT periodic interrupt. + * + */ +extern void pit_disable_it(void); + +/** + * \brief Returns the value of the PIT mode register. + * + * \return PIT_MR value. + */ +extern uint32_t pit_get_mode(void); + +/** + * \brief Returns the value of the PIT status register, clearing it as + * a side effect. + * + * \return PIT_SR value. + */ +extern uint32_t pit_get_status(void); + +/** + * \brief Returns the value of the PIT Image Register, to read PICNT + * and CPIV without clearing the current values. + * + * \return PIT_PIIR value. + */ +extern uint32_t pit_get_piir(void); + +/** + * \brief Returns the value of the PIT Value Register, clearing it as + * a side effect. + * + * \return PITC_PIVR value. + */ +extern uint32_t pit_get_pivr(void); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifndef _PIT_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.c new file mode 100644 index 000000000..52051bc05 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.c @@ -0,0 +1,978 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup pmc_module Working with PMC + * \section Purpose + * The PMC driver provides the Interface for configuration the Power Management + * Controller (PMC). + * + * \section Usage + *
    + *
  • Enable & disable peripherals using pmc_enable_peripheral() and + * pmc_enable_all_peripherals() or pmc_disable_peripheral() and + * pmc_disable_all_peripherals(). + *
  • Get & set maximum frequency clock for giving peripheral using + * pmc_get_peri_max_freq() and pmc_set_peri_max_clock(). + *
  • Get Peripheral Status for the given peripheral using pmc_is_periph_enabled() + *
  • Select clocks's source using pmc_select_external_crystal(), + * pmc_select_internal_crystal(), pmc_select_external_osc() and pmc_select_internal_osc(). + *
  • Switch MCK using pmc_switch_mck_to_pll(), pmc_switch_mck_to_main() and + * pmc_switch_mck_to_slck(). + *
  • Config PLL using pmc_set_pll_a() and pmc_disable_pll_a(). + *
  • + *
+ * For more accurate information, please look at the PMC section of the + * Datasheet. + * + * Related files :\n + * \ref pmc.c\n + * \ref pmc.h\n +*/ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of PIO (Parallel Input/Output) controller. + * + */ +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "board.h" +#include "peripherals/pmc.h" +#include "trace.h" +#include + +/*---------------------------------------------------------------------------- + * Variables + *----------------------------------------------------------------------------*/ + +static uint32_t _pmc_mck = 0; + +/*---------------------------------------------------------------------------- + * Private functions + *----------------------------------------------------------------------------*/ + +static void _pmc_compute_mck(void) +{ + uint32_t clk = 0; + uint32_t mckr = PMC->PMC_MCKR; + + uint32_t css = mckr & PMC_MCKR_CSS_Msk; + switch (css) { + case PMC_MCKR_CSS_SLOW_CLK: + clk = pmc_get_slow_clock(); + break; + case PMC_MCKR_CSS_MAIN_CLK: + clk = pmc_get_main_clock(); + break; + case PMC_MCKR_CSS_PLLA_CLK: + clk = pmc_get_plla_clock(); + break; + case PMC_MCKR_CSS_UPLL_CLK: + clk = pmc_get_upll_clock(); + break; + default: + /* should never get here... */ + break; + } + + uint32_t pres = mckr & PMC_MCKR_PRES_Msk; + switch (pres) { + case PMC_MCKR_PRES_CLOCK: + break; + case PMC_MCKR_PRES_CLOCK_DIV2: + clk >>= 1; + break; + case PMC_MCKR_PRES_CLOCK_DIV4: + clk >>= 2; + break; + case PMC_MCKR_PRES_CLOCK_DIV8: + clk >>= 3; + break; + case PMC_MCKR_PRES_CLOCK_DIV16: + clk >>= 4; + break; + case PMC_MCKR_PRES_CLOCK_DIV32: + clk >>= 5; + break; + case PMC_MCKR_PRES_CLOCK_DIV64: + clk >>= 6; + break; + default: + /* should never get here... */ + break; + } + + uint32_t mdiv = mckr & PMC_MCKR_MDIV_Msk; + switch (mdiv) { + case PMC_MCKR_MDIV_EQ_PCK: + break; + case PMC_MCKR_MDIV_PCK_DIV2: + clk >>= 1; // divide by 2 + break; + case PMC_MCKR_MDIV_PCK_DIV4: + clk >>= 2; // divide by 4 + break; + case PMC_MCKR_MDIV_PCK_DIV3: + clk /= 3; // divide by 3 + break; + default: + /* should never get here... */ + break; + } + + _pmc_mck = clk; +} + +static uint32_t _pmc_get_pck_clock(uint32_t index) +{ + uint32_t clk = 0; + uint32_t pck = PMC->PMC_PCK[index]; + + switch (pck & PMC_PCK_CSS_Msk) { + case PMC_PCK_CSS_SLOW_CLK: + clk = pmc_get_slow_clock(); + break; + case PMC_PCK_CSS_MAIN_CLK: + clk = pmc_get_main_clock(); + break; + case PMC_PCK_CSS_PLLA_CLK: + clk = pmc_get_plla_clock(); + break; + case PMC_PCK_CSS_UPLL_CLK: + clk = pmc_get_upll_clock(); + break; + case PMC_PCK_CSS_MCK_CLK: + clk = pmc_get_master_clock(); + break; +#ifdef CONFIG_HAVE_PMC_AUDIO_CLOCK + case PMC_PCK_CSS_AUDIO_CLK: + clk = pmc_get_audio_pmc_clock(); + break; +#endif + } + + uint32_t prescaler = (pck & PMC_PCK_PRES_Msk) >> PMC_PCK_PRES_Pos; + return clk / (prescaler + 1); +} + +static bool _pmc_get_system_clock_bits(enum _pmc_system_clock clock, + uint32_t *scer, uint32_t* scdr, uint32_t *scsr) +{ + uint32_t e, d, s; + + switch (clock) + { +#ifdef PMC_SCDR_PCK + case PMC_SYSTEM_CLOCK_PCK: + e = 0; + d = PMC_SCDR_PCK; + s = PMC_SCSR_PCK; + break; +#endif + case PMC_SYSTEM_CLOCK_DDR: + e = PMC_SCER_DDRCK; + d = PMC_SCDR_DDRCK; + s = PMC_SCSR_DDRCK; + break; + case PMC_SYSTEM_CLOCK_LCD: + e = PMC_SCER_LCDCK; + d = PMC_SCDR_LCDCK; + s = PMC_SCSR_LCDCK; + break; +#ifdef PMC_SCER_SMDCK + case PMC_SYSTEM_CLOCK_SMD: + e = PMC_SCER_SMDCK; + d = PMC_SCDR_SMDCK; + s = PMC_SCSR_SMDCK; + break; +#endif + case PMC_SYSTEM_CLOCK_UHP: + e = PMC_SCER_UHP; + d = PMC_SCDR_UHP; + s = PMC_SCSR_UHP; + break; + case PMC_SYSTEM_CLOCK_UDP: + e = PMC_SCER_UDP; + d = PMC_SCDR_UDP; + s = PMC_SCSR_UDP; + break; + case PMC_SYSTEM_CLOCK_PCK0: + e = PMC_SCER_PCK0; + d = PMC_SCDR_PCK0; + s = PMC_SCSR_PCK0; + break; + case PMC_SYSTEM_CLOCK_PCK1: + e = PMC_SCER_PCK1; + d = PMC_SCDR_PCK1; + s = PMC_SCSR_PCK1; + break; + case PMC_SYSTEM_CLOCK_PCK2: + e = PMC_SCER_PCK2; + d = PMC_SCDR_PCK2; + s = PMC_SCSR_PCK2; + break; +#ifdef PMC_SCER_ISCCK + case PMC_SYSTEM_CLOCK_ISC: + e = PMC_SCER_ISCCK; + d = PMC_SCDR_ISCCK; + s = PMC_SCSR_ISCCK; + break; +#endif + default: + return false; + } + + if (scer) { + if (e) + *scer = e; + else + return false; + } + + if (scdr) { + if (d) + *scdr = d; + else + return false; + } + + if (scsr) { + if (s) + *scsr = s; + else + return false; + } + + return true; +} + +/*---------------------------------------------------------------------------- + * Exported functions (General) + *----------------------------------------------------------------------------*/ + +uint32_t pmc_get_master_clock(void) +{ + if (!_pmc_mck) { + _pmc_compute_mck(); + } + return _pmc_mck; +} + +uint32_t pmc_get_slow_clock(void) +{ + if (SCKC->SCKC_CR & SCKC_CR_OSCSEL) + return SLOW_CLOCK_INT_OSC; /* on-chip slow clock RC */ + else + return BOARD_SLOW_CLOCK_EXT_OSC; /* external crystal */ +} + +uint32_t pmc_get_main_clock(void) +{ + if (PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) + return MAIN_CLOCK_INT_OSC; /* on-chip main clock RC */ + else + return BOARD_MAIN_CLOCK_EXT_OSC; /* external crystal */ +} + +uint32_t pmc_get_plla_clock(void) +{ + uint32_t pllaclk, pllar, pllmula, plldiva; + + if (PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) + pllaclk = MAIN_CLOCK_INT_OSC; /* on-chip main clock RC */ + else + pllaclk = BOARD_MAIN_CLOCK_EXT_OSC; /* external crystal */ + + pllar = PMC->CKGR_PLLAR; + pllmula = (pllar & CKGR_PLLAR_MULA_Msk) >> CKGR_PLLAR_MULA_Pos; + plldiva = (pllar & CKGR_PLLAR_DIVA_Msk) >> CKGR_PLLAR_DIVA_Pos; + if (plldiva == 0 || pllmula == 0) { + pllaclk = 0; + } else { + pllaclk = pllaclk * (pllmula + 1) / plldiva; + if (PMC->PMC_MCKR & PMC_MCKR_PLLADIV2) + pllaclk >>= 1; + } + + return pllaclk; +} + +uint32_t pmc_get_processor_clock(void) +{ + uint32_t procclk, mdiv; + + procclk = pmc_get_master_clock(); + + mdiv = PMC->PMC_MCKR & PMC_MCKR_MDIV_Msk; + switch (mdiv) { + case PMC_MCKR_MDIV_EQ_PCK: + break; + case PMC_MCKR_MDIV_PCK_DIV2: + procclk <<= 1; // multiply by 2 + break; + case PMC_MCKR_MDIV_PCK_DIV3: + procclk *= 3; // multiply by 3 + break; + case PMC_MCKR_MDIV_PCK_DIV4: + procclk <<= 2; // multiply by 4 + break; + default: + /* should never get here... */ + break; + } + + return procclk; +} + +void pmc_select_external_crystal(void) +{ + int return_to_sclock = 0; + + if (PMC->PMC_MCKR == PMC_MCKR_CSS(PMC_MCKR_CSS_SLOW_CLK)) { + pmc_switch_mck_to_main(); + return_to_sclock = 1; + } + + /* switch from internal RC 32kHz to external OSC 32 kHz */ + SCKC->SCKC_CR = (SCKC->SCKC_CR & ~SCKC_CR_OSCSEL) | SCKC_CR_OSCSEL_XTAL; + + /* Wait 5 slow clock cycles for internal resynchronization */ + volatile int count; + for (count = 0; count < 0x1000; count++); + + /* Switch to slow clock again if needed */ + if (return_to_sclock) + pmc_switch_mck_to_slck(); +} + +void pmc_select_internal_crystal(void) +{ + int return_to_sclock = 0; + + if (PMC->PMC_MCKR == PMC_MCKR_CSS(PMC_MCKR_CSS_SLOW_CLK)) { + pmc_switch_mck_to_main(); + return_to_sclock = 1; + } + + /* switch from extenal OSC 32kHz to internal RC 32 kHz */ + /* switch slow clock source to internal OSC 32 kHz */ + SCKC->SCKC_CR = (SCKC->SCKC_CR & ~SCKC_CR_OSCSEL) | SCKC_CR_OSCSEL_RC; + + /* Wait 5 slow clock cycles for internal resynchronization */ + volatile int count; + for (count = 0; count < 0x1000; count++); + + /* Switch to slow clock again if needed */ + if (return_to_sclock) + pmc_switch_mck_to_slck(); +} + +void pmc_select_external_osc(void) +{ + /* Enable external osc 12 MHz when needed */ + if ((PMC->CKGR_MOR & CKGR_MOR_MOSCXTEN) != CKGR_MOR_MOSCXTEN) { + PMC->CKGR_MOR |= CKGR_MOR_MOSCXTST(18) | CKGR_MOR_MOSCXTEN | CKGR_MOR_KEY_PASSWD; + /* Wait Main Oscillator ready */ + while(!(PMC->PMC_SR & PMC_SR_MOSCXTS)); + } + + /* Return if external osc had been selected */ + if ((PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) == CKGR_MOR_MOSCSEL) + return; + + /* switch MAIN clock to external OSC 12 MHz */ + PMC->CKGR_MOR |= CKGR_MOR_MOSCSEL | CKGR_MOR_KEY_PASSWD; + + /* wait for the command to be taken into account */ + while ((PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) != CKGR_MOR_MOSCSEL); + + /* wait MAIN clock status change for external OSC 12 MHz selection */ + while (!(PMC->PMC_SR & PMC_SR_MOSCSELS)); + + /* disable internal RC 12 MHz to save power */ + pmc_disable_internal_osc(); +} + +void pmc_disable_external_osc(void) +{ + /* disable external OSC 12 MHz */ + PMC->CKGR_MOR = (PMC->CKGR_MOR & ~CKGR_MOR_MOSCXTEN) | CKGR_MOR_KEY_PASSWD; +} + +void pmc_select_internal_osc(void) +{ +#ifdef CKGR_MOR_MOSCRCEN + /* Enable internal RC 12 MHz when needed */ + if ((PMC->CKGR_MOR & CKGR_MOR_MOSCRCEN) != CKGR_MOR_MOSCRCEN) { + PMC->CKGR_MOR |= CKGR_MOR_MOSCRCEN | CKGR_MOR_KEY_PASSWD; + /* Wait internal 12 MHz RC Startup Time for clock stabilization */ + while (!(PMC->PMC_SR & PMC_SR_MOSCRCS)); + } +#endif + + /* switch MAIN clock to internal RC 12 MHz */ + PMC->CKGR_MOR = (PMC->CKGR_MOR & ~CKGR_MOR_MOSCSEL) | CKGR_MOR_KEY_PASSWD; + + /* in case where MCK is running on MAIN CLK */ + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); + + /* disable external OSC 12 MHz to save power*/ + pmc_disable_external_osc(); +} + +void pmc_disable_internal_osc(void) +{ +#ifdef CKGR_MOR_MOSCRCEN + /* disable internal RC 12 MHz */ + PMC->CKGR_MOR = (PMC->CKGR_MOR & ~CKGR_MOR_MOSCRCEN) | CKGR_MOR_KEY_PASSWD; +#endif +} + +void pmc_switch_mck_to_pll(void) +{ + /* Select PLL as input clock for PCK and MCK */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_PLLA_CLK; + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); + + _pmc_mck = 0; +} + +void pmc_switch_mck_to_upll(void) +{ + /* Select UPLL as input clock for PCK and MCK */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_UPLL_CLK; + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); + + _pmc_mck = 0; +} + +void pmc_switch_mck_to_main(void) +{ + /* Select Main Oscillator as input clock for PCK and MCK */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_PCK_CSS_MAIN_CLK; + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); + + _pmc_mck = 0; +} + +void pmc_switch_mck_to_slck(void) +{ + /* Select Slow Clock as input clock for PCK and MCK */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_PCK_CSS_SLOW_CLK; + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); + + _pmc_mck = 0; +} + +void pmc_set_mck_prescaler(uint32_t prescaler) +{ + /* Change MCK Prescaler divider in PMC_MCKR register */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_PRES_Msk) | prescaler; + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); +} + +void pmc_set_mck_plla_div(uint32_t divider) +{ + if ((PMC->PMC_MCKR & PMC_MCKR_PLLADIV2) == PMC_MCKR_PLLADIV2) { + if (divider == 0) { + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_PLLADIV2); + } + } else { + if (divider == PMC_MCKR_PLLADIV2) { + PMC->PMC_MCKR = (PMC->PMC_MCKR | PMC_MCKR_PLLADIV2); + } + } + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); +} + +void pmc_set_mck_h32mxdiv(uint32_t divider) +{ + if ((PMC->PMC_MCKR & PMC_MCKR_H32MXDIV) == PMC_MCKR_H32MXDIV_H32MXDIV2) { + if (divider == PMC_MCKR_H32MXDIV_H32MXDIV1) { + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_H32MXDIV); + } + } else { + if (divider == PMC_MCKR_H32MXDIV_H32MXDIV2) { + PMC->PMC_MCKR = (PMC->PMC_MCKR | PMC_MCKR_H32MXDIV_H32MXDIV2); + } + } + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); +} + +void pmc_set_mck_divider(uint32_t divider) +{ + /* change MCK Prescaler divider in PMC_MCKR register */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~PMC_MCKR_MDIV_Msk) | divider; + while (!(PMC->PMC_SR & PMC_SR_MCKRDY)); +} + +void pmc_set_plla(uint32_t pll, uint32_t cpcr) +{ + PMC->CKGR_PLLAR = pll; + PMC->PMC_PLLICPR = cpcr; + + if ((pll & CKGR_PLLAR_DIVA_Msk) != CKGR_PLLAR_DIVA_0) { + while (!(PMC->PMC_SR & PMC_SR_LOCKA)); + } +} + +void pmc_disable_plla(void) +{ + PMC->CKGR_PLLAR = (PMC->CKGR_PLLAR & ~CKGR_PLLAR_MULA_Msk) | CKGR_PLLAR_MULA(0); +} + +void pmc_enable_system_clock(enum _pmc_system_clock clock) +{ + uint32_t scer, scsr; + if (!_pmc_get_system_clock_bits(clock, &scer, NULL, &scsr)) + return; + + PMC->PMC_SCER |= scer; + while (!(PMC->PMC_SCSR & scsr)); +} + +void pmc_disable_system_clock(enum _pmc_system_clock clock) +{ + uint32_t scdr, scsr; + if (!_pmc_get_system_clock_bits(clock, NULL, &scdr, &scsr)) + return; + + PMC->PMC_SCDR |= scdr; + while (PMC->PMC_SCSR & scsr); +} + +#ifdef CONFIG_HAVE_PMC_FAST_STARTUP +void pmc_set_fast_startup_mode(uint32_t startup_mode) +{ + PMC->PMC_FSMR = startup_mode; +} + +void pmc_set_fast_startup_polarity(uint32_t high_level, uint32_t low_level) +{ + PMC->PMC_FSPR &= ~low_level; + PMC->PMC_FSPR |= high_level; +} +#endif /* CONFIG_HAVE_PMC_FAST_STARTUP */ + +void pmc_set_custom_pck_mck(struct pck_mck_cfg *cfg) +{ + pmc_switch_mck_to_slck(); + + if (cfg->ext12m) + pmc_select_external_osc(); + else + pmc_select_internal_osc(); + + pmc_switch_mck_to_main(); + + if (cfg->ext32k) + pmc_select_external_crystal(); + else + pmc_select_internal_crystal(); + + pmc_set_mck_prescaler(cfg->pck_pres); + pmc_set_mck_divider(cfg->mck_div); + + pmc_set_mck_plla_div(cfg->plla_div2 ? PMC_MCKR_PLLADIV2 : 0); + if (cfg->plla_mul > 0) { + pmc_disable_plla(); + uint32_t tmp = CKGR_PLLAR_ONE | + CKGR_PLLAR_PLLACOUNT(0x3F) | + CKGR_PLLAR_OUTA(0x0) | + CKGR_PLLAR_MULA(cfg->plla_mul) | + CKGR_PLLAR_DIVA(cfg->plla_div); + pmc_set_plla(tmp, PMC_PLLICPR_IPLL_PLLA(0x3)); + } else { + pmc_disable_plla(); + } + + if (cfg->h32mxdiv2) + pmc_set_mck_h32mxdiv(PMC_MCKR_H32MXDIV_H32MXDIV2); + else + pmc_set_mck_h32mxdiv(PMC_MCKR_H32MXDIV_H32MXDIV1); + + switch (cfg->pck_input) { + case PMC_MCKR_CSS_PLLA_CLK: + pmc_switch_mck_to_pll(); + break; + + case PMC_MCKR_CSS_UPLL_CLK: + pmc_switch_mck_to_upll(); + break; + + case PMC_MCKR_CSS_SLOW_CLK: + pmc_switch_mck_to_slck(); + pmc_disable_internal_osc(); + pmc_disable_external_osc(); + break; + } +} + +/*---------------------------------------------------------------------------- + * Exported functions (Peripherals) + *----------------------------------------------------------------------------*/ + +void pmc_enable_peripheral(uint32_t id) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + + PMC->PMC_PCR = pcr | PMC_PCR_CMD | PMC_PCR_EN; +} + +void pmc_disable_peripheral(uint32_t id) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + + PMC->PMC_PCR = PMC_PCR_CMD | (pcr & ~PMC_PCR_EN); +} + +uint32_t pmc_is_peripheral_enabled(uint32_t id) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + + return !!(pcr & PMC_PCR_EN); +} + +uint32_t pmc_get_peripheral_clock(uint32_t id) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + + uint32_t div = get_peripheral_clock_divider(id); + if (div) + return pmc_get_master_clock() / div; + + return 0; +} + +void pmc_disable_all_peripherals(void) +{ + int i; + for (i = 2; i < ID_PERIPH_COUNT; i++) + pmc_disable_peripheral(i); +} + +/*---------------------------------------------------------------------------- + * Exported functions (PCK0-2) + *----------------------------------------------------------------------------*/ + +void pmc_configure_pck0(uint32_t clock_source, uint32_t prescaler) +{ + pmc_disable_pck0(); + PMC->PMC_PCK[0] = (clock_source & PMC_PCK_CSS_Msk) | PMC_PCK_PRES(prescaler); +} + +void pmc_enable_pck0(void) +{ + PMC->PMC_SCER = PMC_SCER_PCK0; + while (!(PMC->PMC_SR & PMC_SR_PCKRDY0)); +} + +void pmc_disable_pck0(void) +{ + PMC->PMC_SCDR = PMC_SCDR_PCK0; + while (PMC->PMC_SCSR & PMC_SCSR_PCK0); +} + +uint32_t pmc_get_pck0_clock(void) +{ + return _pmc_get_pck_clock(0); +} + +void pmc_configure_pck1(uint32_t clock_source, uint32_t prescaler) +{ + pmc_disable_pck1(); + PMC->PMC_PCK[1] = (clock_source & PMC_PCK_CSS_Msk) | PMC_PCK_PRES(prescaler); +} + +void pmc_enable_pck1(void) +{ + PMC->PMC_SCER = PMC_SCER_PCK1; + while (!(PMC->PMC_SR & PMC_SR_PCKRDY1)); +} + +void pmc_disable_pck1(void) +{ + PMC->PMC_SCDR = PMC_SCDR_PCK1; + while (PMC->PMC_SCSR & PMC_SCSR_PCK1); +} + +uint32_t pmc_get_pck1_clock(void) +{ + return _pmc_get_pck_clock(1); +} + +void pmc_configure_pck2(uint32_t clock_source, uint32_t prescaler) +{ + pmc_disable_pck2(); + PMC->PMC_PCK[2] = (clock_source & PMC_PCK_CSS_Msk) | PMC_PCK_PRES(prescaler); +} + +void pmc_enable_pck2(void) +{ + PMC->PMC_SCER = PMC_SCER_PCK2; + while (!(PMC->PMC_SR & PMC_SR_PCKRDY2)); +} + +void pmc_disable_pck2(void) +{ + PMC->PMC_SCDR = PMC_SCDR_PCK2; + while (PMC->PMC_SCSR & PMC_SCSR_PCK2); +} + +uint32_t pmc_get_pck2_clock(void) +{ + return _pmc_get_pck_clock(2); +} + +/*---------------------------------------------------------------------------- + * Exported functions (UPLL) + *----------------------------------------------------------------------------*/ + +void pmc_enable_upll_clock(void) +{ + /* enable 480Mhz UPLL */ + PMC->CKGR_UCKR = CKGR_UCKR_UPLLEN | CKGR_UCKR_UPLLCOUNT(0x3) + | CKGR_UCKR_BIASCOUNT(0x1); + + /* wait until UPLL is locked */ + while (!(PMC->PMC_SR & PMC_SR_LOCKU)); +} + +void pmc_disable_upll_clock(void) +{ + PMC->CKGR_UCKR &= ~CKGR_UCKR_UPLLEN; +} + +uint32_t pmc_get_upll_clock(void) +{ +#ifdef SFR_UTMICKTRIM_FREQ_Msk + uint32_t clktrim = SFR->SFR_UTMICKTRIM & SFR_UTMICKTRIM_FREQ_Msk; + switch (clktrim) { + case SFR_UTMICKTRIM_FREQ_16: + return 30 * BOARD_MAIN_CLOCK_EXT_OSC; + case SFR_UTMICKTRIM_FREQ_24: + return 20 * BOARD_MAIN_CLOCK_EXT_OSC; + default: + return 40 * BOARD_MAIN_CLOCK_EXT_OSC; + } +#else + return 40 * BOARD_MAIN_CLOCK_EXT_OSC; +#endif +} + +void pmc_enable_upll_bias(void) +{ + PMC->CKGR_UCKR |= CKGR_UCKR_BIASEN; +} + +void pmc_disable_upll_bias(void) +{ + PMC->CKGR_UCKR &= ~CKGR_UCKR_BIASEN; +} + +/*---------------------------------------------------------------------------- + * Exported functions (Generated clocks) + *----------------------------------------------------------------------------*/ + +#ifdef CONFIG_HAVE_PMC_GENERATED_CLOCKS +void pmc_configure_gck(uint32_t id, uint32_t clock_source, uint32_t div) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + assert(!(clock_source & ~PMC_PCR_GCKCSS_Msk)); + assert(!(div << PMC_PCR_GCKDIV_Pos & ~PMC_PCR_GCKDIV_Msk)); + + pmc_disable_gck(id); + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + PMC->PMC_PCR = pcr | (clock_source & PMC_PCR_GCKCSS_Msk) | PMC_PCR_CMD + | PMC_PCR_GCKDIV(div); +} + +void pmc_enable_gck(uint32_t id) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + PMC->PMC_PCR = pcr | PMC_PCR_CMD | PMC_PCR_GCKEN; + while (!(PMC->PMC_SR & PMC_SR_GCKRDY)); +} + +void pmc_disable_gck(uint32_t id) +{ + assert(id > 1 && id < ID_PERIPH_COUNT); + + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + PMC->PMC_PCR = PMC_PCR_CMD | (pcr & ~PMC_PCR_GCKEN); +} + +uint32_t pmc_get_gck_clock(uint32_t id) +{ + uint32_t clk = 0; + assert(id > 1 && id < ID_PERIPH_COUNT); + + PMC->PMC_PCR = PMC_PCR_PID(id); + volatile uint32_t pcr = PMC->PMC_PCR; + + switch (pcr & PMC_PCR_GCKCSS_Msk) { + case PMC_PCR_GCKCSS_SLOW_CLK: + clk = pmc_get_slow_clock(); + break; + case PMC_PCR_GCKCSS_MAIN_CLK: + clk = pmc_get_main_clock(); + break; + case PMC_PCR_GCKCSS_PLLA_CLK: + clk = pmc_get_plla_clock(); + break; + case PMC_PCR_GCKCSS_UPLL_CLK: + clk = pmc_get_upll_clock(); + break; + case PMC_PCR_GCKCSS_MCK_CLK: + clk = pmc_get_master_clock(); + break; +#ifdef CONFIG_HAVE_PMC_AUDIO_CLOCK + case PMC_PCR_GCKCSS_AUDIO_CLK: + clk = pmc_get_audio_pmc_clock(); + break; +#endif + } + + uint32_t div = (pcr & PMC_PCR_GCKDIV_Msk) >> PMC_PCR_GCKDIV_Pos; + return ROUND_INT_DIV(clk, div + 1); +} +#endif /* CONFIG_HAVE_PMC_GENERATED_CLOCKS */ + +/*---------------------------------------------------------------------------- + * Exported functions (Audio PLL) + *----------------------------------------------------------------------------*/ + +#ifdef CONFIG_HAVE_PMC_AUDIO_CLOCK +void pmc_configure_audio(struct _pmc_audio_cfg *cfg) +{ + /* reset audio clock */ + PMC->PMC_AUDIO_PLL0 &= ~PMC_AUDIO_PLL0_RESETN; + PMC->PMC_AUDIO_PLL0 |= PMC_AUDIO_PLL0_RESETN; + + /* configure values */ + uint32_t pll0 = PMC->PMC_AUDIO_PLL0; + pll0 &= ~PMC_AUDIO_PLL0_ND_Msk; + pll0 |= cfg->nd << PMC_AUDIO_PLL0_ND_Pos; + pll0 &= ~PMC_AUDIO_PLL0_QDPMC_Msk; + pll0 |= cfg->qdpmc << PMC_AUDIO_PLL0_QDPMC_Pos; + PMC->PMC_AUDIO_PLL0 = pll0; + uint32_t pll1 = PMC->PMC_AUDIO_PLL1; + pll1 &= ~PMC_AUDIO_PLL1_DIV_Msk; + pll1 |= cfg->div << PMC_AUDIO_PLL1_DIV_Pos; + pll1 &= ~PMC_AUDIO_PLL1_FRACR_Msk; + pll1 |= cfg->fracr << PMC_AUDIO_PLL1_FRACR_Pos; + pll1 &= ~PMC_AUDIO_PLL1_QDAUDIO_Msk; + pll1 |= cfg->qdaudio << PMC_AUDIO_PLL1_QDAUDIO_Pos; + PMC->PMC_AUDIO_PLL1 = pll1; +} + +void pmc_enable_audio(bool pmc_clock, bool pad_clock) +{ + uint32_t bits = PMC_AUDIO_PLL0_PLLEN | PMC_AUDIO_PLL0_RESETN; + uint32_t nbits = 0; + + if (pad_clock) + bits |= PMC_AUDIO_PLL0_PADEN; + else + nbits |= PMC_AUDIO_PLL0_PADEN; + + if (pmc_clock) + bits |= PMC_AUDIO_PLL0_PMCEN; + else + nbits |= PMC_AUDIO_PLL0_PMCEN; + + PMC->PMC_AUDIO_PLL0 = (PMC->PMC_AUDIO_PLL0 & ~nbits) | bits; +} + +void pmc_disable_audio() +{ + uint32_t nbits = PMC_AUDIO_PLL0_PLLEN | PMC_AUDIO_PLL0_RESETN | + PMC_AUDIO_PLL0_PADEN | PMC_AUDIO_PLL0_PMCEN; + PMC->PMC_AUDIO_PLL0 &= ~nbits; +} + +uint32_t pmc_get_audio_pmc_clock(void) +{ + uint32_t pll0 = PMC->PMC_AUDIO_PLL0; + uint32_t pll1 = PMC->PMC_AUDIO_PLL1; + + uint32_t nd = (pll0 & PMC_AUDIO_PLL0_ND_Msk) >> PMC_AUDIO_PLL0_ND_Pos; + uint32_t fracr = (pll1 & PMC_AUDIO_PLL1_FRACR_Msk) >> PMC_AUDIO_PLL1_FRACR_Pos; + uint32_t qdpmc = (pll0 & PMC_AUDIO_PLL0_QDPMC_Msk) >> PMC_AUDIO_PLL0_QDPMC_Pos; + + uint64_t clk = BOARD_MAIN_CLOCK_EXT_OSC; + clk *= ((nd + 1) << 22) + fracr; + clk /= 1 << 22; + clk /= qdpmc + 1; + return (uint32_t)clk; +} + +uint32_t pmc_get_audio_pad_clock(void) +{ + uint32_t pll0 = PMC->PMC_AUDIO_PLL0; + uint32_t pll1 = PMC->PMC_AUDIO_PLL1; + + uint32_t nd = (pll0 & PMC_AUDIO_PLL0_ND_Msk) >> PMC_AUDIO_PLL0_ND_Pos; + uint32_t fracr = (pll1 & PMC_AUDIO_PLL1_FRACR_Msk) >> PMC_AUDIO_PLL1_FRACR_Pos; + uint32_t qdaudio = (pll1 & PMC_AUDIO_PLL1_QDAUDIO_Msk) >> PMC_AUDIO_PLL1_QDAUDIO_Pos; + if (qdaudio == 0) + return 0; + + uint32_t div = (pll1 & PMC_AUDIO_PLL1_DIV_Msk) >> PMC_AUDIO_PLL1_DIV_Pos; + if (div != 2 && div != 3) + return 0; + + uint64_t clk = BOARD_MAIN_CLOCK_EXT_OSC; + clk *= ((nd + 1) << 22) + fracr; + clk /= 1 << 22; + clk /= div * qdaudio; + return (uint32_t)clk; +} +#endif /* CONFIG_HAVE_PMC_AUDIO_CLOCK */ + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.h new file mode 100644 index 000000000..8d79a45c8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmc.h @@ -0,0 +1,466 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _PMC_H_ +#define _PMC_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" + +#include + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +struct pck_mck_cfg { + /** PLL A, SLCK, MAIN, UPLL */ + uint32_t pck_input; + + /** RC12M (false) or EXT12M (true) */ + bool ext12m; + + /** RC32K (false) or EXT32K (true) */ + bool ext32k; + + /** PLLA MUL value in PMC PLL register */ + uint32_t plla_mul; + + /** PLLA DIV value in PMC PLL register */ + uint32_t plla_div; + + /** PLLA DIV value by 2 */ + bool plla_div2; + + /** Master/Processor Clock Prescaler */ + uint32_t pck_pres; + + /** Master Clock Division after Prescaler divider */ + uint32_t mck_div; + + /** true if the AHB 32-bit Matrix frequency is equal to the AHB 64-bit Matrix frequency divided by 2 */ + bool h32mxdiv2; +}; + +/** + * \brief System clock identifiers, used for pmc_{enable,disable}_system_clock + */ +enum _pmc_system_clock { + PMC_SYSTEM_CLOCK_PCK, + PMC_SYSTEM_CLOCK_DDR, + PMC_SYSTEM_CLOCK_LCD, + PMC_SYSTEM_CLOCK_SMD, + PMC_SYSTEM_CLOCK_UHP, + PMC_SYSTEM_CLOCK_UDP, + PMC_SYSTEM_CLOCK_PCK0, + PMC_SYSTEM_CLOCK_PCK1, + PMC_SYSTEM_CLOCK_PCK2, + PMC_SYSTEM_CLOCK_ISC, +}; + +#ifdef CONFIG_HAVE_PMC_AUDIO_CLOCK +/** + * \brief Configuration data for Audio clock + * + * AUDIOPLLCK = BOARD_EXT_OSC * (nd + 1 + (fracr / 2^22)) / (qdpmc + 1) + * AUDIOPINCLK = BOARD_EXT_OSC * (nc + 1 + (fracr / 2^22)) / (div * qdaudio) + */ +struct _pmc_audio_cfg { + uint32_t nd; + uint32_t fracr; + uint32_t qdpmc; + uint32_t div; + uint32_t qdaudio; +}; +#endif /* CONFIG_HAVE_PMC_AUDIO_CLOCK */ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Configure PCK and MCK with custom setting + */ +extern void pmc_set_custom_pck_mck(struct pck_mck_cfg *cfg); + +/** + * \brief Get the configured frequency of the master clock + * \return master clock frequency in Hz + */ +extern uint32_t pmc_get_master_clock(void); + +/** + * \brief Get the configured frequency of the slow clock + * \return slow clock frequency in Hz + */ +extern uint32_t pmc_get_slow_clock(void); + +/** + * \brief Get the configured frequency of the main clock + * \return main clock frequency in Hz + */ +extern uint32_t pmc_get_main_clock(void); + +/** + * \brief Get the configured frequency of the PLLA clock + * \return PLLA clock frequency in Hz + */ +extern uint32_t pmc_get_plla_clock(void); + +/** + * \brief Get the configured frequency of the processor clock + * \return processor clock frequency in Hz + */ +extern uint32_t pmc_get_processor_clock(void); + +/** + * \brief Select external 32K crystal. + */ +extern void pmc_select_external_crystal(void); + +/** + * \brief Select internal 32K crystal. + */ +extern void pmc_select_internal_crystal(void); + +/** + * \brief Select external 12M OSC. + */ +extern void pmc_select_external_osc(void); + +/** + * \brief Disable external 12M OSC. + */ +extern void pmc_disable_external_osc(void); + +/** + * \brief Select internal 12M OSC. + */ +extern void pmc_select_internal_osc(void); + +/** + * \brief Disable internal 12M OSC. + */ +extern void pmc_disable_internal_osc(void); + +/** + * \brief Switch PMC from MCK to PLL clock. + */ +extern void pmc_switch_mck_to_pll(void); + +/** + * \brief Switch PMC from MCK to UPLL clock. + */ +extern void pmc_switch_mck_to_upll(void); + +/** + * \brief Switch PMC from MCK to main clock. + */ +extern void pmc_switch_mck_to_main(void); + +/** + * \brief Switch PMC from MCK to slow clock. + */ +extern void pmc_switch_mck_to_slck(void); + +/** + * \brief Configure PLL Register. + * \param pll pll value. + * \param cpcr cpcr value. + */ +extern void pmc_set_plla(uint32_t pll, uint32_t cpcr); + +/** + * \brief Configure MCK Prescaler. + * \param prescaler prescaler value. + */ +extern void pmc_set_mck_prescaler(uint32_t prescaler); + +/** + * \brief Configure MCK Divider. + * \param divider divider value. + */ +extern void pmc_set_mck_divider(uint32_t divider); + +/** + * \brief Configure MCK H32MXDIV. + * \param divider divider value. + */ +extern void pmc_set_mck_h32mxdiv(uint32_t divider); + +/** + * \brief Configure MCK PLLA divider. + * \param divider PLL divider value. + */ +extern void pmc_set_mck_plla_div(uint32_t divider); + +/** + * \brief Disable PLLA Register. + */ +extern void pmc_disable_plla(void); + +/** + * \brief Enables a system clock + * \param clock system clock to enable + */ +extern void pmc_enable_system_clock(enum _pmc_system_clock clock); + +/** + * \brief Disables a system clock + * \param clock system clock to disable + */ +extern void pmc_disable_system_clock(enum _pmc_system_clock clock); + +#ifdef CONFIG_HAVE_PMC_FAST_STARTUP +/** + * \brief Set up fast startup mode + * \param source and low power mode + */ +extern void pmc_set_fast_startup_mode(uint32_t startup_mode); + +/** + * \brief Set up fast startup polarity + * \param level + */ +extern void pmc_set_fast_startup_polarity(uint32_t high_level, + uint32_t low_level); +#endif /* CONFIG_HAVE_PMC_FAST_STARTUP */ + +/** + * \brief Enables the clock of a peripheral. The peripheral ID is used + * to identify which peripheral is targeted. + * + * \param id Peripheral ID (ID_xxx). + */ +extern void pmc_enable_peripheral(uint32_t id); + +/** + * \brief Disables the clock of a peripheral. The peripheral ID is used + * to identify which peripheral is targeted. + * + * \param id Peripheral ID (ID_xxx). + */ +extern void pmc_disable_peripheral(uint32_t id); + +/** + * \brief Get Peripheral Status for the given peripheral ID. + * + * \param id Peripheral ID (ID_xxx). + */ +extern uint32_t pmc_is_peripheral_enabled(uint32_t id); + +/** + * \brief Get current frequency clock for the given peripheral ID. + * + * \param id Peripheral ID (ID_xxx). + */ +extern uint32_t pmc_get_peripheral_clock(uint32_t id); + +/** + * \brief Disable clocks for all peripherals + */ +extern void pmc_disable_all_peripherals(void); + +/** + * \brief Configure programmable clock 0 (PCK0) with the given master clock + * source and clock prescaler + * \param clock_source clock source selection (one of the PMC_PCK_CSS_xxx_CLK + * constants) + * \param prescaler prescaler + */ +extern void pmc_configure_pck0(uint32_t clock_source, uint32_t prescaler); + +/** + * \brief Enable programmable clock 0 (PCK0) + */ +extern void pmc_enable_pck0(void); + +/** + * \brief Disable programmable clock 0 (PCK0) + */ +extern void pmc_disable_pck0(void); + +/** + * \brief Get the frequency of the programmable clock 0 (PCK0) + * \return PCK0 frequency in Hz + */ +extern uint32_t pmc_get_pck0_clock(void); + +/** + * \brief Configure programmable clock 1 (PCK1) with the given master clock + * source and clock prescaler + * \param clock_source Clock source selection (one of the PMC_PCK_CSS_xxx_CLK + * constants) + * \param prescaler Prescaler value + */ +extern void pmc_configure_pck1(uint32_t clock_source, uint32_t prescaler); + +/** + * \brief Enable programmable clock 1 (PCK1) + */ +extern void pmc_enable_pck1(void); + +/** + * \brief Disable programmable clock 1 (PCK1) + */ +extern void pmc_disable_pck1(void); + +/** + * \brief Get the frequency of the programmable clock 1 (PCK1) + * \return PCK1 Frequency in Hz + */ +extern uint32_t pmc_get_pck1_clock(void); + +/** + * \brief Configure programmable clock 2 (PCK2) with the given master clock + * source and clock prescaler + * \param clock_source Clock source selection (one of the PMC_PCK_CSS_xxx_CLK + * constants) + * \param prescaler Prescaler value + */ +extern void pmc_configure_pck2(uint32_t clock_source, uint32_t prescaler); + +/** + * \brief Enable programmable clock 2 (PCK2) + */ +extern void pmc_enable_pck2(void); + +/** + * \brief Disable programmable clock 2 (PCK2) + */ +extern void pmc_disable_pck2(void); + +/** + * \brief Get the frequency of the programmable clock 2 (PCK2) + * \return PCK2 Frequency in Hz + */ +extern uint32_t pmc_get_pck2_clock(void); + +/** + * \brief Enable the UPLL clock + */ +extern void pmc_enable_upll_clock(void); + +/** + * \brief Disable the UPLL clock + */ +extern void pmc_disable_upll_clock(void); + +/** + * \brief Get the frequency of the UPLL clock + * \return UPLL clock frequency in Hz + */ +extern uint32_t pmc_get_upll_clock(void); + +/** + * \brief Enable the UPLL clock bias + */ +extern void pmc_enable_upll_bias(void); + +/** + * \brief Disable the UPLL clock bias + */ +extern void pmc_disable_upll_bias(void); + +#ifdef CONFIG_HAVE_PMC_GENERATED_CLOCKS +/** + * \brief Configure the generated clock (GCK) for the given peripheral with the + * given master clock source and clock prescaler + * \param id Peripheral ID (ID_xxx) + * \param clock_source Clock source selection (one of the + * PMC_PCR_GCKCSS_xxx_CLK constants) + * \param div Generated Clock Division Ratio (selected clock is divided by + * div + 1) + */ +extern void pmc_configure_gck(uint32_t id, uint32_t clock_source, uint32_t div); + +/** + * \brief Enable generated clock for the given peripheral + * \param id Peripheral ID (ID_xxx) + */ +extern void pmc_enable_gck(uint32_t id); + +/** + * \brief Disable generated clock for the given peripheral + * \param id Peripheral ID (ID_xxx) + */ +extern void pmc_disable_gck(uint32_t id); + +/** + * \brief Get the frequency of the generated clock (GCK) for the given + * peripheral + * \param id Peripheral ID (ID_xxx) + * \return GCK Frequency in Hz + */ +extern uint32_t pmc_get_gck_clock(uint32_t id); +#endif /* CONFIG_HAVE_PMC_GENERATED_CLOCKS */ + +#ifdef CONFIG_HAVE_PMC_AUDIO_CLOCK +/** + * \brief Configure the audio clock + */ +extern void pmc_configure_audio(struct _pmc_audio_cfg *cfg); + +/** + * \brief Enable audio clocks + * \param pmc_clock if true AUDIOPLLCK is sent to the PMC + * \param pad_clock if true the external audio pin is driven by AUDIOPINCLK, if + * false the audio pin is driven low + */ +extern void pmc_enable_audio(bool pmc_clock, bool pad_clock); + +/** + * \brief Disable audio clocks + */ +extern void pmc_disable_audio(void); + +/** + * \brief Get the frequency of the audio PMC clock + * \return Audio PMC Frequency in Hz + */ +extern uint32_t pmc_get_audio_pmc_clock(void); + +/** + * \brief Get the frequency of the audio pad clock + * \return Audio pad Frequency in Hz + */ +extern uint32_t pmc_get_audio_pad_clock(void); +#endif /* CONFIG_HAVE_PMC_AUDIO_CLOCK */ + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _PMC_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.c new file mode 100644 index 000000000..2760569f8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.c @@ -0,0 +1,749 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2012, Atmel Corporation + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "trace.h" + +#include "peripherals/pmecc.h" +#include "peripherals/pmecc_gallois_field_512.h" +#include "peripherals/pmecc_gallois_field_1024.h" + +/*--------------------------------------------------------------------------- */ +/* Local types */ +/*--------------------------------------------------------------------------- */ + +/** PMECC configuration descriptor */ +struct _pmecc_descriptor { + /** Number of Sectors in one Page */ + uint32_t page_size; + + /** The spare area size is equal to (SPARESIZE+1) bytes */ + uint32_t spare_size; + + /** 0 for 512, 1 for 1024 bytes, like in PMECCFG register */ + uint32_t sector_size; + + /** Coded value of ECC bit number correction + * 0 (2 bits), 1 (4 bits), 2 (8 bits), 3 (12 bits), 4 (24 bits), 5 (NU)) */ + uint32_t err_bit_nbr_capability; + + /** Real size in bytes of ECC in spare */ + uint32_t ecc_size_byte; + + /** The first byte address of the ECC area */ + uint32_t ecc_start_address; + + /** The last byte address of the ECC area */ + uint32_t ecc_end_address; + + /** NAND Write Access*/ + uint32_t nand_wr; + + /** Spare Enable */ + uint32_t spare_ena; + + /** Automatic Mode */ + uint32_t mode_auto; + + /** The PMECC Module data path Setup Time is set to CLKCTRL+1. */ + uint32_t clk_ctrl; + + /** */ + uint32_t interrupt; + + /** defines the error correcting capability selected at encoding/decoding time */ + int32_t tt; + + /** degree of the remainders, GF(2**mm) */ + int32_t mm; + + /** length of codeword = nn=2**mm -1 */ + int32_t nn; + + /** Gallois field table */ + const int16_t *alpha_to; + + /** Index of Gallois field table */ + const int16_t *index_of; + + /** */ + int16_t partial_syn[100]; + + /** Holds the current syndrome value, an element of that table belongs to the field.*/ + int16_t si[100]; + + /** sigma table */ + int16_t smu[PMECC_NB_ERROR_MAX + 2][2 * PMECC_NB_ERROR_MAX + 1]; + + /** polynom order */ + int16_t lmu[PMECC_NB_ERROR_MAX + 1]; +}; + +/*--------------------------------------------------------------------------- */ +/* Local variables */ +/*--------------------------------------------------------------------------- */ + +/** Pmecc decriptor instance */ +struct _pmecc_descriptor pmecc_desc; + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + + /** + * \brief Build the pseudo syndromes table + * \param sector Targetted sector. + */ +static void gen_syn(uint32_t sector) +{ + int16_t *remainer; + uint32_t index; + + remainer = (int16_t*)&HSMC->SMC_REM[sector]; + for (index = 0; index < (uint32_t)pmecc_desc.tt; index++) { + /* Fill odd syndromes */ + pmecc_desc.partial_syn[1 + (2 * index)] = remainer[index]; + } +} + +/** + * \brief The substitute function evaluates the polynomial remainder, + * with different values of the field primitive elements. + */ +static uint32_t substitute(void) +{ + int32_t i, j; + int16_t *si; + int16_t *p_partial_syn = pmecc_desc.partial_syn; + const int16_t *alpha_to = pmecc_desc.alpha_to; + const int16_t *index_of = pmecc_desc.index_of; + + /* si[] is a table that holds the current syndrome value, an element of that table belongs to the field.*/ + si = pmecc_desc.si; + + for (i = 1; i < 2 * PMECC_NB_ERROR_MAX; i++) + si[i] = 0; + + /* Computation 2t syndromes based on S(x) */ + /* Odd syndromes */ + for (i = 1; i <= 2 * pmecc_desc.tt - 1; i = i + 2) { + si[i] = 0; + for (j = 0; j < pmecc_desc.mm; j++) { + if (p_partial_syn[i] & ((uint16_t)0x1 << j)) + si[i] = alpha_to[(i * j)] ^ si[i]; + } + } + /* Even syndrome = (Odd syndrome) ** 2 */ + for (i = 2; i <= 2 * pmecc_desc.tt; i = i + 2) { + j = i / 2; + if (si[j] == 0) { + si[i] = 0; + } else { + si[i] = alpha_to[(2 * index_of[si[j]]) % pmecc_desc.nn]; + } + } + return 0; +} + +/** + * \brief The substitute function finding the value of the error + * location polynomial. + */ +static uint32_t get_sigma(void) +{ + uint32_t dmu_0_count; + int32_t i, j, k; + int16_t *lmu = pmecc_desc.lmu; + int16_t *si = pmecc_desc.si; + int16_t tt = pmecc_desc.tt; + + int32_t mu[PMECC_NB_ERROR_MAX+1]; /* mu */ + int32_t dmu[PMECC_NB_ERROR_MAX+1]; /* discrepancy */ + int32_t delta[PMECC_NB_ERROR_MAX+1]; /* delta order */ + int32_t ro; /* index of largest delta */ + int32_t largest; + int32_t diff; + + dmu_0_count = 0; + + /* -- First Row -- */ + + /* Mu */ + mu[0] = -1; + /* Actually -1/2 */ + /* Sigma(x) set to 1 */ + + for (i = 0; i < (2 * PMECC_NB_ERROR_MAX + 1); i++) + pmecc_desc.smu[0][i] = 0; + pmecc_desc.smu[0][0] = 1; + + /* discrepancy set to 1 */ + dmu[0] = 1; + + /* polynom order set to 0 */ + lmu[0] = 0; + + /* delta set to -1 */ + delta[0] = (mu[0] * 2 - lmu[0]) >> 1; + + /* -- Second Row -- */ + + /* Mu */ + mu[1] = 0; + + /* Sigma(x) set to 1 */ + for (i = 0; i < (2 * PMECC_NB_ERROR_MAX + 1); i++) + pmecc_desc.smu[1][i] = 0; + pmecc_desc.smu[1][0] = 1; + + /* discrepancy set to S1 */ + dmu[1] = si[1]; + + /* polynom order set to 0 */ + lmu[1] = 0; + + /* delta set to 0 */ + delta[1] = (mu[1] * 2 - lmu[1]) >> 1; + + /* Init the Sigma(x) last row */ + for (i = 0; i < (2 * PMECC_NB_ERROR_MAX + 1); i++) + pmecc_desc.smu[tt + 1][i] = 0; + + for (i = 1; i <= tt; i++) { + mu[i+1] = i << 1; + + /* Compute Sigma (Mu+1) */ + /* And L(mu) */ + /* check if discrepancy is set to 0 */ + if ( dmu[i] == 0) { + dmu_0_count++; + if (( tt - (lmu[i] >> 1) - 1) & 0x1) { + if (dmu_0_count == (uint32_t)((tt - (lmu[i] >> 1) - 1) / 2) + 2) { + for (j = 0; j <= (lmu[i] >> 1) + 1; j++) + pmecc_desc.smu[tt+1][j] = pmecc_desc.smu[i][j]; + lmu[tt + 1] = lmu[i]; + return 0; + } + } else { + if (dmu_0_count == (uint32_t)((tt - (lmu[i] >> 1) - 1) / 2) + 1) { + for (j = 0; j <= (lmu[i] >> 1) + 1; j++) + pmecc_desc.smu[tt + 1][j] = pmecc_desc.smu[i][j]; + lmu[tt + 1] = lmu[i]; + return 0; + } + } + + /* copy polynom */ + for (j = 0; j <= (lmu[i] >> 1); j++) + pmecc_desc.smu[i + 1][j] = pmecc_desc.smu[i][j]; + + /* copy previous polynom order to the next */ + lmu[i + 1] = lmu[i]; + } else { + /* find largest delta with dmu != 0 */ + ro = 0; + largest = -1; + for (j = 0; j < i; j++) { + if (dmu[j]) { + if (delta[j] > largest) { + largest = delta[j]; + ro = j; + } + } + } + + /* compute difference */ + diff = (mu[i] - mu[ro]); + + /* Compute degree of the new smu polynomial */ + if ((lmu[i] >> 1) > ((lmu[ro] >> 1) + diff)) + lmu[i + 1] = lmu[i]; + else + lmu[i + 1] = ((lmu[ro] >> 1) + diff) * 2; + + /* Init smu[i+1] with 0 */ + for (k = 0; k < (2 * PMECC_NB_ERROR_MAX + 1); k++) + pmecc_desc.smu[i+1][k] = 0; + + /* Compute smu[i+1] */ + for (k = 0; k <= (lmu[ro] >> 1); k++) { + if (pmecc_desc.smu[ro][k] && dmu[i]) + pmecc_desc.smu[i + 1][k + diff] = pmecc_desc.alpha_to[(pmecc_desc.index_of[dmu[i]] + + (pmecc_desc.nn - pmecc_desc.index_of[dmu[ro]]) + + pmecc_desc.index_of[pmecc_desc.smu[ro][k]]) % pmecc_desc.nn]; + } + for (k = 0; k <= (lmu[i] >> 1); k++) + pmecc_desc.smu[i+1][k] ^= pmecc_desc.smu[i][k]; + } + + /*************************************************/ + /* End Compute Sigma (Mu+1) */ + /* And L(mu) */ + /*************************************************/ + /* In either case compute delta */ + delta[i + 1] = (mu[i + 1] * 2 - lmu[i + 1]) >> 1; + + /* Do not compute discrepancy for the last iteration */ + if (i < tt) { + for (k = 0 ; k <= (lmu[i + 1] >> 1); k++) { + if (k == 0) + dmu[i + 1] = si[2 * (i - 1) + 3]; + /* check if one operand of the multiplier is null, its index is -1 */ + else if (pmecc_desc.smu[i+1][k] && si[2 * (i - 1) + 3 - k]) + dmu[i + 1] = pmecc_desc.alpha_to[(pmecc_desc.index_of[pmecc_desc.smu[i + 1][k]] + + pmecc_desc.index_of[si[2 * (i - 1) + 3 - k]]) % pmecc_desc.nn] ^ dmu[i + 1]; + } + } + } + return 0; +} + +/** + * \brief Init the PMECC Error Location peripheral and start the error + * location processing + * \param sector_size_in_bits Size of the sector in bits. + * \return Number of errors + */ +static int32_t error_location (uint32_t sector_size_in_bits) +{ + uint32_t alphax; + uint32_t *sigma; + uint32_t error_number; + uint32_t nbr_of_roots; + + /* Disable PMECC Error Location IP */ + HSMC->HSMC_ELDIS |= 0xFFFFFFFF; + error_number = 0; + alphax = 0; + + sigma = (uint32_t*)&HSMC->HSMC_SIGMA0; + + for (alphax = 0; alphax <= (uint32_t)(pmecc_desc.lmu[pmecc_desc.tt + 1] >> 1); alphax++) { + *sigma++ = pmecc_desc.smu[pmecc_desc.tt + 1][alphax]; + error_number++; + } + + /* Enable error location process */ + HSMC->HSMC_ELCFG |= ((error_number - 1) << 16); + HSMC->HSMC_ELEN = sector_size_in_bits; + + while ((HSMC->HSMC_ELISR & HSMC_ELISR_DONE) == 0); + + nbr_of_roots = (HSMC->HSMC_ELISR & HSMC_ELISR_ERR_CNT_Msk) >> 8; + /* Number of roots == degree of smu hence <= tt */ + if (nbr_of_roots == (uint32_t)(pmecc_desc.lmu[pmecc_desc.tt + 1] >> 1)) + return (error_number - 1); + + /* Number of roots not match the degree of smu ==> unable to correct error */ + return -1; +} + +/** + * \brief Correct errors indicated in the PMECCEL error location registers. + * \param sector_base_address Base address of the sector. + * \param extra_bytes Number of extra bytes of the sector.(encoded Spare Area, only for the last sector) + * \param error_nbr Number of error to correct + * \return Number of errors + */ +static uint32_t error_correction(uint32_t sector_base_address, uint32_t extra_bytes, uint32_t error_nbr) +{ + uint32_t *error_pos; + uint32_t byte_pos; + uint32_t bit_pos; + uint32_t sector_size; + uint32_t ecc_size; + uint32_t ecc_end_addr; + + error_pos = (uint32_t*)&HSMC->HSMC_ERRLOC0; + + sector_size = 512 * (((HSMC->HSMC_PMECCFG & HSMC_PMECCFG_SECTORSZ) >> 4) + 1); + + /* Get number of ECC bytes */ + ecc_end_addr = HSMC->HSMC_PMECCEADDR; + ecc_size = (ecc_end_addr - HSMC->HSMC_PMECCSADDR) + 1; + + while (error_nbr) { + byte_pos = (*error_pos - 1) / 8; + bit_pos = (*error_pos - 1) % 8; + + /* If error is located in the data area(not in ECC) */ + if ( byte_pos < (sector_size + extra_bytes)) { + uint8_t *data_ptr = NULL; + + /* If the error position is before ECC area */ + if ( byte_pos < sector_size + HSMC->HSMC_PMECCSADDR) { + data_ptr = (uint8_t*)(sector_base_address + byte_pos); + } else { + data_ptr = (uint8_t*)(sector_base_address + byte_pos + ecc_size); + } + + trace_info("Correct error bit @[#Byte %u,Bit# %u]\n\r", + (unsigned)byte_pos, (unsigned)bit_pos); + + if (*data_ptr & (1 << bit_pos)) + *data_ptr &= (0xFF ^ (1 << bit_pos)); + else + *data_ptr |= (1 << bit_pos); + } + error_pos++; + error_nbr--; + } + return 0; +} + +/** + * \brief Configure the PMECC peripheral + * \param pPmeccDescriptor Pointer to a PmeccDescriptor instance. + */ +static void _pmecc_configure(void) +{ + /* Disable ECC module */ + HSMC->HSMC_PMECCTRL |= HSMC_PMECCTRL_DISABLE; + + /* Reset the ECC module */ + HSMC->HSMC_PMECCTRL = HSMC_PMECCTRL_RST; + HSMC->HSMC_PMECCFG = pmecc_desc.err_bit_nbr_capability | + pmecc_desc.sector_size | + pmecc_desc.page_size | + pmecc_desc.nand_wr | + pmecc_desc.spare_ena | + pmecc_desc.mode_auto; + HSMC->HSMC_PMECCSAREA = pmecc_desc.spare_size - 1; + HSMC->HSMC_PMECCSADDR = pmecc_desc.ecc_start_address; + HSMC->HSMC_PMECCEADDR = pmecc_desc.ecc_end_address - 1; + + /* Disable all interrupts */ + HSMC->HSMC_PMECCIDR = 0xFF; + + /* Enable ECC module */ + HSMC->HSMC_PMECCTRL |= HSMC_PMECCTRL_ENABLE; +} + + +/*---------------------------------------------------------------------------- + * Export functions + *----------------------------------------------------------------------------*/ + +/** + * \brief This function is able to build Galois Field. + * \param mm degree of the remainders. + * \param index_of Pointer to a buffer for index_of table. + * \param alpha_to Pointer to a buffer for alpha_to table. + */ +void build_gf(uint32_t mm, int32_t* index_of, int32_t* alpha_to) +{ + uint32_t i; + uint32_t mask; + uint32_t nn; + uint32_t p[15]; + + nn = (1 << mm) - 1; + /* set default value */ + for (i = 1; i < mm; i++) + p[i] = 0; + + /* 1 + X^mm */ + p[0] = 1; + p[mm] = 1; + + /* others */ + if (mm == 3) + p[1] = 1; + else if (mm == 4) + p[1] = 1; + else if (mm == 5) + p[2] = 1; + else if (mm == 6) + p[1] = 1; + else if (mm == 7) + p[3] = 1; + else if (mm == 8) + p[2] = p[3] = p[4] = 1; + else if (mm == 9) + p[4] = 1; + else if (mm == 10) + p[3] = 1; + else if (mm == 11) + p[2] = 1; + else if (mm == 12) + p[1] = p[4] = p[6] = 1; + else if (mm == 13) + p[1] = p[3] = p[4] = 1; + else if (mm == 14) + p[1] = p[6] = p[10] = 1; + else if (mm == 15) + p[1] = 1; + + /*-- First of All */ + /*-- build alpha ^ mm it will help to generate the field (primitiv) */ + alpha_to[mm] = 0; + for (i = 0; i < mm; i++) + if (p[i]) + alpha_to[mm] |= 1 << i; + + /* Secondly */ + /* Build elements from 0 to mm - 1 */ + /* very easy because degree is less than mm so it is */ + /* just a logical shift ! (only the remainder) */ + mask = 1; + for (i = 0; i < mm; i++) { + alpha_to[i] = mask; + index_of[alpha_to[i]] = i; + mask <<= 1; + } + + index_of[alpha_to[mm]] = mm; + + /* use a mask to select the MSB bit of the */ + /* LFSR ! */ + mask >>= 1; /* previous value moust be decremented */ + + /* then finish the building */ + for (i = mm + 1; i <= nn; i++) { + /* check if the msb bit of the lfsr is set */ + if (alpha_to[i-1] & mask) + /* feedback loop is set */ + alpha_to[i] = alpha_to[mm] ^ ((alpha_to[i-1] ^ mask) << 1); + else + /* only shift is enabled */ + alpha_to[i] = alpha_to[i-1] << 1; + /* lookup table */ + //index_of[alpha_to[i]] = i ; + index_of[alpha_to[i]] = i%nn ; + } + /* of course index of 0 is undefined in a multiplicative field */ + index_of[0] = -1; +} + +/** + * \brief Initialize the PMECC peripheral + * \param sector_size 0 for 512, 1 for 1024. + * \param ecc_errors_per_sector Coded value of ECC bit number correction(2,4,8,12,24). + * \param page_data_size Data area size in byte. + * \param page_spare_size Spare area size in byte. + * \param ecc_offset_in_spare offset of the first ecc byte in spare zone. + * \param spare_protected 1: The spare area is protected with the last sector of data. + * 0: The spare area is skipped in read or write mode. + * \return 0 if successful; otherwise returns 1. + */ +uint8_t pmecc_initialize(uint8_t sector_size , uint8_t ecc_errors_per_sector, + uint32_t page_data_size, uint32_t page_spare_size, + uint16_t ecc_offset_in_spare, uint8_t spare_protected) +{ + uint8_t nb_sectors_per_page = 0; + + if (ecc_errors_per_sector == 0xFF) { + /* ONFI 2.2 : a value of 0xff indaicate we must apply a correction on sector > 512 bytes, + so we set at the maximum allowed by PMECC 24 bits on 1024 sectors. */ + ecc_errors_per_sector = 24; + sector_size = 1; /* 1 for 1024 bytes per sector */ + } + + /* Number of Sectors in one Page */ + switch (sector_size) { + /* 512 bytes per sector */ + case 0: + pmecc_desc.sector_size = 0; + nb_sectors_per_page = page_data_size / 512; + pmecc_desc.mm = 13; + pmecc_get_gf_512_tables(&pmecc_desc.alpha_to, &pmecc_desc.index_of); + break; + + /* 1024 bytes per sector */ + case 1: + pmecc_desc.sector_size = HSMC_PMECCFG_SECTORSZ; + nb_sectors_per_page = page_data_size / 1024; + pmecc_desc.mm = 14; + pmecc_get_gf_1024_tables(&pmecc_desc.alpha_to, &pmecc_desc.index_of); + break; + } + + switch (nb_sectors_per_page) { + case 1: + pmecc_desc.page_size = HSMC_PMECCFG_PAGESIZE_PAGESIZE_1SEC; + break; + case 2: + pmecc_desc.page_size = HSMC_PMECCFG_PAGESIZE_PAGESIZE_2SEC; + break; + case 4: + pmecc_desc.page_size = HSMC_PMECCFG_PAGESIZE_PAGESIZE_4SEC; + break; + case 8: + pmecc_desc.page_size = HSMC_PMECCFG_PAGESIZE_PAGESIZE_8SEC; + break; + default : + pmecc_desc.page_size = HSMC_PMECCFG_PAGESIZE_PAGESIZE_1SEC; + break; + } + + pmecc_desc.nn = (1 << pmecc_desc.mm) - 1; + + /* Coded value of ECC bit number correction (0 (2 bits), 1 (4 bits), 2 (8 bits), 3 (12 bits), 4 (24 bits), 5 (NU)) */ + switch (ecc_errors_per_sector) { + case 2: + pmecc_desc.err_bit_nbr_capability = HSMC_PMECCFG_BCH_ERR_BCH_ERR2; + break; + case 4: + pmecc_desc.err_bit_nbr_capability = HSMC_PMECCFG_BCH_ERR_BCH_ERR4; + break; + case 8: + pmecc_desc.err_bit_nbr_capability = HSMC_PMECCFG_BCH_ERR_BCH_ERR8; + break; + case 12: + pmecc_desc.err_bit_nbr_capability = HSMC_PMECCFG_BCH_ERR_BCH_ERR12; + break; + case 24: + pmecc_desc.err_bit_nbr_capability = HSMC_PMECCFG_BCH_ERR_BCH_ERR24; + break; + default: + pmecc_desc.err_bit_nbr_capability = HSMC_PMECCFG_BCH_ERR_BCH_ERR2; + ecc_errors_per_sector = 2; + break; + } + + /* Real value of ECC bit number correction (2, 4, 8, 12, 24) */ + pmecc_desc.tt = ecc_errors_per_sector; + if (((pmecc_desc.mm * ecc_errors_per_sector ) % 8 ) == 0) { + pmecc_desc.ecc_size_byte = ((pmecc_desc.mm * ecc_errors_per_sector ) / 8) * nb_sectors_per_page; + } else { + pmecc_desc.ecc_size_byte = (((pmecc_desc.mm * ecc_errors_per_sector ) / 8 ) + 1 ) * nb_sectors_per_page; + } + if (ecc_offset_in_spare <= 2) { + pmecc_desc.ecc_start_address = PMECC_ECC_DEFAULT_START_ADDR; + } else { + pmecc_desc.ecc_start_address = ecc_offset_in_spare; + } + pmecc_desc.ecc_end_address = pmecc_desc.ecc_start_address + pmecc_desc.ecc_size_byte; + if (pmecc_desc.ecc_end_address > page_spare_size) { + return 1; + } + pmecc_desc.spare_size = pmecc_desc.ecc_end_address; + + //pmecc_desc.nand_wr = PMECC_CFG_NANDWR; /* NAND write access */ + pmecc_desc.nand_wr = 0; /* NAND Read access */ + if (spare_protected) { + pmecc_desc.spare_ena = HSMC_PMECCFG_SPAREEN; + } else { + pmecc_desc.spare_ena = 0; + } + /* PMECC_CFG_AUTO indicates that the spare is error protected. In this case, the ECC computation takes into account the whole spare area + minus the ECC area in the ECC computation operation */ + pmecc_desc.mode_auto = 0; + /* At 133 Mhz, this field must be programmed with 2, + indicating that the setup time is 3 clock cycles.*/ + pmecc_desc.clk_ctrl = 2; + pmecc_desc.interrupt = 0; + _pmecc_configure(); + return 0; +} + +/** + * \brief Return PMECC page size. + */ +uint32_t pmecc_get_page_size(void) +{ + return pmecc_desc.page_size; +} + +/** + * \brief Return PMECC ecc size. + */ +uint32_t pmecc_get_ecc_bytes(void) +{ + return pmecc_desc.ecc_size_byte; +} + +/** + * \brief Return PMECC ecc start address. + */ +uint32_t pmecc_get_ecc_start_address(void) +{ + return pmecc_desc.ecc_start_address; +} + +/** + * \brief Return PMECC ecc end address. + */ +uint32_t pmecc_get_ecc_end_address(void) +{ + return pmecc_desc.ecc_end_address; +} + + +typedef uint32_t (*pmecc_correction_algo_t)(Smc *, struct _pmecc_descriptor *, uint32_t, uint32_t); + +/** + * \brief Launch error detection functions and correct corrupted bits. + * \param pmecc_status Value of the PMECC status register. + * \param page_buffer Base address of the buffer containing the page to be corrected. + * \return 0 if all errors have been corrected, 1 if too many errors detected + */ +uint32_t pmecc_correction(uint32_t pmecc_status, uint32_t page_buffer) +{ + uint32_t sector_number = 0; + uint32_t sector_base_address; + volatile int32_t error_nbr; + + /* Set the sector size (512 or 1024 bytes) */ + HSMC->HSMC_ELCFG = pmecc_desc.sector_size >> 4; + + while (sector_number < (uint32_t)((1 << ((HSMC->HSMC_PMECCFG & HSMC_PMECCFG_PAGESIZE_Msk) >> 8)))) { + error_nbr = 0; + if (pmecc_status & 0x1) { + sector_base_address = page_buffer + (sector_number * ((pmecc_desc.sector_size >> 4) + 1) * 512); + gen_syn(sector_number); + substitute(); + get_sigma(); + error_nbr = error_location((((pmecc_desc.sector_size >> 4) + 1) * 512 * 8) + + (pmecc_desc.tt * (13 + (pmecc_desc.sector_size >> 4)))); /* number of bits of the sector + ecc */ + + if (error_nbr == -1) + return 1; + else + error_correction(sector_base_address, 0, error_nbr); /* Extra byte is 0 */ + } + sector_number++; + pmecc_status = pmecc_status >> 1; + } + return 0; +} + +/** + * \brief Disable pmecc. + */ +void pmecc_disable(void) +{ + /* Disable ECC module */ + HSMC->HSMC_PMECCTRL |= HSMC_PMECCTRL_DISABLE; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.h new file mode 100644 index 000000000..c141f4824 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc.h @@ -0,0 +1,66 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 PMECC_H +#define PMECC_H + +/*----------------------------------------------------------------------- */ +/* Definition */ +/*----------------------------------------------------------------------- */ + +/** Start address of ECC cvalue in spare zone, this must not be 0 since Bad block tag are at 0. */ +#define PMECC_ECC_DEFAULT_START_ADDR 0x02 + +/*------------------------------------------------------------------------------ */ +/* Exported functions */ +/*------------------------------------------------------------------------------ */ + +extern uint8_t pmecc_initialize(uint8_t sector_size, + uint8_t ecc_errors_per_sector, + uint32_t page_data_size, + uint32_t page_spare_size, + uint16_t ecc_offset_in_spare, + uint8_t spare_protected); + +extern uint32_t pmecc_get_page_size(void); + +extern uint32_t pmecc_get_ecc_bytes(void); + +extern uint32_t pmecc_get_ecc_start_address(void); + +extern uint32_t pmecc_get_ecc_end_address(void); + +extern uint32_t pmecc_correction(uint32_t pmecc_status, uint32_t page_buffer); + +extern void build_gf(uint32_t mm, int32_t *index_of, int32_t *alpha_to); + +extern void pmecc_disable(void); + +#endif + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_1024.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_1024.h new file mode 100644 index 000000000..74de5fb3c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_1024.h @@ -0,0 +1,52 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2013, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 PMECC_TABLES_1024_H +#define PMECC_TABLES_1024_H + + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +#define PMECC_GF_1024_SIZE (0x4000) + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** \brief Get the addresses of Gallois Field tables for 1024 bytes sectors */ +void pmecc_get_gf_1024_tables(const int16_t **alpha_to, const int16_t **index_of); + +#endif /* PMECC_TABLES_1024_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_512.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_512.h new file mode 100644 index 000000000..5c8611306 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pmecc_gallois_field_512.h @@ -0,0 +1,52 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2013, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 PMECC_TABLES_512_H +#define PMECC_TABLES_512_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +#define PMECC_GF_512_SIZE (0x2000) + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** \brief Get the addresses of Gallois Field tables for 512 bytes sectors */ +void pmecc_get_gf_512_tables(const int16_t **alpha_to, const int16_t **index_of); + +#endif /* PMECC_TABLES_512_H */ + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.c new file mode 100644 index 000000000..20a7815e1 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.c @@ -0,0 +1,147 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup pwm_module Working with PWM + * \section Purpose + * The PWM driver provides the interface to configure and use the PWM + * peripheral. + * + * The PWM macrocell controls square output waveforms of 4 channels. + * Characteristics of output waveforms such as period, duty-cycle can be configured.\n + * + * Before enabling the channels, they must have been configured first. + * The main settings include: + *
    + *
  • Configuration of the clock generator.
  • + *
  • Selection of the clock for each channel.
  • + *
  • Configuration of output waveform characteristics, such as period, duty-cycle etc.
  • + *
+ * + * After the channels is enabled, the user must use respective update registers + * to change the wave characteristics to prevent unexpected output waveform. + * i.e. PWM_CUPDx register should be used if user want to change duty-cycle + * when the channel is enabled. + * + * \section Usage + *
    + *
  • Configure PWM clock using pwmc_configure_clocks(). + *
  • Enable & disable given PWM channel using pwmc_enable_channel() and pwmc_disable_channel(). + *
  • Enable & disable interrupt of given PWM channel using pwmc_enable_channel_it() + * and pwmc_disable_channel_it(). + *
  • Set feature of the given PWM channel's output signal using pwmc_set_period() + * and pwmc_set_duty_cycle(). + *
  • + *
+ * + * For more accurate information, please look at the PWM section of the + * Datasheet. + * + * Related files :\n + * \ref pwmc.c\n + * \ref pwmc.h.\n + */ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of the Pulse Width Modulation Controller (PWM) peripheral. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/pwmc.h" + +#include +#include + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void pwmc_configure_clocks(Pwm * p_pwm, uint32_t mode) +{ + p_pwm->PWM_CLK = mode; +} + +void pwmc_enable_channel(Pwm * p_pwm, uint8_t channel) +{ + p_pwm->PWM_ENA = 0x1ul << channel; +} + +void pwmc_disable_channel(Pwm * p_pwm, uint8_t channel) +{ + p_pwm->PWM_DIS = 0x1ul << channel; +} + +void pwmc_enable_channel_it(Pwm * p_pwm, uint8_t channel) +{ + p_pwm->PWM_IER1 = 0x1ul << channel; +} + +void pwmc_disable_channel_it(Pwm * p_pwm, uint8_t channel) +{ + p_pwm->PWM_IDR1 = 0x1ul << channel; +} + +void pwmc_configure_channel(Pwm * p_pwm, uint8_t channel, uint32_t mode) +{ + p_pwm->PWM_CH_NUM[channel].PWM_CMR = mode; +} + +void pwmc_set_period(Pwm * p_pwm, uint8_t channel, uint16_t period) +{ + /* If channel is disabled, write to CPRD */ + if ((p_pwm->PWM_SR & (1 << channel)) == 0) { + p_pwm->PWM_CH_NUM[channel].PWM_CPRD = period; + } + /* Otherwise use update register */ + else { + p_pwm->PWM_CH_NUM[channel].PWM_CPRDUPD = period; + } +} + +void pwmc_set_duty_cycle(Pwm * p_pwm, uint8_t channel, uint16_t duty) +{ + assert(duty <= p_pwm->PWM_CH_NUM[channel].PWM_CPRD); + + /* If channel is disabled, write to CDTY */ + if ((p_pwm->PWM_SR & (1 << channel)) == 0) { + p_pwm->PWM_CH_NUM[channel].PWM_CDTY = duty; + } + /* Otherwise use update register */ + else { + p_pwm->PWM_CH_NUM[channel].PWM_CDTYUPD = duty; + } +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.h new file mode 100644 index 000000000..491366ccb --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/pwmc.h @@ -0,0 +1,157 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * Interface for configuration the Pulse Width Modulation Controller (PWM) peripheral. + * + * \par Usage + * + * -# Configures PWM clocks A & B to run at the given frequencies using + * pwmc_configure_clocks(). + * -# Configure PWMC channel using pwmc_configure_channel(), pwmc_set_period() + * and pwmc_set_duty_cycle(). + * -# Enable & disable channel using pwmc_enable_channel() and pwmc_disable_channel(). + * -# Enable & disable the period interrupt for the given PWM channel using + * pwmc_enable_channel_it() and pwmc_disable_channel_it(). + * + */ + +#ifndef _PWMC_ +#define _PWMC_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Configures PWM clocks + * \param p_pwm Pointer to a Pwm instance + * \param mode PWM clock source selection and divide factor. + */ +extern void pwmc_configure_clocks(Pwm * p_pwm, uint32_t mode); + +/** + * \brief Enables the given PWM channel. + * + * This does NOT enable the corresponding pin; this must be done in the user + * code. + * + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + */ +extern void pwmc_enable_channel(Pwm * p_pwm, uint8_t channel); + +/** + * \brief Disables the given PWM channel. + * + * Beware, the channel will be effectively disabled at the end of the current + * period. + * Applications may check whether the channel is disabled using the following + * wait loop: + * while ((PWM->PWM_SR & (1 << channel)) != 0) {}; + * + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + */ +extern void pwmc_disable_channel(Pwm * p_pwm, uint8_t channel); + +/** + * \brief Enables the selected interrupts sources on a PWMC peripheral. + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + */ +extern void pwmc_enable_channel_it(Pwm * p_pwm, uint8_t channel); + +/** + * \brief Disables the selected interrupts sources on a PWMC peripheral. + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + */ +extern void pwmc_disable_channel_it(Pwm * p_pwm, uint8_t channel); + +/** + * \brief Configures a PWM channel with the given parameters, basic configure + * function. + * + * The PWM controller must have been clocked in the PMC prior to calling this + * function. + * Beware: this function disables the channel. It will wait until the channel is + * effectively disabled. + * + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + * \param mode Channel mode. + */ +extern void pwmc_configure_channel(Pwm * p_pwm, uint8_t channel, uint32_t mode); + +/** + * \brief Sets the period value used by a PWM channel. + * + * This function writes directly to the CPRD register if the channel is + * disabled. Otherwise it sets the update register CPRDUPD. + * + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + * \param period Period value. + */ +extern void pwmc_set_period(Pwm * p_pwm, uint8_t channel, uint16_t period); + +/** + * \brief Sets the duty cycle used by a PWM channel. + * This function writes directly to the CDTY register if the channel is + * disabled. Otherwise it sets the update register CDTYUPD. + * Note that the duty cycle must always be inferior or equal to the channel + * period. + * + * \param p_pwm Pointer to a Pwm instance + * \param channel Channel number. + * \param duty Duty cycle value. + */ +extern void pwmc_set_duty_cycle(Pwm * p_pwm, uint8_t channel, uint16_t duty); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _PWMC_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.c new file mode 100644 index 000000000..99d4d2c34 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.c @@ -0,0 +1,233 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + + +#include "chip.h" +#include "timer.h" +#include "trace.h" +#include "peripherals/pmc.h" +#include "peripherals/qspi.h" +#include +#include + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static void qspi_memcpy(uint8_t *dst, const uint8_t *src, int count) +{ + while (count--) + *dst++ = *src++; +} + +/*---------------------------------------------------------------------------- + * Public functions + *----------------------------------------------------------------------------*/ + +void qspi_initialize(Qspi *qspi) +{ + pmc_enable_peripheral(get_qspi_id_from_addr(qspi)); + + /* Disable write protection */ + qspi->QSPI_WPMR = QSPI_WPMR_WPKEY_PASSWD; + + /* Reset */ + qspi->QSPI_CR = QSPI_CR_SWRST; + + /* Configure */ + qspi->QSPI_MR = QSPI_MR_SMM_MEMORY; + qspi->QSPI_SCR = 0; + + /* Enable */ + qspi->QSPI_CR = QSPI_CR_QSPIEN; +} + +uint32_t qspi_set_baudrate(Qspi *qspi, uint32_t baudrate) +{ + uint32_t mck, scr, scbr; + + if (!baudrate) + return 0; + + /* Serial Clock Baudrate */ + mck = pmc_get_peripheral_clock(get_qspi_id_from_addr(qspi)); + scbr = (mck + baudrate - 1) / baudrate; + if (scbr > 0) + scbr--; + + /* Update the Serial Clock Register */ + scr = qspi->QSPI_SCR; + scr &= ~QSPI_SCR_SCBR_Msk; + scr |= QSPI_SCR_SCBR(scbr); + qspi->QSPI_SCR = scr; + + return mck / (scbr + 1); +} + +bool qspi_perform_command(Qspi *qspi, const struct _qspi_cmd *cmd) +{ + uint32_t iar, icr, ifr; + uint32_t offset; + + iar = 0; + icr = 0; + ifr = (cmd->ifr_width & QSPI_IFR_WIDTH_Msk) | (cmd->ifr_type & QSPI_IFR_TFRTYP_Msk); + + /* Compute address parameters */ + switch (cmd->enable.address) { + case 4: + ifr |= QSPI_IFR_ADDRL_32_BIT; + /* fallback to the 24-bit address case */ + case 3: + iar = (cmd->enable.data) ? 0 : QSPI_IAR_ADDR(cmd->address); + ifr |= QSPI_IFR_ADDREN; + offset = cmd->address; + break; + case 0: + offset = 0; + break; + default: + return false; + } + + /* Compute instruction parameters */ + if (cmd->enable.instruction) { + icr |= QSPI_ICR_INST(cmd->instruction); + ifr |= QSPI_IFR_INSTEN; + } + + /* Compute option parameters */ + if (cmd->enable.mode && cmd->num_mode_cycles) { + uint32_t mode_cycle_bits, mode_bits; + + icr |= QSPI_ICR_OPT(cmd->mode); + ifr |= QSPI_IFR_OPTEN; + + switch (ifr & QSPI_IFR_WIDTH_Msk) { + case QSPI_IFR_WIDTH_SINGLE_BIT_SPI: + case QSPI_IFR_WIDTH_DUAL_OUTPUT: + case QSPI_IFR_WIDTH_QUAD_OUTPUT: + mode_cycle_bits = 1; + break; + case QSPI_IFR_WIDTH_DUAL_IO: + case QSPI_IFR_WIDTH_DUAL_CMD: + mode_cycle_bits = 2; + break; + case QSPI_IFR_WIDTH_QUAD_IO: + case QSPI_IFR_WIDTH_QUAD_CMD: + mode_cycle_bits = 4; + break; + default: + return false; + } + + mode_bits = cmd->num_mode_cycles * mode_cycle_bits; + switch (mode_bits) { + case 1: + ifr |= QSPI_IFR_OPTL_OPTION_1BIT; + break; + + case 2: + ifr |= QSPI_IFR_OPTL_OPTION_2BIT; + break; + + case 4: + ifr |= QSPI_IFR_OPTL_OPTION_4BIT; + break; + + case 8: + ifr |= QSPI_IFR_OPTL_OPTION_8BIT; + break; + + default: + return false; + } + } + + /* Set number of dummy cycles */ + if (cmd->enable.dummy) + ifr |= QSPI_IFR_NBDUM(cmd->num_dummy_cycles); + else + ifr |= QSPI_IFR_NBDUM(0); + + /* Set data enable */ + if (cmd->enable.data) { + ifr |= QSPI_IFR_DATAEN; + + /* Special case for Continous Read Mode */ + if (!cmd->tx_buffer && !cmd->rx_buffer) + ifr |= QSPI_IFR_CRM_ENABLED; + } + + /* Set QSPI Instruction Frame registers */ + qspi->QSPI_IAR = iar; + qspi->QSPI_ICR = icr; + qspi->QSPI_IFR = ifr; + + /* Skip to the final steps if there is no data */ + if (!cmd->enable.data) + goto no_data; + + /* Dummy read of QSPI_IFR to synchronize APB and AHB accesses */ + (void)qspi->QSPI_IFR; + + /* Send/Receive data */ + if (cmd->tx_buffer) { + /* Write data */ + uint8_t *ptr = (uint8_t*)get_qspi_mem_from_addr(qspi); + qspi_memcpy(ptr + offset, cmd->tx_buffer, cmd->buffer_len); + } else if (cmd->rx_buffer) { + /* Read data */ + const uint8_t *ptr = (const uint8_t*)get_qspi_mem_from_addr(qspi); + qspi_memcpy(cmd->rx_buffer, ptr + offset, cmd->buffer_len); + } else { + /* Stop here for continuous read */ + return true; + } + +no_data: + /* Release the chip-select */ + qspi->QSPI_CR = QSPI_CR_LASTXFER; + + /* Wait for INSTRuction End */ + struct _timeout timeout; + timer_start_timeout(&timeout, cmd->timeout); + while (!(qspi->QSPI_SR & QSPI_SR_INSTRE)) { + if (timer_timeout_reached(&timeout)) { + trace_debug("qspi_perform_command timeout reached\r\n"); + return false; + } + } + + return true; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.h new file mode 100644 index 000000000..8ea3e7587 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/qspi.h @@ -0,0 +1,143 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + + +/** + * \file + * + * Interface for Quad Serial Peripheral Interface (QSPI) controller. + * + */ + +#ifndef _QSPI_H_ +#define _QSPI_H_ + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** QSPI Command structure */ +struct _qspi_cmd { + /** Data Transfer Type (QSPI_IFR_TFRTYP_TRSFR_xxx) */ + uint32_t ifr_type; + + /** Width of Instruction Code, Address, Option Code and Data + * (QSPI_IFR_WIDTH_xxx) */ + uint32_t ifr_width; + + /** Flags to select which information is included in the command */ + struct { + /** 0: don't send instruction code, 1: send instuction code */ + uint32_t instruction:1; + /** 0: don't send address, 3: send 3-byte address, 4: send + * 4-byte address */ + uint32_t address:3; + /** 0: don't send mode bits, 1: send mode bits */ + uint32_t mode:1; + /** 0: don't send dummy bits, 1: send dummy bits */ + uint32_t dummy:1; + /** 0: don't send/recieve data, 1: send/recieve data */ + uint32_t data:1; + /** reserved, not used */ + uint32_t reserved:25; + } enable; + + /** Instruction code */ + uint8_t instruction; + + /** Mode bits */ + uint8_t mode; + + /** Number of mode cycles */ + uint8_t num_mode_cycles; + + /** Number of dummy cycles */ + uint8_t num_dummy_cycles; + + /** QSPI address */ + uint32_t address; + + /** Address of the TX buffer */ + const void *tx_buffer; + + /** Address of the RX buffer */ + void *rx_buffer; + + /** Size of the RX/TX buffer */ + uint32_t buffer_len; + + /** Timeout for the command execution, in timer ticks */ + uint32_t timeout; +}; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + extern "C" { +#endif + +/** + * \brief Reset and initialize a QSPI instance. + * + * \param qspi the QSPI instance + */ +void qspi_initialize(Qspi *qspi); + +/** + * \brief Configure the baudrate for a QSPI instance. + * + * \param qspi the QSPI instance + * \param baudrate the requested baudrate + * \return the actual baudrate configured (can be lower than requested) + */ +uint32_t qspi_set_baudrate(Qspi *qspi, uint32_t baudrate); + +/** + * \brief Perform a QSPI command. + * + * Note that if enable.data is set in the command, data will be sent/recieved: + * - if tx_buffer is not NULL, data will be sent + * - if rx_buffer is not NULL, data will be recieved + * - if both tx_buffer and rx_buffer are NULL, QSPI will be configured in + * "Continuous Read" mode and random read access can be done at the address + * returned by get_qspi_mem_from_addr + * + * \param qspi the QSPI instance + * \param cmd the QSPI command to perform + * \return true if the command was succesfully issued, false otherwise + */ +bool qspi_perform_command(Qspi *qspi, const struct _qspi_cmd *cmd); + +#ifdef __cplusplus +} +#endif + +#endif /* _QSPI_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.c new file mode 100644 index 000000000..69a1c2071 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.c @@ -0,0 +1,131 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ +/*--------------------------------------------------------------------------- + * Headers + *---------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/rstc.h" + +/*--------------------------------------------------------------------------- + * Exported functions + *---------------------------------------------------------------------------*/ + +/** + * Configure the mode of the RSTC peripheral. + * The configuration is computed by the lib (RSTC_RMR_*). + * \param mr Desired mode configuration. + */ +void rstc_configure_mode(uint32_t mr) +{ + RSTC->RSTC_MR = (mr & ~RSTC_MR_KEY_Msk) | RSTC_MR_KEY_PASSWD; +} + +/** + * Enable/Disable the detection of a low level on the pin NRST as User Reset + * \param enable 1 to enable & 0 to disable. + */ +void rstc_set_user_reset_enable(uint8_t enable) +{ + uint32_t mr = RSTC->RSTC_MR; + if (enable) { + mr |= RSTC_MR_URSTEN; + } else { + mr &= ~RSTC_MR_URSTEN; + } + RSTC->RSTC_MR = mr | RSTC_MR_KEY_PASSWD; +} + +/** + * Enable/Disable the interrupt of a User Reset (USRTS bit in RSTC_RST). + * \param enable 1 to enable & 0 to disable. + */ +void rstc_set_user_reset_interrupt_enable(uint8_t enable) +{ + uint32_t mr = RSTC->RSTC_MR; + if (enable) { + mr |= RSTC_MR_URSTIEN; + } else { + + mr &= ~RSTC_MR_URSTIEN; + } + RSTC->RSTC_MR = mr | RSTC_MR_KEY_PASSWD; +} + +/** + * Resets the processor. + */ +void rstc_processor_reset(void) +{ + RSTC->RSTC_CR = RSTC_CR_PROCRST | RSTC_MR_KEY_PASSWD; +} + +/** + * Resets the peripherals. + */ +void rstc_peripheral_reset(void) +{ + RSTC->RSTC_CR = RSTC_CR_PERRST | RSTC_MR_KEY_PASSWD; +} + +/** + * Return NRST pin level ( 1 or 0 ). + */ +uint8_t rstc_get_nrst_level(void) +{ + return (RSTC->RSTC_SR & RSTC_SR_NRSTL) != 0; +} + +/** + * Returns 1 if at least one high-to-low transition of NRST (User Reset) has + * been detected since the last read of RSTC_RSR. + */ +uint8_t rstc_is_user_reset_detected(void) +{ + return (RSTC->RSTC_SR & RSTC_SR_URSTS) != 0; +} + +/** + * Return 1 if a software reset command is being performed by the reset + * controller. The reset controller is busy. + */ +uint8_t rstc_is_busy(void) +{ + return (RSTC->RSTC_SR & RSTC_SR_SRCMP) != 0; +} + +/** + * Get the status + */ +uint32_t rstc_get_status(void) +{ + return RSTC->RSTC_SR; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.h new file mode 100644 index 000000000..112996e9a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rstc.h @@ -0,0 +1,53 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _RSTC_H +#define _RSTC_H + +/*--------------------------------------------------------------------------- + * Includes + *---------------------------------------------------------------------------*/ + +#include + +/*--------------------------------------------------------------------------- + * Exported functions + *---------------------------------------------------------------------------*/ + +extern void rstc_configure_mode(uint32_t rmr); +extern void rstc_set_user_reset_enable(uint8_t enable); +extern void rstc_set_user_reset_interrupt_enable(uint8_t enable); +extern void rstc_processor_reset(void); +extern void rstc_peripheral_reset(void); +extern uint8_t rstc_get_nrst_level(void); +extern uint8_t rstc_is_user_reset_detected(void); +extern uint8_t rstc_is_busy(void); +extern uint32_t rstc_get_status(void); + +#endif /* #ifndef _RSTC_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.c new file mode 100644 index 000000000..ff0843460 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.c @@ -0,0 +1,554 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup rtc_module Working with RTC + * \section Purpose + * The RTC driver provides the interface to configure and use the RTC + * peripheral. + * + * It manages date, time, and alarms.\n + * This timer is clocked by the 32kHz system clock, and is not impacted by + * power management settings (PMC). To be accurate, it is better to use an + * external 32kHz crystal instead of the internal 32kHz RC.\n + * + * It uses BCD format, and time can be set in AM/PM or 24h mode through a + * configuration bit in the mode register.\n + * + * To update date or time, the user has to follow these few steps : + *
    + *
  • Set UPDTIM and/or UPDCAL bit(s) in RTC_CR,
  • + *
  • Polling or IRQ on the ACKUPD bit of RTC_CR,
  • + *
  • Clear ACKUPD bit in RTC_SCCR,
  • + *
  • Update Time and/or Calendar values in RTC_TIMR/RTC_CALR (BCD format),
  • + *
  • Clear UPDTIM and/or UPDCAL bit in RTC_CR.
  • + *
+ * An alarm can be set to happen on month, date, hours, minutes or seconds, + * by setting the proper "Enable" bit of each of these fields in the Time and + * Calendar registers. + * This allows a large number of configurations to be available for the user. + * Alarm occurence can be detected even by polling or interrupt. + * + * A check of the validity of the date and time format and values written by the user is automatically done. + * Errors are reported through the Valid Entry Register. + * + * \section Usage + *
    + *
  • Enable & disable RTC interrupt using rtc_enable_it() and rtc_disable_it(). + *
  • Set RTC data, time, alarm using rtc_set_date(), rtc_set_time(), + * rtc_set_time_alarm() and rtc_set_date_alarm(). + *
  • Get RTC data, time using rtc_get_date() and rtc_get_time(). + *
  • + *
+ * + * For more accurate information, please look at the RTC section of the + * Datasheet. + * + * Related files :\n + * \ref rtc.c\n + * \ref rtc.h.\n +*/ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of Real Time Clock (RTC) controller. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/rtc.h" +#include "trace.h" +#include +#include + +/*---------------------------------------------------------------------------- + * Local Defines + *----------------------------------------------------------------------------*/ + +/* The BCD code shift value */ +#define BCD_SHIFT 4 + +/* The BCD code mask value */ +#define BCD_MASK 0xfu + +/* The BCD mul/div factor value */ +#define BCD_FACTOR 10 + +/*---------------------------------------------------------------------------- + * Local Types + *----------------------------------------------------------------------------*/ + +struct rtc_ppm_lookup { + int8_t tempr; + int16_t ppm; + uint8_t negppm; + uint8_t highppm; + uint16_t correction; +}; + +//------------------------------------------------------------------------------ +// Local constants +//------------------------------------------------------------------------------ + +static const struct rtc_ppm_lookup ppm_lookup[] = { + {-40, -168, 0, 1, 22}, + {-39, -163, 0, 1, 23}, + {-38, -158, 0, 1, 24}, + {-37, -153, 0, 1, 25}, + {-36, -148, 0, 1, 25}, + {-35, -143, 0, 1, 26}, + {-34, -138, 0, 1, 27}, + {-33, -134, 0, 1, 28}, + {-32, -129, 0, 1, 29}, + {-31, -124, 0, 1, 31}, + {-30, -120, 0, 1, 32}, + {-29, -116, 0, 1, 33}, + {-28, -111, 0, 1, 34}, + {-27, -107, 0, 1, 36}, + {-26, -103, 0, 1, 37}, + {-25, -99, 0, 1, 38}, + {-24, -95, 0, 1, 40}, + {-23, -91, 0, 1, 42}, + {-22, -87, 0, 1, 44}, + {-21, -84, 0, 1, 45}, + {-20, -80, 0, 1, 48}, + {-19, -76, 0, 1, 50}, + {-18, -73, 0, 1, 53}, + {-17, -70, 0, 1, 55}, + {-16, -66, 0, 1, 58}, + {-15, -63, 0, 1, 61}, + {-14, -60, 0, 1, 64}, + {-13, -57, 0, 1, 68}, + {-12, -54, 0, 1, 71}, + {-11, -51, 0, 1, 76}, + {-10, -48, 0, 1, 80}, + {-9, -45, 0, 1, 86}, + {-8, -43, 0, 1, 90}, + {-7, -40, 0, 1, 97}, + {-6, -37, 0, 1, 105}, + {-5, -35, 0, 1, 111}, + {-4, -33, 0, 1, 117}, + {-3, -30, 0, 0, 6}, + {-2, -28, 0, 0, 6}, + {-1, -26, 0, 0, 7}, + {0, -24, 0, 0, 7}, + {1, -22, 0, 0, 8}, + {2, -20, 0, 0, 9}, + {3, -18, 0, 0, 10}, + {4, -17, 0, 0, 10}, + {5, -15, 0, 0, 12}, + {6, -13, 0, 0, 14}, + {7, -12, 0, 0, 15}, + {8, -11, 0, 0, 17}, + {9, -9, 0, 0, 21}, + {10, -8, 0, 0, 23}, + {11, -7, 0, 0, 27}, + {12, -6, 0, 0, 32}, + {13, -5, 0, 0, 38}, + {14, -4, 0, 0, 48}, + {15, -3, 0, 0, 64}, + {16, -2, 0, 0, 97}, + {17, -2, 0, 0, 97}, + {18, -1, 0, 0, 127}, + {19, 0, 1, 0, 0}, + {20, 0, 1, 0, 0}, + {21, 0, 1, 0, 0}, + {22, 1, 1, 0, 127}, + {23, 1, 1, 0, 127}, + {24, 1, 1, 0, 127}, + {25, 1, 1, 0, 127}, + {26, 1, 1, 0, 127}, + {27, 1, 1, 0, 127}, + {28, 1, 1, 0, 127}, + {29, 0, 1, 0, 0}, + {30, 0, 1, 0, 0}, + {31, 0, 1, 0, 0}, + {32, -1, 0, 0, 127}, + {33, -2, 0, 0, 97}, + {34, -2, 0, 0, 97}, + {35, -3, 0, 0, 64}, + {36, -4, 0, 0, 48}, + {37, -5, 0, 0, 38}, + {38, -6, 0, 0, 32}, + {39, -7, 0, 0, 27}, + {40, -8, 0, 0, 23}, + {41, -9, 0, 0, 21}, + {42, -11, 0, 0, 17}, + {43, -12, 0, 0, 15}, + {44, -13, 0, 0, 14}, + {45, -15, 0, 0, 12}, + {46, -17, 0, 0, 10}, + {47, -18, 0, 0, 10}, + {48, -20, 0, 0, 9}, + {49, -22, 0, 0, 8}, + {50, -24, 0, 0, 7}, + {51, -26, 0, 0, 7}, + {52, -28, 0, 0, 6}, + {53, -30, 0, 0, 6}, + {54, -33, 0, 1, 117}, + {55, -35, 0, 1, 111}, + {56, -37, 0, 1, 105}, + {57, -40, 0, 1, 97}, + {58, -43, 0, 1, 90}, + {59, -45, 0, 1, 86}, + {60, -48, 0, 1, 80}, + {61, -51, 0, 1, 76}, + {62, -54, 0, 1, 71}, + {63, -57, 0, 1, 68}, + {64, -60, 0, 1, 64}, + {65, -63, 0, 1, 61}, + {66, -66, 0, 1, 58}, + {67, -70, 0, 1, 55}, + {68, -73, 0, 1, 53}, + {69, -76, 0, 1, 50}, + {70, -80, 0, 1, 48}, + {71, -84, 0, 1, 45}, + {72, -87, 0, 1, 44}, + {73, -91, 0, 1, 42}, + {74, -95, 0, 1, 40}, + {75, -99, 0, 1, 38}, + {76, -103, 0, 1, 37}, + {77, -107, 0, 1, 36}, + {78, -111, 0, 1, 34}, + {79, -116, 0, 1, 33}, + {80, -120, 0, 1, 32}, + {81, -124, 0, 1, 31}, + {82, -129, 0, 1, 29}, + {83, -134, 0, 1, 28}, + {84, -138, 0, 1, 27}, + {85, -143, 0, 1, 26} +}; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Sets the RTC in either 12 or 24 hour mode. + * + * \param dwMode Hour mode. + */ +void rtc_set_hour_mode(uint32_t mode) +{ + assert((mode & 0xFFFFFFFE) == 0); + RTC->RTC_MR = mode; +} + +extern uint32_t rtc_get_hour_mode(void) +{ + uint32_t mode; + mode = RTC->RTC_MR; + mode &= 0xFFFFFFFE; + return mode; +} + +void rtc_enable_it(uint32_t sources) +{ + assert((sources & (uint32_t) (~0x1F)) == 0); + RTC->RTC_IER = sources; +} + +void rtc_disable_it(uint32_t sources) +{ + assert((sources & (uint32_t) (~0x1F)) == 0); + RTC->RTC_IDR = sources; +} + +uint32_t rtc_set_time(struct _time *time) +{ + uint32_t ltime = 0; + uint8_t hour_bcd , min_bcd, sec_bcd; + + /* if 12-hour mode, set AMPM bit */ + if ((RTC->RTC_MR & RTC_MR_HRMOD) == RTC_MR_HRMOD) { + if (time->hour > 12) { + time->hour -= 12; + ltime |= RTC_TIMR_AMPM; + } + } + hour_bcd = (time->hour % 10) | ((time->hour / 10) << 4); + min_bcd = (time->min % 10) | ((time->min / 10) << 4); + sec_bcd = (time->sec % 10) | ((time->sec / 10) << 4); + /* value overflow */ + if ((hour_bcd & (uint8_t) (~RTC_HOUR_BIT_LEN_MASK)) | + (min_bcd & (uint8_t) (~RTC_MIN_BIT_LEN_MASK)) | + (sec_bcd & (uint8_t) (~RTC_SEC_BIT_LEN_MASK))) { + return 1; + } + ltime = sec_bcd | (min_bcd << 8) | (hour_bcd << 16); + RTC->RTC_CR |= RTC_CR_UPDTIM; + while ((RTC->RTC_SR & RTC_SR_ACKUPD) != RTC_SR_ACKUPD) ; + RTC->RTC_SCCR = RTC_SCCR_ACKCLR; + RTC->RTC_TIMR = ltime; + RTC->RTC_CR &= (uint32_t) (~RTC_CR_UPDTIM); + RTC->RTC_SCCR |= RTC_SCCR_SECCLR; + return (uint32_t) (RTC->RTC_VER & RTC_VER_NVTIM); +} + +void rtc_get_time(struct _time *time) +{ + uint32_t ltime; + + /* Get current RTC time */ + ltime = RTC->RTC_TIMR; + while (ltime != RTC->RTC_TIMR) { + ltime = RTC->RTC_TIMR; + } + /* Hour */ + time->hour = ((ltime & 0x00300000) >> 20) * 10 + ((ltime & 0x000F0000) >> 16); + if ((ltime & RTC_TIMR_AMPM) == RTC_TIMR_AMPM) { + time->hour += 12; + } + /* Minute */ + time->min = ((ltime & 0x00007000) >> 12) * 10 + ((ltime & 0x00000F00) >> 8); + /* Second */ + time->sec = ((ltime & 0x00000070) >> 4) * 10 + (ltime & 0x0000000F); +} + +uint32_t rtc_set_time_alarm(struct _time *time) +{ + uint32_t alarm = 0; + + /* Hour */ + if (time->hour) { + alarm |= RTC_TIMALR_HOUREN | ((time->hour / 10) << 20) | ((time->hour % 10) << 16); + } + /* Minute */ + if (time->min) { + alarm |= RTC_TIMALR_MINEN | ((time->min / 10) << 12) | ((time->min % 10) << 8); + } + /* Second */ + if (time->sec) { + alarm |= RTC_TIMALR_SECEN | ((time->sec / 10) << 4) | (time->sec % 10); + } + RTC->RTC_TIMALR = alarm; + return (uint32_t) (RTC->RTC_VER & RTC_VER_NVTIMALR); +} + +void rtc_get_date(struct _date *date) +{ + uint32_t ldate; + + /* Get current date (multiple reads are necessary to insure a stable value) */ + do { + ldate = RTC->RTC_CALR; + } while (ldate != RTC->RTC_CALR); + + /* Retrieve values */ + date->year = (((ldate >> 4) & 0x7) * 1000) + ((ldate & 0xF) * 100) + + (((ldate >> 12) & 0xF) * 10) + ((ldate >> 8) & 0xF); + date->month = (((ldate >> 20) & 1) * 10) + ((ldate >> 16) & 0xF); + date->day = (((ldate >> 28) & 0x3) * 10) + ((ldate >> 24) & 0xF); + date->week = ((ldate >> 21) & 0x7); +} + +uint32_t rtc_set_date(struct _date *date) +{ + uint32_t ldate; + uint8_t cent_bcd, year_bcd, month_bcd, day_bcd, week_bcd; + + cent_bcd = ((date->year / 100) % 10) | ((date->year / 1000) << 4); + year_bcd = (date->year % 10) | (((date->year / 10) % 10) << 4); + month_bcd = ((date->month % 10) | (date->month / 10) << 4); + day_bcd = ((date->day % 10) | (date->day / 10) << 4); + week_bcd = ((date->week % 10) | (date->week / 10) << 4); + /* value over flow */ + if ((cent_bcd & (uint8_t) (~RTC_CENT_BIT_LEN_MASK)) | + (year_bcd & (uint8_t) (~RTC_YEAR_BIT_LEN_MASK)) | + (month_bcd & (uint8_t) (~RTC_MONTH_BIT_LEN_MASK)) | + (week_bcd & (uint8_t) (~RTC_WEEK_BIT_LEN_MASK)) | + (day_bcd & (uint8_t) (~RTC_DATE_BIT_LEN_MASK)) + ) { + return 1; + } + /* Convert values to date register value */ + ldate = cent_bcd | (year_bcd << 8) | (month_bcd << 16) | (week_bcd << 21) | (day_bcd << 24); + /* Update calendar register */ + RTC->RTC_CR |= RTC_CR_UPDCAL; + while ((RTC->RTC_SR & RTC_SR_ACKUPD) != RTC_SR_ACKUPD) ; + RTC->RTC_SCCR = RTC_SCCR_ACKCLR; + RTC->RTC_CALR = ldate; + RTC->RTC_CR &= (uint32_t) (~RTC_CR_UPDCAL); + RTC->RTC_SCCR |= RTC_SCCR_SECCLR; /* clear SECENV in SCCR */ + return (uint32_t) (RTC->RTC_VER & RTC_VER_NVCAL); +} + +uint32_t rtc_set_date_alarm(struct _date *date) +{ + uint32_t alarm; + + alarm = ((date->month) || (date->day)) ? (0) : (0x01010000); + /* Compute alarm field value */ + if (date->month) { + alarm |= RTC_CALALR_MTHEN | ((date->month / 10) << 20) | ((date->month % 10) << 16); + } + if (date->day) { + alarm |= RTC_CALALR_DATEEN | ((date->day / 10) << 28) | ((date->day % 10) << 24); + } + /* Set alarm */ + RTC->RTC_CALALR = alarm; + return (uint32_t) (RTC->RTC_VER & RTC_VER_NVCALALR); +} + +void rtc_clear_sccr(uint32_t mask) +{ + /* Clear all flag bits in status clear command register */ + mask &= RTC_SCCR_ACKCLR | RTC_SCCR_ALRCLR | RTC_SCCR_SECCLR | + RTC_SCCR_TIMCLR | RTC_SCCR_CALCLR; + RTC->RTC_SCCR = mask; +} + +uint32_t rtc_get_sr(uint32_t mask) +{ + return (RTC->RTC_SR) & mask; +} + +void rtc_get_tamper_time(struct _time *time, uint8_t reg_num) +{ + uint32_t ltime, temp; + + /* Get current RTC time */ + ltime = RTC->RTC_TS[reg_num].RTC_TSTR; + while (ltime != RTC->RTC_TS[reg_num].RTC_TSTR) { + ltime = RTC->RTC_TS[reg_num].RTC_TSTR; + } + /* Hour */ + if (time->hour) { + temp = (ltime & RTC_TSTR_HOUR_Msk) >> RTC_TSTR_HOUR_Pos; + time->hour = (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + if ((ltime & RTC_TSTR_AMPM) == RTC_TSTR_AMPM) { + time->hour += 12; + } + } + /* Minute */ + if (time->min) { + temp = (ltime & RTC_TSTR_MIN_Msk) >> RTC_TSTR_MIN_Pos; + time->min = (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + } + /* Second */ + if (time->sec) { + temp = (ltime & RTC_TSTR_SEC_Msk) >> RTC_TSTR_SEC_Pos; + time->sec = (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + } +} + +void rtc_get_tamper_date(struct _date *date, uint8_t reg_num) +{ + uint32_t ldate, cent, temp; + + /* Get the current date (multiple reads are to insure a stable value). */ + ldate = RTC->RTC_TS[reg_num].RTC_TSDR; + while (ldate != RTC->RTC_TS[reg_num].RTC_TSDR) { + ldate = RTC->RTC_TS[reg_num].RTC_TSDR; + } + /* Retrieve year */ + temp = (ldate & RTC_TSDR_CENT_Msk) >> RTC_TSDR_CENT_Pos; + cent = (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + temp = (ldate & RTC_TSDR_YEAR_Msk) >> RTC_TSDR_YEAR_Pos; + date->year = (cent * BCD_FACTOR * BCD_FACTOR) + (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + + /* Retrieve month */ + temp = (ldate & RTC_TSDR_MONTH_Msk) >> RTC_TSDR_MONTH_Pos; + date->month = (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + + /* Retrieve day */ + temp = (ldate & RTC_TSDR_DATE_Msk) >> RTC_TSDR_DATE_Pos; + date->day = (temp >> BCD_SHIFT) * BCD_FACTOR + (temp & BCD_MASK); + + /* Retrieve week */ + date->week= ((ldate & RTC_TSDR_DAY_Msk) >> RTC_TSDR_DAY_Pos); +} + +uint32_t rtc_get_tamper_source(uint8_t reg_num) +{ + return RTC->RTC_TS[reg_num].RTC_TSSR; +} + +uint32_t rtc_get_tamper_event_counter(void) +{ + return (RTC->RTC_TS[0].RTC_TSTR & RTC_TSTR_TEVCNT_Msk) >> RTC_TSTR_TEVCNT_Pos; +} + +uint8_t rtc_is_tamper_occur_in_backup_mode(uint8_t reg_num) +{ + if (RTC->RTC_TS[reg_num].RTC_TSTR & RTC_TSTR_BACKUP) { + return 1; + } else { + return 0; + } +} + +void rtc_convert_time_to_hms(struct _time *time, uint32_t count) +{ + count = count % 86400; + time->hour = count / 3600; + count -= time->hour * 3600; + time->min = count / 60; + time->sec = count % 60; +} + +void rtc_calibration(int32_t current_tempr) +{ + uint32_t i, mr; + for (i = 0; i < ARRAY_SIZE(ppm_lookup); i++) { + if (ppm_lookup[i].tempr == current_tempr) { + mr = RTC_MR_CORRECTION(ppm_lookup[i].correction); + mr |= (ppm_lookup[i].highppm << 15); + mr |= (ppm_lookup[i].negppm << 4); + RTC->RTC_MR = mr; // update the calibration value + break; + } + } +} + +uint32_t rtc_set_time_event (uint32_t mask) +{ + uint32_t reg; + reg = RTC->RTC_CR; + reg &= ~RTC_CR_TIMEVSEL_Msk; + reg |= mask; + RTC->RTC_CR = reg; + return RTC->RTC_CR; +} + +uint32_t rtc_set_calendar_event (uint32_t mask) +{ + uint32_t reg; + reg = RTC->RTC_CR; + reg &= ~RTC_CR_CALEVSEL_Msk; + reg |= mask; + RTC->RTC_CR = reg; + return RTC->RTC_CR; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.h new file mode 100644 index 000000000..690d56976 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/rtc.h @@ -0,0 +1,305 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for Real Time Clock (RTC) controller. + * + */ + +#ifndef _RTC_H_ +#define _RTC_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +#define RTC_HOUR_BIT_LEN_MASK 0x3F +#define RTC_MIN_BIT_LEN_MASK 0x7F +#define RTC_SEC_BIT_LEN_MASK 0x7F +#define RTC_CENT_BIT_LEN_MASK 0x7F +#define RTC_YEAR_BIT_LEN_MASK 0xFF +#define RTC_MONTH_BIT_LEN_MASK 0x1F +#define RTC_DATE_BIT_LEN_MASK 0x3F +#define RTC_WEEK_BIT_LEN_MASK 0x07 + +struct _time +{ + uint8_t hour; + uint8_t min; + uint8_t sec; +} ; + +struct _date +{ + uint16_t year; + uint8_t month; + uint8_t day; + uint8_t week; +} ; + +#ifdef CONFIG_SOC_SAMA5D2 + /* -------- RTC_TSTR : (RTC Offset: N/A) TimeStamp Time Register 0 -------- */ + #define RTC_TSTR_SEC_Pos 0 + #define RTC_TSTR_SEC_Msk (0x7fu << RTC_TSTR_SEC_Pos) /**< \brief (RTC_TSTR) SEConds of the tamper */ + #define RTC_TSTR_MIN_Pos 8 + #define RTC_TSTR_MIN_Msk (0x7fu << RTC_TSTR_MIN_Pos) /**< \brief (RTC_TSTR) MINutes of the tamper */ + #define RTC_TSTR_HOUR_Pos 16 + #define RTC_TSTR_HOUR_Msk (0x3fu << RTC_TSTR_HOUR_Pos) /**< \brief (RTC_TSTR) HOURs of the tamper */ + #define RTC_TSTR_AMPM (0x1u << 22) /**< \brief (RTC_TSTR) AMPM indicator of the tamper */ + #define RTC_TSTR_TEVCNT_Pos 24 + #define RTC_TSTR_TEVCNT_Msk (0xfu << RTC_TSTR_TEVCNT_Pos) /**< \brief (RTC_TSTR) Tamper events counter */ + #define RTC_TSTR_BACKUP (0x1u << 31) /**< \brief (RTC_TSTR) system mode of the tamper */ + /* -------- RTC_TSDR : (RTC Offset: N/A) TimeStamp Date Register 0 -------- */ + #define RTC_TSDR_CENT_Pos 0 + #define RTC_TSDR_CENT_Msk (0x7fu << RTC_TSDR_CENT_Pos) /**< \brief (RTC_TSDR) Century of the tamper */ + #define RTC_TSDR_YEAR_Pos 8 + #define RTC_TSDR_YEAR_Msk (0xffu << RTC_TSDR_YEAR_Pos) /**< \brief (RTC_TSDR) Year of the tamper */ + #define RTC_TSDR_MONTH_Pos 16 + #define RTC_TSDR_MONTH_Msk (0x1fu << RTC_TSDR_MONTH_Pos) /**< \brief (RTC_TSDR) Month of the tamper */ + #define RTC_TSDR_DAY_Pos 21 + #define RTC_TSDR_DAY_Msk (0x7u << RTC_TSDR_DAY_Pos) /**< \brief (RTC_TSDR) Day of the tamper */ + #define RTC_TSDR_DATE_Pos 24 + #define RTC_TSDR_DATE_Msk (0x3fu << RTC_TSDR_DATE_Pos) /**< \brief (RTC_TSDR) Date of the tamper */ +#endif + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Sets the RTC in either 12 or 24 hour mode. + * + * \param mode Hour mode. + */ +extern void rtc_set_hour_mode(uint32_t mode); + +/** + * \brief Gets the RTC mode. + * + * \return Hour mode. + */ +extern uint32_t rtc_get_hour_mode(void); + +/** + * \brief Enables the selected interrupt sources of the RTC. + * + * \param sources Interrupt sources to enable. + */ +extern void rtc_enable_it(uint32_t sources); + +/** +* \brief Disables the selected interrupt sources of the RTC. +* +* \param sources Interrupt sources to disable. +*/ +extern void rtc_disable_it(uint32_t sources); + +/** + * \brief Sets the current time in the RTC. + * + * \note In successive update operations, the user must wait at least one second + * after resetting the UPDTIM/UPDCAL bit in the RTC_CR before setting these + * bits again. Please look at the RTC section of the datasheet for detail. + * + * \param time Pointer to structure time + * + * \return 0 sucess, 1 fail to set + */ +extern uint32_t rtc_set_time(struct _time *time); + +/** + * \brief Retrieves the current time as stored in the RTC in several variables. + * + * \param time Pointer to structure time + */ +extern void rtc_get_time(struct _time *time); + +/** + * \brief Sets a time alarm on the RTC. + * The match is performed only on the provided variables; + * Setting all pointers to 0 disables the time alarm. + * + * \note In AM/PM mode, the hour value must have bit #7 set for PM, cleared for + * AM (as expected in the time registers). + * + * \param time Pointer to structure time. + * + * \return 0 success, 1 fail to set + */ +extern uint32_t rtc_set_time_alarm(struct _time *time); + +/** + * \brief Retrieves the current year, month and day from the RTC. + * Month, day and week values are numbered starting at 1. + * + * \param date Pointer to structure Date. + */ +extern void rtc_get_date(struct _date *date); + +/** + * \brief Sets the current year, month and day in the RTC. + * Month, day and week values must be numbered starting from 1. + * + * \note In successive update operations, the user must wait at least one second + * after resetting the UPDTIM/UPDCAL bit in the RTC_CR before setting these + * bits again. Please look at the RTC section of the datasheet for detail. + * + * \param date Pointer to structure Date + * + * \return 0 success, 1 fail to set + */ +extern uint32_t rtc_set_date(struct _date *date); + +/** + * \brief Sets a date alarm in the RTC. + * The alarm will match only the provided values; + * Passing a null-pointer disables the corresponding field match. + * + * \param pucMonth If not null, the RTC alarm will month-match this value. + * \param pucDay If not null, the RTC alarm will day-match this value. + * + * \return 0 success, 1 fail to set + */ +extern uint32_t rtc_set_date_alarm(struct _date *date); + +/** + * \brief Clear flag bits of status clear command register in the RTC. + * + * \param mask Bits mask of cleared events + */ +extern void rtc_clear_sccr(uint32_t mask); + +/** + * \brief Get flag bits of status register in the RTC. + * + * \param mask Bits mask of Status Register + * + * \return Status register & mask + */ +extern uint32_t rtc_get_sr(uint32_t mask); + +/** + * \brief Get the RTC tamper time value. + * + * \note This function should be called before rtc_get_tamper_source() + * function call, Otherwise the tamper time will be cleared. + * + * \param time Pointer to structure Time. + * \param reg_num Tamper register set number. + */ +extern void rtc_get_tamper_time(struct _time *time, uint8_t reg_num); + +/** + * \brief Get the RTC tamper date. + * + * \note This function should be called before rtc_get_tamper_source() + * function call, Otherwise the tamper date will be cleared. + * + * \param date Pointer to structure Date + * \param reg_num Tamper register set number. + */ +extern void rtc_get_tamper_date(struct _date *date, uint8_t reg_num); + +/** + * \brief Get the RTC tamper source. + * + * \param reg_num Current tamper register set number. + * + * \return Tamper source. + */ +extern uint32_t rtc_get_tamper_source(uint8_t reg_num); + +/** + * \brief Get the RTC tamper event counter. + * + * \note This function should be called before rtc_get_tamper_source() + * function call, Otherwise the tamper event counter will be cleared. + * + * \return Tamper event counter + */ +extern uint32_t rtc_get_tamper_event_counter(void); + +/** + * \brief Check the system is in backup mode when RTC tamper event happen. + * + * \note This function should be called before rtc_get_tamper_source() + * function call, Otherwise the flag indicates tamper occur in backup + * mode will be cleared. + * + * \param reg_num Current tamper register set number. + * + * \return 1 - The system is in backup mode when the tamper event occurs. + * 0 - The system is different from backup mode. + */ +extern uint8_t rtc_is_tamper_occur_in_backup_mode(uint8_t reg_num); + +/** + * \brief Convert number of second (count) to HMS format. + * + */ +extern void rtc_convert_time_to_hms (struct _time *time, uint32_t count); + +/** + * \brief RTC calibration for Temperature or PPM drift + */ +extern void rtc_calibration(int32_t current_tempr); + +/** + * \brief Set calendar event selection. + * + * \param mask Bits CALEVSEL of Control Register + * \return Status register & mask + */ +extern uint32_t rtc_set_calendar_event (uint32_t mask); + +/** + * \brief Set time event selection. + * + * \param mask Bits TIMEVSEL of Control Register + * \return Status register & mask + */ +extern uint32_t rtc_set_time_event (uint32_t maskask); + +#ifdef __cplusplus +} +#endif +#endif /* _RTC_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.c new file mode 100644 index 000000000..12c7bbc3b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.c @@ -0,0 +1,1414 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup sdmmc_module Working with Multi Media Cards and + * Secure Digital Memory Cards + * \ingroup peripherals_module + * The SDMMC driver provides the interface to configure and use + * the SDMMC peripheral. + * \n + * + * For more accurate information, please look at the SDMMC + * section of the Datasheet. + * + * Related files:\n + * \ref sdmmc.c\n + * \ref sdmmc.h\n + */ +/*@{*/ +/*@}*/ +/** + * \file + * + * Driver for MMC and SD Cards using the SDMMC IP. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "trace.h" +#include "intmath.h" +#include "timer.h" +#include "peripherals/pmc.h" +#include "peripherals/tc.h" +#include "peripherals/l2cc.h" +#include "peripherals/sdmmc.h" +#include "libsdmmc/sdmmc_hal.h" +#include "libsdmmc/sdmmc_api.h" /* Included for debug functions only */ + +#include +#include + +/*---------------------------------------------------------------------------- + * Local definitions + *----------------------------------------------------------------------------*/ + +/** Device status */ +#define STAT_ADDRESS_OUT_OF_RANGE (1UL << 31) +#define STAT_ADDRESS_MISALIGN (1UL << 30) +#define STAT_BLOCK_LEN_ERROR (1UL << 29) +#define STAT_ERASE_SEQ_ERROR (1UL << 28) +#define STAT_ERASE_PARAM (1UL << 27) +#define STAT_WP_VIOLATION (1UL << 26) +#define STAT_DEVICE_IS_LOCKED (1UL << 25) +#define STAT_LOCK_UNLOCK_FAILED (1UL << 24) +#define STAT_COM_CRC_ERROR (1UL << 23) +#define STAT_ILLEGAL_COMMAND (1UL << 22) +#define STAT_DEVICE_ECC_FAILED (1UL << 21) +#define STAT_CC_ERROR (1UL << 20) +#define STAT_ERROR (1UL << 19) +#define STAT_CID_OVERWRITE (1UL << 16) +#define STAT_ERASE_SKIP (1UL << 15) +#define STAT_CARD_ECC_DISABLED (1UL << 14) +#define STAT_ERASE_RESET (1UL << 13) +#define STAT_CURRENT_STATE (0xfUL << 9) +#define STAT_READY_FOR_DATA (1UL << 8) +#define STAT_SWITCH_ERROR (1UL << 7) +#define STAT_EXCEPTION_EVENT (1UL << 6) +#define STAT_APP_CMD (1UL << 5) + +/** Device state */ +#define STATE_TRANSFER 0x4 +#define STATE_SENDING_DATA 0x5 +#define STATE_RECEIVE_DATA 0x6 +#define STATE_PROGRAMMING 0x7 + +/** Driver state */ +#define MCID_OFF 0 /**< Device not powered */ +#define MCID_IDLE 1 /**< Idle */ +#define MCID_LOCKED 2 /**< Locked for specific slot */ +#define MCID_CMD 3 /**< Processing the command */ +#define MCID_ERROR 4 /**< Command error */ + +/** A software event, never raised by the hardware, specific to this driver */ +#define SDMMC_NISTR_CUSTOM_EVT (0x1u << 13) + +union uint32_u { + uint32_t word; + uint8_t bytes[4]; +}; + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static uint32_t sdmmc_send_command(void *set, sSdmmcCommand *cmd); +static uint8_t sdmmc_cancel_command(struct sdmmc_set *set); + +static void sdmmc_reset_peripheral(struct sdmmc_set *set) +{ + assert(set); + + Sdmmc *regs = set->regs; + uint8_t mc1r, tcr; + + /* First, save the few settings we'll want to restore. */ + mc1r = regs->SDMMC_MC1R; + tcr = regs->SDMMC_TCR; + + /* Reset the peripheral. This will reset almost all registers. */ + regs->SDMMC_SRR |= SDMMC_SRR_SWRSTALL; + while (regs->SDMMC_SRR & SDMMC_SRR_SWRSTALL) ; + + /* Restore specific register fields */ + if (mc1r & SDMMC_MC1R_FCD) + regs->SDMMC_MC1R |= SDMMC_MC1R_FCD; + regs->SDMMC_TCR = (regs->SDMMC_TCR & ~SDMMC_TCR_DTCVAL_Msk) + | (tcr & SDMMC_TCR_DTCVAL_Msk); + + /* Apply our unconditional custom settings */ + /* When using DMA, use the 32-bit Advanced DMA 2 mode */ + regs->SDMMC_HC1R = (regs->SDMMC_HC1R & ~SDMMC_HC1R_DMASEL_Msk) + | SDMMC_HC1R_DMASEL_ADMA32; + /* Configure maximum AHB burst size */ + regs->SDMMC_ACR = (regs->SDMMC_ACR & ~SDMMC_ACR_BMAX_Msk) + | SDMMC_ACR_BMAX_INCR16; +} + +static void sdmmc_power_device(struct sdmmc_set *set, bool on) +{ + assert(set); + + Sdmmc *regs = set->regs; + uint32_t timer_res_prv, usec = 0; + uint8_t mc1r; + + if ((on && set->state != MCID_OFF) || (!on && set->state == MCID_OFF)) + return; + if (on) { + trace_debug("Power the device on\n\r"); + /* Power the signals to/from the device */ + regs->SDMMC_PCR |= SDMMC_PCR_SDBPWR; + set->state = MCID_IDLE; + return; + } + trace_debug("Release and power the device off\n\r"); + if (set->state == MCID_CMD) + sdmmc_cancel_command(set); + + /* Hardware-reset the e.MMC, move it to the pre-idle state. + * Note that this will only be effective on systems where + * 1) the RST_n e.MMC input is wired to the SDMMCx_RSTN PIO, and + * 2) the hardware reset functionality of the device has been + * enabled by software (!) Refer to ECSD register byte 162. */ + timer_res_prv = timer_get_resolution(); + /* Generate a pulse on SDMMCx_RSTN. Satisfy tRSTW >= 1 usec. + * The timer driver can't cope with periodic interrupts triggered as + * frequently as one interrupt per microsecond. Extend to 10 usec. */ + timer_configure(10); + mc1r = regs->SDMMC_MC1R; + regs->SDMMC_MC1R = mc1r | SDMMC_MC1R_RSTN; + timer_sleep(1); + regs->SDMMC_MC1R = mc1r; + /* Wait for either tRSCA = 200 usec or 74 device clock cycles, as per + * the e.MMC Electrical Standard. */ + if (set->dev_freq != 0) + usec = ROUND_INT_DIV(74 * 1000000UL / 10UL, set->dev_freq); + usec = usec < 20 ? 20 : usec; + timer_sleep(usec); + timer_configure(timer_res_prv); + + /* Stop both the output clock and the SDMMC internal clock */ + regs->SDMMC_CCR &= ~(SDMMC_CCR_SDCLKEN | SDMMC_CCR_INTCLKEN); + set->dev_freq = 0; + /* Cut the power rail supplying signals to/from the device */ + regs->SDMMC_PCR &= ~SDMMC_PCR_SDBPWR; + /* Reset the peripheral. This will reset almost all registers. */ + sdmmc_reset_peripheral(set); + + set->state = MCID_OFF; +} + +static uint8_t sdmmc_get_bus_width(struct sdmmc_set *set) +{ + assert(set); + + const uint8_t hc1r = set->regs->SDMMC_HC1R; + + if (hc1r & SDMMC_HC1R_EXTDW) + return 8; + else if (hc1r & SDMMC_HC1R_DW) + return 4; + else + return 1; +} + +static uint8_t sdmmc_set_bus_width(struct sdmmc_set *set, uint8_t bits) +{ + assert(set); + + Sdmmc *regs = set->regs; + uint8_t hc1r_prv, hc1r; + + if (bits != 1 && bits != 4 && bits != 8) + return SDMMC_PARAM; + if (bits == 8 && !(regs->SDMMC_CA0R & SDMMC_CA0R_ED8SUP)) { + trace_error("This slot doesn't support an 8-bit data bus\n\r"); + return SDMMC_PARAM; + } + + hc1r = hc1r_prv = regs->SDMMC_HC1R; + if (bits == 8 && hc1r & SDMMC_HC1R_EXTDW) + return SDMMC_OK; + else if (bits == 8) + hc1r |= SDMMC_HC1R_EXTDW; + else { + hc1r &= ~SDMMC_HC1R_EXTDW; + if (bits == 4) + hc1r |= SDMMC_HC1R_DW; + else + hc1r &= ~SDMMC_HC1R_DW; + if (hc1r == hc1r_prv) + return SDMMC_OK; + } + regs->SDMMC_HC1R = hc1r; + return SDMMC_OK; +} + +static bool sdmmc_get_speed_mode(struct sdmmc_set *set) +{ + assert(set); + + if (set->regs->SDMMC_MC1R & SDMMC_MC1R_DDR) + return true; + if (set->regs->SDMMC_HC1R & SDMMC_HC1R_HSEN) + return true; + return false; +} + +static uint8_t sdmmc_set_speed_mode(struct sdmmc_set *set, bool high_speed) +{ + assert(set); + + Sdmmc *regs = set->regs; + uint8_t hc1r, mc1r; + bool enable_dev_clock; + + if (high_speed && !(regs->SDMMC_CA0R & SDMMC_CA0R_HSSUP)) { + trace_error("This slot doesn't support High Speed Mode\n\r"); + return SDMMC_PARAM; + } +#ifndef NDEBUG + if (high_speed && !(regs->SDMMC_CCR & (SDMMC_CCR_USDCLKFSEL_Msk + | SDMMC_CCR_SDCLKFSEL_Msk))) { + trace_error("Incompatible with the current clock config\n\r"); + return SDMMC_STATE; + } +#endif + mc1r = regs->SDMMC_MC1R; + if (high_speed && mc1r & SDMMC_MC1R_DDR) + return SDMMC_OK; + if (!high_speed && mc1r & SDMMC_MC1R_DDR) + regs->SDMMC_MC1R = mc1r & ~SDMMC_MC1R_DDR; + + hc1r = regs->SDMMC_HC1R; + if ((hc1r & SDMMC_HC1R_HSEN) == (high_speed ? SDMMC_HC1R_HSEN : 0)) + return SDMMC_OK; + hc1r ^= SDMMC_HC1R_HSEN; + /* Avoid generating glitches on the device clock */ + enable_dev_clock = regs->SDMMC_HC2R & SDMMC_HC2R_PVALEN + && regs->SDMMC_CCR & SDMMC_CCR_SDCLKEN; + if (enable_dev_clock) + regs->SDMMC_CCR &= ~SDMMC_CCR_SDCLKEN; + /* Now change the Speed Mode */ + regs->SDMMC_HC1R = hc1r; + if (enable_dev_clock) + regs->SDMMC_CCR |= SDMMC_CCR_SDCLKEN; + return SDMMC_OK; +} + +static void sdmmc_set_device_clock(struct sdmmc_set *set, uint32_t freq) +{ + assert(set); + assert(freq); + + Sdmmc *regs = set->regs; + uint32_t base_freq, div, low_freq, up_freq, new_freq; + uint32_t mult_freq, p_div, p_mode_freq; + uint16_t shval; + bool use_prog_mode = false; + +#ifndef NDEBUG + if (regs->SDMMC_HC2R & SDMMC_HC2R_PVALEN) + trace_error("Preset values enabled though not implemented\n\r"); +#endif + /* In the Divided Clock Mode scenario, compute the divider */ + base_freq = (regs->SDMMC_CA0R & SDMMC_CA0R_BASECLKF_Msk) >> SDMMC_CA0R_BASECLKF_Pos; + base_freq *= 1000000UL; + /* DIV = FBASECLK / (2 * FSDCLK) */ + div = base_freq / (2 * freq); + if (div >= 0x3ff) + div = 0x3ff; + else { + up_freq = base_freq / (div == 0 ? 1UL : 2 * div); + low_freq = base_freq / (2 * (div + 1UL)); + if (up_freq > freq && (up_freq - freq) > (freq - low_freq)) + div += 1; + } + new_freq = base_freq / (div == 0 ? 1UL : 2 * div); + + /* Now, in the Programmable Clock Mode scenario, compute the divider. + * First, retrieve the frequency of the Generated Clock feeding this + * peripheral. */ + /* TODO fix CLKMULT value in CA1R capability register: the default value + * is 32 whereas the real value is 40.5 */ + mult_freq = (regs->SDMMC_CA1R & SDMMC_CA1R_CLKMULT_Msk) >> SDMMC_CA1R_CLKMULT_Pos; + if (mult_freq != 0) +#if 0 + mult_freq = base_freq * (mult_freq + 1); +#else + mult_freq = pmc_get_gck_clock(set->id); +#endif + if (mult_freq != 0) { + /* DIV = FMULTCLK / FSDCLK - 1 */ + p_div = ROUND_INT_DIV(mult_freq, freq); + if (p_div > 0x3ff) + p_div = 0x3ff; + else if (p_div != 0) + p_div = p_div - 1; + p_mode_freq = mult_freq / (p_div + 1); + if (ABS_DIFF(freq, p_mode_freq) < ABS_DIFF(freq, new_freq)) { + use_prog_mode = true; + div = p_div; + new_freq = p_mode_freq; + } + } + + /* Stop both the output clock and the SDMMC internal clock */ + shval = regs->SDMMC_CCR & ~SDMMC_CCR_SDCLKEN & ~SDMMC_CCR_INTCLKEN; + regs->SDMMC_CCR = shval; + set->dev_freq = new_freq; + /* Select the clock mode */ + if (use_prog_mode) + shval |= SDMMC_CCR_CLKGSEL; + else + shval &= ~SDMMC_CCR_CLKGSEL; + /* Set the clock divider, and start the SDMMC internal clock */ + shval = (shval & ~SDMMC_CCR_USDCLKFSEL_Msk & ~SDMMC_CCR_SDCLKFSEL_Msk) + | SDMMC_CCR_USDCLKFSEL(div >> 8) | SDMMC_CCR_SDCLKFSEL(div & 0xff) + | SDMMC_CCR_INTCLKEN; + regs->SDMMC_CCR = shval; + while (!(regs->SDMMC_CCR & SDMMC_CCR_INTCLKS)) ; + /* Now start the output clock */ + regs->SDMMC_CCR |= SDMMC_CCR_SDCLKEN; +} + +static uint8_t sdmmc_build_dma_table(struct sdmmc_set *set, sSdmmcCommand *cmd) +{ + assert(set); + assert(set->table); + assert(set->table_size); + assert(cmd->pData); + assert(cmd->wBlockSize); + assert(cmd->wNbBlocks); + + uint32_t *line = NULL; + uint32_t data_len = (uint32_t)cmd->wNbBlocks + * (uint32_t)cmd->wBlockSize; + uint32_t ram_addr = (uint32_t)cmd->pData; + uint32_t ram_bound = ram_addr + data_len; + uint32_t line_ix, line_cnt; + uint8_t rc = SDMMC_OK; + +#if 0 && !defined(NDEBUG) + trace_debug("Configuring DMA for a %luB transfer %s %p\n\r", + data_len, cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX ? "from" : "to", + cmd->pData); +#endif + /* Verify that cmd->pData is word-aligned */ + if ((uint32_t)cmd->pData & 0x3) + return SDMMC_PARAM; + /* Compute the size of the descriptor table for this transfer */ + line_cnt = (data_len - 1 + SDMMC_DMADL_TRAN_LEN_MAX) + / SDMMC_DMADL_TRAN_LEN_MAX; + /* If it won't fit into the allocated buffer, resize the transfer */ + if (line_cnt > set->table_size) { + line_cnt = set->table_size; + data_len = line_cnt * SDMMC_DMADL_TRAN_LEN_MAX; + data_len /= cmd->wBlockSize; + if (data_len == 0) + return SDMMC_NOT_SUPPORTED; + cmd->wNbBlocks = (uint16_t)data_len; + data_len *= cmd->wBlockSize; + ram_bound = ram_addr + data_len; + rc = SDMMC_CHANGED; + } + /* Fill the table */ + for (line_ix = 0, line = set->table; line_ix < line_cnt; + line_ix++, line += SDMMC_DMADL_SIZE) { + if (line_ix + 1 < line_cnt) { + line[0] = SDMMC_DMA0DL_LEN_MAX + | SDMMC_DMA0DL_ATTR_ACT_TRAN + | SDMMC_DMA0DL_ATTR_VALID; + line[1] = SDMMC_DMA1DL_ADDR(ram_addr); + ram_addr += SDMMC_DMADL_TRAN_LEN_MAX; + } + else { + line[0] = ram_bound - ram_addr + < SDMMC_DMADL_TRAN_LEN_MAX + ? SDMMC_DMA0DL_LEN(ram_bound - ram_addr) + : SDMMC_DMA0DL_LEN_MAX; + line[0] |= SDMMC_DMA0DL_ATTR_ACT_TRAN + | SDMMC_DMA0DL_ATTR_END | SDMMC_DMA0DL_ATTR_VALID; + line[1] = SDMMC_DMA1DL_ADDR(ram_addr); + } +#if 0 && !defined(NDEBUG) + trace_debug("DMA descriptor: %luB @ 0x%lx%c\n\r", + (line[0] & SDMMC_DMA0DL_LEN_Msk) >> SDMMC_DMA0DL_LEN_Pos, + line[1], line[0] & SDMMC_DMA0DL_ATTR_END ? '.' : ' '); +#endif + } + /* Clean the underlying cache lines, to ensure the DMA gets our table + * when it reads from RAM. + * CPU access to the table is write-only, peripheral/DMA access is read- + * only, hence there is no need to invalidate. */ + l2cc_clean_region((uint32_t)set->table, (uint32_t)line); + + return rc; +} + +/** + * \brief Retrieve command response from the SDMMC peripheral. + * The response may be retrieved once per command. + */ +static void sdmmc_get_response(struct sdmmc_set *set, sSdmmcCommand *cmd, + bool complete, uint32_t *out) +{ + assert(set); + assert(cmd); + assert(cmd->cmdOp.bmBits.respType <= 7); + assert(out); + + const bool first_call = set->resp_len == 0; + const bool has_data = cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX + || cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX; + uint32_t resp; + uint8_t ix; + + if (first_call) { + switch (cmd->cmdOp.bmBits.respType) { + case 2: + /* R2 response is 120-bit long, split in + * 32+32+32+24 bits this way: + * RR[0] = R[ 39: 8] + * RR[1] = R[ 71: 40] + * RR[2] = R[103: 72] + * RR[3] = R[127:104] + * Shift data the way libsdmmc expects it, + * that is: + * pResp[0] = R[127: 96] + * pResp[1] = R[ 95: 64] + * pResp[2] = R[ 63: 32] + * pResp[3] = R[ 31: 0] + * The CRC7 and the end bit aren't provided, + * just hard-code their default values. */ + out[3] = 0x000000ff; + for (ix = 0; ix < 4; ix++) { + resp = set->regs->SDMMC_RR[ix]; + if (ix < 3) + out[2 - ix] = resp >> 24 & 0xff; + out[3 - ix] |= resp << 8 & 0xffffff00; + } + set->resp_len = 4; + break; + case 1: case 3: case 4: case 5: case 6: case 7: + /* The nominal response is 32-bit long */ + out[0] = set->regs->SDMMC_RR[0]; + set->resp_len = 1; + break; + case 0: + default: + break; + } + } + + if (has_data && (cmd->bCmd == 18 || cmd->bCmd == 25) && ((first_call + && set->use_set_blk_cnt) || (complete && !set->use_set_blk_cnt))) { + resp = set->regs->SDMMC_RR[3]; +#if 0 && !defined(NDEBUG) + trace_debug("Auto CMD%d returned status 0x%lx\n\r", + set->use_set_blk_cnt ? 23 : 12, resp); +#endif + if (!set->use_set_blk_cnt) + /* We return a single response to the application: the + * device status returned by CMD18 or CMD25, combined + * with the device status just returned by Auto CMD12. + * Retain the status bits from only CMD18 or CMD25, and + * combine the exception bits from both. */ + out[0] |= resp & ~STAT_DEVICE_IS_LOCKED + & ~STAT_CARD_ECC_DISABLED & ~STAT_CURRENT_STATE + & ~STAT_READY_FOR_DATA & ~STAT_EXCEPTION_EVENT + & ~STAT_APP_CMD; +#ifndef NDEBUG + resp = (resp & STAT_CURRENT_STATE) >> 9; + if (set->use_set_blk_cnt && resp != STATE_TRANSFER) + trace_warning("Auto CMD23 returned state %lx\n\r", resp) + else if (!set->use_set_blk_cnt && cmd->bCmd == 18 + && resp != STATE_SENDING_DATA) + trace_warning("CMD18 switched to state %lx\n\r", resp) + else if (!set->use_set_blk_cnt && cmd->bCmd == 25 + && resp != STATE_RECEIVE_DATA && resp != STATE_PROGRAMMING) + trace_warning("CMD25 switched to state %lx\n\r", resp) +#endif + } +} + +/** + * \brief Fetch events from the SDMMC peripheral, handle them, and proceed to + * the subsequent step, w.r.t. the SD/MMC command being processed. + * \warning This implementation suits LITTLE ENDIAN hosts only. + */ +static void sdmmc_poll(struct sdmmc_set *set) +{ + assert(set); + assert(set->state != MCID_OFF); + + Sdmmc *regs = set->regs; + sSdmmcCommand *cmd = set->cmd; + uint16_t events, errors, acesr; + bool has_data; + + if (set->state != MCID_CMD) + return; + assert(cmd); + has_data = cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX + || cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX; + +Fetch: + /* Fetch normal events */ + events = regs->SDMMC_NISTR; + if (set->expect_auto_end && !(set->timer->TC_SR & TC_SR_CLKSTA)) + events |= SDMMC_NISTR_CUSTOM_EVT; + if (!events) + return; + + errors = 0; + /* Check the global error flag */ + if (events & SDMMC_NISTR_ERRINT) { + errors = regs->SDMMC_EISTR; + events &= ~SDMMC_NISTR_ERRINT; + /* Clear error interrupts */ + regs->SDMMC_EISTR = errors; + if (errors & SDMMC_EISTR_CURLIM) + cmd->bStatus = SDMMC_NOT_INITIALIZED; + else if (errors & SDMMC_EISTR_CMDCRC) + cmd->bStatus = SDMMC_ERR_IO; + else if (errors & SDMMC_EISTR_CMDTEO) + cmd->bStatus = SDMMC_NO_RESPONSE; + else if (errors & (SDMMC_EISTR_CMDEND | SDMMC_EISTR_CMDIDX)) + cmd->bStatus = SDMMC_ERR_IO; + /* TODO if SDMMC_NISTR_TRFC and only SDMMC_EISTR_DATTEO then + * ignore SDMMC_EISTR_DATTEO */ + else if (errors & SDMMC_EISTR_DATTEO) + cmd->bStatus = SDMMC_ERR_IO; + else if (errors & (SDMMC_EISTR_DATCRC | SDMMC_EISTR_DATEND)) + cmd->bStatus = SDMMC_ERR_IO; + else if (errors & SDMMC_EISTR_ACMD) { + acesr = regs->SDMMC_ACESR; + if (acesr & SDMMC_ACESR_ACMD12NE) + cmd->bStatus = SDMMC_ERR; + else if (acesr & SDMMC_ACESR_ACMDCRC) + cmd->bStatus = SDMMC_ERR_IO; + else if (acesr & SDMMC_ACESR_ACMDTEO) + cmd->bStatus = SDMMC_NO_RESPONSE; + else if (acesr & (SDMMC_ACESR_ACMDEND | SDMMC_ACESR_ACMDIDX)) + cmd->bStatus = SDMMC_ERR_IO; + else + cmd->bStatus = SDMMC_ERR; + } + else if (errors & SDMMC_EISTR_ADMA) { + cmd->bStatus = SDMMC_PARAM; + trace_error("ADMA error 0x%x at desc. line[%lu]\n\r", + regs->SDMMC_AESR, (regs->SDMMC_ASA0R - + (uint32_t)set->table) / (SDMMC_DMADL_SIZE * 4UL)); + } + else if (errors & SDMMC_EISTR_BOOTAE) + cmd->bStatus = SDMMC_STATE; + else + cmd->bStatus = SDMMC_ERR; + set->state = cmd->bCmd == 12 ? MCID_LOCKED : MCID_ERROR; + /* Reset CMD and DAT lines. + * Resetting DAT lines also aborts the DMA transfer - if any - + * and resets the DMA circuit. */ + regs->SDMMC_SRR |= SDMMC_SRR_SWRSTDAT | SDMMC_SRR_SWRSTCMD; + while (regs->SDMMC_SRR & (SDMMC_SRR_SWRSTDAT + | SDMMC_SRR_SWRSTCMD)) ; + trace_warning("CMD%u ended with error flags %04x, cmd status " + "%s\n\r", cmd->bCmd, errors, SD_StringifyRetCode(cmd->bStatus)); + goto End; + } + + /* No error. Give priority to the low-latency event that signals the + * completion of the Auto CMD12 command, hence of the whole multiple- + * block data transfer. */ + if (events & SDMMC_NISTR_CUSTOM_EVT) { +#ifndef NDEBUG + if (!(set->regs->SDMMC_PSR & SDMMC_PSR_CMDLL)) + trace_warning("Command still ongoing\n\r"); +#endif + if (cmd->pResp) + sdmmc_get_response(set, cmd, true, cmd->pResp); + goto Succeed; + } + + /* First, expect completion of the command */ + if (events & SDMMC_NISTR_CMDC) { + /* Clear this normal interrupt */ + regs->SDMMC_NISTR = SDMMC_NISTR_CMDC; + events &= ~SDMMC_NISTR_CMDC; +#ifndef NDEBUG + if (cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX + && !set->table && set->blk_index != cmd->wNbBlocks + && !(regs->SDMMC_PSR & SDMMC_PSR_WTACT)) + trace_warning("Write transfer not started\n\r") + else if (cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX + && !set->table && set->blk_index != cmd->wNbBlocks + && !(regs->SDMMC_PSR & SDMMC_PSR_RTACT)) + trace_warning("Read transfer not started\n\r") +#endif + /* Retrieve command response */ + if (cmd->pResp) + sdmmc_get_response(set, cmd, false, cmd->pResp); + if (!has_data && !cmd->cmdOp.bmBits.checkBsy) + goto Succeed; + } + + /* Expect the next incoming block of data */ + if (events & SDMMC_NISTR_BRDRDY + && cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX && !set->table) { + /* FIXME may be optimized by looping while PSR.BUFRDEN == 1 */ + uint8_t *in, *out, *bound; + union uint32_u val; + uint16_t count; + + /* Clear this normal interrupt */ + regs->SDMMC_NISTR = SDMMC_NISTR_BRDRDY; + events &= ~SDMMC_NISTR_BRDRDY; + + if (set->blk_index >= cmd->wNbBlocks) { + trace_error("Excess of incoming data\n\r"); + cmd->bStatus = SDMMC_ERR_IO; + set->state = MCID_ERROR; + goto End; + } + out = cmd->pData + set->blk_index * (uint32_t)cmd->wBlockSize; + count = cmd->wBlockSize & ~0x3; + for (bound = out + count; out < bound; out += 4) { +#ifndef NDEBUG + if (!(regs->SDMMC_PSR & SDMMC_PSR_BUFRDEN)) + trace_error("Unexpected Buffer Read Disable status\n\r"); +#endif + val.word = regs->SDMMC_BDPR; + out[0] = val.bytes[0]; + out[1] = val.bytes[1]; + out[2] = val.bytes[2]; + out[3] = val.bytes[3]; + } + if (count < cmd->wBlockSize) { +#ifndef NDEBUG + if (!(regs->SDMMC_PSR & SDMMC_PSR_BUFRDEN)) + trace_error("Unexpected Buffer Read Disable status\n\r"); +#endif + val.word = regs->SDMMC_BDPR; + count = cmd->wBlockSize - count; + for (in = val.bytes, bound = out + count; + out < bound; in++, out++) + *out = *in; + } +#if 0 && !defined(NDEBUG) + if (regs->SDMMC_PSR & SDMMC_PSR_BUFRDEN) + trace_warning("Renewed Buffer Read Enable status\n\r"); +#endif + set->blk_index++; + } + + /* Expect the Buffer Data Port to be ready to accept the next + * outgoing block of data */ + if (events & SDMMC_NISTR_BWRRDY + && cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX && !set->table + && set->blk_index < cmd->wNbBlocks) { + /* FIXME may be optimized by looping while PSR.BUFWREN == 1 */ + uint8_t *in, *out, *bound; + union uint32_u val; + uint16_t count; + + /* Clear this normal interrupt */ + regs->SDMMC_NISTR = SDMMC_NISTR_BWRRDY; + events &= ~SDMMC_NISTR_BWRRDY; + + in = cmd->pData + set->blk_index * (uint32_t)cmd->wBlockSize; + count = cmd->wBlockSize & ~0x3; + for (bound = in + count; in < bound; in += 4) { + val.bytes[0] = in[0]; + val.bytes[1] = in[1]; + val.bytes[2] = in[2]; + val.bytes[3] = in[3]; +#ifndef NDEBUG + if (!(regs->SDMMC_PSR & SDMMC_PSR_BUFWREN)) + trace_error("Unexpected Buffer Write Disable status\n\r"); +#endif + regs->SDMMC_BDPR = val.word; + } + if (count < cmd->wBlockSize) { + count = cmd->wBlockSize - count; + for (val.word = 0, out = val.bytes, bound = in + count; + in < bound; in++, out++) + *out = *in; +#ifndef NDEBUG + if (!(regs->SDMMC_PSR & SDMMC_PSR_BUFWREN)) + trace_error("Unexpected Buffer Write Disable status\n\r"); +#endif + regs->SDMMC_BDPR = val.word; + } +#if 0 && !defined(NDEBUG) + if (regs->SDMMC_PSR & SDMMC_PSR_BUFWREN) + trace_warning("Renewed Buffer Write Enable status\n\r"); +#endif + set->blk_index++; + } +#ifndef NDEBUG + else if (events & SDMMC_NISTR_BWRRDY + && cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX && !set->table + && set->blk_index >= cmd->wNbBlocks) + trace_warning("Excess Buffer Write Ready status\n\r"); +#endif + + /* Expect completion of either the data transfer or the busy state. */ + if (events & SDMMC_NISTR_TRFC) { + /* Deviation from the SD Host Controller Specification: + * the Auto CMD12 command/response (when enabled) is still in + * progress. We are on our own to figure out when CMD12 will + * have completed. + * In the meantime: + * 1. errors affecting the CMD12 command - essentially + * SDMMC_EISTR_ACMD - have not been detected yet. + * 2. SDMMC_RR[3] is not yet valid. + * Our workaround here consists in generating a third event + * further to Transfer Complete, after a predefined amount of + * time, sufficient for CMD12 to complete. + * Refer to sdmmc_send_command(), which has prepared our Timer/ + * Counter for this purpose. */ + if (has_data && (cmd->bCmd == 18 || cmd->bCmd == 25) + && !set->use_set_blk_cnt) { + set->timer->TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG; + set->expect_auto_end = true; + } + /* Clear this normal interrupt */ + regs->SDMMC_NISTR = SDMMC_NISTR_TRFC; + events &= ~SDMMC_NISTR_TRFC; + /* Deviation from the SD Host Controller Specification: + * there are cases, notably CMD7 with address and R1b, where the + * Command Complete interrupt does not occur. In such cases, + * the command response has not been retrieved yet. */ + if (!set->expect_auto_end && cmd->pResp) + sdmmc_get_response(set, cmd, true, cmd->pResp); +#ifndef NDEBUG + if (regs->SDMMC_PSR & SDMMC_PSR_WTACT) + trace_error("Write transfer still active\n\r"); + if (regs->SDMMC_PSR & SDMMC_PSR_RTACT) + trace_error("Read transfer still active\n\r"); +#endif + if (has_data && !set->table + && set->blk_index != cmd->wNbBlocks) { + trace_error("Incomplete data transfer\n\r"); + cmd->bStatus = SDMMC_ERR_IO; + set->state = MCID_ERROR; + goto End; + } + else if (has_data && set->table + && cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX) + l2cc_invalidate_region((uint32_t)cmd->pData, + (uint32_t)cmd->pData + (uint32_t)cmd->wNbBlocks + * (uint32_t)cmd->wBlockSize); + if (!set->expect_auto_end) + goto Succeed; + } + +#ifndef NDEBUG + if (events) + trace_warning("Unhandled NISTR events: 0x%04x\n\r", events); +#endif + if (events) + regs->SDMMC_NISTR = events; + goto Fetch; + +Succeed: + set->state = MCID_LOCKED; +End: + /* Clear residual normal interrupts, if any */ + if (events) + regs->SDMMC_NISTR = events; +#if 0 && !defined(NDEBUG) + if (set->resp_len == 1) + trace_debug("CMD%u got response %08lx\n\r", cmd->bCmd, + cmd->pResp[0]) + else if (set->resp_len == 4) + trace_debug("CMD%u got response %08lx %08lx %08lx %08lx\n\r", + cmd->bCmd, cmd->pResp[0], cmd->pResp[1], cmd->pResp[2], + cmd->pResp[3]) +#endif + /* Release command */ + set->cmd = NULL; + set->resp_len = 0; + set->blk_index = 0; + set->expect_auto_end = false; + /* Invoke the end-of-command fSdmmcCallback function, if provided */ + if (cmd->fCallback) + (cmd->fCallback)(cmd->bStatus, cmd->pArg); +} + +/** + * \brief Check if the command is finished. + */ +static bool sdmmc_is_busy(struct sdmmc_set *set) +{ + assert(set->state != MCID_OFF); + + if (set->use_polling) + sdmmc_poll(set); + if (set->state == MCID_CMD) + return true; + return false; +} + +static uint8_t sdmmc_cancel_command(struct sdmmc_set *set) +{ + assert(set); + assert(set->state != MCID_OFF); + + Sdmmc *regs = set->regs; + sSdmmcCommand *cmd = set->cmd; + uint32_t response; /* The R1 response is 32-bit long */ + uint32_t timer_res_prv, usec, rc; + sSdmmcCommand stop_cmd = { + .pResp = &response, + .cmdOp.wVal = SDMMC_CMD_CSTOP | SDMMC_CMD_bmBUSY, + .bCmd = 12, + }; + + if (set->state != MCID_CMD && set->state != MCID_ERROR) + return SDMMC_STATE; + trace_debug("Requested to cancel CMD%u\n\r", set->cmd ? set->cmd->bCmd : 99); + if (set->state == MCID_ERROR) { + set->state = MCID_LOCKED; + return SDMMC_OK; + } + assert(cmd); + /* Asynchronous Abort, if a data transfer has been started */ + if (cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX + || cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX) { + /* May the CMD line still be busy, reset it */ + if (regs->SDMMC_PSR & SDMMC_PSR_CMDINHC) { + regs->SDMMC_SRR |= SDMMC_SRR_SWRSTCMD; + while (regs->SDMMC_SRR & SDMMC_SRR_SWRSTCMD) ; + } + /* Issue the STOP_TRANSMISSION command. */ + set->state = MCID_LOCKED; + set->cmd = NULL; + set->resp_len = 0; + set->blk_index = 0; + set->expect_auto_end = false; + rc = sdmmc_send_command(set, &stop_cmd); + if (rc == SDMMC_OK) { + timer_res_prv = timer_get_resolution(); + timer_configure(10); + for (usec = 0; set->state == MCID_CMD && usec < 500000; usec+= 10) { + timer_sleep(1); + sdmmc_poll(set); + } + timer_configure(timer_res_prv); + } + } + /* Reset CMD and DATn lines */ + regs->SDMMC_SRR |= SDMMC_SRR_SWRSTDAT | SDMMC_SRR_SWRSTCMD; + while (regs->SDMMC_SRR & (SDMMC_SRR_SWRSTDAT | SDMMC_SRR_SWRSTCMD)) ; + /* Release command */ + cmd->bStatus = SDMMC_ERROR_USER_CANCEL; + set->state = MCID_LOCKED; + set->cmd = NULL; + set->resp_len = 0; + set->blk_index = 0; + set->expect_auto_end = false; + /* Invoke the end-of-command fSdmmcCallback function, if provided */ + if (cmd->fCallback) + (cmd->fCallback)(cmd->bStatus, cmd->pArg); + return SDMMC_OK; +} + +/*---------------------------------------------------------------------------- + * HAL for the SD/MMC library + *----------------------------------------------------------------------------*/ + +/** + * Here is the fSdmmcLock-type callback. + * Lock the driver for slot N access. + * TODO implement, once used by the library. + */ +static uint32_t sdmmc_lock(void *_set, uint8_t slot) +{ + assert(_set); + + if (slot > 0) { + return SDMMC_ERROR_PARAM; + } + return SDMMC_OK; +} + +/** + * Here is the fSdmmcRelease-type callback. + * Release the driver. + * TODO implement, once used by the library. + */ +static uint32_t sdmmc_release(void *_set) +{ + assert(_set); + + return SDMMC_OK; +} + +/** + * Here is the fSdmmcIOCtrl-type callback. + * IO control functions. + * \param _set Pointer to driver instance data (struct sdmmc_set). + * \param bCtl IO control code. + * \param param IO control parameter. Optional, depends on the IO control code. + * \return Return code, from the eSDMMC_RC enumeration. + */ +static uint32_t sdmmc_control(void *_set, uint32_t bCtl, uint32_t param) +{ + assert(_set); + + struct sdmmc_set *set = (struct sdmmc_set *)_set; + uint32_t rc = SDMMC_OK, *param_u32 = (uint32_t *)param; + uint8_t byte; + +#ifndef NDEBUG + if (bCtl != SDMMC_IOCTL_BUSY_CHECK && bCtl != SDMMC_IOCTL_GET_DEVICE) + trace_debug("%s(%lu)\n\r", SD_StringifyIOCtrl(bCtl), + param ? *param_u32 : 0); +#endif + + switch (bCtl) { + case SDMMC_IOCTL_GET_DEVICE: + if (!param) + return SDMMC_ERROR_PARAM; + *param_u32 = set->regs->SDMMC_PSR & SDMMC_PSR_CARDINS ? 1 : 0; + break; + + case SDMMC_IOCTL_POWER: + if (!param) + return SDMMC_ERROR_PARAM; + sdmmc_power_device(set, *param_u32 ? true : false); + break; + + case SDMMC_IOCTL_RESET: + /* Release the device. The device may have been removed. */ + sdmmc_power_device(set, false); + break; + + case SDMMC_IOCTL_GET_BUSMODE: + if (!param) + return SDMMC_ERROR_PARAM; + byte = sdmmc_get_bus_width(set); + *param_u32 = byte; + break; + + case SDMMC_IOCTL_SET_BUSMODE: + if (!param) + return SDMMC_ERROR_PARAM; + if (*param_u32 > 0xff) + return SDMMC_ERROR_PARAM; + rc = sdmmc_set_bus_width(set, (uint8_t)*param_u32); + byte = sdmmc_get_bus_width(set); + trace_debug("Using a %u-bit data bus\n\r", byte); + break; + + case SDMMC_IOCTL_GET_HSMODE: + if (!param) + return SDMMC_ERROR_PARAM; + *param_u32 = set->regs->SDMMC_CA0R & SDMMC_CA0R_HSSUP ? 1 : 0; + break; + + case SDMMC_IOCTL_SET_HSMODE: + if (!param) + return SDMMC_ERROR_PARAM; + rc = sdmmc_set_speed_mode(set, *param_u32 ? true : false); + *param_u32 = sdmmc_get_speed_mode(set) ? 1 : 0; + trace_debug("Using %s mode\n\r", *param_u32 ? "High Speed" : "Default Speed"); + break; + + case SDMMC_IOCTL_SET_CLOCK: + if (!param) + return SDMMC_ERROR_PARAM; + if (*param_u32 == 0) + return SDMMC_ERROR_PARAM; + sdmmc_set_device_clock(set, *param_u32); + trace_debug("Clocking the device at %lu Hz\n\r", set->dev_freq); + if (set->dev_freq != *param_u32) { + rc = SDMMC_CHANGED; + *param_u32 = set->dev_freq; + } + break; + + case SDMMC_IOCTL_SET_LENPREFIX: + if (!param) + return SDMMC_ERROR_PARAM; + set->use_set_blk_cnt = *param_u32 ? true : false; + *param_u32 = set->use_set_blk_cnt ? 1 : 0; + break; + + case SDMMC_IOCTL_GET_XFERCOMPL: + if (!param) + return SDMMC_ERROR_PARAM; + *param_u32 = 1; + break; + + case SDMMC_IOCTL_BUSY_CHECK: + if (!param) + return SDMMC_ERROR_PARAM; + if (set->state == MCID_OFF) + *param_u32 = 0; + else + *param_u32 = sdmmc_is_busy(set) ? 1 : 0; + break; + + case SDMMC_IOCTL_CANCEL_CMD: + if (set->state == MCID_OFF) + rc = SDMMC_STATE; + else + rc = sdmmc_cancel_command(set); + break; + + case SDMMC_IOCTL_GET_CLOCK: + case SDMMC_IOCTL_SET_BOOTMODE: + case SDMMC_IOCTL_GET_BOOTMODE: + default: + rc = SDMMC_ERROR_NOT_SUPPORT; + break; + } +#ifndef NDEBUG + if (rc != SDMMC_OK && rc != SDMMC_CHANGED && bCtl != SDMMC_IOCTL_BUSY_CHECK) + trace_error("%s ended with %s\n\r", SD_StringifyIOCtrl(bCtl), SD_StringifyRetCode(rc)); +#endif + return rc; +} + +/** + * Here is the fSdmmcSendCommand-type callback. + * SD/MMC command. + * \param _set Pointer to driver instance data (struct sdmmc_set). + * \param cmd Pointer to the command to be sent. Owned by the caller. Shall + * remain valid until the command is completed or stopped. For commands which + * transfer data, mind the peripheral and DMA alignment requirements that the + * external data buffer shall meet. Especially when DMA is used to read from the + * device, in which case the buffer shall be aligned on entire cache lines. + * \return Return code, from the eSDMMC_RC enumeration. If SDMMC_OK, the command + * has been issued and the caller should: + * 1. poll on sdmmc_is_busy(), + * 2. once finished, check the result of the command in cmd->bStatus. + * TODO in future when libsdmmc will set it: call sSdmmcCommand::fCallback. + */ +static uint32_t sdmmc_send_command(void *_set, sSdmmcCommand *cmd) +{ + assert(_set); + assert(cmd); + assert(cmd->bCmd <= 63); + + struct sdmmc_set *set = (struct sdmmc_set *)_set; + Sdmmc *regs = set->regs; + const bool stop_xfer = cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_STOPXFR; + const bool has_data = cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX + || cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_RX; + const bool multiple_xfer = cmd->bCmd == 18 || cmd->bCmd == 25; + const bool blk_count_prefix = (cmd->bCmd == 18 || cmd->bCmd == 25) + && set->use_set_blk_cnt; + const bool stop_xfer_suffix = (cmd->bCmd == 18 || cmd->bCmd == 25) + && !set->use_set_blk_cnt; + uint32_t timer_res_prv, usec, eister, mask, cycles; + uint16_t cr, tmr; + uint8_t rc = SDMMC_OK, mc1r; + + if (set->state == MCID_OFF) + return SDMMC_STATE; + if (cmd->cmdOp.bmBits.powerON == cmd->cmdOp.bmBits.sendCmd) { + trace_error("Invalid command\n\r"); + return SDMMC_ERROR_PARAM; + } + if (stop_xfer && cmd->bCmd != 12 && cmd->bCmd != 52) { + trace_error("Inconsistent abort command\n\r"); + return SDMMC_ERROR_PARAM; + } + if (cmd->cmdOp.bmBits.powerON) { + /* Special call, no command to send this time */ + /* Wait for 74 SD Clock cycles, as per SD Card specification. + * The e.MMC Electrical Standard specifies tRSCA >= 200 usec. */ + if (set->dev_freq == 0) { + trace_error("Shall enable the device clock first\n\r"); + return SDMMC_ERROR_STATE; + } + timer_res_prv = timer_get_resolution(); + usec = ROUND_INT_DIV(74 * 1000000UL, set->dev_freq); + timer_configure(usec < 200 ? 200 : usec); + timer_sleep(1); + timer_configure(timer_res_prv); + return SDMMC_OK; + } + + if (has_data && (cmd->wNbBlocks == 0 || cmd->wBlockSize == 0 + || cmd->pData == NULL)) { + trace_error("Invalid data\n\r"); + return SDMMC_ERROR_PARAM; + } + if (has_data && cmd->wBlockSize > set->blk_size) { + trace_error("%u-byte data block size not supported\n\r", cmd->wBlockSize); + return SDMMC_ERROR_PARAM; + } + if (has_data && set->table) { + /* Using DMA. Prepare the descriptor table. */ + rc = sdmmc_build_dma_table(set, cmd); + if (rc != SDMMC_OK && rc != SDMMC_CHANGED) + return rc; + if (cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX) + /* Ensure the outgoing data can be fetched directly from + * RAM */ + l2cc_clean_region((uint32_t)cmd->pData, + (uint32_t)cmd->pData + (uint32_t)cmd->wNbBlocks + * (uint32_t)cmd->wBlockSize); + } + if (multiple_xfer && !has_data) + trace_warning("Inconsistent data\n\r"); + if (sdmmc_is_busy(set)) { + trace_error("Concurrent command\n\r"); + return SDMMC_ERROR_BUSY; + } + set->state = MCID_CMD; + set->cmd = cmd; + set->resp_len = 0; + set->blk_index = 0; + set->expect_auto_end = false; + cmd->bStatus = rc; + + tmr = (regs->SDMMC_TMR & ~SDMMC_TMR_MSBSEL & ~SDMMC_TMR_DTDSEL + & ~SDMMC_TMR_ACMDEN_Msk & ~SDMMC_TMR_BCEN & ~SDMMC_TMR_DMAEN) + | SDMMC_TMR_ACMDEN_DIS; + mc1r = (regs->SDMMC_MC1R & ~SDMMC_MC1R_OPD & ~SDMMC_MC1R_CMDTYP_Msk) + | SDMMC_MC1R_CMDTYP_NORMAL; + cr = (regs->SDMMC_CR & ~SDMMC_CR_CMDIDX_Msk & ~SDMMC_CR_CMDTYP_Msk + & ~SDMMC_CR_DPSEL & ~SDMMC_CR_RESPTYP_Msk) + | SDMMC_CR_CMDIDX(cmd->bCmd) | SDMMC_CR_CMDTYP_NORMAL + | SDMMC_CR_CMDICEN | SDMMC_CR_CMDCCEN; + eister = SDMMC_EISTER_BOOTAE | SDMMC_EISTER_ADMA + | SDMMC_EISTER_ACMD | SDMMC_EISTER_CURLIM | SDMMC_EISTER_DATEND + | SDMMC_EISTER_DATCRC | SDMMC_EISTER_DATTEO | SDMMC_EISTER_CMDIDX + | SDMMC_EISTER_CMDEND | SDMMC_EISTER_CMDCRC | SDMMC_EISTER_CMDTEO; + + if (cmd->cmdOp.bmBits.odON) + mc1r |= SDMMC_MC1R_OPD; + switch (cmd->cmdOp.bmBits.respType) { + case 2: + cr |= SDMMC_CR_RESPTYP_RL136; + /* R2 response doesn't include the command index */ + eister &= ~SDMMC_EISTER_CMDIDX; + break; + case 3: + /* R3 response includes neither the command index nor the CRC */ + eister &= ~(SDMMC_EISTER_CMDIDX | SDMMC_EISTER_CMDCRC); + case 1: + case 4: + if (cmd->cmdOp.bmBits.respType == 4 && cmd->cmdOp.bmBits.ioCmd) + /* SDIO R4 response includes neither the command index nor the CRC */ + eister &= ~(SDMMC_EISTER_CMDIDX | SDMMC_EISTER_CMDCRC); + case 5: + case 6: + case 7: + cr |= cmd->cmdOp.bmBits.checkBsy ? SDMMC_CR_RESPTYP_RL48BUSY + : SDMMC_CR_RESPTYP_RL48; + break; + default: + /* No response, ignore response time-out error */ + cr |= SDMMC_CR_RESPTYP_NORESP; + eister &= ~SDMMC_EISTER_CMDTEO; + break; + } + if (stop_xfer) { + tmr |= SDMMC_TMR_MSBSEL | SDMMC_TMR_BCEN; + /* TODO consider BGCR:STPBGR (pause) */ + /* TODO in case of SDIO consider CR:CMDTYP = ABORT */ + /* Ignore data errors */ + eister = eister & ~SDMMC_EISTER_ADMA & ~SDMMC_EISTER_DATEND + & ~SDMMC_EISTER_DATCRC & ~SDMMC_EISTER_DATTEO; + } + else if (has_data) { + cr |= SDMMC_CR_DPSEL; + tmr |= cmd->cmdOp.bmBits.xfrData == SDMMC_CMD_TX + ? SDMMC_TMR_DTDSEL_WR : SDMMC_TMR_DTDSEL_RD; + if (blk_count_prefix) + tmr = (tmr & ~SDMMC_TMR_ACMDEN_Msk) + | SDMMC_TMR_ACMDEN_ACMD23; + else if (stop_xfer_suffix) + tmr = (tmr & ~SDMMC_TMR_ACMDEN_Msk) + | SDMMC_TMR_ACMDEN_ACMD12; + /* TODO check if this is fine for SDIO too (byte or block transfer) (cmd->cmdOp.bmBits.ioCmd, cmd->wBlockSize) */ + if (multiple_xfer || cmd->wNbBlocks > 1) + tmr |= SDMMC_TMR_MSBSEL | SDMMC_TMR_BCEN; + if (set->table) + tmr |= SDMMC_TMR_DMAEN; + } + + /* Enable normal interrupts */ + regs->SDMMC_NISTER |= SDMMC_NISTER_BRDRDY | SDMMC_NISTER_BWRRDY + | SDMMC_NISTER_TRFC | SDMMC_NISTER_CMDC; + assert(!(regs->SDMMC_NISTER & SDMMC_NISTR_CUSTOM_EVT)); + /* Enable error interrupts */ + regs->SDMMC_EISTER = eister; + /* Clear all interrupt status flags */ + regs->SDMMC_NISTR = SDMMC_NISTR_ERRINT | SDMMC_NISTR_BOOTAR + | SDMMC_NISTR_CINT | SDMMC_NISTR_CREM | SDMMC_NISTR_CINS + | SDMMC_NISTR_BRDRDY | SDMMC_NISTR_BWRRDY | SDMMC_NISTR_DMAINT + | SDMMC_NISTR_BLKGE | SDMMC_NISTR_TRFC | SDMMC_NISTR_CMDC; + regs->SDMMC_EISTR = SDMMC_EISTR_BOOTAE | SDMMC_EISTR_ADMA + | SDMMC_EISTR_ACMD | SDMMC_EISTR_CURLIM | SDMMC_EISTR_DATEND + | SDMMC_EISTR_DATCRC | SDMMC_EISTR_DATTEO | SDMMC_EISTR_CMDIDX + | SDMMC_EISTR_CMDEND | SDMMC_EISTR_CMDCRC | SDMMC_EISTR_CMDTEO; + + /* Wait for the CMD and DATn lines to be ready */ + mask = SDMMC_PSR_CMDINHC; + if (has_data || (cmd->cmdOp.bmBits.checkBsy && !stop_xfer)) + mask |= SDMMC_PSR_CMDINHD; + while (regs->SDMMC_PSR & mask) ; + + /* Issue the command */ + if (has_data) { + if (blk_count_prefix) + regs->SDMMC_SSAR = SDMMC_SSAR_ARG2(cmd->wNbBlocks); + if (set->table) + regs->SDMMC_ASA0R = + SDMMC_ASA0R_ADMASA((uint32_t)set->table); + regs->SDMMC_BSR = (regs->SDMMC_BSR & ~SDMMC_BSR_BLKSIZE_Msk) + | SDMMC_BSR_BLKSIZE(cmd->wBlockSize); + } + if (stop_xfer) + regs->SDMMC_BCR = SDMMC_BCR_BLKCNT(0); + else if (has_data && (multiple_xfer || cmd->wNbBlocks > 1)) + regs->SDMMC_BCR = SDMMC_BCR_BLKCNT(cmd->wNbBlocks); + regs->SDMMC_ARG1R = cmd->dwArg; + if (has_data || stop_xfer) + regs->SDMMC_TMR = tmr; + regs->SDMMC_MC1R = mc1r; + regs->SDMMC_CR = cr; + + /* In the case of Auto CMD12, we'll need to generate an extra event. + * Have our Timer/Counter ready for this. */ + if (has_data && stop_xfer_suffix) { + /* Considering the multiple block read mode, + * 1. Assuming Transfer Complete is raised upon successful + * reception of the End bit of the last data packet, + * 2. A SD/eMMC protocol analyzer shows that the CMD12 command + * token is fully transmitted 1 or 2 device clock cycles + * later, + * 3. The device may take up to 64 clock cycles (NCR) before + * initiating the CMD12 response token, + * 4. The code length of the CMD12 response token (R1) is 48 + * bits, hence 48 device clock cycles. + * The sum of the above timings is the maximum time CMD12 will + * take to complete. */ + cycles = pmc_get_peripheral_clock(set->tc_id) + / (set->dev_freq / (2ul + 64ul + 48ul)); + /* The Timer operates with RC >= 1 */ + set->timer->TC_RC = cycles ? cycles : 1; + } + + return SDMMC_OK; +} + +static sSdHalFunctions sdHal = { + .fLock = sdmmc_lock, + .fRelease = sdmmc_release, + .fCommand = sdmmc_send_command, + .fIOCtrl = sdmmc_control, +}; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +bool sdmmc_initialize(struct sdmmc_set *set, Sdmmc *regs, uint32_t periph_id, + uint32_t tc_id, uint32_t tc_ch, uint32_t *dma_buf, uint32_t dma_buf_size) +{ + assert(set); + assert(regs); + assert(periph_id <= 0xff); + assert(tc_ch < TCCHANNEL_NUMBER); + + Tc * const tc_module = get_tc_addr_from_id(tc_id); + uint32_t base_freq, power, val; + const uint8_t max_exp = (SDMMC_TCR_DTCVAL_Msk >> SDMMC_TCR_DTCVAL_Pos) - 1; + uint8_t exp; + + assert(tc_module); + memset(set, 0, sizeof(*set)); + set->id = periph_id; + set->regs = regs; + set->tc_id = tc_id; + set->timer = &tc_module->TC_CHANNEL[tc_ch]; + set->table_size = dma_buf ? dma_buf_size / SDMMC_DMADL_SIZE : 0; + set->table = set->table_size ? dma_buf : NULL; + set->use_polling = true; + set->use_set_blk_cnt = false; + set->state = MCID_OFF; + + val = (regs->SDMMC_CA0R & SDMMC_CA0R_MAXBLKL_Msk) >> SDMMC_CA0R_MAXBLKL_Pos; + set->blk_size = val <= 0x2 ? 512 << val : 512; + + /* Prepare our Timer/Counter */ + tc_configure(tc_module, tc_ch, TC_CMR_WAVE | TC_CMR_WAVSEL_UP + | TC_CMR_CPCDIS | TC_CMR_BURST_NONE | TC_CMR_TCCLKS_TIMER_CLOCK2); + set->timer->TC_EMR |= TC_EMR_NODIVCLK; + + /* Perform the initial I/O calibration sequence, manually. + * Allow tSTARTUP = 2 usec for the analog circuitry to start up. + * CNTVAL = fHCLOCK / (4 * (1 / tSTARTUP)) */ + val = pmc_get_peripheral_clock(periph_id); + val = ROUND_INT_DIV(val, 4 * 500000UL); + assert(!(val << SDMMC_CALCR_CNTVAL_Pos & ~SDMMC_CALCR_CNTVAL_Msk)); + regs->SDMMC_CALCR = (regs->SDMMC_CALCR & ~SDMMC_CALCR_CNTVAL_Msk) | SDMMC_CALCR_CNTVAL(val); + regs->SDMMC_CALCR |= SDMMC_CALCR_EN; + while (regs->SDMMC_CALCR & SDMMC_CALCR_EN) ; + val = regs->SDMMC_CALCR; + trace_info("Result of output impedance calibration: CALN=%lu, CALP=%lu.\n\r", + (val & SDMMC_CALCR_CALN_Msk) >> SDMMC_CALCR_CALN_Pos, + (val & SDMMC_CALCR_CALP_Msk) >> SDMMC_CALCR_CALP_Pos); + + /* Set DAT line timeout error to occur after 500 ms waiting delay. + * 500 ms is the timeout value to implement when writing to SDXC cards. + */ + base_freq = (regs->SDMMC_CA0R & SDMMC_CA0R_TEOCLKF_Msk) >> SDMMC_CA0R_TEOCLKF_Pos; + base_freq *= regs->SDMMC_CA0R & SDMMC_CA0R_TEOCLKU ? 1000000UL : 1000UL; + /* 2 ^ (DTCVAL + 13) = TIMEOUT * FTEOCLK = FTEOCLK / 2 */ + val = base_freq / 2; + for (exp = 31, power = 1UL << 31; !(val & power) && power != 0; + exp--, power >>= 1) ; + if (power == 0) { + trace_warning("FTEOCLK is unknown\n\r"); + exp = max_exp; + } + else { + exp = exp + 1 - 13; + exp = exp <= max_exp ? exp : max_exp; + } + regs->SDMMC_TCR = (regs->SDMMC_TCR & ~SDMMC_TCR_DTCVAL_Msk) + | SDMMC_TCR_DTCVAL(exp); + trace_debug("Set DAT line timeout to %lu ms\n\r", (10UL << (exp + 13UL)) + / (base_freq / 100UL)); + + /* Reset the peripheral. This will reset almost all registers. + * It doesn't affect I/O calibration however. */ + sdmmc_reset_peripheral(set); + /* As sdmmc_reset_peripheral deliberately preserves MC1R.FCD, this field + * has yet to be initialized. */ + regs->SDMMC_MC1R &= ~SDMMC_MC1R_FCD; + + return true; +} + +/** + * \brief Initialize the SD/MMC library instance for SD/MMC bus mode (versus + * SPI mode, not supported by this driver). Provide it with the HAL callback + * functions implemented here. + * \param pSd Pointer to SD/MMC library instance data. + * \param pDrv Pointer to driver instance data (struct sdmmc_set). + * \param bSlot Slot number. + */ +void SDD_InitializeSdmmcMode(sSdCard *pSd, void *pDrv, uint8_t bSlot) +{ + SDD_Initialize(pSd, pDrv, bSlot, &sdHal); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.h new file mode 100644 index 000000000..c5aea80c3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sdmmc.h @@ -0,0 +1,109 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SDMMC_PERIPH_H_ +#define _SDMMC_PERIPH_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _SdmmcCommand; + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/* This structure is private to the SDMMC Driver. + * Allocate it but ignore its members. */ +struct sdmmc_set +{ + uint32_t id; /* SDMMC peripheral ID (ID_SDMMCx) */ + Sdmmc *regs; /* set of SDMMC hardware registers */ + uint32_t tc_id; /* Timer/Counter peripheral ID (ID_TCx) */ + TcChannel *timer; /* set of TC channel hardware registers */ + uint32_t *table; /* ADMA descriptor table, or NULL when DMA + * is not used */ + uint32_t table_size; /* Max size of the ADMA descriptor table, + * in lines */ + bool use_polling; /* polling mode */ + bool use_set_blk_cnt; /* implicit SET_BLOCK_COUNT command */ + + uint16_t blk_size; /* max data block size, in bytes */ + uint32_t dev_freq; /* frequency of clock provided to memory + * device, in Hz */ + volatile uint8_t state; + struct _SdmmcCommand *cmd; /* pointer to the command being processed */ + uint16_t blk_index; /* count of data blocks tranferred already, + * in the context of the command and data + * transfer being executed */ + uint8_t resp_len; /* size of the response, once retrieved, + * in the context of the command being + * executed, expressed in 32-bit words */ + bool expect_auto_end; /* waiting for completion of Auto CMD12 */ +}; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Initialize the specified driver instance and the associated SDMMC + * peripheral. + * \param set Pointer to uninitialized driver instance data. + * \param regs Base address of registers of the SDMMC peripheral. + * \param sdmmc_id SDMMC peripheral ID (ID_SDMMCx). + * \param tc_id TC peripheral ID (ID_TCx). + * \note The application shall have enabled the clock assigned to this + * Timer/Counter peripheral. + * \param tc_ch TC channel number, within the Timer/Counter module designated + * by tc_id. Every instance of the SDMMC Driver requires a Timer/Counter channel + * for its exclusive usage. + * \param dma_buf Buffer allocated by the application, required when DMA is + * used. This is where the DMA descriptor table will be set up. The larger + * the buffer is, the greater throughput we achieve. Up to 4 KiB. Shall be + * word-aligned. NULL to have the CPU read/write data, word by word. + * \param dma_buf_size Size of the dma_buf buffer, in words. + * \return true if successful, false if a parameter is assigned an unsupported + * value. + */ +bool sdmmc_initialize(struct sdmmc_set *set, Sdmmc *regs, uint32_t sdmmc_id, + uint32_t tc_id, uint32_t tc_ch, uint32_t *dma_buf, uint32_t dma_buf_size); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifndef _SDMMC_PERIPH_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.c new file mode 100644 index 000000000..b8861a067 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.c @@ -0,0 +1,56 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "peripherals/sfrbu.h" + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void sfrbu_enable_ddr_backup(void) +{ + /* Enable DDR backup mode. Isolate the DDR Pads from the CPU domain, + VCCCORE */ + SFRBU->SFRBU_DDRBUMCR = SFRBU_DDRBUMCR_BUMEN; +} + +void sfrbu_disable_ddr_backup(void) +{ + /* Connect the DDR Pads to the CPU domain, VCCCORE */ + SFRBU->SFRBU_DDRBUMCR &= ~SFRBU_DDRBUMCR_BUMEN; +} + +bool sfrbu_is_ddr_backup_enabled(void) +{ + return (SFRBU->SFRBU_DDRBUMCR & SFRBU_DDRBUMCR_BUMEN) != 0; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.h new file mode 100644 index 000000000..99f1e0e27 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sfrbu.h @@ -0,0 +1,62 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SFRBU_H +#define _SFRBU_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include +#include + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Enable DDR backup + */ +extern void sfrbu_enable_ddr_backup(void); + +/** + * \brief Disable DDR backup + */ +extern void sfrbu_disable_ddr_backup(void); + +/** + * \brief Get DDR backup status + * \return true if DDR BU Mode is enabled, false otherwise + */ +extern bool sfrbu_is_ddr_backup_enabled(void); + +#endif //#ifndef _SFRBU_H diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.c new file mode 100644 index 000000000..b12bbf7a3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.c @@ -0,0 +1,135 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup sha_module Working with SHA + * \ingroup peripherals_module + * The SHA driver provides the interface to configure and use the SHA + * peripheral. + * \n + * + * The Secure Hash Algorithm (SHA) module requires a padded message + * according to FIPS180-2 specification. The first block of the + * message must be indicated to the module by a specific command. The + * SHA module produces a N-bit message digest each time a block is + * written and processing period ends. N is 160 for SHA1, 224 for + * SHA224, 256 for SHA256, 384 for SHA384, 512 for SHA512. + * + * To Enable a SHA encryption and decrypt,the user has to follow these + * few steps: + *
    + *
  • Configure SHA algorithm mode, key mode, start mode and + * operation mode by sha_configure().
  • + *
  • Set sha_first_block() to indicates that the next block to + * process is the first one of a message.
  • + *
  • Input data for encryption by sha_set_input().
  • + *
  • To start the encryption process with sha_start()
  • + *
  • To get the encryption reslut by sha_get_output()
  • + *
+ * + * For more accurate information, please look at the SHA section of the + * Datasheet. + * + * Related files :\n + * \ref sha.c\n + * \ref sha.h\n + */ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of Secure Hash Algorithm (SHA) + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/sha.h" + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void sha_start(void) +{ + SHA->SHA_CR = SHA_CR_START; +} + +void sha_soft_reset(void) +{ + SHA->SHA_CR = SHA_CR_SWRST; +} + +void sha_first_block(void) +{ + SHA->SHA_CR = SHA_CR_FIRST; +} + +void sha_configure(uint32_t mode) +{ + SHA->SHA_MR = mode; +} + +void sha_enable_it(uint32_t sources) +{ + SHA->SHA_IER = sources; +} + +void sha_disable_it(uint32_t sources) +{ + SHA->SHA_IDR = sources; +} + +uint32_t sha_get_status(void) +{ + return SHA->SHA_ISR; +} + +void sha_set_input(uint32_t * data, uint8_t len) +{ + uint8_t i; + uint8_t num; + num = len <= 16 ? len : 16; + for (i = 0; i < num; i++) + SHA->SHA_IDATAR[i] = (data[i]); + num = len > 16 ? len - 16 : 0; + for (i = 0; i < num; i++) + SHA->SHA_IODATAR[i] = (data[i + 16]); +} + +void sha_get_output(uint32_t * data) +{ + uint8_t i; + for (i = 0; i < 16; i++) + data[i] = SHA->SHA_IODATAR[i]; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h new file mode 100644 index 000000000..184689aec --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/sha.h @@ -0,0 +1,98 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SHA_ +#define _SHA_ + +/*------------------------------------------------------------------------------ + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +/*----------------------------------------------------------------------------*/ +/* Exported functions */ +/*----------------------------------------------------------------------------*/ + +/** + * \brief Starts Manual hash algorithm process. + */ +extern void sha_start(void); + +/** + * \brief Resets the SHA. A software triggered hardware reset of the + * SHA interface is performed. + */ +extern void sha_soft_reset(void); + +/** + * \brief Indicates that the next block to process is the first one of + * a message. + */ +extern void sha_first_block(void); + +/** + * \brief Configures an SHA peripheral with the specified parameters. + * \param mode Desired value for the SHA mode register (see the datasheet). + */ +extern void sha_configure(uint32_t mode); + +/** + * \brief Enables the selected interrupts sources on a SHA peripheral. + * \param sources Bitwise OR of selected interrupt sources. + */ +extern void sha_enable_it(uint32_t sources); + +/** + * \brief Disables the selected interrupts sources on a SHA peripheral. + * \param sources Bitwise OR of selected interrupt sources. + */ +extern void sha_disable_it(uint32_t sources); + +/** + * \brief Get the current status register of the given SHA peripheral. + * \return SHA status register. + */ +extern uint32_t sha_get_status(void); + +/** + * \brief Set the 32-bit Input Data registers allow to load the data block used for hash processing. + * \param data Pointer data block. + * \param len 512/1024-bits block size + */ +extern void sha_set_input(uint32_t * data, uint8_t len); + +/** + * \brief Getread the resulting message digest and to write the second part of the message block when the +* SHA algorithm is SHA-384 or SHA-512. + * \param data pointer to the word that has been encrypted/decrypted.. + */ +extern void sha_get_output(uint32_t * data); + +#endif /* #ifndef _SHA_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.c new file mode 100644 index 000000000..dff948c93 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.c @@ -0,0 +1,100 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/shdwc.h" +#include + +/*---------------------------------------------------------------------------- + * Local Defines + *----------------------------------------------------------------------------*/ + +struct _bitfield_shdwc_cfgr { + uint32_t + lpdbcen0: 1, + lpdbcen1: 1, + rfu2_7: 6, + lpdbc: 3, + rfu10_15: 5, + rttwken: 1, + rtcwken: 1, + accwken: 1, + rxlpwken: 1, + rfu20_23: 4, + wkupdbc: 3, + rfu26_31: 5; +}; + +union _shdwc_cfg { + struct _bitfield_shdwc_cfgr bfield; + uint32_t uint32_value; +}; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void shdwc_configure_wakeup_mode(uint32_t config) +{ + union _shdwc_cfg cfg; + + cfg.uint32_value = SHDWC->SHDW_MR; + + cfg.bfield.lpdbcen0 = (config & SHDW_MR_LPDBCEN0_ENABLE) ? 1 : 0; + cfg.bfield.lpdbcen1 = (config & SHDW_MR_LPDBCEN1_ENABLE) ? 1 : 0; + cfg.bfield.lpdbc = (config & SHDW_MR_LPDBC_Msk) >> SHDW_MR_LPDBC_Pos; + cfg.bfield.rttwken = (config & SHDW_MR_RTTWKEN) ? 1 : 0; + cfg.bfield.rtcwken = (config & SHDW_MR_RTCWKEN) ? 1 : 0; + cfg.bfield.accwken = (config & SHDW_MR_ACCWKEN) ? 1 : 0; + cfg.bfield.rxlpwken = (config & SHDW_MR_RXLPWKEN) ? 1 : 0; + cfg.bfield.wkupdbc = (config & SHDW_MR_WKUPDBC_Msk) >> SHDW_MR_WKUPDBC_Pos; + + SHDWC->SHDW_MR = cfg.uint32_value; +} + +void shdwc_set_wakeup_input(uint32_t input_enable, uint32_t input_type) +{ + uint32_t wuir = (input_enable & 0x0000FFFF) | (input_type & 0xFFFF0000); + + SHDWC->SHDW_WUIR |= wuir; +} + +void shdwc_do_shutdown(void) +{ + SHDWC->SHDW_CR = SHDW_CR_KEY_PASSWD | SHDW_CR_SHDW; +} + +uint32_t shdwc_get_status(void) +{ + return SHDWC->SHDW_SR; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.h new file mode 100644 index 000000000..e393d967f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/shdwc.h @@ -0,0 +1,72 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SHDWC_H +#define _SHDWC_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Configure the Shutdown Mode Register + */ +extern void shdwc_configure_wakeup_mode(uint32_t config); + +/** + * \brief Configure the Shutdown Wake-up Input Register + * + * \param input_enable, WKUPEN0-WKUPEN15: define the corresponding + * wake-up input. + * \param input_type, WKUPT0-WKUPT15: define falling or rising edge + * on wake-up input. + */ +extern void shdwc_set_wakeup_input(uint32_t input_enable, + uint32_t input_type); + +/** + * \brief Launch the ShutDown + */ +extern void shdwc_do_shutdown(void); + +/** + * \brief Get Status + * \return Contents of the Shutdown Status Register + */ +extern uint32_t shdwc_get_status(void); + +#endif //#ifndef _SHDWC_H diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.c new file mode 100644 index 000000000..4e63b38c8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.c @@ -0,0 +1,451 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup spi_module Working with SPI + * \section Purpose + * The SPI driver provides the interface to configure and use the SPI + * peripheral. + * + * The Serial Peripheral Interface (SPI) circuit is a synchronous serial + * data link that provides communication with external devices in Master + * or Slave Mode. + * + * \section Usage + * To use the SPI, the user has to follow these few steps: + * -# Enable the SPI pins required by the application (see pio.h). + * -# Configure the SPI using the \ref spi_configure(). This enables the + * peripheral clock. The mode register is loaded with the given value. + * -# Configure all the necessary chip selects with \ref spi_configure_npcs(). + * -# Enable the SPI by calling \ref spi_enable(). + * -# Send/receive data using \ref spi_write() and \ref + * spi_read(). Note that \ref spi_read() + * must be called after \ref spi_write() to retrieve the last value read. + * -# Disable the SPI by calling \ref spi_disable(). + * + * For more accurate information, please look at the SPI section of the + * Datasheet. + * + * Related files :\n + * \ref spi.c\n + * \ref spi.h\n +*/ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of Serial Peripheral Interface (SPI) controller. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "peripherals/spi.h" +#include "peripherals/pmc.h" + +#include "io.h" +#include "trace.h" + +#include + +#include + +/*--------------------------------------------------------------------------- +* Macros +*----------------------------------------------------------------------------*/ + +#define SPI_PCS(npcs) SPI_MR_PCS((~(1 << npcs) & 0xF)) + +/*---------------------------------------------------------------------------- + * local functions + *----------------------------------------------------------------------------*/ + +static inline uint32_t _spi_compute_scbr(uint32_t bitrate, uint32_t periph_id) +{ + assert(bitrate>0); + return SPI_CSR_SCBR( + pmc_get_peripheral_clock(periph_id) / (bitrate*1000)); +} + +static inline uint32_t _spi_compute_dlybs(uint32_t delay, uint32_t periph_id) +{ + uint32_t dlybs = + ((pmc_get_peripheral_clock(periph_id)/1000000u) * delay) / 100; + return SPI_CSR_DLYBS(dlybs); +} + +static inline uint32_t _spi_compute_dlybct(uint32_t delay, uint32_t periph_id) +{ + uint32_t dlybct = + ((pmc_get_peripheral_clock(periph_id)/31250u) * delay) / 100; + return SPI_CSR_DLYBCT(dlybct); +} + +static inline uint32_t _spi_is_master(Spi* spi) +{ + return (spi->SPI_MR & SPI_MR_MSTR); +} + +static inline uint32_t _spi_is_variable_ps(Spi* spi) +{ + return (spi->SPI_MR & SPI_MR_PS); +} + +static void _spi_write_dummy(Spi* spi) +{ + if (_spi_is_master(spi)) { + writehw(&spi->SPI_TDR, 0xFF); + } +} + +static void _spi_consume_read(Spi* spi, uint32_t cs) +{ + if (_spi_is_master(spi)) { + while(!(spi->SPI_SR & SPI_SR_RDRF)); + uint16_t value; + if ((spi->SPI_CSR[cs] & SPI_CSR_BITS_Msk) < SPI_CSR_BITS_9_BIT) { + readb(&spi->SPI_RDR, (uint8_t*)&value); + } else { + readhw(&spi->SPI_RDR, &value); + } + (void)value; + } +} + +#ifdef CONFIG_HAVE_SPI_FIFO + +static void _spi_fifo_clear(Spi* spi, uint32_t fifos) +{ + trace_debug("Spi: Clearing FIFOs\r\n"); + while (!(spi->SPI_SR & SPI_SR_TXFEF)); + spi->SPI_CR = fifos & (SPI_CR_RXFCLR | SPI_CR_TXFCLR); +} + +static inline void _clear_fifo_control_flags(uint32_t* control_reg) +{ + *control_reg |= SPI_CR_TXFCLR | SPI_CR_RXFCLR | SPI_CR_FIFODIS; +} +#else +#define _clear_fifo_control_flags(dummy) do {} while(0) +#endif + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void spi_enable(Spi * spi) +{ + spi->SPI_CR = SPI_CR_SPIEN; +} + +void spi_disable(Spi * spi) +{ + spi->SPI_CR = SPI_CR_SPIDIS; +} + +void spi_enable_it(Spi * spi, uint32_t dwSources) +{ + spi->SPI_IER = dwSources; +} + +void spi_disable_it(Spi * spi, uint32_t dwSources) +{ + spi->SPI_IDR = dwSources; +} + +void spi_configure(Spi * spi, uint32_t configuration) +{ + /* Execute a software reset of the SPI twice */ + spi->SPI_CR = SPI_CR_SWRST; + spi->SPI_CR = SPI_CR_SWRST; + + uint32_t control_reg = SPI_CR_SPIDIS; + /* Add clear FIFO flags if present */ + _clear_fifo_control_flags(&control_reg); + /* Apply */ + spi->SPI_CR = control_reg; + + spi->SPI_MR = configuration; +} + +void spi_chip_select(Spi * spi, uint8_t cS) +{ + spi->SPI_MR &= ~SPI_MR_PCS_Msk; + spi->SPI_MR |= SPI_PCS(cS); +} + +void spi_set_mode(Spi * spi, uint32_t dwConfiguration) +{ + spi->SPI_MR = dwConfiguration; +} + +void spi_release_cs(Spi * spi) +{ + spi->SPI_CR = SPI_CR_LASTXFER; +} + +void spi_configure_cs(Spi * spi, uint32_t cs, uint32_t bitrate, + uint32_t delay_dlybs, uint32_t delay_dlybct, + uint32_t spi_mode, uint32_t release_on_last) +{ + trace_debug("Spi: configuring chip select %u\r\n", (unsigned int)cs); + uint32_t id = get_spi_id_from_addr(spi); + assert(id < ID_PERIPH_COUNT); + + bitrate = _spi_compute_scbr(bitrate, id); + delay_dlybs = _spi_compute_dlybs(delay_dlybs, id); + delay_dlybct = _spi_compute_dlybct(delay_dlybct, id); + release_on_last = release_on_last ? SPI_CSR_CSAAT : 0; + + spi->SPI_CSR[cs] = bitrate | delay_dlybs | delay_dlybct + | release_on_last | spi_mode; +} + +void spi_configure_cs_mode(Spi * spi, uint32_t cs, uint32_t release_on_last) +{ + if (!release_on_last) { + spi->SPI_CSR[cs] |= SPI_CSR_CSAAT; + } else { + spi->SPI_CSR[cs] &= ~SPI_CSR_CSAAT; + } +} + +uint32_t spi_get_status(Spi * spi) +{ + return spi->SPI_SR; +} + +uint16_t spi_read(Spi * spi, uint8_t cs) +{ + _spi_write_dummy(spi); + while ((spi->SPI_SR & SPI_SR_RDRF) == 0) ; + uint16_t value; + if ((spi->SPI_CSR[cs] & SPI_CSR_BITS_Msk) < SPI_CSR_BITS_9_BIT) { + readb(&spi->SPI_RDR, (uint8_t*)&value); + } else { + readhw(&spi->SPI_RDR, &value); + } + return value; +} + +/** + * \details If the SPI is configured to use a fixed peripheral select, + * the npcs value is meaningless. Otherwise, it identifies the + * component which shall be addressed. + */ +void spi_write(Spi * spi, uint32_t cs, uint16_t data) +{ + /* Send data */ + while ((spi->SPI_SR & SPI_SR_TXEMPTY) == 0); + if (_spi_is_variable_ps(spi)) { + spi->SPI_TDR = data | SPI_PCS(cs); + } else { + writehw(&spi->SPI_TDR, data); + } + /* Consume write */ + _spi_consume_read(spi, cs); +} + +/** + * \brief Sends last data through a SPI peripheral. + * + * \details If the SPI is configured to use a fixed peripheral select, + * the npcs value is meaningless. Otherwise, it identifies the + * component which shall be addressed. + * + * \param spi Pointer to an Spi instance. + * \param dwNpcs Chip select of the component to address (0, 1, 2 or 3). + * \param wData Word of data to send. + */ +void spi_write_last(Spi * spi, uint32_t cs, uint16_t data) +{ + /* Send data */ + while ((spi->SPI_SR & SPI_SR_TXEMPTY) == 0) ; + spi->SPI_TDR = data | SPI_PCS(cs) | SPI_TDR_LASTXFER; + /* Consume write to not corrupt FIFO if present (dummy + * function if CONFIG_HAV_SPI_FIFO not defined) */ + _spi_consume_read(spi, cs); +} + +uint32_t spi_is_finished(Spi * spi) +{ + return ((spi->SPI_SR & SPI_SR_TXEMPTY) != 0); +} + +#ifdef CONFIG_HAVE_SPI_FIFO + +static void _spi_fifo_set_rx_threshold(Spi* spi, uint8_t rx_thres) +{ + spi->SPI_FMR &= ~SPI_FMR_RXFTHRES_Msk; + spi->SPI_FMR |= SPI_FMR_RXFTHRES(rx_thres); +} + +static uint32_t _spi_write_stream(Spi *spi, uint32_t chip_select, + const void *stream, uint32_t len) +{ + const uint8_t* buffer = stream; + uint32_t left = len; + + uint8_t is_ps = _spi_is_variable_ps(spi); + uint32_t max_size = is_ps ? sizeof(uint8_t) : sizeof(uint16_t); + int32_t fifo_size = get_peripheral_fifo_depth(spi); + if (fifo_size < 0) + return 0; + + while (left > 0) { + if ((spi->SPI_SR & SPI_SR_TDRE) == 0) continue; + + /* Get FIFO free size (int octet) and clamp it */ + uint32_t buf_size = fifo_size - spi_fifo_tx_size(spi); + buf_size = (buf_size > left) ? left : buf_size; + + /* Fill the FIFO as must as possible */ + while (buf_size >= max_size) { + if (is_ps) { + spi->SPI_TDR = *(uint8_t*)buffer | + SPI_PCS(chip_select); + } else { + spi->SPI_TDR = *buffer | + (*(buffer+1) << 16); + } + buffer += max_size; + left -= max_size; + buf_size -= max_size; + } + if (buf_size >= sizeof(uint8_t)) { + writehw(&spi->SPI_TDR, *(uint8_t*)buffer); + buffer += sizeof(uint8_t); + left -= sizeof(uint8_t); + } + } + trace_debug("Spi (fifo): %u data writen\r\n", + (unsigned int)(len-left)); + return len - left; +} + +void spi_fifo_configure(Spi* spi, uint8_t tx_thres, + uint8_t rx_thres, + uint32_t ready_modes) +{ + /* Disable SPI and activate FIFO */ + spi->SPI_CR = SPI_CR_SPIDIS | SPI_CR_FIFOEN; + + /* Configure FIFO */ + spi->SPI_FMR = SPI_FMR_TXFTHRES(tx_thres) | SPI_FMR_RXFTHRES(rx_thres) + | ready_modes; + + /* Reenable SPI */ + spi->SPI_CR = SPI_CR_SPIEN; +} + +void spi_fifo_disable(Spi* spi) +{ + uint32_t reg = 0; + _clear_fifo_control_flags(®); + spi->SPI_CR = reg; +} + +uint32_t spi_fifo_rx_size(Spi *spi) +{ + return (spi->SPI_FLR & SPI_FLR_RXFL_Msk) >> SPI_FLR_RXFL_Pos; +} + +uint32_t spi_fifo_tx_size(Spi *spi) +{ + return (spi->SPI_FLR & SPI_FLR_TXFL_Msk) >> SPI_FLR_TXFL_Pos; +} + +uint32_t spi_read_stream(Spi *spi, uint32_t chip_select, + void *stream, uint32_t len) +{ + uint8_t* buffer = stream; + uint32_t left = len; + + uint8_t is_master = _spi_is_master(spi); + uint32_t max_size = is_master ? sizeof(uint8_t) : sizeof(uint32_t); + + while (left > 0) { + uint32_t lenwrite = (left > SPI_FIFO_DEPTH) ? + SPI_FIFO_DEPTH : left; + + _spi_fifo_set_rx_threshold(spi, lenwrite); + _spi_write_stream(spi, chip_select, + stream, lenwrite); + + while (!(spi->SPI_SR & SPI_SR_RXFTHF)); + + /* Get FIFO size (in octets) and clamp it */ + uint32_t buf_size = spi_fifo_rx_size(spi); + buf_size = buf_size > left ? left : buf_size; + + /* Fill the buffer as must as possible with four data reads */ + while (buf_size >= max_size) { + if (is_master) { + readb(&spi->SPI_RDR, (uint8_t*)buffer); + } else { + *(uint32_t*)buffer = spi->SPI_RDR; + } + buffer += max_size; + left -= max_size; + buf_size -= max_size; + } + /* Add tail data if stream is not 4 octet aligned */ + if (buf_size >= sizeof(uint16_t)) { + /* two data read */ + readhw(&spi->SPI_RDR, (uint16_t*)buffer); + left -= sizeof(uint16_t); + buffer += sizeof(uint16_t); + buf_size -= sizeof(uint16_t); + } + if (buf_size >= sizeof(uint8_t)) { + /* two data read */ + readb(&spi->SPI_RDR, (uint8_t*)buffer); + left -= sizeof(uint8_t); + buffer += sizeof(uint8_t); + } + } + trace_debug("Spi (fifo): %u data read\r\n", + (unsigned int)(len-left)); + return len - left; +} + +uint32_t spi_write_stream(Spi *spi, uint32_t chip_select, + const void *stream, uint32_t len) +{ + uint32_t consumed = _spi_write_stream(spi, chip_select, stream, len); + _spi_fifo_clear(spi, SPI_CR_RXFCLR); + return consumed; +} + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.h new file mode 100644 index 000000000..71fd93619 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spi.h @@ -0,0 +1,214 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for Serial Peripheral Interface (SPI) controller. + * + */ + +#ifndef _SPI_ +#define _SPI_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +/*---------------------------------------------------------------------------- + * Macros + *----------------------------------------------------------------------------*/ + +#define SPI_KEEP_CS_OW (0) +#define SPI_RELEASE_CS_OW (1) + +/*------------------------------------------------------------------------------ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Enables a SPI peripheral. + * + * \param spi Pointer to an Spi instance. + */ +extern void spi_enable(Spi * spi); + +/** + * \brief Disables a SPI peripheral. + * + * \param spi Pointer to an Spi instance. + */ +extern void spi_disable(Spi * spi); + +/** + * \brief Enables one or more interrupt sources of a SPI peripheral. + * + * \param spi Pointer to an Spi instance. + * \param dwSources Bitwise OR of selected interrupt sources. + */ +extern void spi_enable_it(Spi * spi, uint32_t dwSources); + +/** + * \brief Disables one or more interrupt sources of a SPI peripheral. + * + * \param spi Pointer to an Spi instance. + * \param dwSources Bitwise OR of selected interrupt sources. + */ +extern void spi_disable_it(Spi * spi, uint32_t dwSources); + +/** + * \brief Configures a SPI peripheral as specified. The configuration + * can be computed + * using several macros (see \ref spi_configuration_macros). + * + * \param spi Pointer to an Spi instance. + * \param dwConfiguration Value of the SPI configuration register. + */ +extern void spi_configure(Spi * spi, uint32_t configuration); + +/** + * \brief Configures SPI Mode Register. + * + * \param spi Pointer to an Spi instance. + * \param dwConfiguration Value of the SPI mode register. + */ +extern void spi_set_mode(Spi * spi, uint32_t dwConfiguration); + +/** + * \brief Configures SPI chip select. + * + * \param spi Pointer to an Spi instance. + * \param cS Chip select of NPSCx. + */ +extern void spi_chip_select(Spi * spi, uint8_t cS); + +/** + * \brief Configures SPI to release last used CS line. + * + * \param spi Pointer to an Spi instance. + */ +extern void spi_release_cs(Spi * spi); + +/** + * \brief Configures a chip select of a SPI peripheral. + * + * \param spi Pointer to an Spi instance. + * \param cs Chip select to configure (0, 1, 2 or 3). + * \param bitrate + * \param delay_dlybs + * \param delay_dlybct + * \param spi_mode + * \param release_on_last + */ +extern void spi_configure_cs(Spi * spi, uint32_t cs,uint32_t bitrate, + uint32_t delay_dlybs, uint32_t delay_dlybct, + uint32_t spi_mode, uint32_t release_on_last); + +/** + * \brief Configures a chip select active mode of a SPI peripheral. + * + * \param spi Pointer to an Spi instance. + * \param cs Chip select to configure (0, 1, 2 or 3). + * \param release_on_last CS controlled by last transfer. + * spi_release_cs() is used to deactive CS. + */ +extern void spi_configure_cs_mode(Spi * spi, uint32_t cs, + uint32_t release_on_last); + +/** + * \brief Reads one data from SPI peripheral with a dummy write. + * + * \param spi Pointer to an Spi instance. + * + * \return readed data. + */ + +extern uint16_t spi_read(Spi * spi, uint8_t cs); + +/** + * \brief Sends data through a SPI peripheral consuming reads. + * + * + * \param spi Pointer to an Spi instance. + * \param cs Chip select of the component to address (0, 1, 2 or 3). + * \param data Word of data to send. + */ +extern void spi_write(Spi * spi, uint32_t cs, uint16_t data); +extern void spi_write_last(Spi * spi, uint32_t cs, uint16_t data); + +/** + * \brief Get the current status register of the given SPI peripheral. + * + * \note This resets the internal value of the status register, so further + * read may yield different values. + * + * \param spi Pointer to a Spi instance. + * \return SPI status register. + */ +extern uint32_t spi_get_status(Spi * spi); + + +/** + * \brief Check if SPI transfer finish. + * + * \param spi Pointer to an Spi instance. + * + * \return Returns 1 if there is no pending write operation on the SPI; + * otherwise returns 0. + */ + +extern uint32_t spi_is_finished(Spi * spi); + +#ifdef CONFIG_HAVE_SPI_FIFO +extern void spi_fifo_configure(Spi* spi, uint8_t tx_thres, + uint8_t rx_thres, + uint32_t ready_modes); +extern void spi_fifo_disable(Spi* spi); + +extern uint32_t spi_fifo_rx_size(Spi *spi); +extern uint32_t spi_fifo_tx_size(Spi *spi); + +extern uint32_t spi_read_stream(Spi *spi, uint32_t chip_select, + void *stream, uint32_t len); +extern uint32_t spi_write_stream(Spi *spi, uint32_t chip_select, + const void *stream, uint32_t len); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _SPI_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.c new file mode 100644 index 000000000..123305305 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.c @@ -0,0 +1,368 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + + +#include "peripherals/aic.h" +#ifdef CONFIG_HAVE_FLEXCOM +#include "peripherals/flexcom.h" +#endif +#include "peripherals/pmc.h" +#include "peripherals/spid.h" +#include "peripherals/spi.h" +#include "peripherals/xdmac.h" +#include "peripherals/xdmad.h" +#include "peripherals/l2cc.h" + +#include "cortex-a/cp15.h" + +#include "trace.h" + +#include +#include +#include +#include + +#define SPID_ATTRIBUTE_MASK (SPI_MR_PS | SPI_MR_MODFDIS | SPI_MR_MSTR | SPI_MR_WDRBT) +#define SPID_DMA_THRESHOLD 16 + +static uint32_t _garbage = 0; + +static void _spid_xdmad_callback_wrapper(struct _xdmad_channel *channel, + void *arg) +{ + trace_debug("SPID DMA Transfert Finished\r\n"); + struct _spi_desc* spid = (struct _spi_desc*) arg; + + xdmad_free_channel(channel); + + if (spid->region_start && spid->region_end) { + l2cc_invalidate_region(spid->region_start, spid->region_end); + } + + if (spid && spid->callback) + spid->callback(spid, spid->cb_args); +} + +static void _spid_xdmad_cleanup_callback(struct _xdmad_channel *channel, + void *arg) +{ + xdmad_free_channel(channel); +} + +#ifdef CONFIG_HAVE_SPI_FIFO +static void spid_fifo_error(void) +{ + trace_error("Fifo pointer error encountered !!\r\n"); +} +#endif + +void spid_configure(struct _spi_desc* desc) +{ + uint32_t id = get_spi_id_from_addr(desc->addr); + +#ifdef CONFIG_HAVE_FLEXCOM + Flexcom* flexcom = get_flexcom_addr_from_id(id); + if (flexcom) { + flexcom_select(flexcom, FLEX_MR_OPMODE_SPI); + } +#endif + /* Enable SPI early otherwise FIFO configuration won't be applied */ + pmc_enable_peripheral(id); + if (desc->transfert_mode == SPID_MODE_FIFO) { + desc->attributes &= ~SPI_MR_WDRBT; + } + spi_configure(desc->addr, (desc->attributes & SPID_ATTRIBUTE_MASK) | SPI_MR_MSTR); + spi_chip_select(desc->addr, desc->chip_select); + spi_configure_cs(desc->addr, desc->chip_select, desc->bitrate, + desc->dlybs, desc->dlybct, desc->spi_mode, 0); +#ifdef CONFIG_HAVE_SPI_FIFO + if (desc->transfert_mode == SPID_MODE_FIFO) { + spi_fifo_configure(desc->addr, SPI_FIFO_DEPTH, SPI_FIFO_DEPTH, + SPI_FMR_TXRDYM_ONE_DATA | SPI_FMR_RXRDYM_ONE_DATA); + spi_enable_it(desc->addr, SPI_IER_TXFPTEF | SPI_IER_RXFPTEF); + aic_set_source_vector(id, spid_fifo_error); + aic_enable(id); + } +#endif + (void)spi_get_status(desc->addr); + + spi_enable(desc->addr); +} + +void spid_begin_transfert(struct _spi_desc* desc) +{ + spi_chip_select(desc->addr, desc->chip_select); + spi_configure_cs_mode(desc->addr, desc->chip_select, SPI_KEEP_CS_OW); +} + +static void _spid_init_dma_write_channel(const struct _spi_desc* desc, + struct _xdmad_channel** channel, + struct _xdmad_cfg* cfg) +{ + assert(cfg); + assert(channel); + + uint32_t id = get_spi_id_from_addr(desc->addr); + + memset(cfg, 0x0, sizeof(*cfg)); + + *channel = + xdmad_allocate_channel(XDMAD_PERIPH_MEMORY, id); + assert(*channel); + + xdmad_prepare_channel(*channel); + cfg->cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_DSYNC_MEM2PER + | XDMAC_CC_MEMSET_NORMAL_MODE + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_DIF_AHB_IF1 + | XDMAC_CC_SIF_AHB_IF0 + | XDMAC_CC_DAM_FIXED_AM; + + cfg->dest_addr = (void*)&desc->addr->SPI_TDR; +} + +static void _spid_init_dma_read_channel(const struct _spi_desc* desc, + struct _xdmad_channel** channel, + struct _xdmad_cfg* cfg) +{ + assert(cfg); + assert(channel); + + uint32_t id = get_spi_id_from_addr(desc->addr); + + memset(cfg, 0x0, sizeof(*cfg)); + + *channel = + xdmad_allocate_channel(id, XDMAD_PERIPH_MEMORY); + assert(*channel); + + xdmad_prepare_channel(*channel); + cfg->cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_DSYNC_PER2MEM + | XDMAC_CC_MEMSET_NORMAL_MODE + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_DIF_AHB_IF0 + | XDMAC_CC_SIF_AHB_IF1 + | XDMAC_CC_SAM_FIXED_AM; + + cfg->src_addr = (void*)&desc->addr->SPI_RDR; +} + +static void _spid_dma_write(const struct _spi_desc* desc, + const struct _buffer* buffer) +{ + struct _xdmad_channel* w_channel = NULL; + struct _xdmad_channel* r_channel = NULL; + struct _xdmad_cfg w_cfg; + struct _xdmad_cfg r_cfg; + + _spid_init_dma_write_channel(desc, &w_channel, &w_cfg); + _spid_init_dma_read_channel(desc, &r_channel, &r_cfg); + + w_cfg.cfg.bitfield.sam = XDMAC_CC_SAM_INCREMENTED_AM + >> XDMAC_CC_SAM_Pos; + w_cfg.src_addr = buffer->data; + w_cfg.ublock_size = buffer->size; + xdmad_configure_transfer(w_channel, &w_cfg, 0, 0); + xdmad_set_callback(w_channel, _spid_xdmad_cleanup_callback, + NULL); + + r_cfg.cfg.bitfield.dam = XDMAC_CC_DAM_FIXED_AM + >> XDMAC_CC_DAM_Pos; + r_cfg.dest_addr = &_garbage; + r_cfg.ublock_size = buffer->size; + xdmad_configure_transfer(r_channel, &r_cfg, 0, 0); + xdmad_set_callback(r_channel, _spid_xdmad_callback_wrapper, + (void*)desc); + + l2cc_clean_region(desc->region_start, desc->region_end); + + xdmad_start_transfer(w_channel); + xdmad_start_transfer(r_channel); +} + +static void _spid_dma_read(const struct _spi_desc* desc, + struct _buffer* buffer) +{ + struct _xdmad_channel* w_channel = NULL; + struct _xdmad_channel* r_channel = NULL; + struct _xdmad_cfg w_cfg; + struct _xdmad_cfg r_cfg; + + _spid_init_dma_write_channel(desc, &w_channel, &w_cfg); + _spid_init_dma_read_channel(desc, &r_channel, &r_cfg); + + w_cfg.cfg.bitfield.sam = XDMAC_CC_SAM_FIXED_AM + >> XDMAC_CC_SAM_Pos; + w_cfg.src_addr = buffer->data; + w_cfg.ublock_size = buffer->size; + w_cfg.block_size = 0; + xdmad_configure_transfer(w_channel, &w_cfg, 0, 0); + xdmad_set_callback(w_channel, _spid_xdmad_cleanup_callback, NULL); + + r_cfg.cfg.bitfield.dam = XDMAC_CC_DAM_INCREMENTED_AM + >> XDMAC_CC_DAM_Pos; + r_cfg.dest_addr = buffer->data; + r_cfg.ublock_size = buffer->size; + xdmad_configure_transfer(r_channel, &r_cfg, 0, 0); + xdmad_set_callback(r_channel, _spid_xdmad_callback_wrapper, + (void*)desc); + + l2cc_clean_region(desc->region_start, desc->region_end); + + xdmad_start_transfer(w_channel); + xdmad_start_transfer(r_channel); +} + +uint32_t spid_transfert(struct _spi_desc* desc, struct _buffer* rx, + struct _buffer* tx, spid_callback_t cb, + void* user_args) +{ + Spi* spi = desc->addr; + uint32_t i = 0; + + desc->callback = cb; + desc->cb_args = user_args; + + if (mutex_try_lock(&desc->mutex)) { + return SPID_ERROR_LOCK; + } + + switch (desc->transfert_mode) { + case SPID_MODE_POLLING: + if (tx) { + for (i = 0; i < tx->size; ++i) { + spi_write(spi, desc->chip_select, tx->data[i]); + } + } + if (rx) { + for (i = 0; i < rx->size; ++i) { + rx->data[i] = spi_read(spi, desc->chip_select); + } + } + mutex_free(&desc->mutex); + if (cb) + cb(desc, user_args); + break; + case SPID_MODE_DMA: + if (tx) { + if (tx->size < SPID_DMA_THRESHOLD) { + for (i = 0; i < tx->size; ++i) { + spi_write(spi, desc->chip_select, tx->data[i]); + } + if (!rx) { + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + } + } else { + desc->region_start = (uint32_t)tx->data; + desc->region_end = desc->region_start + + tx->size; + _spid_dma_write(desc, tx); + if (rx) { + spid_wait_transfert(desc); + mutex_lock(&desc->mutex); + } + } + } + if (rx) { + if (rx->size < SPID_DMA_THRESHOLD) { + for (i = 0; i < rx->size; ++i) { + rx->data[i] = spi_read(spi, desc->chip_select); + } + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + } else { + desc->region_start = (uint32_t)rx->data; + desc->region_end = desc->region_start + + rx->size; + _spid_dma_read(desc, rx); + } + } + break; +#ifdef CONFIG_HAVE_SPI_FIFO + case SPID_MODE_FIFO: + if (tx) { + spi_write_stream(spi, desc->chip_select, + tx->data, tx->size); + } + if (rx) { + spi_read_stream(spi, desc->chip_select, + rx->data, rx->size); + } + mutex_free(&desc->mutex); + if (cb) + cb(desc, user_args); + break; +#endif + default: + trace_debug("Unkown mode"); + } + + return SPID_SUCCESS; +} + +void spid_finish_transfert_callback(struct _spi_desc* desc, void* user_args) +{ + (void)user_args; + spid_finish_transfert(desc); +} + +void spid_finish_transfert(struct _spi_desc* desc) +{ + spi_release_cs(desc->addr); + mutex_free(&desc->mutex); +} + +void spid_close(const struct _spi_desc* desc) +{ + uint32_t id = get_spi_id_from_addr(desc->addr); +#ifdef CONFIG_HAVE_SPI_FIFO + spi_fifo_disable(desc->addr); + spi_disable_it(desc->addr, SPI_IER_TXFPTEF | SPI_IER_RXFPTEF); + aic_disable(id); +#endif + spi_disable(desc->addr); + pmc_disable_peripheral(id); +} + +uint32_t spid_is_busy(const struct _spi_desc* desc) +{ + return mutex_is_locked(&desc->mutex); +} + +void spid_wait_transfert(const struct _spi_desc* desc) +{ + while (mutex_is_locked(&desc->mutex)); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.h new file mode 100644 index 000000000..e70c5854e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/spid.h @@ -0,0 +1,101 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 SPID_HEADER__ +#define SPID_HEADER__ + +/*------------------------------------------------------------------------------ + * Header + *----------------------------------------------------------------------------*/ + +#include +#include "mutex.h" +#include "io.h" + +/*------------------------------------------------------------------------------ + * Types + *----------------------------------------------------------------------------*/ + +#define SPID_SUCCESS (0) +#define SPID_INVALID_ID (1) +#define SPID_INVALID_BITRATE (2) +#define SPID_ERROR_LOCK (3) + +#define SPID_NO_CALLBACK ((spid_callback_t)0) + +struct _spi_desc; + +typedef void (*spid_callback_t)(struct _spi_desc* spid, void* args); + +enum _spid_trans_mode +{ + SPID_MODE_POLLING, + SPID_MODE_FIFO, + SPID_MODE_DMA +}; + +struct _spi_desc +{ + Spi* addr; + uint32_t bitrate; + uint32_t attributes; + uint8_t dlybs; + uint8_t dlybct; + uint8_t chip_select; + uint8_t spi_mode; + uint8_t transfert_mode; + /* implicit internal padding is mandatory here */ + spid_callback_t callback; + void* cb_args; + mutex_t mutex; + uint32_t region_start; + uint32_t region_end; +}; + +/*------------------------------------------------------------------------------ + * Functions + *----------------------------------------------------------------------------*/ + +extern void spid_configure(struct _spi_desc* desc); + +extern void spid_begin_transfert(struct _spi_desc* desc); + +extern uint32_t spid_transfert(struct _spi_desc* desc, struct _buffer* rx, + struct _buffer* tx, spid_callback_t cb, + void* user_args); +extern void spid_finish_transfert(struct _spi_desc* desc); +extern void spid_finish_transfert_callback(struct _spi_desc* desc, + void* user_arg); +extern void spid_close(const struct _spi_desc* desc); + +extern uint32_t spid_is_busy(const struct _spi_desc* desc); +extern void spid_wait_transfert(const struct _spi_desc* desc); + +#endif /* SPID_HEADER__ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.c new file mode 100644 index 000000000..b1907f063 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.c @@ -0,0 +1,228 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup tc_module + * \section Purpose + * The TC driver provides the Interface to configure the Timer Counter (TC). + * + * \section Usage + *
    + *
  • Optionally, use tc_find_mck_divisor() to let the program find the best + * TCCLKS field value automatically.
  • + *
  • Configure a Timer Counter in the desired mode using tc_configure().
  • + *
  • Start or stop the timer clock using tc_start() and tc_stop().
  • + * + *
+ * For more accurate information, please look at the TC section of the Datasheet. + * + * Related files :\n + * \ref tc.c\n + * \ref tc.h.\n +*/ + +/** +* \file +* +* \section Purpose +* +* Interface for configuring and using Timer Counter (TC) peripherals. +* +* \section Usage +* -# Optionally, use tc_find_mck_divisor() to let the program find the best +* TCCLKS field value automatically. +* -# Configure a Timer Counter in the desired mode using tc_configure(). +* -# Start or stop the timer clock using tc_start() and tc_stop(). +*/ + +/** + * \file + * + * Implementation of Timer Counter (TC). + * + */ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/tc.h" +#include "peripherals/pmc.h" + +#include + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +/** + * \brief Configures a Timer Counter Channel + * + * Configures a Timer Counter to operate in the given mode. Timer is stopped + * after configuration and must be restarted with tc_start(). All the + * interrupts of the timer are also disabled. + * + * \param pTc Pointer to a Tc instance. + * \param channel Channel number. + * \param mode Operating mode (TC_CMR value). + */ +void tc_configure(Tc * pTc, uint32_t channel, uint32_t mode) +{ + volatile TcChannel *pTcCh; + + assert(channel < + (sizeof (pTc->TC_CHANNEL) / sizeof (pTc->TC_CHANNEL[0]))); + pTcCh = pTc->TC_CHANNEL + channel; + + /* Disable TC clock */ + pTcCh->TC_CCR = TC_CCR_CLKDIS; + + /* Disable interrupts */ + pTcCh->TC_IDR = 0xFFFFFFFF; + + /* Clear status register */ + pTcCh->TC_SR; + + /* Set mode */ + pTcCh->TC_CMR = mode; +} + +/** + * \brief Reset and Start the TC Channel + * + * Enables the timer clock and performs a software reset to start the counting. + * + * \param pTc Pointer to a Tc instance. + * \param channel Channel number. + */ +void tc_start(Tc * pTc, uint32_t channel) +{ + volatile TcChannel *pTcCh; + + assert(channel < + (sizeof (pTc->TC_CHANNEL) / sizeof (pTc->TC_CHANNEL[0]))); + + pTcCh = pTc->TC_CHANNEL + channel; + pTcCh->TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG; + pTcCh->TC_IER = TC_IER_COVFS; +} + +/** + * \brief Stop TC Channel + * + * Disables the timer clock, stopping the counting. + * + * \param pTc Pointer to a Tc instance. + * \param channel Channel number. + */ +void tc_stop(Tc * pTc, uint32_t channel) +{ + volatile TcChannel *pTcCh; + + assert(channel < + (sizeof (pTc->TC_CHANNEL) / sizeof (pTc->TC_CHANNEL[0]))); + + pTcCh = pTc->TC_CHANNEL + channel; + pTcCh->TC_CCR = TC_CCR_CLKDIS; + pTcCh->TC_IDR = TC_IER_COVFS; +} + +/** + * \brief Enables TC channel interrupts + * + * \param tc Pointer to Tc instance + * \param channel Channel number + * \param mask mask of interrupts to enable + */ +void tc_enable_it(Tc* tc, uint32_t channel, uint32_t mask) +{ + assert(channel < (sizeof (tc->TC_CHANNEL) / sizeof (tc->TC_CHANNEL[0]))); + tc->TC_CHANNEL[channel].TC_IER = mask; +} + +/** + * \brief Find best MCK divisor + * + * Finds the best MCK divisor given the timer frequency and MCK. The result + * is guaranteed to satisfy the following equation: + * \code + * (MCK / (DIV * 65536)) <= freq <= (MCK / DIV) + * \endcode + * with DIV being the highest possible value. + * + * \param freq Desired timer freq. + * \param div Divisor value. + * \param tc_clks TCCLKS field value for divisor. + * + * \return 1 if a proper divisor has been found, otherwise 0. + */ +uint32_t tc_find_mck_divisor (uint32_t freq, uint32_t * div, + uint32_t * tc_clks) +{ + const uint32_t periph_clock = pmc_get_peripheral_clock(ID_TC0); + const uint32_t available_freqs[5] = {periph_clock >> 1, periph_clock >> 3, periph_clock >> 5, periph_clock >> 7, 32768}; + + int i = 0; + for (i = 0; i < 5; ++i) + { + uint32_t tmp = freq << 1; + if (tmp > available_freqs[i]) + break; + } + + i = (i == 5 ? i-1 : i); + + /* Store results */ + if (div) { + *div = periph_clock / available_freqs[i]; + } + if (tc_clks) { + *tc_clks = i; + } + + return 1; +} + +uint32_t tc_get_status(Tc* tc, uint32_t channel_num) +{ + return tc->TC_CHANNEL[channel_num].TC_SR; +} + + +void tc_trigger_on_freq(Tc* tc, uint32_t channel_num, uint32_t freq) +{ + uint32_t div = 0; + uint32_t tcclks = 0; + uint32_t tc_id = get_tc_id_from_addr(tc); + TcChannel* channel = &tc->TC_CHANNEL[channel_num]; + + tc_find_mck_divisor(freq, &div, &tcclks); + tc_configure(tc, channel_num, tcclks | TC_CMR_CPCTRG); + channel->TC_RC = (pmc_get_peripheral_clock(tc_id) / div) / freq; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.h new file mode 100644 index 000000000..efc00d255 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tc.h @@ -0,0 +1,74 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * Interface for configuring and using Timer Counter (TC) peripherals. + * + * \section Usage + * -# Optionally, use tc_find_mck_divisor() to let the program find the best + * TCCLKS field value automatically. + * -# Configure a Timer Counter in the desired mode using tc_configure(). + * -# Start or stop the timer clock using tc_start() and tc_stop(). + */ + +#ifndef _TC_ +#define _TC_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void tc_configure (Tc* pTc, uint32_t channel, uint32_t mode); +extern void tc_start (Tc * pTc, uint32_t channel); +extern void tc_stop (Tc * pTc, uint32_t channel); +extern void tc_enable_it(Tc* tc, uint32_t channel, uint32_t mask); +extern uint32_t tc_find_mck_divisor (uint32_t freq, uint32_t* div, uint32_t * tc_clks); +extern uint32_t tc_get_status(Tc* tc, uint32_t channel_num); +extern void tc_trigger_on_freq(Tc* tc, uint32_t channel_num, uint32_t freq); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _TC_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.c new file mode 100644 index 000000000..4f88b6432 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.c @@ -0,0 +1,164 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup tdes_module Working with TDES + * \ingroup peripherals_module + * The TDES driver provides the interface to configure and use the TDES + * peripheral. + * \n + * + * The Data Encryption Standard (DES) and the Triple Data Encryption Algorithm + * (TDES) specify FIPS-approved cryptographic algorithms that can be used to + * protect electronic data. + * The TDES bit in the TDES Mode Register (TDES_MR) is used to select either the + * single DES or the Triple DES mode (make use of the tdes_configure() + * function). + * + * The DES uses 64-bit cryptographic keys to encrypt and decrypt 64-bit data + * blocks. Input data can be fed calling tdes_set_input(). + * The 64-bit key is defined in the Key 1 Word Registers (TDES_KEY1WRx) and set + * by tdes_write_key1(). + * + * The Triple DES key consists in three DES keys, which set is also referred to + * as a key bundle. These three 64-bit keys are defined, respectively, in the + * Key 1, 2 and 3 Word Registers (TDES_KEY1WRx, TDES_KEY2WRx and TDES_KEY3WRx). + * In Triple DES mode (TDES_MR:TDESMOD set to 1), the TDES_MR:KEYMOD bit is used + * to select either the two- or three-key algorithm. + * + * In order to perform TDES encryption/decryption, the user has to follow these + * few steps: + *
    + *
  • A software-triggered hardware reset of the TDES interface is performed + * by tdes_soft_reset().
  • + *
  • Configure TDES algorithm mode, key mode, start mode and operation mode + * by means of tdes_configure().
  • + *
  • Set DES keys with function tdes_write_key1(), tdes_write_key2(), and + * tdes_write_key3().
  • + *
  • To start encrypting or decrypting call tdes_start().
  • + *
  • Retrieve the encryption or decryption result by means of + * tdes_get_output().
  • + *
+ * + * For more accurate information, please look at the TDES section of the + * Datasheet. + * + * Related files:\n + * \ref tdes.c\n + * \ref tdes.h\n + */ +/*@{*/ +/*@}*/ +/** + * \file + * + * Implementation of the Triple Data Encryption Algorithm (TDES). + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/tdes.h" + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void tdes_start(void) +{ + TDES->TDES_CR = TDES_CR_START; +} + +void tdes_soft_reset(void) +{ + TDES->TDES_CR = TDES_CR_SWRST; +} + +void tdes_configure(uint32_t mode) +{ + TDES->TDES_MR = mode; +} + +void tdes_enable_it(uint32_t sources) +{ + TDES->TDES_IER = sources; +} + +void tdes_disable_it(uint32_t sources) +{ + TDES->TDES_IDR = sources; +} + +uint32_t tdes_get_status(void) +{ + return TDES->TDES_ISR; +} + +void tdes_write_key1(uint32_t key_word0, uint32_t key_word1) +{ + TDES->TDES_KEY1WR[0] = key_word0; + TDES->TDES_KEY1WR[1] = key_word1; +} + +void tdes_write_key2(uint32_t key_word0, uint32_t key_word1) +{ + TDES->TDES_KEY2WR[0] = key_word0; + TDES->TDES_KEY2WR[1] = key_word1; +} + +void tdes_write_key3(uint32_t key_word0, uint32_t key_word1) +{ + TDES->TDES_KEY3WR[0] = key_word0; + TDES->TDES_KEY3WR[1] = key_word1; +} + +void tdes_set_input(uint32_t data0, uint32_t data1) +{ + TDES->TDES_IDATAR[0] = data0; + TDES->TDES_IDATAR[1] = data1; +} + +void tdes_get_output(uint32_t *data0, uint32_t *data1) +{ + *data0 = TDES->TDES_ODATAR[0]; + *data1 = TDES->TDES_ODATAR[1]; +} + +void tdes_set_vector(uint32_t v0, uint32_t v1) +{ + TDES->TDES_IVR[0] = v0; + TDES->TDES_IVR[1] = v1; +} + +void tdes_set_xtea_rounds(uint32_t rounds) +{ + TDES->TDES_XTEA_RNDR = TDES_XTEA_RNDR_XTEA_RNDS(rounds); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.h new file mode 100644 index 000000000..59e982d61 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/tdes.h @@ -0,0 +1,125 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _TDES_ +#define _TDES_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +#define MODE_SINGLE_DES 0x00 +#define MODE_TRIPLE_DES 0x01 +#define MODE_XTEA 0x02 + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Starts Manual encryption/decryption process. + */ +void tdes_start(void); + +/** + * \brief Resets the TDES. + * A software triggered hardware reset of the TDES interface is performed. + */ +void tdes_soft_reset(void); + +/** + * \brief Configures an TDES peripheral with the specified parameters. + * \param mode Desired value for the TDES_MR mode register (see the datasheet). + */ +void tdes_configure(uint32_t mode); + +/** + * \brief Enables the selected interrupts sources on a TDES peripheral. + * \param sources Bitwise OR of selected interrupt sources. + */ +void tdes_enable_it(uint32_t sources); + +/** + * \brief Disables the selected interrupts sources on a TDES peripheral. + * \param sources Bitwise OR of selected interrupt sources. + */ +void tdes_disable_it(uint32_t sources); + +/** + * \brief Get the current status register of the given TDES peripheral. + * \return TDES status register. + */ +extern uint32_t tdes_get_status(void); + +/** + * \brief Set KEY 1/2/3. + * \param key_word0 Key x, word 0 + * \param key_word1 Key x, word 1 + */ +void tdes_write_key1(uint32_t key_word0, uint32_t key_word1); +void tdes_write_key2(uint32_t key_word0, uint32_t key_word1); +void tdes_write_key3(uint32_t key_word0, uint32_t key_word1); + +/** + * \brief Set the two 32-bit input data registers. Allows to set the 64-bit data + * block used for encryption/decryption. + * \param data0 Corresponds to the first word of the data to be processed. + * \param data1 Corresponds to the last word of the data to be processed. + */ +void tdes_set_input(uint32_t data0, uint32_t data1); + +/** + * \brief Read from the two 32-bit data registers containing the 64-bit data + * block which has been encrypted/decrypted. + * \param data0 Points to the first word. + * \param data1 Points to the second word. + */ +void tdes_get_output(uint32_t *data0, uint32_t *data1); + +/** + * \brief Set the 64-bit initialization vector data block, which is used by + * specific modes of operation as an additional initial input. + * \param v0 Corresponds to the first word of the initialization vector. + * \param v1 Corresponds to the second word of the initialization vector. + */ +void tdes_set_vector(uint32_t v0, uint32_t v1); + +/** + * \brief Set the 6-bit complete rounds. + * \param rounds Corresponds to rounds+1 complete round. + */ +void tdes_set_xtea_rounds(uint32_t rounds); + +#endif /* #ifndef _TDES_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.c new file mode 100644 index 000000000..04ebb1018 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.c @@ -0,0 +1,128 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup rtng_module Working with RTNG + * \ingroup peripherals_module + * The TRNG driver provides the interface to configure and use the TRNG + * peripheral. + * \n + * + * The True Random Number Generator (TRNG) passes the American NIST Special + * Publication 800-22 and Diehard Random Tests Suites. As soon as the TRNG is + * enabled (trng_enable()), the generator provides one 32-bit value every 84 + * clock cycles. TRNG Interrupt can be enabled through trng_enable_it() + * (respectively disabled with trng_disable_it()). When new random data is + * ready, the interrupt will fire and the configured callback will be called. + * Alternatively, the TRNG can also be used in polling mode using + * trng_get_random_data(). + * + * For more accurate information, please look at the TRNG section of the + * datasheet. + * + * Related files :\n + * \ref trng.c\n + * \ref trng.h\n + */ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of True Random Number Generator (TRNG) + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/aic.h" +#include "peripherals/pmc.h" +#include "peripherals/trng.h" + +/*---------------------------------------------------------------------------- + * Local Data + *----------------------------------------------------------------------------*/ + +static trng_callback_t _trng_callback; +static void* _trng_callback_arg; + +/*------------------------------------------------------------------------------ + * Local functions + *------------------------------------------------------------------------------*/ + +static void _trng_handler(void) +{ + if (TRNG->TRNG_ISR & TRNG_ISR_DATRDY) { + if (_trng_callback) { + _trng_callback(TRNG->TRNG_ODATA, _trng_callback_arg); + } + } +} + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +void trng_enable() +{ + pmc_enable_peripheral(ID_TRNG); + TRNG->TRNG_CR = TRNG_CR_ENABLE | TRNG_CR_KEY_PASSWD; +} + +void trng_disable() +{ + TRNG->TRNG_CR = TRNG_CR_KEY_PASSWD; + pmc_disable_peripheral(ID_TRNG); +} + +void trng_enable_it(trng_callback_t cb, void* user_arg) +{ + _trng_callback = cb; + _trng_callback_arg = user_arg; + aic_set_source_vector(ID_TRNG, _trng_handler); + aic_enable(ID_TRNG); + TRNG->TRNG_IER = TRNG_IER_DATRDY; +} + +void trng_disable_it(void) +{ + TRNG->TRNG_IDR = TRNG_IDR_DATRDY; + aic_disable(ID_TRNG); + _trng_callback = NULL; + _trng_callback_arg = NULL; +} + +uint32_t trng_get_random_data(void) +{ + while (!(TRNG->TRNG_ISR & TRNG_ISR_DATRDY)); + return TRNG->TRNG_ODATA; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.h new file mode 100644 index 000000000..157993d93 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/trng.h @@ -0,0 +1,81 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _TRNG_H_ +#define _TRNG_H_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include +#include "chip.h" + +/*------------------------------------------------------------------------------ + * Types + *------------------------------------------------------------------------------*/ + +typedef void (*trng_callback_t)(uint32_t random_value, void* user_arg); + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +/** + * \brief Enables the TRNG. + */ +extern void trng_enable(void); + +/** + * \brief Disables the TRNG. + */ +extern void trng_disable(void); + +/** + * \brief Enable the TRNG interrupt, the callback will be called for each new + * generated random value. + * + * \param cb user callback + * \param user_arg user argument passed as-is to the callback + */ +extern void trng_enable_it(trng_callback_t cb, void* user_arg); + +/** + * \brief Disable the TRNG interrupt. + */ +extern void trng_disable_it(void); + +/** + * \brief Get the next random value generated by the TRNG. This function will + * block until a value is available. + * \return a random value + */ +extern uint32_t trng_get_random_data(void); + +#endif /* _TRNG_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.c new file mode 100644 index 000000000..9177e1426 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.c @@ -0,0 +1,500 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup twi_module Working with TWI + * \section Purpose + * The TWI driver provides the interface to configure and use the TWI + * peripheral. + * + * \section Usage + *
    + *
  • Configures a TWI peripheral to operate in master mode, at the given + * frequency (in Hz) using twi_configure().
  • + *
  • Sends a STOP condition on the TWI using twi_stop().
  • + *
  • Starts a read operation on the TWI bus with the specified slave using + * twi_start_read(). Data must then be read using twi_read_byte() whenever + * a byte is available (poll using twi_is_byte_received()).
  • + *
  • Starts a write operation on the TWI to access the selected slave using + * twi_start_write(). A byte of data must be provided to start the write; + * other bytes are written next.
  • + *
  • Sends a byte of data to one of the TWI slaves on the bus using twi_write_byte(). + * This function must be called once before twi_start_write() with the first byte of data + * to send, then it shall be called repeatedly after that to send the remaining bytes.
  • + *
  • Check if a byte has been received and can be read on the given TWI + * peripheral using twi_is_byte_received().< + * Check if a byte has been sent using twi_byte_sent().
  • + *
  • Check if the current transmission is complete (the STOP has been sent) + * using twi_is_transfer_complete().
  • + *
  • Enables & disable the selected interrupts sources on a TWI peripheral + * using twi_enable_it() and twi_enable_it().
  • + *
  • Get current status register of the given TWI peripheral using + * twi_get_status(). Get current status register of the given TWI peripheral, but + * masking interrupt sources which are not currently enabled using + * twi_get_masked_status().
  • + *
+ * For more accurate information, please look at the TWI section of the + * Datasheet. + * + * Related files :\n + * \ref twi.c\n + * \ref twi.h.\n +*/ +/*@{*/ +/*@}*/ + +/** + * \file + * + * Implementation of Two Wire Interface (TWI). + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/twi.h" +#include "peripherals/pmc.h" +#include "trace.h" + +#include "timer.h" +#include "io.h" + +#include +#include + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Configures a TWI peripheral to operate in master mode, at the given + * frequency (in Hz). The duty cycle of the TWI clock is set to 50%. + * \param twi Pointer to an Twi instance. + * \param twi_clock Desired TWI clock frequency. + */ +void twi_configure_master(Twi * pTwi, uint32_t twi_clock) +{ + uint32_t ck_div, cl_div, hold, ok, clock; + uint32_t id = get_twi_id_from_addr(pTwi); + + trace_debug("twi_configure_master(%u)\n\r", (unsigned)twi_clock); + assert(pTwi); + assert(id < ID_PERIPH_COUNT); + + /* SVEN: TWI Slave Mode Enabled */ + pTwi->TWI_CR = TWI_CR_SVEN; + + /* Reset the TWI */ + pTwi->TWI_CR = TWI_CR_SWRST; + pTwi->TWI_RHR; + timer_sleep(10); + + /* TWI Slave Mode Disabled, TWI Master Mode Disabled. */ + pTwi->TWI_MMR = 0; + pTwi->TWI_CR = TWI_CR_SVDIS; + pTwi->TWI_CR = TWI_CR_MSDIS; + clock = pmc_get_peripheral_clock(id); + + /* Compute clock */ + ck_div = 0; ok = 0; + while (!ok) { + cl_div = ((clock / (2 * twi_clock)) - 3) >> ck_div; + if (cl_div <= 255) + ok = 1; + else + ck_div++; + } + twi_clock = ROUND_INT_DIV(clock, (((cl_div * 2) << ck_div) + 3)); + assert(ck_div < 8); + trace_debug("twi: CKDIV=%u CLDIV=CHDIV=%u -> TWI Clock %uHz\n\r", + (unsigned)ck_div, (unsigned)cl_div, (unsigned)twi_clock); + + /* Compute holding time (I2C spec requires 300ns) */ + hold = ROUND_INT_DIV((uint32_t)(0.3 * clock), 1000000) - 3; + trace_debug("twi: HOLD=%u -> Holding Time %uns\n\r", + (unsigned)hold, (unsigned)((1000000 * (hold + 3)) / (clock / 1000))); + + /* Configure clock */ + pTwi->TWI_CWGR = 0; + pTwi->TWI_CWGR = TWI_CWGR_CKDIV(ck_div) | TWI_CWGR_CHDIV(cl_div) | + TWI_CWGR_CLDIV(cl_div) | TWI_CWGR_HOLD(hold); + + /* Set master mode */ + pTwi->TWI_CR = TWI_CR_MSEN; + timer_sleep(10); + assert((pTwi->TWI_CR & TWI_CR_SVDIS) != TWI_CR_MSDIS); + +} + +/** + * \brief Configures a TWI peripheral to operate in slave mode. + * \param twi Pointer to an Twi instance. + * \param slaveAddress Slave address. + */ +void twi_configure_slave(Twi * pTwi, uint8_t slave_address) +{ + trace_debug("twi_configure_slave()\n\r"); + assert(pTwi); + /* TWI software reset */ + pTwi->TWI_CR = TWI_CR_SWRST; + pTwi->TWI_RHR; + /* Wait at least 10 ms */ + timer_sleep(10); + /* TWI Slave Mode Disabled, TWI Master Mode Disabled */ + pTwi->TWI_CR = TWI_CR_SVDIS | TWI_CR_MSDIS; + /* Configure slave address. */ + pTwi->TWI_SMR = 0; + pTwi->TWI_SMR = TWI_SMR_SADR(slave_address); + /* SVEN: TWI Slave Mode Enabled */ + pTwi->TWI_CR = TWI_CR_SVEN; + /* Wait at least 10 ms */ + timer_sleep(10); + assert((pTwi->TWI_CR & TWI_CR_SVDIS) != TWI_CR_SVDIS); +} + +/** + * \brief Sends a STOP condition on the TWI. + * \param twi Pointer to an Twi instance. + */ +void twi_stop(Twi * pTwi) +{ + assert(pTwi != NULL); + pTwi->TWI_CR = TWI_CR_STOP; +} + +/** + * \brief Starts a read operation on the TWI bus with the specified slave, it returns + * immediately. Data must then be read using twi_read_byte() whenever a byte is + * available (poll using twi_is_byte_received()). + * \param twi Pointer to an Twi instance. + * \param address Slave address on the bus. + * \param iaddress Optional internal address bytes. + * \param isize Number of internal address bytes. + */ +void twi_start_read(Twi * pTwi, uint8_t address, + uint32_t iaddress, uint8_t isize) +{ + assert(pTwi != NULL); + assert((address & 0x80) == 0); + assert((iaddress & 0xFF000000) == 0); + assert(isize < 4); + /* Set slave address and number of internal address bytes. */ + pTwi->TWI_MMR = 0; + pTwi->TWI_MMR = (isize << 8) | TWI_MMR_MREAD | (address << 16); + /* Set internal address bytes */ + pTwi->TWI_IADR = 0; + pTwi->TWI_IADR = iaddress; + /* Send START condition */ + pTwi->TWI_CR = TWI_CR_START; +} + +/** + * \brief Reads a byte from the TWI bus. The read operation must have been started + * using twi_start_read() and a byte must be available (check with twi_is_byte_received()). + * \param twi Pointer to an Twi instance. + * \return byte read. + */ +uint8_t twi_read_byte(Twi * twi) +{ + assert(twi != NULL); + uint8_t value; + readb(&twi->TWI_RHR, &value); + return value; +} + +/** + * \brief Sends a byte of data to one of the TWI slaves on the bus. + * \note This function must be called once before twi_start_write() with + * the first byte of data to send, then it shall be called repeatedly + * after that to send the remaining bytes. + * \param twi Pointer to an Twi instance. + * \param byte Byte to send. + */ +void twi_write_byte(Twi * twi, uint8_t byte) +{ + assert(twi != NULL); + writeb(&twi->TWI_THR, byte); +} + +/** + * \brief Starts a write operation on the TWI to access the selected slave, then + * returns immediately. A byte of data must be provided to start the write; + * other bytes are written next. + * after that to send the remaining bytes. + * \param twi Pointer to an Twi instance. + * \param address Address of slave to acccess on the bus. + * \param iaddress Optional slave internal address. + * \param isize Number of internal address bytes. + * \param byte First byte to send. + */ +void twi_start_write(Twi * pTwi, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t byte) +{ + assert(pTwi != NULL); + assert((address & 0x80) == 0); + assert((iaddress & 0xFF000000) == 0); + assert(isize < 4); + /* Set slave address and number of internal address bytes. */ + pTwi->TWI_MMR = 0; + pTwi->TWI_MMR = (isize << 8) | (address << 16); + /* Set internal address bytes. */ + pTwi->TWI_IADR = 0; + pTwi->TWI_IADR = iaddress; + /* Write first byte to send. */ + twi_write_byte(pTwi, byte); +} + +/** + * \brief Check if a byte have been receiced from TWI. + * \param twi Pointer to an Twi instance. + * \return 1 if a byte has been received and can be read on the given TWI + * peripheral; otherwise, returns 0. This function resets the status register. + */ +uint8_t twi_is_byte_received(Twi * pTwi) +{ + assert(pTwi != NULL); + return ((pTwi->TWI_SR & TWI_SR_RXRDY) == TWI_SR_RXRDY); +} + +/** + * \brief Check if a byte have been sent to TWI. + * \param twi Pointer to an Twi instance. + * \return 1 if a byte has been sent so another one can be stored for + * transmission; otherwise returns 0. This function clears the status register. + */ +uint8_t twi_byte_sent(Twi * pTwi) +{ + assert(pTwi != NULL); + return ((pTwi->TWI_SR & TWI_SR_TXRDY) == TWI_SR_TXRDY); +} + +/** + * \brief Check if current transmission is complet. + * \param twi Pointer to an Twi instance. + * \return 1 if the current transmission is complete (the STOP has been sent); + * otherwise returns 0. + */ +uint8_t twi_is_transfer_complete(Twi * pTwi) +{ + assert(pTwi != NULL); + return ((pTwi->TWI_SR & TWI_SR_TXCOMP) == TWI_SR_TXCOMP); +} + +/** + * \brief Enables the selected interrupts sources on a TWI peripheral. + * \param twi Pointer to an Twi instance. + * \param sources Bitwise OR of selected interrupt sources. + */ +void twi_enable_it(Twi * pTwi, uint32_t sources) +{ + assert(pTwi != NULL); + pTwi->TWI_IER = sources; +} + +/** + * \brief Disables the selected interrupts sources on a TWI peripheral. + * \param twi Pointer to an Twi instance. + * \param sources Bitwise OR of selected interrupt sources. + */ +void twi_disable_it(Twi * pTwi, uint32_t sources) +{ + assert(pTwi != NULL); + pTwi->TWI_IDR = sources; +} + +/** + * \brief Get the current status register of the given TWI peripheral. + * \note This resets the internal value of the status register, so further + * read may yield different values. + * \param twi Pointer to an Twi instance. + * \return TWI status register. + */ +uint32_t twi_get_status(Twi * pTwi) +{ + assert(pTwi != NULL); + return pTwi->TWI_SR; +} + +/** + * \brief Returns the current status register of the given TWI peripheral, but + * masking interrupt sources which are not currently enabled. + * \note This resets the internal value of the status register, so further + * read may yield different values. + * \param twi Pointer to an Twi instance. + */ +uint32_t twi_get_masked_status(Twi * pTwi) +{ + uint32_t status; + assert(pTwi != NULL); + status = pTwi->TWI_SR; + status &= pTwi->TWI_IMR; + return status; +} + +/** + * \brief Sends a STOP condition. STOP Condition is sent just after completing + * the current byte transmission in master read mode. + * \param twi Pointer to an Twi instance. + */ +void twi_send_stop_condition(Twi * pTwi) +{ + assert(pTwi != NULL); + pTwi->TWI_CR |= TWI_CR_STOP; +} + +#ifdef CONFIG_HAVE_TWI_ALTERNATE_CMD +void twi_init_write_transfert(Twi * twi, uint8_t addr, uint32_t iaddress, + uint8_t isize, uint8_t len) +{ + twi->TWI_RHR; + twi->TWI_CR = TWI_CR_MSDIS; + twi->TWI_CR = TWI_CR_MSEN; + twi->TWI_CR = TWI_CR_MSEN | TWI_CR_SVDIS | TWI_CR_ACMEN; + twi->TWI_ACR = 0; + twi->TWI_ACR = TWI_ACR_DATAL(len); + twi->TWI_MMR = 0; + twi->TWI_MMR = TWI_MMR_DADR(addr) | TWI_MMR_IADRSZ(isize); + /* Set internal address bytes. */ + twi->TWI_IADR = 0; + twi->TWI_IADR = iaddress; +} + +void twi_init_read_transfert(Twi * twi, uint8_t addr, uint32_t iaddress, + uint8_t isize, uint8_t len) +{ + twi->TWI_RHR; + twi->TWI_CR = TWI_CR_MSEN | TWI_CR_SVDIS | TWI_CR_ACMEN; + twi->TWI_ACR = 0; + twi->TWI_ACR = TWI_ACR_DATAL(len) | TWI_ACR_DIR; + twi->TWI_MMR = 0; + twi->TWI_MMR = TWI_MMR_DADR(addr) | TWI_MMR_MREAD + | TWI_MMR_IADRSZ(isize); + /* Set internal address bytes. */ + twi->TWI_IADR = 0; + twi->TWI_IADR = iaddress; + twi->TWI_CR = TWI_CR_START; + while(twi->TWI_SR & TWI_SR_TXCOMP); +} +#endif + +#ifdef CONFIG_HAVE_TWI_FIFO +void twi_fifo_configure(Twi* twi, uint8_t tx_thres, + uint8_t rx_thres, + uint32_t ready_modes) +{ + /* Disable TWI master and slave mode and activate FIFO */ + twi->TWI_CR = TWI_CR_MSDIS | TWI_CR_SVDIS | TWI_CR_FIFOEN; + + /* Configure FIFO */ + twi->TWI_FMR = TWI_FMR_TXFTHRES(tx_thres) | TWI_FMR_RXFTHRES(rx_thres) + | ready_modes; +} + +uint32_t twi_fifo_rx_size(Twi *twi) +{ + return (twi->TWI_FLR & TWI_FLR_RXFL_Msk) >> TWI_FLR_RXFL_Pos; +} + +uint32_t twi_fifo_tx_size(Twi *twi) +{ + return (twi->TWI_FLR & TWI_FLR_TXFL_Msk) >> TWI_FLR_TXFL_Pos; +} + +uint32_t twi_read_stream(Twi *twi, uint32_t addr, uint32_t iaddr, + uint32_t isize, const void *stream, uint8_t len) +{ + const uint8_t* buffer = stream; + uint8_t left = len; + + twi_init_read_transfert(twi, addr, iaddr, isize, len); + if (twi_get_status(twi) & TWI_SR_NACK) { + trace_error("twid2: command NACK!\r\n"); + return 0; + } + + while (left > 0) { + if ((twi->TWI_SR & TWI_SR_RXRDY) == 0) continue; + + /* Get FIFO free size (int octet) and clamp it */ + uint32_t buf_size = twi_fifo_rx_size(twi); + buf_size = buf_size > left ? left : buf_size; + + /* Fill the FIFO as must as possible */ + while (buf_size > sizeof(uint32_t)) { + *(uint32_t*)buffer = twi->TWI_RHR; + buffer += sizeof(uint32_t); + left -= sizeof(uint32_t); + buf_size -= sizeof(uint32_t); + } + while (buf_size >= sizeof(uint8_t)) { + readb(&twi->TWI_RHR, (uint8_t*)buffer); + buffer += sizeof(uint8_t); + left -= sizeof(uint8_t); + buf_size -= sizeof(uint8_t); + } + } + return len - left; +} + +uint32_t twi_write_stream(Twi *twi, uint32_t addr, uint32_t iaddr, + uint32_t isize, const void *stream, uint8_t len) +{ + const uint8_t* buffer = stream; + uint8_t left = len; + + int32_t fifo_size = get_peripheral_fifo_depth(twi); + if (fifo_size < 0) + return 0; + + twi_init_write_transfert(twi, addr, iaddr, isize, len); + if (twi_get_status(twi) & TWI_SR_NACK) { + trace_error("twid2: command NACK!\r\n"); + return 0; + } + while (left > 0) { + if ((twi->TWI_SR & TWI_SR_TXRDY) == 0) continue; + + /* Get FIFO free size (int octet) and clamp it */ + uint32_t buf_size = fifo_size - twi_fifo_tx_size(twi); + buf_size = buf_size > left ? left : buf_size; + + /* /\* Fill the FIFO as must as possible *\/ */ + while (buf_size >= sizeof(uint8_t)) { + writeb(&twi->TWI_THR,*buffer); + buffer += sizeof(uint8_t); + left -= sizeof(uint8_t); + buf_size -= sizeof(uint8_t); + } + } + return len - left; +} + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.h new file mode 100644 index 000000000..95e4a5ac4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twi.h @@ -0,0 +1,111 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for configuration the Two Wire Interface (TWI) peripheral. + * + */ + +#ifndef _TWI_H_ +#define _TWI_H_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +#include + +/*---------------------------------------------------------------------------- + * Macros + *----------------------------------------------------------------------------*/ +/* Returns 1 if the TXRDY bit (ready to transmit data) is set in the given status register value.*/ +#define TWI_STATUS_TXRDY(status) ((status & TWI_SR_TXRDY) == TWI_SR_TXRDY) + +/* Returns 1 if the RXRDY bit (ready to receive data) is set in the given status register value.*/ +#define TWI_STATUS_RXRDY(status) ((status & TWI_SR_RXRDY) == TWI_SR_RXRDY) + +/* Returns 1 if the TXCOMP bit (transfer complete) is set in the given status register value.*/ +#define TWI_STATUS_TXCOMP(status) ((status & TWI_SR_TXCOMP) == TWI_SR_TXCOMP) + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * External function + *----------------------------------------------------------------------------*/ + +extern void twi_configure_master(Twi * pTwi, uint32_t twck); +extern void twi_configure_slave(Twi * pTwi, uint8_t slaveAddress); +extern void twi_stop(Twi * pTwi); +extern void twi_start_read(Twi * pTwi, uint8_t address, + uint32_t iaddress, uint8_t isize); +extern uint8_t twi_read_byte(Twi * pTwi); +extern void twi_write_byte(Twi * pTwi, uint8_t byte); +extern void twi_start_write(Twi * pTwi, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t byte); +extern uint8_t twi_is_byte_received(Twi * pTwi); +extern uint8_t twi_byte_sent(Twi * pTwi); +extern uint8_t twi_is_transfer_complete(Twi * pTwi); +extern void twi_enable_it(Twi * pTwi, uint32_t sources); +extern void twi_disable_it(Twi * pTwi, uint32_t sources); +extern uint32_t twi_get_status(Twi * pTwi); +extern uint32_t twi_get_masked_status(Twi * pTwi); +extern void twi_send_stop_condition(Twi * pTwi); + +#ifdef CONFIG_HAVE_TWI_ALTERNATE_CMD +extern void twi_init_write_transfert(Twi * twi, uint8_t addr, uint32_t iaddress, + uint8_t isize, uint8_t len); +extern void twi_init_read_transfert(Twi * twi, uint8_t addr, uint32_t iaddress, + uint8_t isize, uint8_t len); +#endif + +#ifdef CONFIG_HAVE_TWI_FIFO +extern void twi_fifo_configure(Twi* twi, uint8_t tx_thres, + uint8_t rx_thres, + uint32_t ready_modes); +extern void twi_fifo_disable(Twi* twi); + +extern uint32_t twi_fifo_rx_size(Twi *twi); +extern uint32_t twi_fifo_tx_size(Twi *twi); + +extern uint32_t twi_read_stream(Twi *twi, uint32_t addr, uint32_t iaddr, + uint32_t isize, const void *stream, uint8_t len); +extern uint32_t twi_write_stream(Twi *twi, uint32_t addr, uint32_t iaddr, + uint32_t isize, const void *stream, uint8_t len); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _TWI_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.c new file mode 100644 index 000000000..ec052f1ca --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.c @@ -0,0 +1,409 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + + +#ifdef CONFIG_HAVE_FLEXCOM +#include "peripherals/flexcom.h" +#endif +#include "peripherals/pmc.h" +#include "peripherals/twid.h" +#include "peripherals/twi.h" +#include "peripherals/xdmad.h" +#include "peripherals/l2cc.h" + +#include "cortex-a/cp15.h" + +#include "trace.h" +#include "io.h" +#include "timer.h" + +#include +#include + +#define TWID_DMA_THRESHOLD 16 +#define TWID_TIMEOUT 100 + +static uint32_t _twid_wait_twi_transfer(struct _twi_desc* desc) +{ + struct _timeout timeout; + timer_start_timeout(&timeout, TWID_TIMEOUT); + while(!twi_is_transfer_complete(desc->addr)){ + if (timer_timeout_reached(&timeout)) { + trace_error("twid: Unable to complete transfert!\r\n"); + twid_configure(desc); + return TWID_ERROR_TRANSFER; + } + } + return TWID_SUCCESS; +} + +static void _twid_xdmad_callback_wrapper(struct _xdmad_channel* channel, + void* args) +{ + trace_debug("TWID DMA Transfert Finished\r\n"); + struct _twi_desc* twid = (struct _twi_desc*) args; + + xdmad_free_channel(channel); + + if (twid->region_start && twid->region_end) { + l2cc_invalidate_region(twid->region_start, twid->region_end); + } + + if (twid && twid->callback) + twid->callback(twid, twid->cb_args); + +} + +static void _twid_init_dma_read_channel(const struct _twi_desc* desc, + struct _xdmad_channel** channel, + struct _xdmad_cfg* cfg) +{ + assert(cfg); + assert(channel); + + uint32_t id = get_twi_id_from_addr(desc->addr); + assert(id < ID_PERIPH_COUNT); + + memset(cfg, 0x0, sizeof(*cfg)); + + *channel = + xdmad_allocate_channel(id, XDMAD_PERIPH_MEMORY); + assert(*channel); + + xdmad_prepare_channel(*channel); + cfg->cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_DSYNC_PER2MEM + | XDMAC_CC_MEMSET_NORMAL_MODE + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_DIF_AHB_IF0 + | XDMAC_CC_SIF_AHB_IF1 + | XDMAC_CC_SAM_FIXED_AM; + + cfg->src_addr = (void*)&desc->addr->TWI_RHR; +} + +static void _twid_dma_read(const struct _twi_desc* desc, + struct _buffer* buffer) +{ + struct _xdmad_channel* channel = NULL; + struct _xdmad_cfg cfg; + + _twid_init_dma_read_channel(desc, &channel, &cfg); + + cfg.cfg.bitfield.dam = XDMAC_CC_DAM_INCREMENTED_AM + >> XDMAC_CC_DAM_Pos; + cfg.dest_addr = buffer->data; + cfg.ublock_size = buffer->size; + cfg.block_size = 0; + xdmad_configure_transfer(channel, &cfg, 0, 0); + xdmad_set_callback(channel, _twid_xdmad_callback_wrapper, + (void*)desc); + + l2cc_clean_region(desc->region_start, desc->region_end); + + xdmad_start_transfer(channel); +} + +static void _twid_init_dma_write_channel(struct _twi_desc* desc, + struct _xdmad_channel** channel, + struct _xdmad_cfg* cfg) +{ + assert(cfg); + assert(channel); + + uint32_t id = get_twi_id_from_addr(desc->addr); + assert(id < ID_PERIPH_COUNT); + memset(cfg, 0x0, sizeof(*cfg)); + + *channel = + xdmad_allocate_channel(XDMAD_PERIPH_MEMORY, id); + assert(*channel); + + xdmad_prepare_channel(*channel); + cfg->cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_DSYNC_MEM2PER + | XDMAC_CC_MEMSET_NORMAL_MODE + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_DIF_AHB_IF1 + | XDMAC_CC_SIF_AHB_IF0 + | XDMAC_CC_DAM_FIXED_AM; + + cfg->dest_addr = (void*)&desc->addr->TWI_THR; +} + +static void _twid_dma_write(struct _twi_desc* desc, + struct _buffer* buffer) +{ + struct _xdmad_channel* channel = NULL; + struct _xdmad_cfg cfg; + + _twid_init_dma_write_channel(desc, &channel, &cfg); + + cfg.cfg.bitfield.sam = XDMAC_CC_SAM_INCREMENTED_AM + >> XDMAC_CC_SAM_Pos; + cfg.src_addr = buffer->data; + cfg.ublock_size = buffer->size; + cfg.block_size = 0; + xdmad_configure_transfer(channel, &cfg, 0, 0); + xdmad_set_callback(channel, _twid_xdmad_callback_wrapper, + (void*)desc); + + l2cc_clean_region(desc->region_start, desc->region_end); + + xdmad_start_transfer(channel); +} + +void twid_configure(struct _twi_desc* desc) +{ + uint32_t id = get_twi_id_from_addr(desc->addr); + assert(id < ID_PERIPH_COUNT); + +#ifdef CONFIG_HAVE_FLEXCOM + Flexcom* flexcom = get_flexcom_addr_from_id(get_twi_id_from_addr(desc->addr)); + if (flexcom) { + flexcom_select(flexcom, FLEX_MR_OPMODE_TWI); + } +#endif + + pmc_enable_peripheral(id); + twi_configure_master(desc->addr, desc->freq); + +#ifdef CONFIG_HAVE_TWI_FIFO + if (desc->transfert_mode == TWID_MODE_FIFO) { + uint32_t fifo_depth = get_peripheral_fifo_depth(desc->addr); + twi_fifo_configure(desc->addr, fifo_depth/2, fifo_depth/2, + TWI_FMR_RXRDYM_ONE_DATA | TWI_FMR_TXRDYM_ONE_DATA); + } +#endif +} + +static uint32_t _twid_poll_write(struct _twi_desc* desc, struct _buffer* buffer) +{ + int i = 0; + struct _timeout timeout; + twi_init_write_transfert(desc->addr, + desc->slave_addr, + desc->iaddr, + desc->isize, + buffer->size); + if (twi_get_status(desc->addr) & TWI_SR_NACK) { + trace_error("twid: command NACK!\r\n"); + return TWID_ERROR_ACK; + } + for (i = 0; i < buffer->size; ++i) { + timer_start_timeout(&timeout, TWID_TIMEOUT); + while(!twi_byte_sent(desc->addr)) { + if (timer_timeout_reached(&timeout)) { + trace_error("twid: Device doesn't answer, " + "(TX TIMEOUT)\r\n"); + break; + } + } + twi_write_byte(desc->addr, buffer->data[i]); + if(twi_get_status(desc->addr) & TWI_SR_NACK) { + trace_error("twid: command NACK!\r\n"); + return TWID_ERROR_ACK; + } + } + /* wait transfert to be finished */ + return _twid_wait_twi_transfer(desc); +} + +static uint32_t _twid_poll_read(struct _twi_desc* desc, struct _buffer* buffer) +{ + int i = 0; + struct _timeout timeout; + twi_init_read_transfert(desc->addr, + desc->slave_addr, + desc->iaddr, + desc->isize, + buffer->size); + if (twi_get_status(desc->addr) & TWI_SR_NACK) { + trace_error("twid: command NACK!\r\n"); + return TWID_ERROR_ACK; + } + for (i = 0; i < buffer->size; ++i) { + timer_start_timeout(&timeout, TWID_TIMEOUT); + while(!twi_is_byte_received(desc->addr)) { + if (timer_timeout_reached(&timeout)) { + trace_error("twid: Device doesn't answer, " + "(RX TIMEOUT)\r\n"); + break; + } + } + buffer->data[i] = twi_read_byte(desc->addr); + if(twi_get_status(desc->addr) & TWI_SR_NACK) { + trace_error("twid: command NACK\r\n"); + return TWID_ERROR_ACK; + } + } + /* wait transfert to be finished */ + return _twid_wait_twi_transfer(desc); +} + +uint32_t twid_transfert(struct _twi_desc* desc, struct _buffer* rx, + struct _buffer* tx, twid_callback_t cb, + void* user_args) +{ + uint32_t status = TWID_SUCCESS; + + desc->callback = cb; + desc->cb_args = user_args; + + if (mutex_try_lock(&desc->mutex)) { + return TWID_ERROR_LOCK; + } + + switch (desc->transfert_mode) { + case TWID_MODE_POLLING: + if (tx) { + status = _twid_poll_write(desc, tx); + if (status) break; + } + if (rx) { + status = _twid_poll_read(desc, rx); + if (status) break; + } + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + break; + + case TWID_MODE_DMA: + if (!(rx || tx)) { + status = TWID_ERROR_DUPLEX; + break; + } + if (tx) { + if (tx->size < TWID_DMA_THRESHOLD) { + status = _twid_poll_write(desc, tx); + if (status) break; + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + } else { + twi_init_write_transfert(desc->addr, + desc->slave_addr, + desc->iaddr, + desc->isize, + tx->size); + desc->region_start = (uint32_t)tx->data; + desc->region_end = desc->region_start + + tx->size; + _twid_dma_write(desc, tx); + } + } + if (rx) { + if (rx->size < TWID_DMA_THRESHOLD) { + status = _twid_poll_read(desc, rx); + if (status) break; + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + } else { + twi_init_read_transfert(desc->addr, + desc->slave_addr, + desc->iaddr, + desc->isize, + rx->size); + desc->region_start = (uint32_t)rx->data; + desc->region_end = desc->region_start + + rx->size; + if(twi_get_status(desc->addr) & TWI_SR_NACK) { + trace_error("twid: Acknolegment " + "Error\r\n"); + status = TWID_ERROR_ACK; + break; + } + _twid_dma_read(desc, rx); + } + } + break; + +#ifdef CONFIG_HAVE_TWI_FIFO + case TWID_MODE_FIFO: + if (tx) { + status = twi_write_stream(desc->addr, desc->slave_addr, + desc->iaddr, desc->isize, + tx->data, tx->size); + status = status ? TWID_SUCCESS : TWID_ERROR_ACK; + if (status) + break; + status = _twid_wait_twi_transfer(desc); + if (status) + break; + } + if (rx) { + status = twi_read_stream(desc->addr, desc->slave_addr, + desc->iaddr, desc->isize, + rx->data, rx->size); + status = status ? TWID_SUCCESS : TWID_ERROR_ACK; + if (status) + break; + status = _twid_wait_twi_transfer(desc); + if (status) + break; + } + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + break; +#endif + default: + trace_debug("Unkown mode"); + } + + if (status) + mutex_free(&desc->mutex); + + return status; +} + +void twid_finish_transfert_callback(struct _twi_desc* desc, void* user_args) +{ + (void)user_args; + twid_finish_transfert(desc); +} + +void twid_finish_transfert(struct _twi_desc* desc) +{ + mutex_free(&desc->mutex); +} + +uint32_t twid_is_busy(const struct _twi_desc* desc) +{ + return mutex_is_locked(&desc->mutex); +} + +void twid_wait_transfert(const struct _twi_desc* desc) +{ + while (mutex_is_locked(&desc->mutex)); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.h new file mode 100644 index 000000000..3e4fc701f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid.h @@ -0,0 +1,95 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 TWID_HEADER__ +#define TWID_HEADER__ + +/*------------------------------------------------------------------------------ + * Header + *----------------------------------------------------------------------------*/ + +#include "peripherals/twi.h" +#include "mutex.h" +#include "io.h" + +/*------------------------------------------------------------------------------ + * Types + *----------------------------------------------------------------------------*/ + +#define TWID_SUCCESS (0) +#define TWID_INVALID_ID (1) +#define TWID_INVALID_BITRATE (2) +#define TWID_ERROR_LOCK (3) +#define TWID_ERROR_DUPLEX (4) +#define TWID_ERROR_ACK (5) +#define TWID_ERROR_TIMEOUT (6) +#define TWID_ERROR_TRANSFER (7) + +enum _twid_trans_mode +{ + TWID_MODE_POLLING, + TWID_MODE_FIFO, + TWID_MODE_DMA +}; + +struct _twi_desc; + +typedef void (*twid_callback_t)(struct _twi_desc* spid, void* args); + +struct _twi_desc +{ + Twi* addr; + uint32_t freq; + uint32_t slave_addr; + uint32_t iaddr; + uint32_t isize; + uint8_t transfert_mode; + /* implicit internal padding is mandatory here */ + mutex_t mutex; + uint32_t region_start; + uint32_t region_end; + twid_callback_t callback; + void* cb_args; +}; + +/*------------------------------------------------------------------------------ + * Functions + *----------------------------------------------------------------------------*/ + +extern void twid_configure(struct _twi_desc* desc); +extern uint32_t twid_transfert(struct _twi_desc* desc, struct _buffer* rx, + struct _buffer* tx, twid_callback_t cb, + void* user_args); +extern void twid_finish_transfert_callback(struct _twi_desc* desc, + void* user_args); +extern void twid_finish_transfert(struct _twi_desc* desc); +extern uint32_t twid_is_busy(const struct _twi_desc* desc); +extern void twid_wait_transfert(const struct _twi_desc* desc); + +#endif /* TWID_HEADER__ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.c new file mode 100644 index 000000000..d368f42c6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.c @@ -0,0 +1,675 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "peripherals/twid_legacy.h" +#include "peripherals/xdmad.h" +#include "cortex-a/cp15.h" +#include "trace.h" + +#include + +/*---------------------------------------------------------------------------- + * Definition + *----------------------------------------------------------------------------*/ +#define TWITIMEOUTMAX 0xfffff + +static struct _xdmad_cfg twi_dmaCfg; +static struct _xdmad_channel *dmaWriteChannel; +static struct _xdmad_channel *dmaReadChannel; +static struct _xdmad_desc_view1 dmaWriteLinkList[1]; +static struct _xdmad_desc_view1 dmaReadLinkList[1]; + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** TWI driver callback function.*/ +typedef void (*TwiCallback) (struct _async *); + +/** \brief TWI asynchronous transfer descriptor.*/ +struct _async_twi { + volatile uint32_t status; /** Asynchronous transfer status. */ + TwiCallback callback; /** Callback function to invoke when transfer completes or fails.*/ + uint8_t *pData; /** Pointer to the data buffer.*/ + uint32_t num; /** Total number of bytes to transfer.*/ + uint32_t transferred; /** Number of already transferred bytes.*/ +}; + +//struct _async_twi async_twi ; + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Initializes a TWI DMA Read channel. + */ +static void twid_dma_initialize_read(uint8_t TWI_ID) +{ + /* Allocate a XDMA channel, Read accesses into TWI_THR */ + dmaReadChannel = xdmad_allocate_channel(TWI_ID, XDMAD_PERIPH_MEMORY); + if (!dmaReadChannel) { + printf("-E- Can't allocate XDMA channel\n\r"); + } + xdmad_prepare_channel(dmaReadChannel); +} + +/** + * \brief Initializes a TWI DMA write channel. + */ +static void twid_dma_initialize_write(uint8_t TWI_ID) +{ + + /* Allocate a XDMA channel, Write accesses into TWI_THR */ + dmaWriteChannel = xdmad_allocate_channel(XDMAD_PERIPH_MEMORY, TWI_ID); + if (!dmaWriteChannel) { + printf("-E- Can't allocate XDMA channel\n\r"); + } + xdmad_prepare_channel(dmaWriteChannel); + +} + +/** + * \brief Initializes a TWI driver instance, using the given TWI peripheral. + * \note The peripheral must have been initialized properly before calling this function. + * \param pTwid Pointer to the Twid instance to initialize. + * \param pTwi Pointer to the TWI peripheral to use. + */ +void twid_initialize(struct _twid* pTwid, Twi * pTwi) +{ + trace_debug("twid_initialize()\n\r"); + assert(pTwid != NULL); + assert(pTwi != NULL); + + /* Initialize driver. */ + pTwid->pTwi = pTwi; + pTwid->pTransfer = 0; + /* Initialize XDMA driver instance with polling mode */ + + // ************* need to be updated XDMAD_Initialize(&twi_dma, 1); +} + +/** + * \brief Configure xDMA write linker list for TWI transfer. + */ +static void _xdma_configure_write(uint8_t * buf, uint32_t len, uint8_t twi_id) +{ + uint32_t i; + uint32_t xdmaCndc, Thr; + Twi* twi = (Twi*)get_twi_addr_from_id(twi_id); + + Thr = (uint32_t) & (TWI0->TWI_THR); + if (twi) + Thr = (uint32_t) & (twi->TWI_THR); + for (i = 0; i < 1; i++) { + dmaWriteLinkList[i].ublock_size = XDMA_UBC_NVIEW_NDV1 + | ((i == len - 1) ? 0 : XDMA_UBC_NDE_FETCH_EN) + | len; + dmaWriteLinkList[i].src_addr = & buf[i]; + dmaWriteLinkList[i].dest_addr = (void*)Thr; + if (i == len - 1) + dmaWriteLinkList[i].next_desc = 0; + else + dmaWriteLinkList[i].next_desc = + & dmaWriteLinkList[i + 1]; + } + twi_dmaCfg.cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_MBSIZE_SINGLE + | XDMAC_CC_DSYNC_MEM2PER + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_SIF_AHB_IF0 + | XDMAC_CC_DIF_AHB_IF1 + | XDMAC_CC_SAM_INCREMENTED_AM + | XDMAC_CC_DAM_FIXED_AM + | + XDMAC_CC_PERID(get_peripheral_xdma_channel(twi_id, XDMAC0, true)); + xdmaCndc = + XDMAC_CNDC_NDVIEW_NDV1 | XDMAC_CNDC_NDE_DSCR_FETCH_EN | + XDMAC_CNDC_NDSUP_SRC_PARAMS_UPDATED | + XDMAC_CNDC_NDDUP_DST_PARAMS_UNCHANGED; + cp15_coherent_dcache_for_dma((uint32_t) & dmaWriteLinkList, + ((uint32_t) & dmaWriteLinkList + + sizeof (*dmaWriteLinkList) * len)); + xdmad_configure_transfer(dmaWriteChannel, &twi_dmaCfg, + xdmaCndc, dmaWriteLinkList); +} + +/** + * \brief Configure xDMA read linker list for TWI transfer. + */ +static void _xdma_configure_read(uint8_t * buf, uint32_t len, uint8_t twi_id) +{ + uint32_t i; + uint32_t xdmaCndc, Rhr; + Twi* twi = get_twi_addr_from_id(twi_id); + + Rhr = (uint32_t) & (TWI0->TWI_RHR); + if (twi) { + Rhr = twi->TWI_RHR; + } + /* if (twi_id == ID_TWI1) { */ + /* Rhr = (uint32_t) & (TWI1->TWI_RHR); */ + /* } */ + /* if (twi_id == ID_TWI2) { */ + /* Rhr = (uint32_t) & (TWI2->TWI_RHR); */ + /* } */ + for (i = 0; i < 1; i++) { + dmaReadLinkList[i].ublock_size = XDMA_UBC_NVIEW_NDV1 + | ((i == len - 1) ? 0 : XDMA_UBC_NDE_FETCH_EN) + | len; + dmaReadLinkList[i].src_addr = (void*)Rhr; + dmaReadLinkList[i].dest_addr = & buf[i]; + if (i == len - 1) + dmaReadLinkList[i].next_desc = 0; + else + dmaReadLinkList[i].next_desc = + & dmaReadLinkList[i + 1]; + } + twi_dmaCfg.cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_MBSIZE_SINGLE + | XDMAC_CC_DSYNC_PER2MEM + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_SIF_AHB_IF1 + | XDMAC_CC_DIF_AHB_IF0 + | XDMAC_CC_SAM_FIXED_AM + | XDMAC_CC_DAM_INCREMENTED_AM + | + XDMAC_CC_PERID(get_peripheral_xdma_channel(twi_id, XDMAC0, false)); + xdmaCndc = + XDMAC_CNDC_NDVIEW_NDV1 | XDMAC_CNDC_NDE_DSCR_FETCH_EN | + XDMAC_CNDC_NDSUP_SRC_PARAMS_UPDATED | + XDMAC_CNDC_NDDUP_DST_PARAMS_UPDATED; + cp15_coherent_dcache_for_dma((uint32_t) & dmaReadLinkList, + ((uint32_t) & dmaReadLinkList + + sizeof (*dmaReadLinkList) * len)); + xdmad_configure_transfer(dmaReadChannel, &twi_dmaCfg, xdmaCndc, + dmaReadLinkList); +} + +/** + * \brief Interrupt handler for a TWI peripheral. Manages asynchronous transfer + * occuring on the bus. This function MUST be called by the interrupt service + * routine of the TWI peripheral if asynchronous read/write are needed. + * \param pTwid Pointer to a Twid instance. + */ +void twid_handler(struct _twid* pTwid) +{ + uint32_t status; + struct _async_twi* pTransfer; + Twi *pTwi; + + assert(pTwid != NULL); + + pTransfer = (struct _async_twi *) pTwid->pTransfer; + assert(pTransfer != NULL); + pTwi = pTwid->pTwi; + assert(pTwi != NULL); + + /* Retrieve interrupt status */ + status = twi_get_masked_status(pTwi); + + /* Byte received */ + if (TWI_STATUS_RXRDY(status)) { + + pTransfer->pData[pTransfer->transferred] = twi_read_byte(pTwi); + pTransfer->transferred++; + + /* check for transfer finish */ + if (pTransfer->transferred == pTransfer->num) { + + twi_enable_it(pTwi, TWI_IDR_RXRDY); + twi_enable_it(pTwi, TWI_IER_TXCOMP); + } + /* Last byte? */ + else if (pTransfer->transferred == (pTransfer->num - 1)) { + + twi_stop(pTwi); + } + } + /* Byte sent */ + else if (TWI_STATUS_TXRDY(status)) { + + /* Transfer finished ? */ + if (pTransfer->transferred == pTransfer->num) { + + twi_enable_it(pTwi, TWI_IDR_TXRDY); + twi_enable_it(pTwi, TWI_IER_TXCOMP); + twi_send_stop_condition(pTwi); + } + /* Bytes remaining */ + else { + + twi_write_byte(pTwi, + pTransfer->pData[pTransfer->transferred]); + pTransfer->transferred++; + } + } + /* Transfer complete */ + else if (TWI_STATUS_TXCOMP(status)) { + + twi_enable_it(pTwi, TWI_IDR_TXCOMP); + pTransfer->status = 0; + if (pTransfer->callback) { + pTransfer->callback((struct _async *) (void *) pTransfer); + } + pTwid->pTransfer = 0; + } +} + +/** + * \brief Asynchronously reads data from a slave on the TWI bus. An optional + * callback function is triggered when the transfer is complete. + * \param pTwid Pointer to a Twid instance. + * \param address TWI slave address. + * \param iaddress Optional slave internal address. + * \param isize Internal address size in bytes. + * \param pData Data buffer for storing received bytes. + * \param num Number of bytes to read. + * \param pAsync Asynchronous transfer descriptor. + * \return 0 if the transfer has been started; otherwise returns a TWI error code. + */ +uint8_t twid_read(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, struct _async * pAsync) +{ + Twi *pTwi; + struct _async_twi* pTransfer; + uint32_t timeout = 0; + uint32_t i = 0; + uint32_t status; + + assert(pTwid != NULL); + pTwi = pTwid->pTwi; + pTransfer = (struct _async_twi*) pTwid->pTransfer; + + assert((address & 0x80) == 0); + assert((iaddress & 0xFF000000) == 0); + assert(isize < 4); + + /* Check that no transfer is already pending */ + if (pTransfer) { + + trace_error("twid_read: A transfer is already pending\n\r"); + return TWID_ERROR_BUSY; + } + + /* Asynchronous transfer */ + if (pAsync) { + + /* Update the transfer descriptor */ + pTwid->pTransfer = pAsync; + pTransfer = (struct _async_twi*) pAsync; + pTransfer->status = ASYNC_STATUS_PENDING; + pTransfer->pData = pData; + pTransfer->num = num; + pTransfer->transferred = 0; + + /* Enable read interrupt and start the transfer */ + twi_enable_it(pTwi, TWI_IER_RXRDY); + twi_start_read(pTwi, address, iaddress, isize); + } + /* Synchronous transfer */ + else { + + /* Start read */ + twi_start_read(pTwi, address, iaddress, isize); + if (num != 1) { + status = twi_get_status(pTwi); + + if (status & TWI_SR_NACK) + trace_error("TWID NACK error\n\r"); + timeout = 0; + while (!(status & TWI_SR_RXRDY) + && (++timeout < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + //trace_error("TWID status %x\n\r",twi_get_status(pTwi)); + } + + pData[0] = twi_read_byte(pTwi); + for (i = 1; i < num - 1; i++) { + status = twi_get_status(pTwi); + if (status & TWI_SR_NACK) + trace_error("TWID NACK error\n\r"); + timeout = 0; + while (!(status & TWI_SR_RXRDY) + && (++timeout < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + //trace_error("TWID status %x\n\r",twi_get_status(pTwi)); + } + pData[i] = twi_read_byte(pTwi); + } + } + twi_stop(pTwi); + status = twi_get_status(pTwi); + if (status & TWI_SR_NACK) + trace_error("TWID NACK error\n\r"); + timeout = 0; + while (!(status & TWI_SR_RXRDY) && (++timeout < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + //trace_error("TWID status %x\n\r",twi_get_status(pTwi)); + } + + pData[i] = twi_read_byte(pTwi); + timeout = 0; + status = twi_get_status(pTwi); + while (!(status & TWI_SR_TXCOMP) && (++timeout < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + //trace_error("TWID status %x\n\r",twi_get_status(pTwi)); + } + } + + return 0; +} + +/** + * \brief Asynchronously reads data from a slave on the TWI bus. An optional + * callback function is triggered when the transfer is complete. + * \param pTwid Pointer to a Twid instance. + * \param address TWI slave address. + * \param iaddress Optional slave internal address. + * \param isize Internal address size in bytes. + * \param pData Data buffer for storing received bytes. + * \param num Number of bytes to read. + * \param pAsync Asynchronous transfer descriptor. + * \param twi_id TWI ID for TWI0, TWI1, TWI2. + * \return 0 if the transfer has been started; otherwise returns a TWI error code. + */ +uint8_t twid_dma_read(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, struct _async * pAsync, uint8_t twi_id) +{ + Twi *pTwi; + struct _async_twi* pTransfer; + uint32_t timeout = 0; + uint32_t status; + + assert(pTwid != NULL); + pTwi = pTwid->pTwi; + pTransfer = (struct _async_twi*) pTwid->pTransfer; + + assert((address & 0x80) == 0); + assert((iaddress & 0xFF000000) == 0); + assert(isize < 4); + + /* Check that no transfer is already pending */ + if (pTransfer) { + + trace_error("twid_read: A transfer is already pending\n\r"); + return TWID_ERROR_BUSY; + } + + /* Asynchronous transfer */ + if (pAsync) { + + /* Update the transfer descriptor */ + pTwid->pTransfer = pAsync; + pTransfer = (struct _async_twi*) pAsync; + pTransfer->status = ASYNC_STATUS_PENDING; + pTransfer->pData = pData; + pTransfer->num = num; + pTransfer->transferred = 0; + + /* Enable read interrupt and start the transfer */ + twi_enable_it(pTwi, TWI_IER_RXRDY); + twi_start_read(pTwi, address, iaddress, isize); + } + /* Synchronous transfer */ + else { + + twid_dma_initialize_read(twi_id); + _xdma_configure_read(pData, num, twi_id); + /* Start read */ + xdmad_start_transfer(dmaReadChannel); + + twi_start_read(pTwi, address, iaddress, isize); + + while ((!xdmad_is_transfer_done(dmaReadChannel)) + && (++timeout < TWITIMEOUTMAX)) + xdmad_poll(); + + xdmad_stop_transfer(dmaReadChannel); + + status = twi_get_status(pTwi); + timeout = 0; + while (!(status & TWI_SR_RXRDY) + && (++timeout < TWITIMEOUTMAX)) ; + + twi_stop(pTwi); + + twi_read_byte(pTwi); + + status = twi_get_status(pTwi); + timeout = 0; + while (!(status & TWI_SR_RXRDY) + && (++timeout < TWITIMEOUTMAX)) ; + + twi_read_byte(pTwi); + + status = twi_get_status(pTwi); + timeout = 0; + while (!(status & TWI_SR_TXCOMP) + && (++timeout < TWITIMEOUTMAX)) ; + if (timeout == TWITIMEOUTMAX) { + trace_error("TWID Timeout Read\n\r"); + } + xdmad_free_channel(dmaReadChannel); + } + return 0; +} + +/** + * \brief Asynchronously sends data to a slave on the TWI bus. An optional callback + * function is invoked whenever the transfer is complete. + * \param pTwid Pointer to a Twid instance. + * \param address TWI slave address. + * \param iaddress Optional slave internal address. + * \param isize Number of internal address bytes. + * \param pData Data buffer for storing received bytes. + * \param num Data buffer to send. + * \param pAsync Asynchronous transfer descriptor. + * \param twi_id TWI ID for TWI0, TWI1, TWI2. + * \return 0 if the transfer has been started; otherwise returns a TWI error code. + */ +uint8_t twid_dma_write(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, struct _async * pAsync, uint8_t twi_id) +{ + Twi *pTwi = pTwid->pTwi; + struct _async_twi* pTransfer; + uint32_t timeout = 0; + uint32_t status; + //uint8_t singleTransfer = 0; + + assert(pTwi != NULL); + assert((address & 0x80) == 0); + assert((iaddress & 0xFF000000) == 0); + assert(isize < 4); + + pTransfer = (struct _async_twi *) pTwid->pTransfer; +// if(num == 1) singleTransfer = 1; + /* Check that no transfer is already pending */ + if (pTransfer) { + trace_error("TWI_Write: A transfer is already pending\n\r"); + return TWID_ERROR_BUSY; + } + + /* Asynchronous transfer */ + if (pAsync) { + /* Update the transfer descriptor */ + pTwid->pTransfer = pAsync; + pTransfer = (struct _async_twi*) pAsync; + pTransfer->status = ASYNC_STATUS_PENDING; + pTransfer->pData = pData; + pTransfer->num = num; + pTransfer->transferred = 1; + /* Enable write interrupt and start the transfer */ + twi_start_write(pTwi, address, iaddress, isize, *pData); + twi_enable_it(pTwi, TWI_IER_TXRDY); + } + /* Synchronous transfer */ + else { + cp15_coherent_dcache_for_dma((uint32_t) pData, (uint32_t) pData); + twid_dma_initialize_write(twi_id); + _xdma_configure_write(pData, num, twi_id); + /* Set slave address and number of internal address bytes. */ + pTwi->TWI_MMR = 0; + pTwi->TWI_MMR = (isize << 8) | (address << 16); + /* Set internal address bytes. */ + pTwi->TWI_IADR = 0; + pTwi->TWI_IADR = iaddress; + xdmad_start_transfer(dmaWriteChannel); + while (!xdmad_is_transfer_done(dmaWriteChannel)) + xdmad_poll(); + xdmad_stop_transfer(dmaWriteChannel); + status = twi_get_status(pTwi); + timeout = 0; + while (!(status & TWI_SR_TXRDY) && (timeout++ < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + } + if (timeout == TWITIMEOUTMAX) { + trace_error("TWID Timeout TXRDY\n\r"); + } + /* Send a STOP condition */ + twi_stop(pTwi); + status = twi_get_status(pTwi); + timeout = 0; + while (!(status & TWI_SR_TXCOMP) && (++timeout < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + } + if (timeout == TWITIMEOUTMAX) { + trace_error("TWID Timeout Write\n\r"); + } + cp15_invalidate_dcache_for_dma((uint32_t) pData, (uint32_t) (pData)); + xdmad_free_channel(dmaWriteChannel); + } + return 0; +} + +/** + * \brief Asynchronously sends data to a slave on the TWI bus. An optional callback + * function is invoked whenever the transfer is complete. + * \param pTwid Pointer to a Twid instance. + * \param address TWI slave address. + * \param iaddress Optional slave internal address. + * \param isize Number of internal address bytes. + * \param pData Data buffer for storing received bytes. + * \param num Data buffer to send. + * \param pAsync Asynchronous transfer descriptor. + * \return 0 if the transfer has been started; otherwise returns a TWI error code. + */ +uint8_t twid_write(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, struct _async * pAsync) +{ + Twi *pTwi = pTwid->pTwi; + struct _async_twi* pTransfer; + uint32_t timeout = 0; + uint32_t status; + uint8_t singleTransfer = 0; + + assert(pTwi != NULL); + assert((address & 0x80) == 0); + assert((iaddress & 0xFF000000) == 0); + assert(isize < 4); + + pTransfer = (struct _async_twi *) pTwid->pTransfer; + if (num == 1) + singleTransfer = 1; + /* Check that no transfer is already pending */ + if (pTransfer) { + trace_error("TWI_Write: A transfer is already pending\n\r"); + return TWID_ERROR_BUSY; + } + /* Asynchronous transfer */ + if (pAsync) { + /* Update the transfer descriptor */ + pTwid->pTransfer = pAsync; + pTransfer = (struct _async_twi*) pAsync; + pTransfer->status = ASYNC_STATUS_PENDING; + pTransfer->pData = pData; + pTransfer->num = num; + pTransfer->transferred = 1; + /* Enable write interrupt and start the transfer */ + twi_start_write(pTwi, address, iaddress, isize, *pData); + twi_enable_it(pTwi, TWI_IER_TXRDY); + } + /* Synchronous transfer */ + else { + // Start write + twi_start_write(pTwi, address, iaddress, isize, *pData++); + num--; + if (singleTransfer) { + /* Send a STOP condition */ + twi_send_stop_condition(pTwi); + } + status = twi_get_status(pTwi); + if (status & TWI_SR_NACK) + trace_error("TWID NACK error\n\r"); + while (!(status & TWI_SR_TXRDY) && (timeout++ < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + } + if (timeout == TWITIMEOUTMAX) { + trace_error("TWID Timeout BS\n\r"); + } + timeout = 0; + /* Send all bytes */ + while (num > 0) { + /* Wait before sending the next byte */ + timeout = 0; + twi_write_byte(pTwi, *pData++); + status = twi_get_status(pTwi); + if (status & TWI_SR_NACK) + trace_error("TWID NACK error\n\r"); + while (!(status & TWI_SR_TXRDY) + && (timeout++ < TWITIMEOUTMAX)) { + status = twi_get_status(pTwi); + } + if (timeout == TWITIMEOUTMAX) { + trace_error("TWID Timeout BS\n\r"); + } + num--; + } + /* Wait for actual end of transfer */ + timeout = 0; + if (!singleTransfer) { + /* Send a STOP condition */ + twi_send_stop_condition(pTwi); + } + while (!twi_is_transfer_complete(pTwi) + && (++timeout < TWITIMEOUTMAX)) ; + if (timeout == TWITIMEOUTMAX) { + trace_error("TWID Timeout TC2\n\r"); + } + } + return 0; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.h new file mode 100644 index 000000000..ebeb74298 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/twid_legacy.h @@ -0,0 +1,128 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _TWID_ +#define _TWID_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "peripherals/twi.h" +#include "async.h" + +#include + +/*---------------------------------------------------------------------------- + * Definition + *----------------------------------------------------------------------------*/ + +/** TWI driver is currently busy. */ +#define TWID_ERROR_BUSY 1 + +// TWI clock frequency in Hz. +#define TWCK_400K 400000 +#define TWCK_200K 200000 +#define TWCK_100K 100000 + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** \brief TWI driver structure. Holds the internal state of the driver.*/ +struct _twid { + Twi *pTwi; /** Pointer to the underlying TWI peripheral.*/ + struct _async *pTransfer; /** Current asynchronous transfer being processed.*/ +}; + +struct _handler_twi +{ + uint8_t IdTwi; // ID TWI + uint8_t Status; // status of the TWI + uint8_t PeriphAddr; // Address of the component + uint8_t LenData; // Lenfth of the data to be read or write + uint8_t AddSize; // Size of the address + uint16_t RegMemAddr; // Address of the memory or register + uint32_t Twck; // default clock of the bus TWI + uint8_t* pData; // pointer to a data buffer + struct _twid twid; +}; + + +enum TWI_CMD +{ + TWI_RD = 0, + TWI_WR = 1 +}; + +enum TWI_STATUS +{ + TWI_STATUS_RESET = 0, + TWI_STATUS_HANDLE = 1u<<0, + TWI_STATUS_RFU2 = 1u<<1, + TWI_STATUS_RFU3 = 1u<<2, + TWI_STATUS_RFU4 = 1u<<3, + TWI_STATUS_READY = 1u<<7, +}; + +enum TWI_RESULT +{ + TWI_SUCCES = 0, + TWI_FAIL = 1 +}; + +/*---------------------------------------------------------------------------- + * Export functions + *----------------------------------------------------------------------------*/ +extern void twid_initialize(struct _twid* pTwid, Twi * pTwi); + +extern void twid_handler(struct _twid* pTwid); + +extern uint8_t twid_read(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, struct _async * pAsync); + +extern uint8_t twid_dma_read(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, + struct _async * pAsync, uint8_t TWI_ID); + +extern uint8_t twid_write(struct _twid* pTwid, uint8_t address, uint32_t iaddress, + uint8_t isize, uint8_t * pData, uint32_t num, struct _async * pAsync); + +extern uint8_t twid_dma_write(struct _twid* pTwid, uint8_t address, + uint32_t iaddress, uint8_t isize, uint8_t * pData, + uint32_t num, struct _async * pAsync, uint8_t TWI_ID); +#ifdef __cplusplus +} +#endif +#endif //#ifndef TWID_H diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.c new file mode 100644 index 000000000..e4ade23b4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.c @@ -0,0 +1,135 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/uart.h" +#include "peripherals/pmc.h" + +#include + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +/* + * Initializes the UART with the given parameters, and enables both the + * transmitter and the receiver. The mode parameter contains the value of the + * UART_MR register. + * Value UART_STANDARD can be used for mode to get the most common configuration + * (i.e. aysnchronous, 8bits, no parity, 1 stop bit, no flow control). + * \param mode Operating mode to configure. + * \param baudrate Desired baudrate (e.g. 115200). + * \param mck Frequency of the system master clock in Hz. + */ +void uart_configure(Uart* pUart, uint32_t mode, uint32_t baudrate) +{ + uint32_t uart_id = get_uart_id_from_addr(pUart); + // Reset & disable receiver and transmitter, disable interrupts + pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS + | UART_CR_RSTSTA; + pUart->UART_IDR = 0xFFFFFFFF; + // Configure baud rate + pUart->UART_BRGR = pmc_get_peripheral_clock(uart_id) / (baudrate * 16); + // Configure mode register + pUart->UART_MR = mode; + // Enable receiver and transmitter + pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN; +} + +/* Enable transmitter + * + */ +void uart_set_transmitter_enabled (Uart* pUart, uint8_t enabled) +{ + if (enabled) pUart->UART_CR = UART_CR_TXEN; + else pUart->UART_CR = UART_CR_TXDIS; +} + +/* Enable receiver + * + */ +void uart_set_receiver_enabled (Uart* pUart, uint8_t enabled) +{ + if (enabled) + pUart->UART_CR = UART_CR_RXEN; + else + pUart->UART_CR = UART_CR_RXDIS; +} + +/* Set interrupt register + * + */ +void uart_set_int (Uart* pUart, uint32_t int_mask) +{ + pUart->UART_IER |= int_mask; +} + +/** + * Outputs a character on the UART line. + * \note This function is synchronous (i.e. uses polling). + * \param c Character to send. + */ +void uart_put_char(Uart* pUart, uint8_t c) +{ + // Wait for the transmitter to be ready + while ((pUart->UART_SR & UART_SR_TXEMPTY) == 0); + // Send character + pUart->UART_THR = c; +} + +/** + * Return 1 if a character can be read in UART + */ +uint32_t uart_is_rx_ready(Uart* pUart) +{ + return (pUart->UART_SR & UART_SR_RXRDY); +} + +/** + * Return 1 if a character can be write in UART + */ +uint32_t uart_is_tx_ready(Uart* pUart) +{ + return (pUart->UART_SR & UART_SR_TXRDY); +} + +/** + * \brief Reads and returns a character from the UART. + * \note This function is synchronous (i.e. uses polling). + * \return Character received. + */ +uint8_t uart_get_char(Uart* pUart) +{ + while ((pUart->UART_SR & UART_SR_RXRDY) == 0); + return pUart->UART_RHR; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.h new file mode 100644 index 000000000..90a795d2c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/uart.h @@ -0,0 +1,70 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * This module provides several definitions and methods for using an UART + * peripheral. + * + */ + +#ifndef UART_H +#define UART_H + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include + +/*------------------------------------------------------------------------------ + * Definitions + *------------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------*/ +/* Exported functions */ +/*------------------------------------------------------------------------------*/ + +extern void uart_configure(Uart* puart, uint32_t mode, uint32_t baudrate); +extern void uart_set_transmitter_enabled(Uart* puart, uint8_t enabled); +extern void uart_set_receiver_enabled (Uart* puart, uint8_t enabled); +extern void uart_set_int (Uart* puart, uint32_t int_mask); +extern void uart_put_char(Uart* puart, uint8_t c); +extern uint32_t uart_is_rx_ready(Uart* puart); +extern uint32_t uart_is_tx_ready(Uart* puart); +extern uint8_t uart_get_char(Uart* puart); + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +#endif //#ifndef UART_H + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.c new file mode 100644 index 000000000..600a4f2b0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.c @@ -0,0 +1,825 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup usart_module Working with USART + * \section Purpose + * The USART driver provides the interface to configure and use the USART peripheral.\n + * + * The USART supports several kinds of communication modes such as full-duplex asynchronous/ + * synchronous serial communication,RS485 with driver control signal,ISO7816,SPI and Test modes. + * + * To start a USART transfer with \ref dmad_module "DMA" support, the user could follow these steps: + *
    + *
  • Configure USART with expected mode and baudrate(see \ref usart_configure), which could be done by: + * -# Resetting and disabling transmitter and receiver by setting US_CR(Control Register).
  • + * -# Configuring the USART in a specific mode by setting USART_MODE bits in US_MR(Mode Register) + * -# Setting baudrate which is different from mode to mode. + + *
  • Enable transmitter or receiver respectively by set US_CR_TXEN or US_CR_RXEN in US_CR.
  • + *
  • Read from or write to the peripheral with \ref dmad_module
  • + *
+ * + * \section Usage + *
    + *
  • Enable or disable USART transmitter or receiver using + * usart_set_transmitter_enabled() and usart_set_receiver_enabled(). + *
  • Enable or disable USART interrupt using usart_enable_it() or usart_disable_it(). + *
  • + *
+ * + * For more accurate information, please look at the USART section of the + * Datasheet. + * + * Related files :\n + * \ref usart.c\n + * \ref usart.h\n +*/ + +/** + * \file + * + * Implementation of USART (Universal Synchronous Asynchronous Receiver Transmitter) + * controller. + * + */ +/*----------------------------------------------------------------------------- +* Headers + *---------------------------------------------------------------------------*/ + +#include "chip.h" +#include "compiler.h" +#include "peripherals/usart.h" +#include "peripherals/pmc.h" + +#include "trace.h" +#include "io.h" + +#include +#include + +/*----------------------------------------------------------------------------- +* + *---------------------------------------------------------------------------*/ + +#ifdef CONFIG_HAVE_USART_FIFO +/* Clear FIFO related register if present. Dummy function otherwise. */ +static inline void _clear_fifo_control_flags(uint32_t* control_reg) +{ + *control_reg |= US_CR_FIFODIS | US_CR_TXFCLR | US_CR_RXFCLR | US_CR_TXFLCLR; +} +#else +#define _clear_fifo_control_flags(dummy) do {} while(0) +#endif + +/* The CD value scope programmed in MR register. */ +#define MIN_CD_VALUE 0x01 +#define MIN_CD_VALUE_SPI 0x04 +#define MAX_CD_VALUE US_BRGR_CD_Msk + +/* The receiver sampling divide of baudrate clock. */ +#define HIGH_FRQ_SAMPLE_DIV 16 +#define LOW_FRQ_SAMPLE_DIV 8 + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Reset status bits (PARE, OVER, MANERR, UNRE and PXBRK in US_CSR). + * + * \param usart Pointer to a USART instance. + */ +void usart_reset_status(Usart *usart) +{ + usart->US_CR = US_CR_RSTSTA; +} + + +/** + * \brief Configures an USART peripheral with the specified parameters. + * \param usart Pointer to the USART peripheral to configure. + * \param mode Desired value for the USART mode register (see the datasheet). + * \param baudrate Baudrate at which the USART should operate (in Hz). + * \param clock Frequency of the system master clock (in Hz). + */ +void usart_configure(Usart *usart, uint32_t mode, uint32_t baudrate) +{ + uint32_t clock = pmc_get_peripheral_clock(get_usart_id_from_addr(usart)); + /* Reset and disable receiver & transmitter */ + uint32_t control = US_CR_RSTRX | US_CR_RSTTX | US_CR_RXDIS | US_CR_TXDIS; + /* Reset and disable FIFO if present */ + _clear_fifo_control_flags(&control); + /* apply */ + usart->US_CR = control; + /* Configure mode */ + usart->US_MR = mode; + + /* Configure baudrate */ + /* Asynchronous, no oversampling */ + if (((mode & US_MR_SYNC) == 0) && ((mode & US_MR_OVER) == 0)) { + usart->US_BRGR = (clock / baudrate) / 16; + } +#ifdef CONFIG_HAVE_USART_SPI_MODE + if (((mode & US_MR_USART_MODE_SPI_MASTER) == + US_MR_USART_MODE_SPI_MASTER) || ((mode & US_MR_SYNC) == US_MR_SYNC)) { + if ((mode & US_MR_USCLKS_Msk) == US_MR_USCLKS_MCK) { + usart->US_BRGR = clock / baudrate; + } else { + if ((mode & US_MR_USCLKS_DIV) == US_MR_USCLKS_DIV) { + usart->US_BRGR = clock / baudrate / 8; + } + } + } +#endif /* CONFIG_HAVE_USART_SPI_MODE */ + + /* TODO other modes */ + + /* Disable all interrupts */ + usart->US_IDR = 0xFFFFFFFF; + /* Enable receiver and transmitter */ + usart->US_CR = US_CR_RXEN | US_CR_TXEN; +} + +/** + * \brief Get present status + * \param usart Pointer to an USART peripheral. + */ +uint32_t usart_get_status(Usart *usart) +{ + return usart->US_CSR; +} + +/** + * \brief Enable interrupt + * \param usart Pointer to an USART peripheral. + * \param mode Interrupt mode. + */ +void usart_enable_it(Usart *usart, uint32_t mode) +{ + usart->US_IER = mode; +} + +/** + * \brief Disable interrupt + * \param usart Pointer to an USART peripheral. + * \param mode Interrupt mode. + */ +void usart_disable_it(Usart *usart, uint32_t mode) +{ + usart->US_IDR = mode; +} + +/** + * \brief Return interrupt mask + * \param usart Pointer to an USART peripheral. + */ +uint32_t usart_get_it_mask(Usart *usart) +{ + return usart->US_IMR; +} + +/** + * \brief Enables or disables the transmitter of an USART peripheral. + * \param usart Pointer to an USART peripheral + * \param enabled If true, the transmitter is enabled; otherwise it is + * disabled. + */ +void usart_set_transmitter_enabled(Usart *usart, uint8_t enabled) +{ + if (enabled) { + usart->US_CR = US_CR_TXEN; + } else { + usart->US_CR = US_CR_TXDIS; + } +} + +/** + * \brief Enables or disables the receiver of an USART peripheral + * \param usart Pointer to an USART peripheral + * \param enabled If true, the receiver is enabled; otherwise it is disabled. + */ +void usart_set_receiver_enabled(Usart *usart, uint8_t enabled) +{ + if (enabled) { + usart->US_CR = US_CR_RXEN; + } else { + usart->US_CR = US_CR_RXDIS; + } +} + +/** + * \brief Enables or disables the Request To Send (RTS) of an USART peripheral + * \param usart Pointer to an USART peripheral + * \param enabled If true, the RTS is enabled (0); otherwise it is disabled. + */ +void usart_set_rts_enabled(Usart *usart, uint8_t enabled) +{ + if (enabled) { + usart->US_CR = US_CR_RTSEN; + } else { + usart->US_CR = US_CR_RTSDIS; + } +} + +/** + * \brief Immediately stop and disable USART transmitter. + * + * \param usart Pointer to a USART instance. + */ +void usart_reset_tx(Usart *usart) +{ + /* Reset transmitter */ + usart->US_CR = US_CR_RSTTX | US_CR_TXDIS; +} + +/** + * \brief Configure the transmit timeguard register. + * + * \param usart Pointer to a USART instance. + * \param timeguard The value of transmit timeguard. + */ +void usart_set_tx_timeguard(Usart *usart, uint32_t timeguard) +{ + usart->US_TTGR = timeguard; +} + +/** + * \brief Immediately stop and disable USART receiver. + * + * \param usart Pointer to a USART instance. + */ +void usart_reset_rx(Usart *usart) +{ + /* Reset Receiver */ + usart->US_CR = US_CR_RSTRX | US_CR_RXDIS; +} + +/** + * \brief Configure the receive timeout register. + * + * \param usart Pointer to a USART instance. + * \param timeout The value of receive timeout. + */ +void usart_set_rx_timeout(Usart *usart, uint32_t timeout) +{ + usart->US_RTOR = timeout; +} + + +/** + * \brief Start transmission of a break. + * + * \param usart Pointer to a USART instance. + */ +void usart_start_tx_break(Usart *usart) +{ + usart->US_CR = US_CR_STTBRK; +} + +/** + * \brief Stop transmission of a break. + * + * \param usart Pointer to a USART instance. + */ +void usart_stop_tx_break(Usart *usart) +{ + usart->US_CR = US_CR_STPBRK; +} + +/** + * \brief Start waiting for a character before clocking the timeout count. + * Reset the status bit TIMEOUT in US_CSR. + * + * \param usart Pointer to a USART instance. + */ +void usart_start_rx_timeout(Usart *usart) +{ + usart->US_CR = US_CR_STTTO; +} + +/** + * \brief Reset the ITERATION in US_CSR when the ISO7816 mode is enabled. + * + * \param usart Pointer to a USART instance. + */ +void usart_reset_iterations(Usart *usart) +{ + usart->US_CR = US_CR_RSTIT; +} + +/** + * \brief Reset NACK in US_CSR. + * + * \param usart Pointer to a USART instance. + */ +void usart_reset_nack(Usart *usart) +{ + usart->US_CR = US_CR_RSTNACK; +} + +/** + * \brief Restart the receive timeout. + * + * \param usart Pointer to a USART instance. + */ +void usart_restart_rx_timeout(Usart *usart) +{ + usart->US_CR = US_CR_RETTO; +} + +/** + * \brief Sends one packet of data through the specified USART peripheral. This + * function operates synchronously, so it only returns when the data has been + * actually sent. + * \param usart Pointer to an USART peripheral. + * \param data Data to send including 9nth bit and sync field if necessary (in + * the same format as the US_THR register in the datasheet). + * \param timeout Time out value (0 = no timeout). + */ +void usart_write(Usart *usart, uint16_t data, volatile uint32_t timeout) +{ + if (timeout == 0) { + while ((usart->US_CSR & US_CSR_TXRDY) == 0) ; + } else { + while ((usart->US_CSR & US_CSR_TXRDY) == 0) { + if (timeout == 0) { + trace_error("usart_write: Timed out.\n\r"); + return; + } + timeout--; + } + } + usart->US_THR = data; +} + +/** + * \brief Reads and return a packet of data on the specified USART peripheral. This + * function operates asynchronously, so it waits until some data has been + * received. + * \param usart Pointer to an USART peripheral. + * \param timeout Time out value (0 -> no timeout). + */ +uint16_t usart_read(Usart *usart, volatile uint32_t timeout) +{ + if (timeout == 0) { + while ((usart->US_CSR & US_CSR_RXRDY) == 0) ; + } else { + while ((usart->US_CSR & US_CSR_RXRDY) == 0) { + if (timeout == 0) { + trace_error("usart_read: Timed out.\n\r"); + return 0; + } + timeout--; + } + } + return usart->US_RHR; +} + +/** + * \brief Returns 1 if some data has been received and can be read from an USART; + * otherwise returns 0. + * \param usart Pointer to an USART instance. + */ +uint8_t usart_is_data_available(Usart *usart) +{ + if ((usart->US_CSR & US_CSR_RXRDY) != 0) { + return 1; + } else { + return 0; + } +} + +/** + * \brief Return 1 if a character can be read in USART + * \param usart Pointer to an USART peripheral. + */ +uint32_t usart_is_rx_ready(Usart *usart) +{ + return (usart->US_CSR & US_CSR_RXRDY); +} + +/** + * \brief Return 1 if a character send in USART + * \param usart Pointer to an USART peripheral. + */ +uint32_t usart_is_tx_ready(Usart *usart) +{ + return (usart->US_CSR & US_CSR_TXRDY); +} + +/** + * \brief Sends one packet of data through the specified USART peripheral. This + * function operates synchronously, so it only returns when the data has been + * actually sent. + * \param usart Pointer to an USART peripheral. + * \param c Character to send + */ +void usart_put_char(Usart *usart, uint8_t c) +{ + /* Wait for the transmitter to be ready */ + while ((usart->US_CSR & US_CSR_TXEMPTY) == 0) ; + /* Send character */ + /* Force an octet write to avoid race conditions with FIFO mode */ + writeb(&usart->US_THR, c); +} + +/** + * \brief Reads and returns a character from the USART. + * \note This function is synchronous (i.e. uses polling). + * \param usart Pointer to an USART peripheral. + * \return Character received. + */ +uint8_t usart_get_char(Usart *usart) +{ + while ((usart->US_CSR & US_CSR_RXRDY) == 0) ; + /* Force an octet read to avoid race conditions with FIFO mode */ + uint8_t v; + readb(&usart->US_RHR, &v); + return v; +} + +/** + * \brief Sets the filter value for the IRDA demodulator. + * \param usart Pointer to an USART instance. + * \param filter Filter value. + */ +void usart_set_irda_filter(Usart *usart, uint8_t filter) +{ + assert(usart != NULL); + + usart->US_IF = filter; + /* Set IrDA mode. */ + usart->US_MR = (usart->US_MR & ~US_MR_USART_MODE_Msk) | US_MR_USART_MODE_IRDA; +} + +/** + * \brief Select the SCK pin as the source of baud rate for the USART + * synchronous slave modes. + * + * \param usart Pointer to a USART instance. + */ +void usart_set_sync_slave_baudrate(Usart *usart) +{ + usart->US_MR = (usart->US_MR & ~US_MR_USCLKS_Msk) | US_MR_USCLKS_SCK | US_MR_SYNC; +} + +/** + * \brief Calculate a clock divider (\e CD) for the USART SPI master mode to + * generate a baud rate as close as possible to the baud rate set point. + * + * \note Baud rate calculation: + * \f$ Baudrate = \frac{SelectedClock}{CD} \f$. + * + * \param usart Pointer to a USART instance. + * \param baudrate Baud rate set point. + * + * \retval 0 Baud rate is successfully initialized. + * \retval 1 Baud rate set point is out of range for the given input clock + * frequency. + */ +uint32_t usart_set_spi_master_baudrate(Usart *usart, uint32_t baudrate) +{ + uint32_t cd; + uint32_t clock = pmc_get_peripheral_clock(get_usart_id_from_addr(usart)); + + /* Calculate the clock divider according to the formula in SPI mode. */ + cd = (clock + baudrate / 2) / baudrate; + if (cd < MIN_CD_VALUE_SPI || cd > MAX_CD_VALUE) { + return 1; + } + usart->US_BRGR = cd << US_BRGR_CD_Pos; + return 0; +} + +/** + * \brief Select the SCK pin as the source of baudrate for the USART SPI slave + * mode. + * + * \param usart Pointer to a USART instance. + */ +void usart_set_spi_slave_baudrate(Usart *usart) +{ + usart->US_MR &= ~US_MR_USCLKS_Msk; + usart->US_MR |= US_MR_USCLKS_SCK; +} + +/** + * \brief Configure USART to work in hardware handshaking mode. + * + * \note By default, the transmitter and receiver aren't enabled. + * + * \param usart Pointer to a USART instance. + * + * \retval 0 on success. + * \retval 1 on failure. + */ +uint32_t usart_init_hw_handshaking(Usart *usart) +{ + /* The USART should be initialized first as standard RS232. */ + /* Set hardware handshaking mode. */ + usart->US_MR = (usart->US_MR & ~US_MR_USART_MODE_Msk) | US_MR_USART_MODE_HW_HANDSHAKING; + return 0; +} + +/** + * \brief Calculate a clock divider(CD) and a fractional part (FP) for the + * USART asynchronous modes to generate a baudrate as close as possible to + * the baudrate set point. + * + * \note Baud rate calculation: Baudrate = mck/(Over * (CD + FP/8)) + * (Over being 16 or 8). The maximal oversampling is selected if it allows to + * generate a baudrate close to the set point. + * + * \param usart Pointer to a USART instance. + * \param baudrate Baud rate set point. + * + * \retval 0 Baud rate is successfully initialized. + * \retval 1 Baud rate set point is out of range for the given input clock + * frequency. + */ +uint32_t usart_set_async_baudrate(Usart *usart, uint32_t baudrate) +{ + uint32_t over, cd_fp, cd, fp; + uint32_t mck; + + /* get peripheral clock */ + mck = pmc_get_peripheral_clock(get_usart_id_from_addr(usart)); + + /* Calculate the receiver sampling divide of baudrate clock. */ + if (mck >= HIGH_FRQ_SAMPLE_DIV * baudrate) { + over = HIGH_FRQ_SAMPLE_DIV; + } else { + over = LOW_FRQ_SAMPLE_DIV; + } + + /* Calculate clock divider according to the fraction calculated formula. */ + cd_fp = (8 * mck + (over * baudrate) / 2) / (over * baudrate); + cd = cd_fp >> 0x03; + fp = cd_fp & 0x07; + if (cd < MIN_CD_VALUE || cd > MAX_CD_VALUE) { + return 1; + } + + /* Configure the OVER bit in MR register. */ + if (over == 8) { + usart->US_MR |= US_MR_OVER; + } + + /* Configure the baudrate generate register. */ + usart->US_BRGR = (cd << US_BRGR_CD_Pos) | (fp << US_BRGR_FP_Pos); + + return 0; +} + +/*----------------------------------------------------------------------------- +* Functions if FIFO are used + *---------------------------------------------------------------------------*/ + +#ifdef CONFIG_HAVE_USART_FIFO +/** + * \brief Configure the FIFO of USART device + * + * \param usart Pointer to an USART instance. + * \param tx_thres + * \param rx_down_thres + * \param rx_up_thres + * \param ready_modes + */ +void usart_fifo_configure(Usart *usart, uint8_t tx_thres, + uint8_t rx_down_thres, uint8_t rx_up_thres, + uint32_t ready_modes) +{ + /* Disable transmitter & receiver */ + usart->US_CR = US_CR_RXDIS | US_CR_TXDIS; + /* Enable FIFO */ + usart->US_CR = US_CR_FIFOEN; + /* Configure FIFO */ + usart->US_FMR = US_FMR_TXFTHRES(tx_thres) | US_FMR_RXFTHRES(rx_down_thres) + | US_FMR_RXFTHRES2(rx_up_thres) | ready_modes; + + /* Disable all fifo related interrupts */ + usart->US_FIDR = 0xFFFFFFFF; + + /* Reenable receiver & transmitter */ + usart->US_CR = US_CR_RXEN | US_CR_TXEN; +} + +/** + * \brief Disable the FIFO mode from the USART device + * + * \param usart Pointer to an USART instance. + * \note receiver and transmitter are reenabled. + */ +void usart_fifo_disable(Usart *usart) +{ + /* Reset and disable receiver & transmitter */ + uint32_t control = US_CR_RSTRX | US_CR_RSTTX | US_CR_RXDIS | US_CR_TXDIS; + /* clear and disable FIFO */ + _clear_fifo_control_flags(&control); + /* apply */ + usart->US_CR = control; + + /* Reenable receiver & transmitter */ + usart->US_CR = US_CR_RXEN | US_CR_TXEN; +} + +/** + * \brief Enable FIFO related interrupts according to the given mask + * + * \param usart Pointer to an USART instance. + * \param interrupt_mask The mask to apply + */ +void usart_fifo_enable_it(Usart *usart, uint32_t interrupt_mask) +{ + usart->US_FIER = interrupt_mask; +} + +/** + * \brief Disable FIFO related interrupts according to the given mask + * + * \param usart Pointer to an USART instance. + * \param interrupt_mask The mask to apply + */ +void usart_fifo_disable_it(Usart *usart, uint32_t interrupt_mask) +{ + usart->US_FIDR = interrupt_mask; +} + +/** + * \brief Retrive FIFO related interrupt mask. + * + * \param usart Pointer to an USART instance. + * \return current FIFO interrupt mask. + */ +uint32_t usart_fifo_get_interrupts(Usart *usart) +{ + return usart->US_FIMR; +} + + +/** + * \brief Get the size occupied in the input FIFO of USART device. + * + * \param usart Pointer to an USART instance. + * \return Size occupied in the input FIFO (not read yet) in octet + */ +uint32_t usart_fifo_rx_size(Usart *usart) +{ + return (usart->US_FLR & US_FLR_RXFL_Msk) >> US_FLR_RXFL_Pos; +} + +/** + * \brief Get the size occupied in the ouput FIFO of USART device. + * + * \param usart Pointer to an USART instance. + * \return Size occupied in the output FIFO (not sent yet) in octet + */ +uint32_t usart_fifo_tx_size(Usart *usart) +{ + return (usart->US_FLR & US_FLR_TXFL_Msk) >> US_FLR_TXFL_Pos; +} + +/** + * \brief Reads from USART device input channel until the specified length is + * reached. + * + * \param usart Pointer to an USART instance. + * \param stream Pointer to the receive buffer. + * \param len Size of the receive buffer, in octets. + * + * \return Number of read octets + * + * \warning WORKS ONLY IN LITTLE ENDIAN MODE! + * + * \note The FIFO must be configured before using this function. + * \note In case of a TIMEOUT or a BREAK, a null character is appended to the + * buffer and the returned value should be inferior to \ref len. + */ +uint32_t usart_read_stream(Usart *usart, void *stream, uint32_t len) +{ + uint8_t* buffer = stream; + uint32_t left = len; + while (left > 0) { + /* Stop reception if a timeout or break occur */ + if ((usart->US_CSR & (US_CSR_TIMEOUT | US_CSR_RXBRK)) != 0) { + *buffer = '\0'; + break; + } + + if ((usart->US_CSR & US_CSR_RXRDY) == 0) continue; + + /* Get FIFO size (in octets) and clamp it */ + uint32_t buf_size = usart_fifo_rx_size(usart); + buf_size = buf_size > left ? left : buf_size; + + /* Fill the buffer as must as possible with four data reads */ + while (buf_size >= sizeof(uint32_t)) { + *(uint32_t*)buffer = usart->US_RHR; + buffer += sizeof(uint32_t); + left -= sizeof(uint32_t); + buf_size -= sizeof(uint32_t); + } + /* Add tail data if stream is not 4 octet aligned */ + if (buf_size >= sizeof(uint16_t)) { + /* two data read */ + readhw(&usart->US_RHR, (uint16_t*)buffer); + left -= sizeof(uint16_t); + buffer += sizeof(uint16_t); + buf_size -= sizeof(uint16_t); + } + if (buf_size >= sizeof(uint8_t)) { + /* one data read */ + readb(&usart->US_RHR, buffer); + buffer += sizeof(uint8_t); + left -= sizeof(uint8_t); + buf_size -= sizeof(uint8_t); + } + } + return len - left; +} + +/** + * \brief Writes given data to USART device output channel until the specified + * length is reached. + * + * \param usart Pointer to an USART instance. + * \param stream Pointer to the data to send. + * \param len Size of the data to send, in octets. + * + * \return Number of written octets + * + * \warning WORKS ONLY IN LITTLE ENDIAN MODE! + * + * \note The FIFO must be configured before using this function. + * \note This function do not wait for the FIFO to be empty. + * \note In case of a TIMEOUT the transmission is aborted and the returned value + * should be inferior to \ref len. + */ +uint32_t usart_write_stream(Usart *usart, const void *stream, uint32_t len) +{ + const uint8_t* buffer = stream; + uint32_t left = len; + int32_t fifo_size = get_peripheral_fifo_depth(usart); + if (fifo_size < 0) + return 0; + + while (left > 0) { + if ((usart->US_CSR & US_CSR_TXRDY) == 0) continue; + + /* Get FIFO free size (int octet) and clamp it */ + uint32_t buf_size = fifo_size - usart_fifo_tx_size(usart); + buf_size = buf_size > left ? left : buf_size; + + /* Fill the FIFO as must as possible with four data writes */ + while (buf_size >= sizeof(uint32_t)) { + usart->US_THR = *(uint32_t*)buffer; + buffer += sizeof(uint32_t); + left -= sizeof(uint32_t); + buf_size -= sizeof(uint32_t); + } + /* Add tail data if stream is not 4 octet aligned */ + if (buf_size >= sizeof(uint16_t)) { + /* two data write */ + writehw(&usart->US_THR, *(uint16_t*)buffer); + buffer += sizeof(uint16_t); + left -= sizeof(uint16_t); + buf_size -= sizeof(uint16_t); + } + if (buf_size >= sizeof(uint8_t)) { + /* one data write */ + writeb(&usart->US_THR, *buffer); + buffer += sizeof(uint8_t); + left -= sizeof(uint8_t); + buf_size -= sizeof(uint8_t); + } + } + return len - left; +} + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.h new file mode 100644 index 000000000..5bd3566d9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart.h @@ -0,0 +1,137 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * This module provides several definitions and methods for using an USART + * peripheral. + * + * \par Usage + * + * -# Enable the USART peripheral clock in the PMC. + * -# Enable the required USART PIOs (see pio.h). + * -# Configure the UART by calling usart_configure. + * -# Enable the transmitter and/or the receiver of the USART using + * usart_set_transmitter_enabled and usart_set_receiver_enabled. + * -# Send data through the USART using the usart_write methods. + * -# Receive data from the USART using the usart_read functions; the availability of data can be polled + * with usart_is_data_available. + * -# Disable the transmitter and/or the receiver of the USART with + * usart_set_transmitter_enabled and usart_set_receiver_enabled. + */ + +#ifndef _USART_ +#define _USART_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +/*------------------------------------------------------------------------------ + * Definitions + *------------------------------------------------------------------------------*/ + +/** \section USART_mode USART modes + * This section lists several common operating modes for an USART peripheral. + * + * \b Modes + * - USART_MODE_ASYNCHRONOUS + * - USART_MODE_IRDA + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*------------------------------------------------------------------------------*/ +/* Exported functions */ +/*------------------------------------------------------------------------------*/ + +extern void usart_reset_status(Usart *usart); +extern void usart_configure(Usart *usart, uint32_t mode, uint32_t baudrate); +extern uint32_t usart_get_status(Usart * usart); +extern void usart_enable_it(Usart *usart, uint32_t mode); +extern void usart_disable_it(Usart *usart, uint32_t mode); +extern uint32_t usart_get_it_mask(Usart *usart); +extern void usart_set_transmitter_enabled(Usart *usart, uint8_t enabled); +extern void usart_set_receiver_enabled(Usart *usart, uint8_t enabled); +extern void usart_set_rts_enabled(Usart *usart, uint8_t enabled); + +extern void usart_reset_tx(Usart *usart); +extern void usart_set_tx_timeguard(Usart *usart, uint32_t timeguard); +extern void usart_reset_rx(Usart *usart); +extern void usart_set_rx_timeout(Usart *usart, uint32_t timeout); +extern void usart_start_tx_break(Usart *usart); +extern void usart_stop_tx_break(Usart *usart); +extern void usart_start_rx_timeout(Usart *usart); +extern void usart_reset_iterations(Usart *usart); +extern void usart_reset_nack(Usart *usart); +extern void usart_restart_rx_timeout(Usart *usart); + +extern void usart_write(Usart *usart, uint16_t data, volatile uint32_t timeout); +extern uint16_t usart_read(Usart *usart, volatile uint32_t timeout); +extern uint8_t usart_is_data_available(Usart *usart); +extern uint32_t usart_is_rx_ready(Usart *usart); +extern uint32_t usart_is_tx_ready(Usart *usart); + +extern void usart_put_char(Usart *usart, uint8_t c); +extern uint8_t usart_get_char(Usart *usart); + +extern void usart_set_irda_filter(Usart *usart, uint8_t filter); + +extern void usart_set_sync_slave_baudrate(Usart *usart); +extern uint32_t usart_set_spi_master_baudrate(Usart *usart, uint32_t baudrate); +extern void usart_set_spi_slave_baudrate(Usart *usart); +extern uint32_t usart_init_hw_handshaking(Usart *usart); +extern uint32_t usart_set_async_baudrate(Usart *usart, uint32_t baudrate); + +#ifdef CONFIG_HAVE_USART_FIFO +extern void usart_fifo_configure(Usart *usart, uint8_t tx_thres, + uint8_t rx_down_thres, uint8_t rx_up_thres, + uint32_t ready_modes); +extern void usart_fifo_disable(Usart *usart); +extern void usart_fifo_enable_it(Usart *usart, uint32_t interrupt_mask); +extern void usart_fifo_disable_it(Usart *usart, uint32_t interrupt_mask); +extern uint32_t usart_fifo_get_interrupts(Usart *usart); +extern uint32_t usart_fifo_rx_size(Usart *usart); +extern uint32_t usart_fifo_tx_size(Usart *usart); +extern uint32_t usart_read_stream(Usart *usart, void *stream, uint32_t len); +extern uint32_t usart_write_stream(Usart *usart, const void *stream, uint32_t len); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #ifndef _USART_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.c new file mode 100644 index 000000000..ca93ee588 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.c @@ -0,0 +1,620 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * ISO 7816 driver + * + * \section Usage + * + * Explanation on the usage of the code made available through the header file. + */ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "board.h" +#include "chip.h" + +#ifdef CONFIG_HAVE_FLEXCOM +#include "peripherals/flexcom.h" +#endif +#include "peripherals/pmc.h" +#include "peripherals/usart_iso7816_4.h" +#include "peripherals/usart.h" + +#include "trace.h" + +/*------------------------------------------------------------------------------ + * Definitions + *------------------------------------------------------------------------------*/ +/** Case for APDU commands*/ +#define CASE1 1 +#define CASE2 2 +#define CASE3 3 + +/** Flip flop for send and receive char */ +#define USART_SEND 0 +#define USART_RCV 1 + +/*----------------------------------------------------------------------------- + * Internal variables + *-----------------------------------------------------------------------------*/ +/** Variable for state of send and receive froom USART */ +static uint8_t state_usart_global = USART_RCV; + +/*---------------------------------------------------------------------------- + * Internal functions + *----------------------------------------------------------------------------*/ + +/** + * Get a character from iso7816 + * \param pchar_to_receive Pointer for store the received char + * \return 0: if timeout else status of US_CSR + */ +static uint32_t iso7816_get_char(Usart* usart, uint8_t * pchar_to_receive) +{ + uint32_t status; + uint32_t timeout = 0; + + if (state_usart_global == USART_SEND) { + while ((usart->US_CSR & US_CSR_TXEMPTY) == 0) { + } + usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + state_usart_global = USART_RCV; + } + + /* Wait USART ready for reception */ + while (((usart->US_CSR & US_CSR_RXRDY) == 0)) { + if (timeout++ > 12000 * (pmc_get_master_clock() / 1000000)) { + trace_debug("TimeOut\n\r"); + return (0); + } + } + trace_debug("T: %u\n\r", (unsigned)timeout); + + /* At least one complete character has been received and US_RHR has not yet been read. */ + /* Get a char */ + *pchar_to_receive = ((usart->US_RHR) & 0xFF); + + status = (usart-> US_CSR & (US_CSR_OVRE | US_CSR_FRAME | US_CSR_PARE | US_CSR_TIMEOUT | US_CSR_NACK | (1 << 10))); + + if (status != 0) { + /* trace_debug("R:0x%X\n\r", status); */ + trace_debug("R:0x%X\n\r", (unsigned)usart->US_CSR); + trace_debug("Nb:0x%X\n\r", (unsigned)usart->US_NER); + usart->US_CR = US_CR_RSTSTA; + } + /* Return status */ + return (status); +} + +/** + * Send a char to iso7816 + * \param char_to_send char to be send + * \return status of US_CSR + */ +static uint32_t iso7816_send_char(Usart* usart, uint8_t char_to_send) +{ + uint32_t status; + + if (state_usart_global == USART_RCV) { + usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + state_usart_global = USART_SEND; + } + + /* Wait USART ready for transmit */ + while ((usart->US_CSR & US_CSR_TXRDY) == 0) { + } + /* There is no character in the US_THR */ + /* Transmit a char */ + usart->US_THR = char_to_send; + + status = (usart-> US_CSR & (US_CSR_OVRE | US_CSR_FRAME | US_CSR_PARE | US_CSR_TIMEOUT | US_CSR_NACK | (1 << 10))); + + if (status != 0) { + trace_debug("E:0x%X\n\r", (unsigned)usart->US_CSR); + trace_debug("Nb:0x%X\n\r", (unsigned)usart->US_NER); + usart->US_CR = US_CR_RSTSTA; + } + /* Return status */ + return (status); +} + + + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * Iso 7816 ICC power off + */ +void iso7816_icc_power_off(const struct _pin* pinrst) +{ + /* Clear RESET Master Card */ + pio_clear(pinrst); +} + +/** + * Iso 7816 ICC power on + */ +static void iso7816_icc_power_on(const struct _pin* pinrst) +{ + /* Set RESET Master Card */ + pio_set(pinrst); +} + + +/** + * Transfert Block TPDU T=0 + * \param pAPDU APDU buffer + * \param pMessage Message buffer + * \param length Block length + * \return Message index + */ +uint16_t iso7816_xfr_block_TPDU_T0(const struct _iso7816_desc* iso7816, const uint8_t * pAPDU, + uint8_t * pMessage, uint16_t length) +{ + uint16_t NeNc, indexApdu = 4, indexMessage = 0; + uint8_t SW1 = 0, procByte, cmdCase, ins; + Usart* usart = iso7816->addr; + + trace_debug("pAPDU[0]=0x%X\n\r", pAPDU[0]); + trace_debug("pAPDU[1]=0x%X\n\r", pAPDU[1]); + trace_debug("pAPDU[2]=0x%X\n\r", pAPDU[2]); + trace_debug("pAPDU[3]=0x%X\n\r", pAPDU[3]); + trace_debug("pAPDU[4]=0x%X\n\r", pAPDU[4]); + trace_debug("pAPDU[5]=0x%X\n\r", pAPDU[5]); + trace_debug("wlength=%d\n\r", length); + + iso7816_send_char(usart, pAPDU[0]); /* CLA */ + iso7816_send_char(usart, pAPDU[1]); /* INS */ + iso7816_send_char(usart, pAPDU[2]); /* P1 */ + iso7816_send_char(usart, pAPDU[3]); /* P2 */ + iso7816_send_char(usart, pAPDU[4]); /* P3 */ + + /* Handle the four structures of command APDU */ + indexApdu = 4; + + if (length == 4) { + cmdCase = CASE1; + NeNc = 0; + } else if (length == 5) { + cmdCase = CASE2; + NeNc = pAPDU[4]; /* C5 */ + if (NeNc == 0) { + NeNc = 256; + } + } else if (length == 6) { + NeNc = pAPDU[4]; /* C5 */ + cmdCase = CASE3; + } else if (length == 7) { + NeNc = pAPDU[4]; /* C5 */ + if (NeNc == 0) { + cmdCase = CASE2; + NeNc = (pAPDU[5] << 8) + pAPDU[6]; + } else { + cmdCase = CASE3; + } + } else { + NeNc = pAPDU[4]; /* C5 */ + if (NeNc == 0) { + cmdCase = CASE3; + NeNc = (pAPDU[5] << 8) + pAPDU[6]; + } else { + cmdCase = CASE3; + } + } + + trace_debug("CASE=0x%X NeNc=0x%X\n\r", cmdCase, NeNc); + + /* Handle Procedure Bytes */ + do { + iso7816_get_char(usart, &procByte); + ins = procByte ^ 0xff; + /* Handle NULL */ + if (procByte == ISO_NULL_VAL) { + trace_debug("INS\n\r"); + continue; + } + /* Handle SW1 */ + else if (((procByte & 0xF0) == 0x60) || ((procByte & 0xF0) == 0x90)) { + trace_debug("SW1\n\r"); + SW1 = 1; + } + /* Handle INS */ + else if (pAPDU[1] == procByte) { + trace_debug("HdlINS\n\r"); + if (cmdCase == CASE2) { + /* receive data from card */ + do { + iso7816_get_char(usart, &pMessage[indexMessage++]); + } while (0 != --NeNc); + } else { + /* Send data */ + do { + iso7816_send_char(usart, pAPDU[indexApdu++]); + } while (0 != --NeNc); + } + } + /* Handle INS ^ 0xff */ + else if (pAPDU[1] == ins) { + trace_debug("HdlINS+\n\r"); + if (cmdCase == CASE2) { + /* receive data from card */ + iso7816_get_char(usart, &pMessage[indexMessage++]); + } else { + iso7816_send_char(usart, pAPDU[indexApdu++]); + } + NeNc--; + } else { + /* ?? */ + trace_debug("procByte=0x%X\n\r", procByte); + break; + } + } while (NeNc != 0); + + /* Status Bytes */ + if (SW1 == 0) { + iso7816_get_char(usart, &pMessage[indexMessage++]); /* SW1 */ + } else { + pMessage[indexMessage++] = procByte; + } + iso7816_get_char(usart, &pMessage[indexMessage++]); /* SW2 */ + + return (indexMessage); +} + +/** + * Escape iso7816 + */ +void iso7816_escape(void) +{ + trace_debug("For user, if needed\n\r"); +} + +/** + * Restart clock iso7816 + */ +void iso7816_restart_clock(struct _iso7816_desc* iso7816) +{ + Usart* usart = iso7816->addr; + trace_debug("iso7816_restart_clock\n\r"); + usart->US_BRGR = 13; +} + +/** + * Stop clock iso7816 + */ +void iso7816_stop_clock(struct _iso7816_desc* iso7816) +{ + Usart* usart = iso7816->addr; + trace_debug("iso7816_stop_clock\n\r"); + usart->US_BRGR = 0; +} + +/** + * T0 APDU + */ +void iso7816_to_APDU(void) +{ + trace_debug("iso7816_toAPDU\n\r"); + trace_debug("Not supported at this time\n\r"); +} + +/** + * Answer To Reset (ATR) + * \param pAtr ATR buffer + * \param plength Pointer for store the ATR length + */ +void iso7816_get_data_block_ATR(struct _iso7816_desc* iso7816, uint8_t * pAtr, uint8_t * plength) +{ + uint32_t i, j, y; + Usart* usart = iso7816->addr; + + *plength = 0; + + /* Read ATR TS */ + iso7816_get_char(usart, &pAtr[0]); + /* Read ATR T0 */ + iso7816_get_char(usart, &pAtr[1]); + y = pAtr[1] & 0xF0; + i = 2; + + /* Read ATR Ti */ + while (y) { + if (y & 0x10) { /* TA[i] */ + iso7816_get_char(usart, &pAtr[i++]); + } + if (y & 0x20) { /* TB[i] */ + iso7816_get_char(usart, &pAtr[i++]); + } + if (y & 0x40) { /* TC[i] */ + iso7816_get_char(usart, &pAtr[i++]); + } + if (y & 0x80) { /* TD[i] */ + iso7816_get_char(usart, &pAtr[i]); + y = pAtr[i++] & 0xF0; + } else { + y = 0; + } + } + /* Historical Bytes */ + y = pAtr[1] & 0x0F; + for (j = 0; j < y; j++) { + iso7816_get_char(usart, &pAtr[i++]); + } + *plength = i; +} + +/** + * Set data rate and clock frequency + * \param clock_frequency ICC clock frequency in KHz. + * \param data_rate ICC data rate in bpd + */ +void iso7816_set_data_rate_and_clock_frequency(struct _iso7816_desc* iso7816, uint32_t clock_frequency, uint32_t data_rate) +{ + uint8_t clk_frequency; + uint32_t per_mck; + Usart* usart = iso7816->addr; + + /* Define the baud rate divisor register */ + per_mck = pmc_get_peripheral_clock(iso7816->id); + usart->US_BRGR = per_mck / (clock_frequency * 1000); + clk_frequency = per_mck / usart->US_BRGR; + usart->US_FIDI = (clk_frequency) / data_rate; +} + +/** + * Pin status for iso7816 RESET + * \return 1 if the Pin RstMC is high; otherwise 0. + */ +uint8_t iso7816_get_status_pin_reset(const struct _pin* pinrst) +{ + return pio_get(pinrst); +} + +/** + * cold reset + */ +void iso7816_cold_reset(struct _iso7816_desc* iso7816) +{ + volatile uint32_t i; + Usart* usart = iso7816->addr; + + /* tb: wait 400 cycles */ + for (i = 0; i < (120 * (pmc_get_master_clock() / 1000000)); i++) { + } + usart->US_RHR; + usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + iso7816_icc_power_on(&iso7816->pin_rst); +} + +/** + * Warm reset + */ +void iso7816_warm_reset(struct _iso7816_desc* iso7816) +{ + volatile uint32_t i; + Usart* usart = iso7816->addr; + + iso7816_icc_power_off(&iso7816->pin_rst); + /* tb: wait 400 cycles, 40000cycles/t(277ns)=11ms */ + for (i = 0; i < (30 * (pmc_get_master_clock() / 1000000)); i++) { + } + usart->US_RHR; + usart->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + iso7816_icc_power_on(&iso7816->pin_rst); +} + +/** + * Decode ATR trace + * \param pAtr pointer on ATR buffer + */ +void iso7816_decode_ATR(uint8_t * pAtr) +{ + uint32_t i, j, y; + uint8_t offset; + + printf("\n\r"); + printf("ATR: Answer To Reset:\n\r"); + printf("TS = 0x%X Initial character ", pAtr[0]); + + switch (pAtr[0]) + { + case 0x3B: + printf("Direct Convention\n\r"); + break; + case 0x3F: + printf("Inverse Convention\n\r"); + break; + default: + printf("BAD Convention\n\r"); + break; + } + printf("T0 = 0x%X Format caracter\n\r", pAtr[1]); + printf(" Number of historical bytes: K = %d\n\r", pAtr[1] & 0x0F); + printf(" Presence further interface byte:\n\r"); + if (pAtr[1] & 0x80) { + printf("TA "); + } + if (pAtr[1] & 0x40) { + printf("TB "); + } + if (pAtr[1] & 0x20) { + printf("TC "); + } + if (pAtr[1] & 0x10) { + printf("TD "); + } + if (pAtr[1] != 0) { + printf(" present\n\r"); + } + + i = 2; + y = pAtr[1] & 0xF0; + + /* Read ATR Ti */ + offset = 1; + while (y) { + + if (y & 0x10) { /* TA[i] */ + printf("TA[%d] = 0x%X ", offset, pAtr[i]); + if (offset == 1) { + printf("FI = %d ", (pAtr[i] >> 8)); + printf("DI = %d", (pAtr[i] & 0x0F)); + } + printf("\n\r"); + i++; + } + if (y & 0x20) { /* TB[i] */ + printf("TB[%d] = 0x%X\n\r", offset, pAtr[i]); + i++; + } + if (y & 0x40) { /* TC[i] */ + printf("TC[%d] = 0x%X ", offset, pAtr[i]); + if (offset == 1) { + printf("Extra Guard Time: N = %d", pAtr[i]); + } + printf("\n\r"); + i++; + } + if (y & 0x80) { /* TD[i] */ + printf("TD[%d] = 0x%X\n\r", offset, pAtr[i]); + y = pAtr[i++] & 0xF0; + } else { + y = 0; + } + offset++; + } + + /* Historical Bytes */ + printf("Historical bytes:\n\r"); + y = pAtr[1] & 0x0F; + for (j = 0; j < y; j++) { + + printf(" 0x%X", pAtr[i]); + if ((pAtr[i] > 0x21) && (pAtr[i] < 0x7D)) { /* ASCII */ + printf("(%c) ", pAtr[i]); + } + i++; + } + printf("\n\r\n\r"); + +} + +/** Initializes a usart ISO7816 + * \param + */ +static void _usart_iso7816_configure(Usart* usart, const struct _iso7816_opt* opt, uint32_t mode) +{ + /* Reset and disable receiver & transmitter */ + usart->US_CR = US_CR_RSTRX | US_CR_RSTTX | US_CR_RXDIS | US_CR_TXDIS; + /* Configure mode */ + usart->US_MR = mode; + + /* Disable all interrupts */ + usart->US_IDR = 0xFFFFFFFF; + usart->US_FIDI = opt->fidi_ratio; + /* Define the baud rate divisor register */ + /* CD = MCK /(FIDI x BAUD) = periph_mck / (372x9600) */ + uint32_t per_mck = pmc_get_peripheral_clock(get_usart_id_from_addr(usart)); + usart->US_BRGR = per_mck / opt->iso7816_hz; + /* Write the Timeguard Register */ + usart->US_TTGR = opt->time_guard; + /* Enable receiver and transmitter */ + usart->US_CR = US_CR_RXEN | US_CR_TXEN; +} + +/** Initializes a ISO driver + * \param + */ +uint8_t iso7816_init(struct _iso7816_desc* iso7816, const struct _iso7816_opt* opt) +{ + uint32_t mode = 0; + Usart* usart = iso7816->addr; + + trace_debug("ISO_Init\n\r"); + + /* Configure control Pios */ + pio_configure(&iso7816->pin_stop, 1); + pio_configure(&iso7816->pin_mod_vcc, 1); + pio_configure(&iso7816->pin_rst, 1); + + /* STOP = 1, normal operation */ + pio_set(&iso7816->pin_stop); + /* MOD = 1, 3V3 */ + pio_set(&iso7816->pin_mod_vcc); + + pmc_enable_peripheral(iso7816->id); + +#ifdef CONFIG_HAVE_FLEXCOM + /* switch Flexcom to Usart mode */ + Flexcom* flexcom = get_flexcom_addr_from_id(iso7816->id); + if (flexcom) { + flexcom_select(flexcom, FLEX_MR_OPMODE_USART); + } +#endif + + /* Initialize driver to use */ + mode = opt->clock_sel | opt->char_length | opt->sync | opt->parity_type ; + mode |= opt->inhibit_nack | opt->dis_suc_nack ; + mode |= US_MR_CLKO ; /* The USART drives the SCK pin */ + + /* Check whether the input values are legal. */ + if ( (opt->parity_type != US_MR_PAR_EVEN) && (opt->parity_type != US_MR_PAR_ODD) ) { + return 1; + } + if (opt->protocol_type == US_MR_USART_MODE_IS07816_T_0) { + mode |= US_MR_USART_MODE_IS07816_T_0 | US_MR_NBSTOP_2_BIT | US_MR_MAX_ITERATION(opt->max_iterations); + if (opt->bit_order) { + mode |= US_MR_MSBF; + } + } else if (opt->protocol_type == US_MR_USART_MODE_IS07816_T_1) { + /* + * Only LSBF is used in the T=1 protocol, and max_iterations field + * is only used in T=0 mode. + */ + if (opt->bit_order || opt->max_iterations) { + return 1; + } + /* Set USART mode to ISO7816, T=1, and always uses 1 stop bit. */ + mode |= US_MR_USART_MODE_IS07816_T_1 | US_MR_NBSTOP_1_BIT; + } else { + return 1; + } + + _usart_iso7816_configure (usart, opt, mode); + return 0; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.h new file mode 100644 index 000000000..6ad4b65d7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_iso7816_4.h @@ -0,0 +1,131 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +//------------------------------------------------------------------------------ +/** \addtogroup iso7816_4 ISO7816-4 Driver + * \section Purpose + * + * Definition of methods for ISO7816 driver. + * + * \section Usage + * + * -# ISO7816_Init() + * -# ISO7816_IccPowerOff() + * -# ISO7816_XfrBlockTPDU_T0() + * -# ISO7816_Escape() + * -# ISO7816_RestartClock() + * -# ISO7816_StopClock() + * -# ISO7816_toAPDU() + * -# ISO7816_Datablock_ATR() + * -# ISO7816_SetDataRateandClockFrequency() + * -# ISO7816_StatusReset() + * -# ISO7816_cold_reset() + * -# ISO7816_warm_reset() + * -# ISO7816_Decode_ATR() + */ + +#ifndef ISO7816_4_H +#define ISO7816_4_H + +/*------------------------------------------------------------------------------ + * Include headers + *----------------------------------------------------------------------------*/ + +#include "peripherals/pio.h" +#include "peripherals/usart.h" + +/*------------------------------------------------------------------------------ + * Constants Definition + *----------------------------------------------------------------------------*/ + +/** Size max of Answer To Reset */ +#define ATR_SIZE_MAX 55 + +/** NULL byte to restart byte procedure */ +#define ISO_NULL_VAL 0x60 + +/* MOD_VCC The signal present on this pin programs the SIM_VCC value */ +#define MOD_VCC_1V8 0 +#define MOD_VCC_3V3 1 + +/* STOP pin, Power Down Mode pin */ +#define STOP_SHUTDOWN 0 +#define STOP_NORMAL 1 + +struct _iso7816_opt { + uint32_t protocol_type; /* Which protocol is used 0: T = 0, 1: T = 1*/ + uint32_t clock_sel; /* Clock Selection */ + uint32_t char_length; /* Character Length*/ + uint32_t sync; /* Synchronous Mode Select */ + uint32_t parity_type; /* Parity Type*/ + uint32_t num_stop_bits; /* Number of Stop Bits*/ + uint32_t bit_order; /* Bit order in transmitted characters 0: LSB first 1: MSB first.*/ + uint32_t inhibit_nack; /* Inhibit Non Acknowledge*/ + uint32_t dis_suc_nack; /* Disable Successive NACK*/ + + uint32_t max_iterations;/* */ + uint32_t iso7816_hz; /* Set the frequency of the ISO7816 clock. */ + uint32_t fidi_ratio; /* */ + uint32_t time_guard; /* */ +}; + + +struct _iso7816_desc { + const struct _pin pin_stop; + const struct _pin pin_mod_vcc; + const struct _pin pin_rst; + + Usart* addr; + uint8_t id; +}; + +/*------------------------------------------------------------------------------ + * Exported functions + *----------------------------------------------------------------------------*/ + +extern void iso7816_icc_power_off(const struct _pin* pinrst); +extern uint16_t iso7816_xfr_block_TPDU_T0(const struct _iso7816_desc* iso7816, const uint8_t* pAPDU, uint8_t* pMessage, uint16_t length); +extern void iso7816_escape(void); +extern void iso7816_restart_clock(struct _iso7816_desc* iso7816); +extern void iso7816_stop_clock(struct _iso7816_desc* iso7816); +extern void iso7816_to_APDU(void); +extern void iso7816_get_data_block_ATR(struct _iso7816_desc* iso7816, uint8_t * pAtr, uint8_t * plength); +extern void iso7816_set_data_rate_and_clock_frequency(struct _iso7816_desc* iso7816, uint32_t clock_frequency, uint32_t data_rate); + +extern uint8_t iso7816_get_status_pin_reset(const struct _pin* pinrst); +extern void iso7816_cold_reset(struct _iso7816_desc* iso7816); +extern void iso7816_warm_reset(struct _iso7816_desc* iso7816); +extern void iso7816_decode_ATR(uint8_t * pAtr); + +extern uint8_t iso7816_init(struct _iso7816_desc* iso7816, const struct _iso7816_opt* opt); + + + + +#endif /* ISO7816_4_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.c new file mode 100644 index 000000000..99e1168ef --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.c @@ -0,0 +1,387 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup usart_module Working with USART_LIN + * \section Purpose + * The USART_LIN driver provides the interface to configure and use the USART peripheral in LIN mode.\n + * + * + * For more accurate information, please look at the USART LIN section of the + * Datasheet. + * + * Related files :\n + * \ref usart_lin.c\n + * \ref usart_lin.h\n +*/ + +/** + * \file + * + * Implementation of USART in LIN mode (Universal Synchronous Asynchronous Receiver Transmitter) + * controller. + * + */ +/*----------------------------------------------------------------------------- +* Headers + *---------------------------------------------------------------------------*/ + +#include "chip.h" +#include "compiler.h" + +#include "peripherals/pmc.h" +#include "peripherals/usart.h" +#include "peripherals/usart_lin.h" + +#include "trace.h" +#include "io.h" + +#include +#include + +/*----------------------------------------------------------------------------- +* + *---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void usart_lin_reset_status_bits(Usart *usart) +{ + usart->US_CR = US_CR_RSTSTA; +} + + +uint32_t usart_lin_get_status_register(Usart *usart) +{ + return usart->US_CSR; +} + +void usart_lin_set_mode_master_or_slave (Usart* usart, uint32_t mode_master_or_slave) +{ + /* Set LIN master or slave mode. */ + usart->US_MR = (usart->US_MR & ~US_MR_USART_MODE_Msk) | US_MR_USART_MODE(mode_master_or_slave); +} + +/** + * \brief Abort the current LIN transmission. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_abort_tx(Usart *usart) +{ + usart->US_CR = US_CR_LINABT; +} + +/** + * \brief Send a wakeup signal on the LIN bus. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_send_wakeup_signal(Usart *usart) +{ + usart->US_CR = US_CR_LINWKUP; +} + +/** + * \brief Configure the LIN node action, which should be one of PUBLISH, + * SUBSCRIBE or IGNORE. + * + * \param usart Pointer to a USART instance. + * \param action 0 for PUBLISH, 1 for SUBSCRIBE, 2 for IGNORE. + */ +void usart_lin_set_node_action(Usart *usart, uint8_t action) +{ + usart->US_LINMR = (usart->US_LINMR & ~US_LINMR_NACT_Msk) | (action << US_LINMR_NACT_Pos); +} + +/** + * \brief Disable the parity check during the LIN communication. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_disable_parity(Usart *usart) +{ + usart->US_LINMR |= US_LINMR_PARDIS; +} + +/** + * \brief Enable the parity check during the LIN communication. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_enable_parity(Usart *usart) +{ + usart->US_LINMR &= ~US_LINMR_PARDIS; +} + +/** + * \brief Disable the checksum during the LIN communication. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_disable_checksum(Usart *usart) +{ + usart->US_LINMR |= US_LINMR_CHKDIS; +} + +/** + * \brief Enable the checksum during the LIN communication. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_enable_checksum(Usart *usart) +{ + usart->US_LINMR &= ~US_LINMR_CHKDIS; +} + +/** + * \brief Configure the checksum type during the LIN communication. + * + * \param usart Pointer to a USART instance. + * \param type 0 for LIN 2.0 Enhanced checksum or 1 for LIN 1.3 Classic + * checksum. + */ +void usart_lin_set_checksum_type(Usart *usart, uint8_t type) +{ + usart->US_LINMR = (usart->US_LINMR & ~US_LINMR_CHKTYP) | (type << 4); +} + +/** + * \brief Configure the data length mode during the LIN communication. + * + * \param usart Pointer to a USART instance. + * \param mode Indicate the data length type: 0 if the data length is + * defined by the DLC of LIN mode register or 1 if the data length is defined + * by the bit 5 and 6 of the identifier. + */ +void usart_lin_set_data_len_mode(Usart *usart, uint8_t mode) +{ + usart->US_LINMR = (usart->US_LINMR & ~US_LINMR_DLM) | (mode << 5); +} + +/** + * \brief Disable the frame slot mode during the LIN communication. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_disable_frame_slot(Usart *usart) +{ + usart->US_LINMR |= US_LINMR_FSDIS; +} + +/** + * \brief Enable the frame slot mode during the LIN communication. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_enable_frame_slot(Usart *usart) +{ + usart->US_LINMR &= ~US_LINMR_FSDIS; +} + +/** + * \brief Configure the wakeup signal type during the LIN communication. + * + * \param usart Pointer to a USART instance. + * \param type Indicate the checksum type: 0 if the wakeup signal is a + * LIN 2.0 wakeup signal; 1 if the wakeup signal is a LIN 1.3 wakeup signal. + */ +void usart_lin_set_wakeup_signal_type(Usart *usart, uint8_t type) +{ + usart->US_LINMR = (usart->US_LINMR & ~US_LINMR_WKUPTYP) | (type << 7); +} + +/** + * \brief Configure the response data length if the data length is defined by + * the DLC field during the LIN communication. + * + * \param usart Pointer to a USART instance. + * \param len Indicate the response data length. + */ +void usart_lin_set_frame_data_len(Usart *usart, uint8_t len) +{ + usart->US_LINMR = (usart->US_LINMR & ~US_LINMR_DLC_Msk) | ((len-1) << US_LINMR_DLC_Pos); +} + +/** + * \brief The LIN mode register is not written by the DMAC. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_disable_dmac_mode(Usart *usart) +{ + usart->US_LINMR &= ~US_LINMR_PDCM; +} + +/** + * \brief The LIN mode register (except this flag) is written by the DMAC. + * + * \param usart Pointer to a USART instance. + */ +void usart_lin_enable_dmac_mode(Usart *usart) +{ + usart->US_LINMR |= US_LINMR_PDCM; +} + +/** + * \brief Configure the LIN identifier when USART works in LIN master mode. + * + * \param usart Pointer to a USART instance. + * \param id The identifier to be transmitted. + */ +void usart_lin_set_tx_identifier(Usart *usart, uint8_t id) +{ + usart->US_LINIR = (usart->US_LINIR & ~US_LINIR_IDCHR_Msk) | US_LINIR_IDCHR(id); +} + +/** + * \brief Read the identifier when USART works in LIN mode. + * + * \param usart Pointer to a USART instance. + * + * \return The last identifier received in LIN slave mode or the last + * identifier transmitted in LIN master mode. + */ +uint8_t usart_lin_read_identifier(Usart *usart) +{ + return (usart->US_LINIR & US_LINIR_IDCHR_Msk); +} + +/** + * \brief Get data length. + * + * \param usart Pointer to a USART instance. + * + * \return Data length. + */ +uint8_t usart_lin_get_data_length(Usart *usart) +{ + if (usart->US_LINMR & US_LINMR_DLM) { + uint8_t data_length = 1 << ((usart->US_LINIR >> (US_LINIR_IDCHR_Pos + 4)) & 0x03); + return data_length; + } else { + return ((usart->US_LINMR & US_LINMR_DLC_Msk) >> US_LINMR_DLC_Pos) + 1; + } +} + +/*----------------------------------------------------------------------------- +* Functions if FIFO are used + *---------------------------------------------------------------------------*/ + +#ifdef CONFIG_HAVE_USART_FIFO + +/** + * \brief Reads from USART device input channel until the specified length is + * reached. + * + * \param usart Pointer to an USART instance. + * \param stream Pointer to the receive buffer. + * \param len Size of the receive buffer, in octets. + * + * \return Number of read octets + * + * \warning WORKS ONLY IN LITTLE ENDIAN MODE! + * + * \note The FIFO must be configured before using this function. + * \note In case of a TIMEOUT or a BREAK, a null character is appended to the + * buffer and the returned value should be inferior to \ref len. + */ +uint32_t usart_lin_read_stream(Usart *usart, uint8_t *stream, uint32_t len) +{ + uint8_t* buffer = stream; + uint32_t left = len; + while (left > 0) { + /* Stop reception if a timeout or break occur */ + if ((usart->US_CSR & (US_CSR_TIMEOUT | US_CSR_RXBRK)) != 0) { + *buffer = '\0'; + break; + } + if ((usart->US_CSR & (US_CSR_RXRDY | US_CSR_LINTC)) == 0) continue; + + /* Get FIFO size (in octets) and clamp it */ + uint32_t buf_size = usart_fifo_rx_size(usart); + buf_size = buf_size > left ? left : buf_size; + + /* Fill the buffer with data received */ + while (buf_size) { + readb(&usart->US_RHR, buffer); + buffer ++; + left -= sizeof(uint8_t); + buf_size -= sizeof(uint8_t); + } + } + return len - left; +} + +/** + * \brief Writes given data to USART device output channel until the specified + * length is reached. + * + * \param usart Pointer to an USART instance. + * \param stream Pointer to the data to send. + * \param len Size of the data to send, in octets. + * + * \return Number of written octets + * + * \warning WORKS ONLY IN LITTLE ENDIAN MODE! + * + * \note The FIFO must be configured before using this function. + * \note This function do not wait for the FIFO to be empty. + * \note In case of a TIMEOUT the transmission is aborted and the returned value + * should be inferior to \ref len. + */ +uint32_t usart_lin_write_stream(Usart *usart, uint8_t *stream, uint32_t len) +{ + uint8_t* buffer = stream; + uint32_t left = len; + int32_t fifo_size = get_peripheral_fifo_depth(usart); + if (fifo_size < 0) + return 0; + + while (left > 0) { + if ((usart->US_CSR & US_CSR_TXRDY) == 0) continue; + + /* Get FIFO free size (int octet) and clamp it */ + uint32_t buf_size = fifo_size - usart_fifo_tx_size(usart); + buf_size = buf_size > left ? left : buf_size; + + /* Fill the FIFO with data to send */ + while (buf_size) { + writeb(&usart->US_THR, *buffer); + buffer ++ ; + left -= sizeof(uint8_t); + buf_size -= sizeof(uint8_t); + } + } + return len - left; +} + +#endif + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.h new file mode 100644 index 000000000..5f13a6274 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usart_lin.h @@ -0,0 +1,93 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * This module provides several definitions and methods for using an USART + * peripheral in LIN mode. + * + */ + +#ifndef _USART_LIN_ +#define _USART_LIN_ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "chip.h" + +/*------------------------------------------------------------------------------ + * Definitions + *------------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/*------------------------------------------------------------------------------*/ +/* Exported functions */ +/*------------------------------------------------------------------------------*/ + +extern void usart_lin_reset_status_bits(Usart *usart); +extern uint32_t usart_lin_get_status_register(Usart *usart); +extern void usart_lin_set_mode_master_or_slave (Usart* usart, uint32_t mode_master_or_slave); +extern void usart_lin_abort_tx(Usart *usart); +extern void usart_lin_send_wakeup_signal(Usart *usart); +extern void usart_lin_set_node_action(Usart *usart, uint8_t action); +extern void usart_lin_disable_parity(Usart *usart); +extern void usart_lin_enable_parity(Usart *usart); +extern void usart_lin_disable_checksum(Usart *usart); +extern void usart_lin_enable_checksum(Usart *usart); +extern void usart_lin_set_checksum_type(Usart *usart, uint8_t type); +extern void usart_lin_set_data_len_mode(Usart *usart, uint8_t mode); +extern void usart_lin_disable_frame_slot(Usart *usart); +extern void usart_lin_enable_frame_slot(Usart *usart); +extern void usart_lin_set_wakeup_signal_type(Usart *usart, uint8_t type); +extern void usart_lin_set_frame_data_len(Usart *usart, uint8_t len); +extern void usart_lin_disable_dmac_mode(Usart *usart); +extern void usart_lin_enable_dmac_mode(Usart *usart); +extern void usart_lin_set_tx_identifier(Usart *usart, uint8_t id); +extern uint8_t usart_lin_read_identifier(Usart *usart); +extern uint8_t usart_lin_get_data_length(Usart *usart); + + +#ifdef CONFIG_HAVE_USART_FIFO +extern uint32_t usart_lin_read_stream(Usart *usart, uint8_t *stream, uint32_t len); +extern uint32_t usart_lin_write_stream(Usart *usart, uint8_t *stream, uint32_t len); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* #ifndef _USART_LIN_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.c new file mode 100644 index 000000000..aaf20e45d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.c @@ -0,0 +1,303 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +#include "chip.h" + +#ifdef CONFIG_HAVE_FLEXCOM +#include "peripherals/flexcom.h" +#endif +#include "peripherals/pmc.h" +#include "peripherals/usartd.h" +#include "peripherals/usart.h" +#include "peripherals/xdmac.h" +#include "peripherals/xdmad.h" +#include "peripherals/l2cc.h" + +#include "cortex-a/cp15.h" + +#include "trace.h" +#include "mutex.h" + +#include +#include +#include + +#define USARTD_ATTRIBUTE_MASK (0) +#define USARTD_DMA_THRESHOLD 16 + +static void _usartd_xdmad_callback_wrapper(struct _xdmad_channel* channel, + void* args) +{ + trace_debug("USARTD DMA Transfert Finished\r\n"); + struct _usart_desc* usartd = (struct _usart_desc*) args; + + xdmad_free_channel(channel); + + if (usartd->region_start && usartd->region_end) { + l2cc_invalidate_region(usartd->region_start, + usartd->region_end); + } + + if (usartd && usartd->callback) + usartd->callback(usartd, usartd->cb_args); +} + +static void _usartd_init_dma_read_channel(const struct _usart_desc* desc, + struct _xdmad_channel** channel, + struct _xdmad_cfg* cfg) +{ + assert(cfg); + assert(channel); + + uint32_t id = get_usart_id_from_addr(desc->addr); + + memset(cfg, 0x0, sizeof(*cfg)); + + *channel = + xdmad_allocate_channel(id, XDMAD_PERIPH_MEMORY); + assert(*channel); + + xdmad_prepare_channel(*channel); + cfg->cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_DSYNC_PER2MEM + | XDMAC_CC_MEMSET_NORMAL_MODE + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_DIF_AHB_IF0 + | XDMAC_CC_SIF_AHB_IF1 + | XDMAC_CC_SAM_FIXED_AM; + + cfg->src_addr = (void*)&desc->addr->US_RHR; +} + +static void _usartd_dma_read(const struct _usart_desc* desc, + struct _buffer* buffer) +{ + struct _xdmad_channel* channel = NULL; + struct _xdmad_cfg cfg; + + _usartd_init_dma_read_channel(desc, &channel, &cfg); + + cfg.cfg.bitfield.dam = XDMAC_CC_DAM_INCREMENTED_AM + >> XDMAC_CC_DAM_Pos; + cfg.dest_addr = buffer->data; + cfg.ublock_size = buffer->size; + cfg.block_size = 0; + xdmad_configure_transfer(channel, &cfg, 0, 0); + xdmad_set_callback(channel, _usartd_xdmad_callback_wrapper, + (void*)desc); + + l2cc_clean_region(desc->region_start, desc->region_end); + + xdmad_start_transfer(channel); +} + +static void _usartd_init_dma_write_channel(const struct _usart_desc* desc, + struct _xdmad_channel** channel, + struct _xdmad_cfg* cfg) +{ + assert(cfg); + assert(channel); + + uint32_t id = get_usart_id_from_addr(desc->addr); + + memset(cfg, 0x0, sizeof(*cfg)); + + *channel = + xdmad_allocate_channel(XDMAD_PERIPH_MEMORY, id); + assert(*channel); + + xdmad_prepare_channel(*channel); + cfg->cfg.uint32_value = XDMAC_CC_TYPE_PER_TRAN + | XDMAC_CC_DSYNC_MEM2PER + | XDMAC_CC_MEMSET_NORMAL_MODE + | XDMAC_CC_CSIZE_CHK_1 + | XDMAC_CC_DWIDTH_BYTE + | XDMAC_CC_DIF_AHB_IF1 + | XDMAC_CC_SIF_AHB_IF0 + | XDMAC_CC_DAM_FIXED_AM; + + cfg->dest_addr = (void*)&desc->addr->US_THR; +} + +static void _usartd_dma_write(const struct _usart_desc* desc, + struct _buffer* buffer) +{ + struct _xdmad_channel* channel = NULL; + struct _xdmad_cfg cfg; + + _usartd_init_dma_write_channel(desc, &channel, &cfg); + + cfg.cfg.bitfield.sam = XDMAC_CC_SAM_INCREMENTED_AM + >> XDMAC_CC_SAM_Pos; + cfg.src_addr = buffer->data; + cfg.ublock_size = buffer->size; + cfg.block_size = 0; + xdmad_configure_transfer(channel, &cfg, 0, 0); + xdmad_set_callback(channel, _usartd_xdmad_callback_wrapper, + (void*)desc); + + l2cc_clean_region(desc->region_start, desc->region_end); + + xdmad_start_transfer(channel); +} + +void usartd_configure(struct _usart_desc* desc) +{ + uint32_t id = get_usart_id_from_addr(desc->addr); + assert(id < ID_PERIPH_COUNT); + +#ifdef CONFIG_HAVE_FLEXCOM + Flexcom* flexcom = get_flexcom_addr_from_id(id); + if (flexcom) { + flexcom_select(flexcom, FLEX_MR_OPMODE_USART); + } +#endif + pmc_enable_peripheral(id); + usart_configure(desc->addr, desc->mode, desc->baudrate); + +#ifdef CONFIG_HAVE_USART_FIFO + if (desc->transfert_mode == USARTD_MODE_FIFO) { + uint32_t fifo_size = get_peripheral_fifo_depth(desc->addr); + uint32_t tx_thres = fifo_size >> 1; + uint32_t rx_thres1 = (fifo_size >> 1) + (fifo_size >> 2); + uint32_t rx_thres2 = (fifo_size >> 1) - (fifo_size >> 2); + usart_fifo_configure(desc->addr, tx_thres, rx_thres1, rx_thres2, + US_FMR_RXRDYM_ONE_DATA | US_FMR_TXRDYM_FOUR_DATA); + } +#endif +} + +uint32_t usartd_transfert(struct _usart_desc* desc, struct _buffer* rx, + struct _buffer* tx, usartd_callback_t cb, + void* user_args) +{ + uint32_t i = 0; + + desc->callback = cb; + desc->cb_args = user_args; + + if (mutex_try_lock(&desc->mutex)) { + return USARTD_ERROR_LOCK; + } + + switch (desc->transfert_mode) { + case USARTD_MODE_POLLING: + if (tx) { + for (i = 0; i < tx->size; ++i) { + usart_put_char(desc->addr, tx->data[i]); + } + } + if (rx) { + for (i = 0; i < rx->size; ++i) { + rx->data[i] = usart_get_char(desc->addr); + } + } + mutex_free(&desc->mutex); + if (cb) + cb(desc, user_args); + break; + case USARTD_MODE_DMA: + if (!(rx || tx)) { + return USARTD_ERROR_DUPLEX; + } + + if (tx) { + if (tx->size < USARTD_DMA_THRESHOLD) { + for (i = 0; i < tx->size; ++i) { + usart_put_char(desc->addr, tx->data[i]); + } + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + } else { + desc->region_start = (uint32_t)tx->data; + desc->region_end = desc->region_start + + tx->size; + _usartd_dma_write(desc, tx); + } + } else if (rx) { + if (rx->size < USARTD_DMA_THRESHOLD) { + for (i = 0; i < rx->size; ++i) { + rx->data[i] = usart_get_char(desc->addr); + } + if (cb) + cb(desc, user_args); + mutex_free(&desc->mutex); + } else { + desc->region_start = (uint32_t)rx->data; + desc->region_end = desc->region_start + + rx->size; + _usartd_dma_read(desc, rx); + } + } else { + mutex_free(&desc->mutex); + } + break; +#ifdef CONFIG_HAVE_USART_FIFO + case USARTD_MODE_FIFO: + if (tx) { + usart_write_stream(desc->addr, tx->data, tx->size); + } + if (rx) { + usart_read_stream(desc->addr, rx->data, rx->size); + } + mutex_free(&desc->mutex); + if (cb) + cb(desc, user_args); + break; +#endif + default: + trace_debug("Unkown mode"); + } + + return USARTD_SUCCESS; +} + +void usartd_finish_transfert_callback(struct _usart_desc* desc, + void* user_args) +{ + (void)user_args; + usartd_finish_transfert(desc); +} + +void usartd_finish_transfert(struct _usart_desc* desc) +{ + mutex_free(&desc->mutex); +} + +uint32_t usartd_is_busy(const struct _usart_desc* desc) +{ + return mutex_is_locked(&desc->mutex); +} + +void usartd_wait_transfert(const struct _usart_desc* desc) +{ + while (mutex_is_locked(&desc->mutex)); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.h new file mode 100644 index 000000000..374d1f858 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/usartd.h @@ -0,0 +1,77 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 USARTD_HEADER__ +#define USARTD_HEADER__ + +#include "mutex.h" +#include "io.h" + +#define USARTD_SUCCESS (0) +#define USARTD_INVALID_ID (1) +#define USARTD_INVALID_BITRATE (2) +#define USARTD_ERROR_LOCK (3) +#define USARTD_ERROR_DUPLEX (4) + +struct _usart_desc; + +typedef void (*usartd_callback_t)(struct _usart_desc* spid, void* args); + +struct _usart_desc +{ + Usart* addr; + uint32_t mode; + uint32_t baudrate; + uint8_t transfert_mode; + /* implicit internal padding is mandatory here */ + mutex_t mutex; + uint32_t region_start; + uint32_t region_end; + usartd_callback_t callback; + void* cb_args; +}; + +enum _usartd_trans_mode +{ + USARTD_MODE_POLLING, + USARTD_MODE_FIFO, + USARTD_MODE_DMA +}; + +extern void usartd_configure(struct _usart_desc* desc); +extern uint32_t usartd_transfert(struct _usart_desc* desc, struct _buffer* rx, + struct _buffer* tx, usartd_callback_t cb, + void* user_args); +extern void usartd_finish_transfert_callback(struct _usart_desc* desc, + void* user_args); +extern void usartd_finish_transfert(struct _usart_desc* desc); +extern uint32_t usartd_is_busy(const struct _usart_desc* desc); +extern void usartd_wait_transfert(const struct _usart_desc* desc); + +#endif /* USARTD_HEADER__ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.c new file mode 100644 index 000000000..802e3d34f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.c @@ -0,0 +1,121 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Implementation of Watchdog Timer (WDT) controller. + * + */ + +/** \addtogroup wdt_module Working with WDT + * \section Purpose + * The WDT driver provides the interface to configure and use the WDT + * peripheral. + * + * The WDT can be used to prevent system lock-up if the software becomes + * trapped in a deadlock. It can generate a general reset or a processor + * reset only. It is clocked by slow clock divided by 128. + * + * The WDT is running at reset with 16 seconds watchdog period (slow clock at 32.768 kHz) + * and external reset generation enabled. The user must either disable it or + * reprogram it to meet the application requires. + * + * \section Usage + * To use the WDT, the user could follow these few steps: + *
    + *
  • Enable watchdog with given mode using \ref wdt_enable(). + *
  • Restart the watchdog using \ref wdt_restart() within the watchdog period. + *
+ * + * For more accurate information, please look at the WDT section of the + * Datasheet. + * + * \note + * The Watchdog Mode Register (WDT_MR) can be written only once.\n + * + * Related files :\n + * \ref wdt.c\n + * \ref wdt.h.\n + */ +/*@{*/ +/*@}*/ + +/*--------------------------------------------------------------------------- + * Headers + *---------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/pmc.h" +#include "peripherals/wdt.h" +#include + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static uint32_t _wdt_compute_period(uint32_t period) +{ + uint32_t value = period * (pmc_get_slow_clock() >> 7) / 1000; + if (value > 0xfff) + value = 0xfff; + return value; +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void wdt_enable(uint32_t mode, uint32_t delta, uint32_t counter) +{ + WDT->WDT_MR = (mode & ~(WDT_MR_WDDIS | WDT_MR_WDD_Msk | WDT_MR_WDV_Msk)) | + WDT_MR_WDD(_wdt_compute_period(delta)) | + WDT_MR_WDV(_wdt_compute_period(counter)); +} + +void wdt_disable(void) +{ + WDT->WDT_MR = WDT_MR_WDDIS; +} + +void wdt_restart() +{ + WDT->WDT_CR = WDT_CR_KEY_PASSWD | WDT_CR_WDRSTT; +} + +uint32_t wdt_get_status(void) +{ + return WDT->WDT_SR & (WDT_SR_WDUNF | WDT_SR_WDERR); +} + +uint32_t wdt_get_counter_value(void) +{ + return (WDT->WDT_MR & WDT_MR_WDV_Msk) >> WDT_MR_WDV_Pos; +} + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.h new file mode 100644 index 000000000..b8236e701 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/wdt.h @@ -0,0 +1,101 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * Interface for Watchdog Timer (WDT) controller. + * + * \section Usage + * -# Enable watchdog with given mode using \ref wdt_enable(). + * -# Disable watchdog using \ref wdt_disable() + * -# Restart the watchdog using \ref wdt_restart(). + * -# Get watchdog status using \ref wdt_get_status(). + */ + +#ifndef _WDT_H_ +#define _WDT_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + + +/** + * \brief Enable watchdog with given mode. + * + * \note The Watchdog Mode Register (WDT_MR) can be written only once. + * Only a processor reset resets it. + * + * \param mode WDT mode to be set + * \param delta WDT delta value + * \param counter WDT counter value + */ +extern void wdt_enable(uint32_t mode, uint32_t delta, uint32_t counter); + +/** + * \brief Disable watchdog. + * + * \note The Watchdog Mode Register (WDT_MR) can be written only once. + * Only a processor reset resets it. + */ +extern void wdt_disable(void); + +/** + * \brief Watchdog restart. + */ +extern void wdt_restart(void); + +/** + * \brief Watchdog get status. + */ +extern uint32_t wdt_get_status(void); + +/** + * \brief Watchdog get counter value. + */ +extern uint32_t wdt_get_counter_value(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _WDT_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.c new file mode 100644 index 000000000..bee883538 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.c @@ -0,0 +1,365 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Implementation of xDMA controller (XDMAC). + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/xdmac.h" + +#include +#include "compiler.h" + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +Xdmac *xdmac_get_instance(uint32_t index) +{ + assert(index < XDMAC_CONTROLLERS); + if (index == 0) + return XDMAC0; + else if (index == 1) + return XDMAC1; + else + return NULL; +} + +uint32_t xdmac_get_periph_id(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + if (xdmac == XDMAC0) + return ID_XDMAC0; + else if (xdmac == XDMAC1) + return ID_XDMAC1; + else + return ID_PERIPH_COUNT; +} + +uint32_t xdmac_get_type(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GTYPE; +} + +uint32_t xdmac_get_config(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GCFG; +} + +uint32_t xdmac_get_arbiter(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GWAC; +} + +void xdmac_enable_global_it(Xdmac *xdmac, uint32_t int_mask) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + xdmac->XDMAC_GIE = int_mask; +} + +void xdmac_disable_global_it(Xdmac *xdmac, uint32_t int_mask) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + xdmac->XDMAC_GID = int_mask; +} + +uint32_t xdmac_get_global_it_mask(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GIM; +} + +uint32_t xdmac_get_global_isr(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GIS; +} + +uint32_t xdmac_get_masked_global_isr(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + uint32_t mask = xdmac->XDMAC_GIM; + + return xdmac->XDMAC_GIS & mask; +} + +void xdmac_enable_channel(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GE |= XDMAC_GE_EN0 << channel; +} + +void xdmac_enable_channels(Xdmac *xdmac, uint8_t channel_mask) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + xdmac->XDMAC_GE = channel_mask; +} + +void xdmac_disable_channel(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GD |= XDMAC_GD_DI0 << channel; +} + +void xdmac_disable_channels(Xdmac *xdmac, uint8_t channel_mask) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + xdmac->XDMAC_GD = channel_mask; +} + +uint32_t xdmac_get_global_channel_status(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GS; +} + +void xdmac_suspend_read_channel(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GRS |= XDMAC_GRS_RS0 << channel; +} + +void xdmac_suspend_write_channel(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GWS |= XDMAC_GWS_WS0 << channel; +} + +void xdmac_suspend_read_write_channel(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GRWS |= XDMAC_GRWS_RWS0 << channel; +} + +void xdmac_resume_read_write_channel(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GRWR |= XDMAC_GRWR_RWR0 << channel; +} + +void xdmac_software_transfer_request(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GSWR |= (XDMAC_GSWR_SWREQ0 << channel); +} + +uint32_t xdmac_get_software_transfer_status(Xdmac *xdmac) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + + return xdmac->XDMAC_GSWS; +} + +void xdmac_software_flush_request(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_GSWF |= XDMAC_GSWF_SWF0 << channel; +} + +void xdmac_enable_channel_it(Xdmac *xdmac, uint8_t channel, uint32_t int_mask) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CIE = int_mask; +} + +void xdmac_disable_channel_it(Xdmac *xdmac, uint8_t channel, uint32_t int_mask) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CID = int_mask; +} + +uint32_t xdmac_get_channel_it_mask(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + return xdmac->XDMAC_CHID[channel].XDMAC_CIM; +} + +uint32_t xdmac_get_channel_isr(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + return xdmac->XDMAC_CHID[channel].XDMAC_CIS; +} + +uint32_t xdmac_get_masked_channel_isr(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + uint32_t mask = xdmac->XDMAC_CHID[channel].XDMAC_CIM; + + return xdmac->XDMAC_CHID[channel].XDMAC_CIS & mask; +} + +void xdmac_set_src_addr(Xdmac *xdmac, uint8_t channel, void *addr) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CSA = (uint32_t)addr; +} + +void xdmac_set_dest_addr(Xdmac *xdmac, uint8_t channel, void *addr) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CDA = (uint32_t)addr; +} + +void xdmac_set_descriptor_addr(Xdmac *xdmac, uint8_t channel, void *addr, + uint32_t ndaif) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CNDA = (((uint32_t)addr) & 0xFFFFFFFC) | ndaif; +} + +void xdmac_set_descriptor_control(Xdmac *xdmac, uint8_t channel, + uint32_t config) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CNDC = config; +} + +void xdmac_set_microblock_control(Xdmac *xdmac, uint8_t channel, + uint32_t ublen) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CUBC = ublen; +} + +void xdmac_set_block_control(Xdmac *xdmac, uint8_t channel, uint32_t blen) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CBC = blen; +} + +void xdmac_set_channel_config(Xdmac *xdmac, uint8_t channel, uint32_t config) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CC = config; +} + +uint32_t xdmac_get_channel_config(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + return xdmac->XDMAC_CHID[channel].XDMAC_CC; +} + +void xdmac_set_data_stride_mem_pattern(Xdmac *xdmac, uint8_t channel, + uint32_t dds_msp) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CDS_MSP = dds_msp; +} + +void xdmac_set_src_microblock_stride(Xdmac *xdmac, uint8_t channel, + uint32_t subs) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CSUS = subs; +} + +void xdmac_set_dest_microblock_stride(Xdmac *xdmac, uint8_t channel, + uint32_t dubs) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + xdmac->XDMAC_CHID[channel].XDMAC_CDUS = dubs; +} + +uint32_t xdmac_get_channel_dest_addr(Xdmac *xdmac, uint8_t channel) +{ + assert(xdmac == XDMAC0 || xdmac == XDMAC1); + assert(channel < XDMAC_CHANNELS); + + return xdmac->XDMAC_CHID[channel].XDMAC_CDA; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.h new file mode 100644 index 000000000..c9300a170 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmac.h @@ -0,0 +1,440 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/** \addtogroup dmac_module Working with DMAC + * + * \section Usage + *
    + *
  • Enable or disable DMAC channel with XDMAC_EnableChannel() and XDMAC_EnableChannels() or XDMAC_DisableChannel() and XDMAC_DisableChannels().
  • + *
  • Enable or disable %DMA interrupt using XDMAC_EnableGIt() and XDMAC_EnableChannelIt() or XDMAC_DisableGIt() and XDMAC_DisableChannelIt().
  • + *
  • Get %DMA interrupt status by XDMAC_GetChannelIsr() and XDMAC_GetMaskChannelIsr().
  • + *
  • Enable or disable specified %DMA channel with XDMAC_EnableChannel() or XDMAC_DisableChannel().
  • + *
  • Suspend or resume specified %DMA channel with XDMAC_SuspendReadChannel(), XDMAC_SuspendWriteChannel() and XDMAC_SuspendReadWriteChannel() or XDMAC_ResumeReadWriteChannel().
  • + *
  • Get %DMA channel status by XDMAC_GetGlobalChStatus().
  • + *
  • Configure source and/or destination start address with XDMAC_SetSourceAddr() and/or XDMAC_SetDestinationAddr().
  • + *
  • Set %DMA descriptor address using XDMAC_SetDescriptorAddr().
  • + *
  • Set source transfer buffer size with XDMAC_SetMicroblockControl() or XDMAC_SetBlockControl().
  • + *
  • Configure source and destination memory pattern with XDMAC_SetDataStride_MemPattern().
  • + *
  • Configure source or destination Microblock stride with XDMAC_SetSourceMicroBlockStride() or XDMAC_SetDestinationMicroBlockStride().
  • + *
+ * + * For more accurate information, please look at the DMAC section of the + * Datasheet. + * + * \sa \ref dmad_module + * + * Related files :\n + * \ref xdmac.c\n + * \ref xdmac.h\n + * + */ + +#ifndef _XDMAC_H_ +#define _XDMAC_H_ + +/**@{*/ + +/*------------------------------------------------------------------------------ + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include + +/*------------------------------------------------------------------------------ + * Definitions + *----------------------------------------------------------------------------*/ + +/** \addtogroup dmac_defines DMAC Definitions + * @{ + */ + +/** Number of DMA channels */ +#define XDMAC_CONTROLLERS 2 + +/** Number of DMA channels */ +#define XDMAC_CHANNELS (XDMACCHID_NUMBER) + +/** Max DMA single transfer size */ +#define XDMAC_MAX_BT_SIZE 0xFFFF + +/** @}*/ + +/*---------------------------------------------------------------------------- + * Macro + *----------------------------------------------------------------------------*/ +#define XDMA_GET_DATASIZE(size) ((size==0)? XDMAC_CC_DWIDTH_BYTE : \ + ((size==1)? XDMAC_CC_DWIDTH_HALFWORD : \ + ((size==2)? XDMAC_CC_DWIDTH_WORD : XDMAC_CC_DWIDTH_DWORD ))) +#define XDMA_GET_CC_SAM(s) ((s==0)? XDMAC_CC_SAM_FIXED_AM : \ + ((s==1)? XDMAC_CC_SAM_INCREMENTED_AM : \ + ((s==2)? XDMAC_CC_SAM_UBS_AM : XDMAC_CC_SAM_UBS_DS_AM ))) +#define XDMA_GET_CC_DAM(d) ((d==0)? XDMAC_CC_DAM_FIXED_AM : \ + ((d==1)? XDMAC_CC_DAM_INCREMENTED_AM : \ + ((d==2)? XDMAC_CC_DAM_UBS_AM : XDMAC_CC_DAM_UBS_DS_AM ))) +#define XDMA_GET_CC_MEMSET(m) ((m==0)? XDMAC_CC_MEMSET_NORMAL_MODE : XDMAC_CC_MEMSET_HW_MODE) + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +/** \addtogroup dmac_functions XDMAC Functions + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Enable the XDMAC peripheral clock + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern Xdmac *xdmac_get_instance(uint32_t index); + +/** + * \brief Get the XDMAC peripheral ID for a given XDMAC instance + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_periph_id(Xdmac *xdmac); + +/** + * \brief Get XDMAC global type. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_type(Xdmac *xdmac); + +/** + * \brief Get XDMAC global configuration. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_config(Xdmac *xdmac); + +/** + * \brief Get XDMAC global weighted arbiter configuration. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_arbiter(Xdmac *xdmac); + +/** + * \brief Enables XDMAC global interrupt. + * + * \param xdmac Pointer to the XDMAC instance. + * \param int_mask IT to be enabled. + */ +extern void xdmac_enable_global_it(Xdmac *xdmac, uint32_t int_mask); + +/** + * \brief Disables XDMAC global interrupt + * + * \param xdmac Pointer to the XDMAC instance. + * \param int_mask IT to be enabled + */ +extern void xdmac_disable_global_it(Xdmac *xdmac, uint32_t int_mask); + +/** + * \brief Get XDMAC global interrupt mask. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_global_it_mask(Xdmac *xdmac); + +/** + * \brief Get XDMAC global interrupt status. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_global_isr(Xdmac *xdmac); + +/** + * \brief Get XDMAC masked global interrupt. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_masked_global_isr(Xdmac *xdmac); + +/** + * \brief enables the relevant channel of given XDMAC. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_enable_channel(Xdmac *xdmac, uint8_t channel); + +/** + * \brief enables the relevant channels of given XDMAC. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel_mask Channels bitmap. + */ +extern void xdmac_enable_channels(Xdmac *xdmac, uint8_t channel_mask); + +/** + * \brief Disables the relevant channel of given XDMAC. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_disable_channel(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Disables the relevant channels of given XDMAC. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel_mask Channels bitmap. + */ +extern void xdmac_disable_channels(Xdmac *xdmac, uint8_t channel_mask); + +/** + * \brief Get Global channel status of given XDMAC. + * \note: When set to 1, this bit indicates that the channel x is enabled. If a channel disable request is issued, this bit remains asserted + until pending transaction is completed. + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_global_channel_status(Xdmac *xdmac); + +/** + * \brief Suspend the relevant channel's read. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_suspend_read_channel(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Suspend the relevant channel's write. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_suspend_write_channel(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Suspend the relevant channel's read & write. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_suspend_read_write_channel(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Resume the relevant channel's read & write. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_resume_read_write_channel(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Set software transfer request on the relevant channel. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_software_transfer_request(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Get software transfer status of the relevant channel. + * + * \param xdmac Pointer to the XDMAC instance. + */ +extern uint32_t xdmac_get_software_transfer_status(Xdmac *xdmac); + +/** + * \brief Set software flush request on the relevant channel. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern void xdmac_software_flush_request(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Disable interrupt with mask on the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param int_mask Interrupt mask. + */ +extern void xdmac_enable_channel_it(Xdmac *xdmac, uint8_t channel, uint32_t int_mask); + +/** + * \brief Enable interrupt with mask on the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param int_mask Interrupt mask. + */ +extern void xdmac_disable_channel_it(Xdmac *xdmac, uint8_t channel, uint32_t int_mask); + +/** + * \brief Get interrupt mask for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern uint32_t xdmac_get_channel_it_mask(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Get interrupt status for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern uint32_t xdmac_get_channel_isr(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Get masked interrupt status for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern uint32_t xdmac_get_masked_channel_isr(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Set source address for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param addr Source address. + */ +extern void xdmac_set_src_addr(Xdmac *xdmac, uint8_t channel, void *addr); + +/** + * \brief Set destination address for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param addr Destination address. + */ +extern void xdmac_set_dest_addr(Xdmac *xdmac, uint8_t channel, void *addr); + +/** + * \brief Set next descriptor's address & interface for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param addr Address of next descriptor. + * \param nda Next Descriptor Interface. + */ +extern void xdmac_set_descriptor_addr(Xdmac *xdmac, uint8_t channel, void *addr, uint32_t ndaif); + +/** + * \brief Set next descriptor's configuration for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param config Configuration of next descriptor. + */ +extern void xdmac_set_descriptor_control(Xdmac *xdmac, uint8_t channel, uint32_t config); + +/** + * \brief Set microblock length for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param ublen Microblock length. + */ +extern void xdmac_set_microblock_control(Xdmac *xdmac, uint8_t channel, uint32_t ublen); + +/** + * \brief Set block length for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param blen Block length. + */ +extern void xdmac_set_block_control(Xdmac *xdmac, uint8_t channel, uint32_t blen); + +/** + * \brief Set configuration for the relevant channel of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param config Channel configuration. + */ +extern void xdmac_set_channel_config(Xdmac *xdmac, uint8_t channel, uint32_t config); + +/** + * \brief Get the relevant channel's configuration of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern uint32_t xdmac_get_channel_config(Xdmac *xdmac, uint8_t channel); + +/** + * \brief Set the relevant channel's data stride memory pattern of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param dds_msp Data stride memory pattern. + */ +extern void xdmac_set_data_stride_mem_pattern(Xdmac *xdmac, uint8_t channel, + uint32_t dds_msp); + +/** + * \brief Set the relevant channel's source microblock stride of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param subs Source microblock stride. + */ +extern void xdmac_set_src_microblock_stride(Xdmac *xdmac, uint8_t channel, uint32_t subs); + +/** + * \brief Set the relevant channel's destination microblock stride of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + * \param dubs Destination microblock stride. + */ +extern void xdmac_set_dest_microblock_stride(Xdmac *xdmac, uint8_t channel, uint32_t dubs); + +/** + * \brief Get the relevant channel's destination address of given XDMA. + * + * \param xdmac Pointer to the XDMAC instance. + * \param channel Particular channel number. + */ +extern uint32_t xdmac_get_channel_dest_addr(Xdmac *xdmac, uint8_t channel); + +#ifdef __cplusplus +} +#endif + +/** @}*//**@}*/ + +#endif /* _XDMAC_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.c new file mode 100644 index 000000000..9d651e800 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.c @@ -0,0 +1,420 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup xdmad_module + * + * \section Xdma xDma Configuration Usage + * + * To configure a XDMA channel, the user has to follow these few steps : + *
    + *
  • Initialize a XDMA driver instance by XDMAD_Initialize().
  • + *
  • choose an available (disabled) channel using XDMAD_AllocateChannel().
  • + *
  • After the XDMAC selected channel has been programmed, XDMAD_PrepareChannel() is to enable + * clock and dma peripheral of the DMA, and set Configuration register to set up the transfer type + * (memory or non-memory peripheral for source and destination) and flow control device.
  • + *
  • Invoke XDMAD_StartTransfer() to start DMA transfer or XDMAD_StopTransfer() to force stop DMA transfer.
  • + *
  • Once the buffer of data is transferred, XDMAD_IsTransferDone() checks if DMA transfer is finished.
  • + *
  • XDMAD_Handler() handles XDMA interrupt, and invoking XDMAD_SetCallback() if provided.
  • + *
+ * + * Related files:\n + * \ref xdmad.h\n + * \ref xdmad.c\n + */ + +/** \file */ + +/** \addtogroup dmad_functions + @{*/ + +/*---------------------------------------------------------------------------- + * Includes + *----------------------------------------------------------------------------*/ + +#include "peripherals/aic.h" +#include "peripherals/pmc.h" +#include "peripherals/xdmad.h" + +#include +#include "compiler.h" + +/*---------------------------------------------------------------------------- + * Local definitions + *----------------------------------------------------------------------------*/ + +#define XDMAD_CHANNELS (XDMAC_CONTROLLERS * XDMAC_CHANNELS) + +/** DMA state for channel */ +enum { + XDMAD_STATE_FREE = 0, /**< Free channel */ + XDMAD_STATE_ALLOCATED, /**< Allocated to some peripheral */ + XDMAD_STATE_STARTED, /**< DMA started */ + XDMAD_STATE_DONE, /**< DMA transfer done */ +}; + +/** DMA driver channel */ +struct _xdmad_channel +{ + Xdmac *xdmac; /**< XDMAC instance */ + uint32_t id; /**< Channel ID */ + xdmad_callback_t callback; /**< Callback */ + void *user_arg; /**< Callback argument */ + uint8_t src_txif; /**< Source TX Interface ID */ + uint8_t src_rxif; /**< Source RX Interface ID */ + uint8_t dest_txif; /**< Destination TX Interface ID */ + uint8_t dest_rxif; /**< Destination RX Interface ID */ + volatile uint8_t state; /**< Channel State */ +}; + +/** DMA driver instance */ +struct _xdmad { + struct _xdmad_channel channels[XDMAD_CHANNELS]; + bool polling; + uint8_t polling_timeout; +}; + +static struct _xdmad _xdmad; + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +static inline struct _xdmad_channel *_xdmad_channel(uint32_t controller, uint32_t channel) +{ + return &_xdmad.channels[controller * XDMAC_CHANNELS + channel]; +} + +/** + * \brief xDMA interrupt handler + * \param pXdmad Pointer to DMA driver instance. + */ +static void xdmad_handler(void) +{ + uint32_t cont; + + for (cont= 0; cont< XDMAC_CONTROLLERS; cont++) { + uint32_t chan, gis, gcs; + + Xdmac *xdmac = xdmac_get_instance(cont); + + gis = xdmac_get_global_isr(xdmac); + if ((gis & 0xFFFF) == 0) + continue; + + gcs = xdmac_get_global_channel_status(xdmac); + for (chan = 0; chan < XDMAC_CHANNELS; chan++) { + struct _xdmad_channel *channel; + bool exec = false; + + if (!(gis & (1 << chan))) + continue; + + channel = _xdmad_channel(cont, chan); + if (channel->state == XDMAD_STATE_FREE) + continue; + + if (!(gcs & (1 << chan))) { + uint32_t cis = xdmac_get_channel_isr(xdmac, chan); + + if (cis & XDMAC_CIS_BIS) { + if (!(xdmac_get_channel_it_mask(xdmac, chan) & XDMAC_CIM_LIM)) { + channel->state = XDMAD_STATE_DONE; + exec = 1; + } + } + + if (cis & XDMAC_CIS_LIS) { + channel->state = XDMAD_STATE_DONE; + exec = 1; + } + + if (cis & XDMAC_CIS_DIS) { + channel->state = XDMAD_STATE_DONE; + exec = 1; + } + } + + /* Execute callback */ + if (exec && channel->callback) { + channel->callback(channel, channel->user_arg); + } + } + } +} + + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void xdmad_initialize(bool polling) +{ + uint32_t cont, chan; + + _xdmad.polling = polling; + + for (cont = 0; cont < XDMAC_CONTROLLERS; cont++) { + Xdmac* xdmac = xdmac_get_instance(cont); + for (chan = 0; chan < XDMAC_CHANNELS; chan++) { + xdmac_get_channel_isr(xdmac, chan); + struct _xdmad_channel *channel = _xdmad_channel(cont, chan); + channel->xdmac = xdmac; + channel->id = chan; + channel->callback = 0; + channel->user_arg = 0; + channel->src_txif = 0; + channel->src_rxif = 0; + channel->dest_txif = 0; + channel->dest_rxif = 0; + channel->state = XDMAD_STATE_FREE; + } + + if (!polling) { + uint32_t pid = xdmac_get_periph_id(xdmac); + /* enable interrupts */ + aic_set_source_vector(pid, xdmad_handler); + aic_enable(pid); + } + } +} + +void xdmad_poll(void) +{ + if (_xdmad.polling) + xdmad_handler(); +} + +struct _xdmad_channel *xdmad_allocate_channel(uint8_t src, uint8_t dest) +{ + uint32_t i; + + /* Reject peripheral to peripheral transfers */ + if (src != XDMAD_PERIPH_MEMORY && dest != XDMAD_PERIPH_MEMORY) { + return NULL; + } + + for (i = 0; i < XDMAD_CHANNELS; i++) { + struct _xdmad_channel *channel = &_xdmad.channels[i]; + Xdmac *xdmac = channel->xdmac; + + if (channel->state == XDMAD_STATE_FREE) { + /* Check if source peripheral matches this channel controller */ + if (src != XDMAD_PERIPH_MEMORY) + if (!is_peripheral_on_xdma_controller(src, xdmac)) + continue; + + /* Check if destination peripheral matches this channel controller */ + if (dest != XDMAD_PERIPH_MEMORY) + if (!is_peripheral_on_xdma_controller(dest, xdmac)) + continue; + + /* Allocate the channel */ + channel->state = XDMAD_STATE_ALLOCATED; + channel->src_txif = get_peripheral_xdma_channel(src, xdmac, true); + channel->src_rxif = get_peripheral_xdma_channel(src, xdmac, false); + channel->dest_txif = get_peripheral_xdma_channel(dest, xdmac, true); + channel->dest_rxif = get_peripheral_xdma_channel(dest, xdmac, false); + + return channel; + } + } + return NULL; +} + +uint32_t xdmad_free_channel(struct _xdmad_channel *channel) +{ + switch (channel->state) { + case XDMAD_STATE_STARTED: + return XDMAD_BUSY; + case XDMAD_STATE_ALLOCATED: + case XDMAD_STATE_DONE: + channel->state = XDMAD_STATE_FREE; + break; + } + return XDMAD_OK; +} + +uint32_t xdmad_set_callback(struct _xdmad_channel *channel, + xdmad_callback_t callback, void *user_arg) +{ + if (channel->state == XDMAD_STATE_FREE) + return XDMAD_ERROR; + else if (channel->state == XDMAD_STATE_STARTED) + return XDMAD_BUSY; + + channel->callback = callback; + channel->user_arg = user_arg; + + return XDMAD_OK; +} + +uint32_t xdmad_prepare_channel(struct _xdmad_channel *channel) +{ + Xdmac *xdmac = channel->xdmac; + + if (channel->state == XDMAD_STATE_FREE) + return XDMAD_ERROR; + else if (channel->state == XDMAD_STATE_STARTED) + return XDMAD_BUSY; + + /* Clear status */ + xdmac_get_global_channel_status(xdmac); + xdmac_get_global_isr(xdmac); + + /* Enable clock of the DMA peripheral */ + pmc_enable_peripheral(xdmac_get_periph_id(xdmac)); + + /* Clear status */ + xdmac_get_channel_isr(xdmac, channel->id); + + /* Disables XDMAC interrupt for the given channel */ + xdmac_disable_global_it(xdmac, -1); + xdmac_disable_channel_it(xdmac, channel->id, -1); + + /* Disable the given dma channel */ + xdmac_disable_channel(xdmac, channel->id); + xdmac_set_src_addr(xdmac, channel->id, 0); + xdmac_set_dest_addr(xdmac, channel->id, 0); + xdmac_set_block_control(xdmac, channel->id, 0); + xdmac_set_channel_config(xdmac, channel->id, XDMAC_CC_PROT_UNSEC); + xdmac_set_descriptor_addr(xdmac, channel->id, 0, 0); + xdmac_set_descriptor_control(xdmac, channel->id, 0); + + return XDMAD_OK; +} + +bool xdmad_is_transfer_done(struct _xdmad_channel *channel) +{ + return channel->state != XDMAD_STATE_STARTED; +} + +uint32_t xdmad_configure_transfer(struct _xdmad_channel *channel, + struct _xdmad_cfg *cfg, + uint32_t desc_cntrl, + void *desc_addr) +{ + if (channel->state == XDMAD_STATE_FREE) + return XDMAD_ERROR; + else if (channel->state == XDMAD_STATE_STARTED) + return XDMAD_BUSY; + + Xdmac *xdmac = channel->xdmac; + + if (cfg->cfg.bitfield.dsync == XDMAC_CC_DSYNC_PER2MEM) { + cfg->cfg.bitfield.perid = channel->src_rxif; + } else { + cfg->cfg.bitfield.perid = channel->dest_txif; + } + + /* Clear status */ + xdmac_get_global_isr(xdmac); + xdmac_get_channel_isr(xdmac, channel->id); + + if ((desc_cntrl & XDMAC_CNDC_NDE) == XDMAC_CNDC_NDE_DSCR_FETCH_EN) { + /* Linked List is enabled */ + if ((desc_cntrl & XDMAC_CNDC_NDVIEW_Msk) + == XDMAC_CNDC_NDVIEW_NDV0) { + xdmac_set_channel_config(xdmac, channel->id, + cfg->cfg.uint32_value); + xdmac_set_src_addr(xdmac, channel->id, cfg->src_addr); + xdmac_set_dest_addr(xdmac, channel->id, cfg->dest_addr); + } + else if ((desc_cntrl & XDMAC_CNDC_NDVIEW_Msk) + == XDMAC_CNDC_NDVIEW_NDV1) { + xdmac_set_channel_config(xdmac, channel->id, + cfg->cfg.uint32_value); + } + xdmac_set_descriptor_addr(xdmac, channel->id, desc_addr, 0); + xdmac_set_descriptor_control(xdmac, channel->id, desc_cntrl); + xdmac_disable_channel_it(xdmac, channel->id, -1); + xdmac_enable_channel_it(xdmac, channel->id, XDMAC_CIE_LIE); + } else { + /* Linked List is disabled. */ + xdmac_set_src_addr(xdmac, channel->id, cfg->src_addr); + xdmac_set_dest_addr(xdmac, channel->id, cfg->dest_addr); + xdmac_set_microblock_control(xdmac, channel->id, cfg->ublock_size); + xdmac_set_block_control(xdmac, channel->id, + cfg->block_size > 1 ? cfg->block_size : 0); + xdmac_set_data_stride_mem_pattern(xdmac, channel->id, + cfg->data_stride); + xdmac_set_src_microblock_stride(xdmac, channel->id, + cfg->src_ublock_stride); + xdmac_set_dest_microblock_stride(xdmac, channel->id, + cfg->dest_ublock_stride); + xdmac_set_channel_config(xdmac, channel->id, cfg->cfg.uint32_value); + xdmac_set_descriptor_addr(xdmac, channel->id, 0, 0); + xdmac_set_descriptor_control(xdmac, channel->id, 0); + xdmac_enable_channel_it(xdmac, channel->id, + XDMAC_CIE_BIE | XDMAC_CIE_DIE | + XDMAC_CIE_FIE | XDMAC_CIE_RBIE | + XDMAC_CIE_WBIE | XDMAC_CIE_ROIE); + } + return XDMAD_OK; +} + +uint32_t xdmad_start_transfer(struct _xdmad_channel *channel) +{ + if (channel->state == XDMAD_STATE_FREE) + return XDMAD_ERROR; + else if (channel->state == XDMAD_STATE_STARTED) + return XDMAD_BUSY; + + /* Change state to 'started' */ + channel->state = XDMAD_STATE_STARTED; + + /* Start DMA transfer */ + xdmac_enable_channel(channel->xdmac, channel->id); + if (!_xdmad.polling) { + xdmac_enable_global_it(channel->xdmac, 1 << channel->id); + } + + return XDMAD_OK; +} + +uint32_t xdmad_stop_transfer(struct _xdmad_channel *channel) +{ + Xdmac *xdmac = channel->xdmac; + + /* Disable channel */ + xdmac_disable_channel(xdmac, channel->id); + + /* Disable interrupts */ + xdmac_disable_channel_it(xdmac, channel->id, -1); + + /* Clear pending status */ + xdmac_get_channel_isr(xdmac, channel->id); + xdmac_get_global_channel_status(xdmac); + + /* Change state to 'allocated' */ + channel->state = XDMAD_STATE_ALLOCATED; + + return XDMAD_OK; +} + +/**@}*/ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.h new file mode 100644 index 000000000..fbb693ee9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/peripherals/xdmad.h @@ -0,0 +1,260 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _XDMAD_H_ +#define _XDMAD_H_ + +/*---------------------------------------------------------------------------- + * Includes + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "peripherals/xdmac.h" + +#include + +/*---------------------------------------------------------------------------- + * Consts + *----------------------------------------------------------------------------*/ + +/** \addtogroup dmad_defines DMA Driver Defines + @{*/ + +/** Pseudo Peripheral ID for memory transfers */ +#define XDMAD_PERIPH_MEMORY 0xFF + +/* XDMA_MBR_UBC */ + +#define XDMA_UBC_NDE (0x1u << 24) +#define XDMA_UBC_NDE_FETCH_DIS (0x0u << 24) +#define XDMA_UBC_NDE_FETCH_EN (0x1u << 24) + +#define XDMA_UBC_NSEN (0x1u << 25) +#define XDMA_UBC_NSEN_UNCHANGED (0x0u << 25) +#define XDMA_UBC_NSEN_UPDATED (0x1u << 25) + +#define XDMA_UBC_NDEN (0x1u << 26) +#define XDMA_UBC_NDEN_UNCHANGED (0x0u << 26) +#define XDMA_UBC_NDEN_UPDATED (0x1u << 26) + +#define XDMA_UBC_NVIEW_Pos 27 +#define XDMA_UBC_NVIEW_Msk (0x3u << XDMA_UBC_NVIEW_Pos) +#define XDMA_UBC_NVIEW_NDV0 (0x0u << XDMA_UBC_NVIEW_Pos) +#define XDMA_UBC_NVIEW_NDV1 (0x1u << XDMA_UBC_NVIEW_Pos) +#define XDMA_UBC_NVIEW_NDV2 (0x2u << XDMA_UBC_NVIEW_Pos) +#define XDMA_UBC_NVIEW_NDV3 (0x3u << XDMA_UBC_NVIEW_Pos) + +/** @}*/ + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** \addtogroup dmad_structs DMA Driver Structs + @{*/ + +/** DMA status or return code */ +enum { + XDMAD_OK = 0, /**< Operation is sucessful */ + XDMAD_PARTIAL_DONE, + XDMAD_DONE, + XDMAD_BUSY, /**< Channel occupied or transfer not finished */ + XDMAD_ERROR, /**< Operation failed */ + XDMAD_CANCELED /**< Operation canceled */ +}; + +/** DMA channel */ +struct _xdmad_channel; + +/** DMA transfer callback */ +typedef void (*xdmad_callback_t)(struct _xdmad_channel *channel, void *arg); + +union _xdmac_cfg_reg { + uint32_t uint32_value; + struct { + uint32_t type: 1, + mbsize: 2, + dummy1: 1, + dsync: 1, + prot: 1, + sweq: 1, + memset: 1, + csize: 3, + dwidth: 2, + sif: 1, + dif: 1, + dummy2: 1, + sam: 2, + dam: 2, + dummy3: 1, + initd: 1, + rdip: 1, + wrip: 1, + perid: 7; + } bitfield; +}; + +struct _xdmad_cfg { + uint32_t ublock_size; /**< Microblock Size */ + uint32_t block_size; /**< Block Size (number of Microblock) */ + uint32_t data_stride; /**< Data Stride */ + uint32_t src_ublock_stride; /**< Source Microblock Stride */ + uint32_t dest_ublock_stride; /**< Destination Microblock Stride */ + void *src_addr; /**< Source Address */ + void *dest_addr; /**< Destination Address */ + union _xdmac_cfg_reg cfg; /**< Configuration Register */ +}; + +/** Structure for storing parameters for DMA view0 that can be performed by the + * DMA Master transfer.*/ +struct _xdmad_desc_view0 { + void *next_desc; /**< Next Descriptor Address */ + uint32_t ublock_size; /**< Microblock Control */ + uint32_t mbr_ta; /**< Transfer Address */ +}; + +/** Structure for storing parameters for DMA view1 that can be performed by the + * DMA Master transfer.*/ +struct _xdmad_desc_view1 { + void *next_desc; /**< Next Descriptor Address */ + uint32_t ublock_size; /**< Microblock Control */ + void *src_addr; /**< Source Address */ + void *dest_addr; /**< Destination Address */ +}; + +/** Structure for storing parameters for DMA view2 that can be performed by the + * DMA Master transfer.*/ +struct _xdmad_desc_view2 { + void *next_desc; /**< Next Descriptor Address */ + uint32_t ublock_size; /**< Microblock Control */ + void *src_addr; /**< Source Address */ + void *dest_addr; /**< Destination Address */ + union _xdmac_cfg_reg cfg; /**< Configuration Register */ +}; + +/** Structure for storing parameters for DMA view3 that can be performed by the + * DMA Master transfer.*/ +struct _xdmad_desc_view3 { + void *next_desc; /**< Next Descriptor Address */ + uint32_t ublock_size; /**< Microblock Control */ + void *src_addr; /**< Source Address */ + void *dest_addr; /**< Destination Address */ + union _xdmac_cfg_reg cfg; + uint32_t block_size; /**< Block Control */ + uint32_t data_stride; /**< Data Stride */ + uint32_t src_ublock_stride; /**< Source Microblock Stride */ + uint32_t dest_ublock_stride; /**< Destination Microblock Stride */ +}; + +/** @}*/ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ +/** \addtogroup dmad_functions DMA Driver Functionos + @{*/ + +/** + * \brief Initialize DMA driver instance. + * \param polling if true, interrupts will not be configured and xdmad_poll + * must be called to poll for transfer completion + */ +extern void xdmad_initialize(bool polling); + +/** + * \brief Poll for transfers completion. + * If polling mode is enabled, this function will call callbacks for completed + * transfers. If interrupt mode is enabled, this function will do nothing. + */ +extern void xdmad_poll(void); + +/** + * \brief Allocate an DMA channel + * \param src Source peripheral ID, XDMAD_PERIPH_MEMORY for memory. + * \param dest Destination peripheral ID, XDMAD_PERIPH_MEMORY for memory. + * \return Channel pointer if allocation successful, or NULL if channel + * allocation failed. + */ +extern struct _xdmad_channel *xdmad_allocate_channel(uint8_t src, uint8_t dest); + +/** + * \brief Free the specified DMA channel. + * \param channel Channel pointer + */ +extern uint32_t xdmad_free_channel(struct _xdmad_channel *channel); + +/** + * \brief Set the callback function for an DMA channel transfer. + * \param channel Channel pointer + * \param callback Pointer to callback function. + * \param user_arg Pointer to user argument for callback. + */ +extern uint32_t xdmad_set_callback(struct _xdmad_channel *channel, + xdmad_callback_t callback, void *user_arg); + +/** + * \brief Enable clock of the DMA peripheral, Enable the peripheral, + * setup configuration register for transfer. + * \param channel Channel pointer + */ +extern uint32_t xdmad_prepare_channel(struct _xdmad_channel *channel); + +/** + * \brief Configure DMA for a single transfer. + * \param channel Channel pointer + * \param cfg DMA transfer configuration + * \param desc_cntrl optional descriptor control + * \param desc_addr optional descriptor address + */ +extern uint32_t xdmad_configure_transfer(struct _xdmad_channel *channel, + struct _xdmad_cfg *cfg, uint32_t desc_cntrl, void *desc_addr); + +/** + * \brief Start DMA transfer. + * \param channel Channel pointer + */ +extern uint32_t xdmad_start_transfer(struct _xdmad_channel *channel); + +/** + * \brief Check if DMA transfer is finished. + * \param channel Channel pointer + */ +extern bool xdmad_is_transfer_done(struct _xdmad_channel *channel); + +/** + * \brief Stop DMA transfer. + * \param channel Channel pointer + */ +extern uint32_t xdmad_stop_transfer(struct _xdmad_channel *channel); + +/** @}*/ + +/**@}*/ + +#endif /* _XDMAD_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/Makefile.inc new file mode 100644 index 000000000..9c217bf24 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/Makefile.inc @@ -0,0 +1,30 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2015, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + + +drivers-$(CONFIG_HAVE_PMIC_ACT8945A) += drivers/power/act8945a.o diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.c new file mode 100644 index 000000000..dc720dd39 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.c @@ -0,0 +1,890 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "chip.h" + +#include "peripherals/pio.h" +#include "peripherals/pmc.h" +#include "peripherals/flexcom.h" +#include "peripherals/twi.h" +#include "peripherals/twid.h" + +#include "power/act8945a.h" + +#include "trace.h" + +#include +#include +#include +#include + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +#define STATE_VSEL 1 // HW config DDR3L + +// SYS @0x00 +union _sys0 { + struct { + uint8_t + trst: 1, // Reset time out 0->260 1->65ms + nsysmode: 1, // response of SYSLEV voltage detector, 1->int 0>shutdown + nsyslevmsk: 1, // 1->unmask int + nsysstat: 1, // 1 if vsys < syslev voltage threshold + syslev: 4; // defines SYSLEV voltage threshold + } bits; + uint8_t u8; +}; + +// SYS @0x01 +union _sys1 { + struct { + uint8_t + scratch: 4, // user area to store system status information + ruf4: 1, + mstroff: 1, // Set bit to 1 to turn off all regulators + ruf67: 2; + } bits; + uint8_t u8; +}; + +// REG1 @0x20, REG2 @0x30, REG3 @0x40 +union _vset1 { + struct { + uint8_t + vset1: 6, + ruf_67: 2; + } bits; + uint8_t u8; +}; + +// REG1 @0x21, REG2 @0x31, REG3 @0x41 +union _vset2 { + struct { + uint8_t + vset2: 6, + ruf_67: 2; + } bits; + uint8_t u8; +}; + +// REG1 @0x22, REG2 @0x32, REG3 @0x42 +union _ctrl1 { + struct { + uint8_t + ok: 1, + nfltmsk: 1, + delay: 3, + mode: 1, + phase: 1, + on: 1; + } bits; + uint8_t u8; +}; + +// REG4 @0x51, REG5 @0x55, REG6 @0x61, REG7 @0x65 +union _ctrl2 { + struct { + uint8_t + ok: 1, + nfltmsk: 1, + delay: 3, + lowiq: 1, + dis: 1, + on: 1; + } bits; + uint8_t u8; +}; + +union _apch_70 { + struct { + uint8_t + ruf_0: 1, + ruf_1: 1, + ruf_2: 1, + ruf_3: 1, + ruf_45: 2, + ruf_67: 2; + } bits; + uint8_t u8; +}; + +union _apch_71 { + struct { + uint8_t + ovpset: 2, + pretimo: 2, + tottimo: 2, + ruf6: 1, + suschg: 1; + } bits; + uint8_t u8; +}; + +union _apch_78 { + struct { + uint8_t + chgdat: 1, + indat: 1, + tempdat: 1, + timrdat: 1, + chgstat: 1, + instat: 1, + tempstat: 1, + timrstat: 1; + } bits; + uint8_t u8; +}; + +union _apch_79 { + struct { + uint8_t + chgeocout: 1, + indis: 1, + tempout: 1, + timrpre: 1, + chgeocin: 1, + incon: 1, + tempin: 1, + timrtot: 1; + } bits; + uint8_t u8; +}; + +union _apch_7a { + struct { + uint8_t + ruf0: 1, + acinstat: 1, + ruf32: 2, + cstate: 2, + ruf76: 2; + } bits; + uint8_t u8; +}; + +/*---------------------------------------------------------------------------- + * Constants + *----------------------------------------------------------------------------*/ + +/// Slave address +#define ACT8945A_TWI_ADDRESS 0x5B + +#define NUM_REGULATORS 7 + +#define IADDR_SYS0 0x00 +#define IADDR_SYS1 0x01 +#define IADDR_REG1 0x20 +#define IADDR_REG2 0x30 +#define IADDR_REG3 0x40 +#define IADDR_REG4 0x50 +#define IADDR_REG5 0x54 +#define IADDR_REG6 0x60 +#define IADDR_REG7 0x64 +#define IADDR_APCH_70 0x70 +#define IADDR_APCH_71 0x71 +#define IADDR_APCH_78 0x78 +#define IADDR_APCH_79 0x79 +#define IADDR_APCH_7A 0x7a + +static const uint8_t _iaddr_reg[] = { + IADDR_REG1, IADDR_REG2, IADDR_REG3, IADDR_REG4, + IADDR_REG5, IADDR_REG6, IADDR_REG7, +}; + +static const char* _charging_states[4] = { + "Suspend/Disable/Fault", + "End of charge", + "Fast charge/Top-off", + "Precondition", +}; + +struct _reg +{ + const char* name; + uint8_t iaddr; +}; + +static const struct _reg _regs[] = { + { "SYS0 ", IADDR_SYS0 }, + { "SYS1 ", IADDR_SYS1 }, + { "REG1_20", IADDR_REG1 }, + { "REG1_21", IADDR_REG1 + 1 }, + { "REG1_22", IADDR_REG1 + 2 }, + { "REG2_30", IADDR_REG2 }, + { "REG2_31", IADDR_REG2 + 1 }, + { "REG2_32", IADDR_REG2 + 2 }, + { "REG3_40", IADDR_REG3 }, + { "REG3_41", IADDR_REG3 + 1 }, + { "REG3_42", IADDR_REG3 + 2 }, + { "REG4_50", IADDR_REG4 }, + { "REG4_51", IADDR_REG4 + 1 }, + { "REG5_54", IADDR_REG5 }, + { "REG5_55", IADDR_REG5 + 1 }, + { "REG6_60", IADDR_REG6 }, + { "REG6_61", IADDR_REG6 + 1 }, + { "REG7_64", IADDR_REG7 }, + { "REG7_65", IADDR_REG7 + 1 }, + { "APCH_70", IADDR_APCH_70 }, + { "APCH_71", IADDR_APCH_71 }, + { "APCH_78", IADDR_APCH_78 }, + { "APCH_79", IADDR_APCH_79 }, + { "APCH_7A", IADDR_APCH_7A }, +}; + +static const char *_ovp_setting[4] = { + "6.6V", "7.0V", "7.5V", "8.0V", +} ; + +/*------------------------------------------------------------------------------ + * Local functions + *----------------------------------------------------------------------------*/ + +static bool _act8945a_read_reg(struct _act8945a* act8945a, uint32_t iaddr, + uint8_t* value) +{ + uint32_t status; + struct _buffer in = { + .data = value, + .size = 1 + }; + act8945a->twid->slave_addr = ACT8945A_TWI_ADDRESS; + act8945a->twid->iaddr = iaddr; + act8945a->twid->isize = 1; + status = twid_transfert(act8945a->twid, &in, 0, + twid_finish_transfert_callback, 0); + if (status != TWID_SUCCESS) + return false; + twid_wait_transfert(act8945a->twid); + return true; +} + +static bool _act8945a_write_reg(struct _act8945a* act8945a, uint32_t iaddr, + uint8_t value) +{ + uint32_t status; + struct _buffer out = { + .data = (uint8_t*)&value, + .size = 1 + }; + act8945a->twid->slave_addr = ACT8945A_TWI_ADDRESS; + act8945a->twid->iaddr = iaddr; + act8945a->twid->isize = 1; + status = twid_transfert(act8945a->twid, 0, &out, + twid_finish_transfert_callback, 0); + if (status != TWID_SUCCESS) + return false; + twid_wait_transfert(act8945a->twid); + return true; +} + +static bool _act8945a_update_cached_registers(struct _act8945a *act8945a) +{ + return _act8945a_read_reg(act8945a, IADDR_SYS0, &act8945a->sys0) && + _act8945a_read_reg(act8945a, IADDR_APCH_78, &act8945a->apch78) && + _act8945a_read_reg(act8945a, IADDR_APCH_79, &act8945a->apch79) && + _act8945a_read_reg(act8945a, IADDR_APCH_7A, &act8945a->apch7a); +} + +static void _act8945a_irq_handler(uint32_t group, uint32_t status, void* user_arg) +{ + struct _act8945a *act8945a = (struct _act8945a*)user_arg; + + if (status & act8945a->desc.pin_irq.mask) { + union _sys0 sys0; + union _apch_78 apch78; + union _apch_79 apch79; + union _apch_7a apch7a; + + // save previous values + sys0.u8 = act8945a->sys0; + apch78.u8 = act8945a->apch78; + apch79.u8 = act8945a->apch79; + apch7a.u8 = act8945a->apch7a; + + // update values + _act8945a_update_cached_registers(act8945a); + + // show changes + if (sys0.u8 != act8945a->sys0) { + trace_debug("PMIC IRQ: SYST0 changed\r\n"); + } + if (apch78.u8 != act8945a->apch78) { + if (apch78.bits.chgdat == 0x01) + trace_debug("PMIC IRQ: charger state machine, END-OF-CHARGE state\r\n"); + } + if (apch79.u8 != act8945a->apch79) { + printf("PMIC IRQ: APCH79 changed\r\n"); + } + if (apch7a.u8 != act8945a->apch7a) { + trace_debug("PMIC IRQ: %s\r\n", _charging_states[apch7a.bits.cstate]); + } + } +} + +static void _act8945a_lbo_handler(uint32_t group, uint32_t status, void* user_arg) +{ + struct _act8945a *act8945a = (struct _act8945a*)user_arg; + + if (status & act8945a->desc.pin_lbo.mask) { + trace_debug("PMIC LBO: Low Battery Output\r\n"); + if( act8945a->lbo_count++ >= 10) + pio_disable_it(&act8945a->desc.pin_lbo); + } +} + +// Enable interrupt on nIRQ pin to MPU +static void _act8945a_enable_interrupt_handlers(struct _act8945a *act8945a) +{ + /* Configure PMIC line interrupts. */ + pio_configure_it(&act8945a->desc.pin_irq); + pio_add_handler_to_group(act8945a->desc.pin_irq.group, + act8945a->desc.pin_irq.mask, + &_act8945a_irq_handler, + act8945a); + pio_enable_it(&act8945a->desc.pin_irq); + + /* Configure LBO line interrupts. */ + act8945a->lbo_count = 0; + pio_configure_it(&act8945a->desc.pin_lbo); + pio_add_handler_to_group(act8945a->desc.pin_lbo.group, + act8945a->desc.pin_lbo.mask, + &_act8945a_lbo_handler, + act8945a); + pio_enable_it(&act8945a->desc.pin_lbo); +} + +static uint16_t _act8945a_convert_voltage_setting(uint8_t setting) +{ + uint8_t mul20, mul53; + + mul20 = (setting & 0x07) >> 0; + mul53 = (setting & 0x38) >> 3; + + if (setting <= 0x17) + return (uint16_t)(1000 * (0.6 + (0.2 * mul53) + (0.025 * mul20))); + else if (setting <= 0x2F) + return (uint16_t)(1000 * (1.2 + (0.4 * (mul53 - 3)) + (0.050 * mul20))); + else + return (uint16_t)(1000 * (2.4 + (0.8 * (mul53 - 6)) + (0.1 * mul20))); +} + +/*------------------------------------------------------------------------------ + * Exported functions + *----------------------------------------------------------------------------*/ + +bool act8945a_configure(struct _act8945a *act8945a, struct _twi_desc *twid) +{ + uint8_t data = 0; + + act8945a->twid = twid; + twid_configure(twid); + + pio_configure(&act8945a->desc.pin_chglev, 1); + pio_configure(&act8945a->desc.pin_irq, 1); + pio_configure(&act8945a->desc.pin_lbo, 1); + + if (!_act8945a_read_reg(act8945a, IADDR_SYS0, &data)) + return false; + + /* Set Charge Level */ + act8945a_set_charge_level(act8945a, ACT8945A_CHARGE_LEVEL_450MA); + + /* Set level interrupt */ + act8945a_disable_all_apch_interrupts(act8945a); + act8945a_configure_apch_interrupt(act8945a, CHARGE_STATE_INTO_EOC_STATE, true); + act8945a_configure_apch_interrupt(act8945a, CHARGE_STATE_OUT_EOC_STATE, true); + act8945a_configure_apch_interrupt(act8945a, PRECHARGE_TIME_OUT, true); + act8945a_configure_apch_interrupt(act8945a, TOTAL_CHARGE_TIME_OUT, true); + act8945a_enable_system_voltage_level_interrupt(act8945a, true); + + /* Update cached register values */ + if (!_act8945a_update_cached_registers(act8945a)) + return false; + + act8945a_enable_regulator_fault_interrupt(act8945a, 1, true); + act8945a_enable_regulator_fault_interrupt(act8945a, 5, true); + + /* Enable interrupts */ + _act8945a_enable_interrupt_handlers(act8945a); + + return true; +} + +// Charge Current Selection Input +// In USB-Mode: CHGLEV = 1 -> I charge 450mA +// CHGLEV = 0 -> I charge 100mA +void act8945a_set_charge_level(struct _act8945a *act8945a, + enum _act8945a_charge_level level) +{ + switch (level) { + case ACT8945A_CHARGE_LEVEL_100MA: + pio_clear(&act8945a->desc.pin_chglev); + trace_debug("Charge Level: 100mA\r\n"); + break; + case ACT8945A_CHARGE_LEVEL_450MA: + pio_set(&act8945a->desc.pin_chglev); + trace_debug("Charge Level: 450mA\r\n"); + break; + default: + trace_warning("Invalid charge level requested: %d\r\n", + (int)level) + break; + } +} + +// Set or Clear an APCH interrupt +// Set bit to 1 enable interrupt, +// Clear bit to 0 to disable interrupt +bool act8945a_configure_apch_interrupt(struct _act8945a *act8945a, + enum _act8945a_interrupt interrupt, bool enable) +{ + bool status; + union _apch_78 apch78; + union _apch_79 apch79; + + if (!_act8945a_read_reg(act8945a, IADDR_APCH_78, &apch78.u8) || + !_act8945a_read_reg(act8945a, IADDR_APCH_79, &apch79.u8)) + return false; + + switch (interrupt) + { + // Interrupt generated any time the input supply is disconnected when + // INSTAT[] bit is set to 1 and the INDIS[] bit is set to 1. + case INPUT_VOLTAGE_OUT_VALID_RANGE: // Interrupt + apch78.bits.instat = enable ? 1 : 0; + apch79.bits.indis = enable ? 1 : 0; + break; + + // Interrupt generated any time the input supply is connected when + // INSTAT[] bit is set to 1 and the INCON[] bit is set to 1. + case INPUT_VOLTAGE_INTO_VALID_RANGE: + apch78.bits.instat = enable ? 1 : 0; + apch79.bits.incon = enable ? 1 : 0; + break; + + // Interrupts based upon the status of the battery temperature. + // Set the TEMPOUT[] bit to 1 and TEMPSTAT[] bit to 1 to generate + // an interrupt when battery temperature goes out of the valid + // temperature range. + case BATTERY_TEMPERATURE_OUT_RANGE: + apch78.bits.tempstat = enable ? 1 : 0; + apch79.bits.tempout = enable ? 1 : 0; + break; + + // Interrupts based upon the status of the battery temperature. + // Set the TEMPIN[] bit to 1 and TEMPSTAT[] bit to 1 to generate + // an interrupt when battery temperature returns to the valid range. + case BATTERY_TEMPERATURE_INTO_RANGE: + apch78.bits.tempstat = enable ? 1 : 0; + apch79.bits.tempin = enable ? 1 : 0; + break; + + // Interrupt when the charger state machine goes into the + // END-OF-CHARGE (EOC). Set CHGEOCIN[] bit to 1 and CHGSTAT[] bit + // to 1 to generate an interrupt when the charger state machine goes + // into the END-OF-CHARGE (EOC)state. + case CHARGE_STATE_INTO_EOC_STATE: + apch78.bits.chgstat = enable ? 1 : 0; + apch79.bits.chgeocin = enable ? 1 : 0; + break; + + // Interrupt when the charger state machine exit the + // END-OF-CHARGE (EOC). Set CHGEOCOUT[] bit to 1 and CHGSTAT[] bit + // to 1 to generate an interrupt when the charger state machine exits + // the EOC state. + case CHARGE_STATE_OUT_EOC_STATE: + apch78.bits.chgstat = enable ? 1 : 0; + apch79.bits.chgeocout = enable ? 1 : 0; + break; + + // Interrupts based upon the status of the charge timers. + // Set the TIMRPRE[] bit to 1 and TIMRSTAT[] bit to 1 to generate an + // interrupt when the Precondition Timer expires. + case PRECHARGE_TIME_OUT: + apch78.bits.timrstat = enable ? 1 : 0; + apch79.bits.timrpre = enable ? 1 : 0; + break; + + // Set the TIMRTOT[] bit to 1 and TIMRSTAT[] bit to 1 to generate an + // interrupt when the Total-Charge Timer expires. + case TOTAL_CHARGE_TIME_OUT: + apch78.bits.timrstat = enable ? 1 : 0; + apch79.bits.timrtot = enable ? 1 : 0; + break; + + default: + trace_warning("Unknown interrupt %d\r\n", interrupt); + return false; + } + + // Write configuration to registers + status = _act8945a_write_reg(act8945a, IADDR_APCH_78, apch78.u8); + status |= _act8945a_write_reg(act8945a, IADDR_APCH_79, apch79.u8); + return status; + +} + +// Disable all interrupt from APCH +bool act8945a_disable_all_apch_interrupts(struct _act8945a *act8945a) +{ + return act8945a_configure_apch_interrupt(act8945a, CHARGE_STATE_OUT_EOC_STATE, false) && + act8945a_configure_apch_interrupt(act8945a, INPUT_VOLTAGE_OUT_VALID_RANGE, false) && + act8945a_configure_apch_interrupt(act8945a, BATTERY_TEMPERATURE_OUT_RANGE, false) && + act8945a_configure_apch_interrupt(act8945a, PRECHARGE_TIME_OUT, false) && + act8945a_configure_apch_interrupt(act8945a, CHARGE_STATE_INTO_EOC_STATE, false) && + act8945a_configure_apch_interrupt(act8945a, INPUT_VOLTAGE_INTO_VALID_RANGE, false) && + act8945a_configure_apch_interrupt(act8945a, BATTERY_TEMPERATURE_INTO_RANGE, false) && + act8945a_configure_apch_interrupt(act8945a, TOTAL_CHARGE_TIME_OUT, false); +} + +extern bool act8945a_set_system_voltage_detect_threshold(struct _act8945a *act8945a, + uint16_t threshold) +{ + union _sys0 sys0; + + if (threshold < 2300 || threshold > 3800) + return false; + if (!_act8945a_read_reg(act8945a, IADDR_SYS0, &sys0.u8)) + return false; + sys0.bits.syslev = (threshold - 2300) / 100; + return _act8945a_write_reg(act8945a, IADDR_SYS0, sys0.u8); +} + +bool act8945a_enable_system_voltage_level_interrupt(struct _act8945a *act8945a, + bool enable) +{ + union _sys0 sys0; + + if (!_act8945a_read_reg(act8945a, IADDR_SYS0, &sys0.u8)) + return false; + sys0.bits.nsyslevmsk = enable ? 1 : 0; + + sys0.bits.nsysmode = 1; //************* + + return _act8945a_write_reg(act8945a, IADDR_SYS0, sys0.u8); +} + +bool act8945a_set_regulator_voltage(struct _act8945a *act8945a, + uint8_t reg, uint16_t vout) +{ + // minimum is 600mV + if (vout < 600) { + trace_warning("Cannot set regulator %d voltage to %dmV, using 600mV instead\r\n", reg, vout); + vout = 600; + } + // maximum is 3900mV + if (vout > 3900) { + trace_warning("Cannot set regulator %d voltage to %dmV, using 3900mV instead\r\n", reg, vout); + vout = 3900; + } + + // can only set voltage for regulators 4 to 7 + if (reg < 4 || reg > 7) { + trace_error("Cannot change voltage of regulator %d\r\n", reg); + return false; + }; + + uint8_t value = 0; + if (vout < 1200) { + value = (vout - 600) / 25; + } else if (vout < 2400) { + value = 0x18 + (vout - 1200) / 50; + } else if (vout <= 3900) { + value = 0x30 + (vout - 2400) / 100; + } + + uint32_t iaddr = _iaddr_reg[reg - 1]; + return _act8945a_write_reg(act8945a, iaddr, value & 0x3f); +} + +bool act8945a_enable_regulator(struct _act8945a *act8945a, + uint8_t reg, bool enable) +{ + if (reg >= 1 && reg <= 3) { + union _ctrl1 ctrl1; + uint32_t iaddr = _iaddr_reg[reg - 1] + 1; + + if (!_act8945a_read_reg(act8945a, iaddr, &ctrl1.u8)) + return false; + + ctrl1.bits.on = enable ? 1 : 0; + + if (!_act8945a_write_reg(act8945a, iaddr, ctrl1.u8)) + return false; + } else if (reg >= 4 && reg <= 7) { + union _ctrl2 ctrl2; + uint32_t iaddr = _iaddr_reg[reg - 1] + 1; + + if (!_act8945a_read_reg(act8945a, iaddr, &ctrl2.u8)) + return false; + + ctrl2.bits.on = enable ? 1 : 0; + + if (!_act8945a_write_reg(act8945a, iaddr, ctrl2.u8)) + return false; + } else { + trace_error("Invalid regulator number %d\r\n", reg); + return false; + } + + return true; +} + +bool act8945a_enable_regulator_fault_interrupt(struct _act8945a *act8945a, + uint8_t reg, bool enable) +{ + if (reg >= 1 && reg <= 3) { + union _ctrl1 ctrl1; + uint8_t iaddr = (_iaddr_reg[reg-1]) + 2; + + + if (!_act8945a_read_reg(act8945a, iaddr, &ctrl1.u8)) + return false; + + ctrl1.bits.nfltmsk = enable ? 1 : 0; + + if (!_act8945a_write_reg(act8945a, iaddr, ctrl1.u8)) + return false; + } else if (reg >= 4 && reg <= 7) { + union _ctrl2 ctrl2; + uint8_t iaddr = (_iaddr_reg[reg-1]) + 1; + + if (!_act8945a_read_reg(act8945a, iaddr, &ctrl2.u8)) + return false; + + ctrl2.bits.nfltmsk = enable ? 1 : 0; + + if (!_act8945a_write_reg(act8945a, iaddr, ctrl2.u8)) + return false; + } else { + trace_error("Invalid regulator number %d\r\n", reg); + return false; + } + + return true; +} + +extern bool act8945a_get_lbo_pin_state(struct _act8945a *act8945a) +{ + return pio_get(&act8945a->desc.pin_lbo) ? true : false; +} + + + +extern void act8945a_display_voltage_settings(struct _act8945a *act8945a) +{ + int reg; + + trace_info_wp("\r\n-- ACT8945A - Voltage Settings & State --\r\n"); + + for (reg = 0; reg < NUM_REGULATORS; reg++) + { + uint8_t iadd_reg, setting, ctrl; + uint16_t u; + + /* Warning VSEL state */ + iadd_reg = _iaddr_reg[reg]; + if( (iadd_reg < IADDR_REG4) && (STATE_VSEL == 1) ) + iadd_reg ++; + + if (!_act8945a_read_reg(act8945a, iadd_reg, &setting)) + return; + + if (!_act8945a_read_reg(act8945a, iadd_reg + 1, &ctrl)) + return; + + u = _act8945a_convert_voltage_setting(setting); + trace_info_wp(" - VOUT_%d (0x%02x) = %dmV", reg + 1, ctrl, u); + if (reg <= 3) { + union _ctrl1 *ctrl1 = (union _ctrl1*)&ctrl; + trace_info_wp(" %s", ctrl1->bits.on ? "on" : "off"); + trace_info_wp(" %s", ctrl1->bits.phase ? "180" : "osc"); + trace_info_wp(" %s", ctrl1->bits.mode ? "pwm" : "pow-saving"); + trace_info_wp(" delay:0x%02x", ctrl1->bits.delay); + trace_info_wp(" %s", ctrl1->bits.nfltmsk ? "en" : "dis"); + trace_info_wp(" %s", ctrl1->bits.ok ? "OK" : "bits.on ? "on": "off"); + trace_info_wp(" %s", ctrl2->bits.dis ? "off" : "on"); + trace_info_wp(" %s", ctrl2->bits.lowiq ? "normal" : "low-power"); + trace_info_wp(" delay:0x%02x", ctrl2->bits.delay); + trace_info_wp(" %s", ctrl2->bits.nfltmsk ? "en" : "dis"); + trace_info_wp(" %s", ctrl2->bits.ok ? "OK" : ">=1) { + printf ("%x", (data&mask) ? 1 : 0); + } + trace_info_wp("\r\n"); + } + trace_info_wp("\r\n"); +} + +void act8945a_display_apch_registers(struct _act8945a *act8945a) +{ + union _apch_71 apch71; + union _apch_78 apch78; + union _apch_79 apch79; + union _apch_7a apch7a; + + trace_info_wp("\r\n-- ACT8945A - APCH Registers --\r\n"); + +// if (!_act8945a_read_reg(act8945a, IADDR_APCH_70, &data)) +// return; +// trace_info_wp(" - APCH @0x70: 0x%02x (reserved)\r\n", data); + + if (!_act8945a_read_reg(act8945a, IADDR_APCH_71, &apch71.u8)) + return; + trace_info_wp(" - APCH @0x71: 0x%02x\r\n", apch71.u8); + trace_info_wp(" Charge Suspend Control Input: %x\r\n", + apch71.bits.suschg); + trace_info_wp(" Total Charge Time-out Selection: %x\r\n", + apch71.bits.tottimo); + trace_info_wp(" Precondition Charge Time-out Sel: %x\r\n", + apch71.bits.pretimo); + trace_info_wp(" Input Over-Volt Prot.Threshold Sel: %x (%s)\r\n", + apch71.bits.ovpset, _ovp_setting[apch71.bits.ovpset]); + + if (!_act8945a_read_reg(act8945a, IADDR_APCH_78, &apch78.u8)) + return; + trace_info_wp(" - APCH @0x78: 0x%02x\r\n", apch78.u8); + trace_info_wp(" Charge Time-out Interrupt Status: %x\r\n", + apch78.bits.timrstat); + trace_info_wp(" Battery Temperature Interrupt Status: %x\r\n", + apch78.bits.tempstat); + trace_info_wp(" Input Voltage Interrupt Status: %x\r\n", + apch78.bits.instat); + trace_info_wp(" Charge State Interrupt Status: %x\r\n", + apch78.bits.chgstat); + trace_info_wp(" Charge Timer Status %x\r\n", + apch78.bits.timrdat); + trace_info_wp(" Temperature Status %x\r\n", + apch78.bits.tempdat); + trace_info_wp(" Input Voltage Status %x\r\n", + apch78.bits.indat); + trace_info_wp(" Charge State Machine Status %x\r\n", + apch78.bits.chgdat); + + if (!_act8945a_read_reg(act8945a, IADDR_APCH_79, &apch79.u8)) + return; + trace_info_wp(" - APCH @0x79: 0x%02x\r\n", apch79.u8); + trace_info_wp(" Total Charge Time-out Int Control: %x\r\n", + apch79.bits.timrtot); + trace_info_wp(" Batt.Temp.Int.Ctrl into valid range: %x\r\n", + apch79.bits.tempin); + trace_info_wp(" Inp.Voltage Int.Ctrl into valid range: %x\r\n", + apch79.bits.incon); + trace_info_wp(" Charge State Int Ctrl into EOC state: %x\r\n", + apch79.bits.chgeocin); + trace_info_wp(" Precharge Time-out Int Ctrl: %x\r\n", + apch79.bits.timrpre); + trace_info_wp(" Batt.Temp.Int.Ctrl. out valid range: %x\r\n", + apch79.bits.tempout); + trace_info_wp(" Inp.Voltage Int.Ctrl. out valid range: %x\r\n", + apch79.bits.indis); + trace_info_wp(" Charge State Int.Ctrl. out EOC state: %x\r\n", + apch79.bits.chgeocout); + + if (!_act8945a_read_reg(act8945a, IADDR_APCH_7A, &apch7a.u8)) + return; + trace_info_wp(" - APCH @0x7a: 0x%02x\r\n", apch7a.u8); + trace_info_wp(" Charge State: %x (%s)\r\n", + apch7a.bits.cstate, _charging_states[apch7a.bits.cstate]); + trace_info_wp(" ACIN Status: %x\r\n", + apch7a.bits.acinstat); +} + +void act8945a_display_system_registers(struct _act8945a *act8945a) +{ + union _sys0 sys0; + union _sys1 sys1; + + trace_info_wp("\r\n-- ACT8945A - System Registers --\r\n"); + + if (!_act8945a_read_reg(act8945a, IADDR_SYS0, &sys0.u8)) + return; + trace_info_wp(" - SYS0 @0x00: 0x%02x\r\n", sys0.u8); + trace_info_wp(" Reset Timer Setting: %s\r\n", + sys0.bits.trst ? "64ms" : "260ms"); + trace_info_wp(" SYSLEV Mode Select: %s\r\n", + sys0.bits.nsysmode ?"int" : "shutdown"); + trace_info_wp(" System Voltage Level Int.Mask: %s\r\n", + sys0.bits.nsyslevmsk ?"int" : "noint"); + trace_info_wp(" System Voltage Status: %s\r\n", + sys0.bits.nsysstat ? "vsyssyslev"); + trace_info_wp(" SYSLEV Failing Treshold value: %dmV\r\n", + 2300 + sys0.bits.syslev * 100); + + if (!_act8945a_read_reg(act8945a, IADDR_SYS1, &sys1.u8)) + return; + trace_info_wp(" - SYS1 @0x01: 0x%02x\r\n", sys1.u8); + trace_info_wp(" Master Off Ctrl, All regul: %s\r\n", + sys1.bits.mstroff ? "off" : "on"); + trace_info_wp(" Scratchpad Bits, free user: %x\r\n", + sys1.bits.scratch); +} + +void act8945a_display_charge_state(struct _act8945a *act8945a) +{ + union _apch_7a apch7a; + if (!_act8945a_read_reg(act8945a, IADDR_APCH_7A, &apch7a.u8)) return; + + if (act8945a->apch7a != apch7a.u8) { + trace_info_wp(" Charge State: %x (%s)\r\n", apch7a.bits.cstate, _charging_states[apch7a.bits.cstate]); + act8945a->apch7a = apch7a.u8; + } +} \ No newline at end of file diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.h new file mode 100644 index 000000000..9eb451b86 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/drivers/power/act8945a.h @@ -0,0 +1,126 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _ACT_8945A_H_ +#define _ACT_8945A_H_ + +#include +#include + +#include "peripherals/twid.h" + +/*------------------------------------------------------------------------------ + * Types + *----------------------------------------------------------------------------*/ + +enum _act8945a_charge_level +{ + ACT8945A_CHARGE_LEVEL_100MA, + ACT8945A_CHARGE_LEVEL_450MA, +}; + +enum _act8945a_interrupt +{ + CHARGE_STATE_OUT_EOC_STATE, + INPUT_VOLTAGE_OUT_VALID_RANGE, + BATTERY_TEMPERATURE_OUT_RANGE, + PRECHARGE_TIME_OUT, + CHARGE_STATE_INTO_EOC_STATE, + INPUT_VOLTAGE_INTO_VALID_RANGE, + BATTERY_TEMPERATURE_INTO_RANGE, + TOTAL_CHARGE_TIME_OUT, +}; + +struct _act8945a_desc { + const struct _pin pin_chglev; + const struct _pin pin_irq; + const struct _pin pin_lbo; +}; + +struct _act8945a { + struct _twi_desc* twid; + struct _act8945a_desc desc; + + uint8_t sys0; + uint8_t apch78; + uint8_t apch79; + uint8_t apch7a; + uint8_t lbo_count; +}; + +/*------------------------------------------------------------------------------ + * Exported functions + *----------------------------------------------------------------------------*/ + +extern bool act8945a_configure(struct _act8945a *act8945a, + struct _twi_desc *twid); + +extern void act8945a_set_charge_level(struct _act8945a *act8945a, + enum _act8945a_charge_level level); + +extern bool act8945a_configure_apch_interrupt(struct _act8945a *act8945a, + enum _act8945a_interrupt interrupt, bool enable); + +extern bool act8945a_disable_all_apch_interrupts(struct _act8945a *act8945a); + +// Set the Programmable System Voltage Monitor +// Input: Value in mv from 2300mv to 3800mv +extern bool act8945a_set_system_voltage_detect_threshold(struct _act8945a *act8945a, + uint16_t threshold); + +// System Voltage Level Interrupt Mask. SYSLEV interrupt is masked by default, +// set to 1 to unmask this interrupt. +extern bool act8945a_enable_system_voltage_level_interrupt( + struct _act8945a *act8945a, bool enable); + +extern bool act8945a_set_regulator_voltage(struct _act8945a *act8945a, + uint8_t reg, uint16_t vout); + +extern bool act8945a_enable_regulator(struct _act8945a *act8945a, + uint8_t reg, bool enable); + +// Regulator Fault Mask Control. +// Set bit to 1 enable fault-interrupts, clear bit to 0 to disable fault-interrupts +// Input: regulator (1-7) +bool act8945a_enable_regulator_fault_interrupt(struct _act8945a *act8945a, + uint8_t reg, bool enable); + +extern bool act8945a_get_lbo_pin_state(struct _act8945a *act8945a); + +extern void act8945a_display_voltage_settings(struct _act8945a *act8945a); + +extern void act8945a_dump_registers(struct _act8945a *act8945a); + +extern void act8945a_display_apch_registers(struct _act8945a *act8945a); + +extern void act8945a_display_system_registers(struct _act8945a *act8945a); + +extern void act8945a_display_charge_state(struct _act8945a *act8945a); + +#endif /* _ACT_8945A_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/Makefile.inc new file mode 100644 index 000000000..a1ff09899 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/Makefile.inc @@ -0,0 +1,49 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2015, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +lib-y += target/target.a + +target-y := + +include $(TOP)/target/sama5d2/Makefile.inc + +TARGET_OBJS := $(addprefix $(BUILDDIR)/,$(target-y)) + +-include $(TARGET_OBJS:.o=.d) + +$(BUILDDIR)/target/target.a: $(TARGET_OBJS) + @mkdir -p $(dir $@) + $(ECHO) AR $@ + $(Q)$(AR) -cr $@ $^ + +ifeq ($(VARIANT),ddram) +BOOTSTRAP_OBJS := $(addprefix $(BUILDDIR)/,$(bootstrap-y)) +BOOTSTRAP_OBJS += $(addprefix $(BUILDDIR)/,$(gnu-cstartup-y:.S=.o)) + +-include $(BOOTSTRAP_OBJS:.o:.d) +endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/Makefile.inc new file mode 100644 index 000000000..0a489c19c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/Makefile.inc @@ -0,0 +1,64 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2013, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +ifeq ($(CONFIG_SOC_SAMA5D2),y) + +CFLAGS_INC += -I$(TOP)/target/sama5d2 + +gnu-debug-lib-y ?= $(TOP)/target/sama5d2/toolchain/gnu/common.gdb +gnu-cstartup-y ?= target/sama5d2/toolchain/gnu/cstartup.S +iar-cstartup-y ?= target/sama5d2/toolchain/iar/cstartup.s + +ifeq ($(VARIANT),sram) +gnu-linker-script-y ?= $(TOP)/target/sama5d2/toolchain/gnu/sram.ld +gnu-debug-script-y ?= $(TOP)/target/sama5d2/toolchain/gnu/sram.gdb +iar-linker-script-y ?= $(TOP)/target/sama5d2/toolchain/iar/sram.icf +iar-debug-script-y ?= $(TOP)/target/sama5d2/toolchain/iar/sram.mac +endif + +ifeq ($(VARIANT),ddram) +gnu-linker-script-y ?= $(TOP)/target/sama5d2/toolchain/gnu/ddram.ld +gnu-debug-script-y ?= $(TOP)/target/sama5d2/toolchain/gnu/ddram.gdb +iar-linker-script-y ?= $(TOP)/target/sama5d2/toolchain/iar/ddram.icf +ifeq ($(CONFIG_BOARD_SAMA5D2_XPLAINED),y) +iar-debug-script-y ?= $(TOP)/target/sama5d2/toolchain/iar/ddram_sama5d2-xplained.mac +endif +ifeq ($(CONFIG_BOARD_SAMA5D2_XPLAINED_PROTO),y) +iar-debug-script-y ?= $(TOP)/target/sama5d2/toolchain/iar/ddram_sama5d2-xplained.mac +endif +bootstrap-y ?= target/sama5d2/bootstrap.o +bootstrap-linker-script-y ?= $(TOP)/target/sama5d2/toolchain/gnu/sram.ld +endif + +chip-serie-name-y = sama5d2 + +target-y += target/sama5d2/chip.o +target-y += target/sama5d2/board_lowlevel.o +target-y += target/sama5d2/board_memories.o + +endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board.h new file mode 100644 index 000000000..7b6fb3dad --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board.h @@ -0,0 +1,47 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _BOARD_HEADER_ +#define _BOARD_HEADER_ + +#if defined(CONFIG_BOARD_SAMA5D2_XPLAINED) + #include "board_sama5d2-xplained.h" +#elif defined(CONFIG_BOARD_SAMA5D2_XPLAINED_PROTO) + #include "board_sama5d2-xplained-proto.h" +#elif defined(CONFIG_BOARD_SAMA5D2_VB_BGA196) + #include "board_sama5d2-vb-bga196.h" +#elif defined(CONFIG_BOARD_SAMA5D2_VB_BGA289) + #include "board_sama5d2-vb-bga289.h" +#elif defined(CONFIG_BOARD_SAMA5D2_PTC_ENGI) + #include "board_sama5d2-ptc-engi.h" +#else + #error "No board defined" +#endif + +#endif /* _BOARD_HEADER_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.c new file mode 100644 index 000000000..eff5a7d29 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.c @@ -0,0 +1,179 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Provides the low-level initialization function that called on chip startup. + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "board.h" +#include "compiler.h" +#include "timer.h" + +#include "cortex-a/cpsr.h" + +#include "peripherals/aic.h" +#include "peripherals/matrix.h" +#include "peripherals/pio.h" +#include "peripherals/pmc.h" + +#include + +/*---------------------------------------------------------------------------- + * Functions + *----------------------------------------------------------------------------*/ + +extern void Undefined_Handler(); +extern void Abort_Handler(); +extern void FIQ_Handler(); +extern void FreeRTOS_IRQ_Handler(); + +/** + * \brief Performs the low-level initialization of the chip. + * It also enable a low level on the pin NRST triggers a user reset. + */ +void low_level_init(void) +{ + uint32_t i; + + /* Setup default interrupt handlers */ + aic_initialize(); + + /* Configure clocking if code is not in external mem */ + if ((uint32_t)low_level_init < DDR_CS_ADDR) + { + pmc_switch_mck_to_slck(); + pmc_set_mck_h32mxdiv(PMC_MCKR_H32MXDIV_H32MXDIV2); + pmc_set_mck_plla_div(PMC_MCKR_PLLADIV2); + pmc_set_mck_prescaler(PMC_MCKR_PRES_CLOCK); + pmc_set_mck_divider(PMC_MCKR_MDIV_EQ_PCK); + /* Disable PLLA */ + pmc_set_plla(0, PMC_PLLICPR_IPLL_PLLA(0x3)); + pmc_select_external_osc(); + /* Configure PLLA */ + pmc_set_plla(CKGR_PLLAR_ONE | CKGR_PLLAR_PLLACOUNT(0x3F) | + CKGR_PLLAR_OUTA(0x0) | CKGR_PLLAR_MULA(82) | + CKGR_PLLAR_DIVA_BYPASS, PMC_PLLICPR_IPLL_PLLA(0x3)); + pmc_set_mck_divider(PMC_MCKR_MDIV_PCK_DIV3); + pmc_set_mck_prescaler(PMC_MCKR_PRES_CLOCK); + pmc_switch_mck_to_pll(); + } + + /* select FIQ */ + AIC->AIC_SSR = 0; + AIC->AIC_SVR = (unsigned int) FIQ_Handler; + + for (i = 1; i < 31; i++) + { + AIC->AIC_SSR = i; + AIC->AIC_SVR = (unsigned int) FreeRTOS_IRQ_Handler; + } + + AIC->AIC_SPU = (unsigned int) Undefined_Handler; + + /* Disable all interrupts */ + for (i = 1; i < 31; i++) + { + AIC->AIC_SSR = i; + AIC->AIC_IDCR = 1 ; + } + /* Clear All pending interrupts flags */ + for (i = 1; i < 31; i++) + { + AIC->AIC_SSR = i; + AIC->AIC_ICCR = 1 ; + } + /* Perform 8 IT acknoledge (write any value in EOICR) */ + for (i = 0; i < 8 ; i++) + { + AIC->AIC_EOICR = 0; + } + + /* Remap */ + matrix_remap_ram(); + + // timer_configure(BOARD_TIMER_RESOLUTION); +} + +/** + * \brief Restore all IOs to default state after power-on reset. + */ +void board_restore_pio_reset_state(void) +{ + unsigned int i; + + /* all pins, excluding JTAG and NTRST */ + struct _pin pins[] = { + { PIO_GROUP_A, 0xFFFFFFFF, PIO_INPUT, PIO_PULLUP }, + { PIO_GROUP_B, 0xFFFFFFFF, PIO_INPUT, PIO_PULLUP }, + { PIO_GROUP_C, 0xFFFFFFFF, PIO_INPUT, PIO_PULLUP }, + { PIO_GROUP_D, 0xFFF83FFF, PIO_INPUT, PIO_PULLUP }, + }; + + pio_configure(pins, ARRAY_SIZE(pins)); + for (i = 0; i < ARRAY_SIZE(pins); i++) + pio_clear(&pins[i]); +} + +void board_save_misc_power(void) +{ + int i; + + /* disable USB clock */ + pmc_disable_upll_clock(); + pmc_disable_upll_bias(); + + /* Disable audio clock */ +// pmc_disable_audio(); + + /* disable system clocks */ + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_DDR); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_LCD); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_SMD); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_UHP); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_UDP); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_PCK0); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_PCK1); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_PCK2); + pmc_disable_system_clock(PMC_SYSTEM_CLOCK_ISC); + + /* disable all peripheral clocks except PIOA for JTAG, serial debug port */ + for (i = ID_PIT; i < ID_PERIPH_COUNT; i++) { + if (i == ID_PIOA) + continue; + pmc_disable_peripheral(i); + } +} + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.h new file mode 100644 index 000000000..a4241bfae --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_lowlevel.h @@ -0,0 +1,59 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2013, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for the low-level initialization function. + * + */ + +#ifndef BOARD_LOWLEVEL_H +#define BOARD_LOWLEVEL_H + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Low-Level chip initialization -- called by startup + */ +extern void low_level_init(void); + +/** + * \brief Restore all IOs to default state after power-on reset. + */ +extern void board_restore_pio_reset_state(void); + +/** + * \brief Save power by disabling most peripherals + */ +extern void board_save_misc_power(void); + +#endif /* BOARD_LOWLEVEL_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.c new file mode 100644 index 000000000..3529ccbdf --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.c @@ -0,0 +1,371 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Implementation of memories configuration on board. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "board_memories.h" +#include "trace.h" + +#include "cortex-a/mmu.h" + +#include "peripherals/hsmc.h" +#include "peripherals/l2cc.h" +#include "peripherals/matrix.h" +#include "peripherals/pmc.h" + +#include "memories/ddram.h" + +/*---------------------------------------------------------------------------- + * Local constants + *----------------------------------------------------------------------------*/ + +const static struct _l2cc_control l2cc_cfg = { + .instruct_prefetch = true, // Instruction prefetch enable + .data_prefetch = true, // Data prefetch enable + .double_linefill = true, + .incr_double_linefill = true, + /* Disable Write back (enables write through, Use this setting + if DDR2 mem is not write-back) */ + //cfg.no_write_back = true, + .force_write_alloc = FWA_NO_ALLOCATE, + .offset = 31, + .prefetch_drop = true, + .standby_mode = true, + .dyn_clock_gating = true +}; + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +#ifdef BOARD_DDRAM_TYPE +static void matrix_configure_slave_ddr(void) +{ + int i; + + /* Disable write protection */ + matrix_remove_write_protection(MATRIX0); + + /* External DDR */ + /* DDR port 0 not used */ + for (i = H64MX_SLAVE_DDR_PORT1; i <= H64MX_SLAVE_DDR_PORT7; i++) { + matrix_configure_slave_sec(MATRIX0, i, 0xff, 0xff, 0xff); + matrix_set_slave_split_addr(MATRIX0, i, MATRIX_AREA_128M, 0xf); + matrix_set_slave_region_size(MATRIX0, i, MATRIX_AREA_128M, 0x1); + } +} +#endif + +#ifdef CONFIG_HAVE_NANDFLASH +static void matrix_configure_slave_nand(void) +{ + /* Disable write protection */ + matrix_remove_write_protection(MATRIX1); + + /* NFC Command Register */ + matrix_configure_slave_sec(MATRIX1, + H32MX_SLAVE_NFC_CMD, 0xc0, 0xc0, 0xc0); + matrix_set_slave_split_addr(MATRIX1, + H32MX_SLAVE_NFC_CMD, MATRIX_AREA_128M, 0xc0); + matrix_set_slave_region_size(MATRIX1, + H32MX_SLAVE_NFC_CMD, MATRIX_AREA_128M, 0xc0); + + /* NFC SRAM */ + matrix_configure_slave_sec(MATRIX1, + H32MX_SLAVE_NFC_SRAM, 0x1, 0x1, 0x1); + matrix_set_slave_split_addr(MATRIX1, + H32MX_SLAVE_NFC_SRAM, MATRIX_AREA_8K, 0x1); + matrix_set_slave_region_size(MATRIX1, + H32MX_SLAVE_NFC_SRAM, MATRIX_AREA_8K, 0x1); +} +#endif + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +void board_setup_tlb(uint32_t *tlb) +{ + uint32_t addr; + + /* TODO: some peripherals are configured TTB_SECT_STRONGLY_ORDERED + instead of TTB_SECT_SHAREABLE_DEVICE because their drivers have to + be verified for correct operation when write-back is enabled */ + + /* Reset table entries */ + for (addr = 0; addr < 4096; addr++) + tlb[addr] = 0; + + /* 0x00000000: ROM */ + tlb[0x000] = TTB_SECT_ADDR(0x00000000) + | TTB_SECT_AP_READ_ONLY + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_CACHEABLE_WB + | TTB_TYPE_SECT; + + /* 0x00100000: NFC SRAM */ + tlb[0x001] = TTB_SECT_ADDR(0x00100000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x00200000: SRAM */ + tlb[0x002] = TTB_SECT_ADDR(0x00200000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_CACHEABLE_WB + | TTB_TYPE_SECT; + + /* 0x00300000: UDPHS (RAM) */ + tlb[0x003] = TTB_SECT_ADDR(0x00300000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x00400000: UHPHS (OHCI) */ + tlb[0x004] = TTB_SECT_ADDR(0x00400000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x00500000: UDPHS (EHCI) */ + tlb[0x005] = TTB_SECT_ADDR(0x00500000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x00600000: AXIMX */ + tlb[0x006] = TTB_SECT_ADDR(0x00600000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x00700000: DAP */ + tlb[0x007] = TTB_SECT_ADDR(0x00700000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x00a00000: L2CC */ + tlb[0x00a] = TTB_SECT_ADDR(0x00a00000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + tlb[0x00b] = TTB_SECT_ADDR(0x00b00000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_SHAREABLE_DEVICE + | TTB_TYPE_SECT; + + /* 0x10000000: EBI Chip Select 0 */ + for (addr = 0x100; addr < 0x200; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0x20000000: DDR Chip Select */ + /* (64MB cacheable, 448MB strongly ordered) */ + for (addr = 0x200; addr < 0x240; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_CACHEABLE_WB + | TTB_TYPE_SECT; + for (addr = 0x240; addr < 0x400; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0x40000000: DDR AESB Chip Select */ + for (addr = 0x400; addr < 0x600; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_CACHEABLE_WB + | TTB_TYPE_SECT; + + /* 0x60000000: EBI Chip Select 1 */ + for (addr = 0x600; addr < 0x700; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0x70000000: EBI Chip Select 2 */ + for (addr = 0x700; addr < 0x800; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0x80000000: EBI Chip Select 3 */ + for (addr = 0x800; addr < 0x900; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0x90000000: QSPI0/1 AESB MEM */ + for (addr = 0x900; addr < 0xa00; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xa0000000: SDMMC0 */ + for (addr = 0xa00; addr < 0xb00; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + //| TTB_SECT_SHAREABLE_DEVICE + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xb0000000: SDMMC1 */ + for (addr = 0xb00; addr < 0xc00; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + //| TTB_SECT_SHAREABLE_DEVICE + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xc0000000: NFC Command Register */ + for (addr = 0xc00; addr < 0xd00; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC_NEVER + //| TTB_SECT_SHAREABLE_DEVICE + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xd0000000: QSPI0/1 MEM */ + for (addr = 0xe00; addr < 0xe00; addr++) + tlb[addr] = TTB_SECT_ADDR(addr << 20) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xf0000000: Internal Peripherals */ + tlb[0xf00] = TTB_SECT_ADDR(0xf0000000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xf8000000: Internal Peripherals */ + tlb[0xf80] = TTB_SECT_ADDR(0xf8000000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; + + /* 0xfc000000: Internal Peripherals */ + tlb[0xfc0] = TTB_SECT_ADDR(0xfc000000) + | TTB_SECT_AP_FULL_ACCESS + | TTB_SECT_DOMAIN(0xf) + | TTB_SECT_EXEC + | TTB_SECT_STRONGLY_ORDERED + | TTB_TYPE_SECT; +} + +void board_cfg_l2cc(void) +{ + l2cc_configure(&l2cc_cfg); +} + +void board_cfg_ddram (void) +{ +#ifdef BOARD_DDRAM_TYPE + matrix_configure_slave_ddr(); + struct _mpddrc_desc desc; + ddram_init_descriptor(&desc, BOARD_DDRAM_TYPE); + ddram_configure(&desc); +#else + trace_fatal("Cannot configure DDRAM: target board have no DDRAM type definition!"); +#endif +} + +#ifdef CONFIG_HAVE_NANDFLASH +void board_cfg_nand_flash(void) +{ + matrix_configure_slave_nand(); + hsmc_nand_configure(BOARD_NANDFLASH_CS, BOARD_NANDFLASH_BUS_WIDTH); +} +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.h new file mode 100644 index 000000000..a1851068c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_memories.h @@ -0,0 +1,72 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2013, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for memories configuration on board. + * + */ + +#ifndef BOARD_MEMORIES_H +#define BOARD_MEMORIES_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Setup TLB for the board + */ +extern void board_setup_tlb(uint32_t *tlb); + +/** + * \brief Configures L2CC for the board + */ +extern void board_cfg_l2cc(void); + +/** + * \brief Configures DDR for the board + */ +extern void board_cfg_ddram(void); + +#ifdef CONFIG_HAVE_NANDFLASH +/** + * \brief Configures SMC for the board NAND flash. + */ +extern void board_cfg_nand_flash(void); +#endif + +#endif /* BOARD_MEMORIES_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-ptc-engi.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-ptc-engi.h new file mode 100644 index 000000000..2c29599ab --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-ptc-engi.h @@ -0,0 +1,193 @@ +/** + * \page sama5d2_ptc_engi_board_desc sama5d2-PTC-ENGI - Board Description + * + * \section Purpose + * + * This file is dedicated to describe the sama5d2-PTC-ENGI board. + * + * \section Contents + * + * - sama5d2-PTC-ENGI + * - For sama5d2-PTC-ENGI information, see \subpage sama5d2_ptc_engi_board_info. + * - For operating frequency information, see \subpage sama5d2_ptc_engi_opfreq. + * - For using portable PIO definitions, see \subpage sama5d2_ptc_engi_piodef. + * - For on-board memories, see \subpage sama5d2_ptc_engi_mem. + * - Several USB definitions are included here, see \subpage sama5d2_ptc_engi_usb. + * - For External components, see \subpage sama5d2_ptc_engi_extcomp. + * - For Individual chip definition, see \subpage sama5d2_ptc_engi_chipdef. + * + * To get more software details and the full list of parameters related to the + * sama5d2-PTC-ENGI board configuration, please have a look at the source file: + * \ref board.h\n + * + * \section Usage + * + * - The code for booting the board is provided by board_cstartup_xxx.c and + * board_lowlevel.c. + * - For using board PIOs, board characteristics (clock, etc.) and external + * components, see board.h. + * - For manipulating memories, see board_memories.h. + * + * This file can be used as a template and modified to fit a custom board, with + * specific PIOs usage or memory connections. + */ + +/** + * \file board.h + * + * Definition of sama5d2-PTC-ENGI + * characteristics, sama5d4-dependant PIOs and external components interfacing. + */ + +#ifndef _BOARD_D2_H +#define _BOARD_D2_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "board_lowlevel.h" +#include "board_memories.h" + +/*---------------------------------------------------------------------------- + * HW BOARD Definitions + *----------------------------------------------------------------------------*/ + +/** + * \page sama5d2_ptc_engi_board_info "sama5d2-PTC-ENGI - Board informations" + * This page lists several definition related to the board description. + * + * \section Definitions + * - \ref BOARD_NAME + */ + +/** Name of the board */ +#define BOARD_NAME "sama5d2-ptc-engi" + +/*----------------------------------------------------------------------------*/ +/** + * \page sama5d2_ptc_engi_opfreq "sama5d2-PTC-ENGI - Operating frequencies" + * This page lists several definition related to the board operating frequency + * (when using the initialization done by board_lowlevel.c). + */ + +/** Frequency of the board slow clock oscillator */ +#define BOARD_SLOW_CLOCK_EXT_OSC 32768 + +/** Frequency of the board main clock oscillator */ +#define BOARD_MAIN_CLOCK_EXT_OSC 12000000 + +/** /def Definition of DDRAM's type */ +#define BOARD_DDRAM_TYPE MT41K128M16 + +/** \def Board DDR memory size in bytes */ +#define BOARD_DDR_MEMORY_SIZE 512*1024*1024 + +/** \def Board PIT tick resolution */ +#define BOARD_TIMER_RESOLUTION 1000 + +/* =================== PIN CONSOLE definition ================== */ + +/** CONSOLE pin definition, Use only UART */ +#define PINS_CONSOLE PINS_UART0_IOS1 +#define CONSOLE_PER_ADD UART0 +#define CONSOLE_ID ID_UART0 +#define CONSOLE_BAUDRATE 57600 +#define CONSOLE_DRIVER DRV_UART + +/* =================== PIN LED definition ====================== */ + +/* RGB LED index */ +#define LED_RED 0 +#define LED_GREEN 1 +#define LED_BLUE 2 + +/** LED #0 pin definition (Red). */ +#define PIN_LED_0 { PIO_GROUP_A, PIO_PA30, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** LED #1 pin definition (Green). */ +#define PIN_LED_1 { PIO_GROUP_A, PIO_PA31, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** LED #2 pin definition (Blue). */ +#define PIN_LED_2 { PIO_GROUP_B, PIO_PB2, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** List of all LEDs definitions. */ +#define PINS_LEDS { PIN_LED_0, PIN_LED_1, PIN_LED_2 } + +/* =================== PIN PUSH BUTTON definition ============== */ + +#define PIO_CFG_PB (PIO_PULLUP | PIO_DEBOUNCE) + +#define PIN_PUSHBUTTON_1 { PIO_GROUP_B, PIO_PB9, PIO_INPUT, PIO_CFG_PB } + +/** List of all push button definitions. */ +#define PINS_PUSHBUTTONS { PIN_PUSHBUTTON_1 } + +/** Push button index. */ +#define PUSHBUTTON_BP1 0 + +/* ================== ACT8945A PMIC definition ====================== */ + +#define ACT8945A_PINS PINS_FLEXCOM4_TWI_IOS3 +#define ACT8945A_ADDR TWI0 +#define ACT8945A_FREQ 400000 +#define ACT8945A_PIN_CHGLEV \ + { PIO_GROUP_A, PIO_PA22, PIO_OUTPUT_0, PIO_PULLUP } +#define ACT8945A_PIN_IRQ \ + { PIO_GROUP_B, PIO_PB13, PIO_INPUT, PIO_PULLUP | PIO_IT_FALL_EDGE } +#define ACT8945A_PIN_LBO \ + { PIO_GROUP_C, PIO_PC8, PIO_INPUT, PIO_PULLUP } + +/* ================== PIN USB definition ======================= */ + +/** USB VBus pin */ +#define PIN_USB_VBUS {\ + { PIO_GROUP_A, PIO_PA27, PIO_INPUT, PIO_DEBOUNCE | PIO_IT_BOTH_EDGE },\ +} + +/** USB OverCurrent detection*/ +#define PIN_USB_OVCUR {\ + { PIO_GROUP_A, PIO_PA29, PIO_INPUT, PIO_DEFAULT },\ +} + +/** USB Power Enable B, Active high */ +#define PIN_USB_POWER_ENB {\ + { PIO_GROUP_A, PIO_PBA28, PIO_OUTPUT_0, PIO_DEFAULT },\ +} + +/* =================== AT25 device definition =================== */ + +#define AT25_PINS PINS_SPI0_NPCS0_IOS1 +#define AT25_ADDR SPI0 +#define AT25_CS 0 +#define AT25_ATTRS (SPI_MR_MODFDIS | SPI_MR_WDRBT | SPI_MR_MSTR) +#define AT25_FREQ 40000 /* (value in KHz) */ +#define AT25_LOW_FREQ 20000 /* (value in KHz) */ +#define AT25_DLYBS 0 +#define AT25_DLYCT 0 +#define AT25_SPI_MODE (SPI_CSR_NCPHA | SPI_CSR_BITS_8_BIT) + +/* =================== AT24 device definition =================== */ +#define AT24_PINS PINS_TWI1_IOS1; +#define AT24_ADDR ((Twi*)TWIHS1) +#define AT24_FREQ 400000 +#define AT24_DESC {"AT24MAC402", 0xFF, 16} + +/* =================== GMAC/PHY definition =================== */ + +#define GMAC0_ADDR GMAC0 +#define GMAC0_PINS PINS_GMAC_RMII_IOS3 +#define GMAC0_PHY_ADDR 0 +#define GMAC0_PHY_IRQ_PIN PIN_GTSUCOM_IOS1 +#define GMAC0_PHY_RETRIES PHY_DEFAULT_RETRIES + +/* =================== NANDFLASH device definition =================== */ + +#define BOARD_NANDFLASH_PINS PINS_NFC_IOS2 +#define BOARD_NANDFLASH_ADDR EBI_CS3_ADDR +#define BOARD_NANDFLASH_CS 3 +#define BOARD_NANDFLASH_BUS_WIDTH 8 + +#endif /* #ifndef _BOARD_D2_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga196.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga196.h new file mode 100644 index 000000000..1126e3c63 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga196.h @@ -0,0 +1,185 @@ +/** + * \page sama5d2_xult_board_desc sama5d2-XULT - Board Description + * + * \section Purpose + * + * This file is dedicated to describe the sama5d2-XULT board. + * + * \section Contents + * + * - sama5d2-XULT + * - For sama5d2-XULT information, see \subpage sama5d2_xult_board_info. + * - For operating frequency information, see \subpage sama5d2_xult_opfreq. + * - For using portable PIO definitions, see \subpage sama5d2_xult_piodef. + * - For on-board memories, see \subpage sama5d2_xult_mem. + * - Several USB definitions are included here, see \subpage sama5d2_xult_usb. + * - For External components, see \subpage sama5d2_xult_extcomp. + * - For Individual chip definition, see \subpage sama5d2_xult_chipdef. + * + * To get more software details and the full list of parameters related to the + * sama5d2-XULT board configuration, please have a look at the source file: + * \ref board.h\n + * + * \section Usage + * + * - The code for booting the board is provided by board_cstartup_xxx.c and + * board_lowlevel.c. + * - For using board PIOs, board characteristics (clock, etc.) and external + * components, see board.h. + * - For manipulating memories, see board_memories.h. + * + * This file can be used as a template and modified to fit a custom board, with + * specific PIOs usage or memory connections. + */ + +/** + * \file board.h + * + * Definition of sama5d2-xb + * characteristics, sama5d2-dependant PIOs and external components interfacing. + */ + +#ifndef _BOARD_D2_H +#define _BOARD_D2_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "board_lowlevel.h" +#include "board_memories.h" + +/*---------------------------------------------------------------------------- + * HW BOARD Definitions + *----------------------------------------------------------------------------*/ + +/** + * \page sama5d2_vb_board_info "sama5d2-vb - Board informations" + * This page lists several definition related to the board description. + * + * \section Definitions + * - \ref BOARD_NAME + */ + +/** Name of the board */ +#define BOARD_NAME "sama5d2-vb-bga196" + +/*----------------------------------------------------------------------------*/ +/** + * \page sama5d2_xult_opfreq "sama5d2-XULT - Operating frequencies" + * This page lists several definition related to the board operating frequency + * (when using the initialization done by board_lowlevel.c). + */ + +/** Frequency of the board slow clock oscillator */ +#define BOARD_SLOW_CLOCK_EXT_OSC 32768 + +/** Frequency of the board main clock oscillator */ +#define BOARD_MAIN_CLOCK_EXT_OSC 12000000 + +/** \def Board PIT tick resolution */ +#define BOARD_TIMER_RESOLUTION 1000 + +/* =================== PIN CONSOLE definition ================== */ + +/** CONSOLE pin definition, Use only UART */ +#define PINS_CONSOLE PINS_UART0_IOS1 +#define CONSOLE_PER_ADD UART0 +#define CONSOLE_ID ID_UART0 +#define CONSOLE_BAUDRATE 57600 +#define CONSOLE_DRIVER DRV_UART + +/* =================== PIN LED definition ====================== */ + +/* RGB LED index */ +#define LED_RED 0 /* led red shared with SDMMC0 (eMMC) card detect used only by RomBoot */ +#define LED_GREEN 1 +#define LED_BLUE 2 + +/** LED #0 pin definition (Red). */ +#define PIN_LED_0 { PIO_GROUP_D, PIO_PD21, PIO_OUTPUT_0, PIO_OPENDRAIN } + +/** LED #1 pin definition (Green). */ +#define PIN_LED_1 { PIO_GROUP_D, PIO_PD22, PIO_OUTPUT_0, PIO_OPENDRAIN } + +/** List of all LEDs definitions. */ +#define PINS_LEDS { PIN_LED_0, PIN_LED_1 } + +/* =================== PIN PUSH BUTTON definition ============== */ + +#define PIO_CFG_PB (PIO_PULLUP | PIO_DEBOUNCE) + +#define PIN_PUSHBUTTON_1 { PIO_GROUP_D, PIO_PD19, PIO_INPUT, PIO_CFG_PB } + +#define PIN_PUSHBUTTON_2 { PIO_GROUP_D, PIO_PD20, PIO_INPUT, PIO_CFG_PB } + +/** List of all push button definitions. */ +#define PINS_PUSHBUTTONS { PIN_PUSHBUTTON_1, PIN_PUSHBUTTON_2 } + +/** Push button index. */ +#define PUSHBUTTON_BP1 0 +#define PUSHBUTTON_BP2 1 + +/* ================== PIN USB definition ======================= */ + +/** USB VBus pin */ +#define PIN_USB_VBUS {\ + { PIO_GROUP_A, PIO_PA31, PIO_INPUT, PIO_DEFAULT },\ +} +/** USB OverCurrent detection*/ +#define PIN_USB_OVCUR {\ + { PIO_GROUP_A, PIO_PA29, PIO_INPUT, PIO_DEFAULT },\ +} +/** USB Power Enable A, Active high */ +#define PIN_USB_POWER_ENA {\ + { PIO_GROUP_B, PIO_PB9, PIO_OUTPUT_0, PIO_DEFAULT },\ +} +/** USB Power Enable B, Active high */ +#define PIN_USB_POWER_ENB {\ + { PIO_GROUP_B, PIO_PB10, PIO_OUTPUT_0, PIO_DEFAULT },\ +} + +/* ================= PIN LCD IRQ definition ===================== */ + +#define PIO_CFG_LCD_IRQ (PIO_PULLUP | PIO_IT_FALL_EDGE) + +#define PIN_QT1070_IRQ {\ + { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} +#define PIN_MXT336S_IRQ {\ + { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} +#define PIN_MXT768E_IRQ {\ + { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} + +/* =================== PIN ISC definition ======================= */ + +#define PIN_ISC_RST {\ + { PIO_GROUP_B, PIO_PB11, PIO_OUTPUT_1, PIO_DEFAULT },\ +} +#define PIN_ISC_PWD {\ + { PIO_GROUP_B, PIO_PB12, PIO_OUTPUT_1, PIO_DEFAULT },\ +} + +/* =================== PIN SDMMC definition ===================== */ + +#define SDMMC0_PINS { PINS_SDMMC0_4B_IOS1, PIN_SDMMC0_CK_IOS1,\ + PIN_SDMMC0_CD_IOS1, PIN_SDMMC0_RSTN_IOS1,\ + PIN_SDMMC0_WP_IOS1 } + +/* =================== PIN CAN definition ======================= */ +/* CAN0 {PC1; PC2} is wired to the J18 connector via an AT6561 transceiver. */ + +#define CAN0_PINS PINS_CAN0_IOS0 + +/* =================== NANDFLASH device definition =================== */ + +#define BOARD_NANDFLASH_PINS PINS_NFC_IOS1 +#define BOARD_NANDFLASH_ADDR EBI_CS3_ADDR +#define BOARD_NANDFLASH_CS 3 +#define BOARD_NANDFLASH_BUS_WIDTH 8 + +#endif /* #ifndef _BOARD_D2_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga289.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga289.h new file mode 100644 index 000000000..76727a0c8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga289.h @@ -0,0 +1,194 @@ +/** + * \page sama5d2_xult_board_desc sama5d2-XULT - Board Description + * + * \section Purpose + * + * This file is dedicated to describe the sama5d2-XULT board. + * + * \section Contents + * + * - sama5d2-XULT + * - For sama5d2-XULT information, see \subpage sama5d2_xult_board_info. + * - For operating frequency information, see \subpage sama5d2_xult_opfreq. + * - For using portable PIO definitions, see \subpage sama5d2_xult_piodef. + * - For on-board memories, see \subpage sama5d2_xult_mem. + * - Several USB definitions are included here, see \subpage sama5d2_xult_usb. + * - For External components, see \subpage sama5d2_xult_extcomp. + * - For Individual chip definition, see \subpage sama5d2_xult_chipdef. + * + * To get more software details and the full list of parameters related to the + * sama5d2-XULT board configuration, please have a look at the source file: + * \ref board.h\n + * + * \section Usage + * + * - The code for booting the board is provided by board_cstartup_xxx.c and + * board_lowlevel.c. + * - For using board PIOs, board characteristics (clock, etc.) and external + * components, see board.h. + * - For manipulating memories, see board_memories.h. + * + * This file can be used as a template and modified to fit a custom board, with + * specific PIOs usage or memory connections. + */ + +/** + * \file board.h + * + * Definition of sama5d2-xb + * characteristics, sama5d2-dependant PIOs and external components interfacing. + */ + +#ifndef _BOARD_D2_H +#define _BOARD_D2_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "board_lowlevel.h" +#include "board_memories.h" + +/*---------------------------------------------------------------------------- + * HW BOARD Definitions + *----------------------------------------------------------------------------*/ + +/** + * \page sama5d2_vb_board_info "sama5d2-vb - Board informations" + * This page lists several definition related to the board description. + * + * \section Definitions + * - \ref BOARD_NAME + */ + +/** Name of the board */ +#define BOARD_NAME "sama5d2-vb-bga289" + +/*----------------------------------------------------------------------------*/ +/** + * \page sama5d2_xult_opfreq "sama5d2-XULT - Operating frequencies" + * This page lists several definition related to the board operating frequency + * (when using the initialization done by board_lowlevel.c). + */ + +/** Frequency of the board slow clock oscillator */ +#define BOARD_SLOW_CLOCK_EXT_OSC 32768 + +/** Frequency of the board main clock oscillator */ +#define BOARD_MAIN_CLOCK_EXT_OSC 12000000 + +/** \def Board PIT tick resolution */ +#define BOARD_TIMER_RESOLUTION 1000 + +/* =================== PIN CONSOLE definition ================== */ + +/** CONSOLE pin definition, Use only UART */ +#define PINS_CONSOLE PINS_UART0_IOS1 +#define CONSOLE_PER_ADD UART0 +#define CONSOLE_ID ID_UART0 +#define CONSOLE_BAUDRATE 57600 +#define CONSOLE_DRIVER DRV_UART + +/* =================== PIN LED definition ====================== */ + +/* RGB LED index */ +#define LED_RED 0 /* led red shared with SDMMC0 (eMMC) card detect used only by RomBoot */ +#define LED_GREEN 1 +#define LED_BLUE 2 + +/** LED #0 pin definition (Red). */ +#define PIN_LED_0 { PIO_GROUP_D, PIO_PD21, PIO_OUTPUT_0, PIO_OPENDRAIN } + +/** LED #1 pin definition (Green). */ +#define PIN_LED_1 { PIO_GROUP_D, PIO_PD22, PIO_OUTPUT_0, PIO_OPENDRAIN } + +/** List of all LEDs definitions. */ +#define PINS_LEDS { PIN_LED_0, PIN_LED_1 } + +/* =================== PIN PUSH BUTTON definition ============== */ + +#define PIO_CFG_PB (PIO_PULLUP | PIO_DEBOUNCE) + +#define PIN_PUSHBUTTON_1 { PIO_GROUP_D, PIO_PD23, PIO_INPUT, PIO_CFG_PB } + +#define PIN_PUSHBUTTON_2 { PIO_GROUP_D, PIO_PD24, PIO_INPUT, PIO_CFG_PB } + +/** List of all push button definitions. */ +#define PINS_PUSHBUTTONS { PIN_PUSHBUTTON_1, PIN_PUSHBUTTON_2 } + +/** Push button index. */ +#define PUSHBUTTON_BP1 0 +#define PUSHBUTTON_BP2 1 + +/* ================== PIN USB definition ======================= */ + +/** USB VBus pin */ +#define PIN_USB_VBUS {\ + { PIO_GROUP_C, PIO_PC29, PIO_INPUT, PIO_DEFAULT },\ +} +/** USB OverCurrent detection*/ +#define PIN_USB_OVCUR {\ + { PIO_GROUP_C, PIO_PC31, PIO_INPUT, PIO_DEFAULT },\ +} +/** USB Power Enable A, Active high */ +#define PIN_USB_POWER_ENA {\ + { PIO_GROUP_C, PIO_PC30, PIO_OUTPUT_0, PIO_DEFAULT },\ +} +/** USB Power Enable B, Active high */ +#define PIN_USB_POWER_ENB {\ + { PIO_GROUP_D, PIO_PD0, PIO_OUTPUT_0, PIO_DEFAULT },\ +} + +/* ================= PIN LCD IRQ definition ===================== */ + +#define PIO_CFG_LCD_IRQ (PIO_PULLUP | PIO_IT_FALL_EDGE) + +#define PIN_QT1070_IRQ {\ + { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} +#define PIN_MXT336S_IRQ {\ + { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} +#define PIN_MXT768E_IRQ {\ + { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} + +/* =================== PIN ISC definition ======================= */ + +#define PIN_ISC_RST {\ + { PIO_GROUP_B, PIO_PB11, PIO_OUTPUT_1, PIO_DEFAULT },\ +} +#define PIN_ISC_PWD {\ + { PIO_GROUP_B, PIO_PB12, PIO_OUTPUT_1, PIO_DEFAULT },\ +} + +/* =================== PIN SDMMC definition ===================== */ + +#define SDMMC0_PINS { PINS_SDMMC0_8B_IOS1, PIN_SDMMC0_CK_IOS1,\ + PIN_SDMMC0_CD_IOS1, PIN_SDMMC0_VDDSEL_IOS1,\ + PIN_SDMMC0_RSTN_IOS1, PIN_SDMMC0_WP_IOS1 } + +#define SDMMC1_PINS { PINS_SDMMC1_4B_IOS1, PIN_SDMMC1_CK_IOS1,\ + PIN_SDMMC1_CD_IOS1, PIN_SDMMC1_RSTN_IOS1,\ + PIN_SDMMC1_WP_IOS1 } + +/* =================== PIN CAN definition ======================= */ +/* CAN0 {PC1; PC2} is wired to the J18 connector via an AT6561 transceiver. */ +/* CAN1 {PC26; PC27} is wired to the J19 connector via an AT6561 transceiver. */ + +#define CAN0_PINS PINS_CAN0_IOS0 + +#ifdef MCAN1 +#define CAN1_PINS PINS_CAN1_IOS0 +#endif + +/* =================== NANDFLASH device definition =================== */ + +#define BOARD_NANDFLASH_PINS PINS_NFC_IOS1 +#define BOARD_NANDFLASH_ADDR EBI_CS3_ADDR +#define BOARD_NANDFLASH_CS 3 +#define BOARD_NANDFLASH_BUS_WIDTH 8 + +#endif /* #ifndef _BOARD_D2_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained-proto.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained-proto.h new file mode 100644 index 000000000..b659f62e2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained-proto.h @@ -0,0 +1,325 @@ +/** + * \page sama5d2_xult_board_desc sama5d2-XULT - Board Description + * + * \section Purpose + * + * This file is dedicated to describe the sama5d2-XULT board. + * + * \section Contents + * + * - sama5d2-XULT + * - For sama5d2-XULT information, see \subpage sama5d2_xult_board_info. + * - For operating frequency information, see \subpage sama5d2_xult_opfreq. + * - For using portable PIO definitions, see \subpage sama5d2_xult_piodef. + * - For on-board memories, see \subpage sama5d2_xult_mem. + * - Several USB definitions are included here, see \subpage sama5d2_xult_usb. + * - For External components, see \subpage sama5d2_xult_extcomp. + * - For Individual chip definition, see \subpage sama5d2_xult_chipdef. + * + * To get more software details and the full list of parameters related to the + * sama5d2-XULT board configuration, please have a look at the source file: + * \ref board.h\n + * + * \section Usage + * + * - The code for booting the board is provided by board_cstartup_xxx.c and + * board_lowlevel.c. + * - For using board PIOs, board characteristics (clock, etc.) and external + * components, see board.h. + * - For manipulating memories, see board_memories.h. + * + * This file can be used as a template and modified to fit a custom board, with + * specific PIOs usage or memory connections. + */ + +/** + * \file board.h + * + * Definition of sama5d2-XULT + * characteristics, sama5d4-dependant PIOs and external components interfacing. + */ + +#ifndef _BOARD_D2_H +#define _BOARD_D2_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "board_lowlevel.h" +#include "board_memories.h" + +/*---------------------------------------------------------------------------- + * HW BOARD Definitions + *----------------------------------------------------------------------------*/ + +/** + * \page sama5d2_xult_board_info "sama5d2-XULT - Board informations" + * This page lists several definition related to the board description. + * + * \section Definitions + * - \ref BOARD_NAME + */ + +/** Name of the board */ +#define BOARD_NAME "sama5d2-xult-proto" + +/** Family definition */ +#if !defined sama5d2 + #define sama5d2 +#endif + +/** Board definition */ +#define sama5d2xult + +/** Core definition */ +#define cortexa5 + +#define BOARD_REV_A_XULT + +/*----------------------------------------------------------------------------*/ +/** + * \page sama5d2_xult_opfreq "sama5d2-XULT - Operating frequencies" + * This page lists several definition related to the board operating frequency + * (when using the initialization done by board_lowlevel.c). + */ + +/** Frequency of the board slow clock oscillator */ +#define BOARD_SLOW_CLOCK_EXT_OSC 32768 + +/** Frequency of the board main clock oscillator */ +#define BOARD_MAIN_CLOCK_EXT_OSC 12000000 + +/** /def Definition of DDRAM's type */ +#define BOARD_DDRAM_TYPE MT41K128M16 + +/** \def Board DDR memory size in bytes */ +#define BOARD_DDR_MEMORY_SIZE 512*1024*1024 + +/** \def Board PIT tick resolution */ +#define BOARD_TIMER_RESOLUTION 1000 + +/* =================== PIN CONSOLE definition ================== */ + +/** CONSOLE pin definition, Use only UART */ +#define PINS_CONSOLE PINS_UART1_IOS1 +#define CONSOLE_PER_ADD UART1 +#define CONSOLE_ID ID_UART1 +#define CONSOLE_BAUDRATE 57600 +#define CONSOLE_DRIVER DRV_UART + +/* =================== PIN LED definition ====================== */ + +/* RGB LED index */ +#define LED_RED 0 /* led red shared with SDMMC0 (eMMC) card detect used only by RomBoot */ +#define LED_GREEN 1 +#define LED_BLUE 2 + +/** LED #0 pin definition (Red). */ +#define PIN_LED_0 { PIO_GROUP_A, PIO_PA13, PIO_OUTPUT_0, PIO_OPENDRAIN } + +/** LED #1 pin definition (Green). */ +#define PIN_LED_1 { PIO_GROUP_B, PIO_PB5, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** LED #2 pin definition (Blue). */ +#define PIN_LED_2 { PIO_GROUP_B, PIO_PB0, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** List of all LEDs definitions. */ +#define PINS_LEDS { PIN_LED_0, PIN_LED_1, PIN_LED_2 } + +/* =================== LWM LED definition ====================== */ + +/** LED #1 PWM Channel */ +#define PWM_LED_CH_0 2 + +/** LED #2 PWM Channel */ +#define PWM_LED_CH_1 1 + +/** LED #1 pin definition (Green). */ +#define PIN_PWM_LED_0 { PIO_GROUP_B, PIO_PB5C_PWMH2, PIO_PERIPH_C, PIO_PULLUP } + +/** LED #2 pin definition (Blue). */ +#define PIN_PWM_LED_1 { PIO_GROUP_B, PIO_PB0D_PWMH1, PIO_PERIPH_D, PIO_PULLUP } + +/** List of all PWM LED channels */ +#define PWM_LEDS_CH { PWM_LED_CH_0, PWM_LED_CH_1 } + +/** List of all LEDs definitions in PWM mode (red LED is not on a PWM pin) */ +#define PINS_PWM_LEDS { PIN_PWM_LED_0, PIN_PWM_LED_1 } + +/* =================== PIN PUSH BUTTON definition ============== */ + +#define PIO_CFG_PB (PIO_PULLUP | PIO_DEBOUNCE) + +#define PIN_PUSHBUTTON_1 { PIO_GROUP_B, PIO_PB6, PIO_INPUT, PIO_CFG_PB } + +/** List of all push button definitions. */ +#define PINS_PUSHBUTTONS { PIN_PUSHBUTTON_1 } + +/** Push button index. */ +#define PUSHBUTTON_BP1 0 + +/* ================== ACT8945A PMIC definition ====================== */ + +#define ACT8945A_PINS PINS_FLEXCOM4_TWI_IOS3 +#define ACT8945A_ADDR TWI4 +#define ACT8945A_FREQ 400000 +#define ACT8945A_PIN_CHGLEV \ + { PIO_GROUP_A, PIO_PA12, PIO_OUTPUT_0, PIO_PULLUP } +#define ACT8945A_PIN_IRQ \ + { PIO_GROUP_B, PIO_PB13, PIO_INPUT, PIO_PULLUP | PIO_IT_FALL_EDGE } +#define ACT8945A_PIN_LBO \ + { PIO_GROUP_A, PIO_PB13, PIO_INPUT, PIO_PULLUP } + +/* ================== PIN USB definition ======================= */ + +/** USB VBus pin */ +#define PIN_USB_VBUS {\ + { PIO_GROUP_A, PIO_PA31, PIO_INPUT, PIO_DEBOUNCE | PIO_IT_BOTH_EDGE },\ +} +/** USB OverCurrent detection*/ +#define PIN_USB_OVCUR {\ + { PIO_GROUP_A, PIO_PA29, PIO_INPUT, PIO_DEFAULT },\ +} +/** USB Power Enable A, Active high */ +#define PIN_USB_POWER_ENA {\ + { PIO_GROUP_B, PIO_PB9, PIO_OUTPUT_0, PIO_DEFAULT },\ +} +/** USB Power Enable B, Active high */ +#define PIN_USB_POWER_ENB {\ + { PIO_GROUP_B, PIO_PB10, PIO_OUTPUT_0, PIO_DEFAULT },\ +} + +/* ================= PIN LCD IRQ definition ===================== */ + +#define PIO_CFG_LCD_IRQ (PIO_PULLUP | PIO_IT_FALL_EDGE) + +#define PIN_QT1070_IRQ {\ + { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} +#define PIN_MXT336S_IRQ {\ + { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} +#define PIN_MXT768E_IRQ {\ + { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_CFG_LCD_IRQ },\ +} + +/* =================== PIN ISC definition ======================= */ + +#define ISC_TWI_ADDR ((Twi*)TWIHS0) +#define ISC_TWI_PINS PINS_TWI0_IOS4 +#define ISC_PINS PINS_ISC_IOS3 +#define ISC_PIN_RST { PIO_GROUP_B, PIO_PB11, PIO_OUTPUT_1, PIO_DEFAULT } +#define ISC_PIN_PWD { PIO_GROUP_B, PIO_PB12, PIO_OUTPUT_1, PIO_DEFAULT } + +/* =================== PIN ClassD definition ==================== */ + +#define CLASSD_PINS PINS_CLASSD_IOS1 + +/* =================== PIN SDMMC definition ===================== */ + +#define SDMMC0_PINS { PINS_SDMMC0_8B_IOS1, PIN_SDMMC0_CK_IOS1,\ + PIN_SDMMC0_VDDSEL_IOS1, PIN_SDMMC0_RSTN_IOS1 } + +#define SDMMC1_PINS { PINS_SDMMC1_4B_IOS1, PIN_SDMMC1_CK_IOS1,\ + PIN_SDMMC1_CD_IOS1 } + +/* =================== AT25 device definition =================== */ + +#define AT25_PINS PINS_SPI0_NPCS0_IOS1 +#define AT25_ADDR SPI0 +#define AT25_CS 0 +#define AT25_ATTRS (SPI_MR_MODFDIS | SPI_MR_WDRBT | SPI_MR_MSTR) +#define AT25_FREQ 40000 /* (value in KHz) */ +#define AT25_LOW_FREQ 20000 /* (value in KHz) */ +#define AT25_DLYBS 0 +#define AT25_DLYCT 0 +#define AT25_SPI_MODE (SPI_CSR_NCPHA | SPI_CSR_BITS_8_BIT) + +/* =================== AT24 device definition =================== */ +#define AT24_PINS PINS_TWI1_IOS2; +#define AT24_ADDR ((Twi*)TWIHS1) +#define AT24_FREQ 400000 +#define AT24_DESC {"AT24MAC402", 0xFF, 16} + +/* =================== QSPI serial flashdevice definition ======= */ + +#define QSPIFLASH_PINS PINS_QSPI0_IOS3 +#define QSPIFLASH_ADDR QSPI0 +#define QSPIFLASH_BAUDRATE 50000000 /* 50 MHz */ + +/* =================== CAN device definition ==================== */ +/* Both ports are wired to the J9 connector: + * CANTX0 = PC10 = J9:8 + * CANRX0 = PC11 = J9:7 + * CANTX1 = PC26 = J9:6 + * CANRX1 = PC27 = J9:5 */ + +#define CAN0_PINS PINS_CAN0_IOS1 +#define CAN1_PINS PINS_CAN1_IOS0 + +/* =================== GMAC/PHY definition =================== */ + +#define GMAC0_ADDR GMAC0 +#define GMAC0_PINS PINS_GMAC_RMII_IOS3 +#define GMAC0_PHY_ADDR 0 +#define GMAC0_PHY_IRQ_PIN PIN_GTSUCOM_IOS1 +#define GMAC0_PHY_RETRIES PHY_DEFAULT_RETRIES + +/* =================== ILI9488 device definition =================== */ +/* Connected on board A5D2, XPRO EXT2 connector */ + +/* ILI9488 ID code */ +#define ILI9488_DEVICE_CODE 0x2810 + +#define ILI9488_PINS PINS_SPI1_NPCS1_IOS3 +#define ILI9488_ADDR SPI1 +#define ILI9488_CS 1 +#define ILI9488_ATTRS (SPI_MR_MODFDIS | SPI_MR_MSTR) // | SPI_MR_WDRBT +#define ILI9488_FREQ 40000 /* (value in KHz) */ +#define ILI9488_DLYBS 100 +#define ILI9488_DLYCT 100 +//#define ILI9488_SPI_MODE (SPI_CSR_NCPHA | SPI_CSR_BITS_9_BIT) +#define ILI9488_SPI_MODE (SPI_CSR_CPOL | SPI_CSR_BITS_9_BIT) + +#define MXTX_RESET_PIN {\ + {PIO_GROUP_D, PIO_PD28, PIO_OUTPUT_1, PIO_DEFAULT} \ + } +#define MXTX_BACKLIGHT_PIN {\ + {PIO_GROUP_B, PIO_PB5C_PWMH2, PIO_PERIPH_C, PIO_DEFAULT} \ + } + +/* =================== LCD Touch board definition =================== */ + +/** PIO pins for LCD */ +#define BOARD_LCD_PINS PINS_LCD_IOS2 + +/** Display width in pixels. */ +#define BOARD_LCD_WIDTH 480 +/** Display height in pixels. */ +#define BOARD_LCD_HEIGHT 272 +/** Frame rate in Hz. */ +#define BOARD_LCD_FRAMERATE 40 + +/** Vertical front porch in number of lines. */ +#define BOARD_LCD_TIMING_VFP 22 +/** Vertical back porch in number of lines. */ +#define BOARD_LCD_TIMING_VBP 21 +/** Vertical pulse width in number of lines. */ +#define BOARD_LCD_TIMING_VPW 2 +/** Horizontal front porch in LCDDOTCLK cycles. */ +#define BOARD_LCD_TIMING_HFP 64 +/** Horizontal back porch in LCDDOTCLK cycles. */ +#define BOARD_LCD_TIMING_HBP 64 +/** Horizontal pulse width in LCDDOTCLK cycles. */ +#define BOARD_LCD_TIMING_HPW 128 + +/* =================== QT1070 device definition =================== */ +#define QT1070_PINS PINS_TWI1_IOS2; +#define QT1070_ADDR ((Twi*)TWIHS1) +#define QT1070_FREQ 400000 +#define QT1070_DESC {"QT1070", 0x00, 00} + +#endif /* #ifndef _BOARD_D2_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained.h new file mode 100644 index 000000000..4fa20313f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-xplained.h @@ -0,0 +1,362 @@ +/** + * \page sama5d2_xult_board_desc sama5d2-XULT - Board Description + * + * \section Purpose + * + * This file is dedicated to describe the sama5d2-XULT board. + * + * \section Contents + * + * - sama5d2-XULT + * - For sama5d2-XULT information, see \subpage sama5d2_xult_board_info. + * - For operating frequency information, see \subpage sama5d2_xult_opfreq. + * - For using portable PIO definitions, see \subpage sama5d2_xult_piodef. + * - For on-board memories, see \subpage sama5d2_xult_mem. + * - Several USB definitions are included here, see \subpage sama5d2_xult_usb. + * - For External components, see \subpage sama5d2_xult_extcomp. + * - For Individual chip definition, see \subpage sama5d2_xult_chipdef. + * + * To get more software details and the full list of parameters related to the + * sama5d2-XULT board configuration, please have a look at the source file: + * \ref board.h\n + * + * \section Usage + * + * - The code for booting the board is provided by board_cstartup_xxx.c and + * board_lowlevel.c. + * - For using board PIOs, board characteristics (clock, etc.) and external + * components, see board.h. + * - For manipulating memories, see board_memories.h. + * + * This file can be used as a template and modified to fit a custom board, with + * specific PIOs usage or memory connections. + */ + +/** + * \file board.h + * + * Definition of sama5d2-XULT + * characteristics, sama5d4-dependant PIOs and external components interfacing. + */ + +#ifndef _BOARD_D2_H +#define _BOARD_D2_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" + +#include "board_lowlevel.h" +#include "board_memories.h" + +/*---------------------------------------------------------------------------- + * HW BOARD Definitions + *----------------------------------------------------------------------------*/ + +/** + * \page sama5d2_xult_board_info "sama5d2-XULT - Board informations" + * This page lists several definition related to the board description. + * + * \section Definitions + * - \ref BOARD_NAME + */ + +/** Name of the board */ +#define BOARD_NAME "sama5d2-xult" + +/** Family definition */ +#if !defined sama5d2 + #define sama5d2 +#endif + +/** Board definition */ +#define sama5d2xult + +/** Core definition */ +#define cortexa5 + +#define BOARD_REV_A_XULT + +/*----------------------------------------------------------------------------*/ +/** + * \page sama5d2_xult_opfreq "sama5d2-XULT - Operating frequencies" + * This page lists several definition related to the board operating frequency + * (when using the initialization done by board_lowlevel.c). + */ + +/** Frequency of the board slow clock oscillator */ +#define BOARD_SLOW_CLOCK_EXT_OSC 32768 + +/** Frequency of the board main clock oscillator */ +#define BOARD_MAIN_CLOCK_EXT_OSC 12000000 + +/** /def Definition of DDRAM's type */ +#define BOARD_DDRAM_TYPE MT41K128M16 + +/** \def Board DDR memory size in bytes */ +#define BOARD_DDR_MEMORY_SIZE 512*1024*1024 + +/** \def Board PIT tick resolution */ +#define BOARD_TIMER_RESOLUTION 1000 + +/* =================== PIN CONSOLE definition ================== */ + +/** CONSOLE pin definition, Use only UART */ +#define PINS_CONSOLE PINS_UART1_IOS1 +#define CONSOLE_PER_ADD UART1 +#define CONSOLE_ID ID_UART1 +#define CONSOLE_BAUDRATE 57600 +#define CONSOLE_DRIVER DRV_UART + +/* =================== PIN LED definition ====================== */ + +/* RGB LED index */ +#define LED_RED 0 +#define LED_GREEN 1 +#define LED_BLUE 2 + +/* WHIS: ADDED CODE BELOW TO RE-MAP THE LED DEFINITIONS TO BOARD + CONNECTOR-ACCESSIBLE GPIOs, AS ON OUR EXAMPLE BOARD, VDD_LED WAS OFF + BY DEFAULT AND THE DEPENDENCIES INVOLVED IN COMPTROLLING THE + ACT8945a POWER/CHARGER CHIP DRIVER ARE ONEROUS FOR A SIMPLE DEMO. + + These come out on pins 30, 32, 34 of J17. Pin 36 is GND. Configured + for push/pull operation with HI drive, connect LEDs between pins and + GND via circa 100R resistors (max drive current 18mA, voltage 1.8v) + + Define LEDS_ON_J17 in project pre-processor options to use this. */ + +#ifdef LEDS_ON_J17 + +/** LED #0 pin definition. Pin 30 */ +#define PIN_LED_0 { PIO_GROUP_B, PIO_PB25, PIO_OUTPUT_0, PIO_DEFAULT | PIO_DRVSTR_HI } + +/** LED #1 pin definition Pin 32. */ +#define PIN_LED_1 { PIO_GROUP_C, PIO_PC8, PIO_OUTPUT_0, PIO_DEFAULT | PIO_DRVSTR_HI } + +/** LED #2 pin definition Pin 34 */ +#define PIN_LED_2 { PIO_GROUP_C, PIO_PC26, PIO_OUTPUT_0, PIO_DEFAULT | PIO_DRVSTR_HI } + +#else +/** LED #0 pin definition (Red). */ +#define PIN_LED_0 { PIO_GROUP_B, PIO_PB6, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** LED #1 pin definition (Green). */ +#define PIN_LED_1 { PIO_GROUP_B, PIO_PB5, PIO_OUTPUT_1, PIO_OPENDRAIN } + +/** LED #2 pin definition (Blue). */ +#define PIN_LED_2 { PIO_GROUP_B, PIO_PB0, PIO_OUTPUT_1, PIO_OPENDRAIN } +#endif + +/** List of all LEDs definitions. */ +#define PINS_LEDS { PIN_LED_0, PIN_LED_1, PIN_LED_2 } + +/* =================== LWM LED definition ====================== */ + +/** LED #1 PWM Channel */ +#define PWM_LED_CH_0 2 + +/** LED #2 PWM Channel */ +#define PWM_LED_CH_1 1 + +/** LED #1 pin definition (Green). */ +#define PIN_PWM_LED_0 { PIO_GROUP_B, PIO_PB5C_PWMH2, PIO_PERIPH_C, PIO_PULLUP } + +/** LED #2 pin definition (Blue). */ +#define PIN_PWM_LED_1 { PIO_GROUP_B, PIO_PB0D_PWMH1, PIO_PERIPH_D, PIO_PULLUP } + +/** List of all PWM LED channels */ +#define PWM_LEDS_CH { PWM_LED_CH_0, PWM_LED_CH_1 } + +/** List of all LEDs definitions in PWM mode (red LED is not on a PWM pin) */ +#define PINS_PWM_LEDS { PIN_PWM_LED_0, PIN_PWM_LED_1 } + +/* =================== PIN PUSH BUTTON definition ============== */ + +#define PIO_CFG_PB (PIO_PULLUP | PIO_DEBOUNCE) + +#define PIN_PUSHBUTTON_1 { PIO_GROUP_B, PIO_PB9, PIO_INPUT, PIO_CFG_PB } + +/** List of all push button definitions. */ +#define PINS_PUSHBUTTONS { PIN_PUSHBUTTON_1 } + +/** Push button index. */ +#define PUSHBUTTON_BP1 0 + +/* ================== ACT8945A PMIC definition ====================== */ + +#define ACT8945A_PINS PINS_FLEXCOM4_TWI_IOS3 +#define ACT8945A_ADDR TWI4 +#define ACT8945A_FREQ 400000 +#define ACT8945A_PIN_CHGLEV \ + { PIO_GROUP_A, PIO_PA12, PIO_OUTPUT_0, PIO_PULLUP } +#define ACT8945A_PIN_IRQ \ + { PIO_GROUP_B, PIO_PB13, PIO_INPUT, PIO_PULLUP | PIO_IT_FALL_EDGE } +#define ACT8945A_PIN_LBO \ + { PIO_GROUP_C, PIO_PC8, PIO_INPUT, PIO_PULLUP | PIO_IT_FALL_EDGE } + +/* ================== PIN USB definition ======================= */ + +/** USB VBus pin */ +#define PIN_USB_VBUS \ + { PIO_GROUP_A, PIO_PA31, PIO_INPUT, PIO_DEBOUNCE | PIO_IT_BOTH_EDGE } + +/** USB OverCurrent detection*/ +#define PIN_USB_OVCUR \ + { PIO_GROUP_A, PIO_PA29, PIO_INPUT, PIO_DEFAULT } + +/** USB Power Enable A, Active high */ +#define PIN_USB_POWER_ENA \ + { PIO_GROUP_B, PIO_PB9, PIO_OUTPUT_0, PIO_DEFAULT } + +/** USB Power Enable B, Active high */ +#define PIN_USB_POWER_ENB \ + { PIO_GROUP_B, PIO_PB10, PIO_OUTPUT_0, PIO_DEFAULT } + +/* ================= PIN LCD IRQ definition ===================== */ + +#define PIO_CFG_LCD_IRQ (PIO_PULLUP | PIO_IT_FALL_EDGE) + +#define PIN_QT1070_IRQ { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ } + +#define PIN_MXT_IRQ { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_PULLUP | PIO_IT_LOW_LEVEL } + +//#define PIN_MXT_IRQ { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_PULLUP } + +/* =================== PIN ISC definition ======================= */ + +#define ISC_TWI_ADDR ((Twi*)TWIHS1) +#define ISC_TWI_PINS PINS_TWI1_IOS2 +#define ISC_PINS PINS_ISC_IOS3 +#define ISC_PIN_RST { PIO_GROUP_B, PIO_PB11, PIO_OUTPUT_1, PIO_DEFAULT } +#define ISC_PIN_PWD { PIO_GROUP_B, PIO_PB12, PIO_OUTPUT_1, PIO_DEFAULT } + +/* =================== PIN ClassD definition ==================== */ + +#define BOARD_CLASSD_PINS { PIN_CLASSD_R0_IOS1, PIN_CLASSD_R1_IOS1,\ + PIN_CLASSD_R2_IOS1, PIN_CLASSD_R3_IOS1 } +#define BOARD_CLASSD_MODE CLASSD_OUTPUT_FULL_BRIDGE +#define BOARD_CLASSD_MONO true +#define BOARD_CLASSD_MONO_MODE CLASSD_MONO_MIXED + +/* =================== PIN SDMMC definition ===================== */ + +#define SDMMC0_PINS { PINS_SDMMC0_8B_IOS1, PIN_SDMMC0_CK_IOS1,\ + PIN_SDMMC0_CD_IOS1, PIN_SDMMC0_VDDSEL_IOS1,\ + PIN_SDMMC0_RSTN_IOS1 } + +#define SDMMC1_PINS { PINS_SDMMC1_4B_IOS1, PIN_SDMMC1_CK_IOS1,\ + PIN_SDMMC1_CD_IOS1 } + +/* =================== AT25 device definition =================== */ + +#define AT25_PINS PINS_SPI0_NPCS0_IOS1 +#define AT25_ADDR SPI0 +#define AT25_CS 0 +#define AT25_ATTRS (SPI_MR_MODFDIS | SPI_MR_WDRBT | SPI_MR_MSTR) +#define AT25_FREQ 40000 /* (value in KHz) */ +#define AT25_LOW_FREQ 20000 /* (value in KHz) */ +#define AT25_DLYBS 0 +#define AT25_DLYCT 0 +#define AT25_SPI_MODE (SPI_CSR_NCPHA | SPI_CSR_BITS_8_BIT) + +/* =================== AT24 device definition =================== */ +#define AT24_PINS PINS_TWI1_IOS2; +#define AT24_ADDR ((Twi*)TWIHS1) +#define AT24_FREQ 400000 +#define AT24_DESC {"AT24MAC402", 0xFF, 16} + +/* =================== QSPI serial flashdevice definition ======= */ + +#define QSPIFLASH_PINS PINS_QSPI0_IOS3 +#define QSPIFLASH_ADDR QSPI0 +#define QSPIFLASH_BAUDRATE 50000000 /* 50 MHz */ + +/* =================== CAN device definition ==================== */ +/* Both ports are wired to the J9 connector: + * CANTX0 = PC10 = J9:8 + * CANRX0 = PC11 = J9:7 + * CANTX1 = PC26 = J9:6 + * CANRX1 = PC27 = J9:5 */ + +#define CAN0_PINS PINS_CAN0_IOS1 +#define CAN1_PINS PINS_CAN1_IOS0 + +/* =================== GMAC/PHY definition =================== */ + +#define GMAC0_ADDR GMAC0 +#define GMAC0_PINS PINS_GMAC_RMII_IOS3 +#define GMAC0_PHY_ADDR 0 +#define GMAC0_PHY_IRQ_PIN PIN_GTSUCOM_IOS1 +#define GMAC0_PHY_RETRIES PHY_DEFAULT_RETRIES + +/* =================== ILI9488 device definition =================== */ +/* Connected on board A5D2, XPRO EXT2 connector */ + +/* ILI9488 ID code */ +#define ILI9488_DEVICE_CODE 0x2810 + +#define ILI9488_PINS PINS_SPI1_NPCS1_IOS3 +#define ILI9488_ADDR SPI1 +#define ILI9488_CS 1 +#define ILI9488_ATTRS (SPI_MR_MODFDIS | SPI_MR_MSTR) // | SPI_MR_WDRBT +#define ILI9488_FREQ 40000 /* (value in KHz) */ +#define ILI9488_DLYBS 100 +#define ILI9488_DLYCT 100 +//#define ILI9488_SPI_MODE (SPI_CSR_NCPHA | SPI_CSR_BITS_9_BIT) +#define ILI9488_SPI_MODE (SPI_CSR_CPOL | SPI_CSR_BITS_9_BIT) + +#define MXTX_RESET_PIN {\ + {PIO_GROUP_D, PIO_PD28, PIO_OUTPUT_1, PIO_DEFAULT} \ + } +#define MXTX_BACKLIGHT_PIN {\ + {PIO_GROUP_B, PIO_PB5C_PWMH2, PIO_PERIPH_C, PIO_DEFAULT} \ + } + +/* ======================== LCD definition ======================== */ + +/** PIO pins for LCD */ +#define BOARD_LCD_PINS PINS_LCD_IOS2 + +/** Display width in pixels. */ +#define BOARD_LCD_WIDTH 480 +/** Display height in pixels. */ +#define BOARD_LCD_HEIGHT 272 +/** Frame rate in Hz. */ +#define BOARD_LCD_FRAMERATE 40 + +/** Vertical front porch in number of lines. */ +#define BOARD_LCD_TIMING_VFP 22 +/** Vertical back porch in number of lines. */ +#define BOARD_LCD_TIMING_VBP 21 +/** Vertical pulse width in number of lines. */ +#define BOARD_LCD_TIMING_VPW 2 +/** Horizontal front porch in LCDDOTCLK cycles. */ +#define BOARD_LCD_TIMING_HFP 64 +/** Horizontal back porch in LCDDOTCLK cycles. */ +#define BOARD_LCD_TIMING_HBP 64 +/** Horizontal pulse width in LCDDOTCLK cycles. */ +#define BOARD_LCD_TIMING_HPW 128 + +/* =================== QT1070 device definition =================== */ +#define QT1070_PINS PINS_TWI1_IOS2; +#define QT1070_ADDR ((Twi*)TWIHS1) +#define QT1070_FREQ 400000 +#define QT1070_DESC {"QT1070", 0x00, 00} + +/* =================== MXTxxx device definition =================== */ +#define MXT_PINS PINS_TWI1_IOS2; +#define MXT_ADDR ((Twi*)TWIHS1) +#define MXT_FREQ 400000 +#define MXT_DESC {"MXT", 0x00, 00} + +/** + * USB attributes configuration descriptor (bus or self powered, + * remote wakeup) + */ +#define BOARD_USB_BMATTRIBUTES \ + USBConfigurationDescriptor_SELFPOWERED_NORWAKEUP + +#endif /* #ifndef _BOARD_D2_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/bootstrap.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/bootstrap.c new file mode 100644 index 000000000..47e0eb720 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/bootstrap.c @@ -0,0 +1,38 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +#include "board.h" + +int main(void) +{ + board_cfg_ddram(); + asm("BKPT"); + /* never reached */ + return 0; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.c new file mode 100644 index 000000000..b0e1dcfe8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.c @@ -0,0 +1,418 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2014, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "compiler.h" + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +struct peripheral_xdma { + uint32_t id; /**< Peripheral ID */ + uint8_t iftx; /**< DMA Interface for TX */ + uint8_t ifrx; /**< DMA Interface for RX */ +}; + +/*---------------------------------------------------------------------------- + * Local constants + *----------------------------------------------------------------------------*/ + +static uint8_t _h64_peripherals[] = { + ID_ARM_PMU, /* 2: Performance Monitor Unit (PMU) (ARM_PMU) */ + ID_XDMAC0, /* 6: DMA Controller 0 (XDMAC0) */ + ID_XDMAC1, /* 7: DMA Controller 1 (XDMAC1) */ + ID_AES, /* 9: Advanced Enion Standard (AES) */ + ID_AESB, /* 10: AES bridge (AESB) */ + ID_SHA, /* 12: SHA Signature (SHA) */ + ID_MPDDRC, /* 13: MPDDR controller (MPDDRC) */ + ID_MATRIX0, /* 15: H64MX, 64-bit AHB Matrix (MATRIX0) */ + ID_SDMMC0, /* 31: Secure Digital Multimedia Card Controller 0 (SDMMC0) */ + ID_SDMMC1, /* 32: Secure Digital Multimedia Card Controller 1 (SDMMC1) */ + ID_LCDC, /* 45: LCD Controller (LCDC) */ + ID_ISC, /* 46: Camera Interface (ISC) */ + ID_QSPI0, /* 52: QSPI 0 (QSPI0) */ + ID_QSPI1, /* 53: QSPI 1 (QSPI1) */ + ID_L2CC, /* 63: L2 Cache Controller (L2CC) */ +}; + +static const struct peripheral_xdma _xdmac_peripherals[] = { + { ID_TWIHS0, 0, 1 }, + { ID_TWIHS1, 2, 3 }, + { ID_QSPI0, 4, 5 }, + { ID_SPI0, 6, 7 }, + { ID_SPI1, 8, 9 }, + { ID_PWM, 10, 0xff }, + { ID_FLEXCOM0, 11, 12 }, + { ID_FLEXCOM1, 13, 14 }, + { ID_FLEXCOM2, 15, 16 }, + { ID_FLEXCOM3, 17, 18 }, + { ID_FLEXCOM4, 19, 20 }, + { ID_SSC0, 21, 22 }, + { ID_SSC1, 23, 24 }, + { ID_ADC, 0xff, 25 }, + { ID_AES, 26, 27 }, + { ID_TDES, 28, 29 }, + { ID_SHA, 30, 0xff }, + { ID_I2SC0, 31, 32 }, + { ID_I2SC1, 33, 34 }, + { ID_UART0, 35, 36 }, + { ID_UART1, 37, 38 }, + { ID_UART2, 39, 40 }, + { ID_UART3, 41, 42 }, + { ID_UART4, 43, 44 }, + { ID_TC0, 0xff, 45 }, + { ID_TC1, 0xff, 46 }, + { ID_CLASSD, 47, 0xff }, + { ID_QSPI0, 48, 49 }, + { ID_PDMIC, 0xff, 50 }, +}; + +/*---------------------------------------------------------------------------- + * Private functions + *----------------------------------------------------------------------------*/ + +static const struct peripheral_xdma *get_peripheral_xdma(uint32_t id, Xdmac *xdmac) +{ + unsigned int i; + + if (xdmac != XDMAC0 && xdmac != XDMAC1) { + return NULL; + } + + for (i = 0; i < ARRAY_SIZE(_xdmac_peripherals); i++) { + if (_xdmac_peripherals[i].id == id) { + return &_xdmac_peripherals[i]; + } + } + + return NULL; +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +Flexcom* get_flexcom_addr_from_id(const uint32_t id) +{ + if (id == ID_FLEXCOM0) return FLEXCOM0; /**< \brief FLEXCOM 0 (FLEXCOM0) */ +#ifdef FLEXCOM1 + else if (id == ID_FLEXCOM1) return FLEXCOM1; /**< \brief FLEXCOM 1 (FLEXCOM1) */ +#endif +#ifdef FLEXCOM2 + else if (id == ID_FLEXCOM2) return FLEXCOM2; /**< \brief FLEXCOM 2 (FLEXCOM2) */ +#endif +#ifdef FLEXCOM3 + else if (id == ID_FLEXCOM3) return FLEXCOM3; /**< \brief FLEXCOM 3 (FLEXCOM3) */ +#endif +#ifdef FLEXCOM4 + else if (id == ID_FLEXCOM4) return FLEXCOM4; /**< \brief FLEXCOM 4 (FLEXCOM4) */ +#endif + else return (void*)0; +} + +uint32_t get_twi_id_from_addr(const Twi* addr) +{ + if (addr == (void*)TWI0) return ID_FLEXCOM0; /**< \brief FLEXCOM 0 (FLEXCOM0) */ +#ifdef TWI1 + else if (addr == (void*)TWI1) return ID_FLEXCOM1; /**< \brief FLEXCOM 1 (FLEXCOM1) */ +#endif +#ifdef TWI2 + else if (addr == (void*)TWI2) return ID_FLEXCOM2; /**< \brief FLEXCOM 2 (FLEXCOM2) */ +#endif +#ifdef TWI3 + else if (addr == (void*)TWI3) return ID_FLEXCOM3; /**< \brief FLEXCOM 3 (FLEXCOM3) */ +#endif +#ifdef TWI4 + else if (addr == (void*)TWI4) return ID_FLEXCOM4; /**< \brief FLEXCOM 4 (FLEXCOM4) */ +#endif +#ifdef TWIHS0 + else if (addr == (void*)TWIHS0) return ID_TWIHS0; /**< \brief TWIHS0 */ +#endif +#ifdef TWIHS0 + else if (addr == (void*)TWIHS1) return ID_TWIHS1; /**< \brief TWIHS1 */ +#endif + else return ID_PERIPH_COUNT; +} + +Twi* get_twi_addr_from_id(const uint32_t id) +{ + if (id == ID_FLEXCOM0) return TWI0; /**< \brief FLEXCOM 0 (FLEXCOM0) */ +#ifdef TWI1 + else if (id == ID_FLEXCOM1) return TWI1; /**< \brief FLEXCOM 1 (FLEXCOM1) */ +#endif +#ifdef TWI2 + else if (id == ID_FLEXCOM2) return TWI2; /**< \brief FLEXCOM 2 (FLEXCOM2) */ +#endif +#ifdef TWI3 + else if (id == ID_FLEXCOM3) return TWI3; /**< \brief FLEXCOM 3 (FLEXCOM3) */ +#endif +#ifdef TWI4 + else if (id == ID_FLEXCOM4) return TWI4; /**< \brief FLEXCOM 4 (FLEXCOM4) */ +#endif +#ifdef TWIHS0 + else if (id == ID_TWIHS0) return (Twi*)TWIHS0; /**< \brief TWIHS0 */ +#endif +#ifdef TWIHS1 + else if (id == ID_TWIHS1) return (Twi*)TWIHS1; /**< \brief TWIHS1 */ +#endif + else return (void*)0; +} + +uint32_t get_spi_id_from_addr(const Spi* addr) +{ + if (addr == (void*)SPI0) return ID_SPI0; +#ifdef SPI1 + else if (addr == (void*)SPI1) return ID_SPI1; +#endif +#ifdef FCOMSPI0 + else if (addr == (void*)FCOMSPI0) return ID_FCOMSPI0; +#endif +#ifdef FCOMSPI1 + else if (addr == (void*)FCOMSPI1) return ID_FCOMSPI1; +#endif +#ifdef FCOMSPI2 + else if (addr == (void*)FCOMSPI2) return ID_FCOMSPI2; +#endif +#ifdef FCOMSPI3 + else if (addr == (void*)FCOMSPI3) return ID_FCOMSPI3; +#endif +#ifdef FCOMSPI4 + else if (addr == (void*)FCOMSPI4) return ID_FCOMSPI4; +#endif + else return ID_PERIPH_COUNT; +} + +Spi* get_spi_addr_from_id(const uint32_t id) +{ + if (id == ID_SPI0) return SPI0; /**< \brief SPI 0 (SPI0) */ +#ifdef SPI1 + else if (id == ID_SPI1) return SPI1; /**< \brief SPI 1 (SPI1) */ +#endif +#ifdef FCOMSPI0 + else if (id == ID_FCOMSPI0) return FCOMSPI0; /**< \brief FLEXCOM SPI 0 (FCOMSPI0) */ +#endif +#ifdef FCOMSPI1 + else if (id == ID_FCOMSPI1) return FCOMSPI1; /**< \brief FLEXCOM SPI 1 (FCOMSPI1) */ +#endif +#ifdef FCOMSPI2 + else if (id == ID_FCOMSPI2) return FCOMSPI2; /**< \brief FLEXCOM SPI 1 (FCOMSPI1) */ +#endif +#ifdef FCOMSPI3 + else if (id == ID_FCOMSPI3) return FCOMSPI3; /**< \brief FLEXCOM SPI 3 (FCOMSPI3) */ +#endif +#ifdef FCOMSPI4 + else if (id == ID_FCOMSPI4) return FCOMSPI4; /**< \brief FLEXCOM SPI 4 (FCOMSPI4) */ +#endif + else return (void*)0; +} + +uint32_t get_uart_id_from_addr(const Uart* addr) +{ + if (addr == (void*)UART0) return ID_UART0; +#ifdef UART1 + else if (addr == (void*)UART1) return ID_UART1; +#endif +#ifdef UART2 + else if (addr == (void*)UART2) return ID_UART2; +#endif +#ifdef UART3 + else if (addr == (void*)UART3) return ID_UART3; +#endif +#ifdef UART4 + else if (addr == (void*)UART4) return ID_UART4; +#endif + else return ID_PERIPH_COUNT; +} + +uint32_t get_usart_id_from_addr(const Usart* addr) +{ + if (addr == (void*)USART0) return ID_USART0; +#ifdef USART1 + else if (addr == (void*)USART1) return ID_USART1; +#endif +#ifdef USART2 + else if (addr == (void*)USART2) return ID_USART2; +#endif +#ifdef USART3 + else if (addr == (void*)USART3) return ID_USART3; +#endif +#ifdef USART4 + else if (addr == (void*)USART4) return ID_USART4; +#endif + else return ID_PERIPH_COUNT; +} + +uint32_t get_tc_id_from_addr(const Tc* addr) +{ + if (addr == TC0) return ID_TC0; +#ifdef TC1 + else if (addr == TC1) return ID_TC1; +#endif + else return ID_PERIPH_COUNT; +} + +Tc* get_tc_addr_from_id(const uint32_t id) +{ + if (id == ID_TC0) return TC0; /**< \brief Timer/Counter 0 (TC0) */ +#ifdef TC1 + else if (id == ID_TC1) return TC1; /**< \brief Timer/Counter 1 (TC1) */ +#endif + else return (void*)0; +} + +uint32_t get_qspi_id_from_addr(const Qspi* addr) +{ + if (addr == (void*)QSPI0) return ID_QSPI0; + else if (addr == (void*)QSPI1) return ID_QSPI1; + else return ID_PERIPH_COUNT; +} + +void *get_qspi_mem_from_addr(const Qspi* addr) +{ + if (addr == (void*)QSPI0) return (void*)QSPIMEM0_ADDR; + else if (addr == (void*)QSPI1) return (void*)QSPIMEM1_ADDR; + else return NULL; +} + +uint32_t get_gmac_id_from_addr(const Gmac* addr) +{ + if (addr == (void*)GMAC0) return ID_GMAC0; + else return ID_PERIPH_COUNT; +} + +Matrix* get_peripheral_matrix(uint32_t id) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(_h64_peripherals); i++) + if (_h64_peripherals[i] == id) + return MATRIX0; // AHB 64-bit matrix + return MATRIX1; // AHB 32-bit matrix +} + +uint32_t get_peripheral_clock_divider(uint32_t id) +{ + Matrix* matrix = get_peripheral_matrix(id); + + if (matrix == MATRIX1) { + if (PMC->PMC_MCKR & PMC_MCKR_H32MXDIV_H32MXDIV2) + return 2; + else + return 1; + } + + return 1; +} + +uint8_t get_peripheral_xdma_channel(uint32_t id, Xdmac *xdmac, bool transmit) +{ + const struct peripheral_xdma *periph_xdma = get_peripheral_xdma(id, xdmac); + if (periph_xdma) { + return transmit ? periph_xdma->iftx : periph_xdma->ifrx; + } else { + return 0xff; + } +} + +bool is_peripheral_on_xdma_controller(uint32_t id, Xdmac *xdmac) +{ + return get_peripheral_xdma(id, xdmac) != NULL; +} + +int32_t get_peripheral_fifo_depth(void* addr) +{ + uint32_t size = (uint32_t)-1; + uint32_t tmp = (uint32_t)addr; + switch (tmp) { + case (uint32_t)USART0: +#ifdef USART1 + case (uint32_t)USART1: +#endif +#ifdef USART2 + case (uint32_t)USART2: +#endif + case (uint32_t)USART3: +#ifdef USART3 + case (uint32_t)USART4: +#endif + size = FLEXCOM_USART_FIFO_DEPTH; + break; + + case (uint32_t)FCOMSPI0: +#ifdef FCOMSPI1 + case (uint32_t)FCOMSPI1: +#endif +#ifdef FCOMSPI2 + case (uint32_t)FCOMSPI2: +#endif +#ifdef FCOMSPI3 + case (uint32_t)FCOMSPI3: +#endif +#ifdef FCOMSPI4 + case (uint32_t)FCOMSPI4: +#endif + size = FLEXCOM_SPI_FIFO_DEPTH; + break; + case (uint32_t)SPI0: +#ifdef SPI1 + case (uint32_t)SPI1: +#endif + size = SPI_FIFO_DEPTH; + break; + case (uint32_t)TWI0: +#ifdef TWI1 + case (uint32_t)TWI1: +#endif +#ifdef TWI2 + case (uint32_t)TWI2: +#endif +#ifdef TWI3 + case (uint32_t)TWI3: +#endif +#ifdef TWI4 + case (uint32_t)TWI4: +#endif +#ifdef TWIHS0 + case (uint32_t)TWIHS0: +#endif +#ifdef TWIHS1 + case (uint32_t)TWIHS1: +#endif + size = TWI_FIFO_DEPTH; + break; + default: + size = (uint32_t)-1; + } + return size; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.h new file mode 100644 index 000000000..c265762f5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip.h @@ -0,0 +1,370 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CHIP_H_ +#define _CHIP_H_ + +#include +#include + +#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 */ + +/* ************************************************************************** */ +/* PERIPHERAL ID DEFINITIONS FOR SAMA5D2x */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D2x_id Peripheral Ids Definitions */ +/*@{*/ + +#define ID_SAIC_FIQ ( 0) /**< \brief FIQ Interrupt ID (SAIC_FIQ) */ +#define ID_ARM_PMU ( 2) /**< \brief Performance Monitor Unit (PMU) (ARM_PMU) */ +#define ID_PIT ( 3) /**< \brief Periodic Interval Timer Interrupt (PIT) */ +#define ID_WDT ( 4) /**< \brief Watchdog timer Interrupt (WDT) */ +#define ID_GMAC0 ( 5) /**< \brief Ethernet MAC (GMAC0) */ +#define ID_XDMAC0 ( 6) /**< \brief DMA Controller 0 (XDMAC0) */ +#define ID_XDMAC1 ( 7) /**< \brief DMA Controller 1 (XDMAC1) */ +#define ID_ICM ( 8) /**< \brief Integritry Check Monitor (ICM) */ +#define ID_AES ( 9) /**< \brief Advanced Enion Standard (AES) */ +#define ID_AESB (10) /**< \brief AES bridge (AESB) */ +#define ID_TDES (11) /**< \brief Triple Data Enion Standard (TDES) */ +#define ID_SHA (12) /**< \brief SHA Signature (SHA) */ +#define ID_MPDDRC (13) /**< \brief MPDDR controller (MPDDRC) */ +#define ID_MATRIX1 (14) /**< \brief H32MX, 32-bit AHB Matrix (MATRIX1) */ +#define ID_MATRIX0 (15) /**< \brief H64MX, 64-bit AHB Matrix (MATRIX0) */ +#define ID_HSMC (17) /**< \brief Multi-bit ECC Interrupt (HSMC) */ +#define ID_PIOA (18) /**< \brief Parallel I/O Controller (PIOA) */ +#define ID_FLEXCOM0 (19) /**< \brief FLEXCOM 0 (FLEXCOM0) */ +#define ID_USART0 (19) /**< \brief USART (USART0) from FLEXCOM0 */ +#define ID_FCOMSPI0 (19) /**< \brief Serial Peripheral Interface (SPI0) from FLEXCOM0 */ +#define ID_TWI0 (19) /**< \brief Two-Wire Interface (TWI0) from FLEXCOM0 */ +#define ID_FLEXCOM1 (20) /**< \brief FLEXCOM 1 (FLEXCOM1) */ +#define ID_USART1 (20) /**< \brief USART (USART1) from FLEXCOM1 */ +#define ID_FCOMSPI1 (20) /**< \brief Serial Peripheral Interface (SPI1) from FLEXCOM1 */ +#define ID_TWI1 (20) /**< \brief Two-Wire Interface (TWI1) from FLEXCOM1 */ +#define ID_FLEXCOM2 (21) /**< \brief FLEXCOM 1 (FLEXCOM1) */ +#define ID_USART2 (21) /**< \brief USART (USART1) from FLEXCOM1 */ +#define ID_FCOMSPI2 (21) /**< \brief Serial Peripheral Interface (SPI1) from FLEXCOM1 */ +#define ID_TWI2 (21) /**< \brief Two-Wire Interface (TWI1) from FLEXCOM1 */ +#define ID_FLEXCOM3 (22) /**< \brief FLEXCOM 3 (FLEXCOM3) */ +#define ID_USART3 (22) /**< \brief USART (USART3) from FLEXCOM3 */ +#define ID_FCOMSPI3 (22) /**< \brief Serial Peripheral Interface (SPI3) from FLEXCOM3 */ +#define ID_TWI3 (22) /**< \brief Two-Wire Interface (TWI3) from FLEXCOM3 */ +#define ID_FLEXCOM4 (23) /**< \brief FLEXCOM 4 (FLEXCOM4) */ +#define ID_USART4 (23) /**< \brief USART (USART4) from FLEXCOM4 */ +#define ID_FCOMSPI4 (23) /**< \brief Serial Peripheral Interface (SPI4) from FLEXCOM4 */ +#define ID_TWI4 (23) /**< \brief Two-Wire Interface (TWI4) from FLEXCOM4 */ +#define ID_UART0 (24) /**< \brief UART 0 (UART0) */ +#define ID_UART1 (25) /**< \brief UART 1 (UART1) */ +#define ID_UART2 (26) /**< \brief UART 2 (UART2) */ +#define ID_UART3 (27) /**< \brief UART 3 (UART3) */ +#define ID_UART4 (28) /**< \brief UART 4 (UART4) */ +#define ID_TWIHS0 (29) /**< \brief Two-Wire Interface 0 (TWIHS0) */ +#define ID_TWIHS1 (30) /**< \brief Two-Wire Interface 1 (TWIHS1) */ +#define ID_SDMMC0 (31) /**< \brief Secure Digital Multimedia Card Controller 0 (SDMMC0) */ +#define ID_SDMMC1 (32) /**< \brief Secure Digital Multimedia Card Controller 1 (SDMMC1) */ +#define ID_SPI0 (33) /**< \brief Serial Peripheral Interface 0 (SPI0) */ +#define ID_SPI1 (34) /**< \brief Serial Peripheral Interface 1 (SPI1) */ +#define ID_TC0 (35) /**< \brief Timer Counter 0 (ch. 0, 1, 2) (TC0) */ +#define ID_TC1 (36) /**< \brief Timer Counter 1 (ch. 3, 4, 5) (TC1) */ +#define ID_PWM (38) /**< \brief Pulse Width Modulation Controller0 (ch. 0, 1, 2, 3) (PWM) */ +#define ID_ADC (40) /**< \brief Touch Screen ADC Controller (ADC) */ +#define ID_UHPHS (41) /**< \brief USB Host High Speed (UHPHS) */ +#define ID_UDPHS (42) /**< \brief USB Device High Speed (UDPHS) */ +#define ID_SSC0 (43) /**< \brief Synchronous Serial Controller 0 (SSC0) */ +#define ID_SSC1 (44) /**< \brief Synchronous Serial Controller 1 (SSC1) */ +#define ID_LCDC (45) /**< \brief LCD Controller (LCDC) */ +#define ID_ISC (46) /**< \brief Camera Interface (ISC) */ +#define ID_TRNG (47) /**< \brief True Random Number Generator (TRNG) */ +#define ID_PDMIC (48) /**< \brief Pulse Density Modulation Interface Controller (PDMIC) */ +#define ID_AIC_IRQ (49) /**< \brief IRQ Interrupt ID (AIC_IRQ) */ +#define ID_SFC (50) /**< \brief Fuse Controller (SFC) */ +#define ID_SECURAM (51) /**< \brief Secured RAM (SECURAM) */ +#define ID_QSPI0 (52) /**< \brief QSPI 0 (QSPI0) */ +#define ID_QSPI1 (53) /**< \brief QSPI 1 (QSPI1) */ +#define ID_I2SC0 (54) /**< \brief Inter-IC Sound Controller 0 (I2SC0) */ +#define ID_I2SC1 (55) /**< \brief Inter-IC Sound Controller 1 (I2SC1) */ +#define ID_CAN0_INT0 (56) /**< \brief MCAN 0 Interrupt0 (CAN0_INT0) */ +#define ID_CAN1_INT0 (57) /**< \brief MCAN 1 Interrupt0 (CAN1_INT0) */ +#define ID_CLASSD (59) /**< \brief Audio Class D amplifier (CLASSD) */ +#define ID_SFR (60) /**< \brief Special Function Register (SFR) */ +#define ID_SAIC (61) /**< \brief Secured Advanced Interrupt Controller (SAIC) */ +#define ID_AIC (62) /**< \brief Advanced Interrupt Controller (AIC) */ +#define ID_L2CC (63) /**< \brief L2 Cache Controller (L2CC) */ +#define ID_CAN0_INT1 (64) /**< \brief MCAN 0 Interrupt1 (CAN0_INT1) */ +#define ID_CAN1_INT1 (65) /**< \brief MCAN 1 Interrupt1 (CAN1_INT1) */ +#define ID_GMAC0_Q1 (66) /**< \brief GMAC Queue 1 Interrupt (GMAC0_Q1) */ +#define ID_GMAC0_Q2 (67) /**< \brief GMAC Queue 2 Interrupt (GMAC0_Q2) */ +#define ID_PIOB (68) /**< \brief (PIOB) */ +#define ID_PIOC (69) /**< \brief (PIOC) */ +#define ID_PIOD (70) /**< \brief (PIOD) */ +#define ID_SDMMC0_TIMER (71) /**< \brief (SDMMC0_TIMER) */ +#define ID_SDMMC1_TIMER (72) /**< \brief (SDMMC1_TIMER) */ +#define ID_SYSC (74) /**< \brief System Controller Interrupt, RTC, RSTC, PMC (SYSC) */ +#define ID_ACC (75) /**< \brief Analog Comparator (ACC) */ +#define ID_RXLP (76) /**< \brief Uart Low Power (RXLP) */ +#define ID_CHIPID (78) /**< \brief Chip ID (CHIPID) */ + +#define ID_PERIPH_COUNT (79) /**< \brief Number of peripheral IDs */ + +/*@}*/ + +/* ************************************************************************** */ +/* SLAVE MATRIX ID DEFINITIONS FOR SAMA5D2x */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D2x_matrix Matrix Ids Definitions */ +/*@{*/ + +#define H64MX_SLAVE_BRIDGE_H32MX 0 /**< Bridge from H64MX to H32MX */ +#define H64MX_SLAVE_APB 1 /**< H64MX APB - User interfaces */ +#define H64MX_SLAVE_SDMMC 1 /**< SDMMC0 - SDMMC1 */ +#define H64MX_SLAVE_DDR_PORT0 2 /**< DDR Port 0 */ +#define H64MX_SLAVE_DDR_PORT1 3 /**< DDR Port 1 */ +#define H64MX_SLAVE_DDR_PORT2 4 /**< DDR Port 2 */ +#define H64MX_SLAVE_DDR_PORT3 5 /**< DDR Port 3 */ +#define H64MX_SLAVE_DDR_PORT4 6 /**< DDR Port 4 */ +#define H64MX_SLAVE_DDR_PORT5 7 /**< DDR Port 5 */ +#define H64MX_SLAVE_DDR_PORT6 8 /**< DDR Port 6 */ +#define H64MX_SLAVE_DDR_PORT7 9 /**< DDR Port 7 */ +#define H64MX_SLAVE_SRAM 10 /**< Internal SRAM 128K */ +#define H64MX_SLAVE_L2C_SRAM 11 /**< Internal SRAM 128K (L2) */ +#define H64MX_SLAVE_QSPI0 12 /**< QSPI0 */ +#define H64MX_SLAVE_QSPI1 13 /**< QSPI1 */ +#define H64MX_SLAVE_AESB 14 /**< AESB */ + +#define H32MX_SLAVE_BRIDGE_H64MX 0 /**< Bridge from H32MX to H64MX */ +#define H32MX_SLAVE_APB0 1 /**< H32MX APB0 - User interfaces */ +#define H32MX_SLAVE_APB1 2 /**< H32MX APB1 - User interfaces */ +#define H32MX_SLAVE_EBI 3 /**< External Bus Interface CS0..CS3 */ +#define H32MX_SLAVE_NFC_CMD 3 /**< NFC Command Register */ +#define H32MX_SLAVE_NFC_SRAM 4 /**< NFC SRAM */ +#define H32MX_SLAVE_USB 5 /**< USB */ + +/*@}*/ + +/* ************************************************************************** */ +/* PMECC DEFINITIONS FOR SAMA5D2x */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D2x_pmecc PMECC Definitions */ +/*@{*/ + +/** defines the maximum value of the error correcting capability */ +#define PMECC_NB_ERROR_MAX (25) + +/** Address of Galois Field Table 512 mapping in ROM. */ +#define GALOIS_TABLE_512_ROM_MAPPING (0x40000) + +/** Address of Galois Field Table 1024 mapping in ROM. */ +#define GALOIS_TABLE_1024_ROM_MAPPING (0x48000) + +/*@}*/ + +/* ************************************************************************** */ +/* INCLUDE FOR SAMA5D2x */ +/* ************************************************************************** */ + +#if defined(CONFIG_SOC_SAMA5D21) + #include "sama5d21.h" +#elif defined(CONFIG_SOC_SAMA5D22) + #include "sama5d22.h" +#elif defined(CONFIG_SOC_SAMA5D23) + #include "sama5d23.h" +#elif defined(CONFIG_SOC_SAMA5D24) + #include "sama5d24.h" +#elif defined(CONFIG_SOC_SAMA5D26) + #include "sama5d26.h" +#elif defined(CONFIG_SOC_SAMA5D27) + #include "sama5d27.h" +#elif defined(CONFIG_SOC_SAMA5D28) + #include "sama5d28.h" +#else + #error Library does not support the specified device. +#endif + +#include "chip_pins.h" + +/** Size of Cortex-A5 L1 cache line */ +#define L1_CACHE_WORDS (8u) +#define L1_CACHE_BYTES (32u) + +/** FLEXCOM USART FIFO depth */ +#define FLEXCOM_USART_FIFO_DEPTH (32u) + +/** FLEXCOM SPI FIFO depth */ +#define FLEXCOM_SPI_FIFO_DEPTH (32u) + +/** SPI FIFO depth */ +#define SPI_FIFO_DEPTH (16u) + +/** TWI FIFO depth */ +#define TWI_FIFO_DEPTH (16u) + +/** Frequency of the on-chip slow clock oscillator */ +#define SLOW_CLOCK_INT_OSC 32000 + +/** Frequency of the on-chip main clock oscillator */ +#define MAIN_CLOCK_INT_OSC 12000000 + +/** AIC redirection unlock key */ +#define AICREDIR_KEY 0x5B6C0E26u + +/** Indicates chip has an UDP High Speed. */ +#define CHIP_USB_UDPHS + +/** Indicates chip has an internal pull-up. */ +#define CHIP_USB_PULLUP_INTERNAL + +/** Number of USB endpoints */ +#define CHIP_USB_ENDPOINTS 16 + +/** Endpoints max paxcket size */ +#define CHIP_USB_ENDPOINT_MAXPACKETSIZE(ep) \ + ((ep == 0) ? 64 : 1024) + +/** Endpoints Number of Bank */ +#define CHIP_USB_ENDPOINT_BANKS(ep) \ + ((ep == 0) ? 1 : ((ep == 1) ? 3 : ((ep == 2) ? 3 : 2))) + +/** Endpoints DMA support */ +#define CHIP_USB_ENDPOINT_HAS_DMA(ep) \ + ((ep == 0) ? false : ((ep < 7) ? true : false )) + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief retrieve Flexcom base address from its ID + * \return Flexcom base address on success, 0 otherwise + */ +extern Flexcom* get_flexcom_addr_from_id(const uint32_t id); + +/** + * \brief retrieve TWI ID from its base address + * \return TWI ID on success, ID_PERIPH_COUNT otherwise + */ +extern uint32_t get_twi_id_from_addr(const Twi* addr); + +/** + * \brief retrieve TWI base address from its ID + * \return TWI base address on success, 0 otherwise + */ +extern Twi* get_twi_addr_from_id(const uint32_t id); + +/** + * + */ +extern uint32_t get_spi_id_from_addr(const Spi* addr); + +extern Spi* get_spi_addr_from_id(const uint32_t id); + +extern uint32_t get_uart_id_from_addr(const Uart* addr); + +extern uint32_t get_usart_id_from_addr(const Usart* addr); + +/** + * \brief retrieve Timer/Counter ID from its base address + * \return TC ID on success, ID_PERIPH_COUNT otherwise + */ +extern uint32_t get_tc_id_from_addr(const Tc* addr); + +/** + * \brief retrieve Timer/Counter base address from its ID + * \return TC base address on success, 0 otherwise + */ +extern Tc* get_tc_addr_from_id(const uint32_t id); + +/** + * \brief retrieve QSPI ID from its base address + * \return QSPI ID on success, ID_PERIPH_COUNT otherwise + */ +uint32_t get_qspi_id_from_addr(const Qspi* addr); + +/** + * \brief retrieve QSPI memory start from its base address + * \return QSPI memory start on success, NULL otherwise + */ +void *get_qspi_mem_from_addr(const Qspi* addr); + +/** + * \brief retrieve GMAC ID from its base address + * \return GMAC ID on success, ID_PERIPH_COUNT otherwise + */ +uint32_t get_gmac_id_from_addr(const Gmac* addr); + +/** \brief Returns the matrix on which the given peripheral is connected + * + * \param id the Peripheral ID + * \return a pointer to the Matrix instance + */ +extern Matrix* get_peripheral_matrix(uint32_t id); + +/** \brief Returns the clock divider for the given peripheral + * + * \param id the Peripheral ID + * \return the clock divider for the peripheral + */ +extern uint32_t get_peripheral_clock_divider(uint32_t id); + +/** \brief Returns the XDMAC interface number for a given peripheral + * + * \param id the Peripheral ID + * \param xdmac the XDMAC controller instance + * \param transmit a boolean, true for transmit, false for receive + * \return the XDMAC interface number or 0xff if none + */ +extern uint8_t get_peripheral_xdma_channel(uint32_t id, Xdmac *xdmac, + bool transmit); + +/** \brief Checks if a peripheral is usable with a XDMAC controller + * + * \param id the Peripheral ID + * \param xdmac the XDMAC controller instance + * \return true if the peripheral is usable on the given XDMAC controller, + * false otherwise + */ +extern bool is_peripheral_on_xdma_controller(uint32_t id, Xdmac *xdmac); + +/** \brief Retrive peripheral FIFO size from its base address + * + * \param addr the Peripheral base addr + * \return Size in number of data of the peripherals FIFO if + * available, negative value otherwise. + */ +extern int32_t get_peripheral_fifo_depth(void* addr); + +#ifdef __cplusplus +} +#endif + +#endif /* _CHIP_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip_pins.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip_pins.h new file mode 100644 index 000000000..8a6ca1548 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/chip_pins.h @@ -0,0 +1,1316 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CHIP_PINS_H_ +#define _CHIP_PINS_H_ + +/*---------------------------------------------------------------------------- + * PIOs Define + *----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*/ +/** + * This pages lists all the pio definitions contained in chip.h. + * The constants are named using the following convention: PIN_* for a constant + * which defines a single Pin instance (but may include several PIOs sharing the + * same controller), and PINS_* for a list of Pin instances. + */ + +/* ========== Pio PIN definition for ADC peripheral ========== */ + +#define PIN_AD0 { PIO_GROUP_D, PIO_PD19X1_AD0, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD1 { PIO_GROUP_D, PIO_PD20X1_AD1, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD2 { PIO_GROUP_D, PIO_PD21X1_AD2, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD3 { PIO_GROUP_D, PIO_PD22X1_AD3, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD4 { PIO_GROUP_D, PIO_PD23X1_AD4, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD5 { PIO_GROUP_D, PIO_PD24X1_AD5, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD6 { PIO_GROUP_D, PIO_PD25X1_AD6, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD7 { PIO_GROUP_D, PIO_PD26X1_AD7, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD8 { PIO_GROUP_D, PIO_PD27X1_AD8, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD9 { PIO_GROUP_D, PIO_PD28X1_AD9, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD10 { PIO_GROUP_D, PIO_PD29X1_AD10, PIO_PERIPH_F, PIO_DEFAULT } +#define PIN_AD11 { PIO_GROUP_D, PIO_PD30X1_AD11, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_ADTRG { PIO_GROUP_D, PIO_PD31A_ADTRG, PIO_PERIPH_A, PIO_DEFAULT } + +/* ========== Pio PIN definition for ARM JTAG peripheral ========== */ + +/* JTAG IOSET 1 */ + +#define PINS_JTAG_IOS1 {\ + { PIO_GROUP_D, 0x0007c000, PIO_PERIPH_A, PIO_DEFAULT }} + +/* JTAG IOSET 2 */ + +#define PINS_JTAG_IOS2 {\ + { PIO_GROUP_D, 0x000007c0, PIO_PERIPH_A, PIO_DEFAULT }} + +/* JTAG IOSET 3 */ + +#define PINS_JTAG_IOS3 {\ + { PIO_GROUP_D, 0xf8000000, PIO_PERIPH_B, PIO_DEFAULT }} + +/* JTAG IOSET 4 */ + +#define PINS_JTAG_IOS4 {\ + { PIO_GROUP_D, 0x07c00000, PIO_PERIPH_C, PIO_DEFAULT }} + + +/* ========== Pio PIN definition for CAN0 peripheral ========== */ + +#define PINS_CAN0_IOS0 {\ + { PIO_GROUP_C, PIO_PC1C_CANTX0 | PIO_PC2C_CANRX0, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#ifdef PIO_PC10E_CANTX0 +#define PINS_CAN0_IOS1 {\ + { PIO_GROUP_C, PIO_PC10E_CANTX0 | PIO_PC11E_CANRX0, PIO_PERIPH_E, PIO_DEFAULT },\ +} +#endif + +/* ========== Pio PIN definition for CAN1 peripheral ========== */ + +#ifdef MCAN1 +#define PINS_CAN1_IOS0 {\ + { PIO_GROUP_C, PIO_PC26D_CANTX1 | PIO_PC27D_CANRX1, PIO_PERIPH_D, PIO_DEFAULT },\ +} +#endif + +/* ========== Pio PIN definition for CLASSD peripheral ========== */ + +#define PIN_CLASSD_L0_IOS1 \ + { PIO_GROUP_A, PIO_PA28F_CLASSD_L0, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_L1_IOS1 \ + { PIO_GROUP_A, PIO_PA29F_CLASSD_L1, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_L2_IOS1 \ + { PIO_GROUP_A, PIO_PA30F_CLASSD_L2, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_L3_IOS1 \ + { PIO_GROUP_A, PIO_PA31F_CLASSD_L3, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_R0_IOS1 \ + { PIO_GROUP_B, PIO_PB1F_CLASSD_R0, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_R1_IOS1 \ + { PIO_GROUP_B, PIO_PB2F_CLASSD_R1, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_R2_IOS1 \ + { PIO_GROUP_B, PIO_PB3F_CLASSD_R2, PIO_PERIPH_F, PIO_DEFAULT } + +#define PIN_CLASSD_R3_IOS1 \ + { PIO_GROUP_B, PIO_PB4F_CLASSD_R3, PIO_PERIPH_F, PIO_DEFAULT } + +#define PINS_CLASSD_IOS1 {\ + PIN_CLASSD_L0_IOS1, PIN_CLASSD_L1_IOS1, \ + PIN_CLASSD_L2_IOS1, PIN_CLASSD_L3_IOS1, \ + PIN_CLASSD_R0_IOS1, PIN_CLASSD_R1_IOS1, \ + PIN_CLASSD_R2_IOS1, PIN_CLASSD_R3_IOS1, \ +}; + +/* ========== Pio PIN definition for EBI peripheral ========== */ + +/* NFC IOSET 1 */ + +#define PINS_NFC_IOS1 {\ + { PIO_GROUP_A, 0xffc00000, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_B, 0x000007ff, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_C, 0x00000100, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* NFC IOSET 2 */ + +#define PINS_NFC_IOS2 {\ + { PIO_GROUP_A, 0x003fffff, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for FLEXCOM0 peripheral ========== */ + +/* FLEXCOM0 IOSET 1 (TWI) */ + +#define PINS_FLEXCOM0_TWI_IOS1 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM0 IOSET 1 (USART) */ + +#define PINS_FLEXCOM0_USART_IOS1 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1, PIO_PERIPH_C, PIO_DEFAULT },\ +}; + + +/* FLEXCOM0 IOSET 1 (USART with handshake) */ + +#define PINS_FLEXCOM0_USART_HS_IOS1 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1 | PIO_PB31C_FLEXCOM0_IO3, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC0C_FLEXCOM0_IO4, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM0 IOSET 1 (RS485) */ + +#define PINS_FLEXCOM0_USART_IOS1_RS485 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1 | PIO_PC0C_FLEXCOM0_IO4, PIO_PERIPH_C, PIO_DEFAULT },\ +}; + +/* FLEXCOM0 IOSET 1 (SPI) */ + +#define PIN_FLEXCOM0_SPI_NPCS0_IOS1 \ + { PIO_GROUP_B, PIO_PB31C_FLEXCOM0_IO3, PIO_PERIPH_C, PIO_PULLUP } + +#define PIN_FLEXCOM0_SPI_NPCS1_IOS1 \ + { PIO_GROUP_C, PIO_PC0C_FLEXCOM0_IO4, PIO_PERIPH_C, PIO_PULLUP } + +#define PINS_FLEXCOM0_SPI_IOS1 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1 | PIO_PB30C_FLEXCOM0_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM0_SPI_NPCS0_IOS1 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1 | PIO_PB30C_FLEXCOM0_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_FLEXCOM0_SPI_NPCS0_IOS1,\ +} + +#define PINS_FLEXCOM0_SPI_NPCS1_IOS1 {\ + { PIO_GROUP_B, PIO_PB28C_FLEXCOM0_IO0 | PIO_PB29C_FLEXCOM0_IO1 | PIO_PB30C_FLEXCOM0_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_FLEXCOM0_SPI_NPCS1_IOS1,\ +} + +/* ========== Pio PIN definition for FLEXCOM1 peripheral ========== */ + +/* FLEXCOM1 IOSET 1 (TWI) */ + +#define PINS_FLEXCOM1_TWI_IOS1 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* FLEXCOM1 IOSET 1 (USART) */ + +#define PINS_FLEXCOM1_USART_IOS1 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* FLEXCOM1 IOSET 1 (USART with handshake) */ + +#define PINS_FLEXCOM1_USART_HS_IOS1 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1 | PIO_PA25A_FLEXCOM1_IO3 | PIO_PA26A_FLEXCOM1_IO4, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* FLEXCOM1 IOSET 1 (RS485) */ + +#define PINS_FLEXCOM1_USART_IOS1_RS485 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1 | PIO_PA26A_FLEXCOM1_IO4, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* FLEXCOM1 IOSET 1 (SPI) */ + +#define PIN_FLEXCOM1_SPI_NPCS0_IOS1 \ + { PIO_GROUP_A, PIO_PA25A_FLEXCOM1_IO3, PIO_PERIPH_A, PIO_PULLUP } + +#define PIN_FLEXCOM1_SPI_NPCS1_IOS1 \ + { PIO_GROUP_A, PIO_PA26A_FLEXCOM1_IO4, PIO_PERIPH_A, PIO_PULLUP } + +#define PINS_FLEXCOM1_SPI_IOS1 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1 | PIO_PA22A_FLEXCOM1_IO2, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM1_SPI_NPCS0_IOS1 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1 | PIO_PA22A_FLEXCOM1_IO2, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_FLEXCOM1_SPI_NPCS0_IOS1,\ +} + +#define PINS_FLEXCOM1_SPI_NPCS1_IOS1 {\ + { PIO_GROUP_A, PIO_PA24A_FLEXCOM1_IO0 | PIO_PA23A_FLEXCOM1_IO1 | PIO_PA22A_FLEXCOM1_IO2, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_FLEXCOM1_SPI_NPCS1_IOS1,\ +} + +/* ========== Pio PIN definition for FLEXCOM2 peripheral ========== */ + +/* FLEXCOM2 IOSET 1 (TWI) */ + +#define PINS_FLEXCOM2_TWI_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 1 (USART) */ + +#define PINS_FLEXCOM2_USART_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 1 (USART with handshake) */ + +#define PINS_FLEXCOM2_USART_HS_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1 | PIO_PA9E_FLEXCOM2_IO3 | PIO_PA10E_FLEXCOM2_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 1 (RS485) */ + +#define PINS_FLEXCOM2_RS485_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1 | PIO_PA10E_FLEXCOM2_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 1 (SPI) */ + +#define PIN_FLEXCOM2_SPI_NPCS0_IOS1 \ + { PIO_GROUP_A, PIO_PA9E_FLEXCOM2_IO3, PIO_PERIPH_E, PIO_PULLUP } + +#define PIN_FLEXCOM2_SPI_NPCS1_IOS1 \ + { PIO_GROUP_A, PIO_PA10E_FLEXCOM2_IO4, PIO_PERIPH_E, PIO_PULLUP } + +#define PINS_FLEXCOM2_SPI_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1 | PIO_PA8E_FLEXCOM2_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM2_SPI_NPCS0_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1 | PIO_PA8E_FLEXCOM2_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM2_SPI_NPCS0_IOS1, \ +} + +#define PINS_FLEXCOM2_SPI_NPCS1_IOS1 {\ + { PIO_GROUP_A, PIO_PA6E_FLEXCOM2_IO0 | PIO_PA7E_FLEXCOM2_IO1 | PIO_PA8E_FLEXCOM2_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM2_SPI_NPCS1_IOS1, \ +} + +/* FLEXCOM2 IOSET 2 (TWI) */ + +#define PINS_FLEXCOM2_TWI_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 2 (USART) */ + +#define PINS_FLEXCOM2_USART_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 2 (USART with handshake) */ + +#define PINS_FLEXCOM2_USART_HS_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1 | PIO_PD29C_FLEXCOM2_IO3 | PIO_PD30C_FLEXCOM2_IO4, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 2 (RS485) */ + +#define PINS_FLEXCOM2_RS485_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1 | PIO_PD30C_FLEXCOM2_IO4, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM2 IOSET 2 (SPI) */ + +#define PIN_FLEXCOM2_SPI_NPCS0_IOS2 \ + { PIO_GROUP_D, PIO_PD29C_FLEXCOM2_IO3, PIO_PERIPH_C, PIO_PULLUP } + +#define PIN_FLEXCOM2_SPI_NPCS1_IOS2 \ + { PIO_GROUP_D, PIO_PD30C_FLEXCOM2_IO4, PIO_PERIPH_C, PIO_PULLUP } + +#define PINS_FLEXCOM2_SPI_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1 | PIO_PD28C_FLEXCOM2_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM2_SPI_NPCS0_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1 | PIO_PD28C_FLEXCOM2_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_FLEXCOM2_SPI_NPCS0_IOS2,\ +} + +#define PINS_FLEXCOM2_SPI_NPCS1_IOS2 {\ + { PIO_GROUP_D, PIO_PD26C_FLEXCOM2_IO0 | PIO_PD27C_FLEXCOM2_IO1 | PIO_PD28C_FLEXCOM2_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_FLEXCOM2_SPI_NPCS1_IOS2,\ +} + +/* ========== Pio PIN definition for FLEXCOM3 peripheral ========== */ + +/* FLEXCOM3 IOSET 1 (TWI) */ + +#define PINS_FLEXCOM3_TWI_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 1 (USART) */ + +#define PINS_FLEXCOM3_USART_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 1 (USART with handshake) */ + +#define PINS_FLEXCOM3_USART_HS_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1 | PIO_PA16E_FLEXCOM3_IO3 | PIO_PA17E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 1 (RS585) */ + +#define PINS_FLEXCOM3_RS485_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1 | PIO_PA17E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 1 (SPI) */ + +#define PIN_FLEXCOM3_SPI_NPCS0_IOS1 \ + { PIO_GROUP_A, PIO_PA16E_FLEXCOM3_IO3, PIO_PERIPH_E, PIO_PULLUP } + +#define PIN_FLEXCOM3_SPI_NPCS1_IOS1 \ + { PIO_GROUP_A, PIO_PA17E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_PULLUP } + +#define PINS_FLEXCOM3_SPI_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1 | PIO_PA14E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM3_SPI_NPCS0_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1 | PIO_PA14E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM3_SPI_NPCS0_IOS1,\ +} + +#define PINS_FLEXCOM3_SPI_NPCS1_IOS1 {\ + { PIO_GROUP_A, PIO_PA15E_FLEXCOM3_IO0 | PIO_PA13E_FLEXCOM3_IO1 | PIO_PA14E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM3_SPI_NPCS1_IOS1,\ +} + +/* FLEXCOM3 IOSET 2 (TWI) */ + +#define PINS_FLEXCOM3_TWI_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 2 (USART) */ + +#define PINS_FLEXCOM3_USART_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 2 (USART with handshake) */ + +#define PINS_FLEXCOM3_USART_HS_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1 | PIO_PC21E_FLEXCOM3_IO3 | PIO_PC22E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 2 (RS485) */ + +#define PINS_FLEXCOM3_RS485_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1 | PIO_PC22E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 2 (SPI) */ + +#define PIN_FLEXCOM3_SPI_NPCS0_IOS2 \ + { PIO_GROUP_C, PIO_PC21E_FLEXCOM3_IO3, PIO_PERIPH_E, PIO_PULLUP } + +#define PIN_FLEXCOM3_SPI_NPCS1_IOS2 \ + { PIO_GROUP_C, PIO_PC22E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_PULLUP } + +#define PINS_FLEXCOM3_SPI_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1 | PIO_PC18E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM3_SPI_NPCS0_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1 | PIO_PC18E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM3_SPI_NPCS0_IOS2,\ +} + +#define PINS_FLEXCOM3_SPI_NPCS1_IOS2 {\ + { PIO_GROUP_C, PIO_PC20E_FLEXCOM3_IO0 | PIO_PC19E_FLEXCOM3_IO1 | PIO_PC18E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM3_SPI_NPCS1_IOS2,\ +} + +/* FLEXCOM3 IOSET 3 (TWI) */ + +#define PINS_FLEXCOM3_TWI_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 3 (USART) */ + +#define PINS_FLEXCOM3_USART_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 3 (USART with handshake) */ + +#define PINS_FLEXCOM3_USART_HS_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1 | PIO_PB24E_FLEXCOM3_IO3 | PIO_PB25E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 3 (RS485) */ + +#define PINS_FLEXCOM3_RS485_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1 | PIO_PB25E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* FLEXCOM3 IOSET 3 (SPI) */ + +#define PIN_FLEXCOM3_SPI_NPCS0_IOS3 \ + { PIO_GROUP_B, PIO_PB24E_FLEXCOM3_IO3, PIO_PERIPH_E, PIO_PULLUP } + +#define PIN_FLEXCOM3_SPI_NPCS1_IOS3 \ + { PIO_GROUP_B, PIO_PB25E_FLEXCOM3_IO4, PIO_PERIPH_E, PIO_PULLUP } + +#define PINS_FLEXCOM3_SPI_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1 | PIO_PB21E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM3_SPI_NPCS0_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1 | PIO_PB21E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM3_SPI_NPCS0_IOS3,\ +} + +#define PINS_FLEXCOM3_SPI_NPCS1_IOS3 {\ + { PIO_GROUP_B, PIO_PB23E_FLEXCOM3_IO0 | PIO_PB22E_FLEXCOM3_IO1 | PIO_PB21E_FLEXCOM3_IO2, PIO_PERIPH_E, PIO_DEFAULT },\ + PIN_FLEXCOM3_SPI_NPCS1_IOS3,\ +} + +/* ========== Pio PIN definition for FLEXCOM4 peripheral ========== */ + +/* FLEXCOM4 IOSET 1 (TWI) */ + +#define PINS_FLEXCOM4_TWI_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1, PIO_PERIPH_B, PIO_DEFAULT } \ +} + +/* FLEXCOM4 IOSET 1 (USART) */ + +#define PINS_FLEXCOM4_USART_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1, PIO_PERIPH_B, PIO_DEFAULT } \ +} + +/* FLEXCOM4 IOSET 1 (USART with handshake) */ + +#define PINS_FLEXCOM4_USART_HS_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1 | PIO_PC31B_FLEXCOM4_IO3, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD0B_FLEXCOM4_IO4, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 1 (RS485) */ + +#define PINS_FLEXCOM4_RS485_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD0B_FLEXCOM4_IO4, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 1 (SPI) */ + +#define PIN_FLEXCOM4_SPI_NPCS0_IOS1 \ + { PIO_GROUP_C, PIO_PC31B_FLEXCOM4_IO3, PIO_PERIPH_B, PIO_PULLUP } + +#define PIN_FLEXCOM4_SPI_NPCS1_IOS1 \ + { PIO_GROUP_D, PIO_PD0B_FLEXCOM4_IO4, PIO_PERIPH_B, PIO_PULLUP } + +#define PINS_FLEXCOM4_SPI_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1 | PIO_PC30B_FLEXCOM4_IO2, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM4_SPI_NPCS0_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1 | PIO_PC30B_FLEXCOM4_IO2, PIO_PERIPH_B, PIO_DEFAULT },\ + PIN_FLEXCOM4_SPI_NPCS0_IOS1,\ +} + +#define PINS_FLEXCOM4_SPI_NPCS1_IOS1 {\ + { PIO_GROUP_C, PIO_PC28B_FLEXCOM4_IO0 | PIO_PC29B_FLEXCOM4_IO1 | PIO_PC30B_FLEXCOM4_IO2, PIO_PERIPH_B, PIO_DEFAULT },\ + PIN_FLEXCOM4_SPI_NPCS1_IOS1,\ +} + +/* FLEXCOM4 IOSET 2 (TWI) */ + +#define PINS_FLEXCOM4_TWI_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 2 (USART) */ + +#define PINS_FLEXCOM4_USART_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 2 (USART with handshake) */ + +#define PINS_FLEXCOM4_USART_HS_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1 | PIO_PD15B_FLEXCOM4_IO3 | PIO_PD16B_FLEXCOM4_IO4, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 2 (RS485) */ + +#define PINS_FLEXCOM4_RS485_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1 | PIO_PD16B_FLEXCOM4_IO4, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 2 (SPI) */ + +#define PIN_FLEXCOM4_SPI_NPCS0_IOS2 \ + { PIO_GROUP_D, PIO_PD15B_FLEXCOM4_IO3, PIO_PERIPH_B, PIO_PULLUP } + +#define PIN_FLEXCOM4_SPI_NPCS1_IOS2 \ + { PIO_GROUP_D, PIO_PD16B_FLEXCOM4_IO4, PIO_PERIPH_B, PIO_PULLUP } + +#define PINS_FLEXCOM4_SPI_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1 | PIO_PD14B_FLEXCOM4_IO2, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM4_SPI_NPCS0_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1 | PIO_PD14B_FLEXCOM4_IO2, PIO_PERIPH_B, PIO_DEFAULT },\ + PIN_FLEXCOM4_SPI_NPCS0_IOS2,\ +} + +#define PINS_FLEXCOM4_SPI_NPCS1_IOS2 {\ + { PIO_GROUP_D, PIO_PD12B_FLEXCOM4_IO0 | PIO_PD13B_FLEXCOM4_IO1 | PIO_PD14B_FLEXCOM4_IO2, PIO_PERIPH_B, PIO_DEFAULT },\ + PIN_FLEXCOM4_SPI_NPCS1_IOS2,\ +} + +/* FLEXCOM4 IOSET 3 (TWI) */ + +#define PINS_FLEXCOM4_TWI_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 3 (USART) */ + +#define PINS_FLEXCOM4_USART_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 3 (USART with handshake) */ + +#define PINS_FLEXCOM4_USART_HS_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1 | PIO_PD24C_FLEXCOM4_IO3 | PIO_PD25C_FLEXCOM4_IO4, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 3 (RS485) */ + +#define PINS_FLEXCOM4_RS485_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1 | PIO_PD25C_FLEXCOM4_IO4, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* FLEXCOM4 IOSET 3 (SPI) */ + +#define PIN_FLEXCOM4_SPI_NPCS0_IOS3 \ + { PIO_GROUP_D, PIO_PD24C_FLEXCOM4_IO3, PIO_PERIPH_C, PIO_PULLUP } + +#define PIN_FLEXCOM4_SPI_NPCS1_IOS3 \ + { PIO_GROUP_D, PIO_PD25C_FLEXCOM4_IO4, PIO_PERIPH_C, PIO_PULLUP } + +#define PINS_FLEXCOM4_SPI_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1 | PIO_PD23C_FLEXCOM4_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define PINS_FLEXCOM4_SPI_NPCS0_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1 | PIO_PD23C_FLEXCOM4_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_FLEXCOM4_SPI_NPCS0_IOS3,\ +} + +#define PINS_FLEXCOM4_SPI_NPCS1_IOS3 {\ + { PIO_GROUP_D, PIO_PD21C_FLEXCOM4_IO0 | PIO_PD22C_FLEXCOM4_IO1 | PIO_PD23C_FLEXCOM4_IO2, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_FLEXCOM4_SPI_NPCS1_IOS3,\ +} + +/* ========== Pio PIN definition for GMAC peripheral ========== */ + +#define PIN_GTSUCOM_IOS1 {\ + { PIO_GROUP_C, PIO_PC9B_GTSUCOMP, PIO_PERIPH_B, PIO_PULLUP | PIO_IT_FALL_EDGE },\ +} + +#define PINS_GMAC_MII_IOS1 {\ + { PIO_GROUP_C, 0x0FFFFC00, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +#define PINS_GMAC_RMII_IOS1 {\ + { PIO_GROUP_C, 0x000FFC00, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +#define PIN_GTSUCOM_IOS2 {\ + { PIO_GROUP_D, PIO_PD0D_GTSUCOMP, PIO_PERIPH_D, PIO_PULLUP | PIO_IT_FALL_EDGE },\ +} + +#define PINS_GMAC_MII_IOS2 {\ + { PIO_GROUP_D, 0x0007FFFE, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_GMAC_RMII_IOS2 {\ + { PIO_GROUP_D, 0x0007FE00, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PIN_GTSUCOM_IOS3 {\ + { PIO_GROUP_B, PIO_PB5F_GTSUCOMP, PIO_PERIPH_F, PIO_PULLUP | PIO_IT_FALL_EDGE },\ +} + +#define PINS_GMAC_MII_IOS3 {\ + { PIO_GROUP_B, 0x00FFFFC0, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +#define PINS_GMAC_RMII_IOS3 {\ + { PIO_GROUP_B, 0x00FFC000, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for I2SC0 peripheral ========== */ + +#define I2S0_IOS1 (PIO_PC1E_I2SCK0 | PIO_PC2E_I2SMCK0 | PIO_PC3E_I2SWS0 | PIO_PC4E_I2SDI0 | PIO_PC5E_I2SDO0) +#define PINS_I2S0_IOS1 {\ + { PIO_GROUP_C, I2S0_IOS1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define I2S0_IOS2 (PIO_PD19E_I2SCK0 | PIO_PD20E_I2SMCK0 | PIO_PD21E_I2SWS0 | PIO_PD22E_I2SDI0 | PIO_PD23E_I2SDO0) +#define PINS_I2S0_IOS2 {\ + { PIO_GROUP_D, I2S0_IOS1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for I2SC1 peripheral ========== */ + +#define I2S1_IOS1 (PIO_PB14D_I2SMCK1 | PIO_PB15D_I2SCK1 | PIO_PB16D_I2SWS1 | PIO_PB17D_I2SDI1 | PIO_PB18D_I2SDO1) +#define PINS_I2S1_IOS1 {\ + { PIO_GROUP_B, I2S_IOS1, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define I2S1_IOS2 (PIO_PA14D_I2SMCK1 | PIO_PA15D_I2SCK1 | PIO_PA16D_I2SWS1 | PIO_PA17D_I2SDI1 | PIO_PA18D_I2SDO1) +#define PINS_I2S1_IOS2 {\ + { PIO_GROUP_A, I2S_IOS2, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for ISI peripheral ========== */ + +#define PIN_ISC_FIELD_IOS1 {\ + { PIO_GROUP_C, PIO_PC25C_ISC_FIELD, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define PINS_ISC_IOS1 {\ + { PIO_GROUP_C, PIO_PC22C_ISC_VSYNC, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC23C_ISC_HSYNC, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC24C_ISC_MCK, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC21C_ISC_PCK, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, 0x001FFE00, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define PIN_ISC_FIELD_IOS2 {\ + { ID_PIOD, PIO_PD18E_ISC_FIELD, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define PINS_ISC_IOS2 {\ + { PIO_GROUP_D, PIO_PD16E_ISC_VSYNC, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD17E_ISC_HSYNC, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD2E_ISC_MCK, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD15E_ISC_PCK, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_D, 0x00007FF8, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +#define PIN_ISC_FIELD_IOS3 {\ + { PIO_GROUP_C, PIO_PC8F_ISC_FIELD, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +#define PINS_ISC_IOS3 {\ + { PIO_GROUP_C, PIO_PC5F_ISC_VSYNC, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC6F_ISC_HSYNC, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC7F_ISC_MCK, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC4F_ISC_PCK, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_B, 0xFF000000, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_C, 0x0000000F, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +#define PIN_ISC_FIELD_IOS4 {\ + { PIO_GROUP_D, PIO_PD23F_ISC_FIELD, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +#define PINS_ISC_IOS4 {\ + { PIO_GROUP_D, PIO_PD21F_ISC_VSYNC, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD22F_ISC_HSYNC, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD11F_ISC_MCK, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD20F_ISC_PCK, PIO_PERIPH_F, PIO_DEFAULT },\ + { PIO_GROUP_D, 0x000FF000, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for LCDC peripheral ========== */ + +/* LCD 24 bits */ +#define PINS_LCD_IOS1 {\ + { PIO_GROUP_B, 0xFFFFF800, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_C, 0x000001FF, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* LCD 18 bits */ +#define PINS_LCD_IOS2 {\ + { PIO_GROUP_C, 0xFFFFF800, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, 0x00000003, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for PDMIC peripheral ========== */ + +#define PINS_PDMIC_IOS1 {\ + { PIO_GROUP_B, PIO_PB26D_PDMDAT | PIO_PB27D_PDMCLK, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_PDMIC_IOS2 {\ + { PIO_GROUP_B, PIO_PB11D_PDMDAT | PIO_PB12D_PDMCLK, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for PMC peripheral ========== */ + +#define PINS_PCK0_IOS1 {\ + { PIO_GROUP_D, PIO_PD19A_PCK0, PIO_PERIPH_A, PIO_DEFAULT }} + +#define PINS_PCK0_IOS2 {\ + { PIO_GROUP_D, PIO_PD31E_PCK0, PIO_PERIPH_E, PIO_DEFAULT }} + +#define PINS_PCK0_IOS3 {\ + { PIO_GROUP_C, PIO_PC8D_PCK0, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_PCK1_IOS1 {\ + { PIO_GROUP_D, PIO_PD6B_PCK1, PIO_PERIPH_B, PIO_DEFAULT }} + +#define PINS_PCK1_IOS2 {\ + { PIO_GROUP_C, PIO_PC27C_PCK1, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PCK1_IOS3 {\ + { PIO_GROUP_B, PIO_PB13C_PCK1, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PCK1_IOS4 {\ + { PIO_GROUP_B, PIO_PB20E_PCK1, PIO_PERIPH_E, PIO_DEFAULT }} + +#define PINS_PCK2_IOS1 {\ + { PIO_GROUP_C, PIO_PC28C_PCK2, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PCK2_IOS2 {\ + { PIO_GROUP_D, PIO_PD11B_PCK2, PIO_PERIPH_B, PIO_DEFAULT }} + +#define PINS_PCK2_IOS3 {\ + { PIO_GROUP_A, PIO_PA21B_PCK2, PIO_PERIPH_B, PIO_DEFAULT }} + +/* ========== Pio PIN definition for PWM peripheral ========== */ + +#define PINS_PWMH0_IOS1 {\ + { PIO_GROUP_A, PIO_PA30D_PWMH0, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_PWML0_IOS1 {\ + { PIO_GROUP_A, PIO_PA31D_PWML0, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_PWMH1_IOS1 {\ + { PIO_GROUP_B, PIO_PB0D_PWMH1, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_PWML1_IOS1 {\ + { PIO_GROUP_B, PIO_PB1D_PWML1, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_PWMH2_IOS1 {\ + { PIO_GROUP_B, PIO_PB5C_PWMH2, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PWML2_IOS1 {\ + { PIO_GROUP_B, PIO_PB6C_PWML2, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PWMH3_IOS1 {\ + { PIO_GROUP_B, PIO_PB7C_PWMH3, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PWML3_IOS1 {\ + { PIO_GROUP_B, PIO_PB8C_PWML3, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_EXTRG0_IOS1 {\ + { PIO_GROUP_B, PIO_PB3D_PWMEXTRG0, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_EXTRG1_IOS1 {\ + { PIO_GROUP_B, PIO_PB10C_PWMEXTRG1, PIO_PERIPH_C, PIO_DEFAULT }} + +#define PINS_PWMFI0_IOS1 {\ + { PIO_GROUP_B, PIO_PB2D_PWMFI0, PIO_PERIPH_D, PIO_DEFAULT }} + +#define PINS_PWMFI1_IOS1 {\ + { PIO_GROUP_B, PIO_PB9C_PWMFI1, PIO_PERIPH_C, PIO_DEFAULT }} + +/* ========== Pio PIN definition for QSPI0 peripheral ========== */ + +/* QSPI0 IOSET 1 */ +#define PINS_QSPI0_IOS1 {\ + { PIO_GROUP_A, 0x0000003f, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* QSPI0 IOSET 2 */ +#define PINS_QSPI0_IOS2 {\ + { PIO_GROUP_A, 0x000fc000, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* QSPI0 IOSET 3 */ +#define PINS_QSPI0_IOS3 {\ + { PIO_GROUP_A, 0x0fc00000, PIO_PERIPH_F, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for QSPI1 peripheral ========== */ + +/* QSPI1 IOSET 1 */ +#define PINS_QSPI1_IOS1 {\ + { PIO_GROUP_A, 0x00000fc0, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* QSPI1 IOSET 2 */ +#define PINS_QSPI1_IOS2 {\ + { PIO_GROUP_B, 0x000007e0, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +/* QSPI1 IOSET 3 */ +#define PINS_QSPI1_IOS3 {\ + { PIO_GROUP_B, 0x000fc000, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for SDMMC0 peripheral ========== */ + +#if defined(PIO_PA1A_SDMMC0_CMD) + +#define PINS_SDMMC0_1B_IOS1 { PIO_GROUP_A, PIO_PA1A_SDMMC0_CMD\ + | PIO_PA2A_SDMMC0_DAT0, PIO_PERIPH_A, PIO_PULLUP } + +#define PINS_SDMMC0_4B_IOS1 { PIO_GROUP_A, PIO_PA1A_SDMMC0_CMD\ + | PIO_PA5A_SDMMC0_DAT3 | PIO_PA4A_SDMMC0_DAT2 | PIO_PA3A_SDMMC0_DAT1\ + | PIO_PA2A_SDMMC0_DAT0, PIO_PERIPH_A, PIO_PULLUP } + +#define PINS_SDMMC0_8B_IOS1 { PIO_GROUP_A, PIO_PA1A_SDMMC0_CMD\ + | PIO_PA9A_SDMMC0_DAT7 | PIO_PA8A_SDMMC0_DAT6 | PIO_PA7A_SDMMC0_DAT5\ + | PIO_PA6A_SDMMC0_DAT4 | PIO_PA5A_SDMMC0_DAT3 | PIO_PA4A_SDMMC0_DAT2\ + | PIO_PA3A_SDMMC0_DAT1 | PIO_PA2A_SDMMC0_DAT0, PIO_PERIPH_A, PIO_PULLUP } + +#define PIN_SDMMC0_CD_IOS1 { PIO_GROUP_A, PIO_PA13A_SDMMC0_CD, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SDMMC0_VDDSEL_IOS1 { PIO_GROUP_A, PIO_PA11A_SDMMC0_VDDSEL, PIO_PERIPH_A, PIO_DEFAULT } +#define PIN_SDMMC0_RSTN_IOS1 { PIO_GROUP_A, PIO_PA10A_SDMMC0_RSTN, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SDMMC0_CK_IOS1 { PIO_GROUP_A, PIO_PA0A_SDMMC0_CK, PIO_PERIPH_A, PIO_DEFAULT } +#define PIN_SDMMC0_RES_IOS1 { PIO_GROUP_A, PIO_PA5A_SDMMC0_DAT3, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SDMMC0_WP_IOS1 { PIO_GROUP_A, PIO_PA12A_SDMMC0_WP, PIO_PERIPH_A, PIO_PULLUP } + +#elif defined(PIO_PA28E_SDMMC0_CMD) + +#define PINS_SDMMC0_1B_IOS1 { PIO_GROUP_A, PIO_PA28E_SDMMC0_CMD\ + | PIO_PA18E_SDMMC0_DAT0, PIO_PERIPH_E, PIO_PULLUP } + +#define PINS_SDMMC0_4B_IOS1 { PIO_GROUP_A, PIO_PA28E_SDMMC0_CMD\ + | PIO_PA21E_SDMMC0_DAT3 | PIO_PA20E_SDMMC0_DAT2 | PIO_PA19E_SDMMC0_DAT1\ + | PIO_PA18E_SDMMC0_DAT0, PIO_PERIPH_E, PIO_PULLUP } + +#define PIN_SDMMC0_CD_IOS1 { PIO_GROUP_A, PIO_PA30E_SDMMC0_CD, PIO_PERIPH_E, PIO_PULLUP } +#define PIN_SDMMC0_RSTN_IOS1 { PIO_GROUP_A, PIO_PA27E_SDMMC0_RSTN, PIO_PERIPH_E, PIO_PULLUP } +#define PIN_SDMMC0_CK_IOS1 { PIO_GROUP_A, PIO_PA22E_SDMMC0_CK, PIO_PERIPH_E, PIO_DEFAULT } +#define PIN_SDMMC0_RES_IOS1 { PIO_GROUP_A, PIO_PA21E_SDMMC0_DAT3, PIO_PERIPH_E, PIO_PULLUP } +#define PIN_SDMMC0_WP_IOS1 { PIO_GROUP_A, PIO_PA29E_SDMMC0_WP, PIO_PERIPH_E, PIO_PULLUP } + +#endif + +/* ========== Pio PIN definition for SDMMC1 peripheral ========== */ + +#ifdef SDMMC1 +#define PINS_SDMMC1_1B_IOS1 { PIO_GROUP_A, PIO_PA28E_SDMMC1_CMD\ + | PIO_PA18E_SDMMC1_DAT0, PIO_PERIPH_E, PIO_PULLUP } + +#define PINS_SDMMC1_4B_IOS1 { PIO_GROUP_A, PIO_PA28E_SDMMC1_CMD\ + | PIO_PA21E_SDMMC1_DAT3 | PIO_PA20E_SDMMC1_DAT2 | PIO_PA19E_SDMMC1_DAT1\ + | PIO_PA18E_SDMMC1_DAT0, PIO_PERIPH_E, PIO_PULLUP } + +#define PIN_SDMMC1_CD_IOS1 { PIO_GROUP_A, PIO_PA30E_SDMMC1_CD, PIO_PERIPH_E, PIO_PULLUP } +#define PIN_SDMMC1_RSTN_IOS1 { PIO_GROUP_A, PIO_PA27E_SDMMC1_RSTN, PIO_PERIPH_E, PIO_PULLUP } +#define PIN_SDMMC1_CK_IOS1 { PIO_GROUP_A, PIO_PA22E_SDMMC1_CK, PIO_PERIPH_E, PIO_DEFAULT } +#define PIN_SDMMC1_RES_IOS1 { PIO_GROUP_A, PIO_PA21E_SDMMC1_DAT3, PIO_PERIPH_E, PIO_PULLUP } +#define PIN_SDMMC1_WP_IOS1 { PIO_GROUP_A, PIO_PA29E_SDMMC1_WP, PIO_PERIPH_E, PIO_PULLUP } +#endif + +/* ========== Pio PIN definition for SPI0 peripheral ========== */ + +/* SPI0 IOSET 1 */ + +#define PIN_SPI0_NPCS0_IOS1 { PIO_GROUP_A, PIO_PA17A_SPI0_NPCS0, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SPI0_NPCS1_IOS1 { PIO_GROUP_A, PIO_PA18A_SPI0_NPCS1, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SPI0_NPCS2_IOS1 { PIO_GROUP_A, PIO_PA19A_SPI0_NPCS2, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SPI0_NPCS3_IOS1 { PIO_GROUP_A, PIO_PA20A_SPI0_NPCS3, PIO_PERIPH_A, PIO_PULLUP } + +#define PINS_SPI0_IOS1 {\ + { PIO_GROUP_A, PIO_PA14A_SPI0_SPCK | PIO_PA15A_SPI0_MOSI | PIO_PA16A_SPI0_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +#define PINS_SPI0_NPCS0_IOS1 {\ + { PIO_GROUP_A, PIO_PA14A_SPI0_SPCK | PIO_PA15A_SPI0_MOSI | PIO_PA16A_SPI0_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI0_NPCS0_IOS1,\ +} + +#define PINS_SPI0_NPCS1_IOS1 {\ + { PIO_GROUP_A, PIO_PA14A_SPI0_SPCK | PIO_PA15A_SPI0_MOSI | PIO_PA16A_SPI0_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI0_NPCS1_IOS1,\ +} + +#define PINS_SPI0_NPCS2_IOS1 {\ + { PIO_GROUP_A, PIO_PA14A_SPI0_SPCK | PIO_PA15A_SPI0_MOSI | PIO_PA16A_SPI0_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI0_NPCS2_IOS1,\ +} + +#define PINS_SPI0_NPCS3_IOS1 {\ + { PIO_GROUP_A, PIO_PA14A_SPI0_SPCK | PIO_PA15A_SPI0_MOSI | PIO_PA16A_SPI0_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI0_NPCS3_IOS1,\ +} + +/* SPI0 IOSET 2 */ + +#define PIN_SPI0_NPCS0_IOS2 { PIO_GROUP_A, PIO_PA30C_SPI0_NPCS0, PIO_PERIPH_C, PIO_PULLUP } +#define PIN_SPI0_NPCS1_IOS2 { PIO_GROUP_A, PIO_PA29C_SPI0_NPCS1, PIO_PERIPH_C, PIO_PULLUP } +#define PIN_SPI0_NPCS2_IOS2 { PIO_GROUP_A, PIO_PA27C_SPI0_NPCS2, PIO_PERIPH_C, PIO_PULLUP } +#define PIN_SPI0_NPCS3_IOS2 { PIO_GROUP_A, PIO_PA28C_SPI0_NPCS3, PIO_PERIPH_C, PIO_PULLUP } + +#define PINS_SPI0_IOS2 {\ + { PIO_GROUP_B, PIO_PB1C_SPI0_SPCK | PIO_PB0C_SPI0_MOSI, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA31C_SPI0_MISO, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define PINS_SPI0_NPCS0_IOS2 {\ + { PIO_GROUP_B, PIO_PB1C_SPI0_SPCK | PIO_PB0C_SPI0_MOSI, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA31C_SPI0_MISO, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_SPI0_NPCS0_IOS2,\ +} + +#define PINS_SPI0_NPCS1_IOS2 {\ + { PIO_GROUP_B, PIO_PB1C_SPI0_SPCK | PIO_PB0C_SPI0_MOSI, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA31C_SPI0_MISO, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_SPI0_NPCS1_IOS2,\ +} + +#define PINS_SPI0_NPCS2_IOS2 {\ + { PIO_GROUP_B, PIO_PB1C_SPI0_SPCK | PIO_PB0C_SPI0_MOSI, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA31C_SPI0_MISO, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_SPI0_NPCS2_IOS2,\ +} + +#define PINS_SPI0_NPCS3_IOS2 {\ + { PIO_GROUP_B, PIO_PB1C_SPI0_SPCK | PIO_PB0C_SPI0_MOSI, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA31C_SPI0_MISO, PIO_PERIPH_C, PIO_DEFAULT },\ + PIN_SPI0_NPCS3_IOS2,\ +} + +/* ========== Pio PIN definition for SPI1 peripheral ========== */ + +/* SPI1 IOSET 1 */ + +#define PIN_SPI1_NPCS0_IOS1 { PIO_GROUP_C, PIO_PC4D_SPI1_NPCS0, PIO_PERIPH_D, PIO_PULLUP } +#define PIN_SPI1_NPCS1_IOS1 { PIO_GROUP_C, PIO_PC5D_SPI1_NPCS1, PIO_PERIPH_D, PIO_PULLUP } +#define PIN_SPI1_NPCS2_IOS1 { PIO_GROUP_C, PIO_PC6D_SPI1_NPCS2, PIO_PERIPH_D, PIO_PULLUP } +#define PIN_SPI1_NPCS3_IOS1 { PIO_GROUP_C, PIO_PC7D_SPI1_NPCS3, PIO_PERIPH_D, PIO_PULLUP } + +#define PINS_SPI1_IOS1 {\ + { PIO_GROUP_C, PIO_PC1D_SPI1_SPCK | PIO_PC2D_SPI1_MOSI | PIO_PC3D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_SPI1_NPCS0_IOS1 {\ + { PIO_GROUP_C, PIO_PC1D_SPI1_SPCK | PIO_PC2D_SPI1_MOSI | PIO_PC3D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS0_IOS1,\ +} + +#define PINS_SPI1_NPCS1_IOS1 {\ + { PIO_GROUP_C, PIO_PC1D_SPI1_SPCK | PIO_PC2D_SPI1_MOSI | PIO_PC3D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS1_IOS1,\ +} + +#define PINS_SPI1_NPCS2_IOS1 {\ + { PIO_GROUP_C, PIO_PC1D_SPI1_SPCK | PIO_PC2D_SPI1_MOSI | PIO_PC3D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS2_IOS1,\ +} + +#define PINS_SPI1_NPCS3_IOS1 {\ + { PIO_GROUP_C, PIO_PC1D_SPI1_SPCK | PIO_PC2D_SPI1_MOSI | PIO_PC3D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS3_IOS1,\ +} + +/* SPI1 IOSET 2 */ + +#define PIN_SPI1_NPCS0_IOS2 { PIO_GROUP_A, PIO_PA25D_SPI1_NPCS0, PIO_PERIPH_D, PIO_PULLUP } +#define PIN_SPI1_NPCS1_IOS2 { PIO_GROUP_A, PIO_PA26D_SPI1_NPCS1, PIO_PERIPH_D, PIO_PULLUP } +#define PIN_SPI1_NPCS2_IOS2 { PIO_GROUP_A, PIO_PA27D_SPI1_NPCS2, PIO_PERIPH_D, PIO_PULLUP } +#define PIN_SPI1_NPCS3_IOS2 { PIO_GROUP_A, PIO_PA28D_SPI1_NPCS3, PIO_PERIPH_D, PIO_PULLUP } + +#define PINS_SPI1_IOS2 {\ + { PIO_GROUP_A, PIO_PA22D_SPI1_SPCK | PIO_PA23D_SPI1_MOSI | PIO_PA24D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_SPI1_NPCS0_IOS2 {\ + { PIO_GROUP_A, PIO_PA22D_SPI1_SPCK | PIO_PA23D_SPI1_MOSI | PIO_PA24D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS0_IOS2,\ +} + +#define PINS_SPI1_NPCS1_IOS2 {\ + { PIO_GROUP_A, PIO_PA22D_SPI1_SPCK | PIO_PA23D_SPI1_MOSI | PIO_PA24D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS1_IOS2,\ +} + +#define PINS_SPI1_NPCS2_IOS2 {\ + { PIO_GROUP_A, PIO_PA22D_SPI1_SPCK | PIO_PA23D_SPI1_MOSI | PIO_PA24D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS2_IOS2,\ +} + +#define PINS_SPI1_NPCS3_IOS2 {\ + { PIO_GROUP_A, PIO_PA22D_SPI1_SPCK | PIO_PA23D_SPI1_MOSI | PIO_PA24D_SPI1_MISO, PIO_PERIPH_D, PIO_DEFAULT },\ + PIN_SPI1_NPCS3_IOS2,\ +} + +/* SPI1 IOSET 3 */ + +#define PIN_SPI1_NPCS0_IOS3 { PIO_GROUP_D, PIO_PD28A_SPI1_NPCS0, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SPI1_NPCS1_IOS3 { PIO_GROUP_D, PIO_PD29A_SPI1_NPCS1, PIO_PERIPH_A, PIO_PULLUP } +#define PIN_SPI1_NPCS2_IOS3 { PIO_GROUP_D, PIO_PD30A_SPI1_NPCS2, PIO_PERIPH_A, PIO_PULLUP } + +#define PINS_SPI1_IOS3 {\ + { PIO_GROUP_D, PIO_PD25A_SPI1_SPCK | PIO_PD26A_SPI1_MOSI | PIO_PD27A_SPI1_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +#define PINS_SPI1_NPCS0_IOS3 {\ + { PIO_GROUP_D, PIO_PD25A_SPI1_SPCK | PIO_PD26A_SPI1_MOSI | PIO_PD27A_SPI1_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI1_NPCS0_IOS3,\ +} + +#define PINS_SPI1_NPCS1_IOS3 {\ + { PIO_GROUP_D, PIO_PD25A_SPI1_SPCK | PIO_PD26A_SPI1_MOSI | PIO_PD27A_SPI1_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI1_NPCS1_IOS3,\ +} + +#define PINS_SPI1_NPCS2_IOS3 {\ + { PIO_GROUP_D, PIO_PD25A_SPI1_SPCK | PIO_PD26A_SPI1_MOSI | PIO_PD27A_SPI1_MISO, PIO_PERIPH_A, PIO_DEFAULT },\ + PIN_SPI1_NPCS2_IOS3,\ +} + +/* ========== Pio PIN definition for SSC0 peripheral ========== */ + +#define SSC0_IOS1_TX (PIO_PB20C_TK0 | PIO_PB21C_TF0 | PIO_PB22C_TD0) +#define SSC0_IOS1_RX (PIO_PB23C_RD0 | PIO_PB24C_RK0 | PIO_PB25C_RF0) +#define PINS_SSC0_IOS1 {\ + { PIO_GROUP_C, SSC0_IOS1_TX | SSC0_IOS1_RX, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +#define SSC0_IOS2_TX (PIO_PC12E_TK0 | PIO_PC13E_TF0 | PIO_PB2PIO_PC14E_TD02C_TD0) +#define SSC0_IOS2_RX (PIO_PC15E_RD0 | PIO_PC16E_RK0 | PIO_PC17E_RF0) +#define PINS_SSC0_IOS2 {\ + { PIO_GROUP_C, SSC0_IOS2_TX | SSC0_IOS2_RX, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for SSC1 peripheral ========== */ + +#define SSC1_IOS1_TX (PIO_PA14B_TK1 | PIO_PA15B_TF1 | PIO_PA16B_TD1) +#define SSC1_IOS1_RX (PIO_PA17B_RD1 | PIO_PA18B_RK1 | PIO_PA19B_RF1) +#define PINS_SSC1_IOS1 {\ + { PIO_GROUP_A, SSC1_IOS1_TX | SSC1_IOS1_RX, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +#define SSC1_IOS2_TX (PIO_PB14C_TK1 | PIO_PB15C_TF1 | PIO_PB16C_TD1) +#define SSC1_IOS2_RX (PIO_PB17C_RD1 | PIO_PB18C_RK1 | PIO_PB19C_RF1) +#define PINS_SSC1_IOS2 {\ + { PIO_GROUP_B, SSC1_IOS2_TX | SSC1_IOS2_RX, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for TC0 peripheral ========== */ + +#define PINS_TC0_TIO0_IOS1 {\ + { PIO_GROUP_A, PIO_PA19D_TIOA0, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA20D_TIOB0, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA21D_TCLK0, PIO_PERIPH_D, PIO_DEFAULT }\ +} + +#define PINS_TC0_TIO1_IOS1 {\ + { PIO_GROUP_C, PIO_PC3C_TIOA1, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC4C_TIOB1, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC5C_TCLK1, PIO_PERIPH_C, PIO_DEFAULT }\ +} + +#define PINS_TC0_TIO1_IOS2 {\ + { PIO_GROUP_A, PIO_PA27A_TIOA1, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA28A_TIOB1, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA29A_TCLK1, PIO_PERIPH_A, PIO_DEFAULT }\ +} + +#define PINS_TC0_TIO1_IOS3 {\ + { PIO_GROUP_D, PIO_PD11A_TIOA1, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD12A_TIOB1, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD13A_TCLK1, PIO_PERIPH_A, PIO_DEFAULT }\ +} + +#define PINS_TC0_TIO2_IOS1 {\ + { PIO_GROUP_B, PIO_PB6A_TIOA2, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB7A_TIOB2, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_PB5A_TCLK2, PIO_CFGR_B, FUNC_PERIPH_A, PIO_DEFAULT }\ +} + +#define PINS_TC0_TIO2_IOS2 {\ + { PIO_GROUP_B, PIO_PB22D_TIOA2, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB23D_TIOB2, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB24D_TCLK2, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_TC0_TIO2_IOS3 {\ + { PIO_GROUP_D, PIO_PD20A_TIOA2, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD21A_TIOB2, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD22A_TCLK2, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for TC1 peripheral ========== */ + +#define PINS_TC1_TIO3_IOS1 {\ + { PIO_GROUP_B, PIO_PB9A_TIOA3, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB10A_TIOB3, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB8A_TCLK3, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +#define PINS_TC1_TIO3_IOS2 {\ + { PIO_GROUP_B, PIO_PB19D_TIOA3, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB20D_TIOB3, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB21D_TCLK3, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_TC1_TIO3_IOS3 {\ + { PIO_GROUP_D, PIO_PD29D_TIOA3, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD30D_TIOB3, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD31D_TCLK3, PIO_PERIPH_D, PIO_DEFAULT },\ +} +#define PINS_TC1_TIO4_IOS1 {\ + { PIO_GROUP_A, PIO_PA9D_TIOA4, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA10D_TIOB4, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA11D_TCLK4, PIO_PERIPH_D, PIO_DEFAULT },\ +} +#define PINS_TC1_TIO4_IOS2 {\ + { PIO_GROUP_C, PIO_PC9D_TIOA4, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC10D_TIOB4, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC11D_TCLK4, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_TC1_TIO5_IOS1 {\ + { PIO_GROUP_A, PIO_PA6D_TIOA5, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA7D_TIOB5, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_A, PIO_PA8D_TCLK5, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +#define PINS_TC1_TIO5_IOS2 {\ + { PIO_GROUP_B, PIO_PB28D_TIOA5, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB29D_TIOB5, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB30D_TCLK5, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for TWIHS0 peripheral ========== */ + +/* TWI0 IOSET 1 */ +#define PINS_TWI0_IOS1 {\ + { PIO_GROUP_B, PIO_PB31D_TWD0, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC0D_TWCK0, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +/* TWI0 IOSET 2 */ +#define PINS_TWI0_IOS2 {\ + { PIO_GROUP_C, PIO_PC27E_TWD0, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC28E_TWCK0, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* TWI0 IOSET 3 */ +#define PINS_TWI0_IOS3 {\ + { PIO_GROUP_D, PIO_PD29E_TWD0, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD30E_TWCK0, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* TWI0 IOSET 4 */ +#define PINS_TWI0_IOS4 {\ + { PIO_GROUP_D, PIO_PD21B_TWD0, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD22B_TWCK0, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for TWIHS1 peripheral ========== */ + +/* TWI1 IOSET 1 */ +#define PINS_TWI1_IOS1 {\ + { PIO_GROUP_C, PIO_PC6C_TWD1, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC7C_TWCK1, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* TWI1 IOSET 2 */ +#define PINS_TWI1_IOS2 {\ + { PIO_GROUP_D, PIO_PD4A_TWD1, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD5A_TWCK1, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* TWI1 IOSET 3 */ +#define PINS_TWI1_IOS3 {\ + { PIO_GROUP_D, PIO_PD19B_TWD1, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD20B_TWCK1, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for UART0 peripheral ========== */ + +/* UART0 IOSET 1 */ +#define PINS_UART0_IOS1 {\ + { PIO_GROUP_B, PIO_PB26C_URXD0, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB27C_UTXD0, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for UART1 peripheral ========== */ + +/* UART1 IOSET 1 */ +#define PINS_UART1_IOS1 {\ + { PIO_GROUP_D, PIO_PD2A_URXD1, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD3A_UTXD1, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* UART1 IOSET 2 */ +#define PINS_UART1_IOS2 {\ + { PIO_GROUP_C, PIO_PC7E_URXD1, PIO_PERIPH_E, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC8E_UTXD1, PIO_PERIPH_E, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for UART2 peripheral ========== */ + +/* UART2 IOSET 1 */ +#define PINS_UART2_IOS1 {\ + { PIO_GROUP_D, PIO_PD4B_URXD2, PIO_PERIPH_B, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD5B_UTXD2, PIO_PERIPH_B, PIO_DEFAULT },\ +} + +/* UART2 IOSET 2 */ +#define PINS_UART2_IOS2 {\ + { PIO_GROUP_D, PIO_PD23A_URXD2, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD24A_UTXD2, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +/* UART2 IOSET 3 */ +#define PINS_UART2_IOS3 {\ + { PIO_GROUP_D, PIO_PD19C_URXD2, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD20C_UTXD2, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for UART3 peripheral ========== */ + +/* UART3 IOSET 1 */ +#define PINS_UART3_IOS1 {\ + { PIO_GROUP_C, PIO_PC12D_URXD3, PIO_PERIPH_D, PIO_DEFAULT },\ + { PIO_GROUP_C, PIO_PC13D_UTXD3, PIO_PERIPH_D, PIO_DEFAULT },\ +} + +/* UART3 IOSET 2 */ +#define PINS_UART3_IOS2 {\ + { PIO_GROUP_C, PIO_PC31C_URXD3, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_D, PIO_PD0C_UTXD3, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* UART3 IOSET 3 */ +#define PINS_UART3_IOS3 {\ + { PIO_GROUP_B, PIO_PB11C_URXD3, PIO_PERIPH_C, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB12C_UTXD3, PIO_PERIPH_C, PIO_DEFAULT },\ +} + +/* ========== Pio PIN definition for UART4 peripheral ========== */ + +/* UART4 IOSET 1 */ +#define PINS_UART4_IOS1 {\ + { PIO_GROUP_B, PIO_PB3A_URXD4, PIO_PERIPH_A, PIO_DEFAULT },\ + { PIO_GROUP_B, PIO_PB4A_UTXD4, PIO_PERIPH_A, PIO_DEFAULT },\ +} + +//============================================================================= + +#endif /* _CHIP_PINS_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_acc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_acc.h new file mode 100644 index 000000000..40a85c5ee --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_acc.h @@ -0,0 +1,127 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_ACC_COMPONENT_ +#define _SAMA5D2_ACC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Analog Comparator Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_ACC Analog Comparator Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Acc hardware registers */ +typedef struct { + __O uint32_t ACC_CR; /**< \brief (Acc Offset: 0x00) Control Register */ + __IO uint32_t ACC_MR; /**< \brief (Acc Offset: 0x04) Mode Register */ + __I uint32_t Reserved1[7]; + __O uint32_t ACC_IER; /**< \brief (Acc Offset: 0x24) Interrupt Enable Register */ + __O uint32_t ACC_IDR; /**< \brief (Acc Offset: 0x28) Interrupt Disable Register */ + __I uint32_t ACC_IMR; /**< \brief (Acc Offset: 0x2C) Interrupt Mask Register */ + __I uint32_t ACC_ISR; /**< \brief (Acc Offset: 0x30) Interrupt Status Register */ + __I uint32_t Reserved2[24]; + __IO uint32_t ACC_ACR; /**< \brief (Acc Offset: 0x94) Analog Control Register */ + __I uint32_t Reserved3[19]; + __IO uint32_t ACC_WPMR; /**< \brief (Acc Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t ACC_WPSR; /**< \brief (Acc Offset: 0xE8) Write Protection Status Register */ +} Acc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- ACC_CR : (ACC Offset: 0x00) Control Register -------- */ +#define ACC_CR_SWRST (0x1u << 0) /**< \brief (ACC_CR) Software Reset */ +/* -------- ACC_MR : (ACC Offset: 0x04) Mode Register -------- */ +#define ACC_MR_SELMINUS_Pos 0 +#define ACC_MR_SELMINUS_Msk (0x7u << ACC_MR_SELMINUS_Pos) /**< \brief (ACC_MR) Selection for Minus Comparator Input */ +#define ACC_MR_SELMINUS(value) ((ACC_MR_SELMINUS_Msk & ((value) << ACC_MR_SELMINUS_Pos))) +#define ACC_MR_SELMINUS_TS (0x0u << 0) /**< \brief (ACC_MR) Select TS */ +#define ACC_MR_SELMINUS_ADVREF (0x1u << 0) /**< \brief (ACC_MR) Select ADVREF */ +#define ACC_MR_SELMINUS_DAC0 (0x2u << 0) /**< \brief (ACC_MR) Select DAC0 */ +#define ACC_MR_SELMINUS_DAC1 (0x3u << 0) /**< \brief (ACC_MR) Select DAC1 */ +#define ACC_MR_SELMINUS_AD0 (0x4u << 0) /**< \brief (ACC_MR) Select AD0 */ +#define ACC_MR_SELMINUS_AD1 (0x5u << 0) /**< \brief (ACC_MR) Select AD1 */ +#define ACC_MR_SELMINUS_AD2 (0x6u << 0) /**< \brief (ACC_MR) Select AD2 */ +#define ACC_MR_SELMINUS_AD3 (0x7u << 0) /**< \brief (ACC_MR) Select AD3 */ +#define ACC_MR_SELPLUS_Pos 4 +#define ACC_MR_SELPLUS_Msk (0x7u << ACC_MR_SELPLUS_Pos) /**< \brief (ACC_MR) Selection For Plus Comparator Input */ +#define ACC_MR_SELPLUS(value) ((ACC_MR_SELPLUS_Msk & ((value) << ACC_MR_SELPLUS_Pos))) +#define ACC_MR_SELPLUS_AD0 (0x0u << 4) /**< \brief (ACC_MR) Select AD0 */ +#define ACC_MR_SELPLUS_AD1 (0x1u << 4) /**< \brief (ACC_MR) Select AD1 */ +#define ACC_MR_SELPLUS_AD2 (0x2u << 4) /**< \brief (ACC_MR) Select AD2 */ +#define ACC_MR_SELPLUS_AD3 (0x3u << 4) /**< \brief (ACC_MR) Select AD3 */ +#define ACC_MR_SELPLUS_AD4 (0x4u << 4) /**< \brief (ACC_MR) Select AD4 */ +#define ACC_MR_SELPLUS_AD5 (0x5u << 4) /**< \brief (ACC_MR) Select AD5 */ +#define ACC_MR_SELPLUS_AD6 (0x6u << 4) /**< \brief (ACC_MR) Select AD6 */ +#define ACC_MR_SELPLUS_AD7 (0x7u << 4) /**< \brief (ACC_MR) Select AD7 */ +#define ACC_MR_ACEN (0x1u << 8) /**< \brief (ACC_MR) Analog Comparator Enable */ +#define ACC_MR_ACEN_DIS (0x0u << 8) /**< \brief (ACC_MR) Analog comparator disabled. */ +#define ACC_MR_ACEN_EN (0x1u << 8) /**< \brief (ACC_MR) Analog comparator enabled. */ +#define ACC_MR_EDGETYP_Pos 9 +#define ACC_MR_EDGETYP_Msk (0x3u << ACC_MR_EDGETYP_Pos) /**< \brief (ACC_MR) Edge Type */ +#define ACC_MR_EDGETYP(value) ((ACC_MR_EDGETYP_Msk & ((value) << ACC_MR_EDGETYP_Pos))) +#define ACC_MR_EDGETYP_RISING (0x0u << 9) /**< \brief (ACC_MR) Only rising edge of comparator output */ +#define ACC_MR_EDGETYP_FALLING (0x1u << 9) /**< \brief (ACC_MR) Falling edge of comparator output */ +#define ACC_MR_EDGETYP_ANY (0x2u << 9) /**< \brief (ACC_MR) Any edge of comparator output */ +#define ACC_MR_INV (0x1u << 12) /**< \brief (ACC_MR) Invert Comparator Output */ +#define ACC_MR_INV_DIS (0x0u << 12) /**< \brief (ACC_MR) Analog comparator output is directly processed. */ +#define ACC_MR_INV_EN (0x1u << 12) /**< \brief (ACC_MR) Analog comparator output is inverted prior to being processed. */ +#define ACC_MR_SELFS (0x1u << 13) /**< \brief (ACC_MR) Selection Of Fault Source */ +#define ACC_MR_SELFS_CE (0x0u << 13) /**< \brief (ACC_MR) The CE flag is used to drive the FAULT output. */ +#define ACC_MR_SELFS_OUTPUT (0x1u << 13) /**< \brief (ACC_MR) The output of the analog comparator flag is used to drive the FAULT output. */ +#define ACC_MR_FE (0x1u << 14) /**< \brief (ACC_MR) Fault Enable */ +#define ACC_MR_FE_DIS (0x0u << 14) /**< \brief (ACC_MR) The FAULT output is tied to 0. */ +#define ACC_MR_FE_EN (0x1u << 14) /**< \brief (ACC_MR) The FAULT output is driven by the signal defined by SELFS. */ +/* -------- ACC_IER : (ACC Offset: 0x24) Interrupt Enable Register -------- */ +#define ACC_IER_CE (0x1u << 0) /**< \brief (ACC_IER) Comparison Edge */ +/* -------- ACC_IDR : (ACC Offset: 0x28) Interrupt Disable Register -------- */ +#define ACC_IDR_CE (0x1u << 0) /**< \brief (ACC_IDR) Comparison Edge */ +/* -------- ACC_IMR : (ACC Offset: 0x2C) Interrupt Mask Register -------- */ +#define ACC_IMR_CE (0x1u << 0) /**< \brief (ACC_IMR) Comparison Edge */ +/* -------- ACC_ISR : (ACC Offset: 0x30) Interrupt Status Register -------- */ +#define ACC_ISR_CE (0x1u << 0) /**< \brief (ACC_ISR) Comparison Edge (cleared on read) */ +#define ACC_ISR_SCO (0x1u << 1) /**< \brief (ACC_ISR) Synchronized Comparator Output */ +#define ACC_ISR_MASK (0x1u << 31) /**< \brief (ACC_ISR) Flag Mask */ +/* -------- ACC_ACR : (ACC Offset: 0x94) Analog Control Register -------- */ +#define ACC_ACR_ISEL (0x1u << 0) /**< \brief (ACC_ACR) Current Selection */ +#define ACC_ACR_ISEL_LOPW (0x0u << 0) /**< \brief (ACC_ACR) Low-power option. */ +#define ACC_ACR_ISEL_HISP (0x1u << 0) /**< \brief (ACC_ACR) High-speed option. */ +#define ACC_ACR_HYST_Pos 1 +#define ACC_ACR_HYST_Msk (0x3u << ACC_ACR_HYST_Pos) /**< \brief (ACC_ACR) Hysteresis Selection */ +#define ACC_ACR_HYST(value) ((ACC_ACR_HYST_Msk & ((value) << ACC_ACR_HYST_Pos))) +/* -------- ACC_WPMR : (ACC Offset: 0xE4) Write Protection Mode Register -------- */ +#define ACC_WPMR_WPEN (0x1u << 0) /**< \brief (ACC_WPMR) Write Protection Enable */ +#define ACC_WPMR_WPKEY_Pos 8 +#define ACC_WPMR_WPKEY_Msk (0xffffffu << ACC_WPMR_WPKEY_Pos) /**< \brief (ACC_WPMR) Write Protection Key */ +#define ACC_WPMR_WPKEY(value) ((ACC_WPMR_WPKEY_Msk & ((value) << ACC_WPMR_WPKEY_Pos))) +#define ACC_WPMR_WPKEY_PASSWD (0x414343u << 8) /**< \brief (ACC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- ACC_WPSR : (ACC Offset: 0xE8) Write Protection Status Register -------- */ +#define ACC_WPSR_WPVS (0x1u << 0) /**< \brief (ACC_WPSR) Write Protection Violation Status */ + +/*@}*/ + +#endif /* _SAMA5D2_ACC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_adc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_adc.h new file mode 100644 index 000000000..5cb675e07 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_adc.h @@ -0,0 +1,629 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_ADC_COMPONENT_ +#define _SAMA5D2_ADC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Analog-to-Digital Converter */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_ADC Analog-to-Digital Converter */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Adc hardware registers */ +typedef struct { + __O uint32_t ADC_CR; /**< \brief (Adc Offset: 0x00) Control Register */ + __IO uint32_t ADC_MR; /**< \brief (Adc Offset: 0x04) Mode Register */ + __IO uint32_t ADC_SEQR1; /**< \brief (Adc Offset: 0x08) Channel Sequence Register 1 */ + __IO uint32_t ADC_SEQR2; /**< \brief (Adc Offset: 0x0C) Channel Sequence Register 2 */ + __O uint32_t ADC_CHER; /**< \brief (Adc Offset: 0x10) Channel Enable Register */ + __O uint32_t ADC_CHDR; /**< \brief (Adc Offset: 0x14) Channel Disable Register */ + __I uint32_t ADC_CHSR; /**< \brief (Adc Offset: 0x18) Channel Status Register */ + __I uint32_t Reserved1[1]; + __I uint32_t ADC_LCDR; /**< \brief (Adc Offset: 0x20) Last Converted Data Register */ + __O uint32_t ADC_IER; /**< \brief (Adc Offset: 0x24) Interrupt Enable Register */ + __O uint32_t ADC_IDR; /**< \brief (Adc Offset: 0x28) Interrupt Disable Register */ + __I uint32_t ADC_IMR; /**< \brief (Adc Offset: 0x2C) Interrupt Mask Register */ + __I uint32_t ADC_ISR; /**< \brief (Adc Offset: 0x30) Interrupt Status Register */ + __IO uint32_t ADC_LCTMR; /**< \brief (Adc Offset: 0x34) Last Channel Trigger Mode Register */ + __IO uint32_t ADC_LCCWR; /**< \brief (Adc Offset: 0x38) Last Channel Compare Window Register */ + __I uint32_t ADC_OVER; /**< \brief (Adc Offset: 0x3C) Overrun Status Register */ + __IO uint32_t ADC_EMR; /**< \brief (Adc Offset: 0x40) Extended Mode Register */ + __IO uint32_t ADC_CWR; /**< \brief (Adc Offset: 0x44) Compare Window Register */ + __IO uint32_t ADC_CGR; /**< \brief (Adc Offset: 0x48) Channel Gain Register */ + __IO uint32_t ADC_COR; /**< \brief (Adc Offset: 0x4C) Channel Offset Register */ + __I uint32_t ADC_CDR[12]; /**< \brief (Adc Offset: 0x50) Channel Data Registers */ + __I uint32_t Reserved2[5]; + __IO uint32_t ADC_ACR; /**< \brief (Adc Offset: 0x94) Analog Control Register */ + __I uint32_t Reserved3[6]; + __IO uint32_t ADC_TSMR; /**< \brief (Adc Offset: 0xB0) Touchscreen Mode Register */ + __I uint32_t ADC_XPOSR; /**< \brief (Adc Offset: 0xB4) Touchscreen X Position Register */ + __I uint32_t ADC_YPOSR; /**< \brief (Adc Offset: 0xB8) Touchscreen Y Position Register */ + __I uint32_t ADC_PRESSR; /**< \brief (Adc Offset: 0xBC) Touchscreen Pressure Register */ + __IO uint32_t ADC_TRGR; /**< \brief (Adc Offset: 0xC0) Trigger Register */ + __I uint32_t Reserved4[3]; + __IO uint32_t ADC_COSR; /**< \brief (Adc Offset: 0xD0) Correction Select Register */ + __IO uint32_t ADC_CVR; /**< \brief (Adc Offset: 0xD4) Correction Values Register */ + __IO uint32_t ADC_CECR; /**< \brief (Adc Offset: 0xD8) Channel Error Correction Register */ + __I uint32_t Reserved5[2]; + __IO uint32_t ADC_WPMR; /**< \brief (Adc Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t ADC_WPSR; /**< \brief (Adc Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved6[4]; + __I uint32_t ADC_VERSION; /**< \brief (Adc Offset: 0xFC) Version Register */ +} Adc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- ADC_CR : (ADC Offset: 0x00) Control Register -------- */ +#define ADC_CR_SWRST (0x1u << 0) /**< \brief (ADC_CR) Software Reset */ +#define ADC_CR_START (0x1u << 1) /**< \brief (ADC_CR) Start Conversion */ +#define ADC_CR_TSCALIB (0x1u << 2) /**< \brief (ADC_CR) Touchscreen Calibration */ +#define ADC_CR_CMPRST (0x1u << 4) /**< \brief (ADC_CR) Comparison Restart */ +/* -------- ADC_MR : (ADC Offset: 0x04) Mode Register -------- */ +#define ADC_MR_TRGSEL_Pos 1 +#define ADC_MR_TRGSEL_Msk (0x7u << ADC_MR_TRGSEL_Pos) /**< \brief (ADC_MR) Trigger Selection */ +#define ADC_MR_TRGSEL(value) ((ADC_MR_TRGSEL_Msk & ((value) << ADC_MR_TRGSEL_Pos))) +#define ADC_MR_TRGSEL_ADC_TRIG0 (0x0u << 1) /**< \brief (ADC_MR) ADTRG */ +#define ADC_MR_TRGSEL_ADC_TRIG1 (0x1u << 1) /**< \brief (ADC_MR) TIOA0 */ +#define ADC_MR_TRGSEL_ADC_TRIG2 (0x2u << 1) /**< \brief (ADC_MR) TIOA1 */ +#define ADC_MR_TRGSEL_ADC_TRIG3 (0x3u << 1) /**< \brief (ADC_MR) TIOA2 */ +#define ADC_MR_TRGSEL_ADC_TRIG4 (0x4u << 1) /**< \brief (ADC_MR) PWM event line 0 */ +#define ADC_MR_TRGSEL_ADC_TRIG5 (0x5u << 1) /**< \brief (ADC_MR) PWM_even line 1 */ +#define ADC_MR_SLEEP (0x1u << 5) /**< \brief (ADC_MR) Sleep Mode */ +#define ADC_MR_SLEEP_NORMAL (0x0u << 5) /**< \brief (ADC_MR) Normal Mode: The ADC core and reference voltage circuitry are kept ON between conversions. */ +#define ADC_MR_SLEEP_SLEEP (0x1u << 5) /**< \brief (ADC_MR) Sleep Mode: The wake-up time can be modified by programming FWUP bit. */ +#define ADC_MR_FWUP (0x1u << 6) /**< \brief (ADC_MR) Fast Wake Up */ +#define ADC_MR_FWUP_OFF (0x0u << 6) /**< \brief (ADC_MR) If SLEEP is 1, then both ADC core and reference voltage circuitry are OFF between conversions */ +#define ADC_MR_FWUP_ON (0x1u << 6) /**< \brief (ADC_MR) If SLEEP is 1, then Fast Wake-up Sleep mode: The voltage reference is ON between conversions and ADC core is OFF */ +#define ADC_MR_PRESCAL_Pos 8 +#define ADC_MR_PRESCAL_Msk (0xffu << ADC_MR_PRESCAL_Pos) /**< \brief (ADC_MR) Prescaler Rate Selection */ +#define ADC_MR_PRESCAL(value) ((ADC_MR_PRESCAL_Msk & ((value) << ADC_MR_PRESCAL_Pos))) +#define ADC_MR_STARTUP_Pos 16 +#define ADC_MR_STARTUP_Msk (0xfu << ADC_MR_STARTUP_Pos) /**< \brief (ADC_MR) Startup Time */ +#define ADC_MR_STARTUP(value) ((ADC_MR_STARTUP_Msk & ((value) << ADC_MR_STARTUP_Pos))) +#define ADC_MR_STARTUP_SUT0 (0x0u << 16) /**< \brief (ADC_MR) 0 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT8 (0x1u << 16) /**< \brief (ADC_MR) 8 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT16 (0x2u << 16) /**< \brief (ADC_MR) 16 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT24 (0x3u << 16) /**< \brief (ADC_MR) 24 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT64 (0x4u << 16) /**< \brief (ADC_MR) 64 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT80 (0x5u << 16) /**< \brief (ADC_MR) 80 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT96 (0x6u << 16) /**< \brief (ADC_MR) 96 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT112 (0x7u << 16) /**< \brief (ADC_MR) 112 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT512 (0x8u << 16) /**< \brief (ADC_MR) 512 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT576 (0x9u << 16) /**< \brief (ADC_MR) 576 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT640 (0xAu << 16) /**< \brief (ADC_MR) 640 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT704 (0xBu << 16) /**< \brief (ADC_MR) 704 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT768 (0xCu << 16) /**< \brief (ADC_MR) 768 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT832 (0xDu << 16) /**< \brief (ADC_MR) 832 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT896 (0xEu << 16) /**< \brief (ADC_MR) 896 periods of ADCCLK */ +#define ADC_MR_STARTUP_SUT960 (0xFu << 16) /**< \brief (ADC_MR) 960 periods of ADCCLK */ +#define ADC_MR_SETTLING_Pos 20 +#define ADC_MR_SETTLING_Msk (0x3u << ADC_MR_SETTLING_Pos) /**< \brief (ADC_MR) Analog Settling Time */ +#define ADC_MR_SETTLING(value) ((ADC_MR_SETTLING_Msk & ((value) << ADC_MR_SETTLING_Pos))) +#define ADC_MR_SETTLING_AST3 (0x0u << 20) /**< \brief (ADC_MR) 3 periods of ADCCLK */ +#define ADC_MR_SETTLING_AST5 (0x1u << 20) /**< \brief (ADC_MR) 5 periods of ADCCLK */ +#define ADC_MR_SETTLING_AST9 (0x2u << 20) /**< \brief (ADC_MR) 9 periods of ADCCLK */ +#define ADC_MR_SETTLING_AST17 (0x3u << 20) /**< \brief (ADC_MR) 17 periods of ADCCLK */ +#define ADC_MR_ANACH (0x1u << 23) /**< \brief (ADC_MR) Analog Change */ +#define ADC_MR_ANACH_NONE (0x0u << 23) /**< \brief (ADC_MR) No analog change on channel switching: DIFF0, GAIN0 and OFF0 are used for all channels. */ +#define ADC_MR_ANACH_ALLOWED (0x1u << 23) /**< \brief (ADC_MR) Allows different analog settings for each channel. See ADC_CGR and ADC_COR registers. */ +#define ADC_MR_TRACKTIM_Pos 24 +#define ADC_MR_TRACKTIM_Msk (0xfu << ADC_MR_TRACKTIM_Pos) /**< \brief (ADC_MR) Tracking Time */ +#define ADC_MR_TRACKTIM(value) ((ADC_MR_TRACKTIM_Msk & ((value) << ADC_MR_TRACKTIM_Pos))) +#define ADC_MR_TRANSFER_Pos 28 +#define ADC_MR_TRANSFER_Msk (0x3u << ADC_MR_TRANSFER_Pos) /**< \brief (ADC_MR) Hold Time */ +#define ADC_MR_TRANSFER(value) ((ADC_MR_TRANSFER_Msk & ((value) << ADC_MR_TRANSFER_Pos))) +#define ADC_MR_USEQ (0x1u << 31) /**< \brief (ADC_MR) Use Sequence Enable */ +#define ADC_MR_USEQ_NUM_ORDER (0x0u << 31) /**< \brief (ADC_MR) Normal Mode: The controller converts channels in a simple numeric order depending only on the channel index. */ +#define ADC_MR_USEQ_REG_ORDER (0x1u << 31) /**< \brief (ADC_MR) User Sequence Mode: The sequence respects what is defined in ADC_SEQR1 and ADC_SEQR2 registers and can be used to convert the same channel several times. */ +/* -------- ADC_SEQR1 : (ADC Offset: 0x08) Channel Sequence Register 1 -------- */ +#define ADC_SEQR1_USCH1_Pos 0 +#define ADC_SEQR1_USCH1_Msk (0xfu << ADC_SEQR1_USCH1_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 1 */ +#define ADC_SEQR1_USCH1(value) ((ADC_SEQR1_USCH1_Msk & ((value) << ADC_SEQR1_USCH1_Pos))) +#define ADC_SEQR1_USCH2_Pos 4 +#define ADC_SEQR1_USCH2_Msk (0xfu << ADC_SEQR1_USCH2_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 2 */ +#define ADC_SEQR1_USCH2(value) ((ADC_SEQR1_USCH2_Msk & ((value) << ADC_SEQR1_USCH2_Pos))) +#define ADC_SEQR1_USCH3_Pos 8 +#define ADC_SEQR1_USCH3_Msk (0xfu << ADC_SEQR1_USCH3_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 3 */ +#define ADC_SEQR1_USCH3(value) ((ADC_SEQR1_USCH3_Msk & ((value) << ADC_SEQR1_USCH3_Pos))) +#define ADC_SEQR1_USCH4_Pos 12 +#define ADC_SEQR1_USCH4_Msk (0xfu << ADC_SEQR1_USCH4_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 4 */ +#define ADC_SEQR1_USCH4(value) ((ADC_SEQR1_USCH4_Msk & ((value) << ADC_SEQR1_USCH4_Pos))) +#define ADC_SEQR1_USCH5_Pos 16 +#define ADC_SEQR1_USCH5_Msk (0xfu << ADC_SEQR1_USCH5_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 5 */ +#define ADC_SEQR1_USCH5(value) ((ADC_SEQR1_USCH5_Msk & ((value) << ADC_SEQR1_USCH5_Pos))) +#define ADC_SEQR1_USCH6_Pos 20 +#define ADC_SEQR1_USCH6_Msk (0xfu << ADC_SEQR1_USCH6_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 6 */ +#define ADC_SEQR1_USCH6(value) ((ADC_SEQR1_USCH6_Msk & ((value) << ADC_SEQR1_USCH6_Pos))) +#define ADC_SEQR1_USCH7_Pos 24 +#define ADC_SEQR1_USCH7_Msk (0xfu << ADC_SEQR1_USCH7_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 7 */ +#define ADC_SEQR1_USCH7(value) ((ADC_SEQR1_USCH7_Msk & ((value) << ADC_SEQR1_USCH7_Pos))) +#define ADC_SEQR1_USCH8_Pos 28 +#define ADC_SEQR1_USCH8_Msk (0xfu << ADC_SEQR1_USCH8_Pos) /**< \brief (ADC_SEQR1) User Sequence Number 8 */ +#define ADC_SEQR1_USCH8(value) ((ADC_SEQR1_USCH8_Msk & ((value) << ADC_SEQR1_USCH8_Pos))) +/* -------- ADC_SEQR2 : (ADC Offset: 0x0C) Channel Sequence Register 2 -------- */ +#define ADC_SEQR2_USCH9_Pos 0 +#define ADC_SEQR2_USCH9_Msk (0xfu << ADC_SEQR2_USCH9_Pos) /**< \brief (ADC_SEQR2) User Sequence Number 9 */ +#define ADC_SEQR2_USCH9(value) ((ADC_SEQR2_USCH9_Msk & ((value) << ADC_SEQR2_USCH9_Pos))) +#define ADC_SEQR2_USCH10_Pos 4 +#define ADC_SEQR2_USCH10_Msk (0xfu << ADC_SEQR2_USCH10_Pos) /**< \brief (ADC_SEQR2) User Sequence Number 10 */ +#define ADC_SEQR2_USCH10(value) ((ADC_SEQR2_USCH10_Msk & ((value) << ADC_SEQR2_USCH10_Pos))) +#define ADC_SEQR2_USCH11_Pos 8 +#define ADC_SEQR2_USCH11_Msk (0xfu << ADC_SEQR2_USCH11_Pos) /**< \brief (ADC_SEQR2) User Sequence Number 11 */ +#define ADC_SEQR2_USCH11(value) ((ADC_SEQR2_USCH11_Msk & ((value) << ADC_SEQR2_USCH11_Pos))) +/* -------- ADC_CHER : (ADC Offset: 0x10) Channel Enable Register -------- */ +#define ADC_CHER_CH0 (0x1u << 0) /**< \brief (ADC_CHER) Channel 0 Enable */ +#define ADC_CHER_CH1 (0x1u << 1) /**< \brief (ADC_CHER) Channel 1 Enable */ +#define ADC_CHER_CH2 (0x1u << 2) /**< \brief (ADC_CHER) Channel 2 Enable */ +#define ADC_CHER_CH3 (0x1u << 3) /**< \brief (ADC_CHER) Channel 3 Enable */ +#define ADC_CHER_CH4 (0x1u << 4) /**< \brief (ADC_CHER) Channel 4 Enable */ +#define ADC_CHER_CH5 (0x1u << 5) /**< \brief (ADC_CHER) Channel 5 Enable */ +#define ADC_CHER_CH6 (0x1u << 6) /**< \brief (ADC_CHER) Channel 6 Enable */ +#define ADC_CHER_CH7 (0x1u << 7) /**< \brief (ADC_CHER) Channel 7 Enable */ +#define ADC_CHER_CH8 (0x1u << 8) /**< \brief (ADC_CHER) Channel 8 Enable */ +#define ADC_CHER_CH9 (0x1u << 9) /**< \brief (ADC_CHER) Channel 9 Enable */ +#define ADC_CHER_CH10 (0x1u << 10) /**< \brief (ADC_CHER) Channel 10 Enable */ +#define ADC_CHER_CH11 (0x1u << 11) /**< \brief (ADC_CHER) Channel 11 Enable */ +/* -------- ADC_CHDR : (ADC Offset: 0x14) Channel Disable Register -------- */ +#define ADC_CHDR_CH0 (0x1u << 0) /**< \brief (ADC_CHDR) Channel 0 Disable */ +#define ADC_CHDR_CH1 (0x1u << 1) /**< \brief (ADC_CHDR) Channel 1 Disable */ +#define ADC_CHDR_CH2 (0x1u << 2) /**< \brief (ADC_CHDR) Channel 2 Disable */ +#define ADC_CHDR_CH3 (0x1u << 3) /**< \brief (ADC_CHDR) Channel 3 Disable */ +#define ADC_CHDR_CH4 (0x1u << 4) /**< \brief (ADC_CHDR) Channel 4 Disable */ +#define ADC_CHDR_CH5 (0x1u << 5) /**< \brief (ADC_CHDR) Channel 5 Disable */ +#define ADC_CHDR_CH6 (0x1u << 6) /**< \brief (ADC_CHDR) Channel 6 Disable */ +#define ADC_CHDR_CH7 (0x1u << 7) /**< \brief (ADC_CHDR) Channel 7 Disable */ +#define ADC_CHDR_CH8 (0x1u << 8) /**< \brief (ADC_CHDR) Channel 8 Disable */ +#define ADC_CHDR_CH9 (0x1u << 9) /**< \brief (ADC_CHDR) Channel 9 Disable */ +#define ADC_CHDR_CH10 (0x1u << 10) /**< \brief (ADC_CHDR) Channel 10 Disable */ +#define ADC_CHDR_CH11 (0x1u << 11) /**< \brief (ADC_CHDR) Channel 11 Disable */ +/* -------- ADC_CHSR : (ADC Offset: 0x18) Channel Status Register -------- */ +#define ADC_CHSR_CH0 (0x1u << 0) /**< \brief (ADC_CHSR) Channel 0 Status */ +#define ADC_CHSR_CH1 (0x1u << 1) /**< \brief (ADC_CHSR) Channel 1 Status */ +#define ADC_CHSR_CH2 (0x1u << 2) /**< \brief (ADC_CHSR) Channel 2 Status */ +#define ADC_CHSR_CH3 (0x1u << 3) /**< \brief (ADC_CHSR) Channel 3 Status */ +#define ADC_CHSR_CH4 (0x1u << 4) /**< \brief (ADC_CHSR) Channel 4 Status */ +#define ADC_CHSR_CH5 (0x1u << 5) /**< \brief (ADC_CHSR) Channel 5 Status */ +#define ADC_CHSR_CH6 (0x1u << 6) /**< \brief (ADC_CHSR) Channel 6 Status */ +#define ADC_CHSR_CH7 (0x1u << 7) /**< \brief (ADC_CHSR) Channel 7 Status */ +#define ADC_CHSR_CH8 (0x1u << 8) /**< \brief (ADC_CHSR) Channel 8 Status */ +#define ADC_CHSR_CH9 (0x1u << 9) /**< \brief (ADC_CHSR) Channel 9 Status */ +#define ADC_CHSR_CH10 (0x1u << 10) /**< \brief (ADC_CHSR) Channel 10 Status */ +#define ADC_CHSR_CH11 (0x1u << 11) /**< \brief (ADC_CHSR) Channel 11 Status */ +/* -------- ADC_LCDR : (ADC Offset: 0x20) Last Converted Data Register -------- */ +#define ADC_LCDR_LDATA_Pos 0 +#define ADC_LCDR_LDATA_Msk (0xfffu << ADC_LCDR_LDATA_Pos) /**< \brief (ADC_LCDR) Last Data Converted */ +#define ADC_LCDR_CHNB_Pos 12 +#define ADC_LCDR_CHNB_Msk (0xfu << ADC_LCDR_CHNB_Pos) /**< \brief (ADC_LCDR) Channel Number */ +/* -------- ADC_IER : (ADC Offset: 0x24) Interrupt Enable Register -------- */ +#define ADC_IER_EOC0 (0x1u << 0) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 0 */ +#define ADC_IER_EOC1 (0x1u << 1) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 1 */ +#define ADC_IER_EOC2 (0x1u << 2) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 2 */ +#define ADC_IER_EOC3 (0x1u << 3) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 3 */ +#define ADC_IER_EOC4 (0x1u << 4) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 4 */ +#define ADC_IER_EOC5 (0x1u << 5) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 5 */ +#define ADC_IER_EOC6 (0x1u << 6) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 6 */ +#define ADC_IER_EOC7 (0x1u << 7) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 7 */ +#define ADC_IER_EOC8 (0x1u << 8) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 8 */ +#define ADC_IER_EOC9 (0x1u << 9) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 9 */ +#define ADC_IER_EOC10 (0x1u << 10) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 10 */ +#define ADC_IER_EOC11 (0x1u << 11) /**< \brief (ADC_IER) End of Conversion Interrupt Enable 11 */ +#define ADC_IER_VALUE_ (0x1u << 12) /**< \brief (ADC_IER) */ +#define ADC_IER_LCCHG (0x1u << 19) /**< \brief (ADC_IER) Last Channel Change Interrupt Enable */ +#define ADC_IER_XRDY (0x1u << 20) /**< \brief (ADC_IER) Touchscreen Measure XPOS Ready Interrupt Enable */ +#define ADC_IER_YRDY (0x1u << 21) /**< \brief (ADC_IER) Touchscreen Measure YPOS Ready Interrupt Enable */ +#define ADC_IER_PRDY (0x1u << 22) /**< \brief (ADC_IER) Touchscreen Measure Pressure Ready Interrupt Enable */ +#define ADC_IER_DRDY (0x1u << 24) /**< \brief (ADC_IER) Data Ready Interrupt Enable */ +#define ADC_IER_GOVRE (0x1u << 25) /**< \brief (ADC_IER) General Overrun Error Interrupt Enable */ +#define ADC_IER_COMPE (0x1u << 26) /**< \brief (ADC_IER) Comparison Event Interrupt Enable */ +#define ADC_IER_PEN (0x1u << 29) /**< \brief (ADC_IER) Pen Contact Interrupt Enable */ +#define ADC_IER_NOPEN (0x1u << 30) /**< \brief (ADC_IER) No Pen Contact Interrupt Enable */ +/* -------- ADC_IDR : (ADC Offset: 0x28) Interrupt Disable Register -------- */ +#define ADC_IDR_EOC0 (0x1u << 0) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 0 */ +#define ADC_IDR_EOC1 (0x1u << 1) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 1 */ +#define ADC_IDR_EOC2 (0x1u << 2) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 2 */ +#define ADC_IDR_EOC3 (0x1u << 3) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 3 */ +#define ADC_IDR_EOC4 (0x1u << 4) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 4 */ +#define ADC_IDR_EOC5 (0x1u << 5) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 5 */ +#define ADC_IDR_EOC6 (0x1u << 6) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 6 */ +#define ADC_IDR_EOC7 (0x1u << 7) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 7 */ +#define ADC_IDR_EOC8 (0x1u << 8) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 8 */ +#define ADC_IDR_EOC9 (0x1u << 9) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 9 */ +#define ADC_IDR_EOC10 (0x1u << 10) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 10 */ +#define ADC_IDR_EOC11 (0x1u << 11) /**< \brief (ADC_IDR) End of Conversion Interrupt Disable 11 */ +#define ADC_IDR_VALUE_ (0x1u << 12) /**< \brief (ADC_IDR) */ +#define ADC_IDR_LCCHG (0x1u << 19) /**< \brief (ADC_IDR) Last Channel Change Interrupt Disable */ +#define ADC_IDR_XRDY (0x1u << 20) /**< \brief (ADC_IDR) Touchscreen Measure XPOS Ready Interrupt Disable */ +#define ADC_IDR_YRDY (0x1u << 21) /**< \brief (ADC_IDR) Touchscreen Measure YPOS Ready Interrupt Disable */ +#define ADC_IDR_PRDY (0x1u << 22) /**< \brief (ADC_IDR) Touchscreen Measure Pressure Ready Interrupt Disable */ +#define ADC_IDR_DRDY (0x1u << 24) /**< \brief (ADC_IDR) Data Ready Interrupt Disable */ +#define ADC_IDR_GOVRE (0x1u << 25) /**< \brief (ADC_IDR) General Overrun Error Interrupt Disable */ +#define ADC_IDR_COMPE (0x1u << 26) /**< \brief (ADC_IDR) Comparison Event Interrupt Disable */ +#define ADC_IDR_PEN (0x1u << 29) /**< \brief (ADC_IDR) Pen Contact Interrupt Disable */ +#define ADC_IDR_NOPEN (0x1u << 30) /**< \brief (ADC_IDR) No Pen Contact Interrupt Disable */ +/* -------- ADC_IMR : (ADC Offset: 0x2C) Interrupt Mask Register -------- */ +#define ADC_IMR_EOC0 (0x1u << 0) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 0 */ +#define ADC_IMR_EOC1 (0x1u << 1) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 1 */ +#define ADC_IMR_EOC2 (0x1u << 2) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 2 */ +#define ADC_IMR_EOC3 (0x1u << 3) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 3 */ +#define ADC_IMR_EOC4 (0x1u << 4) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 4 */ +#define ADC_IMR_EOC5 (0x1u << 5) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 5 */ +#define ADC_IMR_EOC6 (0x1u << 6) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 6 */ +#define ADC_IMR_EOC7 (0x1u << 7) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 7 */ +#define ADC_IMR_EOC8 (0x1u << 8) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 8 */ +#define ADC_IMR_EOC9 (0x1u << 9) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 9 */ +#define ADC_IMR_EOC10 (0x1u << 10) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 10 */ +#define ADC_IMR_EOC11 (0x1u << 11) /**< \brief (ADC_IMR) End of Conversion Interrupt Mask 11 */ +#define ADC_IMR_VALUE_ (0x1u << 12) /**< \brief (ADC_IMR) */ +#define ADC_IMR_LCCHG (0x1u << 19) /**< \brief (ADC_IMR) Last Channel Change Interrupt Mask */ +#define ADC_IMR_XRDY (0x1u << 20) /**< \brief (ADC_IMR) Touchscreen Measure XPOS Ready Interrupt Mask */ +#define ADC_IMR_YRDY (0x1u << 21) /**< \brief (ADC_IMR) Touchscreen Measure YPOS Ready Interrupt Mask */ +#define ADC_IMR_PRDY (0x1u << 22) /**< \brief (ADC_IMR) Touchscreen Measure Pressure Ready Interrupt Mask */ +#define ADC_IMR_DRDY (0x1u << 24) /**< \brief (ADC_IMR) Data Ready Interrupt Mask */ +#define ADC_IMR_GOVRE (0x1u << 25) /**< \brief (ADC_IMR) General Overrun Error Interrupt Mask */ +#define ADC_IMR_COMPE (0x1u << 26) /**< \brief (ADC_IMR) Comparison Event Interrupt Mask */ +#define ADC_IMR_PEN (0x1u << 29) /**< \brief (ADC_IMR) Pen Contact Interrupt Mask */ +#define ADC_IMR_NOPEN (0x1u << 30) /**< \brief (ADC_IMR) No Pen Contact Interrupt Mask */ +/* -------- ADC_ISR : (ADC Offset: 0x30) Interrupt Status Register -------- */ +#define ADC_ISR_EOC0 (0x1u << 0) /**< \brief (ADC_ISR) End of Conversion 0 (automatically set / cleared) */ +#define ADC_ISR_EOC1 (0x1u << 1) /**< \brief (ADC_ISR) End of Conversion 1 (automatically set / cleared) */ +#define ADC_ISR_EOC2 (0x1u << 2) /**< \brief (ADC_ISR) End of Conversion 2 (automatically set / cleared) */ +#define ADC_ISR_EOC3 (0x1u << 3) /**< \brief (ADC_ISR) End of Conversion 3 (automatically set / cleared) */ +#define ADC_ISR_EOC4 (0x1u << 4) /**< \brief (ADC_ISR) End of Conversion 4 (automatically set / cleared) */ +#define ADC_ISR_EOC5 (0x1u << 5) /**< \brief (ADC_ISR) End of Conversion 5 (automatically set / cleared) */ +#define ADC_ISR_EOC6 (0x1u << 6) /**< \brief (ADC_ISR) End of Conversion 6 (automatically set / cleared) */ +#define ADC_ISR_EOC7 (0x1u << 7) /**< \brief (ADC_ISR) End of Conversion 7 (automatically set / cleared) */ +#define ADC_ISR_EOC8 (0x1u << 8) /**< \brief (ADC_ISR) End of Conversion 8 (automatically set / cleared) */ +#define ADC_ISR_EOC9 (0x1u << 9) /**< \brief (ADC_ISR) End of Conversion 9 (automatically set / cleared) */ +#define ADC_ISR_EOC10 (0x1u << 10) /**< \brief (ADC_ISR) End of Conversion 10 (automatically set / cleared) */ +#define ADC_ISR_EOC11 (0x1u << 11) /**< \brief (ADC_ISR) End of Conversion 11 (automatically set / cleared) */ +#define ADC_ISR_VALUE_ (0x1u << 12) /**< \brief (ADC_ISR) */ +#define ADC_ISR_LCCHG (0x1u << 19) /**< \brief (ADC_ISR) Last Channel Change (cleared on read) */ +#define ADC_ISR_XRDY (0x1u << 20) /**< \brief (ADC_ISR) Touchscreen XPOS Measure Ready (cleared on read) */ +#define ADC_ISR_YRDY (0x1u << 21) /**< \brief (ADC_ISR) Touchscreen YPOS Measure Ready (cleared on read) */ +#define ADC_ISR_PRDY (0x1u << 22) /**< \brief (ADC_ISR) Touchscreen Pressure Measure Ready (cleared on read) */ +#define ADC_ISR_DRDY (0x1u << 24) /**< \brief (ADC_ISR) Data Ready (automatically set / cleared) */ +#define ADC_ISR_GOVRE (0x1u << 25) /**< \brief (ADC_ISR) General Overrun Error (cleared on read) */ +#define ADC_ISR_COMPE (0x1u << 26) /**< \brief (ADC_ISR) Comparison Event (cleared on read) */ +#define ADC_ISR_PEN (0x1u << 29) /**< \brief (ADC_ISR) Pen contact (cleared on read) */ +#define ADC_ISR_NOPEN (0x1u << 30) /**< \brief (ADC_ISR) No Pen Contact (cleared on read) */ +#define ADC_ISR_PENS (0x1u << 31) /**< \brief (ADC_ISR) Pen Detect Status */ +/* -------- ADC_LCTMR : (ADC Offset: 0x34) Last Channel Trigger Mode Register -------- */ +#define ADC_LCTMR_DUALTRIG (0x1u << 0) /**< \brief (ADC_LCTMR) Dual Trigger ON */ +#define ADC_LCTMR_CMPMOD_Pos 4 +#define ADC_LCTMR_CMPMOD_Msk (0x3u << ADC_LCTMR_CMPMOD_Pos) /**< \brief (ADC_LCTMR) Last Channel Comparison Mode */ +#define ADC_LCTMR_CMPMOD(value) ((ADC_LCTMR_CMPMOD_Msk & ((value) << ADC_LCTMR_CMPMOD_Pos))) +#define ADC_LCTMR_CMPMOD_LOW (0x0u << 4) /**< \brief (ADC_LCTMR) Generates an event when the converted data is lower than the low threshold of the window. */ +#define ADC_LCTMR_CMPMOD_HIGH (0x1u << 4) /**< \brief (ADC_LCTMR) Generates an event when the converted data is higher than the high threshold of the window. */ +#define ADC_LCTMR_CMPMOD_IN (0x2u << 4) /**< \brief (ADC_LCTMR) Generates an event when the converted data is in the comparison window. */ +#define ADC_LCTMR_CMPMOD_OUT (0x3u << 4) /**< \brief (ADC_LCTMR) Generates an event when the converted data is out of the comparison window. */ +/* -------- ADC_LCCWR : (ADC Offset: 0x38) Last Channel Compare Window Register -------- */ +#define ADC_LCCWR_LOWTHRES_Pos 0 +#define ADC_LCCWR_LOWTHRES_Msk (0xfffu << ADC_LCCWR_LOWTHRES_Pos) /**< \brief (ADC_LCCWR) Low Threshold */ +#define ADC_LCCWR_LOWTHRES(value) ((ADC_LCCWR_LOWTHRES_Msk & ((value) << ADC_LCCWR_LOWTHRES_Pos))) +#define ADC_LCCWR_HIGHTHRES_Pos 16 +#define ADC_LCCWR_HIGHTHRES_Msk (0xfffu << ADC_LCCWR_HIGHTHRES_Pos) /**< \brief (ADC_LCCWR) High Threshold */ +#define ADC_LCCWR_HIGHTHRES(value) ((ADC_LCCWR_HIGHTHRES_Msk & ((value) << ADC_LCCWR_HIGHTHRES_Pos))) +/* -------- ADC_OVER : (ADC Offset: 0x3C) Overrun Status Register -------- */ +#define ADC_OVER_OVRE0 (0x1u << 0) /**< \brief (ADC_OVER) Overrun Error 0 */ +#define ADC_OVER_OVRE1 (0x1u << 1) /**< \brief (ADC_OVER) Overrun Error 1 */ +#define ADC_OVER_OVRE2 (0x1u << 2) /**< \brief (ADC_OVER) Overrun Error 2 */ +#define ADC_OVER_OVRE3 (0x1u << 3) /**< \brief (ADC_OVER) Overrun Error 3 */ +#define ADC_OVER_OVRE4 (0x1u << 4) /**< \brief (ADC_OVER) Overrun Error 4 */ +#define ADC_OVER_OVRE5 (0x1u << 5) /**< \brief (ADC_OVER) Overrun Error 5 */ +#define ADC_OVER_OVRE6 (0x1u << 6) /**< \brief (ADC_OVER) Overrun Error 6 */ +#define ADC_OVER_OVRE7 (0x1u << 7) /**< \brief (ADC_OVER) Overrun Error 7 */ +#define ADC_OVER_OVRE8 (0x1u << 8) /**< \brief (ADC_OVER) Overrun Error 8 */ +#define ADC_OVER_OVRE9 (0x1u << 9) /**< \brief (ADC_OVER) Overrun Error 9 */ +#define ADC_OVER_OVRE10 (0x1u << 10) /**< \brief (ADC_OVER) Overrun Error 10 */ +#define ADC_OVER_OVRE11 (0x1u << 11) /**< \brief (ADC_OVER) Overrun Error 11 */ +/* -------- ADC_EMR : (ADC Offset: 0x40) Extended Mode Register -------- */ +#define ADC_EMR_CMPMODE_Pos 0 +#define ADC_EMR_CMPMODE_Msk (0x3u << ADC_EMR_CMPMODE_Pos) /**< \brief (ADC_EMR) Comparison Mode */ +#define ADC_EMR_CMPMODE(value) ((ADC_EMR_CMPMODE_Msk & ((value) << ADC_EMR_CMPMODE_Pos))) +#define ADC_EMR_CMPMODE_LOW (0x0u << 0) /**< \brief (ADC_EMR) Generates an event when the converted data is lower than the low threshold of the window. */ +#define ADC_EMR_CMPMODE_HIGH (0x1u << 0) /**< \brief (ADC_EMR) Generates an event when the converted data is higher than the high threshold of the window. */ +#define ADC_EMR_CMPMODE_IN (0x2u << 0) /**< \brief (ADC_EMR) Generates an event when the converted data is in the comparison window. */ +#define ADC_EMR_CMPMODE_OUT (0x3u << 0) /**< \brief (ADC_EMR) Generates an event when the converted data is out of the comparison window. */ +#define ADC_EMR_CMPTYPE (0x1u << 2) /**< \brief (ADC_EMR) Comparison Type */ +#define ADC_EMR_CMPTYPE_FLAG_ONLY (0x0u << 2) /**< \brief (ADC_EMR) Any conversion is performed and comparison function drives the COMPE flag. */ +#define ADC_EMR_CMPTYPE_START_CONDITION (0x1u << 2) /**< \brief (ADC_EMR) Comparison conditions must be met to start the storage of all conversions until the CMPRST bit is set. */ +#define ADC_EMR_CMPSEL_Pos 4 +#define ADC_EMR_CMPSEL_Msk (0xfu << ADC_EMR_CMPSEL_Pos) /**< \brief (ADC_EMR) Comparison Selected Channel */ +#define ADC_EMR_CMPSEL(value) ((ADC_EMR_CMPSEL_Msk & ((value) << ADC_EMR_CMPSEL_Pos))) +#define ADC_EMR_CMPALL (0x1u << 9) /**< \brief (ADC_EMR) Compare All Channels */ +#define ADC_EMR_CMPFILTER_Pos 12 +#define ADC_EMR_CMPFILTER_Msk (0x3u << ADC_EMR_CMPFILTER_Pos) /**< \brief (ADC_EMR) Compare Event Filtering */ +#define ADC_EMR_CMPFILTER(value) ((ADC_EMR_CMPFILTER_Msk & ((value) << ADC_EMR_CMPFILTER_Pos))) +#define ADC_EMR_SRCCLK (0x1u << 21) /**< \brief (ADC_EMR) External Clock Selection */ +#define ADC_EMR_SRCCLK_PERIPH_CLK (0x0u << 21) /**< \brief (ADC_EMR) The peripheral clock is the source for the ADC prescaler. */ +#define ADC_EMR_SRCCLK_PMC_PCK (0x1u << 21) /**< \brief (ADC_EMR) PMC PCKx is the source clock for the ADC prescaler, thus the ADC clock can be independent of the core/peripheral clock. */ +#define ADC_EMR_TAG (0x1u << 24) /**< \brief (ADC_EMR) Tag of the ADC_LCDR */ +#define ADC_EMR_ADCMODE_Pos 28 +#define ADC_EMR_ADCMODE_Msk (0x3u << ADC_EMR_ADCMODE_Pos) /**< \brief (ADC_EMR) ADC Running Mode */ +#define ADC_EMR_ADCMODE(value) ((ADC_EMR_ADCMODE_Msk & ((value) << ADC_EMR_ADCMODE_Pos))) +#define ADC_EMR_ADCMODE_NORMAL (0x0u << 28) /**< \brief (ADC_EMR) Normal mode of operation. */ +#define ADC_EMR_ADCMODE_OFFSET_ERROR (0x1u << 28) /**< \brief (ADC_EMR) Offset Error mode to measure the offset error. See Table 1-8. */ +#define ADC_EMR_ADCMODE_GAIN_ERROR_HIGH (0x2u << 28) /**< \brief (ADC_EMR) Gain Error mode to measure the gain error. See Table 1-8. */ +#define ADC_EMR_ADCMODE_GAIN_ERROR_LOW (0x3u << 28) /**< \brief (ADC_EMR) Gain Error mode to measure the gain error. See Table 1-8. */ +/* -------- ADC_CWR : (ADC Offset: 0x44) Compare Window Register -------- */ +#define ADC_CWR_LOWTHRES_Pos 0 +#define ADC_CWR_LOWTHRES_Msk (0xfffu << ADC_CWR_LOWTHRES_Pos) /**< \brief (ADC_CWR) Low Threshold */ +#define ADC_CWR_LOWTHRES(value) ((ADC_CWR_LOWTHRES_Msk & ((value) << ADC_CWR_LOWTHRES_Pos))) +#define ADC_CWR_HIGHTHRES_Pos 16 +#define ADC_CWR_HIGHTHRES_Msk (0xfffu << ADC_CWR_HIGHTHRES_Pos) /**< \brief (ADC_CWR) High Threshold */ +#define ADC_CWR_HIGHTHRES(value) ((ADC_CWR_HIGHTHRES_Msk & ((value) << ADC_CWR_HIGHTHRES_Pos))) +/* -------- ADC_CGR : (ADC Offset: 0x48) Channel Gain Register -------- */ +#define ADC_CGR_GAIN0_Pos 0 +#define ADC_CGR_GAIN0_Msk (0x3u << ADC_CGR_GAIN0_Pos) /**< \brief (ADC_CGR) Gain for Channel 0 */ +#define ADC_CGR_GAIN0(value) ((ADC_CGR_GAIN0_Msk & ((value) << ADC_CGR_GAIN0_Pos))) +#define ADC_CGR_GAIN0_SE1_DIFF0_5 (0x0u << 0) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN0_SE1_DIFF1 (0x1u << 0) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN0_SE2_DIFF2 (0x2u << 0) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN0_SE4_DIFF2 (0x3u << 0) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN1_Pos 2 +#define ADC_CGR_GAIN1_Msk (0x3u << ADC_CGR_GAIN1_Pos) /**< \brief (ADC_CGR) Gain for Channel 1 */ +#define ADC_CGR_GAIN1(value) ((ADC_CGR_GAIN1_Msk & ((value) << ADC_CGR_GAIN1_Pos))) +#define ADC_CGR_GAIN1_SE1_DIFF0_5 (0x0u << 2) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN1_SE1_DIFF1 (0x1u << 2) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN1_SE2_DIFF2 (0x2u << 2) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN1_SE4_DIFF2 (0x3u << 2) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN2_Pos 4 +#define ADC_CGR_GAIN2_Msk (0x3u << ADC_CGR_GAIN2_Pos) /**< \brief (ADC_CGR) Gain for Channel 2 */ +#define ADC_CGR_GAIN2(value) ((ADC_CGR_GAIN2_Msk & ((value) << ADC_CGR_GAIN2_Pos))) +#define ADC_CGR_GAIN2_SE1_DIFF0_5 (0x0u << 4) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN2_SE1_DIFF1 (0x1u << 4) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN2_SE2_DIFF2 (0x2u << 4) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN2_SE4_DIFF2 (0x3u << 4) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN3_Pos 6 +#define ADC_CGR_GAIN3_Msk (0x3u << ADC_CGR_GAIN3_Pos) /**< \brief (ADC_CGR) Gain for Channel 3 */ +#define ADC_CGR_GAIN3(value) ((ADC_CGR_GAIN3_Msk & ((value) << ADC_CGR_GAIN3_Pos))) +#define ADC_CGR_GAIN3_SE1_DIFF0_5 (0x0u << 6) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN3_SE1_DIFF1 (0x1u << 6) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN3_SE2_DIFF2 (0x2u << 6) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN3_SE4_DIFF2 (0x3u << 6) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN4_Pos 8 +#define ADC_CGR_GAIN4_Msk (0x3u << ADC_CGR_GAIN4_Pos) /**< \brief (ADC_CGR) Gain for Channel 4 */ +#define ADC_CGR_GAIN4(value) ((ADC_CGR_GAIN4_Msk & ((value) << ADC_CGR_GAIN4_Pos))) +#define ADC_CGR_GAIN4_SE1_DIFF0_5 (0x0u << 8) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN4_SE1_DIFF1 (0x1u << 8) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN4_SE2_DIFF2 (0x2u << 8) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN4_SE4_DIFF2 (0x3u << 8) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN5_Pos 10 +#define ADC_CGR_GAIN5_Msk (0x3u << ADC_CGR_GAIN5_Pos) /**< \brief (ADC_CGR) Gain for Channel 5 */ +#define ADC_CGR_GAIN5(value) ((ADC_CGR_GAIN5_Msk & ((value) << ADC_CGR_GAIN5_Pos))) +#define ADC_CGR_GAIN5_SE1_DIFF0_5 (0x0u << 10) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN5_SE1_DIFF1 (0x1u << 10) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN5_SE2_DIFF2 (0x2u << 10) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN5_SE4_DIFF2 (0x3u << 10) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN6_Pos 12 +#define ADC_CGR_GAIN6_Msk (0x3u << ADC_CGR_GAIN6_Pos) /**< \brief (ADC_CGR) Gain for Channel 6 */ +#define ADC_CGR_GAIN6(value) ((ADC_CGR_GAIN6_Msk & ((value) << ADC_CGR_GAIN6_Pos))) +#define ADC_CGR_GAIN6_SE1_DIFF0_5 (0x0u << 12) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN6_SE1_DIFF1 (0x1u << 12) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN6_SE2_DIFF2 (0x2u << 12) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN6_SE4_DIFF2 (0x3u << 12) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN7_Pos 14 +#define ADC_CGR_GAIN7_Msk (0x3u << ADC_CGR_GAIN7_Pos) /**< \brief (ADC_CGR) Gain for Channel 7 */ +#define ADC_CGR_GAIN7(value) ((ADC_CGR_GAIN7_Msk & ((value) << ADC_CGR_GAIN7_Pos))) +#define ADC_CGR_GAIN7_SE1_DIFF0_5 (0x0u << 14) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN7_SE1_DIFF1 (0x1u << 14) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN7_SE2_DIFF2 (0x2u << 14) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN7_SE4_DIFF2 (0x3u << 14) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN8_Pos 16 +#define ADC_CGR_GAIN8_Msk (0x3u << ADC_CGR_GAIN8_Pos) /**< \brief (ADC_CGR) Gain for Channel 8 */ +#define ADC_CGR_GAIN8(value) ((ADC_CGR_GAIN8_Msk & ((value) << ADC_CGR_GAIN8_Pos))) +#define ADC_CGR_GAIN8_SE1_DIFF0_5 (0x0u << 16) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN8_SE1_DIFF1 (0x1u << 16) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN8_SE2_DIFF2 (0x2u << 16) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN8_SE4_DIFF2 (0x3u << 16) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN9_Pos 18 +#define ADC_CGR_GAIN9_Msk (0x3u << ADC_CGR_GAIN9_Pos) /**< \brief (ADC_CGR) Gain for Channel 9 */ +#define ADC_CGR_GAIN9(value) ((ADC_CGR_GAIN9_Msk & ((value) << ADC_CGR_GAIN9_Pos))) +#define ADC_CGR_GAIN9_SE1_DIFF0_5 (0x0u << 18) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN9_SE1_DIFF1 (0x1u << 18) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN9_SE2_DIFF2 (0x2u << 18) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN9_SE4_DIFF2 (0x3u << 18) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN10_Pos 20 +#define ADC_CGR_GAIN10_Msk (0x3u << ADC_CGR_GAIN10_Pos) /**< \brief (ADC_CGR) Gain for Channel 10 */ +#define ADC_CGR_GAIN10(value) ((ADC_CGR_GAIN10_Msk & ((value) << ADC_CGR_GAIN10_Pos))) +#define ADC_CGR_GAIN10_SE1_DIFF0_5 (0x0u << 20) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN10_SE1_DIFF1 (0x1u << 20) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN10_SE2_DIFF2 (0x2u << 20) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN10_SE4_DIFF2 (0x3u << 20) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN11_Pos 22 +#define ADC_CGR_GAIN11_Msk (0x3u << ADC_CGR_GAIN11_Pos) /**< \brief (ADC_CGR) Gain for Channel 11 */ +#define ADC_CGR_GAIN11(value) ((ADC_CGR_GAIN11_Msk & ((value) << ADC_CGR_GAIN11_Pos))) +#define ADC_CGR_GAIN11_SE1_DIFF0_5 (0x0u << 22) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 0.5 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN11_SE1_DIFF1 (0x1u << 22) /**< \brief (ADC_CGR) Single-ended gain = 1 (ADC_COR.DIFFx = 0), differential gain = 1 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN11_SE2_DIFF2 (0x2u << 22) /**< \brief (ADC_CGR) Single-ended gain = 2 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +#define ADC_CGR_GAIN11_SE4_DIFF2 (0x3u << 22) /**< \brief (ADC_CGR) Single-ended gain = 4 (ADC_COR.DIFFx = 0), differential gain = 2 (ADC_COR.DIFFx = 1) */ +/* -------- ADC_COR : (ADC Offset: 0x4C) Channel Offset Register -------- */ +#define ADC_COR_OFF0 (0x1u << 0) /**< \brief (ADC_COR) Offset for Channel 0 */ +#define ADC_COR_OFF1 (0x1u << 1) /**< \brief (ADC_COR) Offset for Channel 1 */ +#define ADC_COR_OFF2 (0x1u << 2) /**< \brief (ADC_COR) Offset for Channel 2 */ +#define ADC_COR_OFF3 (0x1u << 3) /**< \brief (ADC_COR) Offset for Channel 3 */ +#define ADC_COR_OFF4 (0x1u << 4) /**< \brief (ADC_COR) Offset for Channel 4 */ +#define ADC_COR_OFF5 (0x1u << 5) /**< \brief (ADC_COR) Offset for Channel 5 */ +#define ADC_COR_OFF6 (0x1u << 6) /**< \brief (ADC_COR) Offset for Channel 6 */ +#define ADC_COR_OFF7 (0x1u << 7) /**< \brief (ADC_COR) Offset for Channel 7 */ +#define ADC_COR_OFF8 (0x1u << 8) /**< \brief (ADC_COR) Offset for Channel 8 */ +#define ADC_COR_OFF9 (0x1u << 9) /**< \brief (ADC_COR) Offset for Channel 9 */ +#define ADC_COR_OFF10 (0x1u << 10) /**< \brief (ADC_COR) Offset for Channel 10 */ +#define ADC_COR_OFF11 (0x1u << 11) /**< \brief (ADC_COR) Offset for Channel 11 */ +#define ADC_COR_DIFF0 (0x1u << 16) /**< \brief (ADC_COR) Differential Inputs for Channel 0 */ +#define ADC_COR_DIFF1 (0x1u << 17) /**< \brief (ADC_COR) Differential Inputs for Channel 1 */ +#define ADC_COR_DIFF2 (0x1u << 18) /**< \brief (ADC_COR) Differential Inputs for Channel 2 */ +#define ADC_COR_DIFF3 (0x1u << 19) /**< \brief (ADC_COR) Differential Inputs for Channel 3 */ +#define ADC_COR_DIFF4 (0x1u << 20) /**< \brief (ADC_COR) Differential Inputs for Channel 4 */ +#define ADC_COR_DIFF5 (0x1u << 21) /**< \brief (ADC_COR) Differential Inputs for Channel 5 */ +#define ADC_COR_DIFF6 (0x1u << 22) /**< \brief (ADC_COR) Differential Inputs for Channel 6 */ +#define ADC_COR_DIFF7 (0x1u << 23) /**< \brief (ADC_COR) Differential Inputs for Channel 7 */ +#define ADC_COR_DIFF8 (0x1u << 24) /**< \brief (ADC_COR) Differential Inputs for Channel 8 */ +#define ADC_COR_DIFF9 (0x1u << 25) /**< \brief (ADC_COR) Differential Inputs for Channel 9 */ +#define ADC_COR_DIFF10 (0x1u << 26) /**< \brief (ADC_COR) Differential Inputs for Channel 10 */ +#define ADC_COR_DIFF11 (0x1u << 27) /**< \brief (ADC_COR) Differential Inputs for Channel 11 */ +/* -------- ADC_CDR0 : (ADC Offset: 0x50) Channel Data Register 0 -------- */ +#define ADC_CDR0_DATA_Pos 0 +#define ADC_CDR0_DATA_Msk (0xfffu << ADC_CDR0_DATA_Pos) /**< \brief (ADC_CDR0) Converted Data */ +/* -------- ADC_CDR1 : (ADC Offset: 0x54) Channel Data Register 1 -------- */ +#define ADC_CDR1_DATA_Pos 0 +#define ADC_CDR1_DATA_Msk (0xfffu << ADC_CDR1_DATA_Pos) /**< \brief (ADC_CDR1) Converted Data */ +/* -------- ADC_CDR2 : (ADC Offset: 0x58) Channel Data Register 2 -------- */ +#define ADC_CDR2_DATA_Pos 0 +#define ADC_CDR2_DATA_Msk (0xfffu << ADC_CDR2_DATA_Pos) /**< \brief (ADC_CDR2) Converted Data */ +/* -------- ADC_CDR3 : (ADC Offset: 0x5C) Channel Data Register 3 -------- */ +#define ADC_CDR3_DATA_Pos 0 +#define ADC_CDR3_DATA_Msk (0xfffu << ADC_CDR3_DATA_Pos) /**< \brief (ADC_CDR3) Converted Data */ +/* -------- ADC_CDR4 : (ADC Offset: 0x60) Channel Data Register 4 -------- */ +#define ADC_CDR4_DATA_Pos 0 +#define ADC_CDR4_DATA_Msk (0xfffu << ADC_CDR4_DATA_Pos) /**< \brief (ADC_CDR4) Converted Data */ +/* -------- ADC_CDR5 : (ADC Offset: 0x64) Channel Data Register 5 -------- */ +#define ADC_CDR5_DATA_Pos 0 +#define ADC_CDR5_DATA_Msk (0xfffu << ADC_CDR5_DATA_Pos) /**< \brief (ADC_CDR5) Converted Data */ +/* -------- ADC_CDR6 : (ADC Offset: 0x68) Channel Data Register 6 -------- */ +#define ADC_CDR6_DATA_Pos 0 +#define ADC_CDR6_DATA_Msk (0xfffu << ADC_CDR6_DATA_Pos) /**< \brief (ADC_CDR6) Converted Data */ +/* -------- ADC_CDR7 : (ADC Offset: 0x6C) Channel Data Register 7 -------- */ +#define ADC_CDR7_DATA_Pos 0 +#define ADC_CDR7_DATA_Msk (0xfffu << ADC_CDR7_DATA_Pos) /**< \brief (ADC_CDR7) Converted Data */ +/* -------- ADC_CDR8 : (ADC Offset: 0x70) Channel Data Register 8 -------- */ +#define ADC_CDR8_DATA_Pos 0 +#define ADC_CDR8_DATA_Msk (0xfffu << ADC_CDR8_DATA_Pos) /**< \brief (ADC_CDR8) Converted Data */ +/* -------- ADC_CDR9 : (ADC Offset: 0x74) Channel Data Register 9 -------- */ +#define ADC_CDR9_DATA_Pos 0 +#define ADC_CDR9_DATA_Msk (0xfffu << ADC_CDR9_DATA_Pos) /**< \brief (ADC_CDR9) Converted Data */ +/* -------- ADC_CDR10 : (ADC Offset: 0x78) Channel Data Register 10 -------- */ +#define ADC_CDR10_DATA_Pos 0 +#define ADC_CDR10_DATA_Msk (0xfffu << ADC_CDR10_DATA_Pos) /**< \brief (ADC_CDR10) Converted Data */ +/* -------- ADC_CDR11 : (ADC Offset: 0x7C) Channel Data Register 11 -------- */ +#define ADC_CDR11_DATA_Pos 0 +#define ADC_CDR11_DATA_Msk (0xfffu << ADC_CDR11_DATA_Pos) /**< \brief (ADC_CDR11) Converted Data */ +/* -------- ADC_ACR : (ADC Offset: 0x94) Analog Control Register -------- */ +#define ADC_ACR_PENDETSENS_Pos 0 +#define ADC_ACR_PENDETSENS_Msk (0x3u << ADC_ACR_PENDETSENS_Pos) /**< \brief (ADC_ACR) Pen Detection Sensitivity */ +#define ADC_ACR_PENDETSENS(value) ((ADC_ACR_PENDETSENS_Msk & ((value) << ADC_ACR_PENDETSENS_Pos))) +/* -------- ADC_TSMR : (ADC Offset: 0xB0) Touchscreen Mode Register -------- */ +#define ADC_TSMR_TSMODE_Pos 0 +#define ADC_TSMR_TSMODE_Msk (0x3u << ADC_TSMR_TSMODE_Pos) /**< \brief (ADC_TSMR) Touchscreen Mode */ +#define ADC_TSMR_TSMODE(value) ((ADC_TSMR_TSMODE_Msk & ((value) << ADC_TSMR_TSMODE_Pos))) +#define ADC_TSMR_TSMODE_NONE (0x0u << 0) /**< \brief (ADC_TSMR) No Touchscreen */ +#define ADC_TSMR_TSMODE_4_WIRE_NO_PM (0x1u << 0) /**< \brief (ADC_TSMR) 4-wire Touchscreen without pressure measurement */ +#define ADC_TSMR_TSMODE_4_WIRE (0x2u << 0) /**< \brief (ADC_TSMR) 4-wire Touchscreen with pressure measurement */ +#define ADC_TSMR_TSMODE_5_WIRE (0x3u << 0) /**< \brief (ADC_TSMR) 5-wire Touchscreen */ +#define ADC_TSMR_TSAV_Pos 4 +#define ADC_TSMR_TSAV_Msk (0x3u << ADC_TSMR_TSAV_Pos) /**< \brief (ADC_TSMR) Touchscreen Average */ +#define ADC_TSMR_TSAV(value) ((ADC_TSMR_TSAV_Msk & ((value) << ADC_TSMR_TSAV_Pos))) +#define ADC_TSMR_TSAV_NO_FILTER (0x0u << 4) /**< \brief (ADC_TSMR) No Filtering. Only one ADC conversion per measure */ +#define ADC_TSMR_TSAV_AVG2CONV (0x1u << 4) /**< \brief (ADC_TSMR) Averages 2 ADC conversions */ +#define ADC_TSMR_TSAV_AVG4CONV (0x2u << 4) /**< \brief (ADC_TSMR) Averages 4 ADC conversions */ +#define ADC_TSMR_TSAV_AVG8CONV (0x3u << 4) /**< \brief (ADC_TSMR) Averages 8 ADC conversions */ +#define ADC_TSMR_TSFREQ_Pos 8 +#define ADC_TSMR_TSFREQ_Msk (0xfu << ADC_TSMR_TSFREQ_Pos) /**< \brief (ADC_TSMR) Touchscreen Frequency */ +#define ADC_TSMR_TSFREQ(value) ((ADC_TSMR_TSFREQ_Msk & ((value) << ADC_TSMR_TSFREQ_Pos))) +#define ADC_TSMR_TSSCTIM_Pos 16 +#define ADC_TSMR_TSSCTIM_Msk (0xfu << ADC_TSMR_TSSCTIM_Pos) /**< \brief (ADC_TSMR) Touchscreen Switches Closure Time */ +#define ADC_TSMR_TSSCTIM(value) ((ADC_TSMR_TSSCTIM_Msk & ((value) << ADC_TSMR_TSSCTIM_Pos))) +#define ADC_TSMR_NOTSDMA (0x1u << 22) /**< \brief (ADC_TSMR) No TouchScreen DMA */ +#define ADC_TSMR_PENDET (0x1u << 24) /**< \brief (ADC_TSMR) Pen Contact Detection Enable */ +#define ADC_TSMR_PENDBC_Pos 28 +#define ADC_TSMR_PENDBC_Msk (0xfu << ADC_TSMR_PENDBC_Pos) /**< \brief (ADC_TSMR) Pen Detect Debouncing Period */ +#define ADC_TSMR_PENDBC(value) ((ADC_TSMR_PENDBC_Msk & ((value) << ADC_TSMR_PENDBC_Pos))) +/* -------- ADC_XPOSR : (ADC Offset: 0xB4) Touchscreen X Position Register -------- */ +#define ADC_XPOSR_XPOS_Pos 0 +#define ADC_XPOSR_XPOS_Msk (0xfffu << ADC_XPOSR_XPOS_Pos) /**< \brief (ADC_XPOSR) X Position */ +#define ADC_XPOSR_XSCALE_Pos 16 +#define ADC_XPOSR_XSCALE_Msk (0xfffu << ADC_XPOSR_XSCALE_Pos) /**< \brief (ADC_XPOSR) Scale of XPOS */ +/* -------- ADC_YPOSR : (ADC Offset: 0xB8) Touchscreen Y Position Register -------- */ +#define ADC_YPOSR_YPOS_Pos 0 +#define ADC_YPOSR_YPOS_Msk (0xfffu << ADC_YPOSR_YPOS_Pos) /**< \brief (ADC_YPOSR) Y Position */ +#define ADC_YPOSR_YSCALE_Pos 16 +#define ADC_YPOSR_YSCALE_Msk (0xfffu << ADC_YPOSR_YSCALE_Pos) /**< \brief (ADC_YPOSR) Scale of YPOS */ +/* -------- ADC_PRESSR : (ADC Offset: 0xBC) Touchscreen Pressure Register -------- */ +#define ADC_PRESSR_Z1_Pos 0 +#define ADC_PRESSR_Z1_Msk (0xfffu << ADC_PRESSR_Z1_Pos) /**< \brief (ADC_PRESSR) Data of Z1 Measurement */ +#define ADC_PRESSR_Z2_Pos 16 +#define ADC_PRESSR_Z2_Msk (0xfffu << ADC_PRESSR_Z2_Pos) /**< \brief (ADC_PRESSR) Data of Z2 Measurement */ +/* -------- ADC_TRGR : (ADC Offset: 0xC0) Trigger Register -------- */ +#define ADC_TRGR_TRGMOD_Pos 0 +#define ADC_TRGR_TRGMOD_Msk (0x7u << ADC_TRGR_TRGMOD_Pos) /**< \brief (ADC_TRGR) Trigger Mode */ +#define ADC_TRGR_TRGMOD(value) ((ADC_TRGR_TRGMOD_Msk & ((value) << ADC_TRGR_TRGMOD_Pos))) +#define ADC_TRGR_TRGMOD_NO_TRIGGER (0x0u << 0) /**< \brief (ADC_TRGR) No trigger, only software trigger can start conversions */ +#define ADC_TRGR_TRGMOD_EXT_TRIG_RISE (0x1u << 0) /**< \brief (ADC_TRGR) External trigger rising edge */ +#define ADC_TRGR_TRGMOD_EXT_TRIG_FALL (0x2u << 0) /**< \brief (ADC_TRGR) External trigger falling edge */ +#define ADC_TRGR_TRGMOD_EXT_TRIG_ANY (0x3u << 0) /**< \brief (ADC_TRGR) External trigger any edge */ +#define ADC_TRGR_TRGMOD_PEN_TRIG (0x4u << 0) /**< \brief (ADC_TRGR) Pen Detect Trigger (shall be selected only if PENDET is set and TSAMOD = Touchscreen only mode) */ +#define ADC_TRGR_TRGMOD_PERIOD_TRIG (0x5u << 0) /**< \brief (ADC_TRGR) ADC internal periodic trigger (see field TRGPER) */ +#define ADC_TRGR_TRGMOD_CONTINUOUS (0x6u << 0) /**< \brief (ADC_TRGR) Continuous Mode */ +#define ADC_TRGR_TRGPER_Pos 16 +#define ADC_TRGR_TRGPER_Msk (0xffffu << ADC_TRGR_TRGPER_Pos) /**< \brief (ADC_TRGR) Trigger Period */ +#define ADC_TRGR_TRGPER(value) ((ADC_TRGR_TRGPER_Msk & ((value) << ADC_TRGR_TRGPER_Pos))) +/* -------- ADC_COSR : (ADC Offset: 0xD0) Correction Select Register -------- */ +#define ADC_COSR_CSEL_Pos 0 +#define ADC_COSR_CSEL_Msk (0x1fu << ADC_COSR_CSEL_Pos) /**< \brief (ADC_COSR) CORRECTION_TYPE Correction Select */ +#define ADC_COSR_CSEL(value) ((ADC_COSR_CSEL_Msk & ((value) << ADC_COSR_CSEL_Pos))) +/* -------- ADC_CVR : (ADC Offset: 0xD4) Correction Values Register -------- */ +#define ADC_CVR_OFFSETCORR_Pos 0 +#define ADC_CVR_OFFSETCORR_Msk (0xffffu << ADC_CVR_OFFSETCORR_Pos) /**< \brief (ADC_CVR) Offset Correction */ +#define ADC_CVR_OFFSETCORR(value) ((ADC_CVR_OFFSETCORR_Msk & ((value) << ADC_CVR_OFFSETCORR_Pos))) +#define ADC_CVR_GAINCORR_Pos 16 +#define ADC_CVR_GAINCORR_Msk (0xffffu << ADC_CVR_GAINCORR_Pos) /**< \brief (ADC_CVR) Gain Correction */ +#define ADC_CVR_GAINCORR(value) ((ADC_CVR_GAINCORR_Msk & ((value) << ADC_CVR_GAINCORR_Pos))) +/* -------- ADC_CECR : (ADC Offset: 0xD8) Channel Error Correction Register -------- */ +#define ADC_CECR_ECORR0 (0x1u << 0) /**< \brief (ADC_CECR) Error Correction Enable for channel 0 */ +#define ADC_CECR_ECORR1 (0x1u << 1) /**< \brief (ADC_CECR) Error Correction Enable for channel 1 */ +#define ADC_CECR_ECORR2 (0x1u << 2) /**< \brief (ADC_CECR) Error Correction Enable for channel 2 */ +#define ADC_CECR_ECORR3 (0x1u << 3) /**< \brief (ADC_CECR) Error Correction Enable for channel 3 */ +#define ADC_CECR_ECORR4 (0x1u << 4) /**< \brief (ADC_CECR) Error Correction Enable for channel 4 */ +#define ADC_CECR_ECORR5 (0x1u << 5) /**< \brief (ADC_CECR) Error Correction Enable for channel 5 */ +#define ADC_CECR_ECORR6 (0x1u << 6) /**< \brief (ADC_CECR) Error Correction Enable for channel 6 */ +#define ADC_CECR_ECORR7 (0x1u << 7) /**< \brief (ADC_CECR) Error Correction Enable for channel 7 */ +#define ADC_CECR_ECORR8 (0x1u << 8) /**< \brief (ADC_CECR) Error Correction Enable for channel 8 */ +#define ADC_CECR_ECORR9 (0x1u << 9) /**< \brief (ADC_CECR) Error Correction Enable for channel 9 */ +#define ADC_CECR_ECORR10 (0x1u << 10) /**< \brief (ADC_CECR) Error Correction Enable for channel 10 */ +#define ADC_CECR_ECORR11 (0x1u << 11) /**< \brief (ADC_CECR) Error Correction Enable for channel 11 */ +/* -------- ADC_WPMR : (ADC Offset: 0xE4) Write Protection Mode Register -------- */ +#define ADC_WPMR_WPEN (0x1u << 0) /**< \brief (ADC_WPMR) Write Protection Enable */ +#define ADC_WPMR_WPKEY_Pos 8 +#define ADC_WPMR_WPKEY_Msk (0xffffffu << ADC_WPMR_WPKEY_Pos) /**< \brief (ADC_WPMR) Write Protection Key */ +#define ADC_WPMR_WPKEY(value) ((ADC_WPMR_WPKEY_Msk & ((value) << ADC_WPMR_WPKEY_Pos))) +#define ADC_WPMR_WPKEY_PASSWD (0x414443u << 8) /**< \brief (ADC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0 */ +/* -------- ADC_WPSR : (ADC Offset: 0xE8) Write Protection Status Register -------- */ +#define ADC_WPSR_WPVS (0x1u << 0) /**< \brief (ADC_WPSR) Write Protection Violation Status */ +#define ADC_WPSR_WPVSRC_Pos 8 +#define ADC_WPSR_WPVSRC_Msk (0xffffu << ADC_WPSR_WPVSRC_Pos) /**< \brief (ADC_WPSR) Write Protection Violation Source */ +/* -------- ADC_VERSION : (ADC Offset: 0xFC) Version Register -------- */ +#define ADC_VERSION_VERSION_Pos 0 +#define ADC_VERSION_VERSION_Msk (0xfffu << ADC_VERSION_VERSION_Pos) /**< \brief (ADC_VERSION) Version of the Hardware Module */ +#define ADC_VERSION_MFN_Pos 16 +#define ADC_VERSION_MFN_Msk (0x7u << ADC_VERSION_MFN_Pos) /**< \brief (ADC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_ADC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aes.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aes.h new file mode 100644 index 000000000..2ed5099f5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aes.h @@ -0,0 +1,236 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_AES_COMPONENT_ +#define _SAMA5D2_AES_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Advanced Encryption Standard */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_AES Advanced Encryption Standard */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Aes hardware registers */ +typedef struct { + __O uint32_t AES_CR; /**< \brief (Aes Offset: 0x00) Control Register */ + __IO uint32_t AES_MR; /**< \brief (Aes Offset: 0x04) Mode Register */ + __I uint32_t Reserved1[2]; + __O uint32_t AES_IER; /**< \brief (Aes Offset: 0x10) Interrupt Enable Register */ + __O uint32_t AES_IDR; /**< \brief (Aes Offset: 0x14) Interrupt Disable Register */ + __I uint32_t AES_IMR; /**< \brief (Aes Offset: 0x18) Interrupt Mask Register */ + __I uint32_t AES_ISR; /**< \brief (Aes Offset: 0x1C) Interrupt Status Register */ + __O uint32_t AES_KEYWR[8]; /**< \brief (Aes Offset: 0x20) Key Word Register */ + __O uint32_t AES_IDATAR[4]; /**< \brief (Aes Offset: 0x40) Input Data Register */ + __I uint32_t AES_ODATAR[4]; /**< \brief (Aes Offset: 0x50) Output Data Register */ + __O uint32_t AES_IVR[4]; /**< \brief (Aes Offset: 0x60) Initialization Vector Register */ + __IO uint32_t AES_AADLENR; /**< \brief (Aes Offset: 0x70) Additional Authenticated Data Length Register */ + __IO uint32_t AES_CLENR; /**< \brief (Aes Offset: 0x74) Plaintext/Ciphertext Length Register */ + __IO uint32_t AES_GHASHR[4]; /**< \brief (Aes Offset: 0x78) GCM Intermediate Hash Word Register */ + __I uint32_t AES_TAGR[4]; /**< \brief (Aes Offset: 0x88) GCM Authentication Tag Word Register */ + __I uint32_t AES_CTRR; /**< \brief (Aes Offset: 0x98) GCM Encryption Counter Value Register */ + __IO uint32_t AES_GCMHR[4]; /**< \brief (Aes Offset: 0x9C) GCM H Word Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t AES_EMR; /**< \brief (Aes Offset: 0xB0) Extended Mode Register */ + __IO uint32_t AES_BCNT; /**< \brief (Aes Offset: 0xB4) Byte Counter Register */ + __I uint32_t Reserved3[2]; + __IO uint32_t AES_TWR[4]; /**< \brief (Aes Offset: 0xC0) Tweak Word Register */ + __O uint32_t AES_ALPHAR[4]; /**< \brief (Aes Offset: 0xD0) Alpha Word Register */ + __I uint32_t Reserved4[7]; + __I uint32_t AES_VERSION; /**< \brief (Aes Offset: 0xFC) Version Register */ +} Aes; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- AES_CR : (AES Offset: 0x00) Control Register -------- */ +#define AES_CR_START (0x1u << 0) /**< \brief (AES_CR) Start Processing */ +#define AES_CR_SWRST (0x1u << 8) /**< \brief (AES_CR) Software Reset */ +#define AES_CR_LOADSEED (0x1u << 16) /**< \brief (AES_CR) Random Number Generator Seed Loading */ +/* -------- AES_MR : (AES Offset: 0x04) Mode Register -------- */ +#define AES_MR_CIPHER (0x1u << 0) /**< \brief (AES_MR) Processing Mode */ +#define AES_MR_GTAGEN (0x1u << 1) /**< \brief (AES_MR) GCM Automatic Tag Generation Enable */ +#define AES_MR_DUALBUFF (0x1u << 3) /**< \brief (AES_MR) Dual Input Buffer */ +#define AES_MR_DUALBUFF_INACTIVE (0x0u << 3) /**< \brief (AES_MR) AES_IDATARx cannot be written during processing of previous block. */ +#define AES_MR_DUALBUFF_ACTIVE (0x1u << 3) /**< \brief (AES_MR) AES_IDATARx can be written during processing of previous block when SMOD = 2. It speeds up the overall runtime of large files. */ +#define AES_MR_PROCDLY_Pos 4 +#define AES_MR_PROCDLY_Msk (0xfu << AES_MR_PROCDLY_Pos) /**< \brief (AES_MR) Processing Delay */ +#define AES_MR_PROCDLY(value) ((AES_MR_PROCDLY_Msk & ((value) << AES_MR_PROCDLY_Pos))) +#define AES_MR_SMOD_Pos 8 +#define AES_MR_SMOD_Msk (0x3u << AES_MR_SMOD_Pos) /**< \brief (AES_MR) Start Mode */ +#define AES_MR_SMOD(value) ((AES_MR_SMOD_Msk & ((value) << AES_MR_SMOD_Pos))) +#define AES_MR_SMOD_MANUAL_START (0x0u << 8) /**< \brief (AES_MR) Manual Mode */ +#define AES_MR_SMOD_AUTO_START (0x1u << 8) /**< \brief (AES_MR) Auto Mode */ +#define AES_MR_SMOD_IDATAR0_START (0x2u << 8) /**< \brief (AES_MR) AES_IDATAR0 access only Auto Mode (DMA) */ +#define AES_MR_KEYSIZE_Pos 10 +#define AES_MR_KEYSIZE_Msk (0x3u << AES_MR_KEYSIZE_Pos) /**< \brief (AES_MR) Key Size */ +#define AES_MR_KEYSIZE(value) ((AES_MR_KEYSIZE_Msk & ((value) << AES_MR_KEYSIZE_Pos))) +#define AES_MR_KEYSIZE_AES128 (0x0u << 10) /**< \brief (AES_MR) AES Key Size is 128 bits */ +#define AES_MR_KEYSIZE_AES192 (0x1u << 10) /**< \brief (AES_MR) AES Key Size is 192 bits */ +#define AES_MR_KEYSIZE_AES256 (0x2u << 10) /**< \brief (AES_MR) AES Key Size is 256 bits */ +#define AES_MR_OPMOD_Pos 12 +#define AES_MR_OPMOD_Msk (0x7u << AES_MR_OPMOD_Pos) /**< \brief (AES_MR) Operation Mode */ +#define AES_MR_OPMOD(value) ((AES_MR_OPMOD_Msk & ((value) << AES_MR_OPMOD_Pos))) +#define AES_MR_OPMOD_ECB (0x0u << 12) /**< \brief (AES_MR) ECB: Electronic Code Book mode */ +#define AES_MR_OPMOD_CBC (0x1u << 12) /**< \brief (AES_MR) CBC: Cipher Block Chaining mode */ +#define AES_MR_OPMOD_OFB (0x2u << 12) /**< \brief (AES_MR) OFB: Output Feedback mode */ +#define AES_MR_OPMOD_CFB (0x3u << 12) /**< \brief (AES_MR) CFB: Cipher Feedback mode */ +#define AES_MR_OPMOD_CTR (0x4u << 12) /**< \brief (AES_MR) CTR: Counter mode (16-bit internal counter) */ +#define AES_MR_OPMOD_GCM (0x5u << 12) /**< \brief (AES_MR) GCM: Galois/Counter mode */ +#define AES_MR_OPMOD_XTS (0x6u << 12) /**< \brief (AES_MR) XTS: XEX-based tweaked-codebook mode */ +#define AES_MR_LOD (0x1u << 15) /**< \brief (AES_MR) Last Output Data Mode */ +#define AES_MR_CFBS_Pos 16 +#define AES_MR_CFBS_Msk (0x7u << AES_MR_CFBS_Pos) /**< \brief (AES_MR) Cipher Feedback Data Size */ +#define AES_MR_CFBS(value) ((AES_MR_CFBS_Msk & ((value) << AES_MR_CFBS_Pos))) +#define AES_MR_CFBS_SIZE_128BIT (0x0u << 16) /**< \brief (AES_MR) 128-bit */ +#define AES_MR_CFBS_SIZE_64BIT (0x1u << 16) /**< \brief (AES_MR) 64-bit */ +#define AES_MR_CFBS_SIZE_32BIT (0x2u << 16) /**< \brief (AES_MR) 32-bit */ +#define AES_MR_CFBS_SIZE_16BIT (0x3u << 16) /**< \brief (AES_MR) 16-bit */ +#define AES_MR_CFBS_SIZE_8BIT (0x4u << 16) /**< \brief (AES_MR) 8-bit */ +#define AES_MR_CKEY_Pos 20 +#define AES_MR_CKEY_Msk (0xfu << AES_MR_CKEY_Pos) /**< \brief (AES_MR) Countermeasure Key */ +#define AES_MR_CKEY(value) ((AES_MR_CKEY_Msk & ((value) << AES_MR_CKEY_Pos))) +#define AES_MR_CKEY_PASSWD (0xEu << 20) /**< \brief (AES_MR) This field must be written with 0xE to allow CMTYPx bit configuration changes. Any other values will abort the write operation in CMTYPx bits.Always reads as 0. */ +#define AES_MR_CMTYP1 (0x1u << 24) /**< \brief (AES_MR) Countermeasure Type 1 */ +#define AES_MR_CMTYP1_NOPROT_EXTKEY (0x0u << 24) /**< \brief (AES_MR) Countermeasure type 1 is disabled. */ +#define AES_MR_CMTYP1_PROT_EXTKEY (0x1u << 24) /**< \brief (AES_MR) Countermeasure type 1 is enabled. */ +#define AES_MR_CMTYP2 (0x1u << 25) /**< \brief (AES_MR) Countermeasure Type 2 */ +#define AES_MR_CMTYP2_NO_PAUSE (0x0u << 25) /**< \brief (AES_MR) Countermeasure type 2 is disabled. */ +#define AES_MR_CMTYP2_PAUSE (0x1u << 25) /**< \brief (AES_MR) Countermeasure type 2 is enabled. */ +#define AES_MR_CMTYP3 (0x1u << 26) /**< \brief (AES_MR) Countermeasure Type 3 */ +#define AES_MR_CMTYP3_NO_DUMMY (0x0u << 26) /**< \brief (AES_MR) Countermeasure type 3 is disabled. */ +#define AES_MR_CMTYP3_DUMMY (0x1u << 26) /**< \brief (AES_MR) Countermeasure type 3 is enabled. */ +#define AES_MR_CMTYP4 (0x1u << 27) /**< \brief (AES_MR) Countermeasure Type 4 */ +#define AES_MR_CMTYP4_NO_RESTART (0x0u << 27) /**< \brief (AES_MR) Countermeasure type 4 is disabled. */ +#define AES_MR_CMTYP4_RESTART (0x1u << 27) /**< \brief (AES_MR) Countermeasure type 4 is enabled. */ +#define AES_MR_CMTYP5 (0x1u << 28) /**< \brief (AES_MR) Countermeasure Type 5 */ +#define AES_MR_CMTYP5_NO_ADDACCESS (0x0u << 28) /**< \brief (AES_MR) Countermeasure type 5 is disabled. */ +#define AES_MR_CMTYP5_ADDACCESS (0x1u << 28) /**< \brief (AES_MR) Countermeasure type 5 is enabled. */ +#define AES_MR_CMTYP6 (0x1u << 29) /**< \brief (AES_MR) Countermeasure Type 6 */ +#define AES_MR_CMTYP6_NO_IDLECURRENT (0x0u << 29) /**< \brief (AES_MR) Countermeasure type 6 is disabled. */ +#define AES_MR_CMTYP6_IDLECURRENT (0x1u << 29) /**< \brief (AES_MR) Countermeasure type 6 is enabled. */ +/* -------- AES_IER : (AES Offset: 0x10) Interrupt Enable Register -------- */ +#define AES_IER_DATRDY (0x1u << 0) /**< \brief (AES_IER) Data Ready Interrupt Enable */ +#define AES_IER_URAD (0x1u << 8) /**< \brief (AES_IER) Unspecified Register Access Detection Interrupt Enable */ +#define AES_IER_TAGRDY (0x1u << 16) /**< \brief (AES_IER) GCM Tag Ready Interrupt Enable */ +#define AES_IER_EOPAD (0x1u << 17) /**< \brief (AES_IER) End of Padding Interrupt Enable */ +#define AES_IER_PLENERR (0x1u << 18) /**< \brief (AES_IER) Padding Length Error Interrupt Enable */ +/* -------- AES_IDR : (AES Offset: 0x14) Interrupt Disable Register -------- */ +#define AES_IDR_DATRDY (0x1u << 0) /**< \brief (AES_IDR) Data Ready Interrupt Disable */ +#define AES_IDR_URAD (0x1u << 8) /**< \brief (AES_IDR) Unspecified Register Access Detection Interrupt Disable */ +#define AES_IDR_TAGRDY (0x1u << 16) /**< \brief (AES_IDR) GCM Tag Ready Interrupt Disable */ +#define AES_IDR_EOPAD (0x1u << 17) /**< \brief (AES_IDR) End of Padding Interrupt Disable */ +#define AES_IDR_PLENERR (0x1u << 18) /**< \brief (AES_IDR) Padding Length Error Interrupt Disable */ +/* -------- AES_IMR : (AES Offset: 0x18) Interrupt Mask Register -------- */ +#define AES_IMR_DATRDY (0x1u << 0) /**< \brief (AES_IMR) Data Ready Interrupt Mask */ +#define AES_IMR_URAD (0x1u << 8) /**< \brief (AES_IMR) Unspecified Register Access Detection Interrupt Mask */ +#define AES_IMR_TAGRDY (0x1u << 16) /**< \brief (AES_IMR) GCM Tag Ready Interrupt Mask */ +#define AES_IMR_EOPAD (0x1u << 17) /**< \brief (AES_IMR) End of Padding Interrupt Mask */ +#define AES_IMR_PLENERR (0x1u << 18) /**< \brief (AES_IMR) Padding Length Error Interrupt Mask */ +/* -------- AES_ISR : (AES Offset: 0x1C) Interrupt Status Register -------- */ +#define AES_ISR_DATRDY (0x1u << 0) /**< \brief (AES_ISR) Data Ready (cleared by setting bit START or bit SWRST in AES_CR or by reading AES_ODATARx) */ +#define AES_ISR_URAD (0x1u << 8) /**< \brief (AES_ISR) Unspecified Register Access Detection Status (cleared by writing SWRST in AES_CR) */ +#define AES_ISR_URAT_Pos 12 +#define AES_ISR_URAT_Msk (0xfu << AES_ISR_URAT_Pos) /**< \brief (AES_ISR) Unspecified Register Access (cleared by writing SWRST in AES_CR) */ +#define AES_ISR_URAT_IDR_WR_PROCESSING (0x0u << 12) /**< \brief (AES_ISR) Input Data Register written during the data processing when SMOD = 0x2 mode. */ +#define AES_ISR_URAT_ODR_RD_PROCESSING (0x1u << 12) /**< \brief (AES_ISR) Output Data Register read during the data processing. */ +#define AES_ISR_URAT_MR_WR_PROCESSING (0x2u << 12) /**< \brief (AES_ISR) Mode Register written during the data processing. */ +#define AES_ISR_URAT_ODR_RD_SUBKGEN (0x3u << 12) /**< \brief (AES_ISR) Output Data Register read during the sub-keys generation. */ +#define AES_ISR_URAT_MR_WR_SUBKGEN (0x4u << 12) /**< \brief (AES_ISR) Mode Register written during the sub-keys generation. */ +#define AES_ISR_URAT_WOR_RD_ACCESS (0x5u << 12) /**< \brief (AES_ISR) Write-only register read access. */ +#define AES_ISR_TAGRDY (0x1u << 16) /**< \brief (AES_ISR) GCM Tag Ready */ +#define AES_ISR_EOPAD (0x1u << 17) /**< \brief (AES_ISR) End of Padding */ +#define AES_ISR_PLENERR (0x1u << 18) /**< \brief (AES_ISR) Padding Length Error */ +/* -------- AES_KEYWR[8] : (AES Offset: 0x20) Key Word Register -------- */ +#define AES_KEYWR_KEYW_Pos 0 +#define AES_KEYWR_KEYW_Msk (0xffffffffu << AES_KEYWR_KEYW_Pos) /**< \brief (AES_KEYWR[8]) Key Word */ +#define AES_KEYWR_KEYW(value) ((AES_KEYWR_KEYW_Msk & ((value) << AES_KEYWR_KEYW_Pos))) +/* -------- AES_IDATAR[4] : (AES Offset: 0x40) Input Data Register -------- */ +#define AES_IDATAR_IDATA_Pos 0 +#define AES_IDATAR_IDATA_Msk (0xffffffffu << AES_IDATAR_IDATA_Pos) /**< \brief (AES_IDATAR[4]) Input Data Word */ +#define AES_IDATAR_IDATA(value) ((AES_IDATAR_IDATA_Msk & ((value) << AES_IDATAR_IDATA_Pos))) +/* -------- AES_ODATAR[4] : (AES Offset: 0x50) Output Data Register -------- */ +#define AES_ODATAR_ODATA_Pos 0 +#define AES_ODATAR_ODATA_Msk (0xffffffffu << AES_ODATAR_ODATA_Pos) /**< \brief (AES_ODATAR[4]) Output Data */ +/* -------- AES_IVR[4] : (AES Offset: 0x60) Initialization Vector Register -------- */ +#define AES_IVR_IV_Pos 0 +#define AES_IVR_IV_Msk (0xffffffffu << AES_IVR_IV_Pos) /**< \brief (AES_IVR[4]) Initialization Vector */ +#define AES_IVR_IV(value) ((AES_IVR_IV_Msk & ((value) << AES_IVR_IV_Pos))) +/* -------- AES_AADLENR : (AES Offset: 0x70) Additional Authenticated Data Length Register -------- */ +#define AES_AADLENR_AADLEN_Pos 0 +#define AES_AADLENR_AADLEN_Msk (0xffffffffu << AES_AADLENR_AADLEN_Pos) /**< \brief (AES_AADLENR) Additional Authenticated Data Length */ +#define AES_AADLENR_AADLEN(value) ((AES_AADLENR_AADLEN_Msk & ((value) << AES_AADLENR_AADLEN_Pos))) +/* -------- AES_CLENR : (AES Offset: 0x74) Plaintext/Ciphertext Length Register -------- */ +#define AES_CLENR_CLEN_Pos 0 +#define AES_CLENR_CLEN_Msk (0xffffffffu << AES_CLENR_CLEN_Pos) /**< \brief (AES_CLENR) Plaintext/Ciphertext Length */ +#define AES_CLENR_CLEN(value) ((AES_CLENR_CLEN_Msk & ((value) << AES_CLENR_CLEN_Pos))) +/* -------- AES_GHASHR[4] : (AES Offset: 0x78) GCM Intermediate Hash Word Register -------- */ +#define AES_GHASHR_GHASH_Pos 0 +#define AES_GHASHR_GHASH_Msk (0xffffffffu << AES_GHASHR_GHASH_Pos) /**< \brief (AES_GHASHR[4]) Intermediate GCM Hash Word x */ +#define AES_GHASHR_GHASH(value) ((AES_GHASHR_GHASH_Msk & ((value) << AES_GHASHR_GHASH_Pos))) +/* -------- AES_TAGR[4] : (AES Offset: 0x88) GCM Authentication Tag Word Register -------- */ +#define AES_TAGR_TAG_Pos 0 +#define AES_TAGR_TAG_Msk (0xffffffffu << AES_TAGR_TAG_Pos) /**< \brief (AES_TAGR[4]) GCM Authentication Tag x */ +/* -------- AES_CTRR : (AES Offset: 0x98) GCM Encryption Counter Value Register -------- */ +#define AES_CTRR_CTR_Pos 0 +#define AES_CTRR_CTR_Msk (0xffffffffu << AES_CTRR_CTR_Pos) /**< \brief (AES_CTRR) GCM Encryption Counter */ +/* -------- AES_GCMHR[4] : (AES Offset: 0x9C) GCM H Word Register -------- */ +#define AES_GCMHR_H_Pos 0 +#define AES_GCMHR_H_Msk (0xffffffffu << AES_GCMHR_H_Pos) /**< \brief (AES_GCMHR[4]) GCM H Word x */ +#define AES_GCMHR_H(value) ((AES_GCMHR_H_Msk & ((value) << AES_GCMHR_H_Pos))) +/* -------- AES_EMR : (AES Offset: 0xB0) Extended Mode Register -------- */ +#define AES_EMR_APEN (0x1u << 0) /**< \brief (AES_EMR) Auto Padding Enable */ +#define AES_EMR_APM (0x1u << 1) /**< \brief (AES_EMR) Auto Padding Mode */ +#define AES_EMR_PLIPEN (0x1u << 4) /**< \brief (AES_EMR) Protocol Layer Improved Performance Enable */ +#define AES_EMR_PLIPD (0x1u << 5) /**< \brief (AES_EMR) Protocol Layer Improved Performance Decipher */ +#define AES_EMR_PADLEN_Pos 8 +#define AES_EMR_PADLEN_Msk (0xffu << AES_EMR_PADLEN_Pos) /**< \brief (AES_EMR) Auto Padding Length */ +#define AES_EMR_PADLEN(value) ((AES_EMR_PADLEN_Msk & ((value) << AES_EMR_PADLEN_Pos))) +#define AES_EMR_NHEAD_Pos 16 +#define AES_EMR_NHEAD_Msk (0xffu << AES_EMR_NHEAD_Pos) /**< \brief (AES_EMR) IPSEC Next Header */ +#define AES_EMR_NHEAD(value) ((AES_EMR_NHEAD_Msk & ((value) << AES_EMR_NHEAD_Pos))) +/* -------- AES_BCNT : (AES Offset: 0xB4) Byte Counter Register -------- */ +#define AES_BCNT_BCNT_Pos 0 +#define AES_BCNT_BCNT_Msk (0xffffffffu << AES_BCNT_BCNT_Pos) /**< \brief (AES_BCNT) Auto Padding Byte Counter */ +#define AES_BCNT_BCNT(value) ((AES_BCNT_BCNT_Msk & ((value) << AES_BCNT_BCNT_Pos))) +/* -------- AES_TWR[4] : (AES Offset: 0xC0) Tweak Word Register -------- */ +#define AES_TWR_TWEAK_Pos 0 +#define AES_TWR_TWEAK_Msk (0xffffffffu << AES_TWR_TWEAK_Pos) /**< \brief (AES_TWR[4]) Tweak Word x */ +#define AES_TWR_TWEAK(value) ((AES_TWR_TWEAK_Msk & ((value) << AES_TWR_TWEAK_Pos))) +/* -------- AES_ALPHAR[4] : (AES Offset: 0xD0) Alpha Word Register -------- */ +#define AES_ALPHAR_ALPHA_Pos 0 +#define AES_ALPHAR_ALPHA_Msk (0xffffffffu << AES_ALPHAR_ALPHA_Pos) /**< \brief (AES_ALPHAR[4]) Alpha Word x */ +#define AES_ALPHAR_ALPHA(value) ((AES_ALPHAR_ALPHA_Msk & ((value) << AES_ALPHAR_ALPHA_Pos))) +/* -------- AES_VERSION : (AES Offset: 0xFC) Version Register -------- */ +#define AES_VERSION_VERSION_Pos 0 +#define AES_VERSION_VERSION_Msk (0xfffu << AES_VERSION_VERSION_Pos) /**< \brief (AES_VERSION) Version of the Hardware Module */ +#define AES_VERSION_MFN_Pos 16 +#define AES_VERSION_MFN_Msk (0x7u << AES_VERSION_MFN_Pos) /**< \brief (AES_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_AES_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aesb.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aesb.h new file mode 100644 index 000000000..dd019687d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aesb.h @@ -0,0 +1,150 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_AESB_COMPONENT_ +#define _SAMA5D2_AESB_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Advanced Encryption Standard Bridge */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_AESB Advanced Encryption Standard Bridge */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Aesb hardware registers */ +typedef struct { + __O uint32_t AESB_CR; /**< \brief (Aesb Offset: 0x00) Control Register */ + __IO uint32_t AESB_MR; /**< \brief (Aesb Offset: 0x04) Mode Register */ + __I uint32_t Reserved1[2]; + __O uint32_t AESB_IER; /**< \brief (Aesb Offset: 0x10) Interrupt Enable Register */ + __O uint32_t AESB_IDR; /**< \brief (Aesb Offset: 0x14) Interrupt Disable Register */ + __I uint32_t AESB_IMR; /**< \brief (Aesb Offset: 0x18) Interrupt Mask Register */ + __I uint32_t AESB_ISR; /**< \brief (Aesb Offset: 0x1C) Interrupt Status Register */ + __O uint32_t AESB_KEYWR[4]; /**< \brief (Aesb Offset: 0x20) Key Word Register */ + __I uint32_t Reserved2[4]; + __O uint32_t AESB_IDATAR[4]; /**< \brief (Aesb Offset: 0x40) Input Data Register */ + __I uint32_t AESB_ODATAR[4]; /**< \brief (Aesb Offset: 0x50) Output Data Register */ + __O uint32_t AESB_IVR[4]; /**< \brief (Aesb Offset: 0x60) Initialization Vector Register */ + __I uint32_t Reserved3[35]; + __I uint32_t AESB_VERSION; /**< \brief (Aesb Offset: 0xFC) Version Register */ +} Aesb; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- AESB_CR : (AESB Offset: 0x00) Control Register -------- */ +#define AESB_CR_START (0x1u << 0) /**< \brief (AESB_CR) Start Processing */ +#define AESB_CR_SWRST (0x1u << 8) /**< \brief (AESB_CR) Software Reset */ +#define AESB_CR_LOADSEED (0x1u << 16) /**< \brief (AESB_CR) Random Number Generator Seed Loading */ +/* -------- AESB_MR : (AESB Offset: 0x04) Mode Register -------- */ +#define AESB_MR_CIPHER (0x1u << 0) /**< \brief (AESB_MR) Processing Mode */ +#define AESB_MR_AAHB (0x1u << 2) /**< \brief (AESB_MR) Automatic Bridge Mode */ +#define AESB_MR_DUALBUFF (0x1u << 3) /**< \brief (AESB_MR) Dual Input Buffer */ +#define AESB_MR_DUALBUFF_INACTIVE (0x0u << 3) /**< \brief (AESB_MR) AESB_IDATARx cannot be written during processing of previous block. */ +#define AESB_MR_DUALBUFF_ACTIVE (0x1u << 3) /**< \brief (AESB_MR) AESB_IDATARx can be written during processing of previous block when SMOD = 0x2. It speeds up the overall runtime of large files. */ +#define AESB_MR_PROCDLY_Pos 4 +#define AESB_MR_PROCDLY_Msk (0xfu << AESB_MR_PROCDLY_Pos) /**< \brief (AESB_MR) Processing Delay */ +#define AESB_MR_PROCDLY(value) ((AESB_MR_PROCDLY_Msk & ((value) << AESB_MR_PROCDLY_Pos))) +#define AESB_MR_SMOD_Pos 8 +#define AESB_MR_SMOD_Msk (0x3u << AESB_MR_SMOD_Pos) /**< \brief (AESB_MR) Start Mode */ +#define AESB_MR_SMOD(value) ((AESB_MR_SMOD_Msk & ((value) << AESB_MR_SMOD_Pos))) +#define AESB_MR_SMOD_MANUAL_START (0x0u << 8) /**< \brief (AESB_MR) Manual Mode */ +#define AESB_MR_SMOD_AUTO_START (0x1u << 8) /**< \brief (AESB_MR) Auto Mode */ +#define AESB_MR_SMOD_IDATAR0_START (0x2u << 8) /**< \brief (AESB_MR) AESB_IDATAR0 access only Auto Mode */ +#define AESB_MR_OPMOD_Pos 12 +#define AESB_MR_OPMOD_Msk (0x7u << AESB_MR_OPMOD_Pos) /**< \brief (AESB_MR) Operation Mode */ +#define AESB_MR_OPMOD(value) ((AESB_MR_OPMOD_Msk & ((value) << AESB_MR_OPMOD_Pos))) +#define AESB_MR_OPMOD_ECB (0x0u << 12) /**< \brief (AESB_MR) Electronic Code Book mode */ +#define AESB_MR_OPMOD_CBC (0x1u << 12) /**< \brief (AESB_MR) Cipher Block Chaining mode */ +#define AESB_MR_OPMOD_CTR (0x4u << 12) /**< \brief (AESB_MR) Counter mode (16-bit internal counter) */ +#define AESB_MR_LOD (0x1u << 15) /**< \brief (AESB_MR) Last Output Data Mode */ +#define AESB_MR_CKEY_Pos 20 +#define AESB_MR_CKEY_Msk (0xfu << AESB_MR_CKEY_Pos) /**< \brief (AESB_MR) Countermeasure Key */ +#define AESB_MR_CKEY(value) ((AESB_MR_CKEY_Msk & ((value) << AESB_MR_CKEY_Pos))) +#define AESB_MR_CKEY_PASSWD (0xEu << 20) /**< \brief (AESB_MR) This field must be written with 0xE to allow CMTYPx fields change. Any other values will abort the write operation in CMTYPx fields.Always reads as 0. */ +#define AESB_MR_CMTYP1 (0x1u << 24) /**< \brief (AESB_MR) Countermeasure Type 1 */ +#define AESB_MR_CMTYP1_NOPROT_EXTKEY (0x0u << 24) /**< \brief (AESB_MR) Countermeasure type 1 is disabled. */ +#define AESB_MR_CMTYP1_PROT_EXTKEY (0x1u << 24) /**< \brief (AESB_MR) Countermeasure type 1 is enabled. */ +#define AESB_MR_CMTYP2 (0x1u << 25) /**< \brief (AESB_MR) Countermeasure Type 2 */ +#define AESB_MR_CMTYP2_NO_PAUSE (0x0u << 25) /**< \brief (AESB_MR) Countermeasure type 2 is disabled. */ +#define AESB_MR_CMTYP2_PAUSE (0x1u << 25) /**< \brief (AESB_MR) Countermeasure type 2 is enabled. */ +#define AESB_MR_CMTYP3 (0x1u << 26) /**< \brief (AESB_MR) Countermeasure Type 3 */ +#define AESB_MR_CMTYP3_NO_DUMMY (0x0u << 26) /**< \brief (AESB_MR) Countermeasure type 3 is disabled. */ +#define AESB_MR_CMTYP3_DUMMY (0x1u << 26) /**< \brief (AESB_MR) Countermeasure type 3 is enabled. */ +#define AESB_MR_CMTYP4 (0x1u << 27) /**< \brief (AESB_MR) Countermeasure Type 4 */ +#define AESB_MR_CMTYP4_NO_RESTART (0x0u << 27) /**< \brief (AESB_MR) Countermeasure type 4 is disabled. */ +#define AESB_MR_CMTYP4_RESTART (0x1u << 27) /**< \brief (AESB_MR) Countermeasure type 4 is enabled. */ +#define AESB_MR_CMTYP5 (0x1u << 28) /**< \brief (AESB_MR) Countermeasure Type 5 */ +#define AESB_MR_CMTYP5_NO_ADDACCESS (0x0u << 28) /**< \brief (AESB_MR) Countermeasure type 5 is disabled. */ +#define AESB_MR_CMTYP5_ADDACCESS (0x1u << 28) /**< \brief (AESB_MR) Countermeasure type 5 is enabled. */ +#define AESB_MR_CMTYP6 (0x1u << 29) /**< \brief (AESB_MR) CounterMeasure Type 6 */ +#define AESB_MR_CMTYP6_NO_IDLECURRENT (0x0u << 29) /**< \brief (AESB_MR) Countermeasure type 6 is disabled. */ +#define AESB_MR_CMTYP6_IDLECURRENT (0x1u << 29) /**< \brief (AESB_MR) Countermeasure type 6 is enabled. */ +/* -------- AESB_IER : (AESB Offset: 0x10) Interrupt Enable Register -------- */ +#define AESB_IER_DATRDY (0x1u << 0) /**< \brief (AESB_IER) Data Ready Interrupt Enable */ +#define AESB_IER_URAD (0x1u << 8) /**< \brief (AESB_IER) Unspecified Register Access Detection Interrupt Enable */ +/* -------- AESB_IDR : (AESB Offset: 0x14) Interrupt Disable Register -------- */ +#define AESB_IDR_DATRDY (0x1u << 0) /**< \brief (AESB_IDR) Data Ready Interrupt Disable */ +#define AESB_IDR_URAD (0x1u << 8) /**< \brief (AESB_IDR) Unspecified Register Access Detection Interrupt Disable */ +/* -------- AESB_IMR : (AESB Offset: 0x18) Interrupt Mask Register -------- */ +#define AESB_IMR_DATRDY (0x1u << 0) /**< \brief (AESB_IMR) Data Ready Interrupt Mask */ +#define AESB_IMR_URAD (0x1u << 8) /**< \brief (AESB_IMR) Unspecified Register Access Detection Interrupt Mask */ +/* -------- AESB_ISR : (AESB Offset: 0x1C) Interrupt Status Register -------- */ +#define AESB_ISR_DATRDY (0x1u << 0) /**< \brief (AESB_ISR) Data Ready */ +#define AESB_ISR_URAD (0x1u << 8) /**< \brief (AESB_ISR) Unspecified Register Access Detection Status */ +#define AESB_ISR_URAT_Pos 12 +#define AESB_ISR_URAT_Msk (0xfu << AESB_ISR_URAT_Pos) /**< \brief (AESB_ISR) Unspecified Register Access */ +#define AESB_ISR_URAT_IDR_WR_PROCESSING (0x0u << 12) /**< \brief (AESB_ISR) Input Data Register written during the data processing when SMOD = 0x2 mode */ +#define AESB_ISR_URAT_ODR_RD_PROCESSING (0x1u << 12) /**< \brief (AESB_ISR) Output Data Register read during the data processing */ +#define AESB_ISR_URAT_MR_WR_PROCESSING (0x2u << 12) /**< \brief (AESB_ISR) Mode Register written during the data processing */ +#define AESB_ISR_URAT_ODR_RD_SUBKGEN (0x3u << 12) /**< \brief (AESB_ISR) Output Data Register read during the sub-keys generation */ +#define AESB_ISR_URAT_MR_WR_SUBKGEN (0x4u << 12) /**< \brief (AESB_ISR) Mode Register written during the sub-keys generation */ +#define AESB_ISR_URAT_WOR_RD_ACCESS (0x5u << 12) /**< \brief (AESB_ISR) Write-only register read access */ +/* -------- AESB_KEYWR[4] : (AESB Offset: 0x20) Key Word Register -------- */ +#define AESB_KEYWR_KEYW_Pos 0 +#define AESB_KEYWR_KEYW_Msk (0xffffffffu << AESB_KEYWR_KEYW_Pos) /**< \brief (AESB_KEYWR[4]) Key Word */ +#define AESB_KEYWR_KEYW(value) ((AESB_KEYWR_KEYW_Msk & ((value) << AESB_KEYWR_KEYW_Pos))) +/* -------- AESB_IDATAR[4] : (AESB Offset: 0x40) Input Data Register -------- */ +#define AESB_IDATAR_IDATA_Pos 0 +#define AESB_IDATAR_IDATA_Msk (0xffffffffu << AESB_IDATAR_IDATA_Pos) /**< \brief (AESB_IDATAR[4]) Input Data Word */ +#define AESB_IDATAR_IDATA(value) ((AESB_IDATAR_IDATA_Msk & ((value) << AESB_IDATAR_IDATA_Pos))) +/* -------- AESB_ODATAR[4] : (AESB Offset: 0x50) Output Data Register -------- */ +#define AESB_ODATAR_ODATA_Pos 0 +#define AESB_ODATAR_ODATA_Msk (0xffffffffu << AESB_ODATAR_ODATA_Pos) /**< \brief (AESB_ODATAR[4]) Output Data */ +/* -------- AESB_IVR[4] : (AESB Offset: 0x60) Initialization Vector Register -------- */ +#define AESB_IVR_IV_Pos 0 +#define AESB_IVR_IV_Msk (0xffffffffu << AESB_IVR_IV_Pos) /**< \brief (AESB_IVR[4]) Initialization Vector */ +#define AESB_IVR_IV(value) ((AESB_IVR_IV_Msk & ((value) << AESB_IVR_IV_Pos))) +/* -------- AESB_VERSION : (AESB Offset: 0xFC) Version Register -------- */ +#define AESB_VERSION_VERSION_Pos 0 +#define AESB_VERSION_VERSION_Msk (0xfffu << AESB_VERSION_VERSION_Pos) /**< \brief (AESB_VERSION) Version of the Hardware Module */ +#define AESB_VERSION_MFN_Pos 16 +#define AESB_VERSION_MFN_Msk (0x7u << AESB_VERSION_MFN_Pos) /**< \brief (AESB_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_AESB_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aic.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aic.h new file mode 100644 index 000000000..5fa0b6a61 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aic.h @@ -0,0 +1,272 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_AIC_COMPONENT_ +#define _SAMA5D2_AIC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Advanced Interrupt Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_AIC Advanced Interrupt Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Aic hardware registers */ +typedef struct { + __IO uint32_t AIC_SSR; /**< \brief (Aic Offset: 0x00) Source Select Register */ + __IO uint32_t AIC_SMR; /**< \brief (Aic Offset: 0x04) Source Mode Register */ + __IO uint32_t AIC_SVR; /**< \brief (Aic Offset: 0x08) Source Vector Register */ + __I uint32_t Reserved1[1]; + __I uint32_t AIC_IVR; /**< \brief (Aic Offset: 0x10) Interrupt Vector Register */ + __I uint32_t AIC_FVR; /**< \brief (Aic Offset: 0x14) FIQ Vector Register */ + __I uint32_t AIC_ISR; /**< \brief (Aic Offset: 0x18) Interrupt Status Register */ + __I uint32_t Reserved2[1]; + __I uint32_t AIC_IPR0; /**< \brief (Aic Offset: 0x20) Interrupt Pending Register 0 */ + __I uint32_t AIC_IPR1; /**< \brief (Aic Offset: 0x24) Interrupt Pending Register 1 */ + __I uint32_t AIC_IPR2; /**< \brief (Aic Offset: 0x28) Interrupt Pending Register 2 */ + __I uint32_t AIC_IPR3; /**< \brief (Aic Offset: 0x2C) Interrupt Pending Register 3 */ + __I uint32_t AIC_IMR; /**< \brief (Aic Offset: 0x30) Interrupt Mask Register */ + __I uint32_t AIC_CISR; /**< \brief (Aic Offset: 0x34) Core Interrupt Status Register */ + __O uint32_t AIC_EOICR; /**< \brief (Aic Offset: 0x38) End of Interrupt Command Register */ + __IO uint32_t AIC_SPU; /**< \brief (Aic Offset: 0x3C) Spurious Interrupt Vector Register */ + __O uint32_t AIC_IECR; /**< \brief (Aic Offset: 0x40) Interrupt Enable Command Register */ + __O uint32_t AIC_IDCR; /**< \brief (Aic Offset: 0x44) Interrupt Disable Command Register */ + __O uint32_t AIC_ICCR; /**< \brief (Aic Offset: 0x48) Interrupt Clear Command Register */ + __O uint32_t AIC_ISCR; /**< \brief (Aic Offset: 0x4C) Interrupt Set Command Register */ + __I uint32_t Reserved3[7]; + __IO uint32_t AIC_DCR; /**< \brief (Aic Offset: 0x6C) Debug Control Register */ + __I uint32_t Reserved4[29]; + __IO uint32_t AIC_WPMR; /**< \brief (Aic Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t AIC_WPSR; /**< \brief (Aic Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved5[4]; + __I uint32_t AIC_VERSION; /**< \brief (Aic Offset: 0XFC) AIC Version Register */ +} Aic; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- AIC_SSR : (AIC Offset: 0x00) Source Select Register -------- */ +#define AIC_SSR_INTSEL_Pos 0 +#define AIC_SSR_INTSEL_Msk (0x7fu << AIC_SSR_INTSEL_Pos) /**< \brief (AIC_SSR) Interrupt Line Selection */ +#define AIC_SSR_INTSEL(value) ((AIC_SSR_INTSEL_Msk & ((value) << AIC_SSR_INTSEL_Pos))) +/* -------- AIC_SMR : (AIC Offset: 0x04) Source Mode Register -------- */ +#define AIC_SMR_PRIOR_Pos 0 +#define AIC_SMR_PRIOR_Msk (0x7u << AIC_SMR_PRIOR_Pos) /**< \brief (AIC_SMR) Priority Level */ +#define AIC_SMR_PRIOR(value) ((AIC_SMR_PRIOR_Msk & ((value) << AIC_SMR_PRIOR_Pos))) +#define AIC_SMR_SRCTYPE_Pos 5 +#define AIC_SMR_SRCTYPE_Msk (0x3u << AIC_SMR_SRCTYPE_Pos) /**< \brief (AIC_SMR) Interrupt Source Type */ +#define AIC_SMR_SRCTYPE(value) ((AIC_SMR_SRCTYPE_Msk & ((value) << AIC_SMR_SRCTYPE_Pos))) +#define AIC_SMR_SRCTYPE_INT_LEVEL_SENSITIVE (0x0u << 5) /**< \brief (AIC_SMR) High level Sensitive for internal sourceLow level Sensitive for external source */ +#define AIC_SMR_SRCTYPE_INT_EDGE_TRIGGERED (0x1u << 5) /**< \brief (AIC_SMR) Positive edge triggered for internal sourceNegative edge triggered for external source */ +#define AIC_SMR_SRCTYPE_EXT_HIGH_LEVEL (0x2u << 5) /**< \brief (AIC_SMR) High level Sensitive for internal sourceHigh level Sensitive for external source */ +#define AIC_SMR_SRCTYPE_EXT_POSITIVE_EDGE (0x3u << 5) /**< \brief (AIC_SMR) Positive edge triggered for internal sourcePositive edge triggered for external source */ +/* -------- AIC_SVR : (AIC Offset: 0x08) Source Vector Register -------- */ +#define AIC_SVR_VECTOR_Pos 0 +#define AIC_SVR_VECTOR_Msk (0xffffffffu << AIC_SVR_VECTOR_Pos) /**< \brief (AIC_SVR) Source Vector */ +#define AIC_SVR_VECTOR(value) ((AIC_SVR_VECTOR_Msk & ((value) << AIC_SVR_VECTOR_Pos))) +/* -------- AIC_IVR : (AIC Offset: 0x10) Interrupt Vector Register -------- */ +#define AIC_IVR_IRQV_Pos 0 +#define AIC_IVR_IRQV_Msk (0xffffffffu << AIC_IVR_IRQV_Pos) /**< \brief (AIC_IVR) Interrupt Vector Register */ +/* -------- AIC_FVR : (AIC Offset: 0x14) FIQ Vector Register -------- */ +#define AIC_FVR_FIQV_Pos 0 +#define AIC_FVR_FIQV_Msk (0xffffffffu << AIC_FVR_FIQV_Pos) /**< \brief (AIC_FVR) FIQ Vector Register */ +/* -------- AIC_ISR : (AIC Offset: 0x18) Interrupt Status Register -------- */ +#define AIC_ISR_IRQID_Pos 0 +#define AIC_ISR_IRQID_Msk (0x7fu << AIC_ISR_IRQID_Pos) /**< \brief (AIC_ISR) Current Interrupt Identifier */ +/* -------- AIC_IPR0 : (AIC Offset: 0x20) Interrupt Pending Register 0 -------- */ +#define AIC_IPR0_FIQ (0x1u << 0) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_SYS (0x1u << 1) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID2 (0x1u << 2) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID3 (0x1u << 3) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID4 (0x1u << 4) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID5 (0x1u << 5) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID6 (0x1u << 6) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID7 (0x1u << 7) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID8 (0x1u << 8) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID9 (0x1u << 9) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID10 (0x1u << 10) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID11 (0x1u << 11) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID12 (0x1u << 12) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID13 (0x1u << 13) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID14 (0x1u << 14) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID15 (0x1u << 15) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID16 (0x1u << 16) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID17 (0x1u << 17) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID18 (0x1u << 18) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID19 (0x1u << 19) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID20 (0x1u << 20) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID21 (0x1u << 21) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID22 (0x1u << 22) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID23 (0x1u << 23) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID24 (0x1u << 24) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID25 (0x1u << 25) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID26 (0x1u << 26) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID27 (0x1u << 27) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID28 (0x1u << 28) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID29 (0x1u << 29) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID30 (0x1u << 30) /**< \brief (AIC_IPR0) Interrupt Pending */ +#define AIC_IPR0_PID31 (0x1u << 31) /**< \brief (AIC_IPR0) Interrupt Pending */ +/* -------- AIC_IPR1 : (AIC Offset: 0x24) Interrupt Pending Register 1 -------- */ +#define AIC_IPR1_PID32 (0x1u << 0) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID33 (0x1u << 1) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID34 (0x1u << 2) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID35 (0x1u << 3) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID36 (0x1u << 4) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID37 (0x1u << 5) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID38 (0x1u << 6) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID39 (0x1u << 7) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID40 (0x1u << 8) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID41 (0x1u << 9) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID42 (0x1u << 10) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID43 (0x1u << 11) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID44 (0x1u << 12) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID45 (0x1u << 13) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID46 (0x1u << 14) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID47 (0x1u << 15) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID48 (0x1u << 16) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID49 (0x1u << 17) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID50 (0x1u << 18) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID51 (0x1u << 19) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID52 (0x1u << 20) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID53 (0x1u << 21) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID54 (0x1u << 22) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID55 (0x1u << 23) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID56 (0x1u << 24) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID57 (0x1u << 25) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID58 (0x1u << 26) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID59 (0x1u << 27) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID60 (0x1u << 28) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID61 (0x1u << 29) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID62 (0x1u << 30) /**< \brief (AIC_IPR1) Interrupt Pending */ +#define AIC_IPR1_PID63 (0x1u << 31) /**< \brief (AIC_IPR1) Interrupt Pending */ +/* -------- AIC_IPR2 : (AIC Offset: 0x28) Interrupt Pending Register 2 -------- */ +#define AIC_IPR2_PID64 (0x1u << 0) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID65 (0x1u << 1) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID66 (0x1u << 2) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID67 (0x1u << 3) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID68 (0x1u << 4) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID69 (0x1u << 5) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID70 (0x1u << 6) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID71 (0x1u << 7) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID72 (0x1u << 8) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID73 (0x1u << 9) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID74 (0x1u << 10) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID75 (0x1u << 11) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID76 (0x1u << 12) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID77 (0x1u << 13) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID78 (0x1u << 14) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID79 (0x1u << 15) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID80 (0x1u << 16) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID81 (0x1u << 17) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID82 (0x1u << 18) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID83 (0x1u << 19) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID84 (0x1u << 20) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID85 (0x1u << 21) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID86 (0x1u << 22) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID87 (0x1u << 23) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID88 (0x1u << 24) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID89 (0x1u << 25) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID90 (0x1u << 26) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID91 (0x1u << 27) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID92 (0x1u << 28) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID93 (0x1u << 29) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID94 (0x1u << 30) /**< \brief (AIC_IPR2) Interrupt Pending */ +#define AIC_IPR2_PID95 (0x1u << 31) /**< \brief (AIC_IPR2) Interrupt Pending */ +/* -------- AIC_IPR3 : (AIC Offset: 0x2C) Interrupt Pending Register 3 -------- */ +#define AIC_IPR3_PID96 (0x1u << 0) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID97 (0x1u << 1) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID98 (0x1u << 2) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID99 (0x1u << 3) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID100 (0x1u << 4) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID101 (0x1u << 5) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID102 (0x1u << 6) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID103 (0x1u << 7) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID104 (0x1u << 8) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID105 (0x1u << 9) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID106 (0x1u << 10) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID107 (0x1u << 11) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID108 (0x1u << 12) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID109 (0x1u << 13) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID110 (0x1u << 14) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID111 (0x1u << 15) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID112 (0x1u << 16) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID113 (0x1u << 17) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID114 (0x1u << 18) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID115 (0x1u << 19) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID116 (0x1u << 20) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID117 (0x1u << 21) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID118 (0x1u << 22) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID119 (0x1u << 23) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID120 (0x1u << 24) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID121 (0x1u << 25) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID122 (0x1u << 26) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID123 (0x1u << 27) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID124 (0x1u << 28) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID125 (0x1u << 29) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID126 (0x1u << 30) /**< \brief (AIC_IPR3) Interrupt Pending */ +#define AIC_IPR3_PID127 (0x1u << 31) /**< \brief (AIC_IPR3) Interrupt Pending */ +/* -------- AIC_IMR : (AIC Offset: 0x30) Interrupt Mask Register -------- */ +#define AIC_IMR_INTM (0x1u << 0) /**< \brief (AIC_IMR) Interrupt Mask */ +/* -------- AIC_CISR : (AIC Offset: 0x34) Core Interrupt Status Register -------- */ +#define AIC_CISR_NFIQ (0x1u << 0) /**< \brief (AIC_CISR) NFIQ Status */ +#define AIC_CISR_NIRQ (0x1u << 1) /**< \brief (AIC_CISR) NIRQ Status */ +/* -------- AIC_EOICR : (AIC Offset: 0x38) End of Interrupt Command Register -------- */ +#define AIC_EOICR_ENDIT (0x1u << 0) /**< \brief (AIC_EOICR) Interrupt Processing Complete Command */ +/* -------- AIC_SPU : (AIC Offset: 0x3C) Spurious Interrupt Vector Register -------- */ +#define AIC_SPU_SIVR_Pos 0 +#define AIC_SPU_SIVR_Msk (0xffffffffu << AIC_SPU_SIVR_Pos) /**< \brief (AIC_SPU) Spurious Interrupt Vector Register */ +#define AIC_SPU_SIVR(value) ((AIC_SPU_SIVR_Msk & ((value) << AIC_SPU_SIVR_Pos))) +/* -------- AIC_IECR : (AIC Offset: 0x40) Interrupt Enable Command Register -------- */ +#define AIC_IECR_INTEN (0x1u << 0) /**< \brief (AIC_IECR) Interrupt Enable */ +/* -------- AIC_IDCR : (AIC Offset: 0x44) Interrupt Disable Command Register -------- */ +#define AIC_IDCR_INTD (0x1u << 0) /**< \brief (AIC_IDCR) Interrupt Disable */ +/* -------- AIC_ICCR : (AIC Offset: 0x48) Interrupt Clear Command Register -------- */ +#define AIC_ICCR_INTCLR (0x1u << 0) /**< \brief (AIC_ICCR) Interrupt Clear */ +/* -------- AIC_ISCR : (AIC Offset: 0x4C) Interrupt Set Command Register -------- */ +#define AIC_ISCR_INTSET (0x1u << 0) /**< \brief (AIC_ISCR) Interrupt Set */ +/* -------- AIC_DCR : (AIC Offset: 0x6C) Debug Control Register -------- */ +#define AIC_DCR_PROT (0x1u << 0) /**< \brief (AIC_DCR) Protection Mode */ +#define AIC_DCR_GMSK (0x1u << 1) /**< \brief (AIC_DCR) General Interrupt Mask */ +/* -------- AIC_WPMR : (AIC Offset: 0xE4) Write Protection Mode Register -------- */ +#define AIC_WPMR_WPEN (0x1u << 0) /**< \brief (AIC_WPMR) Write Protection Enable */ +#define AIC_WPMR_WPKEY_Pos 8 +#define AIC_WPMR_WPKEY_Msk (0xffffffu << AIC_WPMR_WPKEY_Pos) /**< \brief (AIC_WPMR) Write Protection Key */ +#define AIC_WPMR_WPKEY(value) ((AIC_WPMR_WPKEY_Msk & ((value) << AIC_WPMR_WPKEY_Pos))) +#define AIC_WPMR_WPKEY_PASSWD (0x414943u << 8) /**< \brief (AIC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- AIC_WPSR : (AIC Offset: 0xE8) Write Protection Status Register -------- */ +#define AIC_WPSR_WPVS (0x1u << 0) /**< \brief (AIC_WPSR) Write Protection Violation Status */ +#define AIC_WPSR_WPVSRC_Pos 8 +#define AIC_WPSR_WPVSRC_Msk (0xffffu << AIC_WPSR_WPVSRC_Pos) /**< \brief (AIC_WPSR) Write Protection Violation Source */ +/* -------- AIC_VERSION : (AIC Offset: 0XFC) AIC Version Register -------- */ +#define AIC_VERSION_VERSION_Pos 0 +#define AIC_VERSION_VERSION_Msk (0xfffu << AIC_VERSION_VERSION_Pos) /**< \brief (AIC_VERSION) Version of the Hardware Module */ +#define AIC_VERSION_MFN_Pos 16 +#define AIC_VERSION_MFN_Msk (0x7u << AIC_VERSION_MFN_Pos) /**< \brief (AIC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_AIC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aximx.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aximx.h new file mode 100644 index 000000000..bec70306c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_aximx.h @@ -0,0 +1,51 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_AXIMX_COMPONENT_ +#define _SAMA5D2_AXIMX_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR AXI Matrix */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_AXIMX AXI Matrix */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Aximx hardware registers */ +typedef struct { + __O uint32_t AXIMX_REMAP; /**< \brief (Aximx Offset: 0x00) AXI Matrix Remap Register */ +} Aximx; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- AXIMX_REMAP : (AXIMX Offset: 0x00) AXI Matrix Remap Register -------- */ +#define AXIMX_REMAP_REMAP0 (0x1u << 0) /**< \brief (AXIMX_REMAP) Remap State 0 */ + +/*@}*/ + + +#endif /* _SAMA5D2_AXIMX_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_chipid.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_chipid.h new file mode 100644 index 000000000..cfdca426c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_chipid.h @@ -0,0 +1,121 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_CHIPID_COMPONENT_ +#define _SAMA5D2_CHIPID_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Chip Identifier */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_CHIPID Chip Identifier */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Chipid hardware registers */ +typedef struct { + __I uint32_t CHIPID_CIDR; /**< \brief (Chipid Offset: 0x0) Chip ID Register */ + __I uint32_t CHIPID_EXID; /**< \brief (Chipid Offset: 0x4) Chip ID Extension Register */ +} Chipid; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- CHIPID_CIDR : (CHIPID Offset: 0x0) Chip ID Register -------- */ +#define CHIPID_CIDR_VERSION_Pos 0 +#define CHIPID_CIDR_VERSION_Msk (0x1fu << CHIPID_CIDR_VERSION_Pos) /**< \brief (CHIPID_CIDR) Version of the Device */ +#define CHIPID_CIDR_EPROC_Pos 5 +#define CHIPID_CIDR_EPROC_Msk (0x7u << CHIPID_CIDR_EPROC_Pos) /**< \brief (CHIPID_CIDR) Embedded Processor */ +#define CHIPID_CIDR_EPROC_SAMx7 (0x0u << 5) /**< \brief (CHIPID_CIDR) Cortex-M7 */ +#define CHIPID_CIDR_EPROC_ARM946ES (0x1u << 5) /**< \brief (CHIPID_CIDR) ARM946ES */ +#define CHIPID_CIDR_EPROC_ARM7TDMI (0x2u << 5) /**< \brief (CHIPID_CIDR) ARM7TDMI */ +#define CHIPID_CIDR_EPROC_CM3 (0x3u << 5) /**< \brief (CHIPID_CIDR) Cortex-M3 */ +#define CHIPID_CIDR_EPROC_ARM920T (0x4u << 5) /**< \brief (CHIPID_CIDR) ARM920T */ +#define CHIPID_CIDR_EPROC_ARM926EJS (0x5u << 5) /**< \brief (CHIPID_CIDR) ARM926EJS */ +#define CHIPID_CIDR_EPROC_CA5 (0x6u << 5) /**< \brief (CHIPID_CIDR) Cortex-A5 */ +#define CHIPID_CIDR_EPROC_CM4 (0x7u << 5) /**< \brief (CHIPID_CIDR) Cortex-M4 */ +#define CHIPID_CIDR_NVPSIZ_Pos 8 +#define CHIPID_CIDR_NVPSIZ_Msk (0xfu << CHIPID_CIDR_NVPSIZ_Pos) /**< \brief (CHIPID_CIDR) Nonvolatile Program Memory Size */ +#define CHIPID_CIDR_NVPSIZ_NONE (0x0u << 8) /**< \brief (CHIPID_CIDR) None */ +#define CHIPID_CIDR_NVPSIZ_8K (0x1u << 8) /**< \brief (CHIPID_CIDR) 8 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_16K (0x2u << 8) /**< \brief (CHIPID_CIDR) 16 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_32K (0x3u << 8) /**< \brief (CHIPID_CIDR) 32 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_64K (0x5u << 8) /**< \brief (CHIPID_CIDR) 64 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_128K (0x7u << 8) /**< \brief (CHIPID_CIDR) 128 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_160K (0x8u << 8) /**< \brief (CHIPID_CIDR) 160 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_256K (0x9u << 8) /**< \brief (CHIPID_CIDR) 256 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_512K (0xAu << 8) /**< \brief (CHIPID_CIDR) 512 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_1024K (0xCu << 8) /**< \brief (CHIPID_CIDR) 1024 Kbytes */ +#define CHIPID_CIDR_NVPSIZ_2048K (0xEu << 8) /**< \brief (CHIPID_CIDR) 2048 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_Pos 12 +#define CHIPID_CIDR_NVPSIZ2_Msk (0xfu << CHIPID_CIDR_NVPSIZ2_Pos) /**< \brief (CHIPID_CIDR) Second Nonvolatile Program Memory Size */ +#define CHIPID_CIDR_NVPSIZ2_NONE (0x0u << 12) /**< \brief (CHIPID_CIDR) None */ +#define CHIPID_CIDR_NVPSIZ2_8K (0x1u << 12) /**< \brief (CHIPID_CIDR) 8 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_16K (0x2u << 12) /**< \brief (CHIPID_CIDR) 16 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_32K (0x3u << 12) /**< \brief (CHIPID_CIDR) 32 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_64K (0x5u << 12) /**< \brief (CHIPID_CIDR) 64 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_128K (0x7u << 12) /**< \brief (CHIPID_CIDR) 128 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_256K (0x9u << 12) /**< \brief (CHIPID_CIDR) 256 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_512K (0xAu << 12) /**< \brief (CHIPID_CIDR) 512 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_1024K (0xCu << 12) /**< \brief (CHIPID_CIDR) 1024 Kbytes */ +#define CHIPID_CIDR_NVPSIZ2_2048K (0xEu << 12) /**< \brief (CHIPID_CIDR) 2048 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_Pos 16 +#define CHIPID_CIDR_SRAMSIZ_Msk (0xfu << CHIPID_CIDR_SRAMSIZ_Pos) /**< \brief (CHIPID_CIDR) Internal SRAM Size */ +#define CHIPID_CIDR_SRAMSIZ_48K (0x0u << 16) /**< \brief (CHIPID_CIDR) 48 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_192K (0x1u << 16) /**< \brief (CHIPID_CIDR) 192 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_384K (0x2u << 16) /**< \brief (CHIPID_CIDR) 384 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_6K (0x3u << 16) /**< \brief (CHIPID_CIDR) 6 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_24K (0x4u << 16) /**< \brief (CHIPID_CIDR) 24 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_4K (0x5u << 16) /**< \brief (CHIPID_CIDR) 4 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_80K (0x6u << 16) /**< \brief (CHIPID_CIDR) 80 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_160K (0x7u << 16) /**< \brief (CHIPID_CIDR) 160 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_8K (0x8u << 16) /**< \brief (CHIPID_CIDR) 8 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_16K (0x9u << 16) /**< \brief (CHIPID_CIDR) 16 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_32K (0xAu << 16) /**< \brief (CHIPID_CIDR) 32 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_64K (0xBu << 16) /**< \brief (CHIPID_CIDR) 64 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_128K (0xCu << 16) /**< \brief (CHIPID_CIDR) 128 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_256K (0xDu << 16) /**< \brief (CHIPID_CIDR) 256 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_96K (0xEu << 16) /**< \brief (CHIPID_CIDR) 96 Kbytes */ +#define CHIPID_CIDR_SRAMSIZ_512K (0xFu << 16) /**< \brief (CHIPID_CIDR) 512 Kbytes */ +#define CHIPID_CIDR_ARCH_Pos 20 +#define CHIPID_CIDR_ARCH_Msk (0xffu << CHIPID_CIDR_ARCH_Pos) /**< \brief (CHIPID_CIDR) Architecture Identifier */ +#define CHIPID_CIDR_ARCH_SAM4CxxE (0x66u << 20) /**< \brief (CHIPID_CIDR) SAM4CxE (144-pin version) */ +#define CHIPID_CIDR_ARCH_SAMA5 (0xA5u << 20) /**< \brief (CHIPID_CIDR) SAMA5 */ +#define CHIPID_CIDR_NVPTYP_Pos 28 +#define CHIPID_CIDR_NVPTYP_Msk (0x7u << CHIPID_CIDR_NVPTYP_Pos) /**< \brief (CHIPID_CIDR) Nonvolatile Program Memory Type */ +#define CHIPID_CIDR_NVPTYP_ROM (0x0u << 28) /**< \brief (CHIPID_CIDR) ROM */ +#define CHIPID_CIDR_NVPTYP_ROMLESS (0x1u << 28) /**< \brief (CHIPID_CIDR) ROMless or on-chip Flash */ +#define CHIPID_CIDR_NVPTYP_FLASH (0x2u << 28) /**< \brief (CHIPID_CIDR) Embedded Flash Memory */ +#define CHIPID_CIDR_NVPTYP_ROM_FLASH (0x3u << 28) /**< \brief (CHIPID_CIDR) ROM and Embedded Flash Memory- NVPSIZ is ROM size- NVPSIZ2 is Flash size */ +#define CHIPID_CIDR_NVPTYP_SRAM (0x4u << 28) /**< \brief (CHIPID_CIDR) SRAM emulating ROM */ +#define CHIPID_CIDR_EXT (0x1u << 31) /**< \brief (CHIPID_CIDR) Extension Flag */ +/* -------- CHIPID_EXID : (CHIPID Offset: 0x4) Chip ID Extension Register -------- */ +#define CHIPID_EXID_EXID_Pos 0 +#define CHIPID_EXID_EXID_Msk (0xffffffffu << CHIPID_EXID_EXID_Pos) /**< \brief (CHIPID_EXID) Chip ID Extension */ + +/*@}*/ + + +#endif /* _SAMA5D2_CHIPID_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_classd.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_classd.h new file mode 100644 index 000000000..7d49746ad --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_classd.h @@ -0,0 +1,158 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_CLASSD_COMPONENT_ +#define _SAMA5D2_CLASSD_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Audio Class D Amplifier */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_CLASSD Audio Class D Amplifier */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Classd hardware registers */ +typedef struct { + __O uint32_t CLASSD_CR; /**< \brief (Classd Offset: 0x00) Control Register */ + __IO uint32_t CLASSD_MR; /**< \brief (Classd Offset: 0x04) Mode Register */ + __IO uint32_t CLASSD_INTPMR; /**< \brief (Classd Offset: 0x08) Interpolator Mode Register */ + __I uint32_t CLASSD_INTSR; /**< \brief (Classd Offset: 0x0C) Interpolator Status Register */ + __IO uint32_t CLASSD_THR; /**< \brief (Classd Offset: 0x10) Transmit Holding Register */ + __O uint32_t CLASSD_IER; /**< \brief (Classd Offset: 0x14) Interrupt Enable Register */ + __O uint32_t CLASSD_IDR; /**< \brief (Classd Offset: 0x18) Interrupt Disable Register */ + __IO uint32_t CLASSD_IMR; /**< \brief (Classd Offset: 0x1C) Interrupt Mask Register */ + __I uint32_t CLASSD_ISR; /**< \brief (Classd Offset: 0x20) Interrupt Status Register */ + __I uint32_t Reserved1[48]; + __IO uint32_t CLASSD_WPMR; /**< \brief (Classd Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t Reserved2[5]; + __I uint32_t CLASSD_VERSION; /**< \brief (Classd Offset: 0xFC) IP Version Register */ +} Classd; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- CLASSD_CR : (CLASSD Offset: 0x00) Control Register -------- */ +#define CLASSD_CR_SWRST (0x1u << 0) /**< \brief (CLASSD_CR) Software Reset */ +/* -------- CLASSD_MR : (CLASSD Offset: 0x04) Mode Register -------- */ +#define CLASSD_MR_LEN (0x1u << 0) /**< \brief (CLASSD_MR) Left Channel Enable */ +#define CLASSD_MR_LMUTE (0x1u << 1) /**< \brief (CLASSD_MR) Left Channel Mute */ +#define CLASSD_MR_REN (0x1u << 4) /**< \brief (CLASSD_MR) Right Channel Enable */ +#define CLASSD_MR_RMUTE (0x1u << 5) /**< \brief (CLASSD_MR) Right Channel Mute */ +#define CLASSD_MR_PWMTYP (0x1u << 8) /**< \brief (CLASSD_MR) PWM Modulation Type */ +#define CLASSD_MR_NON_OVERLAP (0x1u << 16) /**< \brief (CLASSD_MR) Non-Overlapping Enable */ +#define CLASSD_MR_NOVRVAL_Pos 20 +#define CLASSD_MR_NOVRVAL_Msk (0x3u << CLASSD_MR_NOVRVAL_Pos) /**< \brief (CLASSD_MR) Non-Overlapping Value */ +#define CLASSD_MR_NOVRVAL(value) ((CLASSD_MR_NOVRVAL_Msk & ((value) << CLASSD_MR_NOVRVAL_Pos))) +#define CLASSD_MR_NOVRVAL_5NS (0x0u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 5 ns */ +#define CLASSD_MR_NOVRVAL_10NS (0x1u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 10 ns */ +#define CLASSD_MR_NOVRVAL_15NS (0x2u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 15 ns */ +#define CLASSD_MR_NOVRVAL_20NS (0x3u << 20) /**< \brief (CLASSD_MR) Non-overlapping time is 20 ns */ +/* -------- CLASSD_INTPMR : (CLASSD Offset: 0x08) Interpolator Mode Register -------- */ +#define CLASSD_INTPMR_ATTL_Pos 0 +#define CLASSD_INTPMR_ATTL_Msk (0x7fu << CLASSD_INTPMR_ATTL_Pos) /**< \brief (CLASSD_INTPMR) Left Channel Attenuation */ +#define CLASSD_INTPMR_ATTL(value) ((CLASSD_INTPMR_ATTL_Msk & ((value) << CLASSD_INTPMR_ATTL_Pos))) +#define CLASSD_INTPMR_ATTR_Pos 8 +#define CLASSD_INTPMR_ATTR_Msk (0x7fu << CLASSD_INTPMR_ATTR_Pos) /**< \brief (CLASSD_INTPMR) Right Channel Attenuation */ +#define CLASSD_INTPMR_ATTR(value) ((CLASSD_INTPMR_ATTR_Msk & ((value) << CLASSD_INTPMR_ATTR_Pos))) +#define CLASSD_INTPMR_DSPCLKFREQ (0x1u << 16) /**< \brief (CLASSD_INTPMR) DSP Clock Frequency */ +#define CLASSD_INTPMR_DSPCLKFREQ_12M288 (0x0u << 16) /**< \brief (CLASSD_INTPMR) DSP Clock (DSPCLK) is 12.288 MHz */ +#define CLASSD_INTPMR_DSPCLKFREQ_11M2896 (0x1u << 16) /**< \brief (CLASSD_INTPMR) DSP Clock (DSPCLK) is 11.2896 MHz */ +#define CLASSD_INTPMR_DEEMP (0x1u << 18) /**< \brief (CLASSD_INTPMR) Enable De-emphasis Filter */ +#define CLASSD_INTPMR_DEEMP_DISABLED (0x0u << 18) /**< \brief (CLASSD_INTPMR) De-emphasis filter is disabled */ +#define CLASSD_INTPMR_DEEMP_ENABLED (0x1u << 18) /**< \brief (CLASSD_INTPMR) De-emphasis filter is enabled */ +#define CLASSD_INTPMR_SWAP (0x1u << 19) /**< \brief (CLASSD_INTPMR) Swap Left and Right Channels */ +#define CLASSD_INTPMR_SWAP_LEFT_ON_LSB (0x0u << 19) /**< \brief (CLASSD_INTPMR) Left channel is on CLASSD_THR[15:0], right channel is on CLASSD_THR[31:16] */ +#define CLASSD_INTPMR_SWAP_RIGHT_ON_LSB (0x1u << 19) /**< \brief (CLASSD_INTPMR) Right channel is on CLASSD_THR[15:0], left channel is on CLASSD_THR[31:16] */ +#define CLASSD_INTPMR_FRAME_Pos 20 +#define CLASSD_INTPMR_FRAME_Msk (0x7u << CLASSD_INTPMR_FRAME_Pos) /**< \brief (CLASSD_INTPMR) CLASSD Incoming Data Sampling Frequency */ +#define CLASSD_INTPMR_FRAME(value) ((CLASSD_INTPMR_FRAME_Msk & ((value) << CLASSD_INTPMR_FRAME_Pos))) +#define CLASSD_INTPMR_FRAME_FRAME_8K (0x0u << 20) /**< \brief (CLASSD_INTPMR) 8 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_16K (0x1u << 20) /**< \brief (CLASSD_INTPMR) 16 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_32K (0x2u << 20) /**< \brief (CLASSD_INTPMR) 32 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_48K (0x3u << 20) /**< \brief (CLASSD_INTPMR) 48 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_96K (0x4u << 20) /**< \brief (CLASSD_INTPMR) 96 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_22K (0x5u << 20) /**< \brief (CLASSD_INTPMR) 22.05 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_44K (0x6u << 20) /**< \brief (CLASSD_INTPMR) 44.1 kHz */ +#define CLASSD_INTPMR_FRAME_FRAME_88K (0x7u << 20) /**< \brief (CLASSD_INTPMR) 88.2 kHz */ +#define CLASSD_INTPMR_EQCFG_Pos 24 +#define CLASSD_INTPMR_EQCFG_Msk (0xfu << CLASSD_INTPMR_EQCFG_Pos) /**< \brief (CLASSD_INTPMR) Equalization Selection */ +#define CLASSD_INTPMR_EQCFG(value) ((CLASSD_INTPMR_EQCFG_Msk & ((value) << CLASSD_INTPMR_EQCFG_Pos))) +#define CLASSD_INTPMR_EQCFG_FLAT (0x0u << 24) /**< \brief (CLASSD_INTPMR) Flat Response */ +#define CLASSD_INTPMR_EQCFG_BBOOST12 (0x1u << 24) /**< \brief (CLASSD_INTPMR) Bass boost +12 dB */ +#define CLASSD_INTPMR_EQCFG_BBOOST6 (0x2u << 24) /**< \brief (CLASSD_INTPMR) Bass boost +6 dB */ +#define CLASSD_INTPMR_EQCFG_BCUT12 (0x3u << 24) /**< \brief (CLASSD_INTPMR) Bass cut -12 dB */ +#define CLASSD_INTPMR_EQCFG_BCUT6 (0x4u << 24) /**< \brief (CLASSD_INTPMR) Bass cut -6 dB */ +#define CLASSD_INTPMR_EQCFG_MBOOST3 (0x5u << 24) /**< \brief (CLASSD_INTPMR) Medium boost +3 dB */ +#define CLASSD_INTPMR_EQCFG_MBOOST8 (0x6u << 24) /**< \brief (CLASSD_INTPMR) Medium boost +8 dB */ +#define CLASSD_INTPMR_EQCFG_MCUT3 (0x7u << 24) /**< \brief (CLASSD_INTPMR) Medium cut -3 dB */ +#define CLASSD_INTPMR_EQCFG_MCUT8 (0x8u << 24) /**< \brief (CLASSD_INTPMR) Medium cut -8 dB */ +#define CLASSD_INTPMR_EQCFG_TBOOST12 (0x9u << 24) /**< \brief (CLASSD_INTPMR) Treble boost +12 dB */ +#define CLASSD_INTPMR_EQCFG_TBOOST6 (0xAu << 24) /**< \brief (CLASSD_INTPMR) Treble boost +6 dB */ +#define CLASSD_INTPMR_EQCFG_TCUT12 (0xBu << 24) /**< \brief (CLASSD_INTPMR) Treble cut -12 dB */ +#define CLASSD_INTPMR_EQCFG_TCUT6 (0xCu << 24) /**< \brief (CLASSD_INTPMR) Treble cut -6 dB */ +#define CLASSD_INTPMR_MONO (0x1u << 28) /**< \brief (CLASSD_INTPMR) Mono Signal */ +#define CLASSD_INTPMR_MONO_DISABLED (0x0u << 28) /**< \brief (CLASSD_INTPMR) The signal is sent stereo to the left and right channels. */ +#define CLASSD_INTPMR_MONO_ENABLED (0x1u << 28) /**< \brief (CLASSD_INTPMR) The same signal is sent on both left and right channels. The sent signal is defined by the MONOMODE field value. */ +#define CLASSD_INTPMR_MONOMODE_Pos 29 +#define CLASSD_INTPMR_MONOMODE_Msk (0x3u << CLASSD_INTPMR_MONOMODE_Pos) /**< \brief (CLASSD_INTPMR) Mono Mode Selection */ +#define CLASSD_INTPMR_MONOMODE(value) ((CLASSD_INTPMR_MONOMODE_Msk & ((value) << CLASSD_INTPMR_MONOMODE_Pos))) +#define CLASSD_INTPMR_MONOMODE_MONOMIX (0x0u << 29) /**< \brief (CLASSD_INTPMR) (left + right) / 2 is sent on both channels */ +#define CLASSD_INTPMR_MONOMODE_MONOSAT (0x1u << 29) /**< \brief (CLASSD_INTPMR) (left + right) is sent to both channels. If the sum is too high, the result is saturated. */ +#define CLASSD_INTPMR_MONOMODE_MONOLEFT (0x2u << 29) /**< \brief (CLASSD_INTPMR) THR[15:0] is sent on both left and right channels */ +#define CLASSD_INTPMR_MONOMODE_MONORIGHT (0x3u << 29) /**< \brief (CLASSD_INTPMR) THR[31:16] is sent on both left and right channels */ +/* -------- CLASSD_INTSR : (CLASSD Offset: 0x0C) Interpolator Status Register -------- */ +#define CLASSD_INTSR_CFGERR (0x1u << 0) /**< \brief (CLASSD_INTSR) Configuration Error */ +/* -------- CLASSD_THR : (CLASSD Offset: 0x10) Transmit Holding Register -------- */ +#define CLASSD_THR_LDATA_Pos 0 +#define CLASSD_THR_LDATA_Msk (0xffffu << CLASSD_THR_LDATA_Pos) /**< \brief (CLASSD_THR) Left Channel Data */ +#define CLASSD_THR_LDATA(value) ((CLASSD_THR_LDATA_Msk & ((value) << CLASSD_THR_LDATA_Pos))) +#define CLASSD_THR_RDATA_Pos 16 +#define CLASSD_THR_RDATA_Msk (0xffffu << CLASSD_THR_RDATA_Pos) /**< \brief (CLASSD_THR) Right Channel Data */ +#define CLASSD_THR_RDATA(value) ((CLASSD_THR_RDATA_Msk & ((value) << CLASSD_THR_RDATA_Pos))) +/* -------- CLASSD_IER : (CLASSD Offset: 0x14) Interrupt Enable Register -------- */ +#define CLASSD_IER_DATRDY (0x1u << 0) /**< \brief (CLASSD_IER) Data Ready */ +/* -------- CLASSD_IDR : (CLASSD Offset: 0x18) Interrupt Disable Register -------- */ +#define CLASSD_IDR_DATRDY (0x1u << 0) /**< \brief (CLASSD_IDR) Data Ready */ +/* -------- CLASSD_IMR : (CLASSD Offset: 0x1C) Interrupt Mask Register -------- */ +#define CLASSD_IMR_DATRDY (0x1u << 0) /**< \brief (CLASSD_IMR) Data Ready */ +/* -------- CLASSD_ISR : (CLASSD Offset: 0x20) Interrupt Status Register -------- */ +#define CLASSD_ISR_DATRDY (0x1u << 0) /**< \brief (CLASSD_ISR) Data Ready */ +/* -------- CLASSD_WPMR : (CLASSD Offset: 0xE4) Write Protection Mode Register -------- */ +#define CLASSD_WPMR_WPEN (0x1u << 0) /**< \brief (CLASSD_WPMR) Write Protection Enable */ +#define CLASSD_WPMR_WPKEY_Pos 8 +#define CLASSD_WPMR_WPKEY_Msk (0xffffffu << CLASSD_WPMR_WPKEY_Pos) /**< \brief (CLASSD_WPMR) Write Protection Key */ +#define CLASSD_WPMR_WPKEY(value) ((CLASSD_WPMR_WPKEY_Msk & ((value) << CLASSD_WPMR_WPKEY_Pos))) +#define CLASSD_WPMR_WPKEY_PASSWD (0x434C44u << 8) /**< \brief (CLASSD_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- CLASSD_VERSION : (CLASSD Offset: 0xFC) IP Version Register -------- */ +#define CLASSD_VERSION_VERSION_Pos 0 +#define CLASSD_VERSION_VERSION_Msk (0xfffu << CLASSD_VERSION_VERSION_Pos) /**< \brief (CLASSD_VERSION) Version of the Hardware Module */ +#define CLASSD_VERSION_MFN_Pos 16 +#define CLASSD_VERSION_MFN_Msk (0x7u << CLASSD_VERSION_MFN_Pos) /**< \brief (CLASSD_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_CLASSD_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_flexcom.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_flexcom.h new file mode 100644 index 000000000..0ec719295 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_flexcom.h @@ -0,0 +1,1075 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_FLEXCOM_COMPONENT_ +#define _SAMA5D2_FLEXCOM_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Flexible Serial Communication */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_FLEXCOM Flexible Serial Communication */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) + +/** \brief Usart hardware registers */ +typedef struct { + __O uint32_t US_CR; /**< \brief (Flexcom Offset: 0x200) USART Control Register */ + __IO uint32_t US_MR; /**< \brief (Flexcom Offset: 0x204) USART Mode Register */ + __O uint32_t US_IER; /**< \brief (Flexcom Offset: 0x208) USART Interrupt Enable Register */ + __O uint32_t US_IDR; /**< \brief (Flexcom Offset: 0x20C) USART Interrupt Disable Register */ + __I uint32_t US_IMR; /**< \brief (Flexcom Offset: 0x210) USART Interrupt Mask Register */ + __I uint32_t US_CSR; /**< \brief (Flexcom Offset: 0x214) USART Channel Status Register */ + __I uint32_t US_RHR; /**< \brief (Flexcom Offset: 0x218) USART Receive Holding Register */ + __O uint32_t US_THR; /**< \brief (Flexcom Offset: 0x21C) USART Transmit Holding Register */ + __IO uint32_t US_BRGR; /**< \brief (Flexcom Offset: 0x220) USART Baud Rate Generator Register */ + __IO uint32_t US_RTOR; /**< \brief (Flexcom Offset: 0x224) USART Receiver Timeout Register */ + __IO uint32_t US_TTGR; /**< \brief (Flexcom Offset: 0x228) USART Transmitter Timeguard Register */ + __I uint32_t Reserved5[5]; + __IO uint32_t US_FIDI; /**< \brief (Flexcom Offset: 0x240) USART FI DI Ratio Register */ + __I uint32_t US_NER; /**< \brief (Flexcom Offset: 0x244) USART Number of Errors Register */ + __I uint32_t Reserved6[1]; + __IO uint32_t US_IF; /**< \brief (Flexcom Offset: 0x24C) USART IrDA Filter Register */ + __IO uint32_t US_MAN; /**< \brief (Flexcom Offset: 0x250) USART Manchester Configuration Register */ + __IO uint32_t US_LINMR; /**< \brief (Flexcom Offset: 0x254) USART LIN Mode Register */ + __IO uint32_t US_LINIR; /**< \brief (Flexcom Offset: 0x258) USART LIN Identifier Register */ + __I uint32_t US_LINBRR; /**< \brief (Flexcom Offset: 0x25C) USART LIN Baud Rate Register */ + __I uint32_t Reserved7[12]; + __IO uint32_t US_CMPR; /**< \brief (Flexcom Offset: 0x290) USART Comparison Register */ + __I uint32_t Reserved8[3]; + __IO uint32_t US_FMR; /**< \brief (Flexcom Offset: 0x2A0) USART FIFO Mode Register */ + __I uint32_t US_FLR; /**< \brief (Flexcom Offset: 0x2A4) USART FIFO Level Register */ + __O uint32_t US_FIER; /**< \brief (Flexcom Offset: 0x2A8) USART FIFO Interrupt Enable Register */ + __O uint32_t US_FIDR; /**< \brief (Flexcom Offset: 0x2AC) USART FIFO Interrupt Disable Register */ + __I uint32_t US_FIMR; /**< \brief (Flexcom Offset: 0x2B0) USART FIFO Interrupt Mask Register */ + __I uint32_t US_FESR; /**< \brief (Flexcom Offset: 0x2B4) USART FIFO Event Status Register */ + __I uint32_t Reserved9[11]; + __IO uint32_t US_WPMR; /**< \brief (Flexcom Offset: 0x2E4) USART Write Protection Mode Register */ + __I uint32_t US_WPSR; /**< \brief (Flexcom Offset: 0x2E8) USART Write Protection Status Register */ + __I uint32_t Reserved10[4]; + __I uint32_t US_VERSION; /**< \brief (Flexcom Offset: 0x2FC) USART Version Register */ +} Usart; + +/** \brief Spi hardware registers */ +typedef struct { + __O uint32_t SPI_CR; /**< \brief (Flexcom Offset: 0x400) SPI Control Register */ + __IO uint32_t SPI_MR; /**< \brief (Flexcom Offset: 0x404) SPI Mode Register */ + __I uint32_t SPI_RDR; /**< \brief (Flexcom Offset: 0x408) SPI Receive Data Register */ + __O uint32_t SPI_TDR; /**< \brief (Flexcom Offset: 0x40C) SPI Transmit Data Register */ + __I uint32_t SPI_SR; /**< \brief (Flexcom Offset: 0x410) SPI Status Register */ + __O uint32_t SPI_IER; /**< \brief (Flexcom Offset: 0x414) SPI Interrupt Enable Register */ + __O uint32_t SPI_IDR; /**< \brief (Flexcom Offset: 0x418) SPI Interrupt Disable Register */ + __I uint32_t SPI_IMR; /**< \brief (Flexcom Offset: 0x41C) SPI Interrupt Mask Register */ + __I uint32_t Reserved1[4]; + __IO uint32_t SPI_CSR[2]; /**< \brief (Flexcom Offset: 0x430) SPI Chip Select Register */ + __I uint32_t Reserved2[2]; + __IO uint32_t SPI_FMR; /**< \brief (Flexcom Offset: 0x440) SPI FIFO Mode Register */ + __I uint32_t SPI_FLR; /**< \brief (Flexcom Offset: 0x444) SPI FIFO Level Register */ + __IO uint32_t SPI_CMPR; /**< \brief (Flexcom Offset: 0x448) SPI Comparison Register */ + __I uint32_t Reserved3[38]; + __IO uint32_t SPI_WPMR; /**< \brief (Flexcom Offset: 0x4E4) SPI Write Protection Mode Register */ + __I uint32_t SPI_WPSR; /**< \brief (Flexcom Offset: 0x4E8) SPI Write Protection Status Register */ + __I uint32_t Reserved4[4]; + __I uint32_t SPI_VERSION; /**< \brief (Flexcom Offset: 0x4FC) SPI Version Register */ +} Spi; + +/** \brief Twi hardware registers */ +typedef struct { + __O uint32_t TWI_CR; /**< \brief (Flexcom Offset: 0x600) TWI Control Register */ + __IO uint32_t TWI_MMR; /**< \brief (Flexcom Offset: 0x604) TWI Master Mode Register */ + __IO uint32_t TWI_SMR; /**< \brief (Flexcom Offset: 0x608) TWI Slave Mode Register */ + __IO uint32_t TWI_IADR; /**< \brief (Flexcom Offset: 0x60C) TWI Internal Address Register */ + __IO uint32_t TWI_CWGR; /**< \brief (Flexcom Offset: 0x610) TWI Clock Waveform Generator Register */ + __I uint32_t Reserved17[3]; + __I uint32_t TWI_SR; /**< \brief (Flexcom Offset: 0x620) TWI Status Register */ + __O uint32_t TWI_IER; /**< \brief (Flexcom Offset: 0x624) TWI Interrupt Enable Register */ + __O uint32_t TWI_IDR; /**< \brief (Flexcom Offset: 0x628) TWI Interrupt Disable Register */ + __I uint32_t TWI_IMR; /**< \brief (Flexcom Offset: 0x62C) TWI Interrupt Mask Register */ + __I uint32_t TWI_RHR; /**< \brief (Flexcom Offset: 0x630) TWI Receive Holding Register */ + __O uint32_t TWI_THR; /**< \brief (Flexcom Offset: 0x634) TWI Transmit Holding Register */ + __IO uint32_t TWI_SMBTR; /**< \brief (Flexcom Offset: 0x638) TWI SMBus Timing Register */ + __I uint32_t Reserved18[1]; + __IO uint32_t TWI_ACR; /**< \brief (Flexcom Offset: 0x640) TWI Alternative Command Register */ + __IO uint32_t TWI_FILTR; /**< \brief (Flexcom Offset: 0x644) TWI Filter Register */ + __I uint32_t Reserved19[1]; + __IO uint32_t TWI_SWMR; /**< \brief (Flexcom Offset: 0x64C) TWI SleepWalking Matching Register */ + __IO uint32_t TWI_FMR; /**< \brief (Flexcom Offset: 0x650) TWI FIFO Mode Register */ + __I uint32_t TWI_FLR; /**< \brief (Flexcom Offset: 0x654) TWI FIFO Level Register */ + __I uint32_t Reserved20[2]; + __I uint32_t TWI_FSR; /**< \brief (Flexcom Offset: 0x660) TWI FIFO Status Register */ + __O uint32_t TWI_FIER; /**< \brief (Flexcom Offset: 0x664) TWI FIFO Interrupt Enable Register */ + __O uint32_t TWI_FIDR; /**< \brief (Flexcom Offset: 0x668) TWI FIFO Interrupt Disable Register */ + __I uint32_t TWI_FIMR; /**< \brief (Flexcom Offset: 0x66C) TWI FIFO Interrupt Mask Register */ + __I uint32_t Reserved21[24]; + __I uint32_t TWI_DR; /**< \brief (Flexcom Offset: 0x6D0) TWI Debug Register */ + __I uint32_t Reserved22[4]; + __IO uint32_t TWI_WPMR; /**< \brief (Flexcom Offset: 0x6E4) TWI Protection Mode Register */ + __I uint32_t TWI_WPSR; /**< \brief (Flexcom Offset: 0x6E8) TWI Protection Status Register */ + __I uint32_t Reserved23[4]; + __I uint32_t TWI_VER; /**< \brief (Flexcom Offset: 0x6FC) TWI Version Register */ +} Twi; + +/** \brief Flexcom hardware registers */ +typedef struct { + __IO uint32_t FLEX_MR; /**< \brief (Flexcom Offset: 0x000) FLEXCOM Mode Register */ + __I uint32_t Reserved1[3]; + __I uint32_t FLEX_RHR; /**< \brief (Flexcom Offset: 0x010) FLEXCOM Receive Holding Register */ + __I uint32_t Reserved2[3]; + __IO uint32_t FLEX_THR; /**< \brief (Flexcom Offset: 0x020) FLEXCOM Transmit Holding Register */ + __I uint32_t Reserved3[54]; + __I uint32_t FLEX_VERSION; /**< \brief (Flexcom Offset: 0x0FC) FLEXCOM Version Register */ + __I uint32_t Reserved4[64]; + Usart usart; + __I uint32_t Reserved11[64]; + Spi spi; + __I uint32_t Reserved16[64]; + Twi twi; +} Flexcom; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- FLEX_MR : (FLEXCOM Offset: 0x000) FLEXCOM Mode Register -------- */ +#define FLEX_MR_OPMODE_Pos 0 +#define FLEX_MR_OPMODE_Msk (0x3u << FLEX_MR_OPMODE_Pos) /**< \brief (FLEX_MR) FLEXCOM Operating Mode */ +#define FLEX_MR_OPMODE(value) ((FLEX_MR_OPMODE_Msk & ((value) << FLEX_MR_OPMODE_Pos))) +#define FLEX_MR_OPMODE_NO_COM (0x0u << 0) /**< \brief (FLEX_MR) No communication */ +#define FLEX_MR_OPMODE_USART (0x1u << 0) /**< \brief (FLEX_MR) All related UART related protocols are selected (RS232, RS485, IrDA, ISO7816, LIN,)All SPI/TWI related registers are not accessible and have no impact on IOs. */ +#define FLEX_MR_OPMODE_SPI (0x2u << 0) /**< \brief (FLEX_MR) SPI operating mode is selected.All USART/TWI related registers are not accessible and have no impact on IOs. */ +#define FLEX_MR_OPMODE_TWI (0x3u << 0) /**< \brief (FLEX_MR) All related TWI protocols are selected (TWI, SMBus). All USART/SPI related registers are not accessible and have no impact on IOs. */ +/* -------- FLEX_RHR : (FLEXCOM Offset: 0x010) FLEXCOM Receive Holding Register -------- */ +#define FLEX_RHR_RXDATA_Pos 0 +#define FLEX_RHR_RXDATA_Msk (0xffffu << FLEX_RHR_RXDATA_Pos) /**< \brief (FLEX_RHR) Receive Data */ +/* -------- FLEX_THR : (FLEXCOM Offset: 0x020) FLEXCOM Transmit Holding Register -------- */ +#define FLEX_THR_TXDATA_Pos 0 +#define FLEX_THR_TXDATA_Msk (0xffffu << FLEX_THR_TXDATA_Pos) /**< \brief (FLEX_THR) Transmit Data */ +#define FLEX_THR_TXDATA(value) ((FLEX_THR_TXDATA_Msk & ((value) << FLEX_THR_TXDATA_Pos))) +/* -------- FLEX_VERSION : (FLEXCOM Offset: 0x0FC) FLEXCOM Version Register -------- */ +#define FLEX_VERSION_VERSION_Pos 0 +#define FLEX_VERSION_VERSION_Msk (0xfffu << FLEX_VERSION_VERSION_Pos) /**< \brief (FLEX_VERSION) Hardware Module Version */ +#define FLEX_VERSION_MFN_Pos 16 +#define FLEX_VERSION_MFN_Msk (0x7u << FLEX_VERSION_MFN_Pos) /**< \brief (FLEX_VERSION) Metal Fix Number */ +/* -------- US_CR : (FLEXCOM Offset: 0x200) USART Control Register -------- */ +#define US_CR_RSTRX (0x1u << 2) /**< \brief (US_CR) Reset Receiver */ +#define US_CR_RSTTX (0x1u << 3) /**< \brief (US_CR) Reset Transmitter */ +#define US_CR_RXEN (0x1u << 4) /**< \brief (US_CR) Receiver Enable */ +#define US_CR_RXDIS (0x1u << 5) /**< \brief (US_CR) Receiver Disable */ +#define US_CR_TXEN (0x1u << 6) /**< \brief (US_CR) Transmitter Enable */ +#define US_CR_TXDIS (0x1u << 7) /**< \brief (US_CR) Transmitter Disable */ +#define US_CR_RSTSTA (0x1u << 8) /**< \brief (US_CR) Reset Status Bits */ +#define US_CR_STTBRK (0x1u << 9) /**< \brief (US_CR) Start Break */ +#define US_CR_STPBRK (0x1u << 10) /**< \brief (US_CR) Stop Break */ +#define US_CR_STTTO (0x1u << 11) /**< \brief (US_CR) Clear TIMEOUT Flag and Start Time-out After Next Character Received */ +#define US_CR_SENDA (0x1u << 12) /**< \brief (US_CR) Send Address */ +#define US_CR_RSTIT (0x1u << 13) /**< \brief (US_CR) Reset Iterations */ +#define US_CR_RSTNACK (0x1u << 14) /**< \brief (US_CR) Reset Non Acknowledge */ +#define US_CR_RETTO (0x1u << 15) /**< \brief (US_CR) Start Time-out Immediately */ +#define US_CR_RTSEN (0x1u << 18) /**< \brief (US_CR) Request to Send Enable */ +#define US_CR_RTSDIS (0x1u << 19) /**< \brief (US_CR) Request to Send Disable */ +#define US_CR_LINABT (0x1u << 20) /**< \brief (US_CR) Abort LIN Transmission */ +#define US_CR_LINWKUP (0x1u << 21) /**< \brief (US_CR) Send LIN Wake-up Signal */ +#define US_CR_TXFCLR (0x1u << 24) /**< \brief (US_CR) Transmit FIFO Clear */ +#define US_CR_RXFCLR (0x1u << 25) /**< \brief (US_CR) Receive FIFO Clear */ +#define US_CR_TXFLCLR (0x1u << 26) /**< \brief (US_CR) Transmit FIFO Lock CLEAR */ +#define US_CR_REQCLR (0x1u << 28) /**< \brief (US_CR) Request to Clear the Comparison Trigger */ +#define US_CR_FIFOEN (0x1u << 30) /**< \brief (US_CR) FIFO Enable */ +#define US_CR_FIFODIS (0x1u << 31) /**< \brief (US_CR) FIFO Disable */ +/* -------- US_MR : (FLEXCOM Offset: 0x204) USART Mode Register -------- */ +#define US_MR_USART_MODE_Pos 0 +#define US_MR_USART_MODE_Msk (0xfu << US_MR_USART_MODE_Pos) /**< \brief (US_MR) USART Mode of Operation */ +#define US_MR_USART_MODE(value) ((US_MR_USART_MODE_Msk & ((value) << US_MR_USART_MODE_Pos))) +#define US_MR_USART_MODE_NORMAL (0x0u << 0) /**< \brief (US_MR) Normal mode */ +#define US_MR_USART_MODE_RS485 (0x1u << 0) /**< \brief (US_MR) RS485 */ +#define US_MR_USART_MODE_HW_HANDSHAKING (0x2u << 0) /**< \brief (US_MR) Hardware Handshaking */ +#define US_MR_USART_MODE_IS07816_T_0 (0x4u << 0) /**< \brief (US_MR) IS07816 Protocol: T = 0 */ +#define US_MR_USART_MODE_IS07816_T_1 (0x6u << 0) /**< \brief (US_MR) IS07816 Protocol: T = 1 */ +#define US_MR_USART_MODE_IRDA (0x8u << 0) /**< \brief (US_MR) IrDA */ +#define US_MR_USART_MODE_LIN_MASTER (0xAu << 0) /**< \brief (US_MR) LIN master */ +#define US_MR_USART_MODE_LIN_SLAVE (0xBu << 0) /**< \brief (US_MR) LIN Slave */ +#define US_MR_USCLKS_Pos 4 +#define US_MR_USCLKS_Msk (0x3u << US_MR_USCLKS_Pos) /**< \brief (US_MR) Clock Selection */ +#define US_MR_USCLKS(value) ((US_MR_USCLKS_Msk & ((value) << US_MR_USCLKS_Pos))) +#define US_MR_USCLKS_MCK (0x0u << 4) /**< \brief (US_MR) Peripheral clock is selected */ +#define US_MR_USCLKS_DIV (0x1u << 4) /**< \brief (US_MR) Peripheral clock divided (DIV = 8) is selected */ +#define US_MR_USCLKS_PMC_PCK (0x2u << 4) /**< \brief (US_MR) PMC programmable clock is selected. If the SCK pin is driven (CLKO = 1), the CD field must be greater than 1. */ +#define US_MR_USCLKS_SCK (0x3u << 4) /**< \brief (US_MR) External pin SCK is selected */ +#define US_MR_CHRL_Pos 6 +#define US_MR_CHRL_Msk (0x3u << US_MR_CHRL_Pos) /**< \brief (US_MR) Character Length */ +#define US_MR_CHRL(value) ((US_MR_CHRL_Msk & ((value) << US_MR_CHRL_Pos))) +#define US_MR_CHRL_5_BIT (0x0u << 6) /**< \brief (US_MR) Character length is 5 bits */ +#define US_MR_CHRL_6_BIT (0x1u << 6) /**< \brief (US_MR) Character length is 6 bits */ +#define US_MR_CHRL_7_BIT (0x2u << 6) /**< \brief (US_MR) Character length is 7 bits */ +#define US_MR_CHRL_8_BIT (0x3u << 6) /**< \brief (US_MR) Character length is 8 bits */ +#define US_MR_SYNC (0x1u << 8) /**< \brief (US_MR) Synchronous Mode Select */ +#define US_MR_PAR_Pos 9 +#define US_MR_PAR_Msk (0x7u << US_MR_PAR_Pos) /**< \brief (US_MR) Parity Type */ +#define US_MR_PAR(value) ((US_MR_PAR_Msk & ((value) << US_MR_PAR_Pos))) +#define US_MR_PAR_EVEN (0x0u << 9) /**< \brief (US_MR) Even parity */ +#define US_MR_PAR_ODD (0x1u << 9) /**< \brief (US_MR) Odd parity */ +#define US_MR_PAR_SPACE (0x2u << 9) /**< \brief (US_MR) Parity forced to 0 (Space) */ +#define US_MR_PAR_MARK (0x3u << 9) /**< \brief (US_MR) Parity forced to 1 (Mark) */ +#define US_MR_PAR_NO (0x4u << 9) /**< \brief (US_MR) No parity */ +#define US_MR_PAR_MULTIDROP (0x6u << 9) /**< \brief (US_MR) Multidrop mode */ +#define US_MR_NBSTOP_Pos 12 +#define US_MR_NBSTOP_Msk (0x3u << US_MR_NBSTOP_Pos) /**< \brief (US_MR) Number of Stop Bits */ +#define US_MR_NBSTOP(value) ((US_MR_NBSTOP_Msk & ((value) << US_MR_NBSTOP_Pos))) +#define US_MR_NBSTOP_1_BIT (0x0u << 12) /**< \brief (US_MR) 1 stop bit */ +#define US_MR_NBSTOP_1_5_BIT (0x1u << 12) /**< \brief (US_MR) 1.5 stop bit (SYNC = 0) or reserved (SYNC = 1) */ +#define US_MR_NBSTOP_2_BIT (0x2u << 12) /**< \brief (US_MR) 2 stop bits */ +#define US_MR_CHMODE_Pos 14 +#define US_MR_CHMODE_Msk (0x3u << US_MR_CHMODE_Pos) /**< \brief (US_MR) Channel Mode */ +#define US_MR_CHMODE(value) ((US_MR_CHMODE_Msk & ((value) << US_MR_CHMODE_Pos))) +#define US_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (US_MR) Normal mode */ +#define US_MR_CHMODE_AUTOMATIC (0x1u << 14) /**< \brief (US_MR) Automatic Echo. Receiver input is connected to the TXD pin. */ +#define US_MR_CHMODE_LOCAL_LOOPBACK (0x2u << 14) /**< \brief (US_MR) Local Loopback. Transmitter output is connected to the Receiver Input. */ +#define US_MR_CHMODE_REMOTE_LOOPBACK (0x3u << 14) /**< \brief (US_MR) Remote Loopback. RXD pin is internally connected to the TXD pin. */ +#define US_MR_MSBF (0x1u << 16) /**< \brief (US_MR) Bit Order */ +#define US_MR_MODE9 (0x1u << 17) /**< \brief (US_MR) 9-bit Character Length */ +#define US_MR_CLKO (0x1u << 18) /**< \brief (US_MR) Clock Output Select */ +#define US_MR_OVER (0x1u << 19) /**< \brief (US_MR) Oversampling Mode */ +#define US_MR_INACK (0x1u << 20) /**< \brief (US_MR) Inhibit Non Acknowledge */ +#define US_MR_DSNACK (0x1u << 21) /**< \brief (US_MR) Disable Successive NACK */ +#define US_MR_VAR_SYNC (0x1u << 22) /**< \brief (US_MR) Variable Synchronization of Command/Data Sync Start Frame Delimiter */ +#define US_MR_INVDATA (0x1u << 23) /**< \brief (US_MR) Inverted Data */ +#define US_MR_MAX_ITERATION_Pos 24 +#define US_MR_MAX_ITERATION_Msk (0x7u << US_MR_MAX_ITERATION_Pos) /**< \brief (US_MR) Maximum Number of Automatic Iteration */ +#define US_MR_MAX_ITERATION(value) ((US_MR_MAX_ITERATION_Msk & ((value) << US_MR_MAX_ITERATION_Pos))) +#define US_MR_FILTER (0x1u << 28) /**< \brief (US_MR) Receive Line Filter */ +#define US_MR_MAN (0x1u << 29) /**< \brief (US_MR) Manchester Encoder/Decoder Enable */ +#define US_MR_MODSYNC (0x1u << 30) /**< \brief (US_MR) Manchester Synchronization Mode */ +#define US_MR_ONEBIT (0x1u << 31) /**< \brief (US_MR) Start Frame Delimiter Selector */ +/* -------- US_IER : (FLEXCOM Offset: 0x208) USART Interrupt Enable Register -------- */ +#define US_IER_RXRDY (0x1u << 0) /**< \brief (US_IER) RXRDY Interrupt Enable */ +#define US_IER_TXRDY (0x1u << 1) /**< \brief (US_IER) TXRDY Interrupt Enable */ +#define US_IER_RXBRK (0x1u << 2) /**< \brief (US_IER) Receiver Break Interrupt Enable */ +#define US_IER_OVRE (0x1u << 5) /**< \brief (US_IER) Overrun Error Interrupt Enable */ +#define US_IER_FRAME (0x1u << 6) /**< \brief (US_IER) Framing Error Interrupt Enable */ +#define US_IER_PARE (0x1u << 7) /**< \brief (US_IER) Parity Error Interrupt Enable */ +#define US_IER_TIMEOUT (0x1u << 8) /**< \brief (US_IER) Timeout Interrupt Enable */ +#define US_IER_TXEMPTY (0x1u << 9) /**< \brief (US_IER) TXEMPTY Interrupt Enable */ +#define US_IER_ITER (0x1u << 10) /**< \brief (US_IER) Max number of Repetitions Reached Interrupt Enable */ +#define US_IER_NACK (0x1u << 13) /**< \brief (US_IER) Non Acknowledge Interrupt Enable */ +#define US_IER_CTSIC (0x1u << 19) /**< \brief (US_IER) Clear to Send Input Change Interrupt Enable */ +#define US_IER_CMP (0x1u << 22) /**< \brief (US_IER) Comparison Interrupt Enable */ +#define US_IER_MANE (0x1u << 24) /**< \brief (US_IER) Manchester Error Interrupt Enable */ +#define US_IER_LINBK (0x1u << 13) /**< \brief (US_IER) LIN Break Sent or LIN Break Received Interrupt Enable */ +#define US_IER_LINID (0x1u << 14) /**< \brief (US_IER) LIN Identifier Sent or LIN Identifier Received Interrupt Enable */ +#define US_IER_LINTC (0x1u << 15) /**< \brief (US_IER) LIN Transfer Completed Interrupt Enable */ +#define US_IER_LINBE (0x1u << 25) /**< \brief (US_IER) LIN Bus Error Interrupt Enable */ +#define US_IER_LINISFE (0x1u << 26) /**< \brief (US_IER) LIN Inconsistent Synch Field Error Interrupt Enable */ +#define US_IER_LINIPE (0x1u << 27) /**< \brief (US_IER) LIN Identifier Parity Interrupt Enable */ +#define US_IER_LINCE (0x1u << 28) /**< \brief (US_IER) LIN Checksum Error Interrupt Enable */ +#define US_IER_LINSNRE (0x1u << 29) /**< \brief (US_IER) LIN Slave Not Responding Error Interrupt Enable */ +#define US_IER_LINSTE (0x1u << 30) /**< \brief (US_IER) LIN Synch Tolerance Error Interrupt Enable */ +#define US_IER_LINHTE (0x1u << 31) /**< \brief (US_IER) LIN Header Timeout Error Interrupt Enable */ +/* -------- US_IDR : (FLEXCOM Offset: 0x20C) USART Interrupt Disable Register -------- */ +#define US_IDR_RXRDY (0x1u << 0) /**< \brief (US_IDR) RXRDY Interrupt Disable */ +#define US_IDR_TXRDY (0x1u << 1) /**< \brief (US_IDR) TXRDY Interrupt Disable */ +#define US_IDR_RXBRK (0x1u << 2) /**< \brief (US_IDR) Receiver Break Interrupt Disable */ +#define US_IDR_OVRE (0x1u << 5) /**< \brief (US_IDR) Overrun Error Interrupt Enable */ +#define US_IDR_FRAME (0x1u << 6) /**< \brief (US_IDR) Framing Error Interrupt Disable */ +#define US_IDR_PARE (0x1u << 7) /**< \brief (US_IDR) Parity Error Interrupt Disable */ +#define US_IDR_TIMEOUT (0x1u << 8) /**< \brief (US_IDR) Timeout Interrupt Disable */ +#define US_IDR_TXEMPTY (0x1u << 9) /**< \brief (US_IDR) TXEMPTY Interrupt Disable */ +#define US_IDR_ITER (0x1u << 10) /**< \brief (US_IDR) Max Number of Repetitions Reached Interrupt Disable */ +#define US_IDR_NACK (0x1u << 13) /**< \brief (US_IDR) Non Acknowledge Interrupt Disable */ +#define US_IDR_CTSIC (0x1u << 19) /**< \brief (US_IDR) Clear to Send Input Change Interrupt Disable */ +#define US_IDR_CMP (0x1u << 22) /**< \brief (US_IDR) Comparison Interrupt Disable */ +#define US_IDR_MANE (0x1u << 24) /**< \brief (US_IDR) Manchester Error Interrupt Disable */ +#define US_IDR_LINBK (0x1u << 13) /**< \brief (US_IDR) LIN Break Sent or LIN Break Received Interrupt Disable */ +#define US_IDR_LINID (0x1u << 14) /**< \brief (US_IDR) LIN Identifier Sent or LIN Identifier Received Interrupt Disable */ +#define US_IDR_LINTC (0x1u << 15) /**< \brief (US_IDR) LIN Transfer Completed Interrupt Disable */ +#define US_IDR_LINBE (0x1u << 25) /**< \brief (US_IDR) LIN Bus Error Interrupt Disable */ +#define US_IDR_LINISFE (0x1u << 26) /**< \brief (US_IDR) LIN Inconsistent Synch Field Error Interrupt Disable */ +#define US_IDR_LINIPE (0x1u << 27) /**< \brief (US_IDR) LIN Identifier Parity Interrupt Disable */ +#define US_IDR_LINCE (0x1u << 28) /**< \brief (US_IDR) LIN Checksum Error Interrupt Disable */ +#define US_IDR_LINSNRE (0x1u << 29) /**< \brief (US_IDR) LIN Slave Not Responding Error Interrupt Disable */ +#define US_IDR_LINSTE (0x1u << 30) /**< \brief (US_IDR) LIN Synch Tolerance Error Interrupt Disable */ +#define US_IDR_LINHTE (0x1u << 31) /**< \brief (US_IDR) LIN Header Timeout Error Interrupt Disable */ +/* -------- US_IMR : (FLEXCOM Offset: 0x210) USART Interrupt Mask Register -------- */ +#define US_IMR_RXRDY (0x1u << 0) /**< \brief (US_IMR) RXRDY Interrupt Mask */ +#define US_IMR_TXRDY (0x1u << 1) /**< \brief (US_IMR) TXRDY Interrupt Mask */ +#define US_IMR_RXBRK (0x1u << 2) /**< \brief (US_IMR) Receiver Break Interrupt Mask */ +#define US_IMR_OVRE (0x1u << 5) /**< \brief (US_IMR) Overrun Error Interrupt Mask */ +#define US_IMR_FRAME (0x1u << 6) /**< \brief (US_IMR) Framing Error Interrupt Mask */ +#define US_IMR_PARE (0x1u << 7) /**< \brief (US_IMR) Parity Error Interrupt Mask */ +#define US_IMR_TIMEOUT (0x1u << 8) /**< \brief (US_IMR) Timeout Interrupt Mask */ +#define US_IMR_TXEMPTY (0x1u << 9) /**< \brief (US_IMR) TXEMPTY Interrupt Mask */ +#define US_IMR_ITER (0x1u << 10) /**< \brief (US_IMR) Max Number of Repetitions Reached Interrupt Mask */ +#define US_IMR_NACK (0x1u << 13) /**< \brief (US_IMR) Non Acknowledge Interrupt Mask */ +#define US_IMR_CTSIC (0x1u << 19) /**< \brief (US_IMR) Clear to Send Input Change Interrupt Mask */ +#define US_IMR_CMP (0x1u << 22) /**< \brief (US_IMR) Comparison Interrupt Mask */ +#define US_IMR_MANE (0x1u << 24) /**< \brief (US_IMR) Manchester Error Interrupt Mask */ +#define US_IMR_LINBK (0x1u << 13) /**< \brief (US_IMR) LIN Break Sent or LIN Break Received Interrupt Mask */ +#define US_IMR_LINID (0x1u << 14) /**< \brief (US_IMR) LIN Identifier Sent or LIN Identifier Received Interrupt Mask */ +#define US_IMR_LINTC (0x1u << 15) /**< \brief (US_IMR) LIN Transfer Completed Interrupt Mask */ +#define US_IMR_LINBE (0x1u << 25) /**< \brief (US_IMR) LIN Bus Error Interrupt Mask */ +#define US_IMR_LINISFE (0x1u << 26) /**< \brief (US_IMR) LIN Inconsistent Synch Field Error Interrupt Mask */ +#define US_IMR_LINIPE (0x1u << 27) /**< \brief (US_IMR) LIN Identifier Parity Interrupt Mask */ +#define US_IMR_LINCE (0x1u << 28) /**< \brief (US_IMR) LIN Checksum Error Interrupt Mask */ +#define US_IMR_LINSNRE (0x1u << 29) /**< \brief (US_IMR) LIN Slave Not Responding Error Interrupt Mask */ +#define US_IMR_LINSTE (0x1u << 30) /**< \brief (US_IMR) LIN Synch Tolerance Error Interrupt Mask */ +#define US_IMR_LINHTE (0x1u << 31) /**< \brief (US_IMR) LIN Header Timeout Error Interrupt Mask */ +/* -------- US_CSR : (FLEXCOM Offset: 0x214) USART Channel Status Register -------- */ +#define US_CSR_RXRDY (0x1u << 0) /**< \brief (US_CSR) Receiver Ready (cleared by reading US_RHR) */ +#define US_CSR_TXRDY (0x1u << 1) /**< \brief (US_CSR) Transmitter Ready (cleared by writing US_THR) */ +#define US_CSR_RXBRK (0x1u << 2) /**< \brief (US_CSR) Break Received/End of Break */ +#define US_CSR_OVRE (0x1u << 5) /**< \brief (US_CSR) Overrun Error */ +#define US_CSR_FRAME (0x1u << 6) /**< \brief (US_CSR) Framing Error */ +#define US_CSR_PARE (0x1u << 7) /**< \brief (US_CSR) Parity Error */ +#define US_CSR_TIMEOUT (0x1u << 8) /**< \brief (US_CSR) Receiver Timeout */ +#define US_CSR_TXEMPTY (0x1u << 9) /**< \brief (US_CSR) Transmitter Empty (cleared by writing US_THR) */ +#define US_CSR_ITER (0x1u << 10) /**< \brief (US_CSR) Max Number of Repetitions Reached */ +#define US_CSR_NACK (0x1u << 13) /**< \brief (US_CSR) Non Acknowledge Interrupt */ +#define US_CSR_CTSIC (0x1u << 19) /**< \brief (US_CSR) Clear to Send Input Change Flag */ +#define US_CSR_CMP (0x1u << 22) /**< \brief (US_CSR) Comparison Status */ +#define US_CSR_CTS (0x1u << 23) /**< \brief (US_CSR) Image of CTS Input */ +#define US_CSR_MANE (0x1u << 24) /**< \brief (US_CSR) Manchester Error */ +#define US_CSR_LINBK (0x1u << 13) /**< \brief (US_CSR) LIN Break Sent or LIN Break Received */ +#define US_CSR_LINID (0x1u << 14) /**< \brief (US_CSR) LIN Identifier Sent or LIN Identifier Received */ +#define US_CSR_LINTC (0x1u << 15) /**< \brief (US_CSR) LIN Transfer Completed */ +#define US_CSR_LINBLS (0x1u << 23) /**< \brief (US_CSR) LIN Bus Line Status */ +#define US_CSR_LINBE (0x1u << 25) /**< \brief (US_CSR) LIN Bit Error */ +#define US_CSR_LINISFE (0x1u << 26) /**< \brief (US_CSR) LIN Inconsistent Synch Field Error */ +#define US_CSR_LINIPE (0x1u << 27) /**< \brief (US_CSR) LIN Identifier Parity Error */ +#define US_CSR_LINCE (0x1u << 28) /**< \brief (US_CSR) LIN Checksum Error */ +#define US_CSR_LINSNRE (0x1u << 29) /**< \brief (US_CSR) LIN Slave Not Responding Error */ +#define US_CSR_LINSTE (0x1u << 30) /**< \brief (US_CSR) LIN Synch Tolerance Error */ +#define US_CSR_LINHTE (0x1u << 31) /**< \brief (US_CSR) LIN Header Timeout Error */ +/* -------- US_RHR : (FLEXCOM Offset: 0x218) USART Receive Holding Register -------- */ +#define US_RHR_RXCHR_Pos 0 +#define US_RHR_RXCHR_Msk (0x1ffu << US_RHR_RXCHR_Pos) /**< \brief (US_RHR) Received Character */ +#define US_RHR_RXSYNH (0x1u << 15) /**< \brief (US_RHR) Received Sync */ +#define US_RHR_RXCHR0_Pos 0 +#define US_RHR_RXCHR0_Msk (0xffu << US_RHR_RXCHR0_Pos) /**< \brief (US_RHR) Received Character */ +#define US_RHR_RXCHR1_Pos 8 +#define US_RHR_RXCHR1_Msk (0xffu << US_RHR_RXCHR1_Pos) /**< \brief (US_RHR) Received Character */ +#define US_RHR_RXCHR2_Pos 16 +#define US_RHR_RXCHR2_Msk (0xffu << US_RHR_RXCHR2_Pos) /**< \brief (US_RHR) Received Character */ +#define US_RHR_RXCHR3_Pos 24 +#define US_RHR_RXCHR3_Msk (0xffu << US_RHR_RXCHR3_Pos) /**< \brief (US_RHR) Received Character */ +/* -------- US_THR : (FLEXCOM Offset: 0x21C) USART Transmit Holding Register -------- */ +#define US_THR_TXCHR_Pos 0 +#define US_THR_TXCHR_Msk (0x1ffu << US_THR_TXCHR_Pos) /**< \brief (US_THR) Character to be Transmitted */ +#define US_THR_TXCHR(value) ((US_THR_TXCHR_Msk & ((value) << US_THR_TXCHR_Pos))) +#define US_THR_TXSYNH (0x1u << 15) /**< \brief (US_THR) Sync Field to be Transmitted */ +#define US_THR_TXCHR0_Pos 0 +#define US_THR_TXCHR0_Msk (0xffu << US_THR_TXCHR0_Pos) /**< \brief (US_THR) Character to be Transmitted */ +#define US_THR_TXCHR0(value) ((US_THR_TXCHR0_Msk & ((value) << US_THR_TXCHR0_Pos))) +#define US_THR_TXCHR1_Pos 8 +#define US_THR_TXCHR1_Msk (0xffu << US_THR_TXCHR1_Pos) /**< \brief (US_THR) Character to be Transmitted */ +#define US_THR_TXCHR1(value) ((US_THR_TXCHR1_Msk & ((value) << US_THR_TXCHR1_Pos))) +#define US_THR_TXCHR2_Pos 16 +#define US_THR_TXCHR2_Msk (0xffu << US_THR_TXCHR2_Pos) /**< \brief (US_THR) Character to be Transmitted */ +#define US_THR_TXCHR2(value) ((US_THR_TXCHR2_Msk & ((value) << US_THR_TXCHR2_Pos))) +#define US_THR_TXCHR3_Pos 24 +#define US_THR_TXCHR3_Msk (0xffu << US_THR_TXCHR3_Pos) /**< \brief (US_THR) Character to be Transmitted */ +#define US_THR_TXCHR3(value) ((US_THR_TXCHR3_Msk & ((value) << US_THR_TXCHR3_Pos))) +/* -------- US_BRGR : (FLEXCOM Offset: 0x220) USART Baud Rate Generator Register -------- */ +#define US_BRGR_CD_Pos 0 +#define US_BRGR_CD_Msk (0xffffu << US_BRGR_CD_Pos) /**< \brief (US_BRGR) Clock Divider */ +#define US_BRGR_CD(value) ((US_BRGR_CD_Msk & ((value) << US_BRGR_CD_Pos))) +#define US_BRGR_FP_Pos 16 +#define US_BRGR_FP_Msk (0x7u << US_BRGR_FP_Pos) /**< \brief (US_BRGR) Fractional Part */ +#define US_BRGR_FP(value) ((US_BRGR_FP_Msk & ((value) << US_BRGR_FP_Pos))) +/* -------- US_RTOR : (FLEXCOM Offset: 0x224) USART Receiver Timeout Register -------- */ +#define US_RTOR_TO_Pos 0 +#define US_RTOR_TO_Msk (0x1ffffu << US_RTOR_TO_Pos) /**< \brief (US_RTOR) Timeout Value */ +#define US_RTOR_TO(value) ((US_RTOR_TO_Msk & ((value) << US_RTOR_TO_Pos))) +/* -------- US_TTGR : (FLEXCOM Offset: 0x228) USART Transmitter Timeguard Register -------- */ +#define US_TTGR_TG_Pos 0 +#define US_TTGR_TG_Msk (0xffu << US_TTGR_TG_Pos) /**< \brief (US_TTGR) Timeguard Value */ +#define US_TTGR_TG(value) ((US_TTGR_TG_Msk & ((value) << US_TTGR_TG_Pos))) +/* -------- US_FIDI : (FLEXCOM Offset: 0x240) USART FI DI Ratio Register -------- */ +#define US_FIDI_FI_DI_RATIO_Pos 0 +#define US_FIDI_FI_DI_RATIO_Msk (0xffffu << US_FIDI_FI_DI_RATIO_Pos) /**< \brief (US_FIDI) FI Over DI Ratio Value */ +#define US_FIDI_FI_DI_RATIO(value) ((US_FIDI_FI_DI_RATIO_Msk & ((value) << US_FIDI_FI_DI_RATIO_Pos))) +/* -------- US_NER : (FLEXCOM Offset: 0x244) USART Number of Errors Register -------- */ +#define US_NER_NB_ERRORS_Pos 0 +#define US_NER_NB_ERRORS_Msk (0xffu << US_NER_NB_ERRORS_Pos) /**< \brief (US_NER) Number of Errors */ +/* -------- US_IF : (FLEXCOM Offset: 0x24C) USART IrDA Filter Register -------- */ +#define US_IF_IRDA_FILTER_Pos 0 +#define US_IF_IRDA_FILTER_Msk (0xffu << US_IF_IRDA_FILTER_Pos) /**< \brief (US_IF) IrDA Filter */ +#define US_IF_IRDA_FILTER(value) ((US_IF_IRDA_FILTER_Msk & ((value) << US_IF_IRDA_FILTER_Pos))) +/* -------- US_MAN : (FLEXCOM Offset: 0x250) USART Manchester Configuration Register -------- */ +#define US_MAN_TX_PL_Pos 0 +#define US_MAN_TX_PL_Msk (0xfu << US_MAN_TX_PL_Pos) /**< \brief (US_MAN) Transmitter Preamble Length */ +#define US_MAN_TX_PL(value) ((US_MAN_TX_PL_Msk & ((value) << US_MAN_TX_PL_Pos))) +#define US_MAN_TX_PP_Pos 8 +#define US_MAN_TX_PP_Msk (0x3u << US_MAN_TX_PP_Pos) /**< \brief (US_MAN) Transmitter Preamble Pattern */ +#define US_MAN_TX_PP(value) ((US_MAN_TX_PP_Msk & ((value) << US_MAN_TX_PP_Pos))) +#define US_MAN_TX_PP_ALL_ONE (0x0u << 8) /**< \brief (US_MAN) The preamble is composed of '1's */ +#define US_MAN_TX_PP_ALL_ZERO (0x1u << 8) /**< \brief (US_MAN) The preamble is composed of '0's */ +#define US_MAN_TX_PP_ZERO_ONE (0x2u << 8) /**< \brief (US_MAN) The preamble is composed of '01's */ +#define US_MAN_TX_PP_ONE_ZERO (0x3u << 8) /**< \brief (US_MAN) The preamble is composed of '10's */ +#define US_MAN_TX_MPOL (0x1u << 12) /**< \brief (US_MAN) Transmitter Manchester Polarity */ +#define US_MAN_RX_PL_Pos 16 +#define US_MAN_RX_PL_Msk (0xfu << US_MAN_RX_PL_Pos) /**< \brief (US_MAN) Receiver Preamble Length */ +#define US_MAN_RX_PL(value) ((US_MAN_RX_PL_Msk & ((value) << US_MAN_RX_PL_Pos))) +#define US_MAN_RX_PP_Pos 24 +#define US_MAN_RX_PP_Msk (0x3u << US_MAN_RX_PP_Pos) /**< \brief (US_MAN) Receiver Preamble Pattern detected */ +#define US_MAN_RX_PP(value) ((US_MAN_RX_PP_Msk & ((value) << US_MAN_RX_PP_Pos))) +#define US_MAN_RX_PP_ALL_ONE (0x0u << 24) /**< \brief (US_MAN) The preamble is composed of '1's */ +#define US_MAN_RX_PP_ALL_ZERO (0x1u << 24) /**< \brief (US_MAN) The preamble is composed of '0's */ +#define US_MAN_RX_PP_ZERO_ONE (0x2u << 24) /**< \brief (US_MAN) The preamble is composed of '01's */ +#define US_MAN_RX_PP_ONE_ZERO (0x3u << 24) /**< \brief (US_MAN) The preamble is composed of '10's */ +#define US_MAN_RX_MPOL (0x1u << 28) /**< \brief (US_MAN) Receiver Manchester Polarity */ +#define US_MAN_ONE (0x1u << 29) /**< \brief (US_MAN) Must Be Set to 1 */ +#define US_MAN_DRIFT (0x1u << 30) /**< \brief (US_MAN) Drift Compensation */ +#define US_MAN_RXIDLEV (0x1u << 31) /**< \brief (US_MAN) Receiver Idle Value */ +/* -------- US_LINMR : (FLEXCOM Offset: 0x254) USART LIN Mode Register -------- */ +#define US_LINMR_NACT_Pos 0 +#define US_LINMR_NACT_Msk (0x3u << US_LINMR_NACT_Pos) /**< \brief (US_LINMR) LIN Node Action */ +#define US_LINMR_NACT(value) ((US_LINMR_NACT_Msk & ((value) << US_LINMR_NACT_Pos))) +#define US_LINMR_NACT_PUBLISH (0x0u << 0) /**< \brief (US_LINMR) The USART transmits the response. */ +#define US_LINMR_NACT_SUBSCRIBE (0x1u << 0) /**< \brief (US_LINMR) The USART receives the response. */ +#define US_LINMR_NACT_IGNORE (0x2u << 0) /**< \brief (US_LINMR) The USART does not transmit and does not receive the response. */ +#define US_LINMR_PARDIS (0x1u << 2) /**< \brief (US_LINMR) Parity Disable */ +#define US_LINMR_CHKDIS (0x1u << 3) /**< \brief (US_LINMR) Checksum Disable */ +#define US_LINMR_CHKTYP (0x1u << 4) /**< \brief (US_LINMR) Checksum Type */ +#define US_LINMR_DLM (0x1u << 5) /**< \brief (US_LINMR) Data Length Mode */ +#define US_LINMR_FSDIS (0x1u << 6) /**< \brief (US_LINMR) Frame Slot Mode Disable */ +#define US_LINMR_WKUPTYP (0x1u << 7) /**< \brief (US_LINMR) Wake-up Signal Type */ +#define US_LINMR_DLC_Pos 8 +#define US_LINMR_DLC_Msk (0xffu << US_LINMR_DLC_Pos) /**< \brief (US_LINMR) Data Length Control */ +#define US_LINMR_DLC(value) ((US_LINMR_DLC_Msk & ((value) << US_LINMR_DLC_Pos))) +#define US_LINMR_PDCM (0x1u << 16) /**< \brief (US_LINMR) DMAC Mode */ +#define US_LINMR_SYNCDIS (0x1u << 17) /**< \brief (US_LINMR) Synchronization Disable */ +/* -------- US_LINIR : (FLEXCOM Offset: 0x258) USART LIN Identifier Register -------- */ +#define US_LINIR_IDCHR_Pos 0 +#define US_LINIR_IDCHR_Msk (0xffu << US_LINIR_IDCHR_Pos) /**< \brief (US_LINIR) Identifier Character */ +#define US_LINIR_IDCHR(value) ((US_LINIR_IDCHR_Msk & ((value) << US_LINIR_IDCHR_Pos))) +/* -------- US_LINBRR : (FLEXCOM Offset: 0x25C) USART LIN Baud Rate Register -------- */ +#define US_LINBRR_LINCD_Pos 0 +#define US_LINBRR_LINCD_Msk (0xffffu << US_LINBRR_LINCD_Pos) /**< \brief (US_LINBRR) Clock Divider after Synchronization */ +#define US_LINBRR_LINFP_Pos 16 +#define US_LINBRR_LINFP_Msk (0x7u << US_LINBRR_LINFP_Pos) /**< \brief (US_LINBRR) Fractional Part after Synchronization */ +/* -------- US_CMPR : (FLEXCOM Offset: 0x290) USART Comparison Register -------- */ +#define US_CMPR_VAL1_Pos 0 +#define US_CMPR_VAL1_Msk (0x1ffu << US_CMPR_VAL1_Pos) /**< \brief (US_CMPR) First Comparison Value for Received Character */ +#define US_CMPR_VAL1(value) ((US_CMPR_VAL1_Msk & ((value) << US_CMPR_VAL1_Pos))) +#define US_CMPR_CMPMODE (0x1u << 12) /**< \brief (US_CMPR) Comparison Mode */ +#define US_CMPR_CMPMODE_FLAG_ONLY (0x0u << 12) /**< \brief (US_CMPR) Any character is received and comparison function drives CMP flag. */ +#define US_CMPR_CMPMODE_START_CONDITION (0x1u << 12) /**< \brief (US_CMPR) Comparison condition must be met to start reception. */ +#define US_CMPR_CMPPAR (0x1u << 14) /**< \brief (US_CMPR) Compare Parity */ +#define US_CMPR_VAL2_Pos 16 +#define US_CMPR_VAL2_Msk (0x1ffu << US_CMPR_VAL2_Pos) /**< \brief (US_CMPR) Second Comparison Value for Received Character */ +#define US_CMPR_VAL2(value) ((US_CMPR_VAL2_Msk & ((value) << US_CMPR_VAL2_Pos))) +/* -------- US_FMR : (FLEXCOM Offset: 0x2A0) USART FIFO Mode Register -------- */ +#define US_FMR_TXRDYM_Pos 0 +#define US_FMR_TXRDYM_Msk (0x3u << US_FMR_TXRDYM_Pos) /**< \brief (US_FMR) Transmitter Ready Mode */ +#define US_FMR_TXRDYM(value) ((US_FMR_TXRDYM_Msk & ((value) << US_FMR_TXRDYM_Pos))) +#define US_FMR_TXRDYM_ONE_DATA (0x0u << 0) /**< \brief (US_FMR) TXRDY will be at level '1' when at least one data can be written in the Transmit FIFO */ +#define US_FMR_TXRDYM_TWO_DATA (0x1u << 0) /**< \brief (US_FMR) TXRDY will be at level '1' when at least two data can be written in the Transmit FIFO */ +#define US_FMR_TXRDYM_FOUR_DATA (0x2u << 0) /**< \brief (US_FMR) TXRDY will be at level '1' when at least four data can be written in the Transmit FIFO */ +#define US_FMR_RXRDYM_Pos 4 +#define US_FMR_RXRDYM_Msk (0x3u << US_FMR_RXRDYM_Pos) /**< \brief (US_FMR) Receiver Ready Mode */ +#define US_FMR_RXRDYM(value) ((US_FMR_RXRDYM_Msk & ((value) << US_FMR_RXRDYM_Pos))) +#define US_FMR_RXRDYM_ONE_DATA (0x0u << 4) /**< \brief (US_FMR) RXRDY will be at level '1' when at least one unread data is in the Receive FIFO */ +#define US_FMR_RXRDYM_TWO_DATA (0x1u << 4) /**< \brief (US_FMR) RXRDY will be at level '1' when at least two unread data are in the Receive FIFO */ +#define US_FMR_RXRDYM_FOUR_DATA (0x2u << 4) /**< \brief (US_FMR) RXRDY will be at level '1' when at least four unread data are in the Receive FIFO */ +#define US_FMR_FRTSC (0x1u << 7) /**< \brief (US_FMR) FIFO RTS pin Control enable (Hardware Handshaking mode only) */ +#define US_FMR_TXFTHRES_Pos 8 +#define US_FMR_TXFTHRES_Msk (0x3fu << US_FMR_TXFTHRES_Pos) /**< \brief (US_FMR) Transmit FIFO Threshold */ +#define US_FMR_TXFTHRES(value) ((US_FMR_TXFTHRES_Msk & ((value) << US_FMR_TXFTHRES_Pos))) +#define US_FMR_RXFTHRES_Pos 16 +#define US_FMR_RXFTHRES_Msk (0x3fu << US_FMR_RXFTHRES_Pos) /**< \brief (US_FMR) Receive FIFO Threshold */ +#define US_FMR_RXFTHRES(value) ((US_FMR_RXFTHRES_Msk & ((value) << US_FMR_RXFTHRES_Pos))) +#define US_FMR_RXFTHRES2_Pos 24 +#define US_FMR_RXFTHRES2_Msk (0x3fu << US_FMR_RXFTHRES2_Pos) /**< \brief (US_FMR) Receive FIFO Threshold 2 */ +#define US_FMR_RXFTHRES2(value) ((US_FMR_RXFTHRES2_Msk & ((value) << US_FMR_RXFTHRES2_Pos))) +/* -------- US_FLR : (FLEXCOM Offset: 0x2A4) USART FIFO Level Register -------- */ +#define US_FLR_TXFL_Pos 0 +#define US_FLR_TXFL_Msk (0x3fu << US_FLR_TXFL_Pos) /**< \brief (US_FLR) Transmit FIFO Level */ +#define US_FLR_RXFL_Pos 16 +#define US_FLR_RXFL_Msk (0x3fu << US_FLR_RXFL_Pos) /**< \brief (US_FLR) Receive FIFO Level */ +/* -------- US_FIER : (FLEXCOM Offset: 0x2A8) USART FIFO Interrupt Enable Register -------- */ +#define US_FIER_TXFEF (0x1u << 0) /**< \brief (US_FIER) TXFEF Interrupt Enable */ +#define US_FIER_TXFFF (0x1u << 1) /**< \brief (US_FIER) TXFFF Interrupt Enable */ +#define US_FIER_TXFTHF (0x1u << 2) /**< \brief (US_FIER) TXFTHF Interrupt Enable */ +#define US_FIER_RXFEF (0x1u << 3) /**< \brief (US_FIER) RXFEF Interrupt Enable */ +#define US_FIER_RXFFF (0x1u << 4) /**< \brief (US_FIER) RXFFF Interrupt Enable */ +#define US_FIER_RXFTHF (0x1u << 5) /**< \brief (US_FIER) RXFTHF Interrupt Enable */ +#define US_FIER_TXFPTEF (0x1u << 6) /**< \brief (US_FIER) TXFPTEF Interrupt Enable */ +#define US_FIER_RXFPTEF (0x1u << 7) /**< \brief (US_FIER) RXFPTEF Interrupt Enable */ +#define US_FIER_RXFTHF2 (0x1u << 9) /**< \brief (US_FIER) RXFTHF2 Interrupt Enable */ +/* -------- US_FIDR : (FLEXCOM Offset: 0x2AC) USART FIFO Interrupt Disable Register -------- */ +#define US_FIDR_TXFEF (0x1u << 0) /**< \brief (US_FIDR) TXFEF Interrupt Disable */ +#define US_FIDR_TXFFF (0x1u << 1) /**< \brief (US_FIDR) TXFFF Interrupt Disable */ +#define US_FIDR_TXFTHF (0x1u << 2) /**< \brief (US_FIDR) TXFTHF Interrupt Disable */ +#define US_FIDR_RXFEF (0x1u << 3) /**< \brief (US_FIDR) RXFEF Interrupt Disable */ +#define US_FIDR_RXFFF (0x1u << 4) /**< \brief (US_FIDR) RXFFF Interrupt Disable */ +#define US_FIDR_RXFTHF (0x1u << 5) /**< \brief (US_FIDR) RXFTHF Interrupt Disable */ +#define US_FIDR_TXFPTEF (0x1u << 6) /**< \brief (US_FIDR) TXFPTEF Interrupt Disable */ +#define US_FIDR_RXFPTEF (0x1u << 7) /**< \brief (US_FIDR) RXFPTEF Interrupt Disable */ +#define US_FIDR_RXFTHF2 (0x1u << 9) /**< \brief (US_FIDR) RXFTHF2 Interrupt Disable */ +/* -------- US_FIMR : (FLEXCOM Offset: 0x2B0) USART FIFO Interrupt Mask Register -------- */ +#define US_FIMR_TXFEF (0x1u << 0) /**< \brief (US_FIMR) TXFEF Interrupt Mask */ +#define US_FIMR_TXFFF (0x1u << 1) /**< \brief (US_FIMR) TXFFF Interrupt Mask */ +#define US_FIMR_TXFTHF (0x1u << 2) /**< \brief (US_FIMR) TXFTHF Interrupt Mask */ +#define US_FIMR_RXFEF (0x1u << 3) /**< \brief (US_FIMR) RXFEF Interrupt Mask */ +#define US_FIMR_RXFFF (0x1u << 4) /**< \brief (US_FIMR) RXFFF Interrupt Mask */ +#define US_FIMR_RXFTHF (0x1u << 5) /**< \brief (US_FIMR) RXFTHF Interrupt Mask */ +#define US_FIMR_TXFPTEF (0x1u << 6) /**< \brief (US_FIMR) TXFPTEF Interrupt Mask */ +#define US_FIMR_RXFPTEF (0x1u << 7) /**< \brief (US_FIMR) RXFPTEF Interrupt Mask */ +#define US_FIMR_RXFTHF2 (0x1u << 9) /**< \brief (US_FIMR) RXFTHF2 Interrupt Mask */ +/* -------- US_FESR : (FLEXCOM Offset: 0x2B4) USART FIFO Event Status Register -------- */ +#define US_FESR_TXFEF (0x1u << 0) /**< \brief (US_FESR) Transmit FIFO Empty Flag (cleared by writing RSTSTA bit in US_CR) */ +#define US_FESR_TXFFF (0x1u << 1) /**< \brief (US_FESR) Transmit FIFO Full Flag (cleared by writing RSTSTA bit in US_CR) */ +#define US_FESR_TXFTHF (0x1u << 2) /**< \brief (US_FESR) Transmit FIFO Threshold Flag (cleared by writing RSTSTA bit in US_CR) */ +#define US_FESR_RXFEF (0x1u << 3) /**< \brief (US_FESR) Receive FIFO Empty Flag (cleared by writing RSTSTA bit in US_CR) */ +#define US_FESR_RXFFF (0x1u << 4) /**< \brief (US_FESR) Receive FIFO Full Flag (cleared by writing RSTSTA bit in US_CR) */ +#define US_FESR_RXFTHF (0x1u << 5) /**< \brief (US_FESR) Receive FIFO Threshold Flag (cleared by writing RSTSTA bit in US_CR) */ +#define US_FESR_TXFPTEF (0x1u << 6) /**< \brief (US_FESR) Transmit FIFO Pointer Error Flag */ +#define US_FESR_RXFPTEF (0x1u << 7) /**< \brief (US_FESR) Receive FIFO Pointer Error Flag */ +#define US_FESR_TXFLOCK (0x1u << 8) /**< \brief (US_FESR) Transmit FIFO Lock */ +#define US_FESR_RXFTHF2 (0x1u << 9) /**< \brief (US_FESR) Receive FIFO Threshold Flag 2 (cleared by writing RSTSTA bit in US_CR) */ +/* -------- US_WPMR : (FLEXCOM Offset: 0x2E4) USART Write Protection Mode Register -------- */ +#define US_WPMR_WPEN (0x1u << 0) /**< \brief (US_WPMR) Write Protection Enable */ +#define US_WPMR_WPKEY_Pos 8 +#define US_WPMR_WPKEY_Msk (0xffffffu << US_WPMR_WPKEY_Pos) /**< \brief (US_WPMR) Write Protection Key */ +#define US_WPMR_WPKEY(value) ((US_WPMR_WPKEY_Msk & ((value) << US_WPMR_WPKEY_Pos))) +#define US_WPMR_WPKEY_PASSWD (0x555341u << 8) /**< \brief (US_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ +/* -------- US_WPSR : (FLEXCOM Offset: 0x2E8) USART Write Protection Status Register -------- */ +#define US_WPSR_WPVS (0x1u << 0) /**< \brief (US_WPSR) Write Protection Violation Status */ +#define US_WPSR_WPVSRC_Pos 8 +#define US_WPSR_WPVSRC_Msk (0xffffu << US_WPSR_WPVSRC_Pos) /**< \brief (US_WPSR) Write Protection Violation Source */ +/* -------- US_VERSION : (FLEXCOM Offset: 0x2FC) USART Version Register -------- */ +#define US_VERSION_VERSION_Pos 0 +#define US_VERSION_VERSION_Msk (0xfffu << US_VERSION_VERSION_Pos) /**< \brief (US_VERSION) Hardware Module Version */ +#define US_VERSION_MFN_Pos 16 +#define US_VERSION_MFN_Msk (0x7u << US_VERSION_MFN_Pos) /**< \brief (US_VERSION) Metal Fix Number */ +/* -------- SPI_CR : (FLEXCOM Offset: 0x400) SPI Control Register -------- */ +#define SPI_CR_SPIEN (0x1u << 0) /**< \brief (SPI_CR) SPI Enable */ +#define SPI_CR_SPIDIS (0x1u << 1) /**< \brief (SPI_CR) SPI Disable */ +#define SPI_CR_SWRST (0x1u << 7) /**< \brief (SPI_CR) SPI Software Reset */ +#define SPI_CR_REQCLR (0x1u << 12) /**< \brief (SPI_CR) Request to Clear the Comparison Trigger */ +#define SPI_CR_TXFCLR (0x1u << 16) /**< \brief (SPI_CR) Transmit FIFO Clear */ +#define SPI_CR_RXFCLR (0x1u << 17) /**< \brief (SPI_CR) Receive FIFO Clear */ +#define SPI_CR_LASTXFER (0x1u << 24) /**< \brief (SPI_CR) Last Transfer */ +#define SPI_CR_FIFOEN (0x1u << 30) /**< \brief (SPI_CR) FIFO Enable */ +#define SPI_CR_FIFODIS (0x1u << 31) /**< \brief (SPI_CR) FIFO Disable */ +/* -------- SPI_MR : (FLEXCOM Offset: 0x404) SPI Mode Register -------- */ +#define SPI_MR_MSTR (0x1u << 0) /**< \brief (SPI_MR) Master/Slave Mode */ +#define SPI_MR_PS (0x1u << 1) /**< \brief (SPI_MR) Peripheral Select */ +#define SPI_MR_PCSDEC (0x1u << 2) /**< \brief (SPI_MR) Chip Select Decode */ +#define SPI_MR_BRSRCCLK (0x1u << 3) /**< \brief (SPI_MR) Bit Rate Source Clock */ +#define SPI_MR_BRSRCCLK_PERIPH_CLK (0x0u << 3) /**< \brief (SPI_MR) The peripheral clock is the source clock for the bit rate generation. */ +#define SPI_MR_BRSRCCLK_PMC_PCK (0x1u << 3) /**< \brief (SPI_MR) PMC PCKx is the source clock for the bit rate generation, thus the bit rate can be independent of the core/peripheral clock. */ +#define SPI_MR_MODFDIS (0x1u << 4) /**< \brief (SPI_MR) Mode Fault Detection */ +#define SPI_MR_WDRBT (0x1u << 5) /**< \brief (SPI_MR) Wait Data Read Before Transfer */ +#define SPI_MR_LLB (0x1u << 7) /**< \brief (SPI_MR) Local Loopback Enable */ +#define SPI_MR_CMPMODE (0x1u << 12) /**< \brief (SPI_MR) Comparison Mode */ +#define SPI_MR_CMPMODE_FLAG_ONLY (0x0u << 12) /**< \brief (SPI_MR) Any character is received and comparison function drives CMP flag. */ +#define SPI_MR_CMPMODE_START_CONDITION (0x1u << 12) /**< \brief (SPI_MR) Comparison condition must be met to start reception of all incoming characters until REQCLR is set. */ +#define SPI_MR_PCS_Pos 16 +#define SPI_MR_PCS_Msk (0xFu << SPI_MR_PCS_Pos) /**< \brief (SPI_MR) Peripheral Chip Select */ +#define SPI_MR_PCS(value) ((SPI_MR_PCS_Msk & ((value) << SPI_MR_PCS_Pos))) +#define SPI_MR_DLYBCS_Pos 24 +#define SPI_MR_DLYBCS_Msk (0xffu << SPI_MR_DLYBCS_Pos) /**< \brief (SPI_MR) Delay Between Chip Selects */ +#define SPI_MR_DLYBCS(value) ((SPI_MR_DLYBCS_Msk & ((value) << SPI_MR_DLYBCS_Pos))) +/* -------- SPI_RDR : (FLEXCOM Offset: 0x408) SPI Receive Data Register -------- */ +#define SPI_RDR_RD_Pos 0 +#define SPI_RDR_RD_Msk (0xffffu << SPI_RDR_RD_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_PCS_Pos 16 +#define SPI_RDR_PCS_Msk (0xfu << SPI_RDR_PCS_Pos) /**< \brief (SPI_RDR) Peripheral Chip Select */ +#define SPI_RDR_RD0_Pos 0 +#define SPI_RDR_RD0_Msk (0xffu << SPI_RDR_RD0_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD1_Pos 8 +#define SPI_RDR_RD1_Msk (0xffu << SPI_RDR_RD1_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD2_Pos 16 +#define SPI_RDR_RD2_Msk (0xffu << SPI_RDR_RD2_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD3_Pos 24 +#define SPI_RDR_RD3_Msk (0xffu << SPI_RDR_RD3_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD0_FIFO_MULTI_DATA_16_Pos 0 +#define SPI_RDR_RD0_FIFO_MULTI_DATA_16_Msk (0xffffu << SPI_RDR_RD0_FIFO_MULTI_DATA_16_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD1_FIFO_MULTI_DATA_16_Pos 16 +#define SPI_RDR_RD1_FIFO_MULTI_DATA_16_Msk (0xffffu << SPI_RDR_RD1_FIFO_MULTI_DATA_16_Pos) /**< \brief (SPI_RDR) Receive Data */ +/* -------- SPI_TDR : (FLEXCOM Offset: 0x40C) SPI Transmit Data Register -------- */ +#define SPI_TDR_TD_Pos 0 +#define SPI_TDR_TD_Msk (0xffffu << SPI_TDR_TD_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD(value) ((SPI_TDR_TD_Msk & ((value) << SPI_TDR_TD_Pos))) +#define SPI_TDR_PCS_Pos 16 +#define SPI_TDR_PCS_Msk (0xfu << SPI_TDR_PCS_Pos) /**< \brief (SPI_TDR) Peripheral Chip Select */ +#define SPI_TDR_PCS(value) ((SPI_TDR_PCS_Msk & ((value) << SPI_TDR_PCS_Pos))) +#define SPI_TDR_LASTXFER (0x1u << 24) /**< \brief (SPI_TDR) Last Transfer */ +#define SPI_TDR_TD0_Pos 0 +#define SPI_TDR_TD0_Msk (0xffffu << SPI_TDR_TD0_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD0(value) ((SPI_TDR_TD0_Msk & ((value) << SPI_TDR_TD0_Pos))) +#define SPI_TDR_TD1_Pos 16 +#define SPI_TDR_TD1_Msk (0xffffu << SPI_TDR_TD1_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD1(value) ((SPI_TDR_TD1_Msk & ((value) << SPI_TDR_TD1_Pos))) +/* -------- SPI_SR : (FLEXCOM Offset: 0x410) SPI Status Register -------- */ +#define SPI_SR_RDRF (0x1u << 0) /**< \brief (SPI_SR) Receive Data Register Full (cleared by reading SPI_RDR) */ +#define SPI_SR_TDRE (0x1u << 1) /**< \brief (SPI_SR) Transmit Data Register Empty (cleared by writing SPI_TDR) */ +#define SPI_SR_MODF (0x1u << 2) /**< \brief (SPI_SR) Mode Fault Error (cleared on read) */ +#define SPI_SR_OVRES (0x1u << 3) /**< \brief (SPI_SR) Overrun Error Status (cleared on read) */ +#define SPI_SR_NSSR (0x1u << 8) /**< \brief (SPI_SR) NSS Rising (cleared on read) */ +#define SPI_SR_TXEMPTY (0x1u << 9) /**< \brief (SPI_SR) Transmission Registers Empty (cleared by writing SPI_TDR) */ +#define SPI_SR_UNDES (0x1u << 10) /**< \brief (SPI_SR) Underrun Error Status (Slave mode Only) (cleared on read) */ +#define SPI_SR_CMP (0x1u << 11) /**< \brief (SPI_SR) Comparison Status (cleared on read) */ +#define SPI_SR_SPIENS (0x1u << 16) /**< \brief (SPI_SR) SPI Enable Status */ +#define SPI_SR_TXFEF (0x1u << 24) /**< \brief (SPI_SR) Transmit FIFO Empty Flag (cleared on read) */ +#define SPI_SR_TXFFF (0x1u << 25) /**< \brief (SPI_SR) Transmit FIFO Full Flag (cleared on read) */ +#define SPI_SR_TXFTHF (0x1u << 26) /**< \brief (SPI_SR) Transmit FIFO Threshold Flag (cleared on read) */ +#define SPI_SR_RXFEF (0x1u << 27) /**< \brief (SPI_SR) Receive FIFO Empty Flag */ +#define SPI_SR_RXFFF (0x1u << 28) /**< \brief (SPI_SR) Receive FIFO Full Flag */ +#define SPI_SR_RXFTHF (0x1u << 29) /**< \brief (SPI_SR) Receive FIFO Threshold Flag */ +#define SPI_SR_TXFPTEF (0x1u << 30) /**< \brief (SPI_SR) Transmit FIFO Pointer Error Flag */ +#define SPI_SR_RXFPTEF (0x1u << 31) /**< \brief (SPI_SR) Receive FIFO Pointer Error Flag */ +/* -------- SPI_IER : (FLEXCOM Offset: 0x414) SPI Interrupt Enable Register -------- */ +#define SPI_IER_RDRF (0x1u << 0) /**< \brief (SPI_IER) Receive Data Register Full Interrupt Enable */ +#define SPI_IER_TDRE (0x1u << 1) /**< \brief (SPI_IER) SPI Transmit Data Register Empty Interrupt Enable */ +#define SPI_IER_MODF (0x1u << 2) /**< \brief (SPI_IER) Mode Fault Error Interrupt Enable */ +#define SPI_IER_OVRES (0x1u << 3) /**< \brief (SPI_IER) Overrun Error Interrupt Enable */ +#define SPI_IER_NSSR (0x1u << 8) /**< \brief (SPI_IER) NSS Rising Interrupt Enable */ +#define SPI_IER_TXEMPTY (0x1u << 9) /**< \brief (SPI_IER) Transmission Registers Empty Enable */ +#define SPI_IER_UNDES (0x1u << 10) /**< \brief (SPI_IER) Underrun Error Interrupt Enable */ +#define SPI_IER_CMP (0x1u << 11) /**< \brief (SPI_IER) Comparison Interrupt Enable */ +#define SPI_IER_TXFEF (0x1u << 24) /**< \brief (SPI_IER) TXFEF Interrupt Enable */ +#define SPI_IER_TXFFF (0x1u << 25) /**< \brief (SPI_IER) TXFFF Interrupt Enable */ +#define SPI_IER_TXFTHF (0x1u << 26) /**< \brief (SPI_IER) TXFTHF Interrupt Enable */ +#define SPI_IER_RXFEF (0x1u << 27) /**< \brief (SPI_IER) RXFEF Interrupt Enable */ +#define SPI_IER_RXFFF (0x1u << 28) /**< \brief (SPI_IER) RXFFF Interrupt Enable */ +#define SPI_IER_RXFTHF (0x1u << 29) /**< \brief (SPI_IER) RXFTHF Interrupt Enable */ +#define SPI_IER_TXFPTEF (0x1u << 30) /**< \brief (SPI_IER) TXFPTEF Interrupt Enable */ +#define SPI_IER_RXFPTEF (0x1u << 31) /**< \brief (SPI_IER) RXFPTEF Interrupt Enable */ +/* -------- SPI_IDR : (FLEXCOM Offset: 0x418) SPI Interrupt Disable Register -------- */ +#define SPI_IDR_RDRF (0x1u << 0) /**< \brief (SPI_IDR) Receive Data Register Full Interrupt Disable */ +#define SPI_IDR_TDRE (0x1u << 1) /**< \brief (SPI_IDR) SPI Transmit Data Register Empty Interrupt Disable */ +#define SPI_IDR_MODF (0x1u << 2) /**< \brief (SPI_IDR) Mode Fault Error Interrupt Disable */ +#define SPI_IDR_OVRES (0x1u << 3) /**< \brief (SPI_IDR) Overrun Error Interrupt Disable */ +#define SPI_IDR_NSSR (0x1u << 8) /**< \brief (SPI_IDR) NSS Rising Interrupt Disable */ +#define SPI_IDR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IDR) Transmission Registers Empty Disable */ +#define SPI_IDR_UNDES (0x1u << 10) /**< \brief (SPI_IDR) Underrun Error Interrupt Disable */ +#define SPI_IDR_CMP (0x1u << 11) /**< \brief (SPI_IDR) Comparison Interrupt Disable */ +#define SPI_IDR_TXFEF (0x1u << 24) /**< \brief (SPI_IDR) TXFEF Interrupt Disable */ +#define SPI_IDR_TXFFF (0x1u << 25) /**< \brief (SPI_IDR) TXFFF Interrupt Disable */ +#define SPI_IDR_TXFTHF (0x1u << 26) /**< \brief (SPI_IDR) TXFTHF Interrupt Disable */ +#define SPI_IDR_RXFEF (0x1u << 27) /**< \brief (SPI_IDR) RXFEF Interrupt Disable */ +#define SPI_IDR_RXFFF (0x1u << 28) /**< \brief (SPI_IDR) RXFFF Interrupt Disable */ +#define SPI_IDR_RXFTHF (0x1u << 29) /**< \brief (SPI_IDR) RXFTHF Interrupt Disable */ +#define SPI_IDR_TXFPTEF (0x1u << 30) /**< \brief (SPI_IDR) TXFPTEF Interrupt Disable */ +#define SPI_IDR_RXFPTEF (0x1u << 31) /**< \brief (SPI_IDR) RXFPTEF Interrupt Disable */ +/* -------- SPI_IMR : (FLEXCOM Offset: 0x41C) SPI Interrupt Mask Register -------- */ +#define SPI_IMR_RDRF (0x1u << 0) /**< \brief (SPI_IMR) Receive Data Register Full Interrupt Mask */ +#define SPI_IMR_TDRE (0x1u << 1) /**< \brief (SPI_IMR) SPI Transmit Data Register Empty Interrupt Mask */ +#define SPI_IMR_MODF (0x1u << 2) /**< \brief (SPI_IMR) Mode Fault Error Interrupt Mask */ +#define SPI_IMR_OVRES (0x1u << 3) /**< \brief (SPI_IMR) Overrun Error Interrupt Mask */ +#define SPI_IMR_NSSR (0x1u << 8) /**< \brief (SPI_IMR) NSS Rising Interrupt Mask */ +#define SPI_IMR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IMR) Transmission Registers Empty Mask */ +#define SPI_IMR_UNDES (0x1u << 10) /**< \brief (SPI_IMR) Underrun Error Interrupt Mask */ +#define SPI_IMR_CMP (0x1u << 11) /**< \brief (SPI_IMR) Comparison Interrupt Mask */ +#define SPI_IMR_TXFEF (0x1u << 24) /**< \brief (SPI_IMR) TXFEF Interrupt Mask */ +#define SPI_IMR_TXFFF (0x1u << 25) /**< \brief (SPI_IMR) TXFFF Interrupt Mask */ +#define SPI_IMR_TXFTHF (0x1u << 26) /**< \brief (SPI_IMR) TXFTHF Interrupt Mask */ +#define SPI_IMR_RXFEF (0x1u << 27) /**< \brief (SPI_IMR) RXFEF Interrupt Mask */ +#define SPI_IMR_RXFFF (0x1u << 28) /**< \brief (SPI_IMR) RXFFF Interrupt Mask */ +#define SPI_IMR_RXFTHF (0x1u << 29) /**< \brief (SPI_IMR) RXFTHF Interrupt Mask */ +#define SPI_IMR_TXFPTEF (0x1u << 30) /**< \brief (SPI_IMR) TXFPTEF Interrupt Mask */ +#define SPI_IMR_RXFPTEF (0x1u << 31) /**< \brief (SPI_IMR) RXFPTEF Interrupt Mask */ +/* -------- SPI_CSR[2] : (FLEXCOM Offset: 0x430) SPI Chip Select Register -------- */ +#define SPI_CSR_CPOL (0x1u << 0) /**< \brief (SPI_CSR[2]) Clock Polarity */ +#define SPI_CSR_NCPHA (0x1u << 1) /**< \brief (SPI_CSR[2]) Clock Phase */ +#define SPI_CSR_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR[2]) Chip Select Not Active After Transfer (Ignored if CSAAT = 1) */ +#define SPI_CSR_CSAAT (0x1u << 3) /**< \brief (SPI_CSR[2]) Chip Select Active After Transfer */ +#define SPI_CSR_BITS_Pos 4 +#define SPI_CSR_BITS_Msk (0xfu << SPI_CSR_BITS_Pos) /**< \brief (SPI_CSR[2]) Bits Per Transfer */ +#define SPI_CSR_BITS(value) ((SPI_CSR_BITS_Msk & ((value) << SPI_CSR_BITS_Pos))) +#define SPI_CSR_BITS_8_BIT (0x0u << 4) /**< \brief (SPI_CSR[2]) 8 bits for transfer */ +#define SPI_CSR_BITS_9_BIT (0x1u << 4) /**< \brief (SPI_CSR[2]) 9 bits for transfer */ +#define SPI_CSR_BITS_10_BIT (0x2u << 4) /**< \brief (SPI_CSR[2]) 10 bits for transfer */ +#define SPI_CSR_BITS_11_BIT (0x3u << 4) /**< \brief (SPI_CSR[2]) 11 bits for transfer */ +#define SPI_CSR_BITS_12_BIT (0x4u << 4) /**< \brief (SPI_CSR[2]) 12 bits for transfer */ +#define SPI_CSR_BITS_13_BIT (0x5u << 4) /**< \brief (SPI_CSR[2]) 13 bits for transfer */ +#define SPI_CSR_BITS_14_BIT (0x6u << 4) /**< \brief (SPI_CSR[2]) 14 bits for transfer */ +#define SPI_CSR_BITS_15_BIT (0x7u << 4) /**< \brief (SPI_CSR[2]) 15 bits for transfer */ +#define SPI_CSR_BITS_16_BIT (0x8u << 4) /**< \brief (SPI_CSR[2]) 16 bits for transfer */ +#define SPI_CSR_SCBR_Pos 8 +#define SPI_CSR_SCBR_Msk (0xffu << SPI_CSR_SCBR_Pos) /**< \brief (SPI_CSR[2]) Serial Clock Bit Rate */ +#define SPI_CSR_SCBR(value) ((SPI_CSR_SCBR_Msk & ((value) << SPI_CSR_SCBR_Pos))) +#define SPI_CSR_DLYBS_Pos 16 +#define SPI_CSR_DLYBS_Msk (0xffu << SPI_CSR_DLYBS_Pos) /**< \brief (SPI_CSR[2]) Delay Before SPCK */ +#define SPI_CSR_DLYBS(value) ((SPI_CSR_DLYBS_Msk & ((value) << SPI_CSR_DLYBS_Pos))) +#define SPI_CSR_DLYBCT_Pos 24 +#define SPI_CSR_DLYBCT_Msk (0xffu << SPI_CSR_DLYBCT_Pos) /**< \brief (SPI_CSR[2]) Delay Between Consecutive Transfers */ +#define SPI_CSR_DLYBCT(value) ((SPI_CSR_DLYBCT_Msk & ((value) << SPI_CSR_DLYBCT_Pos))) +/* -------- SPI_FMR : (FLEXCOM Offset: 0x440) SPI FIFO Mode Register -------- */ +#define SPI_FMR_TXRDYM_Pos 0 +#define SPI_FMR_TXRDYM_Msk (0x3u << SPI_FMR_TXRDYM_Pos) /**< \brief (SPI_FMR) Transmitter Data Register Empty Mode */ +#define SPI_FMR_TXRDYM(value) ((SPI_FMR_TXRDYM_Msk & ((value) << SPI_FMR_TXRDYM_Pos))) +#define SPI_FMR_TXRDYM_ONE_DATA (0x0u << 0) /**< \brief (SPI_FMR) TDRE will be at level '1' when at least one data can be written in the Transmit FIFO. */ +#define SPI_FMR_TXRDYM_TWO_DATA (0x1u << 0) /**< \brief (SPI_FMR) TDRE will be at level '1' when at least two data can be written in the Transmit FIFO. */ +#define SPI_FMR_TXRDYM_FOUR_DATA (0x2u << 0) /**< \brief (SPI_FMR) TDRE will be at level '1' when at least four data can be written in the Transmit FIFO. */ +#define SPI_FMR_RXRDYM_Pos 4 +#define SPI_FMR_RXRDYM_Msk (0x3u << SPI_FMR_RXRDYM_Pos) /**< \brief (SPI_FMR) Receiver Data Register Full Mode */ +#define SPI_FMR_RXRDYM(value) ((SPI_FMR_RXRDYM_Msk & ((value) << SPI_FMR_RXRDYM_Pos))) +#define SPI_FMR_RXRDYM_ONE_DATA (0x0u << 4) /**< \brief (SPI_FMR) RDRF will be at level '1' when at least one unread data is in the Receive FIFO. */ +#define SPI_FMR_RXRDYM_TWO_DATA (0x1u << 4) /**< \brief (SPI_FMR) RDRF will be at level '1' when at least two unread data are in the Receive FIFO. */ +#define SPI_FMR_RXRDYM_FOUR_DATA (0x2u << 4) /**< \brief (SPI_FMR) RDRF will be at level '1' when at least four unread data are in the Receive FIFO. */ +#define SPI_FMR_TXFTHRES_Pos 16 +#define SPI_FMR_TXFTHRES_Msk (0x3fu << SPI_FMR_TXFTHRES_Pos) /**< \brief (SPI_FMR) Transmit FIFO Threshold */ +#define SPI_FMR_TXFTHRES(value) ((SPI_FMR_TXFTHRES_Msk & ((value) << SPI_FMR_TXFTHRES_Pos))) +#define SPI_FMR_RXFTHRES_Pos 24 +#define SPI_FMR_RXFTHRES_Msk (0x3fu << SPI_FMR_RXFTHRES_Pos) /**< \brief (SPI_FMR) Receive FIFO Threshold */ +#define SPI_FMR_RXFTHRES(value) ((SPI_FMR_RXFTHRES_Msk & ((value) << SPI_FMR_RXFTHRES_Pos))) +/* -------- SPI_FLR : (FLEXCOM Offset: 0x444) SPI FIFO Level Register -------- */ +#define SPI_FLR_TXFL_Pos 0 +#define SPI_FLR_TXFL_Msk (0x3fu << SPI_FLR_TXFL_Pos) /**< \brief (SPI_FLR) Transmit FIFO Level */ +#define SPI_FLR_RXFL_Pos 16 +#define SPI_FLR_RXFL_Msk (0x3fu << SPI_FLR_RXFL_Pos) /**< \brief (SPI_FLR) Receive FIFO Level */ +/* -------- SPI_CMPR : (FLEXCOM Offset: 0x448) SPI Comparison Register -------- */ +#define SPI_CMPR_VAL1_Pos 0 +#define SPI_CMPR_VAL1_Msk (0xffffu << SPI_CMPR_VAL1_Pos) /**< \brief (SPI_CMPR) First Comparison Value for Received Character */ +#define SPI_CMPR_VAL1(value) ((SPI_CMPR_VAL1_Msk & ((value) << SPI_CMPR_VAL1_Pos))) +#define SPI_CMPR_VAL2_Pos 16 +#define SPI_CMPR_VAL2_Msk (0xffffu << SPI_CMPR_VAL2_Pos) /**< \brief (SPI_CMPR) Second Comparison Value for Received Character */ +#define SPI_CMPR_VAL2(value) ((SPI_CMPR_VAL2_Msk & ((value) << SPI_CMPR_VAL2_Pos))) +/* -------- SPI_WPMR : (FLEXCOM Offset: 0x4E4) SPI Write Protection Mode Register -------- */ +#define SPI_WPMR_WPEN (0x1u << 0) /**< \brief (SPI_WPMR) Write Protection Enable */ +#define SPI_WPMR_WPKEY_Pos 8 +#define SPI_WPMR_WPKEY_Msk (0xffffffu << SPI_WPMR_WPKEY_Pos) /**< \brief (SPI_WPMR) Write Protection Key */ +#define SPI_WPMR_WPKEY(value) ((SPI_WPMR_WPKEY_Msk & ((value) << SPI_WPMR_WPKEY_Pos))) +#define SPI_WPMR_WPKEY_PASSWD (0x535049u << 8) /**< \brief (SPI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0 */ +/* -------- SPI_WPSR : (FLEXCOM Offset: 0x4E8) SPI Write Protection Status Register -------- */ +#define SPI_WPSR_WPVS (0x1u << 0) /**< \brief (SPI_WPSR) Write Protection Violation Status */ +#define SPI_WPSR_WPVSRC_Pos 8 +#define SPI_WPSR_WPVSRC_Msk (0xffu << SPI_WPSR_WPVSRC_Pos) /**< \brief (SPI_WPSR) Write Protection Violation Source */ +/* -------- SPI_VERSION : (FLEXCOM Offset: 0x4FC) SPI Version Register -------- */ +#define SPI_VERSION_VERSION_Pos 0 +#define SPI_VERSION_VERSION_Msk (0xfffu << SPI_VERSION_VERSION_Pos) /**< \brief (SPI_VERSION) Version of the Hardware Module */ +#define SPI_VERSION_MFN_Pos 16 +#define SPI_VERSION_MFN_Msk (0x7u << SPI_VERSION_MFN_Pos) /**< \brief (SPI_VERSION) Metal Fix Number */ +/* -------- TWI_CR : (FLEXCOM Offset: 0x600) TWI Control Register -------- */ +#define TWI_CR_START (0x1u << 0) /**< \brief (TWI_CR) Send a START Condition */ +#define TWI_CR_STOP (0x1u << 1) /**< \brief (TWI_CR) Send a STOP Condition */ +#define TWI_CR_MSEN (0x1u << 2) /**< \brief (TWI_CR) TWI Master Mode Enabled */ +#define TWI_CR_MSDIS (0x1u << 3) /**< \brief (TWI_CR) TWI Master Mode Disabled */ +#define TWI_CR_SVEN (0x1u << 4) /**< \brief (TWI_CR) TWI Slave Mode Enabled */ +#define TWI_CR_SVDIS (0x1u << 5) /**< \brief (TWI_CR) TWI Slave Mode Disabled */ +#define TWI_CR_QUICK (0x1u << 6) /**< \brief (TWI_CR) SMBus Quick Command */ +#define TWI_CR_SWRST (0x1u << 7) /**< \brief (TWI_CR) Software Reset */ +#define TWI_CR_HSEN (0x1u << 8) /**< \brief (TWI_CR) TWI High-Speed Mode Enabled */ +#define TWI_CR_HSDIS (0x1u << 9) /**< \brief (TWI_CR) TWI High-Speed Mode Disabled */ +#define TWI_CR_SMBEN (0x1u << 10) /**< \brief (TWI_CR) SMBus Mode Enabled */ +#define TWI_CR_SMBDIS (0x1u << 11) /**< \brief (TWI_CR) SMBus Mode Disabled */ +#define TWI_CR_PECEN (0x1u << 12) /**< \brief (TWI_CR) Packet Error Checking Enable */ +#define TWI_CR_PECDIS (0x1u << 13) /**< \brief (TWI_CR) Packet Error Checking Disable */ +#define TWI_CR_PECRQ (0x1u << 14) /**< \brief (TWI_CR) PEC Request */ +#define TWI_CR_CLEAR (0x1u << 15) /**< \brief (TWI_CR) Bus CLEAR Command */ +#define TWI_CR_ACMEN (0x1u << 16) /**< \brief (TWI_CR) Alternative Command Mode Enable */ +#define TWI_CR_ACMDIS (0x1u << 17) /**< \brief (TWI_CR) Alternative Command Mode Disable */ +#define TWI_CR_THRCLR (0x1u << 24) /**< \brief (TWI_CR) Transmit Holding Register Clear */ +#define TWI_CR_LOCKCLR (0x1u << 26) /**< \brief (TWI_CR) Lock Clear */ +#define TWI_CR_FIFOEN (0x1u << 28) /**< \brief (TWI_CR) FIFO Enable */ +#define TWI_CR_FIFODIS (0x1u << 29) /**< \brief (TWI_CR) FIFO Disable */ +/* -------- TWI_MMR : (FLEXCOM Offset: 0x604) TWI Master Mode Register -------- */ +#define TWI_MMR_IADRSZ_Pos 8 +#define TWI_MMR_IADRSZ_Msk (0x3u << TWI_MMR_IADRSZ_Pos) /**< \brief (TWI_MMR) Internal Device Address Size */ +#define TWI_MMR_IADRSZ(value) ((TWI_MMR_IADRSZ_Msk & ((value) << TWI_MMR_IADRSZ_Pos))) +#define TWI_MMR_IADRSZ_NONE (0x0u << 8) /**< \brief (TWI_MMR) No internal device address */ +#define TWI_MMR_IADRSZ_1_BYTE (0x1u << 8) /**< \brief (TWI_MMR) One-byte internal device address */ +#define TWI_MMR_IADRSZ_2_BYTE (0x2u << 8) /**< \brief (TWI_MMR) Two-byte internal device address */ +#define TWI_MMR_IADRSZ_3_BYTE (0x3u << 8) /**< \brief (TWI_MMR) Three-byte internal device address */ +#define TWI_MMR_MREAD (0x1u << 12) /**< \brief (TWI_MMR) Master Read Direction */ +#define TWI_MMR_DADR_Pos 16 +#define TWI_MMR_DADR_Msk (0x7fu << TWI_MMR_DADR_Pos) /**< \brief (TWI_MMR) Device Address */ +#define TWI_MMR_DADR(value) ((TWI_MMR_DADR_Msk & ((value) << TWI_MMR_DADR_Pos))) +/* -------- TWI_SMR : (FLEXCOM Offset: 0x608) TWI Slave Mode Register -------- */ +#define TWI_SMR_NACKEN (0x1u << 0) /**< \brief (TWI_SMR) Slave Receiver Data Phase NACK Enable */ +#define TWI_SMR_SMDA (0x1u << 2) /**< \brief (TWI_SMR) SMBus Default Address */ +#define TWI_SMR_SMHH (0x1u << 3) /**< \brief (TWI_SMR) SMBus Host Header */ +#define TWI_SMR_SCLWSDIS (0x1u << 6) /**< \brief (TWI_SMR) Clock Wait State Disable */ +#define TWI_SMR_MASK_Pos 8 +#define TWI_SMR_MASK_Msk (0x7fu << TWI_SMR_MASK_Pos) /**< \brief (TWI_SMR) Slave Address Mask */ +#define TWI_SMR_MASK(value) ((TWI_SMR_MASK_Msk & ((value) << TWI_SMR_MASK_Pos))) +#define TWI_SMR_SADR_Pos 16 +#define TWI_SMR_SADR_Msk (0x7fu << TWI_SMR_SADR_Pos) /**< \brief (TWI_SMR) Slave Address */ +#define TWI_SMR_SADR(value) ((TWI_SMR_SADR_Msk & ((value) << TWI_SMR_SADR_Pos))) +#define TWI_SMR_SADR1EN (0x1u << 28) /**< \brief (TWI_SMR) Slave Address 1 Enable */ +#define TWI_SMR_SADR2EN (0x1u << 29) /**< \brief (TWI_SMR) Slave Address 2 Enable */ +#define TWI_SMR_SADR3EN (0x1u << 30) /**< \brief (TWI_SMR) Slave Address 3 Enable */ +#define TWI_SMR_DATAMEN (0x1u << 31) /**< \brief (TWI_SMR) Data Matching Enable */ +/* -------- TWI_IADR : (FLEXCOM Offset: 0x60C) TWI Internal Address Register -------- */ +#define TWI_IADR_IADR_Pos 0 +#define TWI_IADR_IADR_Msk (0xffffffu << TWI_IADR_IADR_Pos) /**< \brief (TWI_IADR) Internal Address */ +#define TWI_IADR_IADR(value) ((TWI_IADR_IADR_Msk & ((value) << TWI_IADR_IADR_Pos))) +/* -------- TWI_CWGR : (FLEXCOM Offset: 0x610) TWI Clock Waveform Generator Register -------- */ +#define TWI_CWGR_CLDIV_Pos 0 +#define TWI_CWGR_CLDIV_Msk (0xffu << TWI_CWGR_CLDIV_Pos) /**< \brief (TWI_CWGR) Clock Low Divider */ +#define TWI_CWGR_CLDIV(value) ((TWI_CWGR_CLDIV_Msk & ((value) << TWI_CWGR_CLDIV_Pos))) +#define TWI_CWGR_CHDIV_Pos 8 +#define TWI_CWGR_CHDIV_Msk (0xffu << TWI_CWGR_CHDIV_Pos) /**< \brief (TWI_CWGR) Clock High Divider */ +#define TWI_CWGR_CHDIV(value) ((TWI_CWGR_CHDIV_Msk & ((value) << TWI_CWGR_CHDIV_Pos))) +#define TWI_CWGR_CKDIV_Pos 16 +#define TWI_CWGR_CKDIV_Msk (0x7u << TWI_CWGR_CKDIV_Pos) /**< \brief (TWI_CWGR) Clock Divider */ +#define TWI_CWGR_CKDIV(value) ((TWI_CWGR_CKDIV_Msk & ((value) << TWI_CWGR_CKDIV_Pos))) +#define TWI_CWGR_BRSRCCLK (0x1u << 20) /**< \brief (TWI_CWGR) Bit Rate Source Clock */ +#define TWI_CWGR_BRSRCCLK_PERIPH_CLK (0x0u << 20) /**< \brief (TWI_CWGR) The peripheral clock is the source clock for the bit rate generation. */ +#define TWI_CWGR_BRSRCCLK_PMC_PCK (0x1u << 20) /**< \brief (TWI_CWGR) PMC PCKx is the source clock for the bit rate generation, thus the bit rate can be independent of the core/peripheral clock. */ +#define TWI_CWGR_HOLD_Pos 24 +#define TWI_CWGR_HOLD_Msk (0x1fu << TWI_CWGR_HOLD_Pos) /**< \brief (TWI_CWGR) TWD Hold Time Versus TWCK Falling */ +#define TWI_CWGR_HOLD(value) ((TWI_CWGR_HOLD_Msk & ((value) << TWI_CWGR_HOLD_Pos))) +/* -------- TWI_SR : (FLEXCOM Offset: 0x620) TWI Status Register -------- */ +#define TWI_SR_TXCOMP (0x1u << 0) /**< \brief (TWI_SR) Transmission Completed (cleared by writing TWI_THR) */ +#define TWI_SR_RXRDY (0x1u << 1) /**< \brief (TWI_SR) Receive Holding Register Ready (cleared when reading TWI_RHR) */ +#define TWI_SR_TXRDY (0x1u << 2) /**< \brief (TWI_SR) Transmit Holding Register Ready (cleared by writing TWI_THR) */ +#define TWI_SR_SVREAD (0x1u << 3) /**< \brief (TWI_SR) Slave Read */ +#define TWI_SR_SVACC (0x1u << 4) /**< \brief (TWI_SR) Slave Access */ +#define TWI_SR_GACC (0x1u << 5) /**< \brief (TWI_SR) General Call Access (cleared on read) */ +#define TWI_SR_OVRE (0x1u << 6) /**< \brief (TWI_SR) Overrun Error (cleared on read) */ +#define TWI_SR_UNRE (0x1u << 7) /**< \brief (TWI_SR) Underrun Error (cleared on read) */ +#define TWI_SR_NACK (0x1u << 8) /**< \brief (TWI_SR) Not Acknowledged (cleared on read) */ +#define TWI_SR_ARBLST (0x1u << 9) /**< \brief (TWI_SR) Arbitration Lost (cleared on read) */ +#define TWI_SR_SCLWS (0x1u << 10) /**< \brief (TWI_SR) Clock Wait State */ +#define TWI_SR_EOSACC (0x1u << 11) /**< \brief (TWI_SR) End Of Slave Access (cleared on read) */ +#define TWI_SR_MCACK (0x1u << 16) /**< \brief (TWI_SR) Master Code Acknowledge (cleared on read) */ +#define TWI_SR_TOUT (0x1u << 18) /**< \brief (TWI_SR) Timeout Error (cleared on read) */ +#define TWI_SR_PECERR (0x1u << 19) /**< \brief (TWI_SR) PEC Error (cleared on read) */ +#define TWI_SR_SMBDAM (0x1u << 20) /**< \brief (TWI_SR) SMBus Default Address Match (cleared on read) */ +#define TWI_SR_SMBHHM (0x1u << 21) /**< \brief (TWI_SR) SMBus Host Header Address Match (cleared on read) */ +#define TWI_SR_LOCK (0x1u << 23) /**< \brief (TWI_SR) TWI Lock Due to Frame Errors */ +#define TWI_SR_SCL (0x1u << 24) /**< \brief (TWI_SR) SCL line value */ +#define TWI_SR_SDA (0x1u << 25) /**< \brief (TWI_SR) SDA line value */ +/* -------- TWI_IER : (FLEXCOM Offset: 0x624) TWI Interrupt Enable Register -------- */ +#define TWI_IER_TXCOMP (0x1u << 0) /**< \brief (TWI_IER) Transmission Completed Interrupt Enable */ +#define TWI_IER_RXRDY (0x1u << 1) /**< \brief (TWI_IER) Receive Holding Register Ready Interrupt Enable */ +#define TWI_IER_TXRDY (0x1u << 2) /**< \brief (TWI_IER) Transmit Holding Register Ready Interrupt Enable */ +#define TWI_IER_SVACC (0x1u << 4) /**< \brief (TWI_IER) Slave Access Interrupt Enable */ +#define TWI_IER_GACC (0x1u << 5) /**< \brief (TWI_IER) General Call Access Interrupt Enable */ +#define TWI_IER_OVRE (0x1u << 6) /**< \brief (TWI_IER) Overrun Error Interrupt Enable */ +#define TWI_IER_UNRE (0x1u << 7) /**< \brief (TWI_IER) Underrun Error Interrupt Enable */ +#define TWI_IER_NACK (0x1u << 8) /**< \brief (TWI_IER) Not Acknowledge Interrupt Enable */ +#define TWI_IER_ARBLST (0x1u << 9) /**< \brief (TWI_IER) Arbitration Lost Interrupt Enable */ +#define TWI_IER_SCL_WS (0x1u << 10) /**< \brief (TWI_IER) Clock Wait State Interrupt Enable */ +#define TWI_IER_EOSACC (0x1u << 11) /**< \brief (TWI_IER) End Of Slave Access Interrupt Enable */ +#define TWI_IER_ENDRX (0x1u << 12) /**< \brief (TWI_IER) End of Receive Buffer Interrupt Enable */ +#define TWI_IER_ENDTX (0x1u << 13) /**< \brief (TWI_IER) End of Transmit Buffer Interrupt Enable */ +#define TWI_IER_RXBUFF (0x1u << 14) /**< \brief (TWI_IER) Receive Buffer Full Interrupt Enable */ +#define TWI_IER_TXBUFE (0x1u << 15) /**< \brief (TWI_IER) Transmit Buffer Empty Interrupt Enable */ +#define TWI_IER_MCACK (0x1u << 16) /**< \brief (TWI_IER) Master Code Acknowledge Interrupt Enable */ +#define TWI_IER_TOUT (0x1u << 18) /**< \brief (TWI_IER) Timeout Error Interrupt Enable */ +#define TWI_IER_PECERR (0x1u << 19) /**< \brief (TWI_IER) PEC Error Interrupt Enable */ +#define TWI_IER_SMBDAM (0x1u << 20) /**< \brief (TWI_IER) SMBus Default Address Match Interrupt Enable */ +#define TWI_IER_SMBHHM (0x1u << 21) /**< \brief (TWI_IER) SMBus Host Header Address Match Interrupt Enable */ +/* -------- TWI_IDR : (FLEXCOM Offset: 0x628) TWI Interrupt Disable Register -------- */ +#define TWI_IDR_TXCOMP (0x1u << 0) /**< \brief (TWI_IDR) Transmission Completed Interrupt Disable */ +#define TWI_IDR_RXRDY (0x1u << 1) /**< \brief (TWI_IDR) Receive Holding Register Ready Interrupt Disable */ +#define TWI_IDR_TXRDY (0x1u << 2) /**< \brief (TWI_IDR) Transmit Holding Register Ready Interrupt Disable */ +#define TWI_IDR_SVACC (0x1u << 4) /**< \brief (TWI_IDR) Slave Access Interrupt Disable */ +#define TWI_IDR_GACC (0x1u << 5) /**< \brief (TWI_IDR) General Call Access Interrupt Disable */ +#define TWI_IDR_OVRE (0x1u << 6) /**< \brief (TWI_IDR) Overrun Error Interrupt Disable */ +#define TWI_IDR_UNRE (0x1u << 7) /**< \brief (TWI_IDR) Underrun Error Interrupt Disable */ +#define TWI_IDR_NACK (0x1u << 8) /**< \brief (TWI_IDR) Not Acknowledge Interrupt Disable */ +#define TWI_IDR_ARBLST (0x1u << 9) /**< \brief (TWI_IDR) Arbitration Lost Interrupt Disable */ +#define TWI_IDR_SCL_WS (0x1u << 10) /**< \brief (TWI_IDR) Clock Wait State Interrupt Disable */ +#define TWI_IDR_EOSACC (0x1u << 11) /**< \brief (TWI_IDR) End Of Slave Access Interrupt Disable */ +#define TWI_IDR_ENDRX (0x1u << 12) /**< \brief (TWI_IDR) End of Receive Buffer Interrupt Disable */ +#define TWI_IDR_ENDTX (0x1u << 13) /**< \brief (TWI_IDR) End of Transmit Buffer Interrupt Disable */ +#define TWI_IDR_RXBUFF (0x1u << 14) /**< \brief (TWI_IDR) Receive Buffer Full Interrupt Disable */ +#define TWI_IDR_TXBUFE (0x1u << 15) /**< \brief (TWI_IDR) Transmit Buffer Empty Interrupt Disable */ +#define TWI_IDR_MCACK (0x1u << 16) /**< \brief (TWI_IDR) Master Code Acknowledge Interrupt Disable */ +#define TWI_IDR_TOUT (0x1u << 18) /**< \brief (TWI_IDR) Timeout Error Interrupt Disable */ +#define TWI_IDR_PECERR (0x1u << 19) /**< \brief (TWI_IDR) PEC Error Interrupt Disable */ +#define TWI_IDR_SMBDAM (0x1u << 20) /**< \brief (TWI_IDR) SMBus Default Address Match Interrupt Disable */ +#define TWI_IDR_SMBHHM (0x1u << 21) /**< \brief (TWI_IDR) SMBus Host Header Address Match Interrupt Disable */ +/* -------- TWI_IMR : (FLEXCOM Offset: 0x62C) TWI Interrupt Mask Register -------- */ +#define TWI_IMR_TXCOMP (0x1u << 0) /**< \brief (TWI_IMR) Transmission Completed Interrupt Mask */ +#define TWI_IMR_RXRDY (0x1u << 1) /**< \brief (TWI_IMR) Receive Holding Register Ready Interrupt Mask */ +#define TWI_IMR_TXRDY (0x1u << 2) /**< \brief (TWI_IMR) Transmit Holding Register Ready Interrupt Mask */ +#define TWI_IMR_SVACC (0x1u << 4) /**< \brief (TWI_IMR) Slave Access Interrupt Mask */ +#define TWI_IMR_GACC (0x1u << 5) /**< \brief (TWI_IMR) General Call Access Interrupt Mask */ +#define TWI_IMR_OVRE (0x1u << 6) /**< \brief (TWI_IMR) Overrun Error Interrupt Mask */ +#define TWI_IMR_UNRE (0x1u << 7) /**< \brief (TWI_IMR) Underrun Error Interrupt Mask */ +#define TWI_IMR_NACK (0x1u << 8) /**< \brief (TWI_IMR) Not Acknowledge Interrupt Mask */ +#define TWI_IMR_ARBLST (0x1u << 9) /**< \brief (TWI_IMR) Arbitration Lost Interrupt Mask */ +#define TWI_IMR_SCL_WS (0x1u << 10) /**< \brief (TWI_IMR) Clock Wait State Interrupt Mask */ +#define TWI_IMR_EOSACC (0x1u << 11) /**< \brief (TWI_IMR) End Of Slave Access Interrupt Mask */ +#define TWI_IMR_ENDRX (0x1u << 12) /**< \brief (TWI_IMR) End of Receive Buffer Interrupt Mask */ +#define TWI_IMR_ENDTX (0x1u << 13) /**< \brief (TWI_IMR) End of Transmit Buffer Interrupt Mask */ +#define TWI_IMR_RXBUFF (0x1u << 14) /**< \brief (TWI_IMR) Receive Buffer Full Interrupt Mask */ +#define TWI_IMR_TXBUFE (0x1u << 15) /**< \brief (TWI_IMR) Transmit Buffer Empty Interrupt Mask */ +#define TWI_IMR_MCACK (0x1u << 16) /**< \brief (TWI_IMR) Master Code Acknowledge Interrupt Mask */ +#define TWI_IMR_TOUT (0x1u << 18) /**< \brief (TWI_IMR) Timeout Error Interrupt Mask */ +#define TWI_IMR_PECERR (0x1u << 19) /**< \brief (TWI_IMR) PEC Error Interrupt Mask */ +#define TWI_IMR_SMBDAM (0x1u << 20) /**< \brief (TWI_IMR) SMBus Default Address Match Interrupt Mask */ +#define TWI_IMR_SMBHHM (0x1u << 21) /**< \brief (TWI_IMR) SMBus Host Header Address Match Interrupt Mask */ +/* -------- TWI_RHR : (FLEXCOM Offset: 0x630) TWI Receive Holding Register -------- */ +#define TWI_RHR_RXDATA_Pos 0 +#define TWI_RHR_RXDATA_Msk (0xffu << TWI_RHR_RXDATA_Pos) /**< \brief (TWI_RHR) Master or Slave Receive Holding Data */ +#define TWI_RHR_RXDATA0_Pos 0 +#define TWI_RHR_RXDATA0_Msk (0xffu << TWI_RHR_RXDATA0_Pos) /**< \brief (TWI_RHR) Master or Slave Receive Holding Data 0 */ +#define TWI_RHR_RXDATA1_Pos 8 +#define TWI_RHR_RXDATA1_Msk (0xffu << TWI_RHR_RXDATA1_Pos) /**< \brief (TWI_RHR) Master or Slave Receive Holding Data 1 */ +#define TWI_RHR_RXDATA2_Pos 16 +#define TWI_RHR_RXDATA2_Msk (0xffu << TWI_RHR_RXDATA2_Pos) /**< \brief (TWI_RHR) Master or Slave Receive Holding Data 2 */ +#define TWI_RHR_RXDATA3_Pos 24 +#define TWI_RHR_RXDATA3_Msk (0xffu << TWI_RHR_RXDATA3_Pos) /**< \brief (TWI_RHR) Master or Slave Receive Holding Data 3 */ +/* -------- TWI_THR : (FLEXCOM Offset: 0x634) TWI Transmit Holding Register -------- */ +#define TWI_THR_TXDATA_Pos 0 +#define TWI_THR_TXDATA_Msk (0xffu << TWI_THR_TXDATA_Pos) /**< \brief (TWI_THR) Master or Slave Transmit Holding Data */ +#define TWI_THR_TXDATA(value) ((TWI_THR_TXDATA_Msk & ((value) << TWI_THR_TXDATA_Pos))) +#define TWI_THR_TXDATA0_Pos 0 +#define TWI_THR_TXDATA0_Msk (0xffu << TWI_THR_TXDATA0_Pos) /**< \brief (TWI_THR) Master or Slave Transmit Holding Data 0 */ +#define TWI_THR_TXDATA0(value) ((TWI_THR_TXDATA0_Msk & ((value) << TWI_THR_TXDATA0_Pos))) +#define TWI_THR_TXDATA1_Pos 8 +#define TWI_THR_TXDATA1_Msk (0xffu << TWI_THR_TXDATA1_Pos) /**< \brief (TWI_THR) Master or Slave Transmit Holding Data 1 */ +#define TWI_THR_TXDATA1(value) ((TWI_THR_TXDATA1_Msk & ((value) << TWI_THR_TXDATA1_Pos))) +#define TWI_THR_TXDATA2_Pos 16 +#define TWI_THR_TXDATA2_Msk (0xffu << TWI_THR_TXDATA2_Pos) /**< \brief (TWI_THR) Master or Slave Transmit Holding Data 2 */ +#define TWI_THR_TXDATA2(value) ((TWI_THR_TXDATA2_Msk & ((value) << TWI_THR_TXDATA2_Pos))) +#define TWI_THR_TXDATA3_Pos 24 +#define TWI_THR_TXDATA3_Msk (0xffu << TWI_THR_TXDATA3_Pos) /**< \brief (TWI_THR) Master or Slave Transmit Holding Data 3 */ +#define TWI_THR_TXDATA3(value) ((TWI_THR_TXDATA3_Msk & ((value) << TWI_THR_TXDATA3_Pos))) +/* -------- TWI_SMBTR : (FLEXCOM Offset: 0x638) TWI SMBus Timing Register -------- */ +#define TWI_SMBTR_PRESC_Pos 0 +#define TWI_SMBTR_PRESC_Msk (0xfu << TWI_SMBTR_PRESC_Pos) /**< \brief (TWI_SMBTR) SMBus Clock Prescaler */ +#define TWI_SMBTR_PRESC(value) ((TWI_SMBTR_PRESC_Msk & ((value) << TWI_SMBTR_PRESC_Pos))) +#define TWI_SMBTR_TLOWS_Pos 8 +#define TWI_SMBTR_TLOWS_Msk (0xffu << TWI_SMBTR_TLOWS_Pos) /**< \brief (TWI_SMBTR) Slave Clock Stretch Maximum Cycles */ +#define TWI_SMBTR_TLOWS(value) ((TWI_SMBTR_TLOWS_Msk & ((value) << TWI_SMBTR_TLOWS_Pos))) +#define TWI_SMBTR_TLOWM_Pos 16 +#define TWI_SMBTR_TLOWM_Msk (0xffu << TWI_SMBTR_TLOWM_Pos) /**< \brief (TWI_SMBTR) Master Clock Stretch Maximum Cycles */ +#define TWI_SMBTR_TLOWM(value) ((TWI_SMBTR_TLOWM_Msk & ((value) << TWI_SMBTR_TLOWM_Pos))) +#define TWI_SMBTR_THMAX_Pos 24 +#define TWI_SMBTR_THMAX_Msk (0xffu << TWI_SMBTR_THMAX_Pos) /**< \brief (TWI_SMBTR) Clock High Maximum Cycles */ +#define TWI_SMBTR_THMAX(value) ((TWI_SMBTR_THMAX_Msk & ((value) << TWI_SMBTR_THMAX_Pos))) +/* -------- TWI_ACR : (FLEXCOM Offset: 0x640) TWI Alternative Command Register -------- */ +#define TWI_ACR_DATAL_Pos 0 +#define TWI_ACR_DATAL_Msk (0xffu << TWI_ACR_DATAL_Pos) /**< \brief (TWI_ACR) Data Length */ +#define TWI_ACR_DATAL(value) ((TWI_ACR_DATAL_Msk & ((value) << TWI_ACR_DATAL_Pos))) +#define TWI_ACR_DIR (0x1u << 8) /**< \brief (TWI_ACR) Transfer Direction */ +#define TWI_ACR_PEC (0x1u << 9) /**< \brief (TWI_ACR) PEC Request (SMBus Mode only) */ +#define TWI_ACR_NDATAL_Pos 16 +#define TWI_ACR_NDATAL_Msk (0xffu << TWI_ACR_NDATAL_Pos) /**< \brief (TWI_ACR) Next Data Length */ +#define TWI_ACR_NDATAL(value) ((TWI_ACR_NDATAL_Msk & ((value) << TWI_ACR_NDATAL_Pos))) +#define TWI_ACR_NDIR (0x1u << 24) /**< \brief (TWI_ACR) Next Transfer Direction */ +#define TWI_ACR_NPEC (0x1u << 25) /**< \brief (TWI_ACR) Next PEC Request (SMBus Mode only) */ +/* -------- TWI_FILTR : (FLEXCOM Offset: 0x644) TWI Filter Register -------- */ +#define TWI_FILTR_FILT (0x1u << 0) /**< \brief (TWI_FILTR) RX Digital Filter */ +#define TWI_FILTR_PADFEN (0x1u << 1) /**< \brief (TWI_FILTR) PAD Filter Enable */ +#define TWI_FILTR_PADFCFG (0x1u << 2) /**< \brief (TWI_FILTR) PAD Filter Config */ +#define TWI_FILTR_THRES_Pos 8 +#define TWI_FILTR_THRES_Msk (0x7u << TWI_FILTR_THRES_Pos) /**< \brief (TWI_FILTR) Digital Filter Threshold */ +#define TWI_FILTR_THRES(value) ((TWI_FILTR_THRES_Msk & ((value) << TWI_FILTR_THRES_Pos))) +/* -------- TWI_SWMR : (FLEXCOM Offset: 0x64C) TWI SleepWalking Matching Register -------- */ +#define TWI_SWMR_SADR1_Pos 0 +#define TWI_SWMR_SADR1_Msk (0x7fu << TWI_SWMR_SADR1_Pos) /**< \brief (TWI_SWMR) Slave Address 1 */ +#define TWI_SWMR_SADR1(value) ((TWI_SWMR_SADR1_Msk & ((value) << TWI_SWMR_SADR1_Pos))) +#define TWI_SWMR_SADR2_Pos 8 +#define TWI_SWMR_SADR2_Msk (0x7fu << TWI_SWMR_SADR2_Pos) /**< \brief (TWI_SWMR) Slave Address 2 */ +#define TWI_SWMR_SADR2(value) ((TWI_SWMR_SADR2_Msk & ((value) << TWI_SWMR_SADR2_Pos))) +#define TWI_SWMR_SADR3_Pos 16 +#define TWI_SWMR_SADR3_Msk (0x7fu << TWI_SWMR_SADR3_Pos) /**< \brief (TWI_SWMR) Slave Address 3 */ +#define TWI_SWMR_SADR3(value) ((TWI_SWMR_SADR3_Msk & ((value) << TWI_SWMR_SADR3_Pos))) +#define TWI_SWMR_DATAM_Pos 24 +#define TWI_SWMR_DATAM_Msk (0xffu << TWI_SWMR_DATAM_Pos) /**< \brief (TWI_SWMR) Data Match */ +#define TWI_SWMR_DATAM(value) ((TWI_SWMR_DATAM_Msk & ((value) << TWI_SWMR_DATAM_Pos))) +/* -------- TWI_FMR : (FLEXCOM Offset: 0x650) TWI FIFO Mode Register -------- */ +#define TWI_FMR_TXRDYM_Pos 0 +#define TWI_FMR_TXRDYM_Msk (0x3u << TWI_FMR_TXRDYM_Pos) /**< \brief (TWI_FMR) Transmitter Ready Mode */ +#define TWI_FMR_TXRDYM(value) ((TWI_FMR_TXRDYM_Msk & ((value) << TWI_FMR_TXRDYM_Pos))) +#define TWI_FMR_TXRDYM_ONE_DATA (0x0u << 0) /**< \brief (TWI_FMR) TXRDY will be at level '1' when at least one data can be written in the Transmit FIFO */ +#define TWI_FMR_TXRDYM_TWO_DATA (0x1u << 0) /**< \brief (TWI_FMR) TXRDY will be at level '1' when at least two data can be written in the Transmit FIFO */ +#define TWI_FMR_TXRDYM_FOUR_DATA (0x2u << 0) /**< \brief (TWI_FMR) TXRDY will be at level '1' when at least four data can be written in the Transmit FIFO */ +#define TWI_FMR_RXRDYM_Pos 4 +#define TWI_FMR_RXRDYM_Msk (0x3u << TWI_FMR_RXRDYM_Pos) /**< \brief (TWI_FMR) Receiver Ready Mode */ +#define TWI_FMR_RXRDYM(value) ((TWI_FMR_RXRDYM_Msk & ((value) << TWI_FMR_RXRDYM_Pos))) +#define TWI_FMR_RXRDYM_ONE_DATA (0x0u << 4) /**< \brief (TWI_FMR) RXRDY will be at level '1' when at least one unread data is in the Receive FIFO */ +#define TWI_FMR_RXRDYM_TWO_DATA (0x1u << 4) /**< \brief (TWI_FMR) RXRDY will be at level '1' when at least two unread data are in the Receive FIFO */ +#define TWI_FMR_RXRDYM_FOUR_DATA (0x2u << 4) /**< \brief (TWI_FMR) RXRDY will be at level '1' when at least four unread data are in the Receive FIFO */ +#define TWI_FMR_TXFTHRES_Pos 16 +#define TWI_FMR_TXFTHRES_Msk (0x3fu << TWI_FMR_TXFTHRES_Pos) /**< \brief (TWI_FMR) Transmit FIFO Threshold */ +#define TWI_FMR_TXFTHRES(value) ((TWI_FMR_TXFTHRES_Msk & ((value) << TWI_FMR_TXFTHRES_Pos))) +#define TWI_FMR_RXFTHRES_Pos 24 +#define TWI_FMR_RXFTHRES_Msk (0x3fu << TWI_FMR_RXFTHRES_Pos) /**< \brief (TWI_FMR) Receive FIFO Threshold */ +#define TWI_FMR_RXFTHRES(value) ((TWI_FMR_RXFTHRES_Msk & ((value) << TWI_FMR_RXFTHRES_Pos))) +/* -------- TWI_FLR : (FLEXCOM Offset: 0x654) TWI FIFO Level Register -------- */ +#define TWI_FLR_TXFL_Pos 0 +#define TWI_FLR_TXFL_Msk (0x3fu << TWI_FLR_TXFL_Pos) /**< \brief (TWI_FLR) Transmit FIFO Level */ +#define TWI_FLR_RXFL_Pos 16 +#define TWI_FLR_RXFL_Msk (0x3fu << TWI_FLR_RXFL_Pos) /**< \brief (TWI_FLR) Receive FIFO Level */ +/* -------- TWI_FSR : (FLEXCOM Offset: 0x660) TWI FIFO Status Register -------- */ +#define TWI_FSR_TXFEF (0x1u << 0) /**< \brief (TWI_FSR) Transmit FIFO Empty Flag (cleared on read) */ +#define TWI_FSR_TXFFF (0x1u << 1) /**< \brief (TWI_FSR) Transmit FIFO Full Flag (cleared on read) */ +#define TWI_FSR_TXFTHF (0x1u << 2) /**< \brief (TWI_FSR) Transmit FIFO Threshold Flag (cleared on read) */ +#define TWI_FSR_RXFEF (0x1u << 3) /**< \brief (TWI_FSR) Receive FIFO Empty Flag */ +#define TWI_FSR_RXFFF (0x1u << 4) /**< \brief (TWI_FSR) Receive FIFO Full Flag */ +#define TWI_FSR_RXFTHF (0x1u << 5) /**< \brief (TWI_FSR) Receive FIFO Threshold Flag */ +#define TWI_FSR_TXFPTEF (0x1u << 6) /**< \brief (TWI_FSR) Transmit FIFO Pointer Error Flag */ +#define TWI_FSR_RXFPTEF (0x1u << 7) /**< \brief (TWI_FSR) Receive FIFO Pointer Error Flag */ +/* -------- TWI_FIER : (FLEXCOM Offset: 0x664) TWI FIFO Interrupt Enable Register -------- */ +#define TWI_FIER_TXFEF (0x1u << 0) /**< \brief (TWI_FIER) TXFEF Interrupt Enable */ +#define TWI_FIER_TXFFF (0x1u << 1) /**< \brief (TWI_FIER) TXFFF Interrupt Enable */ +#define TWI_FIER_TXFTHF (0x1u << 2) /**< \brief (TWI_FIER) TXFTHF Interrupt Enable */ +#define TWI_FIER_RXFEF (0x1u << 3) /**< \brief (TWI_FIER) RXFEF Interrupt Enable */ +#define TWI_FIER_RXFFF (0x1u << 4) /**< \brief (TWI_FIER) RXFFF Interrupt Enable */ +#define TWI_FIER_RXFTHF (0x1u << 5) /**< \brief (TWI_FIER) RXFTHF Interrupt Enable */ +#define TWI_FIER_TXFPTEF (0x1u << 6) /**< \brief (TWI_FIER) TXFPTEF Interrupt Enable */ +#define TWI_FIER_RXFPTEF (0x1u << 7) /**< \brief (TWI_FIER) RXFPTEF Interrupt Enable */ +/* -------- TWI_FIDR : (FLEXCOM Offset: 0x668) TWI FIFO Interrupt Disable Register -------- */ +#define TWI_FIDR_TXFEF (0x1u << 0) /**< \brief (TWI_FIDR) TXFEF Interrupt Disable */ +#define TWI_FIDR_TXFFF (0x1u << 1) /**< \brief (TWI_FIDR) TXFFF Interrupt Disable */ +#define TWI_FIDR_TXFTHF (0x1u << 2) /**< \brief (TWI_FIDR) TXFTHF Interrupt Disable */ +#define TWI_FIDR_RXFEF (0x1u << 3) /**< \brief (TWI_FIDR) RXFEF Interrupt Disable */ +#define TWI_FIDR_RXFFF (0x1u << 4) /**< \brief (TWI_FIDR) RXFFF Interrupt Disable */ +#define TWI_FIDR_RXFTHF (0x1u << 5) /**< \brief (TWI_FIDR) RXFTHF Interrupt Disable */ +#define TWI_FIDR_TXFPTEF (0x1u << 6) /**< \brief (TWI_FIDR) TXFPTEF Interrupt Disable */ +#define TWI_FIDR_RXFPTEF (0x1u << 7) /**< \brief (TWI_FIDR) RXFPTEF Interrupt Disable */ +/* -------- TWI_FIMR : (FLEXCOM Offset: 0x66C) TWI FIFO Interrupt Mask Register -------- */ +#define TWI_FIMR_TXFEF (0x1u << 0) /**< \brief (TWI_FIMR) TXFEF Interrupt Mask */ +#define TWI_FIMR_TXFFF (0x1u << 1) /**< \brief (TWI_FIMR) TXFFF Interrupt Mask */ +#define TWI_FIMR_TXFTHF (0x1u << 2) /**< \brief (TWI_FIMR) TXFTHF Interrupt Mask */ +#define TWI_FIMR_RXFEF (0x1u << 3) /**< \brief (TWI_FIMR) RXFEF Interrupt Mask */ +#define TWI_FIMR_RXFFF (0x1u << 4) /**< \brief (TWI_FIMR) RXFFF Interrupt Mask */ +#define TWI_FIMR_RXFTHF (0x1u << 5) /**< \brief (TWI_FIMR) RXFTHF Interrupt Mask */ +#define TWI_FIMR_TXFPTEF (0x1u << 6) /**< \brief (TWI_FIMR) TXFPTEF Interrupt Mask */ +#define TWI_FIMR_RXFPTEF (0x1u << 7) /**< \brief (TWI_FIMR) RXFPTEF Interrupt Mask */ +/* -------- TWI_DR : (FLEXCOM Offset: 0x6D0) TWI Debug Register -------- */ +#define TWI_DR_SWEN (0x1u << 0) /**< \brief (TWI_DR) SleepWalking Enable */ +#define TWI_DR_CLKRQ (0x1u << 1) /**< \brief (TWI_DR) Clock Request */ +#define TWI_DR_SWMATCH (0x1u << 2) /**< \brief (TWI_DR) SleepWalking Match */ +#define TWI_DR_TRP (0x1u << 3) /**< \brief (TWI_DR) Transfer Pending */ +/* -------- TWI_WPMR : (FLEXCOM Offset: 0x6E4) TWI Protection Mode Register -------- */ +#define TWI_WPMR_WPEN (0x1u << 0) /**< \brief (TWI_WPMR) Write Protection Enable */ +#define TWI_WPMR_WPKEY_Pos 8 +#define TWI_WPMR_WPKEY_Msk (0xffffffu << TWI_WPMR_WPKEY_Pos) /**< \brief (TWI_WPMR) Write Protection Key */ +#define TWI_WPMR_WPKEY(value) ((TWI_WPMR_WPKEY_Msk & ((value) << TWI_WPMR_WPKEY_Pos))) +#define TWI_WPMR_WPKEY_PASSWD (0x545749u << 8) /**< \brief (TWI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0 */ +/* -------- TWI_WPSR : (FLEXCOM Offset: 0x6E8) TWI Protection Status Register -------- */ +#define TWI_WPSR_WPVS (0x1u << 0) /**< \brief (TWI_WPSR) Write Protect Violation Status */ +#define TWI_WPSR_WPVSRC_Pos 8 +#define TWI_WPSR_WPVSRC_Msk (0xffffffu << TWI_WPSR_WPVSRC_Pos) /**< \brief (TWI_WPSR) Write Protection Violation Source */ +/* -------- TWI_VER : (FLEXCOM Offset: 0x6FC) TWI Version Register -------- */ +#define TWI_VER_VERSION_Pos 0 +#define TWI_VER_VERSION_Msk (0xfffu << TWI_VER_VERSION_Pos) /**< \brief (TWI_VER) Version of the Hardware Module */ +#define TWI_VER_MFN_Pos 16 +#define TWI_VER_MFN_Msk (0x7u << TWI_VER_MFN_Pos) /**< \brief (TWI_VER) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_FLEXCOM_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_gmac.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_gmac.h new file mode 100644 index 000000000..10998bc33 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_gmac.h @@ -0,0 +1,1284 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_GMAC_COMPONENT_ +#define _SAMA5D2_GMAC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Gigabit Ethernet MAC */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_GMAC Gigabit Ethernet MAC */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief GmacSa hardware registers */ +typedef struct { + __IO uint32_t GMAC_SAB; /**< \brief (GmacSa Offset: 0x0) Specific Address 1 Bottom Register */ + __IO uint32_t GMAC_SAT; /**< \brief (GmacSa Offset: 0x4) Specific Address 1 Top Register */ +} GmacSa; +/** \brief Gmac hardware registers */ +#define GMACSA_NUMBER 4 +typedef struct { + __IO uint32_t GMAC_NCR; /**< \brief (Gmac Offset: 0x000) Network Control Register */ + __IO uint32_t GMAC_NCFGR; /**< \brief (Gmac Offset: 0x004) Network Configuration Register */ + __I uint32_t GMAC_NSR; /**< \brief (Gmac Offset: 0x008) Network Status Register */ + __IO uint32_t GMAC_UR; /**< \brief (Gmac Offset: 0x00C) User Register */ + __IO uint32_t GMAC_DCFGR; /**< \brief (Gmac Offset: 0x010) DMA Configuration Register */ + __IO uint32_t GMAC_TSR; /**< \brief (Gmac Offset: 0x014) Transmit Status Register */ + __IO uint32_t GMAC_RBQB; /**< \brief (Gmac Offset: 0x018) Receive Buffer Queue Base Address Register */ + __IO uint32_t GMAC_TBQB; /**< \brief (Gmac Offset: 0x01C) Transmit Buffer Queue Base Address Register */ + __IO uint32_t GMAC_RSR; /**< \brief (Gmac Offset: 0x020) Receive Status Register */ + __I uint32_t GMAC_ISR; /**< \brief (Gmac Offset: 0x024) Interrupt Status Register */ + __O uint32_t GMAC_IER; /**< \brief (Gmac Offset: 0x028) Interrupt Enable Register */ + __O uint32_t GMAC_IDR; /**< \brief (Gmac Offset: 0x02C) Interrupt Disable Register */ + __IO uint32_t GMAC_IMR; /**< \brief (Gmac Offset: 0x030) Interrupt Mask Register */ + __IO uint32_t GMAC_MAN; /**< \brief (Gmac Offset: 0x034) PHY Maintenance Register */ + __I uint32_t GMAC_RPQ; /**< \brief (Gmac Offset: 0x038) Received Pause Quantum Register */ + __IO uint32_t GMAC_TPQ; /**< \brief (Gmac Offset: 0x03C) Transmit Pause Quantum Register */ + __IO uint32_t GMAC_TPSF; /**< \brief (Gmac Offset: 0x040) TX Partial Store and Forward Register */ + __IO uint32_t GMAC_RPSF; /**< \brief (Gmac Offset: 0x044) RX Partial Store and Forward Register */ + __IO uint32_t GMAC_RJFML; /**< \brief (Gmac Offset: 0x048) RX Jumbo Frame Max Length Register */ + __I uint32_t Reserved1[13]; + __IO uint32_t GMAC_HRB; /**< \brief (Gmac Offset: 0x080) Hash Register Bottom */ + __IO uint32_t GMAC_HRT; /**< \brief (Gmac Offset: 0x084) Hash Register Top */ + GmacSa GMAC_SA[GMACSA_NUMBER]; /**< \brief (Gmac Offset: 0x088) 1 .. 4 */ + __IO uint32_t GMAC_TIDM1; /**< \brief (Gmac Offset: 0x0A8) Type ID Match 1 Register */ + __IO uint32_t GMAC_TIDM2; /**< \brief (Gmac Offset: 0x0AC) Type ID Match 2 Register */ + __IO uint32_t GMAC_TIDM3; /**< \brief (Gmac Offset: 0x0B0) Type ID Match 3 Register */ + __IO uint32_t GMAC_TIDM4; /**< \brief (Gmac Offset: 0x0B4) Type ID Match 4 Register */ + __IO uint32_t GMAC_WOL; /**< \brief (Gmac Offset: 0x0B8) Wake on LAN Register */ + __IO uint32_t GMAC_IPGS; /**< \brief (Gmac Offset: 0x0BC) IPG Stretch Register */ + __IO uint32_t GMAC_SVLAN; /**< \brief (Gmac Offset: 0x0C0) Stacked VLAN Register */ + __IO uint32_t GMAC_TPFCP; /**< \brief (Gmac Offset: 0x0C4) Transmit PFC Pause Register */ + __IO uint32_t GMAC_SAMB1; /**< \brief (Gmac Offset: 0x0C8) Specific Address 1 Mask Bottom Register */ + __IO uint32_t GMAC_SAMT1; /**< \brief (Gmac Offset: 0x0CC) Specific Address 1 Mask Top Register */ + __I uint32_t Reserved2[3]; + __IO uint32_t GMAC_NSC; /**< \brief (Gmac Offset: 0x0DC) 1588 Timer Nanosecond Comparison Register */ + __IO uint32_t GMAC_SCL; /**< \brief (Gmac Offset: 0x0E0) 1588 Timer Second Comparison Low Register */ + __IO uint32_t GMAC_SCH; /**< \brief (Gmac Offset: 0x0E4) 1588 Timer Second Comparison High Register */ + __I uint32_t GMAC_EFTSH; /**< \brief (Gmac Offset: 0x0E8) PTP Event Frame Transmitted Seconds High Register */ + __I uint32_t GMAC_EFRSH; /**< \brief (Gmac Offset: 0x0EC) PTP Event Frame Received Seconds High Register */ + __I uint32_t GMAC_PEFTSH; /**< \brief (Gmac Offset: 0x0F0) PTP Peer Event Frame Transmitted Seconds High Register */ + __I uint32_t GMAC_PEFRSH; /**< \brief (Gmac Offset: 0x0F4) PTP Peer Event Frame Received Seconds High Register */ + __I uint32_t Reserved3[1]; + __I uint32_t GMAC_MID; /**< \brief (Gmac Offset: 0x0FC) Module ID Register */ + __I uint32_t GMAC_OTLO; /**< \brief (Gmac Offset: 0x100) Octets Transmitted Low Register */ + __I uint32_t GMAC_OTHI; /**< \brief (Gmac Offset: 0x104) Octets Transmitted High Register */ + __I uint32_t GMAC_FT; /**< \brief (Gmac Offset: 0x108) Frames Transmitted Register */ + __I uint32_t GMAC_BCFT; /**< \brief (Gmac Offset: 0x10C) Broadcast Frames Transmitted Register */ + __I uint32_t GMAC_MFT; /**< \brief (Gmac Offset: 0x110) Multicast Frames Transmitted Register */ + __I uint32_t GMAC_PFT; /**< \brief (Gmac Offset: 0x114) Pause Frames Transmitted Register */ + __I uint32_t GMAC_BFT64; /**< \brief (Gmac Offset: 0x118) 64 Byte Frames Transmitted Register */ + __I uint32_t GMAC_TBFT127; /**< \brief (Gmac Offset: 0x11C) 65 to 127 Byte Frames Transmitted Register */ + __I uint32_t GMAC_TBFT255; /**< \brief (Gmac Offset: 0x120) 128 to 255 Byte Frames Transmitted Register */ + __I uint32_t GMAC_TBFT511; /**< \brief (Gmac Offset: 0x124) 256 to 511 Byte Frames Transmitted Register */ + __I uint32_t GMAC_TBFT1023; /**< \brief (Gmac Offset: 0x128) 512 to 1023 Byte Frames Transmitted Register */ + __I uint32_t GMAC_TBFT1518; /**< \brief (Gmac Offset: 0x12C) 1024 to 1518 Byte Frames Transmitted Register */ + __I uint32_t GMAC_GTBFT1518; /**< \brief (Gmac Offset: 0x130) Greater Than 1518 Byte Frames Transmitted Register */ + __I uint32_t GMAC_TUR; /**< \brief (Gmac Offset: 0x134) Transmit Underruns Register */ + __I uint32_t GMAC_SCF; /**< \brief (Gmac Offset: 0x138) Single Collision Frames Register */ + __I uint32_t GMAC_MCF; /**< \brief (Gmac Offset: 0x13C) Multiple Collision Frames Register */ + __I uint32_t GMAC_EC; /**< \brief (Gmac Offset: 0x140) Excessive Collisions Register */ + __I uint32_t GMAC_LC; /**< \brief (Gmac Offset: 0x144) Late Collisions Register */ + __I uint32_t GMAC_DTF; /**< \brief (Gmac Offset: 0x148) Deferred Transmission Frames Register */ + __I uint32_t GMAC_CSE; /**< \brief (Gmac Offset: 0x14C) Carrier Sense Errors Register */ + __I uint32_t GMAC_ORLO; /**< \brief (Gmac Offset: 0x150) Octets Received Low Received Register */ + __I uint32_t GMAC_ORHI; /**< \brief (Gmac Offset: 0x154) Octets Received High Received Register */ + __I uint32_t GMAC_FR; /**< \brief (Gmac Offset: 0x158) Frames Received Register */ + __I uint32_t GMAC_BCFR; /**< \brief (Gmac Offset: 0x15C) Broadcast Frames Received Register */ + __I uint32_t GMAC_MFR; /**< \brief (Gmac Offset: 0x160) Multicast Frames Received Register */ + __I uint32_t GMAC_PFR; /**< \brief (Gmac Offset: 0x164) Pause Frames Received Register */ + __I uint32_t GMAC_BFR64; /**< \brief (Gmac Offset: 0x168) 64 Byte Frames Received Register */ + __I uint32_t GMAC_TBFR127; /**< \brief (Gmac Offset: 0x16C) 65 to 127 Byte Frames Received Register */ + __I uint32_t GMAC_TBFR255; /**< \brief (Gmac Offset: 0x170) 128 to 255 Byte Frames Received Register */ + __I uint32_t GMAC_TBFR511; /**< \brief (Gmac Offset: 0x174) 256 to 511 Byte Frames Received Register */ + __I uint32_t GMAC_TBFR1023; /**< \brief (Gmac Offset: 0x178) 512 to 1023 Byte Frames Received Register */ + __I uint32_t GMAC_TBFR1518; /**< \brief (Gmac Offset: 0x17C) 1024 to 1518 Byte Frames Received Register */ + __I uint32_t GMAC_TMXBFR; /**< \brief (Gmac Offset: 0x180) 1519 to Maximum Byte Frames Received Register */ + __I uint32_t GMAC_UFR; /**< \brief (Gmac Offset: 0x184) Undersize Frames Received Register */ + __I uint32_t GMAC_OFR; /**< \brief (Gmac Offset: 0x188) Oversize Frames Received Register */ + __I uint32_t GMAC_JR; /**< \brief (Gmac Offset: 0x18C) Jabbers Received Register */ + __I uint32_t GMAC_FCSE; /**< \brief (Gmac Offset: 0x190) Frame Check Sequence Errors Register */ + __I uint32_t GMAC_LFFE; /**< \brief (Gmac Offset: 0x194) Length Field Frame Errors Register */ + __I uint32_t GMAC_RSE; /**< \brief (Gmac Offset: 0x198) Receive Symbol Errors Register */ + __I uint32_t GMAC_AE; /**< \brief (Gmac Offset: 0x19C) Alignment Errors Register */ + __I uint32_t GMAC_RRE; /**< \brief (Gmac Offset: 0x1A0) Receive Resource Errors Register */ + __I uint32_t GMAC_ROE; /**< \brief (Gmac Offset: 0x1A4) Receive Overrun Register */ + __I uint32_t GMAC_IHCE; /**< \brief (Gmac Offset: 0x1A8) IP Header Checksum Errors Register */ + __I uint32_t GMAC_TCE; /**< \brief (Gmac Offset: 0x1AC) TCP Checksum Errors Register */ + __I uint32_t GMAC_UCE; /**< \brief (Gmac Offset: 0x1B0) UDP Checksum Errors Register */ + __I uint32_t Reserved4[2]; + __IO uint32_t GMAC_TISUBN; /**< \brief (Gmac Offset: 0x1BC) 1588 Timer Increment Sub-nanoseconds Register */ + __IO uint32_t GMAC_TSH; /**< \brief (Gmac Offset: 0x1C0) 1588 Timer Seconds High Register */ + __I uint32_t Reserved5[3]; + __IO uint32_t GMAC_TSL; /**< \brief (Gmac Offset: 0x1D0) 1588 Timer Seconds Low Register */ + __IO uint32_t GMAC_TN; /**< \brief (Gmac Offset: 0x1D4) 1588 Timer Nanoseconds Register */ + __O uint32_t GMAC_TA; /**< \brief (Gmac Offset: 0x1D8) 1588 Timer Adjust Register */ + __IO uint32_t GMAC_TI; /**< \brief (Gmac Offset: 0x1DC) 1588 Timer Increment Register */ + __I uint32_t GMAC_EFTSL; /**< \brief (Gmac Offset: 0x1E0) PTP Event Frame Transmitted Seconds Low Register */ + __I uint32_t GMAC_EFTN; /**< \brief (Gmac Offset: 0x1E4) PTP Event Frame Transmitted Nanoseconds Register */ + __I uint32_t GMAC_EFRSL; /**< \brief (Gmac Offset: 0x1E8) PTP Event Frame Received Seconds Low Register */ + __I uint32_t GMAC_EFRN; /**< \brief (Gmac Offset: 0x1EC) PTP Event Frame Received Nanoseconds Register */ + __I uint32_t GMAC_PEFTSL; /**< \brief (Gmac Offset: 0x1F0) PTP Peer Event Frame Transmitted Seconds Low Register */ + __I uint32_t GMAC_PEFTN; /**< \brief (Gmac Offset: 0x1F4) PTP Peer Event Frame Transmitted Nanoseconds Register */ + __I uint32_t GMAC_PEFRSL; /**< \brief (Gmac Offset: 0x1F8) PTP Peer Event Frame Received Seconds Low Register */ + __I uint32_t GMAC_PEFRN; /**< \brief (Gmac Offset: 0x1FC) PTP Peer Event Frame Received Nanoseconds Register */ + __I uint32_t Reserved6[128]; + __I uint32_t GMAC_ISRPQ[2]; /**< \brief (Gmac Offset: 0x400) Interrupt Status Register Priority Queue (index = 1) */ + __I uint32_t Reserved7[14]; + __IO uint32_t GMAC_TBQBAPQ[2]; /**< \brief (Gmac Offset: 0x440) Transmit Buffer Queue Base Address Register Priority Queue (index = 1) */ + __I uint32_t Reserved8[14]; + __IO uint32_t GMAC_RBQBAPQ[2]; /**< \brief (Gmac Offset: 0x480) Receive Buffer Queue Base Address Register Priority Queue (index = 1) */ + __I uint32_t Reserved9[6]; + __IO uint32_t GMAC_RBSRPQ[2]; /**< \brief (Gmac Offset: 0x4A0) Receive Buffer Size Register Priority Queue (index = 1) */ + __I uint32_t Reserved10[5]; + __IO uint32_t GMAC_CBSCR; /**< \brief (Gmac Offset: 0x4BC) Credit-Based Shaping Control Register */ + __IO uint32_t GMAC_CBSISQA; /**< \brief (Gmac Offset: 0x4C0) Credit-Based Shaping IdleSlope Register for Queue A */ + __IO uint32_t GMAC_CBSISQB; /**< \brief (Gmac Offset: 0x4C4) Credit-Based Shaping IdleSlope Register for Queue B */ + __I uint32_t Reserved11[14]; + __IO uint32_t GMAC_ST1RPQ[4]; /**< \brief (Gmac Offset: 0x500) Screening Type 1 Register Priority Queue (index = 0) */ + __I uint32_t Reserved12[12]; + __IO uint32_t GMAC_ST2RPQ[8]; /**< \brief (Gmac Offset: 0x540) Screening Type 2 Register Priority Queue (index = 0) */ + __I uint32_t Reserved13[12]; + __I uint32_t Reserved14[28]; + __O uint32_t GMAC_IERPQ[2]; /**< \brief (Gmac Offset: 0x600) Interrupt Enable Register Priority Queue (index = 1) */ + __I uint32_t Reserved15[6]; + __O uint32_t GMAC_IDRPQ[2]; /**< \brief (Gmac Offset: 0x620) Interrupt Disable Register Priority Queue (index = 1) */ + __I uint32_t Reserved16[6]; + __IO uint32_t GMAC_IMRPQ[2]; /**< \brief (Gmac Offset: 0x640) Interrupt Mask Register Priority Queue (index = 1) */ + __I uint32_t Reserved17[38]; + __IO uint32_t GMAC_ST2ER[4]; /**< \brief (Gmac Offset: 0x6E0) Screening Type 2 Ethertype Register (index = 0) */ + __I uint32_t Reserved18[4]; + __IO uint32_t GMAC_ST2CW00; /**< \brief (Gmac Offset: 0x700) Screening Type 2 Compare Word 0 Register (index = 0) */ + __IO uint32_t GMAC_ST2CW10; /**< \brief (Gmac Offset: 0x704) Screening Type 2 Compare Word 1 Register (index = 0) */ + __IO uint32_t GMAC_ST2CW01; /**< \brief (Gmac Offset: 0x708) Screening Type 2 Compare Word 0 Register (index = 1) */ + __IO uint32_t GMAC_ST2CW11; /**< \brief (Gmac Offset: 0x70C) Screening Type 2 Compare Word 1 Register (index = 1) */ + __IO uint32_t GMAC_ST2CW02; /**< \brief (Gmac Offset: 0x710) Screening Type 2 Compare Word 0 Register (index = 2) */ + __IO uint32_t GMAC_ST2CW12; /**< \brief (Gmac Offset: 0x714) Screening Type 2 Compare Word 1 Register (index = 2) */ + __IO uint32_t GMAC_ST2CW03; /**< \brief (Gmac Offset: 0x718) Screening Type 2 Compare Word 0 Register (index = 3) */ + __IO uint32_t GMAC_ST2CW13; /**< \brief (Gmac Offset: 0x71C) Screening Type 2 Compare Word 1 Register (index = 3) */ + __IO uint32_t GMAC_ST2CW04; /**< \brief (Gmac Offset: 0x720) Screening Type 2 Compare Word 0 Register (index = 4) */ + __IO uint32_t GMAC_ST2CW14; /**< \brief (Gmac Offset: 0x724) Screening Type 2 Compare Word 1 Register (index = 4) */ + __IO uint32_t GMAC_ST2CW05; /**< \brief (Gmac Offset: 0x728) Screening Type 2 Compare Word 0 Register (index = 5) */ + __IO uint32_t GMAC_ST2CW15; /**< \brief (Gmac Offset: 0x72C) Screening Type 2 Compare Word 1 Register (index = 5) */ + __IO uint32_t GMAC_ST2CW06; /**< \brief (Gmac Offset: 0x730) Screening Type 2 Compare Word 0 Register (index = 6) */ + __IO uint32_t GMAC_ST2CW16; /**< \brief (Gmac Offset: 0x734) Screening Type 2 Compare Word 1 Register (index = 6) */ + __IO uint32_t GMAC_ST2CW07; /**< \brief (Gmac Offset: 0x738) Screening Type 2 Compare Word 0 Register (index = 7) */ + __IO uint32_t GMAC_ST2CW17; /**< \brief (Gmac Offset: 0x73C) Screening Type 2 Compare Word 1 Register (index = 7) */ + __IO uint32_t GMAC_ST2CW08; /**< \brief (Gmac Offset: 0x740) Screening Type 2 Compare Word 0 Register (index = 8) */ + __IO uint32_t GMAC_ST2CW18; /**< \brief (Gmac Offset: 0x744) Screening Type 2 Compare Word 1 Register (index = 8) */ + __IO uint32_t GMAC_ST2CW09; /**< \brief (Gmac Offset: 0x748) Screening Type 2 Compare Word 0 Register (index = 9) */ + __IO uint32_t GMAC_ST2CW19; /**< \brief (Gmac Offset: 0x74C) Screening Type 2 Compare Word 1 Register (index = 9) */ + __IO uint32_t GMAC_ST2CW010; /**< \brief (Gmac Offset: 0x750) Screening Type 2 Compare Word 0 Register (index = 10) */ + __IO uint32_t GMAC_ST2CW110; /**< \brief (Gmac Offset: 0x754) Screening Type 2 Compare Word 1 Register (index = 10) */ + __IO uint32_t GMAC_ST2CW011; /**< \brief (Gmac Offset: 0x758) Screening Type 2 Compare Word 0 Register (index = 11) */ + __IO uint32_t GMAC_ST2CW111; /**< \brief (Gmac Offset: 0x75C) Screening Type 2 Compare Word 1 Register (index = 11) */ + __IO uint32_t GMAC_ST2CW012; /**< \brief (Gmac Offset: 0x760) Screening Type 2 Compare Word 0 Register (index = 12) */ + __IO uint32_t GMAC_ST2CW112; /**< \brief (Gmac Offset: 0x764) Screening Type 2 Compare Word 1 Register (index = 12) */ + __IO uint32_t GMAC_ST2CW013; /**< \brief (Gmac Offset: 0x768) Screening Type 2 Compare Word 0 Register (index = 13) */ + __IO uint32_t GMAC_ST2CW113; /**< \brief (Gmac Offset: 0x76C) Screening Type 2 Compare Word 1 Register (index = 13) */ + __IO uint32_t GMAC_ST2CW014; /**< \brief (Gmac Offset: 0x770) Screening Type 2 Compare Word 0 Register (index = 14) */ + __IO uint32_t GMAC_ST2CW114; /**< \brief (Gmac Offset: 0x774) Screening Type 2 Compare Word 1 Register (index = 14) */ + __IO uint32_t GMAC_ST2CW015; /**< \brief (Gmac Offset: 0x778) Screening Type 2 Compare Word 0 Register (index = 15) */ + __IO uint32_t GMAC_ST2CW115; /**< \brief (Gmac Offset: 0x77C) Screening Type 2 Compare Word 1 Register (index = 15) */ + __IO uint32_t GMAC_ST2CW016; /**< \brief (Gmac Offset: 0x780) Screening Type 2 Compare Word 0 Register (index = 16) */ + __IO uint32_t GMAC_ST2CW116; /**< \brief (Gmac Offset: 0x784) Screening Type 2 Compare Word 1 Register (index = 16) */ + __IO uint32_t GMAC_ST2CW017; /**< \brief (Gmac Offset: 0x788) Screening Type 2 Compare Word 0 Register (index = 17) */ + __IO uint32_t GMAC_ST2CW117; /**< \brief (Gmac Offset: 0x78C) Screening Type 2 Compare Word 1 Register (index = 17) */ + __IO uint32_t GMAC_ST2CW018; /**< \brief (Gmac Offset: 0x790) Screening Type 2 Compare Word 0 Register (index = 18) */ + __IO uint32_t GMAC_ST2CW118; /**< \brief (Gmac Offset: 0x794) Screening Type 2 Compare Word 1 Register (index = 18) */ + __IO uint32_t GMAC_ST2CW019; /**< \brief (Gmac Offset: 0x798) Screening Type 2 Compare Word 0 Register (index = 19) */ + __IO uint32_t GMAC_ST2CW119; /**< \brief (Gmac Offset: 0x79C) Screening Type 2 Compare Word 1 Register (index = 19) */ + __IO uint32_t GMAC_ST2CW020; /**< \brief (Gmac Offset: 0x7A0) Screening Type 2 Compare Word 0 Register (index = 20) */ + __IO uint32_t GMAC_ST2CW120; /**< \brief (Gmac Offset: 0x7A4) Screening Type 2 Compare Word 1 Register (index = 20) */ + __IO uint32_t GMAC_ST2CW021; /**< \brief (Gmac Offset: 0x7A8) Screening Type 2 Compare Word 0 Register (index = 21) */ + __IO uint32_t GMAC_ST2CW121; /**< \brief (Gmac Offset: 0x7AC) Screening Type 2 Compare Word 1 Register (index = 21) */ + __IO uint32_t GMAC_ST2CW022; /**< \brief (Gmac Offset: 0x7B0) Screening Type 2 Compare Word 0 Register (index = 22) */ + __IO uint32_t GMAC_ST2CW122; /**< \brief (Gmac Offset: 0x7B4) Screening Type 2 Compare Word 1 Register (index = 22) */ + __IO uint32_t GMAC_ST2CW023; /**< \brief (Gmac Offset: 0x7B8) Screening Type 2 Compare Word 0 Register (index = 23) */ + __IO uint32_t GMAC_ST2CW123; /**< \brief (Gmac Offset: 0x7BC) Screening Type 2 Compare Word 1 Register (index = 23) */ +} Gmac; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- GMAC_NCR : (GMAC Offset: 0x000) Network Control Register -------- */ +#define GMAC_NCR_LBL (0x1u << 1) /**< \brief (GMAC_NCR) Loop Back Local */ +#define GMAC_NCR_RXEN (0x1u << 2) /**< \brief (GMAC_NCR) Receive Enable */ +#define GMAC_NCR_TXEN (0x1u << 3) /**< \brief (GMAC_NCR) Transmit Enable */ +#define GMAC_NCR_MPE (0x1u << 4) /**< \brief (GMAC_NCR) Management Port Enable */ +#define GMAC_NCR_CLRSTAT (0x1u << 5) /**< \brief (GMAC_NCR) Clear Statistics Registers */ +#define GMAC_NCR_INCSTAT (0x1u << 6) /**< \brief (GMAC_NCR) Increment Statistics Registers */ +#define GMAC_NCR_WESTAT (0x1u << 7) /**< \brief (GMAC_NCR) Write Enable for Statistics Registers */ +#define GMAC_NCR_BP (0x1u << 8) /**< \brief (GMAC_NCR) Back pressure */ +#define GMAC_NCR_TSTART (0x1u << 9) /**< \brief (GMAC_NCR) Start Transmission */ +#define GMAC_NCR_THALT (0x1u << 10) /**< \brief (GMAC_NCR) Transmit Halt */ +#define GMAC_NCR_TXPF (0x1u << 11) /**< \brief (GMAC_NCR) Transmit Pause Frame */ +#define GMAC_NCR_TXZQPF (0x1u << 12) /**< \brief (GMAC_NCR) Transmit Zero Quantum Pause Frame */ +#define GMAC_NCR_SRTSM (0x1u << 15) /**< \brief (GMAC_NCR) Store Receive Time Stamp to Memory */ +#define GMAC_NCR_ENPBPR (0x1u << 16) /**< \brief (GMAC_NCR) Enable PFC Priority-based Pause Reception */ +#define GMAC_NCR_TXPBPF (0x1u << 17) /**< \brief (GMAC_NCR) Transmit PFC Priority-based Pause Frame */ +#define GMAC_NCR_FNP (0x1u << 18) /**< \brief (GMAC_NCR) Flush Next Packet */ +/* -------- GMAC_NCFGR : (GMAC Offset: 0x004) Network Configuration Register -------- */ +#define GMAC_NCFGR_SPD (0x1u << 0) /**< \brief (GMAC_NCFGR) Speed */ +#define GMAC_NCFGR_FD (0x1u << 1) /**< \brief (GMAC_NCFGR) Full Duplex */ +#define GMAC_NCFGR_DNVLAN (0x1u << 2) /**< \brief (GMAC_NCFGR) Discard Non-VLAN FRAMES */ +#define GMAC_NCFGR_JFRAME (0x1u << 3) /**< \brief (GMAC_NCFGR) Jumbo Frame Size */ +#define GMAC_NCFGR_CAF (0x1u << 4) /**< \brief (GMAC_NCFGR) Copy All Frames */ +#define GMAC_NCFGR_NBC (0x1u << 5) /**< \brief (GMAC_NCFGR) No Broadcast */ +#define GMAC_NCFGR_MTIHEN (0x1u << 6) /**< \brief (GMAC_NCFGR) Multicast Hash Enable */ +#define GMAC_NCFGR_UNIHEN (0x1u << 7) /**< \brief (GMAC_NCFGR) Unicast Hash Enable */ +#define GMAC_NCFGR_MAXFS (0x1u << 8) /**< \brief (GMAC_NCFGR) 1536 Maximum Frame Size */ +#define GMAC_NCFGR_RTY (0x1u << 12) /**< \brief (GMAC_NCFGR) Retry Test */ +#define GMAC_NCFGR_PEN (0x1u << 13) /**< \brief (GMAC_NCFGR) Pause Enable */ +#define GMAC_NCFGR_RXBUFO_Pos 14 +#define GMAC_NCFGR_RXBUFO_Msk (0x3u << GMAC_NCFGR_RXBUFO_Pos) /**< \brief (GMAC_NCFGR) Receive Buffer Offset */ +#define GMAC_NCFGR_RXBUFO(value) ((GMAC_NCFGR_RXBUFO_Msk & ((value) << GMAC_NCFGR_RXBUFO_Pos))) +#define GMAC_NCFGR_LFERD (0x1u << 16) /**< \brief (GMAC_NCFGR) Length Field Error Frame Discard */ +#define GMAC_NCFGR_RFCS (0x1u << 17) /**< \brief (GMAC_NCFGR) Remove FCS */ +#define GMAC_NCFGR_CLK_Pos 18 +#define GMAC_NCFGR_CLK_Msk (0x7u << GMAC_NCFGR_CLK_Pos) /**< \brief (GMAC_NCFGR) MDC CLock Division */ +#define GMAC_NCFGR_CLK(value) ((GMAC_NCFGR_CLK_Msk & ((value) << GMAC_NCFGR_CLK_Pos))) +#define GMAC_NCFGR_CLK_MCK_8 (0x0u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 8 (MCK up to 20 MHz) */ +#define GMAC_NCFGR_CLK_MCK_16 (0x1u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 16 (MCK up to 40 MHz) */ +#define GMAC_NCFGR_CLK_MCK_32 (0x2u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 32 (MCK up to 80 MHz) */ +#define GMAC_NCFGR_CLK_MCK_48 (0x3u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 48 (MCK up to 120 MHz) */ +#define GMAC_NCFGR_CLK_MCK_64 (0x4u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 64 (MCK up to 160 MHz) */ +#define GMAC_NCFGR_CLK_MCK_96 (0x5u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 96 (MCK up to 240 MHz) */ +#define GMAC_NCFGR_DBW_Pos 21 +#define GMAC_NCFGR_DBW_Msk (0x3u << GMAC_NCFGR_DBW_Pos) /**< \brief (GMAC_NCFGR) Data Bus Width */ +#define GMAC_NCFGR_DBW(value) ((GMAC_NCFGR_DBW_Msk & ((value) << GMAC_NCFGR_DBW_Pos))) +#define GMAC_NCFGR_DCPF (0x1u << 23) /**< \brief (GMAC_NCFGR) Disable Copy of Pause Frames */ +#define GMAC_NCFGR_RXCOEN (0x1u << 24) /**< \brief (GMAC_NCFGR) Receive Checksum Offload Enable */ +#define GMAC_NCFGR_EFRHD (0x1u << 25) /**< \brief (GMAC_NCFGR) Enable Frames Received in Half Duplex */ +#define GMAC_NCFGR_IRXFCS (0x1u << 26) /**< \brief (GMAC_NCFGR) Ignore RX FCS */ +#define GMAC_NCFGR_IPGSEN (0x1u << 28) /**< \brief (GMAC_NCFGR) IP Stretch Enable */ +#define GMAC_NCFGR_RXBP (0x1u << 29) /**< \brief (GMAC_NCFGR) Receive Bad Preamble */ +#define GMAC_NCFGR_IRXER (0x1u << 30) /**< \brief (GMAC_NCFGR) Ignore IPG GRXER */ +/* -------- GMAC_NSR : (GMAC Offset: 0x008) Network Status Register -------- */ +#define GMAC_NSR_MDIO (0x1u << 1) /**< \brief (GMAC_NSR) MDIO Input Status */ +#define GMAC_NSR_IDLE (0x1u << 2) /**< \brief (GMAC_NSR) PHY Management Logic Idle */ +/* -------- GMAC_UR : (GMAC Offset: 0x00C) User Register -------- */ +#define GMAC_UR_RMII (0x1u << 0) /**< \brief (GMAC_UR) Reduced MII Mode */ +/* -------- GMAC_DCFGR : (GMAC Offset: 0x010) DMA Configuration Register -------- */ +#define GMAC_DCFGR_FBLDO_Pos 0 +#define GMAC_DCFGR_FBLDO_Msk (0x1fu << GMAC_DCFGR_FBLDO_Pos) /**< \brief (GMAC_DCFGR) Fixed Burst Length for DMA Data Operations: */ +#define GMAC_DCFGR_FBLDO(value) ((GMAC_DCFGR_FBLDO_Msk & ((value) << GMAC_DCFGR_FBLDO_Pos))) +#define GMAC_DCFGR_FBLDO_SINGLE (0x1u << 0) /**< \brief (GMAC_DCFGR) 00001: Always use SINGLE AHB bursts */ +#define GMAC_DCFGR_FBLDO_INCR4 (0x4u << 0) /**< \brief (GMAC_DCFGR) 001xx: Attempt to use INCR4 AHB bursts (Default) */ +#define GMAC_DCFGR_FBLDO_INCR8 (0x8u << 0) /**< \brief (GMAC_DCFGR) 01xxx: Attempt to use INCR8 AHB bursts */ +#define GMAC_DCFGR_FBLDO_INCR16 (0x10u << 0) /**< \brief (GMAC_DCFGR) 1xxxx: Attempt to use INCR16 AHB bursts */ +#define GMAC_DCFGR_ESMA (0x1u << 6) /**< \brief (GMAC_DCFGR) Endian Swap Mode Enable for Management Descriptor Accesses */ +#define GMAC_DCFGR_ESPA (0x1u << 7) /**< \brief (GMAC_DCFGR) Endian Swap Mode Enable for Packet Data Accesses */ +#define GMAC_DCFGR_RXBMS_Pos 8 +#define GMAC_DCFGR_RXBMS_Msk (0x3u << GMAC_DCFGR_RXBMS_Pos) /**< \brief (GMAC_DCFGR) Receiver Packet Buffer Memory Size Select */ +#define GMAC_DCFGR_RXBMS(value) ((GMAC_DCFGR_RXBMS_Msk & ((value) << GMAC_DCFGR_RXBMS_Pos))) +#define GMAC_DCFGR_RXBMS_EIGHTH (0x0u << 8) /**< \brief (GMAC_DCFGR) 4/8 Kbyte Memory Size */ +#define GMAC_DCFGR_RXBMS_QUARTER (0x1u << 8) /**< \brief (GMAC_DCFGR) 4/4 Kbytes Memory Size */ +#define GMAC_DCFGR_RXBMS_HALF (0x2u << 8) /**< \brief (GMAC_DCFGR) 4/2 Kbytes Memory Size */ +#define GMAC_DCFGR_RXBMS_FULL (0x3u << 8) /**< \brief (GMAC_DCFGR) 4 Kbytes Memory Size */ +#define GMAC_DCFGR_TXPBMS (0x1u << 10) /**< \brief (GMAC_DCFGR) Transmitter Packet Buffer Memory Size Select */ +#define GMAC_DCFGR_TXCOEN (0x1u << 11) /**< \brief (GMAC_DCFGR) Transmitter Checksum Generation Offload Enable */ +#define GMAC_DCFGR_DRBS_Pos 16 +#define GMAC_DCFGR_DRBS_Msk (0xffu << GMAC_DCFGR_DRBS_Pos) /**< \brief (GMAC_DCFGR) DMA Receive Buffer Size */ +#define GMAC_DCFGR_DRBS(value) ((GMAC_DCFGR_DRBS_Msk & ((value) << GMAC_DCFGR_DRBS_Pos))) +#define GMAC_DCFGR_DDRP (0x1u << 24) /**< \brief (GMAC_DCFGR) DMA Discard Receive Packets */ +/* -------- GMAC_TSR : (GMAC Offset: 0x014) Transmit Status Register -------- */ +#define GMAC_TSR_UBR (0x1u << 0) /**< \brief (GMAC_TSR) Used Bit Read */ +#define GMAC_TSR_COL (0x1u << 1) /**< \brief (GMAC_TSR) Collision Occurred */ +#define GMAC_TSR_RLE (0x1u << 2) /**< \brief (GMAC_TSR) Retry Limit Exceeded */ +#define GMAC_TSR_TXGO (0x1u << 3) /**< \brief (GMAC_TSR) Transmit Go */ +#define GMAC_TSR_TFC (0x1u << 4) /**< \brief (GMAC_TSR) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_TSR_TXCOMP (0x1u << 5) /**< \brief (GMAC_TSR) Transmit Complete */ +#define GMAC_TSR_HRESP (0x1u << 8) /**< \brief (GMAC_TSR) HRESP Not OK */ +/* -------- GMAC_RBQB : (GMAC Offset: 0x018) Receive Buffer Queue Base Address Register -------- */ +#define GMAC_RBQB_ADDR_Pos 2 +#define GMAC_RBQB_ADDR_Msk (0x3fffffffu << GMAC_RBQB_ADDR_Pos) /**< \brief (GMAC_RBQB) Receive Buffer Queue Base Address */ +#define GMAC_RBQB_ADDR(value) ((GMAC_RBQB_ADDR_Msk & ((value) << GMAC_RBQB_ADDR_Pos))) +/* -------- GMAC_TBQB : (GMAC Offset: 0x01C) Transmit Buffer Queue Base Address Register -------- */ +#define GMAC_TBQB_ADDR_Pos 2 +#define GMAC_TBQB_ADDR_Msk (0x3fffffffu << GMAC_TBQB_ADDR_Pos) /**< \brief (GMAC_TBQB) Transmit Buffer Queue Base Address */ +#define GMAC_TBQB_ADDR(value) ((GMAC_TBQB_ADDR_Msk & ((value) << GMAC_TBQB_ADDR_Pos))) +/* -------- GMAC_RSR : (GMAC Offset: 0x020) Receive Status Register -------- */ +#define GMAC_RSR_BNA (0x1u << 0) /**< \brief (GMAC_RSR) Buffer Not Available */ +#define GMAC_RSR_REC (0x1u << 1) /**< \brief (GMAC_RSR) Frame Received */ +#define GMAC_RSR_RXOVR (0x1u << 2) /**< \brief (GMAC_RSR) Receive Overrun */ +#define GMAC_RSR_HNO (0x1u << 3) /**< \brief (GMAC_RSR) HRESP Not OK */ +/* -------- GMAC_ISR : (GMAC Offset: 0x024) Interrupt Status Register -------- */ +#define GMAC_ISR_MFS (0x1u << 0) /**< \brief (GMAC_ISR) Management Frame Sent */ +#define GMAC_ISR_RCOMP (0x1u << 1) /**< \brief (GMAC_ISR) Receive Complete */ +#define GMAC_ISR_RXUBR (0x1u << 2) /**< \brief (GMAC_ISR) RX Used Bit Read */ +#define GMAC_ISR_TXUBR (0x1u << 3) /**< \brief (GMAC_ISR) TX Used Bit Read */ +#define GMAC_ISR_TUR (0x1u << 4) /**< \brief (GMAC_ISR) Transmit Underrun */ +#define GMAC_ISR_RLEX (0x1u << 5) /**< \brief (GMAC_ISR) Retry Limit Exceeded */ +#define GMAC_ISR_TFC (0x1u << 6) /**< \brief (GMAC_ISR) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_ISR_TCOMP (0x1u << 7) /**< \brief (GMAC_ISR) Transmit Complete */ +#define GMAC_ISR_ROVR (0x1u << 10) /**< \brief (GMAC_ISR) Receive Overrun */ +#define GMAC_ISR_HRESP (0x1u << 11) /**< \brief (GMAC_ISR) HRESP Not OK */ +#define GMAC_ISR_PFNZ (0x1u << 12) /**< \brief (GMAC_ISR) Pause Frame with Non-zero Pause Quantum Received */ +#define GMAC_ISR_PTZ (0x1u << 13) /**< \brief (GMAC_ISR) Pause Time Zero */ +#define GMAC_ISR_PFTR (0x1u << 14) /**< \brief (GMAC_ISR) Pause Frame Transmitted */ +#define GMAC_ISR_DRQFR (0x1u << 18) /**< \brief (GMAC_ISR) PTP Delay Request Frame Received */ +#define GMAC_ISR_SFR (0x1u << 19) /**< \brief (GMAC_ISR) PTP Sync Frame Received */ +#define GMAC_ISR_DRQFT (0x1u << 20) /**< \brief (GMAC_ISR) PTP Delay Request Frame Transmitted */ +#define GMAC_ISR_SFT (0x1u << 21) /**< \brief (GMAC_ISR) PTP Sync Frame Transmitted */ +#define GMAC_ISR_PDRQFR (0x1u << 22) /**< \brief (GMAC_ISR) PDelay Request Frame Received */ +#define GMAC_ISR_PDRSFR (0x1u << 23) /**< \brief (GMAC_ISR) PDelay Response Frame Received */ +#define GMAC_ISR_PDRQFT (0x1u << 24) /**< \brief (GMAC_ISR) PDelay Request Frame Transmitted */ +#define GMAC_ISR_PDRSFT (0x1u << 25) /**< \brief (GMAC_ISR) PDelay Response Frame Transmitted */ +#define GMAC_ISR_SRI (0x1u << 26) /**< \brief (GMAC_ISR) TSU Seconds Register Increment */ +#define GMAC_ISR_WOL (0x1u << 28) /**< \brief (GMAC_ISR) Wake On LAN */ +/* -------- GMAC_IER : (GMAC Offset: 0x028) Interrupt Enable Register -------- */ +#define GMAC_IER_MFS (0x1u << 0) /**< \brief (GMAC_IER) Management Frame Sent */ +#define GMAC_IER_RCOMP (0x1u << 1) /**< \brief (GMAC_IER) Receive Complete */ +#define GMAC_IER_RXUBR (0x1u << 2) /**< \brief (GMAC_IER) RX Used Bit Read */ +#define GMAC_IER_TXUBR (0x1u << 3) /**< \brief (GMAC_IER) TX Used Bit Read */ +#define GMAC_IER_TUR (0x1u << 4) /**< \brief (GMAC_IER) Transmit Underrun */ +#define GMAC_IER_RLEX (0x1u << 5) /**< \brief (GMAC_IER) Retry Limit Exceeded or Late Collision */ +#define GMAC_IER_TFC (0x1u << 6) /**< \brief (GMAC_IER) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_IER_TCOMP (0x1u << 7) /**< \brief (GMAC_IER) Transmit Complete */ +#define GMAC_IER_ROVR (0x1u << 10) /**< \brief (GMAC_IER) Receive Overrun */ +#define GMAC_IER_HRESP (0x1u << 11) /**< \brief (GMAC_IER) HRESP Not OK */ +#define GMAC_IER_PFNZ (0x1u << 12) /**< \brief (GMAC_IER) Pause Frame with Non-zero Pause Quantum Received */ +#define GMAC_IER_PTZ (0x1u << 13) /**< \brief (GMAC_IER) Pause Time Zero */ +#define GMAC_IER_PFTR (0x1u << 14) /**< \brief (GMAC_IER) Pause Frame Transmitted */ +#define GMAC_IER_EXINT (0x1u << 15) /**< \brief (GMAC_IER) External Interrupt */ +#define GMAC_IER_DRQFR (0x1u << 18) /**< \brief (GMAC_IER) PTP Delay Request Frame Received */ +#define GMAC_IER_SFR (0x1u << 19) /**< \brief (GMAC_IER) PTP Sync Frame Received */ +#define GMAC_IER_DRQFT (0x1u << 20) /**< \brief (GMAC_IER) PTP Delay Request Frame Transmitted */ +#define GMAC_IER_SFT (0x1u << 21) /**< \brief (GMAC_IER) PTP Sync Frame Transmitted */ +#define GMAC_IER_PDRQFR (0x1u << 22) /**< \brief (GMAC_IER) PDelay Request Frame Received */ +#define GMAC_IER_PDRSFR (0x1u << 23) /**< \brief (GMAC_IER) PDelay Response Frame Received */ +#define GMAC_IER_PDRQFT (0x1u << 24) /**< \brief (GMAC_IER) PDelay Request Frame Transmitted */ +#define GMAC_IER_PDRSFT (0x1u << 25) /**< \brief (GMAC_IER) PDelay Response Frame Transmitted */ +#define GMAC_IER_SRI (0x1u << 26) /**< \brief (GMAC_IER) TSU Seconds Register Increment */ +#define GMAC_IER_WOL (0x1u << 28) /**< \brief (GMAC_IER) Wake On LAN */ +/* -------- GMAC_IDR : (GMAC Offset: 0x02C) Interrupt Disable Register -------- */ +#define GMAC_IDR_MFS (0x1u << 0) /**< \brief (GMAC_IDR) Management Frame Sent */ +#define GMAC_IDR_RCOMP (0x1u << 1) /**< \brief (GMAC_IDR) Receive Complete */ +#define GMAC_IDR_RXUBR (0x1u << 2) /**< \brief (GMAC_IDR) RX Used Bit Read */ +#define GMAC_IDR_TXUBR (0x1u << 3) /**< \brief (GMAC_IDR) TX Used Bit Read */ +#define GMAC_IDR_TUR (0x1u << 4) /**< \brief (GMAC_IDR) Transmit Underrun */ +#define GMAC_IDR_RLEX (0x1u << 5) /**< \brief (GMAC_IDR) Retry Limit Exceeded or Late Collision */ +#define GMAC_IDR_TFC (0x1u << 6) /**< \brief (GMAC_IDR) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_IDR_TCOMP (0x1u << 7) /**< \brief (GMAC_IDR) Transmit Complete */ +#define GMAC_IDR_ROVR (0x1u << 10) /**< \brief (GMAC_IDR) Receive Overrun */ +#define GMAC_IDR_HRESP (0x1u << 11) /**< \brief (GMAC_IDR) HRESP Not OK */ +#define GMAC_IDR_PFNZ (0x1u << 12) /**< \brief (GMAC_IDR) Pause Frame with Non-zero Pause Quantum Received */ +#define GMAC_IDR_PTZ (0x1u << 13) /**< \brief (GMAC_IDR) Pause Time Zero */ +#define GMAC_IDR_PFTR (0x1u << 14) /**< \brief (GMAC_IDR) Pause Frame Transmitted */ +#define GMAC_IDR_EXINT (0x1u << 15) /**< \brief (GMAC_IDR) External Interrupt */ +#define GMAC_IDR_DRQFR (0x1u << 18) /**< \brief (GMAC_IDR) PTP Delay Request Frame Received */ +#define GMAC_IDR_SFR (0x1u << 19) /**< \brief (GMAC_IDR) PTP Sync Frame Received */ +#define GMAC_IDR_DRQFT (0x1u << 20) /**< \brief (GMAC_IDR) PTP Delay Request Frame Transmitted */ +#define GMAC_IDR_SFT (0x1u << 21) /**< \brief (GMAC_IDR) PTP Sync Frame Transmitted */ +#define GMAC_IDR_PDRQFR (0x1u << 22) /**< \brief (GMAC_IDR) PDelay Request Frame Received */ +#define GMAC_IDR_PDRSFR (0x1u << 23) /**< \brief (GMAC_IDR) PDelay Response Frame Received */ +#define GMAC_IDR_PDRQFT (0x1u << 24) /**< \brief (GMAC_IDR) PDelay Request Frame Transmitted */ +#define GMAC_IDR_PDRSFT (0x1u << 25) /**< \brief (GMAC_IDR) PDelay Response Frame Transmitted */ +#define GMAC_IDR_SRI (0x1u << 26) /**< \brief (GMAC_IDR) TSU Seconds Register Increment */ +#define GMAC_IDR_WOL (0x1u << 28) /**< \brief (GMAC_IDR) Wake On LAN */ +/* -------- GMAC_IMR : (GMAC Offset: 0x030) Interrupt Mask Register -------- */ +#define GMAC_IMR_MFS (0x1u << 0) /**< \brief (GMAC_IMR) Management Frame Sent */ +#define GMAC_IMR_RCOMP (0x1u << 1) /**< \brief (GMAC_IMR) Receive Complete */ +#define GMAC_IMR_RXUBR (0x1u << 2) /**< \brief (GMAC_IMR) RX Used Bit Read */ +#define GMAC_IMR_TXUBR (0x1u << 3) /**< \brief (GMAC_IMR) TX Used Bit Read */ +#define GMAC_IMR_TUR (0x1u << 4) /**< \brief (GMAC_IMR) Transmit Underrun */ +#define GMAC_IMR_RLEX (0x1u << 5) /**< \brief (GMAC_IMR) Retry Limit Exceeded */ +#define GMAC_IMR_TFC (0x1u << 6) /**< \brief (GMAC_IMR) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_IMR_TCOMP (0x1u << 7) /**< \brief (GMAC_IMR) Transmit Complete */ +#define GMAC_IMR_ROVR (0x1u << 10) /**< \brief (GMAC_IMR) Receive Overrun */ +#define GMAC_IMR_HRESP (0x1u << 11) /**< \brief (GMAC_IMR) HRESP Not OK */ +#define GMAC_IMR_PFNZ (0x1u << 12) /**< \brief (GMAC_IMR) Pause Frame with Non-zero Pause Quantum Received */ +#define GMAC_IMR_PTZ (0x1u << 13) /**< \brief (GMAC_IMR) Pause Time Zero */ +#define GMAC_IMR_PFTR (0x1u << 14) /**< \brief (GMAC_IMR) Pause Frame Transmitted */ +#define GMAC_IMR_EXINT (0x1u << 15) /**< \brief (GMAC_IMR) External Interrupt */ +#define GMAC_IMR_DRQFR (0x1u << 18) /**< \brief (GMAC_IMR) PTP Delay Request Frame Received */ +#define GMAC_IMR_SFR (0x1u << 19) /**< \brief (GMAC_IMR) PTP Sync Frame Received */ +#define GMAC_IMR_DRQFT (0x1u << 20) /**< \brief (GMAC_IMR) PTP Delay Request Frame Transmitted */ +#define GMAC_IMR_SFT (0x1u << 21) /**< \brief (GMAC_IMR) PTP Sync Frame Transmitted */ +#define GMAC_IMR_PDRQFR (0x1u << 22) /**< \brief (GMAC_IMR) PDelay Request Frame Received */ +#define GMAC_IMR_PDRSFR (0x1u << 23) /**< \brief (GMAC_IMR) PDelay Response Frame Received */ +#define GMAC_IMR_PDRQFT (0x1u << 24) /**< \brief (GMAC_IMR) PDelay Request Frame Transmitted */ +#define GMAC_IMR_PDRSFT (0x1u << 25) /**< \brief (GMAC_IMR) PDelay Response Frame Transmitted */ +/* -------- GMAC_MAN : (GMAC Offset: 0x034) PHY Maintenance Register -------- */ +#define GMAC_MAN_DATA_Pos 0 +#define GMAC_MAN_DATA_Msk (0xffffu << GMAC_MAN_DATA_Pos) /**< \brief (GMAC_MAN) PHY Data */ +#define GMAC_MAN_DATA(value) ((GMAC_MAN_DATA_Msk & ((value) << GMAC_MAN_DATA_Pos))) +#define GMAC_MAN_WTN_Pos 16 +#define GMAC_MAN_WTN_Msk (0x3u << GMAC_MAN_WTN_Pos) /**< \brief (GMAC_MAN) Write Ten */ +#define GMAC_MAN_WTN(value) ((GMAC_MAN_WTN_Msk & ((value) << GMAC_MAN_WTN_Pos))) +#define GMAC_MAN_REGA_Pos 18 +#define GMAC_MAN_REGA_Msk (0x1fu << GMAC_MAN_REGA_Pos) /**< \brief (GMAC_MAN) Register Address */ +#define GMAC_MAN_REGA(value) ((GMAC_MAN_REGA_Msk & ((value) << GMAC_MAN_REGA_Pos))) +#define GMAC_MAN_PHYA_Pos 23 +#define GMAC_MAN_PHYA_Msk (0x1fu << GMAC_MAN_PHYA_Pos) /**< \brief (GMAC_MAN) PHY Address */ +#define GMAC_MAN_PHYA(value) ((GMAC_MAN_PHYA_Msk & ((value) << GMAC_MAN_PHYA_Pos))) +#define GMAC_MAN_OP_Pos 28 +#define GMAC_MAN_OP_Msk (0x3u << GMAC_MAN_OP_Pos) /**< \brief (GMAC_MAN) Operation */ +#define GMAC_MAN_OP(value) ((GMAC_MAN_OP_Msk & ((value) << GMAC_MAN_OP_Pos))) +#define GMAC_MAN_CLTTO (0x1u << 30) /**< \brief (GMAC_MAN) Clause 22 Operation */ +#define GMAC_MAN_WZO (0x1u << 31) /**< \brief (GMAC_MAN) Write ZERO */ +/* -------- GMAC_RPQ : (GMAC Offset: 0x038) Received Pause Quantum Register -------- */ +#define GMAC_RPQ_RPQ_Pos 0 +#define GMAC_RPQ_RPQ_Msk (0xffffu << GMAC_RPQ_RPQ_Pos) /**< \brief (GMAC_RPQ) Received Pause Quantum */ +/* -------- GMAC_TPQ : (GMAC Offset: 0x03C) Transmit Pause Quantum Register -------- */ +#define GMAC_TPQ_TPQ_Pos 0 +#define GMAC_TPQ_TPQ_Msk (0xffffu << GMAC_TPQ_TPQ_Pos) /**< \brief (GMAC_TPQ) Transmit Pause Quantum */ +#define GMAC_TPQ_TPQ(value) ((GMAC_TPQ_TPQ_Msk & ((value) << GMAC_TPQ_TPQ_Pos))) +/* -------- GMAC_TPSF : (GMAC Offset: 0x040) TX Partial Store and Forward Register -------- */ +#define GMAC_TPSF_TPB1ADR_Pos 0 +#define GMAC_TPSF_TPB1ADR_Msk (0xfffu << GMAC_TPSF_TPB1ADR_Pos) /**< \brief (GMAC_TPSF) Transmit Partial Store and Forward Address */ +#define GMAC_TPSF_TPB1ADR(value) ((GMAC_TPSF_TPB1ADR_Msk & ((value) << GMAC_TPSF_TPB1ADR_Pos))) +#define GMAC_TPSF_ENTXP (0x1u << 31) /**< \brief (GMAC_TPSF) Enable TX Partial Store and Forward Operation */ +/* -------- GMAC_RPSF : (GMAC Offset: 0x044) RX Partial Store and Forward Register -------- */ +#define GMAC_RPSF_RPB1ADR_Pos 0 +#define GMAC_RPSF_RPB1ADR_Msk (0xfffu << GMAC_RPSF_RPB1ADR_Pos) /**< \brief (GMAC_RPSF) Receive Partial Store and Forward Address */ +#define GMAC_RPSF_RPB1ADR(value) ((GMAC_RPSF_RPB1ADR_Msk & ((value) << GMAC_RPSF_RPB1ADR_Pos))) +#define GMAC_RPSF_ENRXP (0x1u << 31) /**< \brief (GMAC_RPSF) Enable RX Partial Store and Forward Operation */ +/* -------- GMAC_RJFML : (GMAC Offset: 0x048) RX Jumbo Frame Max Length Register -------- */ +#define GMAC_RJFML_FML_Pos 0 +#define GMAC_RJFML_FML_Msk (0x3fffu << GMAC_RJFML_FML_Pos) /**< \brief (GMAC_RJFML) Frame Max Length */ +#define GMAC_RJFML_FML(value) ((GMAC_RJFML_FML_Msk & ((value) << GMAC_RJFML_FML_Pos))) +/* -------- GMAC_HRB : (GMAC Offset: 0x080) Hash Register Bottom -------- */ +#define GMAC_HRB_ADDR_Pos 0 +#define GMAC_HRB_ADDR_Msk (0xffffffffu << GMAC_HRB_ADDR_Pos) /**< \brief (GMAC_HRB) Hash Address */ +#define GMAC_HRB_ADDR(value) ((GMAC_HRB_ADDR_Msk & ((value) << GMAC_HRB_ADDR_Pos))) +/* -------- GMAC_HRT : (GMAC Offset: 0x084) Hash Register Top -------- */ +#define GMAC_HRT_ADDR_Pos 0 +#define GMAC_HRT_ADDR_Msk (0xffffffffu << GMAC_HRT_ADDR_Pos) /**< \brief (GMAC_HRT) Hash Address */ +#define GMAC_HRT_ADDR(value) ((GMAC_HRT_ADDR_Msk & ((value) << GMAC_HRT_ADDR_Pos))) +/* -------- GMAC_SAB : (GMAC Offset: N/A) Specific Address 1 Bottom Register -------- */ +#define GMAC_SAB_ADDR_Pos 0 +#define GMAC_SAB_ADDR_Msk (0xffffffffu << GMAC_SAB_ADDR_Pos) /**< \brief (GMAC_SAB) Specific Address 1 */ +#define GMAC_SAB_ADDR(value) ((GMAC_SAB_ADDR_Msk & ((value) << GMAC_SAB_ADDR_Pos))) +/* -------- GMAC_SAT : (GMAC Offset: N/A) Specific Address 1 Top Register -------- */ +#define GMAC_SAT_ADDR_Pos 0 +#define GMAC_SAT_ADDR_Msk (0xffffu << GMAC_SAT_ADDR_Pos) /**< \brief (GMAC_SAT) Specific Address 1 */ +#define GMAC_SAT_ADDR(value) ((GMAC_SAT_ADDR_Msk & ((value) << GMAC_SAT_ADDR_Pos))) +/* -------- GMAC_TIDM1 : (GMAC Offset: 0x0A8) Type ID Match 1 Register -------- */ +#define GMAC_TIDM1_TID_Pos 0 +#define GMAC_TIDM1_TID_Msk (0xffffu << GMAC_TIDM1_TID_Pos) /**< \brief (GMAC_TIDM1) Type ID Match 1 */ +#define GMAC_TIDM1_TID(value) ((GMAC_TIDM1_TID_Msk & ((value) << GMAC_TIDM1_TID_Pos))) +#define GMAC_TIDM1_ENID1 (0x1u << 31) /**< \brief (GMAC_TIDM1) Enable Copying of TID Matched Frames */ +/* -------- GMAC_TIDM2 : (GMAC Offset: 0x0AC) Type ID Match 2 Register -------- */ +#define GMAC_TIDM2_TID_Pos 0 +#define GMAC_TIDM2_TID_Msk (0xffffu << GMAC_TIDM2_TID_Pos) /**< \brief (GMAC_TIDM2) Type ID Match 2 */ +#define GMAC_TIDM2_TID(value) ((GMAC_TIDM2_TID_Msk & ((value) << GMAC_TIDM2_TID_Pos))) +#define GMAC_TIDM2_ENID2 (0x1u << 31) /**< \brief (GMAC_TIDM2) Enable Copying of TID Matched Frames */ +/* -------- GMAC_TIDM3 : (GMAC Offset: 0x0B0) Type ID Match 3 Register -------- */ +#define GMAC_TIDM3_TID_Pos 0 +#define GMAC_TIDM3_TID_Msk (0xffffu << GMAC_TIDM3_TID_Pos) /**< \brief (GMAC_TIDM3) Type ID Match 3 */ +#define GMAC_TIDM3_TID(value) ((GMAC_TIDM3_TID_Msk & ((value) << GMAC_TIDM3_TID_Pos))) +#define GMAC_TIDM3_ENID3 (0x1u << 31) /**< \brief (GMAC_TIDM3) Enable Copying of TID Matched Frames */ +/* -------- GMAC_TIDM4 : (GMAC Offset: 0x0B4) Type ID Match 4 Register -------- */ +#define GMAC_TIDM4_TID_Pos 0 +#define GMAC_TIDM4_TID_Msk (0xffffu << GMAC_TIDM4_TID_Pos) /**< \brief (GMAC_TIDM4) Type ID Match 4 */ +#define GMAC_TIDM4_TID(value) ((GMAC_TIDM4_TID_Msk & ((value) << GMAC_TIDM4_TID_Pos))) +#define GMAC_TIDM4_ENID4 (0x1u << 31) /**< \brief (GMAC_TIDM4) Enable Copying of TID Matched Frames */ +/* -------- GMAC_WOL : (GMAC Offset: 0x0B8) Wake on LAN Register -------- */ +#define GMAC_WOL_IP_Pos 0 +#define GMAC_WOL_IP_Msk (0xffffu << GMAC_WOL_IP_Pos) /**< \brief (GMAC_WOL) ARP Request IP Address */ +#define GMAC_WOL_IP(value) ((GMAC_WOL_IP_Msk & ((value) << GMAC_WOL_IP_Pos))) +#define GMAC_WOL_MAG (0x1u << 16) /**< \brief (GMAC_WOL) Magic Packet Event Enable */ +#define GMAC_WOL_ARP (0x1u << 17) /**< \brief (GMAC_WOL) ARP Request IP Address */ +#define GMAC_WOL_SA1 (0x1u << 18) /**< \brief (GMAC_WOL) Specific Address Register 1 Event Enable */ +#define GMAC_WOL_MTI (0x1u << 19) /**< \brief (GMAC_WOL) Multicast Hash Event Enable */ +/* -------- GMAC_IPGS : (GMAC Offset: 0x0BC) IPG Stretch Register -------- */ +#define GMAC_IPGS_FL_Pos 0 +#define GMAC_IPGS_FL_Msk (0xffffu << GMAC_IPGS_FL_Pos) /**< \brief (GMAC_IPGS) Frame Length */ +#define GMAC_IPGS_FL(value) ((GMAC_IPGS_FL_Msk & ((value) << GMAC_IPGS_FL_Pos))) +/* -------- GMAC_SVLAN : (GMAC Offset: 0x0C0) Stacked VLAN Register -------- */ +#define GMAC_SVLAN_VLAN_TYPE_Pos 0 +#define GMAC_SVLAN_VLAN_TYPE_Msk (0xffffu << GMAC_SVLAN_VLAN_TYPE_Pos) /**< \brief (GMAC_SVLAN) User Defined VLAN_TYPE Field */ +#define GMAC_SVLAN_VLAN_TYPE(value) ((GMAC_SVLAN_VLAN_TYPE_Msk & ((value) << GMAC_SVLAN_VLAN_TYPE_Pos))) +#define GMAC_SVLAN_ESVLAN (0x1u << 31) /**< \brief (GMAC_SVLAN) Enable Stacked VLAN Processing Mode */ +/* -------- GMAC_TPFCP : (GMAC Offset: 0x0C4) Transmit PFC Pause Register -------- */ +#define GMAC_TPFCP_PEV_Pos 0 +#define GMAC_TPFCP_PEV_Msk (0xffu << GMAC_TPFCP_PEV_Pos) /**< \brief (GMAC_TPFCP) Priority Enable Vector */ +#define GMAC_TPFCP_PEV(value) ((GMAC_TPFCP_PEV_Msk & ((value) << GMAC_TPFCP_PEV_Pos))) +#define GMAC_TPFCP_PQ_Pos 8 +#define GMAC_TPFCP_PQ_Msk (0xffu << GMAC_TPFCP_PQ_Pos) /**< \brief (GMAC_TPFCP) Pause Quantum */ +#define GMAC_TPFCP_PQ(value) ((GMAC_TPFCP_PQ_Msk & ((value) << GMAC_TPFCP_PQ_Pos))) +/* -------- GMAC_SAMB1 : (GMAC Offset: 0x0C8) Specific Address 1 Mask Bottom Register -------- */ +#define GMAC_SAMB1_ADDR_Pos 0 +#define GMAC_SAMB1_ADDR_Msk (0xffffffffu << GMAC_SAMB1_ADDR_Pos) /**< \brief (GMAC_SAMB1) Specific Address 1 Mask */ +#define GMAC_SAMB1_ADDR(value) ((GMAC_SAMB1_ADDR_Msk & ((value) << GMAC_SAMB1_ADDR_Pos))) +/* -------- GMAC_SAMT1 : (GMAC Offset: 0x0CC) Specific Address 1 Mask Top Register -------- */ +#define GMAC_SAMT1_ADDR_Pos 0 +#define GMAC_SAMT1_ADDR_Msk (0xffffu << GMAC_SAMT1_ADDR_Pos) /**< \brief (GMAC_SAMT1) Specific Address 1 Mask */ +#define GMAC_SAMT1_ADDR(value) ((GMAC_SAMT1_ADDR_Msk & ((value) << GMAC_SAMT1_ADDR_Pos))) +/* -------- GMAC_NSC : (GMAC Offset: 0x0DC) 1588 Timer Nanosecond Comparison Register -------- */ +#define GMAC_NSC_NANOSEC_Pos 0 +#define GMAC_NSC_NANOSEC_Msk (0x3fffffu << GMAC_NSC_NANOSEC_Pos) /**< \brief (GMAC_NSC) 1588 Timer Nanosecond Comparison Value */ +#define GMAC_NSC_NANOSEC(value) ((GMAC_NSC_NANOSEC_Msk & ((value) << GMAC_NSC_NANOSEC_Pos))) +/* -------- GMAC_SCL : (GMAC Offset: 0x0E0) 1588 Timer Second Comparison Low Register -------- */ +#define GMAC_SCL_SEC_Pos 0 +#define GMAC_SCL_SEC_Msk (0xffffffffu << GMAC_SCL_SEC_Pos) /**< \brief (GMAC_SCL) 1588 Timer Second Comparison Value */ +#define GMAC_SCL_SEC(value) ((GMAC_SCL_SEC_Msk & ((value) << GMAC_SCL_SEC_Pos))) +/* -------- GMAC_SCH : (GMAC Offset: 0x0E4) 1588 Timer Second Comparison High Register -------- */ +#define GMAC_SCH_SEC_Pos 0 +#define GMAC_SCH_SEC_Msk (0xffffu << GMAC_SCH_SEC_Pos) /**< \brief (GMAC_SCH) 1588 Timer Second Comparison Value */ +#define GMAC_SCH_SEC(value) ((GMAC_SCH_SEC_Msk & ((value) << GMAC_SCH_SEC_Pos))) +/* -------- GMAC_EFTSH : (GMAC Offset: 0x0E8) PTP Event Frame Transmitted Seconds High Register -------- */ +#define GMAC_EFTSH_RUD_Pos 0 +#define GMAC_EFTSH_RUD_Msk (0xffffu << GMAC_EFTSH_RUD_Pos) /**< \brief (GMAC_EFTSH) Register Update */ +/* -------- GMAC_EFRSH : (GMAC Offset: 0x0EC) PTP Event Frame Received Seconds High Register -------- */ +#define GMAC_EFRSH_RUD_Pos 0 +#define GMAC_EFRSH_RUD_Msk (0xffffu << GMAC_EFRSH_RUD_Pos) /**< \brief (GMAC_EFRSH) Register Update */ +/* -------- GMAC_PEFTSH : (GMAC Offset: 0x0F0) PTP Peer Event Frame Transmitted Seconds High Register -------- */ +#define GMAC_PEFTSH_RUD_Pos 0 +#define GMAC_PEFTSH_RUD_Msk (0xffffu << GMAC_PEFTSH_RUD_Pos) /**< \brief (GMAC_PEFTSH) Register Update */ +/* -------- GMAC_PEFRSH : (GMAC Offset: 0x0F4) PTP Peer Event Frame Received Seconds High Register -------- */ +#define GMAC_PEFRSH_RUD_Pos 0 +#define GMAC_PEFRSH_RUD_Msk (0xffffu << GMAC_PEFRSH_RUD_Pos) /**< \brief (GMAC_PEFRSH) Register Update */ +/* -------- GMAC_MID : (GMAC Offset: 0x0FC) Module ID Register -------- */ +#define GMAC_MID_MREV_Pos 0 +#define GMAC_MID_MREV_Msk (0xffffu << GMAC_MID_MREV_Pos) /**< \brief (GMAC_MID) Module Revision */ +#define GMAC_MID_MID_Pos 16 +#define GMAC_MID_MID_Msk (0xffffu << GMAC_MID_MID_Pos) /**< \brief (GMAC_MID) Module Identification Number */ +/* -------- GMAC_OTLO : (GMAC Offset: 0x100) Octets Transmitted Low Register -------- */ +#define GMAC_OTLO_TXO_Pos 0 +#define GMAC_OTLO_TXO_Msk (0xffffffffu << GMAC_OTLO_TXO_Pos) /**< \brief (GMAC_OTLO) Transmitted Octets */ +/* -------- GMAC_OTHI : (GMAC Offset: 0x104) Octets Transmitted High Register -------- */ +#define GMAC_OTHI_TXO_Pos 0 +#define GMAC_OTHI_TXO_Msk (0xffffu << GMAC_OTHI_TXO_Pos) /**< \brief (GMAC_OTHI) Transmitted Octets */ +/* -------- GMAC_FT : (GMAC Offset: 0x108) Frames Transmitted Register -------- */ +#define GMAC_FT_FTX_Pos 0 +#define GMAC_FT_FTX_Msk (0xffffffffu << GMAC_FT_FTX_Pos) /**< \brief (GMAC_FT) Frames Transmitted without Error */ +/* -------- GMAC_BCFT : (GMAC Offset: 0x10C) Broadcast Frames Transmitted Register -------- */ +#define GMAC_BCFT_BFTX_Pos 0 +#define GMAC_BCFT_BFTX_Msk (0xffffffffu << GMAC_BCFT_BFTX_Pos) /**< \brief (GMAC_BCFT) Broadcast Frames Transmitted without Error */ +/* -------- GMAC_MFT : (GMAC Offset: 0x110) Multicast Frames Transmitted Register -------- */ +#define GMAC_MFT_MFTX_Pos 0 +#define GMAC_MFT_MFTX_Msk (0xffffffffu << GMAC_MFT_MFTX_Pos) /**< \brief (GMAC_MFT) Multicast Frames Transmitted without Error */ +/* -------- GMAC_PFT : (GMAC Offset: 0x114) Pause Frames Transmitted Register -------- */ +#define GMAC_PFT_PFTX_Pos 0 +#define GMAC_PFT_PFTX_Msk (0xffffu << GMAC_PFT_PFTX_Pos) /**< \brief (GMAC_PFT) Pause Frames Transmitted Register */ +/* -------- GMAC_BFT64 : (GMAC Offset: 0x118) 64 Byte Frames Transmitted Register -------- */ +#define GMAC_BFT64_NFTX_Pos 0 +#define GMAC_BFT64_NFTX_Msk (0xffffffffu << GMAC_BFT64_NFTX_Pos) /**< \brief (GMAC_BFT64) 64 Byte Frames Transmitted without Error */ +/* -------- GMAC_TBFT127 : (GMAC Offset: 0x11C) 65 to 127 Byte Frames Transmitted Register -------- */ +#define GMAC_TBFT127_NFTX_Pos 0 +#define GMAC_TBFT127_NFTX_Msk (0xffffffffu << GMAC_TBFT127_NFTX_Pos) /**< \brief (GMAC_TBFT127) 65 to 127 Byte Frames Transmitted without Error */ +/* -------- GMAC_TBFT255 : (GMAC Offset: 0x120) 128 to 255 Byte Frames Transmitted Register -------- */ +#define GMAC_TBFT255_NFTX_Pos 0 +#define GMAC_TBFT255_NFTX_Msk (0xffffffffu << GMAC_TBFT255_NFTX_Pos) /**< \brief (GMAC_TBFT255) 128 to 255 Byte Frames Transmitted without Error */ +/* -------- GMAC_TBFT511 : (GMAC Offset: 0x124) 256 to 511 Byte Frames Transmitted Register -------- */ +#define GMAC_TBFT511_NFTX_Pos 0 +#define GMAC_TBFT511_NFTX_Msk (0xffffffffu << GMAC_TBFT511_NFTX_Pos) /**< \brief (GMAC_TBFT511) 256 to 511 Byte Frames Transmitted without Error */ +/* -------- GMAC_TBFT1023 : (GMAC Offset: 0x128) 512 to 1023 Byte Frames Transmitted Register -------- */ +#define GMAC_TBFT1023_NFTX_Pos 0 +#define GMAC_TBFT1023_NFTX_Msk (0xffffffffu << GMAC_TBFT1023_NFTX_Pos) /**< \brief (GMAC_TBFT1023) 512 to 1023 Byte Frames Transmitted without Error */ +/* -------- GMAC_TBFT1518 : (GMAC Offset: 0x12C) 1024 to 1518 Byte Frames Transmitted Register -------- */ +#define GMAC_TBFT1518_NFTX_Pos 0 +#define GMAC_TBFT1518_NFTX_Msk (0xffffffffu << GMAC_TBFT1518_NFTX_Pos) /**< \brief (GMAC_TBFT1518) 1024 to 1518 Byte Frames Transmitted without Error */ +/* -------- GMAC_GTBFT1518 : (GMAC Offset: 0x130) Greater Than 1518 Byte Frames Transmitted Register -------- */ +#define GMAC_GTBFT1518_NFTX_Pos 0 +#define GMAC_GTBFT1518_NFTX_Msk (0xffffffffu << GMAC_GTBFT1518_NFTX_Pos) /**< \brief (GMAC_GTBFT1518) Greater than 1518 Byte Frames Transmitted without Error */ +/* -------- GMAC_TUR : (GMAC Offset: 0x134) Transmit Underruns Register -------- */ +#define GMAC_TUR_TXUNR_Pos 0 +#define GMAC_TUR_TXUNR_Msk (0x3ffu << GMAC_TUR_TXUNR_Pos) /**< \brief (GMAC_TUR) Transmit Underruns */ +/* -------- GMAC_SCF : (GMAC Offset: 0x138) Single Collision Frames Register -------- */ +#define GMAC_SCF_SCOL_Pos 0 +#define GMAC_SCF_SCOL_Msk (0x3ffffu << GMAC_SCF_SCOL_Pos) /**< \brief (GMAC_SCF) Single Collision */ +/* -------- GMAC_MCF : (GMAC Offset: 0x13C) Multiple Collision Frames Register -------- */ +#define GMAC_MCF_MCOL_Pos 0 +#define GMAC_MCF_MCOL_Msk (0x3ffffu << GMAC_MCF_MCOL_Pos) /**< \brief (GMAC_MCF) Multiple Collision */ +/* -------- GMAC_EC : (GMAC Offset: 0x140) Excessive Collisions Register -------- */ +#define GMAC_EC_XCOL_Pos 0 +#define GMAC_EC_XCOL_Msk (0x3ffu << GMAC_EC_XCOL_Pos) /**< \brief (GMAC_EC) Excessive Collisions */ +/* -------- GMAC_LC : (GMAC Offset: 0x144) Late Collisions Register -------- */ +#define GMAC_LC_LCOL_Pos 0 +#define GMAC_LC_LCOL_Msk (0x3ffu << GMAC_LC_LCOL_Pos) /**< \brief (GMAC_LC) Late Collisions */ +/* -------- GMAC_DTF : (GMAC Offset: 0x148) Deferred Transmission Frames Register -------- */ +#define GMAC_DTF_DEFT_Pos 0 +#define GMAC_DTF_DEFT_Msk (0x3ffffu << GMAC_DTF_DEFT_Pos) /**< \brief (GMAC_DTF) Deferred Transmission */ +/* -------- GMAC_CSE : (GMAC Offset: 0x14C) Carrier Sense Errors Register -------- */ +#define GMAC_CSE_CSR_Pos 0 +#define GMAC_CSE_CSR_Msk (0x3ffu << GMAC_CSE_CSR_Pos) /**< \brief (GMAC_CSE) Carrier Sense Error */ +/* -------- GMAC_ORLO : (GMAC Offset: 0x150) Octets Received Low Received Register -------- */ +#define GMAC_ORLO_RXO_Pos 0 +#define GMAC_ORLO_RXO_Msk (0xffffffffu << GMAC_ORLO_RXO_Pos) /**< \brief (GMAC_ORLO) Received Octets */ +/* -------- GMAC_ORHI : (GMAC Offset: 0x154) Octets Received High Received Register -------- */ +#define GMAC_ORHI_RXO_Pos 0 +#define GMAC_ORHI_RXO_Msk (0xffffu << GMAC_ORHI_RXO_Pos) /**< \brief (GMAC_ORHI) Received Octets */ +/* -------- GMAC_FR : (GMAC Offset: 0x158) Frames Received Register -------- */ +#define GMAC_FR_FRX_Pos 0 +#define GMAC_FR_FRX_Msk (0xffffffffu << GMAC_FR_FRX_Pos) /**< \brief (GMAC_FR) Frames Received without Error */ +/* -------- GMAC_BCFR : (GMAC Offset: 0x15C) Broadcast Frames Received Register -------- */ +#define GMAC_BCFR_BFRX_Pos 0 +#define GMAC_BCFR_BFRX_Msk (0xffffffffu << GMAC_BCFR_BFRX_Pos) /**< \brief (GMAC_BCFR) Broadcast Frames Received without Error */ +/* -------- GMAC_MFR : (GMAC Offset: 0x160) Multicast Frames Received Register -------- */ +#define GMAC_MFR_MFRX_Pos 0 +#define GMAC_MFR_MFRX_Msk (0xffffffffu << GMAC_MFR_MFRX_Pos) /**< \brief (GMAC_MFR) Multicast Frames Received without Error */ +/* -------- GMAC_PFR : (GMAC Offset: 0x164) Pause Frames Received Register -------- */ +#define GMAC_PFR_PFRX_Pos 0 +#define GMAC_PFR_PFRX_Msk (0xffffu << GMAC_PFR_PFRX_Pos) /**< \brief (GMAC_PFR) Pause Frames Received Register */ +/* -------- GMAC_BFR64 : (GMAC Offset: 0x168) 64 Byte Frames Received Register -------- */ +#define GMAC_BFR64_NFRX_Pos 0 +#define GMAC_BFR64_NFRX_Msk (0xffffffffu << GMAC_BFR64_NFRX_Pos) /**< \brief (GMAC_BFR64) 64 Byte Frames Received without Error */ +/* -------- GMAC_TBFR127 : (GMAC Offset: 0x16C) 65 to 127 Byte Frames Received Register -------- */ +#define GMAC_TBFR127_NFRX_Pos 0 +#define GMAC_TBFR127_NFRX_Msk (0xffffffffu << GMAC_TBFR127_NFRX_Pos) /**< \brief (GMAC_TBFR127) 65 to 127 Byte Frames Received without Error */ +/* -------- GMAC_TBFR255 : (GMAC Offset: 0x170) 128 to 255 Byte Frames Received Register -------- */ +#define GMAC_TBFR255_NFRX_Pos 0 +#define GMAC_TBFR255_NFRX_Msk (0xffffffffu << GMAC_TBFR255_NFRX_Pos) /**< \brief (GMAC_TBFR255) 128 to 255 Byte Frames Received without Error */ +/* -------- GMAC_TBFR511 : (GMAC Offset: 0x174) 256 to 511 Byte Frames Received Register -------- */ +#define GMAC_TBFR511_NFRX_Pos 0 +#define GMAC_TBFR511_NFRX_Msk (0xffffffffu << GMAC_TBFR511_NFRX_Pos) /**< \brief (GMAC_TBFR511) 256 to 511 Byte Frames Received without Error */ +/* -------- GMAC_TBFR1023 : (GMAC Offset: 0x178) 512 to 1023 Byte Frames Received Register -------- */ +#define GMAC_TBFR1023_NFRX_Pos 0 +#define GMAC_TBFR1023_NFRX_Msk (0xffffffffu << GMAC_TBFR1023_NFRX_Pos) /**< \brief (GMAC_TBFR1023) 512 to 1023 Byte Frames Received without Error */ +/* -------- GMAC_TBFR1518 : (GMAC Offset: 0x17C) 1024 to 1518 Byte Frames Received Register -------- */ +#define GMAC_TBFR1518_NFRX_Pos 0 +#define GMAC_TBFR1518_NFRX_Msk (0xffffffffu << GMAC_TBFR1518_NFRX_Pos) /**< \brief (GMAC_TBFR1518) 1024 to 1518 Byte Frames Received without Error */ +/* -------- GMAC_TMXBFR : (GMAC Offset: 0x180) 1519 to Maximum Byte Frames Received Register -------- */ +#define GMAC_TMXBFR_NFRX_Pos 0 +#define GMAC_TMXBFR_NFRX_Msk (0xffffffffu << GMAC_TMXBFR_NFRX_Pos) /**< \brief (GMAC_TMXBFR) 1519 to Maximum Byte Frames Received without Error */ +/* -------- GMAC_UFR : (GMAC Offset: 0x184) Undersize Frames Received Register -------- */ +#define GMAC_UFR_UFRX_Pos 0 +#define GMAC_UFR_UFRX_Msk (0x3ffu << GMAC_UFR_UFRX_Pos) /**< \brief (GMAC_UFR) Undersize Frames Received */ +/* -------- GMAC_OFR : (GMAC Offset: 0x188) Oversize Frames Received Register -------- */ +#define GMAC_OFR_OFRX_Pos 0 +#define GMAC_OFR_OFRX_Msk (0x3ffu << GMAC_OFR_OFRX_Pos) /**< \brief (GMAC_OFR) Oversized Frames Received */ +/* -------- GMAC_JR : (GMAC Offset: 0x18C) Jabbers Received Register -------- */ +#define GMAC_JR_JRX_Pos 0 +#define GMAC_JR_JRX_Msk (0x3ffu << GMAC_JR_JRX_Pos) /**< \brief (GMAC_JR) Jabbers Received */ +/* -------- GMAC_FCSE : (GMAC Offset: 0x190) Frame Check Sequence Errors Register -------- */ +#define GMAC_FCSE_FCKR_Pos 0 +#define GMAC_FCSE_FCKR_Msk (0x3ffu << GMAC_FCSE_FCKR_Pos) /**< \brief (GMAC_FCSE) Frame Check Sequence Errors */ +/* -------- GMAC_LFFE : (GMAC Offset: 0x194) Length Field Frame Errors Register -------- */ +#define GMAC_LFFE_LFER_Pos 0 +#define GMAC_LFFE_LFER_Msk (0x3ffu << GMAC_LFFE_LFER_Pos) /**< \brief (GMAC_LFFE) Length Field Frame Errors */ +/* -------- GMAC_RSE : (GMAC Offset: 0x198) Receive Symbol Errors Register -------- */ +#define GMAC_RSE_RXSE_Pos 0 +#define GMAC_RSE_RXSE_Msk (0x3ffu << GMAC_RSE_RXSE_Pos) /**< \brief (GMAC_RSE) Receive Symbol Errors */ +/* -------- GMAC_AE : (GMAC Offset: 0x19C) Alignment Errors Register -------- */ +#define GMAC_AE_AER_Pos 0 +#define GMAC_AE_AER_Msk (0x3ffu << GMAC_AE_AER_Pos) /**< \brief (GMAC_AE) Alignment Errors */ +/* -------- GMAC_RRE : (GMAC Offset: 0x1A0) Receive Resource Errors Register -------- */ +#define GMAC_RRE_RXRER_Pos 0 +#define GMAC_RRE_RXRER_Msk (0x3ffffu << GMAC_RRE_RXRER_Pos) /**< \brief (GMAC_RRE) Receive Resource Errors */ +/* -------- GMAC_ROE : (GMAC Offset: 0x1A4) Receive Overrun Register -------- */ +#define GMAC_ROE_RXOVR_Pos 0 +#define GMAC_ROE_RXOVR_Msk (0x3ffu << GMAC_ROE_RXOVR_Pos) /**< \brief (GMAC_ROE) Receive Overruns */ +/* -------- GMAC_IHCE : (GMAC Offset: 0x1A8) IP Header Checksum Errors Register -------- */ +#define GMAC_IHCE_HCKER_Pos 0 +#define GMAC_IHCE_HCKER_Msk (0xffu << GMAC_IHCE_HCKER_Pos) /**< \brief (GMAC_IHCE) IP Header Checksum Errors */ +/* -------- GMAC_TCE : (GMAC Offset: 0x1AC) TCP Checksum Errors Register -------- */ +#define GMAC_TCE_TCKER_Pos 0 +#define GMAC_TCE_TCKER_Msk (0xffu << GMAC_TCE_TCKER_Pos) /**< \brief (GMAC_TCE) TCP Checksum Errors */ +/* -------- GMAC_UCE : (GMAC Offset: 0x1B0) UDP Checksum Errors Register -------- */ +#define GMAC_UCE_UCKER_Pos 0 +#define GMAC_UCE_UCKER_Msk (0xffu << GMAC_UCE_UCKER_Pos) /**< \brief (GMAC_UCE) UDP Checksum Errors */ +/* -------- GMAC_TISUBN : (GMAC Offset: 0x1BC) 1588 Timer Increment Sub-nanoseconds Register -------- */ +#define GMAC_TISUBN_LSBTIR_Pos 0 +#define GMAC_TISUBN_LSBTIR_Msk (0xffffu << GMAC_TISUBN_LSBTIR_Pos) /**< \brief (GMAC_TISUBN) Lower Significant Bits of Timer Increment Register */ +#define GMAC_TISUBN_LSBTIR(value) ((GMAC_TISUBN_LSBTIR_Msk & ((value) << GMAC_TISUBN_LSBTIR_Pos))) +/* -------- GMAC_TSH : (GMAC Offset: 0x1C0) 1588 Timer Seconds High Register -------- */ +#define GMAC_TSH_TCS_Pos 0 +#define GMAC_TSH_TCS_Msk (0xffffu << GMAC_TSH_TCS_Pos) /**< \brief (GMAC_TSH) Timer Count in Seconds */ +#define GMAC_TSH_TCS(value) ((GMAC_TSH_TCS_Msk & ((value) << GMAC_TSH_TCS_Pos))) +/* -------- GMAC_TSL : (GMAC Offset: 0x1D0) 1588 Timer Seconds Low Register -------- */ +#define GMAC_TSL_TCS_Pos 0 +#define GMAC_TSL_TCS_Msk (0xffffffffu << GMAC_TSL_TCS_Pos) /**< \brief (GMAC_TSL) Timer Count in Seconds */ +#define GMAC_TSL_TCS(value) ((GMAC_TSL_TCS_Msk & ((value) << GMAC_TSL_TCS_Pos))) +/* -------- GMAC_TN : (GMAC Offset: 0x1D4) 1588 Timer Nanoseconds Register -------- */ +#define GMAC_TN_TNS_Pos 0 +#define GMAC_TN_TNS_Msk (0x3fffffffu << GMAC_TN_TNS_Pos) /**< \brief (GMAC_TN) Timer Count in Nanoseconds */ +#define GMAC_TN_TNS(value) ((GMAC_TN_TNS_Msk & ((value) << GMAC_TN_TNS_Pos))) +/* -------- GMAC_TA : (GMAC Offset: 0x1D8) 1588 Timer Adjust Register -------- */ +#define GMAC_TA_ITDT_Pos 0 +#define GMAC_TA_ITDT_Msk (0x3fffffffu << GMAC_TA_ITDT_Pos) /**< \brief (GMAC_TA) Increment/Decrement */ +#define GMAC_TA_ITDT(value) ((GMAC_TA_ITDT_Msk & ((value) << GMAC_TA_ITDT_Pos))) +#define GMAC_TA_ADJ (0x1u << 31) /**< \brief (GMAC_TA) Adjust 1588 Timer */ +/* -------- GMAC_TI : (GMAC Offset: 0x1DC) 1588 Timer Increment Register -------- */ +#define GMAC_TI_CNS_Pos 0 +#define GMAC_TI_CNS_Msk (0xffu << GMAC_TI_CNS_Pos) /**< \brief (GMAC_TI) Count Nanoseconds */ +#define GMAC_TI_CNS(value) ((GMAC_TI_CNS_Msk & ((value) << GMAC_TI_CNS_Pos))) +#define GMAC_TI_ACNS_Pos 8 +#define GMAC_TI_ACNS_Msk (0xffu << GMAC_TI_ACNS_Pos) /**< \brief (GMAC_TI) Alternative Count Nanoseconds */ +#define GMAC_TI_ACNS(value) ((GMAC_TI_ACNS_Msk & ((value) << GMAC_TI_ACNS_Pos))) +#define GMAC_TI_NIT_Pos 16 +#define GMAC_TI_NIT_Msk (0xffu << GMAC_TI_NIT_Pos) /**< \brief (GMAC_TI) Number of Increments */ +#define GMAC_TI_NIT(value) ((GMAC_TI_NIT_Msk & ((value) << GMAC_TI_NIT_Pos))) +/* -------- GMAC_EFTSL : (GMAC Offset: 0x1E0) PTP Event Frame Transmitted Seconds Low Register -------- */ +#define GMAC_EFTSL_RUD_Pos 0 +#define GMAC_EFTSL_RUD_Msk (0xffffffffu << GMAC_EFTSL_RUD_Pos) /**< \brief (GMAC_EFTSL) Register Update */ +/* -------- GMAC_EFTN : (GMAC Offset: 0x1E4) PTP Event Frame Transmitted Nanoseconds Register -------- */ +#define GMAC_EFTN_RUD_Pos 0 +#define GMAC_EFTN_RUD_Msk (0x3fffffffu << GMAC_EFTN_RUD_Pos) /**< \brief (GMAC_EFTN) Register Update */ +/* -------- GMAC_EFRSL : (GMAC Offset: 0x1E8) PTP Event Frame Received Seconds Low Register -------- */ +#define GMAC_EFRSL_RUD_Pos 0 +#define GMAC_EFRSL_RUD_Msk (0xffffffffu << GMAC_EFRSL_RUD_Pos) /**< \brief (GMAC_EFRSL) Register Update */ +/* -------- GMAC_EFRN : (GMAC Offset: 0x1EC) PTP Event Frame Received Nanoseconds Register -------- */ +#define GMAC_EFRN_RUD_Pos 0 +#define GMAC_EFRN_RUD_Msk (0x3fffffffu << GMAC_EFRN_RUD_Pos) /**< \brief (GMAC_EFRN) Register Update */ +/* -------- GMAC_PEFTSL : (GMAC Offset: 0x1F0) PTP Peer Event Frame Transmitted Seconds Low Register -------- */ +#define GMAC_PEFTSL_RUD_Pos 0 +#define GMAC_PEFTSL_RUD_Msk (0xffffffffu << GMAC_PEFTSL_RUD_Pos) /**< \brief (GMAC_PEFTSL) Register Update */ +/* -------- GMAC_PEFTN : (GMAC Offset: 0x1F4) PTP Peer Event Frame Transmitted Nanoseconds Register -------- */ +#define GMAC_PEFTN_RUD_Pos 0 +#define GMAC_PEFTN_RUD_Msk (0x3fffffffu << GMAC_PEFTN_RUD_Pos) /**< \brief (GMAC_PEFTN) Register Update */ +/* -------- GMAC_PEFRSL : (GMAC Offset: 0x1F8) PTP Peer Event Frame Received Seconds Low Register -------- */ +#define GMAC_PEFRSL_RUD_Pos 0 +#define GMAC_PEFRSL_RUD_Msk (0xffffffffu << GMAC_PEFRSL_RUD_Pos) /**< \brief (GMAC_PEFRSL) Register Update */ +/* -------- GMAC_PEFRN : (GMAC Offset: 0x1FC) PTP Peer Event Frame Received Nanoseconds Register -------- */ +#define GMAC_PEFRN_RUD_Pos 0 +#define GMAC_PEFRN_RUD_Msk (0x3fffffffu << GMAC_PEFRN_RUD_Pos) /**< \brief (GMAC_PEFRN) Register Update */ +/* -------- GMAC_ISRPQ[2] : (GMAC Offset: 0x400) Interrupt Status Register Priority Queue (index = 1) -------- */ +#define GMAC_ISRPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_ISRPQ[2]) Receive Complete */ +#define GMAC_ISRPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_ISRPQ[2]) RX Used Bit Read */ +#define GMAC_ISRPQ_RLEX (0x1u << 5) /**< \brief (GMAC_ISRPQ[2]) Retry Limit Exceeded or Late Collision */ +#define GMAC_ISRPQ_TFC (0x1u << 6) /**< \brief (GMAC_ISRPQ[2]) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_ISRPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_ISRPQ[2]) Transmit Complete */ +#define GMAC_ISRPQ_ROVR (0x1u << 10) /**< \brief (GMAC_ISRPQ[2]) Receive Overrun */ +#define GMAC_ISRPQ_HRESP (0x1u << 11) /**< \brief (GMAC_ISRPQ[2]) HRESP Not OK */ +/* -------- GMAC_TBQBAPQ[2] : (GMAC Offset: 0x440) Transmit Buffer Queue Base Address Register Priority Queue (index = 1) -------- */ +#define GMAC_TBQBAPQ_TXBQBA_Pos 2 +#define GMAC_TBQBAPQ_TXBQBA_Msk (0x3fffffffu << GMAC_TBQBAPQ_TXBQBA_Pos) /**< \brief (GMAC_TBQBAPQ[2]) Transmit Buffer Queue Base Address */ +#define GMAC_TBQBAPQ_TXBQBA(value) ((GMAC_TBQBAPQ_TXBQBA_Msk & ((value) << GMAC_TBQBAPQ_TXBQBA_Pos))) +/* -------- GMAC_RBQBAPQ[2] : (GMAC Offset: 0x480) Receive Buffer Queue Base Address Register Priority Queue (index = 1) -------- */ +#define GMAC_RBQBAPQ_RXBQBA_Pos 2 +#define GMAC_RBQBAPQ_RXBQBA_Msk (0x3fffffffu << GMAC_RBQBAPQ_RXBQBA_Pos) /**< \brief (GMAC_RBQBAPQ[2]) Receive Buffer Queue Base Address */ +#define GMAC_RBQBAPQ_RXBQBA(value) ((GMAC_RBQBAPQ_RXBQBA_Msk & ((value) << GMAC_RBQBAPQ_RXBQBA_Pos))) +/* -------- GMAC_RBSRPQ[2] : (GMAC Offset: 0x4A0) Receive Buffer Size Register Priority Queue (index = 1) -------- */ +#define GMAC_RBSRPQ_RBS_Pos 0 +#define GMAC_RBSRPQ_RBS_Msk (0xffffu << GMAC_RBSRPQ_RBS_Pos) /**< \brief (GMAC_RBSRPQ[2]) Receive Buffer Size */ +#define GMAC_RBSRPQ_RBS(value) ((GMAC_RBSRPQ_RBS_Msk & ((value) << GMAC_RBSRPQ_RBS_Pos))) +/* -------- GMAC_CBSCR : (GMAC Offset: 0x4BC) Credit-Based Shaping Control Register -------- */ +#define GMAC_CBSCR_QBE (0x1u << 0) /**< \brief (GMAC_CBSCR) Queue B CBS Enable */ +#define GMAC_CBSCR_QAE (0x1u << 1) /**< \brief (GMAC_CBSCR) Queue A CBS Enable */ +/* -------- GMAC_CBSISQA : (GMAC Offset: 0x4C0) Credit-Based Shaping IdleSlope Register for Queue A -------- */ +#define GMAC_CBSISQA_IS_Pos 0 +#define GMAC_CBSISQA_IS_Msk (0xffffffffu << GMAC_CBSISQA_IS_Pos) /**< \brief (GMAC_CBSISQA) IdleSlope */ +#define GMAC_CBSISQA_IS(value) ((GMAC_CBSISQA_IS_Msk & ((value) << GMAC_CBSISQA_IS_Pos))) +/* -------- GMAC_CBSISQB : (GMAC Offset: 0x4C4) Credit-Based Shaping IdleSlope Register for Queue B -------- */ +#define GMAC_CBSISQB_IS_Pos 0 +#define GMAC_CBSISQB_IS_Msk (0xffffffffu << GMAC_CBSISQB_IS_Pos) /**< \brief (GMAC_CBSISQB) IdleSlope */ +#define GMAC_CBSISQB_IS(value) ((GMAC_CBSISQB_IS_Msk & ((value) << GMAC_CBSISQB_IS_Pos))) +/* -------- GMAC_ST1RPQ[4] : (GMAC Offset: 0x500) Screening Type 1 Register Priority Queue (index = 0) -------- */ +#define GMAC_ST1RPQ_QNB_Pos 0 +#define GMAC_ST1RPQ_QNB_Msk (0x7u << GMAC_ST1RPQ_QNB_Pos) /**< \brief (GMAC_ST1RPQ[4]) Queue Number (0-2) */ +#define GMAC_ST1RPQ_QNB(value) ((GMAC_ST1RPQ_QNB_Msk & ((value) << GMAC_ST1RPQ_QNB_Pos))) +#define GMAC_ST1RPQ_DSTCM_Pos 4 +#define GMAC_ST1RPQ_DSTCM_Msk (0xffu << GMAC_ST1RPQ_DSTCM_Pos) /**< \brief (GMAC_ST1RPQ[4]) Differentiated Services or Traffic Class Match */ +#define GMAC_ST1RPQ_DSTCM(value) ((GMAC_ST1RPQ_DSTCM_Msk & ((value) << GMAC_ST1RPQ_DSTCM_Pos))) +#define GMAC_ST1RPQ_UDPM_Pos 12 +#define GMAC_ST1RPQ_UDPM_Msk (0xffffu << GMAC_ST1RPQ_UDPM_Pos) /**< \brief (GMAC_ST1RPQ[4]) UDP Port Match */ +#define GMAC_ST1RPQ_UDPM(value) ((GMAC_ST1RPQ_UDPM_Msk & ((value) << GMAC_ST1RPQ_UDPM_Pos))) +#define GMAC_ST1RPQ_DSTCE (0x1u << 28) /**< \brief (GMAC_ST1RPQ[4]) Differentiated Services or Traffic Class Match Enable */ +#define GMAC_ST1RPQ_UDPE (0x1u << 29) /**< \brief (GMAC_ST1RPQ[4]) UDP Port Match Enable */ +/* -------- GMAC_ST2RPQ[8] : (GMAC Offset: 0x540) Screening Type 2 Register Priority Queue (index = 0) -------- */ +#define GMAC_ST2RPQ_QNB_Pos 0 +#define GMAC_ST2RPQ_QNB_Msk (0x7u << GMAC_ST2RPQ_QNB_Pos) /**< \brief (GMAC_ST2RPQ[8]) Queue Number (0-2) */ +#define GMAC_ST2RPQ_QNB(value) ((GMAC_ST2RPQ_QNB_Msk & ((value) << GMAC_ST2RPQ_QNB_Pos))) +#define GMAC_ST2RPQ_VLANP_Pos 4 +#define GMAC_ST2RPQ_VLANP_Msk (0x7u << GMAC_ST2RPQ_VLANP_Pos) /**< \brief (GMAC_ST2RPQ[8]) VLAN Priority */ +#define GMAC_ST2RPQ_VLANP(value) ((GMAC_ST2RPQ_VLANP_Msk & ((value) << GMAC_ST2RPQ_VLANP_Pos))) +#define GMAC_ST2RPQ_VLANE (0x1u << 8) /**< \brief (GMAC_ST2RPQ[8]) VLAN Enable */ +#define GMAC_ST2RPQ_I2ETH_Pos 9 +#define GMAC_ST2RPQ_I2ETH_Msk (0x7u << GMAC_ST2RPQ_I2ETH_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 EtherType register x */ +#define GMAC_ST2RPQ_I2ETH(value) ((GMAC_ST2RPQ_I2ETH_Msk & ((value) << GMAC_ST2RPQ_I2ETH_Pos))) +#define GMAC_ST2RPQ_ETHE (0x1u << 12) /**< \brief (GMAC_ST2RPQ[8]) EtherType Enable */ +#define GMAC_ST2RPQ_COMPA_Pos 13 +#define GMAC_ST2RPQ_COMPA_Msk (0x1fu << GMAC_ST2RPQ_COMPA_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 Compare Word 0/Word 1 register x */ +#define GMAC_ST2RPQ_COMPA(value) ((GMAC_ST2RPQ_COMPA_Msk & ((value) << GMAC_ST2RPQ_COMPA_Pos))) +#define GMAC_ST2RPQ_COMPAE (0x1u << 18) /**< \brief (GMAC_ST2RPQ[8]) Compare A Enable */ +#define GMAC_ST2RPQ_COMPB_Pos 19 +#define GMAC_ST2RPQ_COMPB_Msk (0x1fu << GMAC_ST2RPQ_COMPB_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 Compare Word 0/Word 1 register x */ +#define GMAC_ST2RPQ_COMPB(value) ((GMAC_ST2RPQ_COMPB_Msk & ((value) << GMAC_ST2RPQ_COMPB_Pos))) +#define GMAC_ST2RPQ_COMPBE (0x1u << 24) /**< \brief (GMAC_ST2RPQ[8]) Compare B Enable */ +#define GMAC_ST2RPQ_COMPC_Pos 25 +#define GMAC_ST2RPQ_COMPC_Msk (0x1fu << GMAC_ST2RPQ_COMPC_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 Compare Word 0/Word 1 register x */ +#define GMAC_ST2RPQ_COMPC(value) ((GMAC_ST2RPQ_COMPC_Msk & ((value) << GMAC_ST2RPQ_COMPC_Pos))) +#define GMAC_ST2RPQ_COMPCE (0x1u << 30) /**< \brief (GMAC_ST2RPQ[8]) Compare C Enable */ +/* -------- GMAC_IERPQ[2] : (GMAC Offset: 0x600) Interrupt Enable Register Priority Queue (index = 1) -------- */ +#define GMAC_IERPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_IERPQ[2]) Receive Complete */ +#define GMAC_IERPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_IERPQ[2]) RX Used Bit Read */ +#define GMAC_IERPQ_RLEX (0x1u << 5) /**< \brief (GMAC_IERPQ[2]) Retry Limit Exceeded or Late Collision */ +#define GMAC_IERPQ_TFC (0x1u << 6) /**< \brief (GMAC_IERPQ[2]) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_IERPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_IERPQ[2]) Transmit Complete */ +#define GMAC_IERPQ_ROVR (0x1u << 10) /**< \brief (GMAC_IERPQ[2]) Receive Overrun */ +#define GMAC_IERPQ_HRESP (0x1u << 11) /**< \brief (GMAC_IERPQ[2]) HRESP Not OK */ +/* -------- GMAC_IDRPQ[2] : (GMAC Offset: 0x620) Interrupt Disable Register Priority Queue (index = 1) -------- */ +#define GMAC_IDRPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_IDRPQ[2]) Receive Complete */ +#define GMAC_IDRPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_IDRPQ[2]) RX Used Bit Read */ +#define GMAC_IDRPQ_RLEX (0x1u << 5) /**< \brief (GMAC_IDRPQ[2]) Retry Limit Exceeded or Late Collision */ +#define GMAC_IDRPQ_TFC (0x1u << 6) /**< \brief (GMAC_IDRPQ[2]) Transmit Frame Corruption Due to AHB Error */ +#define GMAC_IDRPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_IDRPQ[2]) Transmit Complete */ +#define GMAC_IDRPQ_ROVR (0x1u << 10) /**< \brief (GMAC_IDRPQ[2]) Receive Overrun */ +#define GMAC_IDRPQ_HRESP (0x1u << 11) /**< \brief (GMAC_IDRPQ[2]) HRESP Not OK */ +/* -------- GMAC_IMRPQ[2] : (GMAC Offset: 0x640) Interrupt Mask Register Priority Queue (index = 1) -------- */ +#define GMAC_IMRPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_IMRPQ[2]) Receive Complete */ +#define GMAC_IMRPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_IMRPQ[2]) RX Used Bit Read */ +#define GMAC_IMRPQ_RLEX (0x1u << 5) /**< \brief (GMAC_IMRPQ[2]) Retry Limit Exceeded or Late Collision */ +#define GMAC_IMRPQ_AHB (0x1u << 6) /**< \brief (GMAC_IMRPQ[2]) AHB Error */ +#define GMAC_IMRPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_IMRPQ[2]) Transmit Complete */ +#define GMAC_IMRPQ_ROVR (0x1u << 10) /**< \brief (GMAC_IMRPQ[2]) Receive Overrun */ +#define GMAC_IMRPQ_HRESP (0x1u << 11) /**< \brief (GMAC_IMRPQ[2]) HRESP Not OK */ +/* -------- GMAC_ST2ER[4] : (GMAC Offset: 0x6E0) Screening Type 2 Ethertype Register (index = 0) -------- */ +#define GMAC_ST2ER_COMPVAL_Pos 0 +#define GMAC_ST2ER_COMPVAL_Msk (0xffffu << GMAC_ST2ER_COMPVAL_Pos) /**< \brief (GMAC_ST2ER[4]) Ethertype Compare Value */ +#define GMAC_ST2ER_COMPVAL(value) ((GMAC_ST2ER_COMPVAL_Msk & ((value) << GMAC_ST2ER_COMPVAL_Pos))) +/* -------- GMAC_ST2CW00 : (GMAC Offset: 0x700) Screening Type 2 Compare Word 0 Register (index = 0) -------- */ +#define GMAC_ST2CW00_MASKVAL_Pos 0 +#define GMAC_ST2CW00_MASKVAL_Msk (0xffffu << GMAC_ST2CW00_MASKVAL_Pos) /**< \brief (GMAC_ST2CW00) Mask Value */ +#define GMAC_ST2CW00_MASKVAL(value) ((GMAC_ST2CW00_MASKVAL_Msk & ((value) << GMAC_ST2CW00_MASKVAL_Pos))) +#define GMAC_ST2CW00_COMPVAL_Pos 16 +#define GMAC_ST2CW00_COMPVAL_Msk (0xffffu << GMAC_ST2CW00_COMPVAL_Pos) /**< \brief (GMAC_ST2CW00) Compare Value */ +#define GMAC_ST2CW00_COMPVAL(value) ((GMAC_ST2CW00_COMPVAL_Msk & ((value) << GMAC_ST2CW00_COMPVAL_Pos))) +/* -------- GMAC_ST2CW10 : (GMAC Offset: 0x704) Screening Type 2 Compare Word 1 Register (index = 0) -------- */ +#define GMAC_ST2CW10_OFFSVAL_Pos 0 +#define GMAC_ST2CW10_OFFSVAL_Msk (0x7fu << GMAC_ST2CW10_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW10) Offset Value in Bytes */ +#define GMAC_ST2CW10_OFFSVAL(value) ((GMAC_ST2CW10_OFFSVAL_Msk & ((value) << GMAC_ST2CW10_OFFSVAL_Pos))) +#define GMAC_ST2CW10_OFFSSTRT_Pos 7 +#define GMAC_ST2CW10_OFFSSTRT_Msk (0x3u << GMAC_ST2CW10_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW10) Ethernet Frame Offset Start */ +#define GMAC_ST2CW10_OFFSSTRT(value) ((GMAC_ST2CW10_OFFSSTRT_Msk & ((value) << GMAC_ST2CW10_OFFSSTRT_Pos))) +#define GMAC_ST2CW10_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW10) Offset from the start of the frame */ +#define GMAC_ST2CW10_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW10) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW10_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW10) Offset from the byte after the IP header field */ +#define GMAC_ST2CW10_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW10) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW01 : (GMAC Offset: 0x708) Screening Type 2 Compare Word 0 Register (index = 1) -------- */ +#define GMAC_ST2CW01_MASKVAL_Pos 0 +#define GMAC_ST2CW01_MASKVAL_Msk (0xffffu << GMAC_ST2CW01_MASKVAL_Pos) /**< \brief (GMAC_ST2CW01) Mask Value */ +#define GMAC_ST2CW01_MASKVAL(value) ((GMAC_ST2CW01_MASKVAL_Msk & ((value) << GMAC_ST2CW01_MASKVAL_Pos))) +#define GMAC_ST2CW01_COMPVAL_Pos 16 +#define GMAC_ST2CW01_COMPVAL_Msk (0xffffu << GMAC_ST2CW01_COMPVAL_Pos) /**< \brief (GMAC_ST2CW01) Compare Value */ +#define GMAC_ST2CW01_COMPVAL(value) ((GMAC_ST2CW01_COMPVAL_Msk & ((value) << GMAC_ST2CW01_COMPVAL_Pos))) +/* -------- GMAC_ST2CW11 : (GMAC Offset: 0x70C) Screening Type 2 Compare Word 1 Register (index = 1) -------- */ +#define GMAC_ST2CW11_OFFSVAL_Pos 0 +#define GMAC_ST2CW11_OFFSVAL_Msk (0x7fu << GMAC_ST2CW11_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW11) Offset Value in Bytes */ +#define GMAC_ST2CW11_OFFSVAL(value) ((GMAC_ST2CW11_OFFSVAL_Msk & ((value) << GMAC_ST2CW11_OFFSVAL_Pos))) +#define GMAC_ST2CW11_OFFSSTRT_Pos 7 +#define GMAC_ST2CW11_OFFSSTRT_Msk (0x3u << GMAC_ST2CW11_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW11) Ethernet Frame Offset Start */ +#define GMAC_ST2CW11_OFFSSTRT(value) ((GMAC_ST2CW11_OFFSSTRT_Msk & ((value) << GMAC_ST2CW11_OFFSSTRT_Pos))) +#define GMAC_ST2CW11_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW11) Offset from the start of the frame */ +#define GMAC_ST2CW11_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW11) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW11_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW11) Offset from the byte after the IP header field */ +#define GMAC_ST2CW11_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW11) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW02 : (GMAC Offset: 0x710) Screening Type 2 Compare Word 0 Register (index = 2) -------- */ +#define GMAC_ST2CW02_MASKVAL_Pos 0 +#define GMAC_ST2CW02_MASKVAL_Msk (0xffffu << GMAC_ST2CW02_MASKVAL_Pos) /**< \brief (GMAC_ST2CW02) Mask Value */ +#define GMAC_ST2CW02_MASKVAL(value) ((GMAC_ST2CW02_MASKVAL_Msk & ((value) << GMAC_ST2CW02_MASKVAL_Pos))) +#define GMAC_ST2CW02_COMPVAL_Pos 16 +#define GMAC_ST2CW02_COMPVAL_Msk (0xffffu << GMAC_ST2CW02_COMPVAL_Pos) /**< \brief (GMAC_ST2CW02) Compare Value */ +#define GMAC_ST2CW02_COMPVAL(value) ((GMAC_ST2CW02_COMPVAL_Msk & ((value) << GMAC_ST2CW02_COMPVAL_Pos))) +/* -------- GMAC_ST2CW12 : (GMAC Offset: 0x714) Screening Type 2 Compare Word 1 Register (index = 2) -------- */ +#define GMAC_ST2CW12_OFFSVAL_Pos 0 +#define GMAC_ST2CW12_OFFSVAL_Msk (0x7fu << GMAC_ST2CW12_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW12) Offset Value in Bytes */ +#define GMAC_ST2CW12_OFFSVAL(value) ((GMAC_ST2CW12_OFFSVAL_Msk & ((value) << GMAC_ST2CW12_OFFSVAL_Pos))) +#define GMAC_ST2CW12_OFFSSTRT_Pos 7 +#define GMAC_ST2CW12_OFFSSTRT_Msk (0x3u << GMAC_ST2CW12_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW12) Ethernet Frame Offset Start */ +#define GMAC_ST2CW12_OFFSSTRT(value) ((GMAC_ST2CW12_OFFSSTRT_Msk & ((value) << GMAC_ST2CW12_OFFSSTRT_Pos))) +#define GMAC_ST2CW12_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW12) Offset from the start of the frame */ +#define GMAC_ST2CW12_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW12) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW12_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW12) Offset from the byte after the IP header field */ +#define GMAC_ST2CW12_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW12) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW03 : (GMAC Offset: 0x718) Screening Type 2 Compare Word 0 Register (index = 3) -------- */ +#define GMAC_ST2CW03_MASKVAL_Pos 0 +#define GMAC_ST2CW03_MASKVAL_Msk (0xffffu << GMAC_ST2CW03_MASKVAL_Pos) /**< \brief (GMAC_ST2CW03) Mask Value */ +#define GMAC_ST2CW03_MASKVAL(value) ((GMAC_ST2CW03_MASKVAL_Msk & ((value) << GMAC_ST2CW03_MASKVAL_Pos))) +#define GMAC_ST2CW03_COMPVAL_Pos 16 +#define GMAC_ST2CW03_COMPVAL_Msk (0xffffu << GMAC_ST2CW03_COMPVAL_Pos) /**< \brief (GMAC_ST2CW03) Compare Value */ +#define GMAC_ST2CW03_COMPVAL(value) ((GMAC_ST2CW03_COMPVAL_Msk & ((value) << GMAC_ST2CW03_COMPVAL_Pos))) +/* -------- GMAC_ST2CW13 : (GMAC Offset: 0x71C) Screening Type 2 Compare Word 1 Register (index = 3) -------- */ +#define GMAC_ST2CW13_OFFSVAL_Pos 0 +#define GMAC_ST2CW13_OFFSVAL_Msk (0x7fu << GMAC_ST2CW13_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW13) Offset Value in Bytes */ +#define GMAC_ST2CW13_OFFSVAL(value) ((GMAC_ST2CW13_OFFSVAL_Msk & ((value) << GMAC_ST2CW13_OFFSVAL_Pos))) +#define GMAC_ST2CW13_OFFSSTRT_Pos 7 +#define GMAC_ST2CW13_OFFSSTRT_Msk (0x3u << GMAC_ST2CW13_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW13) Ethernet Frame Offset Start */ +#define GMAC_ST2CW13_OFFSSTRT(value) ((GMAC_ST2CW13_OFFSSTRT_Msk & ((value) << GMAC_ST2CW13_OFFSSTRT_Pos))) +#define GMAC_ST2CW13_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW13) Offset from the start of the frame */ +#define GMAC_ST2CW13_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW13) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW13_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW13) Offset from the byte after the IP header field */ +#define GMAC_ST2CW13_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW13) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW04 : (GMAC Offset: 0x720) Screening Type 2 Compare Word 0 Register (index = 4) -------- */ +#define GMAC_ST2CW04_MASKVAL_Pos 0 +#define GMAC_ST2CW04_MASKVAL_Msk (0xffffu << GMAC_ST2CW04_MASKVAL_Pos) /**< \brief (GMAC_ST2CW04) Mask Value */ +#define GMAC_ST2CW04_MASKVAL(value) ((GMAC_ST2CW04_MASKVAL_Msk & ((value) << GMAC_ST2CW04_MASKVAL_Pos))) +#define GMAC_ST2CW04_COMPVAL_Pos 16 +#define GMAC_ST2CW04_COMPVAL_Msk (0xffffu << GMAC_ST2CW04_COMPVAL_Pos) /**< \brief (GMAC_ST2CW04) Compare Value */ +#define GMAC_ST2CW04_COMPVAL(value) ((GMAC_ST2CW04_COMPVAL_Msk & ((value) << GMAC_ST2CW04_COMPVAL_Pos))) +/* -------- GMAC_ST2CW14 : (GMAC Offset: 0x724) Screening Type 2 Compare Word 1 Register (index = 4) -------- */ +#define GMAC_ST2CW14_OFFSVAL_Pos 0 +#define GMAC_ST2CW14_OFFSVAL_Msk (0x7fu << GMAC_ST2CW14_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW14) Offset Value in Bytes */ +#define GMAC_ST2CW14_OFFSVAL(value) ((GMAC_ST2CW14_OFFSVAL_Msk & ((value) << GMAC_ST2CW14_OFFSVAL_Pos))) +#define GMAC_ST2CW14_OFFSSTRT_Pos 7 +#define GMAC_ST2CW14_OFFSSTRT_Msk (0x3u << GMAC_ST2CW14_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW14) Ethernet Frame Offset Start */ +#define GMAC_ST2CW14_OFFSSTRT(value) ((GMAC_ST2CW14_OFFSSTRT_Msk & ((value) << GMAC_ST2CW14_OFFSSTRT_Pos))) +#define GMAC_ST2CW14_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW14) Offset from the start of the frame */ +#define GMAC_ST2CW14_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW14) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW14_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW14) Offset from the byte after the IP header field */ +#define GMAC_ST2CW14_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW14) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW05 : (GMAC Offset: 0x728) Screening Type 2 Compare Word 0 Register (index = 5) -------- */ +#define GMAC_ST2CW05_MASKVAL_Pos 0 +#define GMAC_ST2CW05_MASKVAL_Msk (0xffffu << GMAC_ST2CW05_MASKVAL_Pos) /**< \brief (GMAC_ST2CW05) Mask Value */ +#define GMAC_ST2CW05_MASKVAL(value) ((GMAC_ST2CW05_MASKVAL_Msk & ((value) << GMAC_ST2CW05_MASKVAL_Pos))) +#define GMAC_ST2CW05_COMPVAL_Pos 16 +#define GMAC_ST2CW05_COMPVAL_Msk (0xffffu << GMAC_ST2CW05_COMPVAL_Pos) /**< \brief (GMAC_ST2CW05) Compare Value */ +#define GMAC_ST2CW05_COMPVAL(value) ((GMAC_ST2CW05_COMPVAL_Msk & ((value) << GMAC_ST2CW05_COMPVAL_Pos))) +/* -------- GMAC_ST2CW15 : (GMAC Offset: 0x72C) Screening Type 2 Compare Word 1 Register (index = 5) -------- */ +#define GMAC_ST2CW15_OFFSVAL_Pos 0 +#define GMAC_ST2CW15_OFFSVAL_Msk (0x7fu << GMAC_ST2CW15_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW15) Offset Value in Bytes */ +#define GMAC_ST2CW15_OFFSVAL(value) ((GMAC_ST2CW15_OFFSVAL_Msk & ((value) << GMAC_ST2CW15_OFFSVAL_Pos))) +#define GMAC_ST2CW15_OFFSSTRT_Pos 7 +#define GMAC_ST2CW15_OFFSSTRT_Msk (0x3u << GMAC_ST2CW15_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW15) Ethernet Frame Offset Start */ +#define GMAC_ST2CW15_OFFSSTRT(value) ((GMAC_ST2CW15_OFFSSTRT_Msk & ((value) << GMAC_ST2CW15_OFFSSTRT_Pos))) +#define GMAC_ST2CW15_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW15) Offset from the start of the frame */ +#define GMAC_ST2CW15_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW15) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW15_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW15) Offset from the byte after the IP header field */ +#define GMAC_ST2CW15_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW15) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW06 : (GMAC Offset: 0x730) Screening Type 2 Compare Word 0 Register (index = 6) -------- */ +#define GMAC_ST2CW06_MASKVAL_Pos 0 +#define GMAC_ST2CW06_MASKVAL_Msk (0xffffu << GMAC_ST2CW06_MASKVAL_Pos) /**< \brief (GMAC_ST2CW06) Mask Value */ +#define GMAC_ST2CW06_MASKVAL(value) ((GMAC_ST2CW06_MASKVAL_Msk & ((value) << GMAC_ST2CW06_MASKVAL_Pos))) +#define GMAC_ST2CW06_COMPVAL_Pos 16 +#define GMAC_ST2CW06_COMPVAL_Msk (0xffffu << GMAC_ST2CW06_COMPVAL_Pos) /**< \brief (GMAC_ST2CW06) Compare Value */ +#define GMAC_ST2CW06_COMPVAL(value) ((GMAC_ST2CW06_COMPVAL_Msk & ((value) << GMAC_ST2CW06_COMPVAL_Pos))) +/* -------- GMAC_ST2CW16 : (GMAC Offset: 0x734) Screening Type 2 Compare Word 1 Register (index = 6) -------- */ +#define GMAC_ST2CW16_OFFSVAL_Pos 0 +#define GMAC_ST2CW16_OFFSVAL_Msk (0x7fu << GMAC_ST2CW16_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW16) Offset Value in Bytes */ +#define GMAC_ST2CW16_OFFSVAL(value) ((GMAC_ST2CW16_OFFSVAL_Msk & ((value) << GMAC_ST2CW16_OFFSVAL_Pos))) +#define GMAC_ST2CW16_OFFSSTRT_Pos 7 +#define GMAC_ST2CW16_OFFSSTRT_Msk (0x3u << GMAC_ST2CW16_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW16) Ethernet Frame Offset Start */ +#define GMAC_ST2CW16_OFFSSTRT(value) ((GMAC_ST2CW16_OFFSSTRT_Msk & ((value) << GMAC_ST2CW16_OFFSSTRT_Pos))) +#define GMAC_ST2CW16_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW16) Offset from the start of the frame */ +#define GMAC_ST2CW16_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW16) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW16_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW16) Offset from the byte after the IP header field */ +#define GMAC_ST2CW16_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW16) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW07 : (GMAC Offset: 0x738) Screening Type 2 Compare Word 0 Register (index = 7) -------- */ +#define GMAC_ST2CW07_MASKVAL_Pos 0 +#define GMAC_ST2CW07_MASKVAL_Msk (0xffffu << GMAC_ST2CW07_MASKVAL_Pos) /**< \brief (GMAC_ST2CW07) Mask Value */ +#define GMAC_ST2CW07_MASKVAL(value) ((GMAC_ST2CW07_MASKVAL_Msk & ((value) << GMAC_ST2CW07_MASKVAL_Pos))) +#define GMAC_ST2CW07_COMPVAL_Pos 16 +#define GMAC_ST2CW07_COMPVAL_Msk (0xffffu << GMAC_ST2CW07_COMPVAL_Pos) /**< \brief (GMAC_ST2CW07) Compare Value */ +#define GMAC_ST2CW07_COMPVAL(value) ((GMAC_ST2CW07_COMPVAL_Msk & ((value) << GMAC_ST2CW07_COMPVAL_Pos))) +/* -------- GMAC_ST2CW17 : (GMAC Offset: 0x73C) Screening Type 2 Compare Word 1 Register (index = 7) -------- */ +#define GMAC_ST2CW17_OFFSVAL_Pos 0 +#define GMAC_ST2CW17_OFFSVAL_Msk (0x7fu << GMAC_ST2CW17_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW17) Offset Value in Bytes */ +#define GMAC_ST2CW17_OFFSVAL(value) ((GMAC_ST2CW17_OFFSVAL_Msk & ((value) << GMAC_ST2CW17_OFFSVAL_Pos))) +#define GMAC_ST2CW17_OFFSSTRT_Pos 7 +#define GMAC_ST2CW17_OFFSSTRT_Msk (0x3u << GMAC_ST2CW17_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW17) Ethernet Frame Offset Start */ +#define GMAC_ST2CW17_OFFSSTRT(value) ((GMAC_ST2CW17_OFFSSTRT_Msk & ((value) << GMAC_ST2CW17_OFFSSTRT_Pos))) +#define GMAC_ST2CW17_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW17) Offset from the start of the frame */ +#define GMAC_ST2CW17_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW17) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW17_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW17) Offset from the byte after the IP header field */ +#define GMAC_ST2CW17_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW17) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW08 : (GMAC Offset: 0x740) Screening Type 2 Compare Word 0 Register (index = 8) -------- */ +#define GMAC_ST2CW08_MASKVAL_Pos 0 +#define GMAC_ST2CW08_MASKVAL_Msk (0xffffu << GMAC_ST2CW08_MASKVAL_Pos) /**< \brief (GMAC_ST2CW08) Mask Value */ +#define GMAC_ST2CW08_MASKVAL(value) ((GMAC_ST2CW08_MASKVAL_Msk & ((value) << GMAC_ST2CW08_MASKVAL_Pos))) +#define GMAC_ST2CW08_COMPVAL_Pos 16 +#define GMAC_ST2CW08_COMPVAL_Msk (0xffffu << GMAC_ST2CW08_COMPVAL_Pos) /**< \brief (GMAC_ST2CW08) Compare Value */ +#define GMAC_ST2CW08_COMPVAL(value) ((GMAC_ST2CW08_COMPVAL_Msk & ((value) << GMAC_ST2CW08_COMPVAL_Pos))) +/* -------- GMAC_ST2CW18 : (GMAC Offset: 0x744) Screening Type 2 Compare Word 1 Register (index = 8) -------- */ +#define GMAC_ST2CW18_OFFSVAL_Pos 0 +#define GMAC_ST2CW18_OFFSVAL_Msk (0x7fu << GMAC_ST2CW18_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW18) Offset Value in Bytes */ +#define GMAC_ST2CW18_OFFSVAL(value) ((GMAC_ST2CW18_OFFSVAL_Msk & ((value) << GMAC_ST2CW18_OFFSVAL_Pos))) +#define GMAC_ST2CW18_OFFSSTRT_Pos 7 +#define GMAC_ST2CW18_OFFSSTRT_Msk (0x3u << GMAC_ST2CW18_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW18) Ethernet Frame Offset Start */ +#define GMAC_ST2CW18_OFFSSTRT(value) ((GMAC_ST2CW18_OFFSSTRT_Msk & ((value) << GMAC_ST2CW18_OFFSSTRT_Pos))) +#define GMAC_ST2CW18_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW18) Offset from the start of the frame */ +#define GMAC_ST2CW18_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW18) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW18_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW18) Offset from the byte after the IP header field */ +#define GMAC_ST2CW18_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW18) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW09 : (GMAC Offset: 0x748) Screening Type 2 Compare Word 0 Register (index = 9) -------- */ +#define GMAC_ST2CW09_MASKVAL_Pos 0 +#define GMAC_ST2CW09_MASKVAL_Msk (0xffffu << GMAC_ST2CW09_MASKVAL_Pos) /**< \brief (GMAC_ST2CW09) Mask Value */ +#define GMAC_ST2CW09_MASKVAL(value) ((GMAC_ST2CW09_MASKVAL_Msk & ((value) << GMAC_ST2CW09_MASKVAL_Pos))) +#define GMAC_ST2CW09_COMPVAL_Pos 16 +#define GMAC_ST2CW09_COMPVAL_Msk (0xffffu << GMAC_ST2CW09_COMPVAL_Pos) /**< \brief (GMAC_ST2CW09) Compare Value */ +#define GMAC_ST2CW09_COMPVAL(value) ((GMAC_ST2CW09_COMPVAL_Msk & ((value) << GMAC_ST2CW09_COMPVAL_Pos))) +/* -------- GMAC_ST2CW19 : (GMAC Offset: 0x74C) Screening Type 2 Compare Word 1 Register (index = 9) -------- */ +#define GMAC_ST2CW19_OFFSVAL_Pos 0 +#define GMAC_ST2CW19_OFFSVAL_Msk (0x7fu << GMAC_ST2CW19_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW19) Offset Value in Bytes */ +#define GMAC_ST2CW19_OFFSVAL(value) ((GMAC_ST2CW19_OFFSVAL_Msk & ((value) << GMAC_ST2CW19_OFFSVAL_Pos))) +#define GMAC_ST2CW19_OFFSSTRT_Pos 7 +#define GMAC_ST2CW19_OFFSSTRT_Msk (0x3u << GMAC_ST2CW19_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW19) Ethernet Frame Offset Start */ +#define GMAC_ST2CW19_OFFSSTRT(value) ((GMAC_ST2CW19_OFFSSTRT_Msk & ((value) << GMAC_ST2CW19_OFFSSTRT_Pos))) +#define GMAC_ST2CW19_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW19) Offset from the start of the frame */ +#define GMAC_ST2CW19_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW19) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW19_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW19) Offset from the byte after the IP header field */ +#define GMAC_ST2CW19_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW19) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW010 : (GMAC Offset: 0x750) Screening Type 2 Compare Word 0 Register (index = 10) -------- */ +#define GMAC_ST2CW010_MASKVAL_Pos 0 +#define GMAC_ST2CW010_MASKVAL_Msk (0xffffu << GMAC_ST2CW010_MASKVAL_Pos) /**< \brief (GMAC_ST2CW010) Mask Value */ +#define GMAC_ST2CW010_MASKVAL(value) ((GMAC_ST2CW010_MASKVAL_Msk & ((value) << GMAC_ST2CW010_MASKVAL_Pos))) +#define GMAC_ST2CW010_COMPVAL_Pos 16 +#define GMAC_ST2CW010_COMPVAL_Msk (0xffffu << GMAC_ST2CW010_COMPVAL_Pos) /**< \brief (GMAC_ST2CW010) Compare Value */ +#define GMAC_ST2CW010_COMPVAL(value) ((GMAC_ST2CW010_COMPVAL_Msk & ((value) << GMAC_ST2CW010_COMPVAL_Pos))) +/* -------- GMAC_ST2CW110 : (GMAC Offset: 0x754) Screening Type 2 Compare Word 1 Register (index = 10) -------- */ +#define GMAC_ST2CW110_OFFSVAL_Pos 0 +#define GMAC_ST2CW110_OFFSVAL_Msk (0x7fu << GMAC_ST2CW110_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW110) Offset Value in Bytes */ +#define GMAC_ST2CW110_OFFSVAL(value) ((GMAC_ST2CW110_OFFSVAL_Msk & ((value) << GMAC_ST2CW110_OFFSVAL_Pos))) +#define GMAC_ST2CW110_OFFSSTRT_Pos 7 +#define GMAC_ST2CW110_OFFSSTRT_Msk (0x3u << GMAC_ST2CW110_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW110) Ethernet Frame Offset Start */ +#define GMAC_ST2CW110_OFFSSTRT(value) ((GMAC_ST2CW110_OFFSSTRT_Msk & ((value) << GMAC_ST2CW110_OFFSSTRT_Pos))) +#define GMAC_ST2CW110_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW110) Offset from the start of the frame */ +#define GMAC_ST2CW110_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW110) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW110_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW110) Offset from the byte after the IP header field */ +#define GMAC_ST2CW110_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW110) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW011 : (GMAC Offset: 0x758) Screening Type 2 Compare Word 0 Register (index = 11) -------- */ +#define GMAC_ST2CW011_MASKVAL_Pos 0 +#define GMAC_ST2CW011_MASKVAL_Msk (0xffffu << GMAC_ST2CW011_MASKVAL_Pos) /**< \brief (GMAC_ST2CW011) Mask Value */ +#define GMAC_ST2CW011_MASKVAL(value) ((GMAC_ST2CW011_MASKVAL_Msk & ((value) << GMAC_ST2CW011_MASKVAL_Pos))) +#define GMAC_ST2CW011_COMPVAL_Pos 16 +#define GMAC_ST2CW011_COMPVAL_Msk (0xffffu << GMAC_ST2CW011_COMPVAL_Pos) /**< \brief (GMAC_ST2CW011) Compare Value */ +#define GMAC_ST2CW011_COMPVAL(value) ((GMAC_ST2CW011_COMPVAL_Msk & ((value) << GMAC_ST2CW011_COMPVAL_Pos))) +/* -------- GMAC_ST2CW111 : (GMAC Offset: 0x75C) Screening Type 2 Compare Word 1 Register (index = 11) -------- */ +#define GMAC_ST2CW111_OFFSVAL_Pos 0 +#define GMAC_ST2CW111_OFFSVAL_Msk (0x7fu << GMAC_ST2CW111_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW111) Offset Value in Bytes */ +#define GMAC_ST2CW111_OFFSVAL(value) ((GMAC_ST2CW111_OFFSVAL_Msk & ((value) << GMAC_ST2CW111_OFFSVAL_Pos))) +#define GMAC_ST2CW111_OFFSSTRT_Pos 7 +#define GMAC_ST2CW111_OFFSSTRT_Msk (0x3u << GMAC_ST2CW111_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW111) Ethernet Frame Offset Start */ +#define GMAC_ST2CW111_OFFSSTRT(value) ((GMAC_ST2CW111_OFFSSTRT_Msk & ((value) << GMAC_ST2CW111_OFFSSTRT_Pos))) +#define GMAC_ST2CW111_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW111) Offset from the start of the frame */ +#define GMAC_ST2CW111_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW111) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW111_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW111) Offset from the byte after the IP header field */ +#define GMAC_ST2CW111_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW111) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW012 : (GMAC Offset: 0x760) Screening Type 2 Compare Word 0 Register (index = 12) -------- */ +#define GMAC_ST2CW012_MASKVAL_Pos 0 +#define GMAC_ST2CW012_MASKVAL_Msk (0xffffu << GMAC_ST2CW012_MASKVAL_Pos) /**< \brief (GMAC_ST2CW012) Mask Value */ +#define GMAC_ST2CW012_MASKVAL(value) ((GMAC_ST2CW012_MASKVAL_Msk & ((value) << GMAC_ST2CW012_MASKVAL_Pos))) +#define GMAC_ST2CW012_COMPVAL_Pos 16 +#define GMAC_ST2CW012_COMPVAL_Msk (0xffffu << GMAC_ST2CW012_COMPVAL_Pos) /**< \brief (GMAC_ST2CW012) Compare Value */ +#define GMAC_ST2CW012_COMPVAL(value) ((GMAC_ST2CW012_COMPVAL_Msk & ((value) << GMAC_ST2CW012_COMPVAL_Pos))) +/* -------- GMAC_ST2CW112 : (GMAC Offset: 0x764) Screening Type 2 Compare Word 1 Register (index = 12) -------- */ +#define GMAC_ST2CW112_OFFSVAL_Pos 0 +#define GMAC_ST2CW112_OFFSVAL_Msk (0x7fu << GMAC_ST2CW112_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW112) Offset Value in Bytes */ +#define GMAC_ST2CW112_OFFSVAL(value) ((GMAC_ST2CW112_OFFSVAL_Msk & ((value) << GMAC_ST2CW112_OFFSVAL_Pos))) +#define GMAC_ST2CW112_OFFSSTRT_Pos 7 +#define GMAC_ST2CW112_OFFSSTRT_Msk (0x3u << GMAC_ST2CW112_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW112) Ethernet Frame Offset Start */ +#define GMAC_ST2CW112_OFFSSTRT(value) ((GMAC_ST2CW112_OFFSSTRT_Msk & ((value) << GMAC_ST2CW112_OFFSSTRT_Pos))) +#define GMAC_ST2CW112_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW112) Offset from the start of the frame */ +#define GMAC_ST2CW112_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW112) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW112_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW112) Offset from the byte after the IP header field */ +#define GMAC_ST2CW112_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW112) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW013 : (GMAC Offset: 0x768) Screening Type 2 Compare Word 0 Register (index = 13) -------- */ +#define GMAC_ST2CW013_MASKVAL_Pos 0 +#define GMAC_ST2CW013_MASKVAL_Msk (0xffffu << GMAC_ST2CW013_MASKVAL_Pos) /**< \brief (GMAC_ST2CW013) Mask Value */ +#define GMAC_ST2CW013_MASKVAL(value) ((GMAC_ST2CW013_MASKVAL_Msk & ((value) << GMAC_ST2CW013_MASKVAL_Pos))) +#define GMAC_ST2CW013_COMPVAL_Pos 16 +#define GMAC_ST2CW013_COMPVAL_Msk (0xffffu << GMAC_ST2CW013_COMPVAL_Pos) /**< \brief (GMAC_ST2CW013) Compare Value */ +#define GMAC_ST2CW013_COMPVAL(value) ((GMAC_ST2CW013_COMPVAL_Msk & ((value) << GMAC_ST2CW013_COMPVAL_Pos))) +/* -------- GMAC_ST2CW113 : (GMAC Offset: 0x76C) Screening Type 2 Compare Word 1 Register (index = 13) -------- */ +#define GMAC_ST2CW113_OFFSVAL_Pos 0 +#define GMAC_ST2CW113_OFFSVAL_Msk (0x7fu << GMAC_ST2CW113_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW113) Offset Value in Bytes */ +#define GMAC_ST2CW113_OFFSVAL(value) ((GMAC_ST2CW113_OFFSVAL_Msk & ((value) << GMAC_ST2CW113_OFFSVAL_Pos))) +#define GMAC_ST2CW113_OFFSSTRT_Pos 7 +#define GMAC_ST2CW113_OFFSSTRT_Msk (0x3u << GMAC_ST2CW113_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW113) Ethernet Frame Offset Start */ +#define GMAC_ST2CW113_OFFSSTRT(value) ((GMAC_ST2CW113_OFFSSTRT_Msk & ((value) << GMAC_ST2CW113_OFFSSTRT_Pos))) +#define GMAC_ST2CW113_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW113) Offset from the start of the frame */ +#define GMAC_ST2CW113_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW113) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW113_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW113) Offset from the byte after the IP header field */ +#define GMAC_ST2CW113_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW113) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW014 : (GMAC Offset: 0x770) Screening Type 2 Compare Word 0 Register (index = 14) -------- */ +#define GMAC_ST2CW014_MASKVAL_Pos 0 +#define GMAC_ST2CW014_MASKVAL_Msk (0xffffu << GMAC_ST2CW014_MASKVAL_Pos) /**< \brief (GMAC_ST2CW014) Mask Value */ +#define GMAC_ST2CW014_MASKVAL(value) ((GMAC_ST2CW014_MASKVAL_Msk & ((value) << GMAC_ST2CW014_MASKVAL_Pos))) +#define GMAC_ST2CW014_COMPVAL_Pos 16 +#define GMAC_ST2CW014_COMPVAL_Msk (0xffffu << GMAC_ST2CW014_COMPVAL_Pos) /**< \brief (GMAC_ST2CW014) Compare Value */ +#define GMAC_ST2CW014_COMPVAL(value) ((GMAC_ST2CW014_COMPVAL_Msk & ((value) << GMAC_ST2CW014_COMPVAL_Pos))) +/* -------- GMAC_ST2CW114 : (GMAC Offset: 0x774) Screening Type 2 Compare Word 1 Register (index = 14) -------- */ +#define GMAC_ST2CW114_OFFSVAL_Pos 0 +#define GMAC_ST2CW114_OFFSVAL_Msk (0x7fu << GMAC_ST2CW114_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW114) Offset Value in Bytes */ +#define GMAC_ST2CW114_OFFSVAL(value) ((GMAC_ST2CW114_OFFSVAL_Msk & ((value) << GMAC_ST2CW114_OFFSVAL_Pos))) +#define GMAC_ST2CW114_OFFSSTRT_Pos 7 +#define GMAC_ST2CW114_OFFSSTRT_Msk (0x3u << GMAC_ST2CW114_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW114) Ethernet Frame Offset Start */ +#define GMAC_ST2CW114_OFFSSTRT(value) ((GMAC_ST2CW114_OFFSSTRT_Msk & ((value) << GMAC_ST2CW114_OFFSSTRT_Pos))) +#define GMAC_ST2CW114_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW114) Offset from the start of the frame */ +#define GMAC_ST2CW114_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW114) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW114_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW114) Offset from the byte after the IP header field */ +#define GMAC_ST2CW114_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW114) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW015 : (GMAC Offset: 0x778) Screening Type 2 Compare Word 0 Register (index = 15) -------- */ +#define GMAC_ST2CW015_MASKVAL_Pos 0 +#define GMAC_ST2CW015_MASKVAL_Msk (0xffffu << GMAC_ST2CW015_MASKVAL_Pos) /**< \brief (GMAC_ST2CW015) Mask Value */ +#define GMAC_ST2CW015_MASKVAL(value) ((GMAC_ST2CW015_MASKVAL_Msk & ((value) << GMAC_ST2CW015_MASKVAL_Pos))) +#define GMAC_ST2CW015_COMPVAL_Pos 16 +#define GMAC_ST2CW015_COMPVAL_Msk (0xffffu << GMAC_ST2CW015_COMPVAL_Pos) /**< \brief (GMAC_ST2CW015) Compare Value */ +#define GMAC_ST2CW015_COMPVAL(value) ((GMAC_ST2CW015_COMPVAL_Msk & ((value) << GMAC_ST2CW015_COMPVAL_Pos))) +/* -------- GMAC_ST2CW115 : (GMAC Offset: 0x77C) Screening Type 2 Compare Word 1 Register (index = 15) -------- */ +#define GMAC_ST2CW115_OFFSVAL_Pos 0 +#define GMAC_ST2CW115_OFFSVAL_Msk (0x7fu << GMAC_ST2CW115_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW115) Offset Value in Bytes */ +#define GMAC_ST2CW115_OFFSVAL(value) ((GMAC_ST2CW115_OFFSVAL_Msk & ((value) << GMAC_ST2CW115_OFFSVAL_Pos))) +#define GMAC_ST2CW115_OFFSSTRT_Pos 7 +#define GMAC_ST2CW115_OFFSSTRT_Msk (0x3u << GMAC_ST2CW115_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW115) Ethernet Frame Offset Start */ +#define GMAC_ST2CW115_OFFSSTRT(value) ((GMAC_ST2CW115_OFFSSTRT_Msk & ((value) << GMAC_ST2CW115_OFFSSTRT_Pos))) +#define GMAC_ST2CW115_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW115) Offset from the start of the frame */ +#define GMAC_ST2CW115_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW115) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW115_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW115) Offset from the byte after the IP header field */ +#define GMAC_ST2CW115_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW115) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW016 : (GMAC Offset: 0x780) Screening Type 2 Compare Word 0 Register (index = 16) -------- */ +#define GMAC_ST2CW016_MASKVAL_Pos 0 +#define GMAC_ST2CW016_MASKVAL_Msk (0xffffu << GMAC_ST2CW016_MASKVAL_Pos) /**< \brief (GMAC_ST2CW016) Mask Value */ +#define GMAC_ST2CW016_MASKVAL(value) ((GMAC_ST2CW016_MASKVAL_Msk & ((value) << GMAC_ST2CW016_MASKVAL_Pos))) +#define GMAC_ST2CW016_COMPVAL_Pos 16 +#define GMAC_ST2CW016_COMPVAL_Msk (0xffffu << GMAC_ST2CW016_COMPVAL_Pos) /**< \brief (GMAC_ST2CW016) Compare Value */ +#define GMAC_ST2CW016_COMPVAL(value) ((GMAC_ST2CW016_COMPVAL_Msk & ((value) << GMAC_ST2CW016_COMPVAL_Pos))) +/* -------- GMAC_ST2CW116 : (GMAC Offset: 0x784) Screening Type 2 Compare Word 1 Register (index = 16) -------- */ +#define GMAC_ST2CW116_OFFSVAL_Pos 0 +#define GMAC_ST2CW116_OFFSVAL_Msk (0x7fu << GMAC_ST2CW116_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW116) Offset Value in Bytes */ +#define GMAC_ST2CW116_OFFSVAL(value) ((GMAC_ST2CW116_OFFSVAL_Msk & ((value) << GMAC_ST2CW116_OFFSVAL_Pos))) +#define GMAC_ST2CW116_OFFSSTRT_Pos 7 +#define GMAC_ST2CW116_OFFSSTRT_Msk (0x3u << GMAC_ST2CW116_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW116) Ethernet Frame Offset Start */ +#define GMAC_ST2CW116_OFFSSTRT(value) ((GMAC_ST2CW116_OFFSSTRT_Msk & ((value) << GMAC_ST2CW116_OFFSSTRT_Pos))) +#define GMAC_ST2CW116_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW116) Offset from the start of the frame */ +#define GMAC_ST2CW116_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW116) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW116_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW116) Offset from the byte after the IP header field */ +#define GMAC_ST2CW116_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW116) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW017 : (GMAC Offset: 0x788) Screening Type 2 Compare Word 0 Register (index = 17) -------- */ +#define GMAC_ST2CW017_MASKVAL_Pos 0 +#define GMAC_ST2CW017_MASKVAL_Msk (0xffffu << GMAC_ST2CW017_MASKVAL_Pos) /**< \brief (GMAC_ST2CW017) Mask Value */ +#define GMAC_ST2CW017_MASKVAL(value) ((GMAC_ST2CW017_MASKVAL_Msk & ((value) << GMAC_ST2CW017_MASKVAL_Pos))) +#define GMAC_ST2CW017_COMPVAL_Pos 16 +#define GMAC_ST2CW017_COMPVAL_Msk (0xffffu << GMAC_ST2CW017_COMPVAL_Pos) /**< \brief (GMAC_ST2CW017) Compare Value */ +#define GMAC_ST2CW017_COMPVAL(value) ((GMAC_ST2CW017_COMPVAL_Msk & ((value) << GMAC_ST2CW017_COMPVAL_Pos))) +/* -------- GMAC_ST2CW117 : (GMAC Offset: 0x78C) Screening Type 2 Compare Word 1 Register (index = 17) -------- */ +#define GMAC_ST2CW117_OFFSVAL_Pos 0 +#define GMAC_ST2CW117_OFFSVAL_Msk (0x7fu << GMAC_ST2CW117_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW117) Offset Value in Bytes */ +#define GMAC_ST2CW117_OFFSVAL(value) ((GMAC_ST2CW117_OFFSVAL_Msk & ((value) << GMAC_ST2CW117_OFFSVAL_Pos))) +#define GMAC_ST2CW117_OFFSSTRT_Pos 7 +#define GMAC_ST2CW117_OFFSSTRT_Msk (0x3u << GMAC_ST2CW117_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW117) Ethernet Frame Offset Start */ +#define GMAC_ST2CW117_OFFSSTRT(value) ((GMAC_ST2CW117_OFFSSTRT_Msk & ((value) << GMAC_ST2CW117_OFFSSTRT_Pos))) +#define GMAC_ST2CW117_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW117) Offset from the start of the frame */ +#define GMAC_ST2CW117_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW117) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW117_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW117) Offset from the byte after the IP header field */ +#define GMAC_ST2CW117_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW117) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW018 : (GMAC Offset: 0x790) Screening Type 2 Compare Word 0 Register (index = 18) -------- */ +#define GMAC_ST2CW018_MASKVAL_Pos 0 +#define GMAC_ST2CW018_MASKVAL_Msk (0xffffu << GMAC_ST2CW018_MASKVAL_Pos) /**< \brief (GMAC_ST2CW018) Mask Value */ +#define GMAC_ST2CW018_MASKVAL(value) ((GMAC_ST2CW018_MASKVAL_Msk & ((value) << GMAC_ST2CW018_MASKVAL_Pos))) +#define GMAC_ST2CW018_COMPVAL_Pos 16 +#define GMAC_ST2CW018_COMPVAL_Msk (0xffffu << GMAC_ST2CW018_COMPVAL_Pos) /**< \brief (GMAC_ST2CW018) Compare Value */ +#define GMAC_ST2CW018_COMPVAL(value) ((GMAC_ST2CW018_COMPVAL_Msk & ((value) << GMAC_ST2CW018_COMPVAL_Pos))) +/* -------- GMAC_ST2CW118 : (GMAC Offset: 0x794) Screening Type 2 Compare Word 1 Register (index = 18) -------- */ +#define GMAC_ST2CW118_OFFSVAL_Pos 0 +#define GMAC_ST2CW118_OFFSVAL_Msk (0x7fu << GMAC_ST2CW118_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW118) Offset Value in Bytes */ +#define GMAC_ST2CW118_OFFSVAL(value) ((GMAC_ST2CW118_OFFSVAL_Msk & ((value) << GMAC_ST2CW118_OFFSVAL_Pos))) +#define GMAC_ST2CW118_OFFSSTRT_Pos 7 +#define GMAC_ST2CW118_OFFSSTRT_Msk (0x3u << GMAC_ST2CW118_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW118) Ethernet Frame Offset Start */ +#define GMAC_ST2CW118_OFFSSTRT(value) ((GMAC_ST2CW118_OFFSSTRT_Msk & ((value) << GMAC_ST2CW118_OFFSSTRT_Pos))) +#define GMAC_ST2CW118_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW118) Offset from the start of the frame */ +#define GMAC_ST2CW118_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW118) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW118_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW118) Offset from the byte after the IP header field */ +#define GMAC_ST2CW118_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW118) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW019 : (GMAC Offset: 0x798) Screening Type 2 Compare Word 0 Register (index = 19) -------- */ +#define GMAC_ST2CW019_MASKVAL_Pos 0 +#define GMAC_ST2CW019_MASKVAL_Msk (0xffffu << GMAC_ST2CW019_MASKVAL_Pos) /**< \brief (GMAC_ST2CW019) Mask Value */ +#define GMAC_ST2CW019_MASKVAL(value) ((GMAC_ST2CW019_MASKVAL_Msk & ((value) << GMAC_ST2CW019_MASKVAL_Pos))) +#define GMAC_ST2CW019_COMPVAL_Pos 16 +#define GMAC_ST2CW019_COMPVAL_Msk (0xffffu << GMAC_ST2CW019_COMPVAL_Pos) /**< \brief (GMAC_ST2CW019) Compare Value */ +#define GMAC_ST2CW019_COMPVAL(value) ((GMAC_ST2CW019_COMPVAL_Msk & ((value) << GMAC_ST2CW019_COMPVAL_Pos))) +/* -------- GMAC_ST2CW119 : (GMAC Offset: 0x79C) Screening Type 2 Compare Word 1 Register (index = 19) -------- */ +#define GMAC_ST2CW119_OFFSVAL_Pos 0 +#define GMAC_ST2CW119_OFFSVAL_Msk (0x7fu << GMAC_ST2CW119_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW119) Offset Value in Bytes */ +#define GMAC_ST2CW119_OFFSVAL(value) ((GMAC_ST2CW119_OFFSVAL_Msk & ((value) << GMAC_ST2CW119_OFFSVAL_Pos))) +#define GMAC_ST2CW119_OFFSSTRT_Pos 7 +#define GMAC_ST2CW119_OFFSSTRT_Msk (0x3u << GMAC_ST2CW119_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW119) Ethernet Frame Offset Start */ +#define GMAC_ST2CW119_OFFSSTRT(value) ((GMAC_ST2CW119_OFFSSTRT_Msk & ((value) << GMAC_ST2CW119_OFFSSTRT_Pos))) +#define GMAC_ST2CW119_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW119) Offset from the start of the frame */ +#define GMAC_ST2CW119_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW119) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW119_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW119) Offset from the byte after the IP header field */ +#define GMAC_ST2CW119_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW119) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW020 : (GMAC Offset: 0x7A0) Screening Type 2 Compare Word 0 Register (index = 20) -------- */ +#define GMAC_ST2CW020_MASKVAL_Pos 0 +#define GMAC_ST2CW020_MASKVAL_Msk (0xffffu << GMAC_ST2CW020_MASKVAL_Pos) /**< \brief (GMAC_ST2CW020) Mask Value */ +#define GMAC_ST2CW020_MASKVAL(value) ((GMAC_ST2CW020_MASKVAL_Msk & ((value) << GMAC_ST2CW020_MASKVAL_Pos))) +#define GMAC_ST2CW020_COMPVAL_Pos 16 +#define GMAC_ST2CW020_COMPVAL_Msk (0xffffu << GMAC_ST2CW020_COMPVAL_Pos) /**< \brief (GMAC_ST2CW020) Compare Value */ +#define GMAC_ST2CW020_COMPVAL(value) ((GMAC_ST2CW020_COMPVAL_Msk & ((value) << GMAC_ST2CW020_COMPVAL_Pos))) +/* -------- GMAC_ST2CW120 : (GMAC Offset: 0x7A4) Screening Type 2 Compare Word 1 Register (index = 20) -------- */ +#define GMAC_ST2CW120_OFFSVAL_Pos 0 +#define GMAC_ST2CW120_OFFSVAL_Msk (0x7fu << GMAC_ST2CW120_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW120) Offset Value in Bytes */ +#define GMAC_ST2CW120_OFFSVAL(value) ((GMAC_ST2CW120_OFFSVAL_Msk & ((value) << GMAC_ST2CW120_OFFSVAL_Pos))) +#define GMAC_ST2CW120_OFFSSTRT_Pos 7 +#define GMAC_ST2CW120_OFFSSTRT_Msk (0x3u << GMAC_ST2CW120_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW120) Ethernet Frame Offset Start */ +#define GMAC_ST2CW120_OFFSSTRT(value) ((GMAC_ST2CW120_OFFSSTRT_Msk & ((value) << GMAC_ST2CW120_OFFSSTRT_Pos))) +#define GMAC_ST2CW120_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW120) Offset from the start of the frame */ +#define GMAC_ST2CW120_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW120) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW120_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW120) Offset from the byte after the IP header field */ +#define GMAC_ST2CW120_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW120) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW021 : (GMAC Offset: 0x7A8) Screening Type 2 Compare Word 0 Register (index = 21) -------- */ +#define GMAC_ST2CW021_MASKVAL_Pos 0 +#define GMAC_ST2CW021_MASKVAL_Msk (0xffffu << GMAC_ST2CW021_MASKVAL_Pos) /**< \brief (GMAC_ST2CW021) Mask Value */ +#define GMAC_ST2CW021_MASKVAL(value) ((GMAC_ST2CW021_MASKVAL_Msk & ((value) << GMAC_ST2CW021_MASKVAL_Pos))) +#define GMAC_ST2CW021_COMPVAL_Pos 16 +#define GMAC_ST2CW021_COMPVAL_Msk (0xffffu << GMAC_ST2CW021_COMPVAL_Pos) /**< \brief (GMAC_ST2CW021) Compare Value */ +#define GMAC_ST2CW021_COMPVAL(value) ((GMAC_ST2CW021_COMPVAL_Msk & ((value) << GMAC_ST2CW021_COMPVAL_Pos))) +/* -------- GMAC_ST2CW121 : (GMAC Offset: 0x7AC) Screening Type 2 Compare Word 1 Register (index = 21) -------- */ +#define GMAC_ST2CW121_OFFSVAL_Pos 0 +#define GMAC_ST2CW121_OFFSVAL_Msk (0x7fu << GMAC_ST2CW121_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW121) Offset Value in Bytes */ +#define GMAC_ST2CW121_OFFSVAL(value) ((GMAC_ST2CW121_OFFSVAL_Msk & ((value) << GMAC_ST2CW121_OFFSVAL_Pos))) +#define GMAC_ST2CW121_OFFSSTRT_Pos 7 +#define GMAC_ST2CW121_OFFSSTRT_Msk (0x3u << GMAC_ST2CW121_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW121) Ethernet Frame Offset Start */ +#define GMAC_ST2CW121_OFFSSTRT(value) ((GMAC_ST2CW121_OFFSSTRT_Msk & ((value) << GMAC_ST2CW121_OFFSSTRT_Pos))) +#define GMAC_ST2CW121_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW121) Offset from the start of the frame */ +#define GMAC_ST2CW121_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW121) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW121_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW121) Offset from the byte after the IP header field */ +#define GMAC_ST2CW121_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW121) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW022 : (GMAC Offset: 0x7B0) Screening Type 2 Compare Word 0 Register (index = 22) -------- */ +#define GMAC_ST2CW022_MASKVAL_Pos 0 +#define GMAC_ST2CW022_MASKVAL_Msk (0xffffu << GMAC_ST2CW022_MASKVAL_Pos) /**< \brief (GMAC_ST2CW022) Mask Value */ +#define GMAC_ST2CW022_MASKVAL(value) ((GMAC_ST2CW022_MASKVAL_Msk & ((value) << GMAC_ST2CW022_MASKVAL_Pos))) +#define GMAC_ST2CW022_COMPVAL_Pos 16 +#define GMAC_ST2CW022_COMPVAL_Msk (0xffffu << GMAC_ST2CW022_COMPVAL_Pos) /**< \brief (GMAC_ST2CW022) Compare Value */ +#define GMAC_ST2CW022_COMPVAL(value) ((GMAC_ST2CW022_COMPVAL_Msk & ((value) << GMAC_ST2CW022_COMPVAL_Pos))) +/* -------- GMAC_ST2CW122 : (GMAC Offset: 0x7B4) Screening Type 2 Compare Word 1 Register (index = 22) -------- */ +#define GMAC_ST2CW122_OFFSVAL_Pos 0 +#define GMAC_ST2CW122_OFFSVAL_Msk (0x7fu << GMAC_ST2CW122_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW122) Offset Value in Bytes */ +#define GMAC_ST2CW122_OFFSVAL(value) ((GMAC_ST2CW122_OFFSVAL_Msk & ((value) << GMAC_ST2CW122_OFFSVAL_Pos))) +#define GMAC_ST2CW122_OFFSSTRT_Pos 7 +#define GMAC_ST2CW122_OFFSSTRT_Msk (0x3u << GMAC_ST2CW122_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW122) Ethernet Frame Offset Start */ +#define GMAC_ST2CW122_OFFSSTRT(value) ((GMAC_ST2CW122_OFFSSTRT_Msk & ((value) << GMAC_ST2CW122_OFFSSTRT_Pos))) +#define GMAC_ST2CW122_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW122) Offset from the start of the frame */ +#define GMAC_ST2CW122_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW122) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW122_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW122) Offset from the byte after the IP header field */ +#define GMAC_ST2CW122_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW122) Offset from the byte after the TCP/UDP header field */ +/* -------- GMAC_ST2CW023 : (GMAC Offset: 0x7B8) Screening Type 2 Compare Word 0 Register (index = 23) -------- */ +#define GMAC_ST2CW023_MASKVAL_Pos 0 +#define GMAC_ST2CW023_MASKVAL_Msk (0xffffu << GMAC_ST2CW023_MASKVAL_Pos) /**< \brief (GMAC_ST2CW023) Mask Value */ +#define GMAC_ST2CW023_MASKVAL(value) ((GMAC_ST2CW023_MASKVAL_Msk & ((value) << GMAC_ST2CW023_MASKVAL_Pos))) +#define GMAC_ST2CW023_COMPVAL_Pos 16 +#define GMAC_ST2CW023_COMPVAL_Msk (0xffffu << GMAC_ST2CW023_COMPVAL_Pos) /**< \brief (GMAC_ST2CW023) Compare Value */ +#define GMAC_ST2CW023_COMPVAL(value) ((GMAC_ST2CW023_COMPVAL_Msk & ((value) << GMAC_ST2CW023_COMPVAL_Pos))) +/* -------- GMAC_ST2CW123 : (GMAC Offset: 0x7BC) Screening Type 2 Compare Word 1 Register (index = 23) -------- */ +#define GMAC_ST2CW123_OFFSVAL_Pos 0 +#define GMAC_ST2CW123_OFFSVAL_Msk (0x7fu << GMAC_ST2CW123_OFFSVAL_Pos) /**< \brief (GMAC_ST2CW123) Offset Value in Bytes */ +#define GMAC_ST2CW123_OFFSVAL(value) ((GMAC_ST2CW123_OFFSVAL_Msk & ((value) << GMAC_ST2CW123_OFFSVAL_Pos))) +#define GMAC_ST2CW123_OFFSSTRT_Pos 7 +#define GMAC_ST2CW123_OFFSSTRT_Msk (0x3u << GMAC_ST2CW123_OFFSSTRT_Pos) /**< \brief (GMAC_ST2CW123) Ethernet Frame Offset Start */ +#define GMAC_ST2CW123_OFFSSTRT(value) ((GMAC_ST2CW123_OFFSSTRT_Msk & ((value) << GMAC_ST2CW123_OFFSSTRT_Pos))) +#define GMAC_ST2CW123_OFFSSTRT_FRAMESTART (0x0u << 7) /**< \brief (GMAC_ST2CW123) Offset from the start of the frame */ +#define GMAC_ST2CW123_OFFSSTRT_ETHERTYPE (0x1u << 7) /**< \brief (GMAC_ST2CW123) Offset from the byte after the EtherType field */ +#define GMAC_ST2CW123_OFFSSTRT_IP (0x2u << 7) /**< \brief (GMAC_ST2CW123) Offset from the byte after the IP header field */ +#define GMAC_ST2CW123_OFFSSTRT_TCP_UDP (0x3u << 7) /**< \brief (GMAC_ST2CW123) Offset from the byte after the TCP/UDP header field */ + +/*@}*/ + + +#endif /* _SAMA5D2_GMAC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_i2sc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_i2sc.h new file mode 100644 index 000000000..14610d7e4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_i2sc.h @@ -0,0 +1,185 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_I2SC_COMPONENT_ +#define _SAMA5D2_I2SC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Inter-IC Sound Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_I2SC Inter-IC Sound Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief I2sc hardware registers */ +typedef struct { + __O uint32_t I2SC_CR; /**< \brief (I2sc Offset: 0x00) Control Register */ + __IO uint32_t I2SC_MR; /**< \brief (I2sc Offset: 0x04) Mode Register */ + __I uint32_t I2SC_SR; /**< \brief (I2sc Offset: 0x08) Status Register */ + __O uint32_t I2SC_SCR; /**< \brief (I2sc Offset: 0x0C) Status Clear Register */ + __O uint32_t I2SC_SSR; /**< \brief (I2sc Offset: 0x10) Status Set Register */ + __O uint32_t I2SC_IER; /**< \brief (I2sc Offset: 0x14) Interrupt Enable Register */ + __O uint32_t I2SC_IDR; /**< \brief (I2sc Offset: 0x18) Interrupt Disable Register */ + __I uint32_t I2SC_IMR; /**< \brief (I2sc Offset: 0x1C) Interrupt Mask Register */ + __I uint32_t I2SC_RHR; /**< \brief (I2sc Offset: 0x20) Receiver Holding Register */ + __O uint32_t I2SC_THR; /**< \brief (I2sc Offset: 0x24) Transmitter Holding Register */ + __I uint32_t I2SC_VERSION; /**< \brief (I2sc Offset: 0x28) Version Register */ +} I2sc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- I2SC_CR : (I2SC Offset: 0x00) Control Register -------- */ +#define I2SC_CR_RXEN (0x1u << 0) /**< \brief (I2SC_CR) Receiver Enable */ +#define I2SC_CR_RXDIS (0x1u << 1) /**< \brief (I2SC_CR) Receiver Disable */ +#define I2SC_CR_CKEN (0x1u << 2) /**< \brief (I2SC_CR) Clocks Enable */ +#define I2SC_CR_CKDIS (0x1u << 3) /**< \brief (I2SC_CR) Clocks Disable */ +#define I2SC_CR_TXEN (0x1u << 4) /**< \brief (I2SC_CR) Transmitter Enable */ +#define I2SC_CR_TXDIS (0x1u << 5) /**< \brief (I2SC_CR) Transmitter Disable */ +#define I2SC_CR_SWRST (0x1u << 7) /**< \brief (I2SC_CR) Software Reset */ +/* -------- I2SC_MR : (I2SC Offset: 0x04) Mode Register -------- */ +#define I2SC_MR_MODE (0x1u << 0) /**< \brief (I2SC_MR) Inter-IC Sound Controller Mode */ +#define I2SC_MR_MODE_SLAVE (0x0u << 0) /**< \brief (I2SC_MR) I2SCK and i2SWS pin inputs used as bit clock and word select/frame synchronization. */ +#define I2SC_MR_MODE_MASTER (0x1u << 0) /**< \brief (I2SC_MR) Bit clock and word select/frame synchronization generated by I2SC from MCK and output to I2SCK and I2SWS pins. MCK is output as master clock on I2SMCK if I2SC_MR.IMCKMODE is set. */ +#define I2SC_MR_DATALENGTH_Pos 2 +#define I2SC_MR_DATALENGTH_Msk (0x7u << I2SC_MR_DATALENGTH_Pos) /**< \brief (I2SC_MR) Data Word Length */ +#define I2SC_MR_DATALENGTH(value) ((I2SC_MR_DATALENGTH_Msk & ((value) << I2SC_MR_DATALENGTH_Pos))) +#define I2SC_MR_DATALENGTH_32_BITS (0x0u << 2) /**< \brief (I2SC_MR) Data length is set to 32 bits */ +#define I2SC_MR_DATALENGTH_24_BITS (0x1u << 2) /**< \brief (I2SC_MR) Data length is set to 24 bits */ +#define I2SC_MR_DATALENGTH_20_BITS (0x2u << 2) /**< \brief (I2SC_MR) Data length is set to 20 bits */ +#define I2SC_MR_DATALENGTH_18_BITS (0x3u << 2) /**< \brief (I2SC_MR) Data length is set to 18 bits */ +#define I2SC_MR_DATALENGTH_16_BITS (0x4u << 2) /**< \brief (I2SC_MR) Data length is set to 16 bits */ +#define I2SC_MR_DATALENGTH_16_BITS_COMPACT (0x5u << 2) /**< \brief (I2SC_MR) Data length is set to 16-bit compact stereo. Left sample in bits 15:0 and right sample in bits 31:16 of same word. */ +#define I2SC_MR_DATALENGTH_8_BITS (0x6u << 2) /**< \brief (I2SC_MR) Data length is set to 8 bits */ +#define I2SC_MR_DATALENGTH_8_BITS_COMPACT (0x7u << 2) /**< \brief (I2SC_MR) Data length is set to 8-bit compact stereo. Left sample in bits 7:0 and right sample in bits 15:8 of the same word. */ +#define I2SC_MR_FORMAT_Pos 6 +#define I2SC_MR_FORMAT_Msk (0x3u << I2SC_MR_FORMAT_Pos) /**< \brief (I2SC_MR) Data Format */ +#define I2SC_MR_FORMAT(value) ((I2SC_MR_FORMAT_Msk & ((value) << I2SC_MR_FORMAT_Pos))) +#define I2SC_MR_FORMAT_I2S (0x0u << 6) /**< \brief (I2SC_MR) I2S format, stereo with I2SWS low for left channel, and MSB of sample starting one I2SCK period after I2SWS edge */ +#define I2SC_MR_FORMAT_LJ (0x1u << 6) /**< \brief (I2SC_MR) Left-justified format, stereo with I2SWS high for left channel, and MSB of sample starting on I2SWS edge */ +#define I2SC_MR_FORMAT_TDM (0x2u << 6) /**< \brief (I2SC_MR) TDM format, with (NBCHAN + 1) channels, I2SWS high at beginning of first channel, and MSB of sample starting one ISCK period after I2SWS edge */ +#define I2SC_MR_FORMAT_TDMLJ (0x3u << 6) /**< \brief (I2SC_MR) TDM format, left-justified, with (NBCHAN + 1) channels, I2SWS high at beginning of first channel, and MSB of sample starting on I2SWS edge */ +#define I2SC_MR_RXMONO (0x1u << 8) /**< \brief (I2SC_MR) Receive Mono */ +#define I2SC_MR_RXDMA (0x1u << 9) /**< \brief (I2SC_MR) Single or Multiple DMA Controller Channels for Receiver */ +#define I2SC_MR_RXLOOP (0x1u << 10) /**< \brief (I2SC_MR) Loop-back Test Mode */ +#define I2SC_MR_TXMONO (0x1u << 12) /**< \brief (I2SC_MR) Transmit Mono */ +#define I2SC_MR_TXDMA (0x1u << 13) /**< \brief (I2SC_MR) Single or Multiple DMA Controller Channels for Transmitter */ +#define I2SC_MR_TXSAME (0x1u << 14) /**< \brief (I2SC_MR) Transmit Data when Underrun */ +#define I2SC_MR_NBCHAN_Pos 16 +#define I2SC_MR_NBCHAN_Msk (0x7u << I2SC_MR_NBCHAN_Pos) /**< \brief (I2SC_MR) Number of TDM Channels-1 */ +#define I2SC_MR_NBCHAN(value) ((I2SC_MR_NBCHAN_Msk & ((value) << I2SC_MR_NBCHAN_Pos))) +#define I2SC_MR_TDMFS_Pos 22 +#define I2SC_MR_TDMFS_Msk (0x3u << I2SC_MR_TDMFS_Pos) /**< \brief (I2SC_MR) TDM Frame Synchronization */ +#define I2SC_MR_TDMFS(value) ((I2SC_MR_TDMFS_Msk & ((value) << I2SC_MR_TDMFS_Pos))) +#define I2SC_MR_TDMFS_SLOT (0x0u << 22) /**< \brief (I2SC_MR) I2SWS pulse is high for one time slot at beginning of frame */ +#define I2SC_MR_TDMFS_HALF (0x1u << 22) /**< \brief (I2SC_MR) I2SWS pulse is high for half the time slots at beginning of frame, i.e., half the IWS period */ +#define I2SC_MR_TDMFS_BIT (0x2u << 22) /**< \brief (I2SC_MR) I2SWS pulse is high for one bit period at beginning of frame, i.e., one ISCK period */ +#define I2SC_MR_IMCKFS_Pos 24 +#define I2SC_MR_IMCKFS_Msk (0x3fu << I2SC_MR_IMCKFS_Pos) /**< \brief (I2SC_MR) Master Clock to fs Ratio */ +#define I2SC_MR_IMCKFS(value) ((I2SC_MR_IMCKFS_Msk & ((value) << I2SC_MR_IMCKFS_Pos))) +#define I2SC_MR_IMCKFS_M2SF32_64_96_128 (0x0u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 32 for two channels, set to 64 for 4 channels, set to 96 for 6 channels and set to 128 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF64_128_192_256 (0x1u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 64 for two channels, set to 128 for 4 channels, set to 192 for 6 channels and set to 256 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF96_192_384 (0x2u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 96 for two channels, set to 192 for 4 channels and set to 384 for 8 channels */ +#define I2SC_MR_IMCKFS_M2SF128_256_384_512 (0x3u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 128 for two channels, set to 256 for 4 channels set to 384 for 6 channels and set to 512 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF192_384_768 (0x5u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 192 for two channels, set to 384 for 4 channels and set to 768 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF256_512_768_1024 (0x7u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 256 for two channels, set to 512 for 4 channels, set to 768 for 6 channels and set to 1024 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF384_768_1536 (0xBu << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 384 for two channels, set to 768 for 4 channels and set to 1536 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF512_1024_1536_2048 (0xFu << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 512 for two channels, set to 1024 for 4 channels, set to 1536 for 6 channels and set to 2048 for 8 channels. */ +#define I2SC_MR_IMCKFS_M2SF768_1536 (0x17u << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 768 for two channels and set to 1536 for 4 channels. */ +#define I2SC_MR_IMCKFS_M2SF1024_2048 (0x1Fu << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 1024 for two channels and set to 2048 for 4 channels. */ +#define I2SC_MR_IMCKFS_M2SF1536 (0x2Fu << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 1536. */ +#define I2SC_MR_IMCKFS_M2SF2048 (0x3Fu << 24) /**< \brief (I2SC_MR) Sample frequency ratio set to 2048. */ +#define I2SC_MR_IMCKMODE (0x1u << 30) /**< \brief (I2SC_MR) Master Clock Mode */ +#define I2SC_MR_IWS (0x1u << 31) /**< \brief (I2SC_MR) I2SWS Slot Width */ +/* -------- I2SC_SR : (I2SC Offset: 0x08) Status Register -------- */ +#define I2SC_SR_RXEN (0x1u << 0) /**< \brief (I2SC_SR) Receiver Enabled */ +#define I2SC_SR_RXRDY (0x1u << 1) /**< \brief (I2SC_SR) Receive Ready */ +#define I2SC_SR_RXOR (0x1u << 2) /**< \brief (I2SC_SR) Receive Overrun */ +#define I2SC_SR_TXEN (0x1u << 4) /**< \brief (I2SC_SR) Transmitter Enabled */ +#define I2SC_SR_TXRDY (0x1u << 5) /**< \brief (I2SC_SR) Transmit Ready */ +#define I2SC_SR_TXUR (0x1u << 6) /**< \brief (I2SC_SR) Transmit Underrun */ +#define I2SC_SR_RXORCH_Pos 8 +#define I2SC_SR_RXORCH_Msk (0xffu << I2SC_SR_RXORCH_Pos) /**< \brief (I2SC_SR) Receive Overrun Channel */ +#define I2SC_SR_TXURCH30_Pos 20 +#define I2SC_SR_TXURCH30_Msk (0xfu << I2SC_SR_TXURCH30_Pos) /**< \brief (I2SC_SR) Transmit Underrun Channel */ +#define I2SC_SR_TXURCH74_Pos 24 +#define I2SC_SR_TXURCH74_Msk (0xfu << I2SC_SR_TXURCH74_Pos) /**< \brief (I2SC_SR) Transmit Underrun Channel */ +/* -------- I2SC_SCR : (I2SC Offset: 0x0C) Status Clear Register -------- */ +#define I2SC_SCR_RXOR (0x1u << 2) /**< \brief (I2SC_SCR) Receive Overrun Status Clear */ +#define I2SC_SCR_TXUR (0x1u << 6) /**< \brief (I2SC_SCR) Transmit Underrun Status Clear */ +#define I2SC_SCR_RXORCH_Pos 8 +#define I2SC_SCR_RXORCH_Msk (0xffu << I2SC_SCR_RXORCH_Pos) /**< \brief (I2SC_SCR) Receive Overrun Per Channel Status Clear */ +#define I2SC_SCR_RXORCH(value) ((I2SC_SCR_RXORCH_Msk & ((value) << I2SC_SCR_RXORCH_Pos))) +#define I2SC_SCR_TXURCH30_Pos 20 +#define I2SC_SCR_TXURCH30_Msk (0xfu << I2SC_SCR_TXURCH30_Pos) /**< \brief (I2SC_SCR) Transmit Underrun Per Channel for Channel 30 Status Clear */ +#define I2SC_SCR_TXURCH30(value) ((I2SC_SCR_TXURCH30_Msk & ((value) << I2SC_SCR_TXURCH30_Pos))) +#define I2SC_SCR_TXURCH74_Pos 24 +#define I2SC_SCR_TXURCH74_Msk (0xfu << I2SC_SCR_TXURCH74_Pos) /**< \brief (I2SC_SCR) Transmit Underrun Per Channel for Channel 74 Status Clear */ +#define I2SC_SCR_TXURCH74(value) ((I2SC_SCR_TXURCH74_Msk & ((value) << I2SC_SCR_TXURCH74_Pos))) +/* -------- I2SC_SSR : (I2SC Offset: 0x10) Status Set Register -------- */ +#define I2SC_SSR_RXOR (0x1u << 2) /**< \brief (I2SC_SSR) Receive Overrun Status Set */ +#define I2SC_SSR_TXUR (0x1u << 6) /**< \brief (I2SC_SSR) Transmit Underrun Status Set */ +#define I2SC_SSR_RXORCH_Pos 8 +#define I2SC_SSR_RXORCH_Msk (0xffu << I2SC_SSR_RXORCH_Pos) /**< \brief (I2SC_SSR) Receive Overrun Per Channel Status Set */ +#define I2SC_SSR_RXORCH(value) ((I2SC_SSR_RXORCH_Msk & ((value) << I2SC_SSR_RXORCH_Pos))) +#define I2SC_SSR_TXURCH30_Pos 20 +#define I2SC_SSR_TXURCH30_Msk (0xfu << I2SC_SSR_TXURCH30_Pos) /**< \brief (I2SC_SSR) Transmit Underrun Per Channel for Channel 30 Status Set */ +#define I2SC_SSR_TXURCH30(value) ((I2SC_SSR_TXURCH30_Msk & ((value) << I2SC_SSR_TXURCH30_Pos))) +#define I2SC_SSR_TXURCH74_Pos 24 +#define I2SC_SSR_TXURCH74_Msk (0xfu << I2SC_SSR_TXURCH74_Pos) /**< \brief (I2SC_SSR) Transmit Underrun Per Channel for Channel 74 Status Set */ +#define I2SC_SSR_TXURCH74(value) ((I2SC_SSR_TXURCH74_Msk & ((value) << I2SC_SSR_TXURCH74_Pos))) +/* -------- I2SC_IER : (I2SC Offset: 0x14) Interrupt Enable Register -------- */ +#define I2SC_IER_RXRDY (0x1u << 1) /**< \brief (I2SC_IER) Receiver Ready Interrupt Enable */ +#define I2SC_IER_RXOR (0x1u << 2) /**< \brief (I2SC_IER) Receiver Overrun Interrupt Enable */ +#define I2SC_IER_TXRDY (0x1u << 5) /**< \brief (I2SC_IER) Transmit Ready Interrupt Enable */ +#define I2SC_IER_TXUR (0x1u << 6) /**< \brief (I2SC_IER) Transmit Underflow Interrupt Enable */ +/* -------- I2SC_IDR : (I2SC Offset: 0x18) Interrupt Disable Register -------- */ +#define I2SC_IDR_RXRDY (0x1u << 1) /**< \brief (I2SC_IDR) Receiver Ready Interrupt Disable */ +#define I2SC_IDR_RXOR (0x1u << 2) /**< \brief (I2SC_IDR) Receiver Overrun Interrupt Disable */ +#define I2SC_IDR_TXRDY (0x1u << 5) /**< \brief (I2SC_IDR) Transmit Ready Interrupt Disable */ +#define I2SC_IDR_TXUR (0x1u << 6) /**< \brief (I2SC_IDR) Transmit Underflow Interrupt Disable */ +/* -------- I2SC_IMR : (I2SC Offset: 0x1C) Interrupt Mask Register -------- */ +#define I2SC_IMR_RXRDY (0x1u << 1) /**< \brief (I2SC_IMR) Receiver Ready Interrupt Disable */ +#define I2SC_IMR_RXOR (0x1u << 2) /**< \brief (I2SC_IMR) Receiver Overrun Interrupt Disable */ +#define I2SC_IMR_TXRDY (0x1u << 5) /**< \brief (I2SC_IMR) Transmit Ready Interrupt Disable */ +#define I2SC_IMR_TXUR (0x1u << 6) /**< \brief (I2SC_IMR) Transmit Underflow Interrupt Disable */ +/* -------- I2SC_RHR : (I2SC Offset: 0x20) Receiver Holding Register -------- */ +#define I2SC_RHR_RHR_Pos 0 +#define I2SC_RHR_RHR_Msk (0xffffffffu << I2SC_RHR_RHR_Pos) /**< \brief (I2SC_RHR) Receiver Holding Register */ +/* -------- I2SC_THR : (I2SC Offset: 0x24) Transmitter Holding Register -------- */ +#define I2SC_THR_THR_Pos 0 +#define I2SC_THR_THR_Msk (0xffffffffu << I2SC_THR_THR_Pos) /**< \brief (I2SC_THR) Transmitter Holding Register */ +#define I2SC_THR_THR(value) ((I2SC_THR_THR_Msk & ((value) << I2SC_THR_THR_Pos))) +/* -------- I2SC_VERSION : (I2SC Offset: 0x28) Version Register -------- */ +#define I2SC_VERSION_VERSION_Pos 0 +#define I2SC_VERSION_VERSION_Msk (0xfffu << I2SC_VERSION_VERSION_Pos) /**< \brief (I2SC_VERSION) Version of the Hardware Module */ +#define I2SC_VERSION_MFN_Pos 16 +#define I2SC_VERSION_MFN_Msk (0x7u << I2SC_VERSION_MFN_Pos) /**< \brief (I2SC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_I2SC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_icm.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_icm.h new file mode 100644 index 000000000..166636fd0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_icm.h @@ -0,0 +1,226 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_ICM_COMPONENT_ +#define _SAMA5D2_ICM_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Integrity Check Monitor */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_ICM Integrity Check Monitor */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Icm hardware registers */ +typedef struct { + __IO uint32_t ICM_CFG; /**< \brief (Icm Offset: 0x00) Configuration Register */ + __O uint32_t ICM_CTRL; /**< \brief (Icm Offset: 0x04) Control Register */ + __O uint32_t ICM_SR; /**< \brief (Icm Offset: 0x08) Status Register */ + __I uint32_t Reserved1[1]; + __O uint32_t ICM_IER; /**< \brief (Icm Offset: 0x10) Interrupt Enable Register */ + __O uint32_t ICM_IDR; /**< \brief (Icm Offset: 0x14) Interrupt Disable Register */ + __I uint32_t ICM_IMR; /**< \brief (Icm Offset: 0x18) Interrupt Mask Register */ + __I uint32_t ICM_ISR; /**< \brief (Icm Offset: 0x1C) Interrupt Status Register */ + __I uint32_t ICM_UASR; /**< \brief (Icm Offset: 0x20) Undefined Access Status Register */ + __I uint32_t Reserved2[3]; + __IO uint32_t ICM_DSCR; /**< \brief (Icm Offset: 0x30) Region Descriptor Area Start Address Register */ + __IO uint32_t ICM_HASH; /**< \brief (Icm Offset: 0x34) Region Hash Area Start Address Register */ + __O uint32_t ICM_UIHVAL[16]; /**< \brief (Icm Offset: 0x38) User Initial Hash Value 0 Register */ + __I uint32_t Reserved3[29]; + __I uint32_t ICM_ADDRSIZE; /**< \brief (Icm Offset: 0xEC) Address Size Register */ + __I uint32_t ICM_IPNAME[2]; /**< \brief (Icm Offset: 0xF0) IP Name 1 Register */ + __I uint32_t ICM_FEATURES; /**< \brief (Icm Offset: 0xF8) Feature Register */ + __I uint32_t ICM_VERSION; /**< \brief (Icm Offset: 0xFC) Version Register */ +} Icm; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- ICM_CFG : (ICM Offset: 0x00) Configuration Register -------- */ +#define ICM_CFG_WBDIS (0x1u << 0) /**< \brief (ICM_CFG) Write Back Disable */ +#define ICM_CFG_EOMDIS (0x1u << 1) /**< \brief (ICM_CFG) End of Monitoring Disable */ +#define ICM_CFG_SLBDIS (0x1u << 2) /**< \brief (ICM_CFG) Secondary List Branching Disable */ +#define ICM_CFG_BBC_Pos 4 +#define ICM_CFG_BBC_Msk (0xfu << ICM_CFG_BBC_Pos) /**< \brief (ICM_CFG) Bus Burden Control */ +#define ICM_CFG_BBC(value) ((ICM_CFG_BBC_Msk & ((value) << ICM_CFG_BBC_Pos))) +#define ICM_CFG_ASCD (0x1u << 8) /**< \brief (ICM_CFG) Automatic Switch To Compare Digest */ +#define ICM_CFG_DUALBUFF (0x1u << 9) /**< \brief (ICM_CFG) Dual Input Buffer */ +#define ICM_CFG_UIHASH (0x1u << 12) /**< \brief (ICM_CFG) User Initial Hash Value */ +#define ICM_CFG_UALGO_Pos 13 +#define ICM_CFG_UALGO_Msk (0x7u << ICM_CFG_UALGO_Pos) /**< \brief (ICM_CFG) User SHA Algorithm */ +#define ICM_CFG_UALGO(value) ((ICM_CFG_UALGO_Msk & ((value) << ICM_CFG_UALGO_Pos))) +#define ICM_CFG_UALGO_SHA1 (0x0u << 13) /**< \brief (ICM_CFG) SHA1 algorithm processed */ +#define ICM_CFG_UALGO_SHA256 (0x1u << 13) /**< \brief (ICM_CFG) SHA256 algorithm processed */ +#define ICM_CFG_UALGO_SHA384 (0x2u << 13) /**< \brief (ICM_CFG) SHA384 algorithm processed */ +#define ICM_CFG_UALGO_SHA512 (0x3u << 13) /**< \brief (ICM_CFG) SHA512 algorithm processed */ +#define ICM_CFG_UALGO_SHA224 (0x4u << 13) /**< \brief (ICM_CFG) SHA224 algorithm processed */ +#define ICM_CFG_HAPROT_Pos 16 +#define ICM_CFG_HAPROT_Msk (0x3fu << ICM_CFG_HAPROT_Pos) /**< \brief (ICM_CFG) Region Hash Area Protection */ +#define ICM_CFG_HAPROT(value) ((ICM_CFG_HAPROT_Msk & ((value) << ICM_CFG_HAPROT_Pos))) +#define ICM_CFG_DAPROT_Pos 24 +#define ICM_CFG_DAPROT_Msk (0x3fu << ICM_CFG_DAPROT_Pos) /**< \brief (ICM_CFG) Region Descriptor Area Protection */ +#define ICM_CFG_DAPROT(value) ((ICM_CFG_DAPROT_Msk & ((value) << ICM_CFG_DAPROT_Pos))) +/* -------- ICM_CTRL : (ICM Offset: 0x04) Control Register -------- */ +#define ICM_CTRL_ENABLE (0x1u << 0) /**< \brief (ICM_CTRL) ICM Enable */ +#define ICM_CTRL_DISABLE (0x1u << 1) /**< \brief (ICM_CTRL) ICM Disable Register */ +#define ICM_CTRL_SWRST (0x1u << 2) /**< \brief (ICM_CTRL) Software Reset */ +#define ICM_CTRL_REHASH_Pos 4 +#define ICM_CTRL_REHASH_Msk (0xfu << ICM_CTRL_REHASH_Pos) /**< \brief (ICM_CTRL) Recompute Internal Hash */ +#define ICM_CTRL_REHASH(value) ((ICM_CTRL_REHASH_Msk & ((value) << ICM_CTRL_REHASH_Pos))) +#define ICM_CTRL_RMDIS_Pos 8 +#define ICM_CTRL_RMDIS_Msk (0xfu << ICM_CTRL_RMDIS_Pos) /**< \brief (ICM_CTRL) Region Monitoring Disable */ +#define ICM_CTRL_RMDIS(value) ((ICM_CTRL_RMDIS_Msk & ((value) << ICM_CTRL_RMDIS_Pos))) +#define ICM_CTRL_RMEN_Pos 12 +#define ICM_CTRL_RMEN_Msk (0xfu << ICM_CTRL_RMEN_Pos) /**< \brief (ICM_CTRL) Region Monitoring Enable */ +#define ICM_CTRL_RMEN(value) ((ICM_CTRL_RMEN_Msk & ((value) << ICM_CTRL_RMEN_Pos))) +/* -------- ICM_SR : (ICM Offset: 0x08) Status Register -------- */ +#define ICM_SR_ENABLE (0x1u << 0) /**< \brief (ICM_SR) ICM Controller Enable Register */ +#define ICM_SR_RAWRMDIS_Pos 8 +#define ICM_SR_RAWRMDIS_Msk (0xfu << ICM_SR_RAWRMDIS_Pos) /**< \brief (ICM_SR) Region Monitoring Disabled Raw Status */ +#define ICM_SR_RAWRMDIS(value) ((ICM_SR_RAWRMDIS_Msk & ((value) << ICM_SR_RAWRMDIS_Pos))) +#define ICM_SR_RMDIS_Pos 12 +#define ICM_SR_RMDIS_Msk (0xfu << ICM_SR_RMDIS_Pos) /**< \brief (ICM_SR) Region Monitoring Disabled Status */ +#define ICM_SR_RMDIS(value) ((ICM_SR_RMDIS_Msk & ((value) << ICM_SR_RMDIS_Pos))) +/* -------- ICM_IER : (ICM Offset: 0x10) Interrupt Enable Register -------- */ +#define ICM_IER_RHC_Pos 0 +#define ICM_IER_RHC_Msk (0xfu << ICM_IER_RHC_Pos) /**< \brief (ICM_IER) Region Hash Completed Interrupt Enable */ +#define ICM_IER_RHC(value) ((ICM_IER_RHC_Msk & ((value) << ICM_IER_RHC_Pos))) +#define ICM_IER_RDM_Pos 4 +#define ICM_IER_RDM_Msk (0xfu << ICM_IER_RDM_Pos) /**< \brief (ICM_IER) Region Digest Mismatch Interrupt Enable */ +#define ICM_IER_RDM(value) ((ICM_IER_RDM_Msk & ((value) << ICM_IER_RDM_Pos))) +#define ICM_IER_RBE_Pos 8 +#define ICM_IER_RBE_Msk (0xfu << ICM_IER_RBE_Pos) /**< \brief (ICM_IER) Region Bus Error Interrupt Enable */ +#define ICM_IER_RBE(value) ((ICM_IER_RBE_Msk & ((value) << ICM_IER_RBE_Pos))) +#define ICM_IER_RWC_Pos 12 +#define ICM_IER_RWC_Msk (0xfu << ICM_IER_RWC_Pos) /**< \brief (ICM_IER) Region Wrap Condition detected Interrupt Enable */ +#define ICM_IER_RWC(value) ((ICM_IER_RWC_Msk & ((value) << ICM_IER_RWC_Pos))) +#define ICM_IER_REC_Pos 16 +#define ICM_IER_REC_Msk (0xfu << ICM_IER_REC_Pos) /**< \brief (ICM_IER) Region End bit Condition Detected Interrupt Enable */ +#define ICM_IER_REC(value) ((ICM_IER_REC_Msk & ((value) << ICM_IER_REC_Pos))) +#define ICM_IER_RSU_Pos 20 +#define ICM_IER_RSU_Msk (0xfu << ICM_IER_RSU_Pos) /**< \brief (ICM_IER) Region Status Updated Interrupt Disable */ +#define ICM_IER_RSU(value) ((ICM_IER_RSU_Msk & ((value) << ICM_IER_RSU_Pos))) +#define ICM_IER_URAD (0x1u << 24) /**< \brief (ICM_IER) Undefined Register Access Detection Interrupt Enable */ +/* -------- ICM_IDR : (ICM Offset: 0x14) Interrupt Disable Register -------- */ +#define ICM_IDR_RHC_Pos 0 +#define ICM_IDR_RHC_Msk (0xfu << ICM_IDR_RHC_Pos) /**< \brief (ICM_IDR) Region Hash Completed Interrupt Disable */ +#define ICM_IDR_RHC(value) ((ICM_IDR_RHC_Msk & ((value) << ICM_IDR_RHC_Pos))) +#define ICM_IDR_RDM_Pos 4 +#define ICM_IDR_RDM_Msk (0xfu << ICM_IDR_RDM_Pos) /**< \brief (ICM_IDR) Region Digest Mismatch Interrupt Disable */ +#define ICM_IDR_RDM(value) ((ICM_IDR_RDM_Msk & ((value) << ICM_IDR_RDM_Pos))) +#define ICM_IDR_RBE_Pos 8 +#define ICM_IDR_RBE_Msk (0xfu << ICM_IDR_RBE_Pos) /**< \brief (ICM_IDR) Region Bus Error Interrupt Disable */ +#define ICM_IDR_RBE(value) ((ICM_IDR_RBE_Msk & ((value) << ICM_IDR_RBE_Pos))) +#define ICM_IDR_RWC_Pos 12 +#define ICM_IDR_RWC_Msk (0xfu << ICM_IDR_RWC_Pos) /**< \brief (ICM_IDR) Region Wrap Condition Detected Interrupt Disable */ +#define ICM_IDR_RWC(value) ((ICM_IDR_RWC_Msk & ((value) << ICM_IDR_RWC_Pos))) +#define ICM_IDR_REC_Pos 16 +#define ICM_IDR_REC_Msk (0xfu << ICM_IDR_REC_Pos) /**< \brief (ICM_IDR) Region End bit Condition detected Interrupt Disable */ +#define ICM_IDR_REC(value) ((ICM_IDR_REC_Msk & ((value) << ICM_IDR_REC_Pos))) +#define ICM_IDR_RSU_Pos 20 +#define ICM_IDR_RSU_Msk (0xfu << ICM_IDR_RSU_Pos) /**< \brief (ICM_IDR) Region Status Updated Interrupt Disable */ +#define ICM_IDR_RSU(value) ((ICM_IDR_RSU_Msk & ((value) << ICM_IDR_RSU_Pos))) +#define ICM_IDR_URAD (0x1u << 24) /**< \brief (ICM_IDR) Undefined Register Access Detection Interrupt Disable */ +/* -------- ICM_IMR : (ICM Offset: 0x18) Interrupt Mask Register -------- */ +#define ICM_IMR_RHC_Pos 0 +#define ICM_IMR_RHC_Msk (0xfu << ICM_IMR_RHC_Pos) /**< \brief (ICM_IMR) Region Hash Completed Interrupt Mask */ +#define ICM_IMR_RDM_Pos 4 +#define ICM_IMR_RDM_Msk (0xfu << ICM_IMR_RDM_Pos) /**< \brief (ICM_IMR) Region Digest Mismatch Interrupt Mask */ +#define ICM_IMR_RBE_Pos 8 +#define ICM_IMR_RBE_Msk (0xfu << ICM_IMR_RBE_Pos) /**< \brief (ICM_IMR) Region Bus Error Interrupt Mask */ +#define ICM_IMR_RWC_Pos 12 +#define ICM_IMR_RWC_Msk (0xfu << ICM_IMR_RWC_Pos) /**< \brief (ICM_IMR) Region Wrap Condition Detected Interrupt Mask */ +#define ICM_IMR_REC_Pos 16 +#define ICM_IMR_REC_Msk (0xfu << ICM_IMR_REC_Pos) /**< \brief (ICM_IMR) Region End bit Condition Detected Interrupt Mask */ +#define ICM_IMR_RSU_Pos 20 +#define ICM_IMR_RSU_Msk (0xfu << ICM_IMR_RSU_Pos) /**< \brief (ICM_IMR) Region Status Updated Interrupt Mask */ +#define ICM_IMR_URAD (0x1u << 24) /**< \brief (ICM_IMR) Undefined Register Access Detection Interrupt Mask */ +/* -------- ICM_ISR : (ICM Offset: 0x1C) Interrupt Status Register -------- */ +#define ICM_ISR_RHC_Pos 0 +#define ICM_ISR_RHC_Msk (0xfu << ICM_ISR_RHC_Pos) /**< \brief (ICM_ISR) Region Hash Completed */ +#define ICM_ISR_RDM_Pos 4 +#define ICM_ISR_RDM_Msk (0xfu << ICM_ISR_RDM_Pos) /**< \brief (ICM_ISR) Region Digest Mismatch */ +#define ICM_ISR_RBE_Pos 8 +#define ICM_ISR_RBE_Msk (0xfu << ICM_ISR_RBE_Pos) /**< \brief (ICM_ISR) Region Bus Error */ +#define ICM_ISR_RWC_Pos 12 +#define ICM_ISR_RWC_Msk (0xfu << ICM_ISR_RWC_Pos) /**< \brief (ICM_ISR) Region Wrap Condition Detected */ +#define ICM_ISR_REC_Pos 16 +#define ICM_ISR_REC_Msk (0xfu << ICM_ISR_REC_Pos) /**< \brief (ICM_ISR) Region End bit Condition Detected */ +#define ICM_ISR_RSU_Pos 20 +#define ICM_ISR_RSU_Msk (0xfu << ICM_ISR_RSU_Pos) /**< \brief (ICM_ISR) Region Status Updated Detected */ +#define ICM_ISR_URAD (0x1u << 24) /**< \brief (ICM_ISR) Undefined Register Access Detection Status */ +/* -------- ICM_UASR : (ICM Offset: 0x20) Undefined Access Status Register -------- */ +#define ICM_UASR_URAT_Pos 0 +#define ICM_UASR_URAT_Msk (0x7u << ICM_UASR_URAT_Pos) /**< \brief (ICM_UASR) Undefined Register Access Trace */ +#define ICM_UASR_URAT_UNSPEC_STRUCT_MEMBER (0x0u << 0) /**< \brief (ICM_UASR) Unspecified structure member set to one detected when the descriptor is loaded. */ +#define ICM_UASR_URAT_ICM_CFG_MODIFIED (0x1u << 0) /**< \brief (ICM_UASR) ICM_CFG modified during active monitoring. */ +#define ICM_UASR_URAT_ICM_DSCR_MODIFIED (0x2u << 0) /**< \brief (ICM_UASR) ICM_DSCR modified during active monitoring. */ +#define ICM_UASR_URAT_ICM_HASH_MODIFIED (0x3u << 0) /**< \brief (ICM_UASR) ICM_HASH modified during active monitoring */ +#define ICM_UASR_URAT_READ_ACCESS (0x4u << 0) /**< \brief (ICM_UASR) Write-only register read access */ +/* -------- ICM_DSCR : (ICM Offset: 0x30) Region Descriptor Area Start Address Register -------- */ +#define ICM_DSCR_DASA_Pos 6 +#define ICM_DSCR_DASA_Msk (0x3ffffffu << ICM_DSCR_DASA_Pos) /**< \brief (ICM_DSCR) Descriptor Area Start Address */ +#define ICM_DSCR_DASA(value) ((ICM_DSCR_DASA_Msk & ((value) << ICM_DSCR_DASA_Pos))) +/* -------- ICM_HASH : (ICM Offset: 0x34) Region Hash Area Start Address Register -------- */ +#define ICM_HASH_HASA_Pos 8 +#define ICM_HASH_HASA_Msk (0xffffffu << ICM_HASH_HASA_Pos) /**< \brief (ICM_HASH) Hash Area Start Address */ +#define ICM_HASH_HASA(value) ((ICM_HASH_HASA_Msk & ((value) << ICM_HASH_HASA_Pos))) +/* -------- ICM_UIHVAL[16] : (ICM Offset: 0x38) User Initial Hash Value 0 Register -------- */ +#define ICM_UIHVAL_VAL_Pos 0 +#define ICM_UIHVAL_VAL_Msk (0xffffffffu << ICM_UIHVAL_VAL_Pos) /**< \brief (ICM_UIHVAL[16]) Initial Hash Value */ +#define ICM_UIHVAL_VAL(value) ((ICM_UIHVAL_VAL_Msk & ((value) << ICM_UIHVAL_VAL_Pos))) +/* -------- ICM_ADDRSIZE : (ICM Offset: 0xEC) Address Size Register -------- */ +#define ICM_ADDRSIZE_ADDRSIZE_Pos 0 +#define ICM_ADDRSIZE_ADDRSIZE_Msk (0xffffu << ICM_ADDRSIZE_ADDRSIZE_Pos) /**< \brief (ICM_ADDRSIZE) Peripheral Bus Address Area Size */ +/* -------- ICM_IPNAME[2] : (ICM Offset: 0xF0) IP Name 1 Register -------- */ +#define ICM_IPNAME_IPNAME_Pos 0 +#define ICM_IPNAME_IPNAME_Msk (0xffffffffu << ICM_IPNAME_IPNAME_Pos) /**< \brief (ICM_IPNAME[2]) IP Name in ASCII Format */ +/* -------- ICM_FEATURES : (ICM Offset: 0xF8) Feature Register -------- */ +#define ICM_FEATURES_CFGALGO (0x1u << 0) /**< \brief (ICM_FEATURES) Configurable Algorithms */ +#define ICM_FEATURES_RFU (0x1u << 1) /**< \brief (ICM_FEATURES) Reserved for Future Use */ +#define ICM_FEATURES_CFGPP (0x1u << 2) /**< \brief (ICM_FEATURES) Configurable Processing Period */ +#define ICM_FEATURES_HDPP (0x1u << 3) /**< \brief (ICM_FEATURES) Hardcoded Processing Period */ +#define ICM_FEATURES_PDC (0x1u << 4) /**< \brief (ICM_FEATURES) Peripheral DMA Logic */ +#define ICM_FEATURES_NAIS (0x1u << 5) /**< \brief (ICM_FEATURES) No Access to Intermediate State */ +#define ICM_FEATURES_EF (0x1u << 6) /**< \brief (ICM_FEATURES) Embedded LFSR */ +#define ICM_FEATURES_SI (0x1u << 7) /**< \brief (ICM_FEATURES) Scan Intrusion */ +#define ICM_FEATURES_BTYP (0x1u << 8) /**< \brief (ICM_FEATURES) Bridge Type */ +#define ICM_FEATURES_PDCOFF0C (0x1u << 9) /**< \brief (ICM_FEATURES) PDC Offset is 0x0C */ +#define ICM_FEATURES_HSHA1 (0x1u << 16) /**< \brief (ICM_FEATURES) SHA1 Hardcoded Mode */ +#define ICM_FEATURES_HSHA224 (0x1u << 17) /**< \brief (ICM_FEATURES) SHA224 Hardcoded Mode */ +#define ICM_FEATURES_HSHA256 (0x1u << 18) /**< \brief (ICM_FEATURES) SHA256 Hardcoded Mode */ +#define ICM_FEATURES_HSHA384 (0x1u << 19) /**< \brief (ICM_FEATURES) SHA384 Hardcoded Mode */ +#define ICM_FEATURES_HSHA512 (0x1u << 20) /**< \brief (ICM_FEATURES) SHA512 Hardcoded Mode */ +/* -------- ICM_VERSION : (ICM Offset: 0xFC) Version Register -------- */ +#define ICM_VERSION_VERSION_Pos 0 +#define ICM_VERSION_VERSION_Msk (0xfffu << ICM_VERSION_VERSION_Pos) /**< \brief (ICM_VERSION) Version of the Hardware Module */ +#define ICM_VERSION_MFN_Pos 16 +#define ICM_VERSION_MFN_Msk (0x7u << ICM_VERSION_MFN_Pos) /**< \brief (ICM_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_ICM_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_isc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_isc.h new file mode 100644 index 000000000..c3f0132ff --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_isc.h @@ -0,0 +1,568 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_ISC_COMPONENT_ +#define _SAMA5D2_ISC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Image Sensor Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_ISC Image Sensor Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief IscSub0 hardware registers */ +typedef struct { + __IO uint32_t ISC_DAD; /**< \brief (IscSub0 Offset: 0x0) DMA Address 0 Register */ + __IO uint32_t ISC_DST; /**< \brief (IscSub0 Offset: 0x4) DMA Stride 0 Register */ +} IscSub0; +/** \brief Isc hardware registers */ +#define ISCSUB0_NUMBER 3 +typedef struct { + __O uint32_t ISC_CTRLEN; /**< \brief (Isc Offset: 0x00) Control Enable Register */ + __O uint32_t ISC_CTRLDIS; /**< \brief (Isc Offset: 0x04) Control Disable Register */ + __I uint32_t ISC_CTRLSR; /**< \brief (Isc Offset: 0x08) Control Status Register */ + __IO uint32_t ISC_PFE_CFG0; /**< \brief (Isc Offset: 0x0C) Parallel Front End Configuration 0 Register */ + __IO uint32_t ISC_PFE_CFG1; /**< \brief (Isc Offset: 0x10) Parallel Front End Configuration 1 Register */ + __IO uint32_t ISC_PFE_CFG2; /**< \brief (Isc Offset: 0x14) Parallel Front End Configuration 2 Register */ + __O uint32_t ISC_CLKEN; /**< \brief (Isc Offset: 0x18) Clock Enable Register */ + __O uint32_t ISC_CLKDIS; /**< \brief (Isc Offset: 0x1C) Clock Disable Register */ + __I uint32_t ISC_CLKSR; /**< \brief (Isc Offset: 0x20) Clock Status Register */ + __IO uint32_t ISC_CLKCFG; /**< \brief (Isc Offset: 0x24) Clock Configuration Register */ + __O uint32_t ISC_INTEN; /**< \brief (Isc Offset: 0x28) Interrupt Enable Register */ + __O uint32_t ISC_INTDIS; /**< \brief (Isc Offset: 0x2C) Interrupt Disable Register */ + __I uint32_t ISC_INTMASK; /**< \brief (Isc Offset: 0x30) Interrupt Mask Register */ + __I uint32_t ISC_INTSR; /**< \brief (Isc Offset: 0x34) Interrupt Status Register */ + __I uint32_t Reserved1[8]; + __IO uint32_t ISC_WB_CTRL; /**< \brief (Isc Offset: 0x58) White Balance Control Register */ + __IO uint32_t ISC_WB_CFG; /**< \brief (Isc Offset: 0x5C) White Balance Configuration Register */ + __IO uint32_t ISC_WB_O_RGR; /**< \brief (Isc Offset: 0x60) White Balance Offset for R, GR Register */ + __IO uint32_t ISC_WB_O_BGB; /**< \brief (Isc Offset: 0x64) White Balance Offset for B, GB Register */ + __IO uint32_t ISC_WB_G_RGR; /**< \brief (Isc Offset: 0x68) White Balance Gain for R, GR Register */ + __IO uint32_t ISC_WB_G_BGB; /**< \brief (Isc Offset: 0x6C) White Balance Gain for B, GB Register */ + __IO uint32_t ISC_CFA_CTRL; /**< \brief (Isc Offset: 0x70) Color Filter Array Control Register */ + __IO uint32_t ISC_CFA_CFG; /**< \brief (Isc Offset: 0x74) Color Filter Array Configuration Register */ + __IO uint32_t ISC_CC_CTRL; /**< \brief (Isc Offset: 0x78) Color Correction Control Register */ + __IO uint32_t ISC_CC_RR_RG; /**< \brief (Isc Offset: 0x7C) Color Correction RR RG Register */ + __IO uint32_t ISC_CC_RB_OR; /**< \brief (Isc Offset: 0x80) Color Correction RB OR Register */ + __IO uint32_t ISC_CC_GR_GG; /**< \brief (Isc Offset: 0x84) Color Correction GR GG Register */ + __IO uint32_t ISC_CC_GB_OG; /**< \brief (Isc Offset: 0x88) Color Correction GB OG Register */ + __IO uint32_t ISC_CC_BR_BG; /**< \brief (Isc Offset: 0x8C) Color Correction BR BG Register */ + __IO uint32_t ISC_CC_BB_OB; /**< \brief (Isc Offset: 0x90) Color Correction BB OB Register */ + __IO uint32_t ISC_GAM_CTRL; /**< \brief (Isc Offset: 0x94) Gamma Correction Control Register */ + __IO uint32_t ISC_GAM_BENTRY[64]; /**< \brief (Isc Offset: 0x98) Gamma Correction Blue Entry */ + __IO uint32_t ISC_GAM_GENTRY[64]; /**< \brief (Isc Offset: 0x198) Gamma Correction Green Entry */ + __IO uint32_t ISC_GAM_RENTRY[64]; /**< \brief (Isc Offset: 0x298) Gamma Correction Red Entry */ + __IO uint32_t ISC_CSC_CTRL; /**< \brief (Isc Offset: 0x398) Color Space Conversion Control Register */ + __IO uint32_t ISC_CSC_YR_YG; /**< \brief (Isc Offset: 0x39C) Color Space Conversion YR, YG Register */ + __IO uint32_t ISC_CSC_YB_OY; /**< \brief (Isc Offset: 0x3A0) Color Space Conversion YB, OY Register */ + __IO uint32_t ISC_CSC_CBR_CBG; /**< \brief (Isc Offset: 0x3A4) Color Space Conversion CBR CBG Register */ + __IO uint32_t ISC_CSC_CBB_OCB; /**< \brief (Isc Offset: 0x3A8) Color Space Conversion CBB OCB Register */ + __IO uint32_t ISC_CSC_CRR_CRG; /**< \brief (Isc Offset: 0x3AC) Color Space Conversion CRR CRG Register */ + __IO uint32_t ISC_CSC_CRB_OCR; /**< \brief (Isc Offset: 0x3B0) Color Space Conversion CRB OCR Register */ + __IO uint32_t ISC_CBC_CTRL; /**< \brief (Isc Offset: 0x3B4) Contrast and Brightness Control Register */ + __IO uint32_t ISC_CBC_CFG; /**< \brief (Isc Offset: 0x3B8) Contrast and Brightness Configuration Register */ + __IO uint32_t ISC_CBC_BRIGHT; /**< \brief (Isc Offset: 0x3BC) Contrast and Brightness, Brightness Register */ + __IO uint32_t ISC_CBC_CONTRAST; /**< \brief (Isc Offset: 0x3C0) Contrast and Brightness, Contrast Register */ + __IO uint32_t ISC_SUB422_CTRL; /**< \brief (Isc Offset: 0x3C4) Subsampling 4:4:4 to 4:2:2 Control Register */ + __IO uint32_t ISC_SUB422_CFG; /**< \brief (Isc Offset: 0x3C8) Subsampling 4:4:4 to 4:2:2 Configuration Register */ + __IO uint32_t ISC_SUB420_CTRL; /**< \brief (Isc Offset: 0x3CC) Subsampling 4:2:2 to 4:2:0 Control Register */ + __IO uint32_t ISC_RLP_CFG; /**< \brief (Isc Offset: 0x3D0) Rounding, Limiting and Packing Config Register */ + __IO uint32_t ISC_HIS_CTRL; /**< \brief (Isc Offset: 0x3D4) Histogram Control Register */ + __IO uint32_t ISC_HIS_CFG; /**< \brief (Isc Offset: 0x3D8) Histogram Configuration Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t ISC_DCFG; /**< \brief (Isc Offset: 0x3E0) DMA Configuration Register */ + __IO uint32_t ISC_DCTRL; /**< \brief (Isc Offset: 0x3E4) DMA Control Register */ + __IO uint32_t ISC_DNDA; /**< \brief (Isc Offset: 0x3E8) DMA Descriptor Address Register */ + IscSub0 ISC_SUB0[ISCSUB0_NUMBER]; /**< \brief (Isc Offset: 0x3EC) 0 .. 2 */ + __I uint32_t Reserved3[2]; + __I uint32_t IPB_VERSION; /**< \brief (Isc Offset: 0x40C) Version Register */ + __I uint32_t ISC_HIS_ENTRY[512]; /**< \brief (Isc Offset: 0x410) Histogram Entry */ +} Isc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- ISC_CTRLEN : (ISC Offset: 0x00) Control Enable Register -------- */ +#define ISC_CTRLEN_CAPTURE (0x1u << 0) /**< \brief (ISC_CTRLEN) Capture Input Stream Command */ +#define ISC_CTRLEN_UPPRO (0x1u << 1) /**< \brief (ISC_CTRLEN) Update Profile */ +#define ISC_CTRLEN_HISREQ (0x1u << 2) /**< \brief (ISC_CTRLEN) Histogram Request */ +#define ISC_CTRLEN_HISCLR (0x1u << 3) /**< \brief (ISC_CTRLEN) Histogram Clear */ +/* -------- ISC_CTRLDIS : (ISC Offset: 0x04) Control Disable Register -------- */ +#define ISC_CTRLDIS_DISABLE (0x1u << 0) /**< \brief (ISC_CTRLDIS) Capture Disable */ +#define ISC_CTRLDIS_SWRST (0x1u << 8) /**< \brief (ISC_CTRLDIS) Software Reset */ +/* -------- ISC_CTRLSR : (ISC Offset: 0x08) Control Status Register -------- */ +#define ISC_CTRLSR_CAPTURE (0x1u << 0) /**< \brief (ISC_CTRLSR) Capture pending */ +#define ISC_CTRLSR_UPPRO (0x1u << 1) /**< \brief (ISC_CTRLSR) Profile Update Pending */ +#define ISC_CTRLSR_HISREQ (0x1u << 2) /**< \brief (ISC_CTRLSR) Histogram Request Pending */ +#define ISC_CTRLSR_FIELD (0x1u << 4) /**< \brief (ISC_CTRLSR) Field Status (only relevant when the video stream is interlaced) */ +#define ISC_CTRLSR_SIP (0x1u << 31) /**< \brief (ISC_CTRLSR) Synchronization In Progress */ +/* -------- ISC_PFE_CFG0 : (ISC Offset: 0x0C) Parallel Front End Configuration 0 Register -------- */ +#define ISC_PFE_CFG0_HPOL (0x1u << 0) /**< \brief (ISC_PFE_CFG0) Horizontal Synchronization Polarity */ +#define ISC_PFE_CFG0_VPOL (0x1u << 1) /**< \brief (ISC_PFE_CFG0) Vertical Synchronization Polarity */ +#define ISC_PFE_CFG0_PPOL (0x1u << 2) /**< \brief (ISC_PFE_CFG0) Pixel Clock Polarity */ +#define ISC_PFE_CFG0_FPOL (0x1u << 3) /**< \brief (ISC_PFE_CFG0) Field Polarity */ +#define ISC_PFE_CFG0_MODE_Pos 4 +#define ISC_PFE_CFG0_MODE_Msk (0x7u << ISC_PFE_CFG0_MODE_Pos) /**< \brief (ISC_PFE_CFG0) Parallel Front End Mode */ +#define ISC_PFE_CFG0_MODE(value) ((ISC_PFE_CFG0_MODE_Msk & ((value) << ISC_PFE_CFG0_MODE_Pos))) +#define ISC_PFE_CFG0_MODE_PROGRESSIVE (0x0u << 4) /**< \brief (ISC_PFE_CFG0) Video source is progressive. */ +#define ISC_PFE_CFG0_MODE_DF_TOP (0x1u << 4) /**< \brief (ISC_PFE_CFG0) Video source is interlaced, two fields are captured starting with top field. */ +#define ISC_PFE_CFG0_MODE_DF_BOTTOM (0x2u << 4) /**< \brief (ISC_PFE_CFG0) Video source is interlaced, two fields are captured starting with bottom field. */ +#define ISC_PFE_CFG0_MODE_DF_IMMEDIATE (0x3u << 4) /**< \brief (ISC_PFE_CFG0) Video source is interlaced, two fields are captured immediately. */ +#define ISC_PFE_CFG0_MODE_SF_TOP (0x4u << 4) /**< \brief (ISC_PFE_CFG0) Video source is interlaced, one field is captured starting with the top field. */ +#define ISC_PFE_CFG0_MODE_SF_BOTTOM (0x5u << 4) /**< \brief (ISC_PFE_CFG0) Video source is interlaced, one field is captured starting with the bottom field. */ +#define ISC_PFE_CFG0_MODE_SF_IMMEDIATE (0x6u << 4) /**< \brief (ISC_PFE_CFG0) Video source is interlaced, one field is captured starting immediately. */ +#define ISC_PFE_CFG0_CONT (0x1u << 7) /**< \brief (ISC_PFE_CFG0) Continuous Acquisition */ +#define ISC_PFE_CFG0_GATED (0x1u << 8) /**< \brief (ISC_PFE_CFG0) Gated input clock */ +#define ISC_PFE_CFG0_CCIR656 (0x1u << 9) /**< \brief (ISC_PFE_CFG0) CCIR656 input mode */ +#define ISC_PFE_CFG0_CCIR_CRC (0x1u << 10) /**< \brief (ISC_PFE_CFG0) CCIR656 CRC Decoder */ +#define ISC_PFE_CFG0_CCIR10_8N (0x1u << 11) /**< \brief (ISC_PFE_CFG0) CCIR 10 bits or 8 bits */ +#define ISC_PFE_CFG0_COLEN (0x1u << 12) /**< \brief (ISC_PFE_CFG0) Column Cropping Enable */ +#define ISC_PFE_CFG0_ROWEN (0x1u << 13) /**< \brief (ISC_PFE_CFG0) Row Cropping Enable */ +#define ISC_PFE_CFG0_SKIPCNT_Pos 16 +#define ISC_PFE_CFG0_SKIPCNT_Msk (0xffu << ISC_PFE_CFG0_SKIPCNT_Pos) /**< \brief (ISC_PFE_CFG0) Frame Skipping Counter */ +#define ISC_PFE_CFG0_SKIPCNT(value) ((ISC_PFE_CFG0_SKIPCNT_Msk & ((value) << ISC_PFE_CFG0_SKIPCNT_Pos))) +#define ISC_PFE_CFG0_CCIR_REP (0x1u << 27) /**< \brief (ISC_PFE_CFG0) CCIR Replication */ +#define ISC_PFE_CFG0_BPS_Pos 28 +#define ISC_PFE_CFG0_BPS_Msk (0x7u << ISC_PFE_CFG0_BPS_Pos) /**< \brief (ISC_PFE_CFG0) Bits Per Sample */ +#define ISC_PFE_CFG0_BPS(value) ((ISC_PFE_CFG0_BPS_Msk & ((value) << ISC_PFE_CFG0_BPS_Pos))) +#define ISC_PFE_CFG0_BPS_TWELVE (0x0u << 28) /**< \brief (ISC_PFE_CFG0) 12-bit input */ +#define ISC_PFE_CFG0_BPS_ELEVEN (0x1u << 28) /**< \brief (ISC_PFE_CFG0) 11-bit input */ +#define ISC_PFE_CFG0_BPS_TEN (0x2u << 28) /**< \brief (ISC_PFE_CFG0) 10-bit input */ +#define ISC_PFE_CFG0_BPS_NINE (0x3u << 28) /**< \brief (ISC_PFE_CFG0) 9-bit input */ +#define ISC_PFE_CFG0_BPS_EIGHT (0x4u << 28) /**< \brief (ISC_PFE_CFG0) 8-bit input */ +#define ISC_PFE_CFG0_REP (0x1u << 31) /**< \brief (ISC_PFE_CFG0) Up Multiply with Replication */ +/* -------- ISC_PFE_CFG1 : (ISC Offset: 0x10) Parallel Front End Configuration 1 Register -------- */ +#define ISC_PFE_CFG1_COLMIN_Pos 0 +#define ISC_PFE_CFG1_COLMIN_Msk (0xffffu << ISC_PFE_CFG1_COLMIN_Pos) /**< \brief (ISC_PFE_CFG1) Column Minimum Limit */ +#define ISC_PFE_CFG1_COLMIN(value) ((ISC_PFE_CFG1_COLMIN_Msk & ((value) << ISC_PFE_CFG1_COLMIN_Pos))) +#define ISC_PFE_CFG1_COLMAX_Pos 16 +#define ISC_PFE_CFG1_COLMAX_Msk (0xffffu << ISC_PFE_CFG1_COLMAX_Pos) /**< \brief (ISC_PFE_CFG1) Column Maximum Limit */ +#define ISC_PFE_CFG1_COLMAX(value) ((ISC_PFE_CFG1_COLMAX_Msk & ((value) << ISC_PFE_CFG1_COLMAX_Pos))) +/* -------- ISC_PFE_CFG2 : (ISC Offset: 0x14) Parallel Front End Configuration 2 Register -------- */ +#define ISC_PFE_CFG2_ROWMIN_Pos 0 +#define ISC_PFE_CFG2_ROWMIN_Msk (0xffffu << ISC_PFE_CFG2_ROWMIN_Pos) /**< \brief (ISC_PFE_CFG2) Row Minimum Limit */ +#define ISC_PFE_CFG2_ROWMIN(value) ((ISC_PFE_CFG2_ROWMIN_Msk & ((value) << ISC_PFE_CFG2_ROWMIN_Pos))) +#define ISC_PFE_CFG2_ROWMAX_Pos 16 +#define ISC_PFE_CFG2_ROWMAX_Msk (0xffffu << ISC_PFE_CFG2_ROWMAX_Pos) /**< \brief (ISC_PFE_CFG2) Row Maximum Limit */ +#define ISC_PFE_CFG2_ROWMAX(value) ((ISC_PFE_CFG2_ROWMAX_Msk & ((value) << ISC_PFE_CFG2_ROWMAX_Pos))) +/* -------- ISC_CLKEN : (ISC Offset: 0x18) Clock Enable Register -------- */ +#define ISC_CLKEN_ICEN (0x1u << 0) /**< \brief (ISC_CLKEN) ISP Clock Enable */ +#define ISC_CLKEN_MCEN (0x1u << 1) /**< \brief (ISC_CLKEN) Master Clock Enable */ +/* -------- ISC_CLKDIS : (ISC Offset: 0x1C) Clock Disable Register -------- */ +#define ISC_CLKDIS_ICDIS (0x1u << 0) /**< \brief (ISC_CLKDIS) ISP Clock Disable */ +#define ISC_CLKDIS_MCDIS (0x1u << 1) /**< \brief (ISC_CLKDIS) Master Clock Disable */ +#define ISC_CLKDIS_ICSWRST (0x1u << 8) /**< \brief (ISC_CLKDIS) ISP Clock Software Reset */ +#define ISC_CLKDIS_MCSWRST (0x1u << 9) /**< \brief (ISC_CLKDIS) Master Clock Software Reset */ +/* -------- ISC_CLKSR : (ISC Offset: 0x20) Clock Status Register -------- */ +#define ISC_CLKSR_ICSR (0x1u << 0) /**< \brief (ISC_CLKSR) ISP Clock Status Register */ +#define ISC_CLKSR_MCSR (0x1u << 1) /**< \brief (ISC_CLKSR) Master Clock Status Register */ +#define ISC_CLKSR_SIP (0x1u << 31) /**< \brief (ISC_CLKSR) Synchronization In Progress */ +/* -------- ISC_CLKCFG : (ISC Offset: 0x24) Clock Configuration Register -------- */ +#define ISC_CLKCFG_ICDIV_Pos 0 +#define ISC_CLKCFG_ICDIV_Msk (0xffu << ISC_CLKCFG_ICDIV_Pos) /**< \brief (ISC_CLKCFG) ISP Clock Divider */ +#define ISC_CLKCFG_ICDIV(value) ((ISC_CLKCFG_ICDIV_Msk & ((value) << ISC_CLKCFG_ICDIV_Pos))) +#define ISC_CLKCFG_ICSEL (0x1u << 8) /**< \brief (ISC_CLKCFG) ISP Clock Selection */ +#define ISC_CLKCFG_MCDIV_Pos 16 +#define ISC_CLKCFG_MCDIV_Msk (0xffu << ISC_CLKCFG_MCDIV_Pos) /**< \brief (ISC_CLKCFG) Master Clock Divider */ +#define ISC_CLKCFG_MCDIV(value) ((ISC_CLKCFG_MCDIV_Msk & ((value) << ISC_CLKCFG_MCDIV_Pos))) +#define ISC_CLKCFG_MCSEL_Pos 24 +#define ISC_CLKCFG_MCSEL_Msk (0x3u << ISC_CLKCFG_MCSEL_Pos) /**< \brief (ISC_CLKCFG) Master Clock Reference Clock Selection */ +#define ISC_CLKCFG_MCSEL(value) ((ISC_CLKCFG_MCSEL_Msk & ((value) << ISC_CLKCFG_MCSEL_Pos))) +/* -------- ISC_INTEN : (ISC Offset: 0x28) Interrupt Enable Register -------- */ +#define ISC_INTEN_VD (0x1u << 0) /**< \brief (ISC_INTEN) Vertical Synchronization Detection Interrupt Enable */ +#define ISC_INTEN_HD (0x1u << 1) /**< \brief (ISC_INTEN) Horizontal Synchronization Detection Interrupt Enable */ +#define ISC_INTEN_SWRST (0x1u << 4) /**< \brief (ISC_INTEN) Software Reset Completed Interrupt Enable */ +#define ISC_INTEN_DIS (0x1u << 5) /**< \brief (ISC_INTEN) Disable Completed Interrupt Enable */ +#define ISC_INTEN_DDONE (0x1u << 8) /**< \brief (ISC_INTEN) DMA Done Interrupt Enable */ +#define ISC_INTEN_LDONE (0x1u << 9) /**< \brief (ISC_INTEN) DMA List Done Interrupt Enable */ +#define ISC_INTEN_HISDONE (0x1u << 12) /**< \brief (ISC_INTEN) Histogram Completed Interrupt Enable */ +#define ISC_INTEN_HISCLR (0x1u << 13) /**< \brief (ISC_INTEN) Histogram Clear Interrupt Enable */ +#define ISC_INTEN_WERR (0x1u << 16) /**< \brief (ISC_INTEN) Write Channel Error Interrupt Enable */ +#define ISC_INTEN_RERR (0x1u << 20) /**< \brief (ISC_INTEN) Read Channel Error Interrupt Enable */ +#define ISC_INTEN_VFPOV (0x1u << 24) /**< \brief (ISC_INTEN) Vertical Front Porch Overflow Interrupt Enable */ +#define ISC_INTEN_DAOV (0x1u << 25) /**< \brief (ISC_INTEN) Data Overflow Interrupt Enable */ +#define ISC_INTEN_VDTO (0x1u << 26) /**< \brief (ISC_INTEN) Vertical Synchronization Timeout Interrupt Enable */ +#define ISC_INTEN_HDTO (0x1u << 27) /**< \brief (ISC_INTEN) Horizontal Synchronization Timeout Interrupt Enable */ +#define ISC_INTEN_CCIRERR (0x1u << 28) /**< \brief (ISC_INTEN) CCIR Decoder Error Interrupt Enable */ +/* -------- ISC_INTDIS : (ISC Offset: 0x2C) Interrupt Disable Register -------- */ +#define ISC_INTDIS_VD (0x1u << 0) /**< \brief (ISC_INTDIS) Vertical Synchronization Detection Interrupt Disable */ +#define ISC_INTDIS_HD (0x1u << 1) /**< \brief (ISC_INTDIS) Horizontal Synchronization Detection Interrupt Disable */ +#define ISC_INTDIS_SWRST (0x1u << 4) /**< \brief (ISC_INTDIS) Software Reset Completed Interrupt Disable */ +#define ISC_INTDIS_DIS (0x1u << 5) /**< \brief (ISC_INTDIS) Disable Completed Interrupt Disable */ +#define ISC_INTDIS_DDONE (0x1u << 8) /**< \brief (ISC_INTDIS) DMA Done Interrupt Disable */ +#define ISC_INTDIS_LDONE (0x1u << 9) /**< \brief (ISC_INTDIS) DMA List Done Interrupt Disable */ +#define ISC_INTDIS_HISDONE (0x1u << 12) /**< \brief (ISC_INTDIS) Histogram Completed Interrupt Disable */ +#define ISC_INTDIS_HISCLR (0x1u << 13) /**< \brief (ISC_INTDIS) Histogram Clear Interrupt Disable */ +#define ISC_INTDIS_WERR (0x1u << 16) /**< \brief (ISC_INTDIS) Write Channel Error Interrupt Disable */ +#define ISC_INTDIS_RERR (0x1u << 20) /**< \brief (ISC_INTDIS) Read Channel Error Interrupt Disable */ +#define ISC_INTDIS_VFPOV (0x1u << 24) /**< \brief (ISC_INTDIS) Vertical Front Porch Overflow Interrupt Disable */ +#define ISC_INTDIS_DAOV (0x1u << 25) /**< \brief (ISC_INTDIS) Data Overflow Interrupt Disable */ +#define ISC_INTDIS_VDTO (0x1u << 26) /**< \brief (ISC_INTDIS) Vertical Synchronization Timeout Interrupt Disable */ +#define ISC_INTDIS_HDTO (0x1u << 27) /**< \brief (ISC_INTDIS) Horizontal Synchronization Timeout Interrupt Disable */ +#define ISC_INTDIS_CCIRERR (0x1u << 28) /**< \brief (ISC_INTDIS) CCIR Decoder Error Interrupt Disable */ +/* -------- ISC_INTMASK : (ISC Offset: 0x30) Interrupt Mask Register -------- */ +#define ISC_INTMASK_VD (0x1u << 0) /**< \brief (ISC_INTMASK) Vertical Synchronization Detection Interrupt Mask */ +#define ISC_INTMASK_HD (0x1u << 1) /**< \brief (ISC_INTMASK) Horizontal Synchronization Detection Interrupt Mask */ +#define ISC_INTMASK_SWRST (0x1u << 4) /**< \brief (ISC_INTMASK) Software Reset Completed Interrupt Mask */ +#define ISC_INTMASK_DIS (0x1u << 5) /**< \brief (ISC_INTMASK) Disable Completed Interrupt Mask */ +#define ISC_INTMASK_DDONE (0x1u << 8) /**< \brief (ISC_INTMASK) DMA Done Interrupt Mask */ +#define ISC_INTMASK_LDONE (0x1u << 9) /**< \brief (ISC_INTMASK) DMA List Done Interrupt Mask */ +#define ISC_INTMASK_HISDONE (0x1u << 12) /**< \brief (ISC_INTMASK) Histogram Completed Interrupt Mask */ +#define ISC_INTMASK_HISCLR (0x1u << 13) /**< \brief (ISC_INTMASK) Histogram Clear Interrupt Mask */ +#define ISC_INTMASK_WERR (0x1u << 16) /**< \brief (ISC_INTMASK) Write Channel Error Interrupt Mask */ +#define ISC_INTMASK_RERR (0x1u << 20) /**< \brief (ISC_INTMASK) Read Channel Error Interrupt Mask */ +#define ISC_INTMASK_VFPOV (0x1u << 24) /**< \brief (ISC_INTMASK) Vertical Front Porch Overflow Interrupt Mask */ +#define ISC_INTMASK_DAOV (0x1u << 25) /**< \brief (ISC_INTMASK) Data Overflow Interrupt Mask */ +#define ISC_INTMASK_VDTO (0x1u << 26) /**< \brief (ISC_INTMASK) Vertical Synchronization Timeout Interrupt Mask */ +#define ISC_INTMASK_HDTO (0x1u << 27) /**< \brief (ISC_INTMASK) Horizontal Synchronization Timeout Interrupt Mask */ +#define ISC_INTMASK_CCIRERR (0x1u << 28) /**< \brief (ISC_INTMASK) CCIR Decoder Error Interrupt Mask */ +/* -------- ISC_INTSR : (ISC Offset: 0x34) Interrupt Status Register -------- */ +#define ISC_INTSR_VD (0x1u << 0) /**< \brief (ISC_INTSR) Vertical Synchronization Detected Interrupt */ +#define ISC_INTSR_HD (0x1u << 1) /**< \brief (ISC_INTSR) Horizontal Synchronization Detected Interrupt */ +#define ISC_INTSR_SWRST (0x1u << 4) /**< \brief (ISC_INTSR) Software Reset Completed Interrupt */ +#define ISC_INTSR_DIS (0x1u << 5) /**< \brief (ISC_INTSR) Disable Completed Interrupt */ +#define ISC_INTSR_DDONE (0x1u << 8) /**< \brief (ISC_INTSR) DMA Done Interrupt */ +#define ISC_INTSR_LDONE (0x1u << 9) /**< \brief (ISC_INTSR) DMA List Done Interrupt */ +#define ISC_INTSR_HISDONE (0x1u << 12) /**< \brief (ISC_INTSR) Histogram Completed Interrupt */ +#define ISC_INTSR_HISCLR (0x1u << 13) /**< \brief (ISC_INTSR) Histogram Clear Interrupt */ +#define ISC_INTSR_WERR (0x1u << 16) /**< \brief (ISC_INTSR) Write Channel Error Interrupt */ +#define ISC_INTSR_WERRID_Pos 17 +#define ISC_INTSR_WERRID_Msk (0x3u << ISC_INTSR_WERRID_Pos) /**< \brief (ISC_INTSR) Write Channel Error Identifier */ +#define ISC_INTSR_WERRID_CH0 (0x0u << 17) /**< \brief (ISC_INTSR) An error occurred for Channel 0 (RAW/RGB/Y) */ +#define ISC_INTSR_WERRID_CH1 (0x1u << 17) /**< \brief (ISC_INTSR) An error occurred for Channel 1 (CbCr/Cb) */ +#define ISC_INTSR_WERRID_CH2 (0x2u << 17) /**< \brief (ISC_INTSR) An error occurred for Channel 2 (Cr) */ +#define ISC_INTSR_WERRID_WB (0x3u << 17) /**< \brief (ISC_INTSR) Write back channel error */ +#define ISC_INTSR_RERR (0x1u << 20) /**< \brief (ISC_INTSR) Read Channel Error Interrupt */ +#define ISC_INTSR_VFPOV (0x1u << 24) /**< \brief (ISC_INTSR) Vertical Front Porch Overflow Interrupt */ +#define ISC_INTSR_DAOV (0x1u << 25) /**< \brief (ISC_INTSR) Data Overflow Interrupt */ +#define ISC_INTSR_VDTO (0x1u << 26) /**< \brief (ISC_INTSR) Vertical Synchronization Timeout Interrupt */ +#define ISC_INTSR_HDTO (0x1u << 27) /**< \brief (ISC_INTSR) Horizontal Synchronization Timeout Interrupt */ +#define ISC_INTSR_CCIRERR (0x1u << 28) /**< \brief (ISC_INTSR) CCIR Decoder Error Interrupt */ +/* -------- ISC_WB_CTRL : (ISC Offset: 0x58) White Balance Control Register -------- */ +#define ISC_WB_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_WB_CTRL) White Balance Enable */ +/* -------- ISC_WB_CFG : (ISC Offset: 0x5C) White Balance Configuration Register -------- */ +#define ISC_WB_CFG_BAYCFG_Pos 0 +#define ISC_WB_CFG_BAYCFG_Msk (0x3u << ISC_WB_CFG_BAYCFG_Pos) /**< \brief (ISC_WB_CFG) White Balance Bayer Configuration (Pixel Color Pattern) */ +#define ISC_WB_CFG_BAYCFG(value) ((ISC_WB_CFG_BAYCFG_Msk & ((value) << ISC_WB_CFG_BAYCFG_Pos))) +#define ISC_WB_CFG_BAYCFG_GRGR (0x0u << 0) /**< \brief (ISC_WB_CFG) Starting Row configuration is G R G R (Red Row) */ +#define ISC_WB_CFG_BAYCFG_RGRG (0x1u << 0) /**< \brief (ISC_WB_CFG) Starting Row configuration is R G R G (Red Row */ +#define ISC_WB_CFG_BAYCFG_GBGB (0x2u << 0) /**< \brief (ISC_WB_CFG) Starting Row configuration is G B G B (Blue Row */ +#define ISC_WB_CFG_BAYCFG_BGBG (0x3u << 0) /**< \brief (ISC_WB_CFG) Starting Row configuration is B G B G (Blue Row) */ +/* -------- ISC_WB_O_RGR : (ISC Offset: 0x60) White Balance Offset for R, GR Register -------- */ +#define ISC_WB_O_RGR_ROFST_Pos 0 +#define ISC_WB_O_RGR_ROFST_Msk (0x1fffu << ISC_WB_O_RGR_ROFST_Pos) /**< \brief (ISC_WB_O_RGR) Offset Red Component (signed 13 bits 1:12:0) */ +#define ISC_WB_O_RGR_ROFST(value) ((ISC_WB_O_RGR_ROFST_Msk & ((value) << ISC_WB_O_RGR_ROFST_Pos))) +#define ISC_WB_O_RGR_GROFST_Pos 16 +#define ISC_WB_O_RGR_GROFST_Msk (0x1fffu << ISC_WB_O_RGR_GROFST_Pos) /**< \brief (ISC_WB_O_RGR) Offset Green Component for Red Row (signed 13 bits 1:12:0) */ +#define ISC_WB_O_RGR_GROFST(value) ((ISC_WB_O_RGR_GROFST_Msk & ((value) << ISC_WB_O_RGR_GROFST_Pos))) +/* -------- ISC_WB_O_BGB : (ISC Offset: 0x64) White Balance Offset for B, GB Register -------- */ +#define ISC_WB_O_BGB_BOFST_Pos 0 +#define ISC_WB_O_BGB_BOFST_Msk (0x1fffu << ISC_WB_O_BGB_BOFST_Pos) /**< \brief (ISC_WB_O_BGB) Offset Blue Component (signed 13 bits, 1:12:0) */ +#define ISC_WB_O_BGB_BOFST(value) ((ISC_WB_O_BGB_BOFST_Msk & ((value) << ISC_WB_O_BGB_BOFST_Pos))) +#define ISC_WB_O_BGB_GBOFST_Pos 16 +#define ISC_WB_O_BGB_GBOFST_Msk (0x1fffu << ISC_WB_O_BGB_GBOFST_Pos) /**< \brief (ISC_WB_O_BGB) Offset Green Component for Blue Row (signed 13 bits, 1:12:0) */ +#define ISC_WB_O_BGB_GBOFST(value) ((ISC_WB_O_BGB_GBOFST_Msk & ((value) << ISC_WB_O_BGB_GBOFST_Pos))) +/* -------- ISC_WB_G_RGR : (ISC Offset: 0x68) White Balance Gain for R, GR Register -------- */ +#define ISC_WB_G_RGR_RGAIN_Pos 0 +#define ISC_WB_G_RGR_RGAIN_Msk (0x1fffu << ISC_WB_G_RGR_RGAIN_Pos) /**< \brief (ISC_WB_G_RGR) Red Component Gain (unsigned 13 bits, 0:4:9) */ +#define ISC_WB_G_RGR_RGAIN(value) ((ISC_WB_G_RGR_RGAIN_Msk & ((value) << ISC_WB_G_RGR_RGAIN_Pos))) +#define ISC_WB_G_RGR_GRGAIN_Pos 16 +#define ISC_WB_G_RGR_GRGAIN_Msk (0x1fffu << ISC_WB_G_RGR_GRGAIN_Pos) /**< \brief (ISC_WB_G_RGR) Green Component (Red row) Gain (unsigned 13 bits, 0:4:9) */ +#define ISC_WB_G_RGR_GRGAIN(value) ((ISC_WB_G_RGR_GRGAIN_Msk & ((value) << ISC_WB_G_RGR_GRGAIN_Pos))) +/* -------- ISC_WB_G_BGB : (ISC Offset: 0x6C) White Balance Gain for B, GB Register -------- */ +#define ISC_WB_G_BGB_BGAIN_Pos 0 +#define ISC_WB_G_BGB_BGAIN_Msk (0x1fffu << ISC_WB_G_BGB_BGAIN_Pos) /**< \brief (ISC_WB_G_BGB) Blue Component Gain (unsigned 13 bits, 0:4:9) */ +#define ISC_WB_G_BGB_BGAIN(value) ((ISC_WB_G_BGB_BGAIN_Msk & ((value) << ISC_WB_G_BGB_BGAIN_Pos))) +#define ISC_WB_G_BGB_GBGAIN_Pos 16 +#define ISC_WB_G_BGB_GBGAIN_Msk (0x1fffu << ISC_WB_G_BGB_GBGAIN_Pos) /**< \brief (ISC_WB_G_BGB) Green Component (Blue row) Gain (unsigned 13 bits, 0:4:9) */ +#define ISC_WB_G_BGB_GBGAIN(value) ((ISC_WB_G_BGB_GBGAIN_Msk & ((value) << ISC_WB_G_BGB_GBGAIN_Pos))) +/* -------- ISC_CFA_CTRL : (ISC Offset: 0x70) Color Filter Array Control Register -------- */ +#define ISC_CFA_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_CFA_CTRL) Color Filter Array Interpolation Enable */ +/* -------- ISC_CFA_CFG : (ISC Offset: 0x74) Color Filter Array Configuration Register -------- */ +#define ISC_CFA_CFG_BAYCFG_Pos 0 +#define ISC_CFA_CFG_BAYCFG_Msk (0x3u << ISC_CFA_CFG_BAYCFG_Pos) /**< \brief (ISC_CFA_CFG) Color Filter Array Pattern */ +#define ISC_CFA_CFG_BAYCFG(value) ((ISC_CFA_CFG_BAYCFG_Msk & ((value) << ISC_CFA_CFG_BAYCFG_Pos))) +#define ISC_CFA_CFG_BAYCFG_GRGR (0x0u << 0) /**< \brief (ISC_CFA_CFG) Starting row configuration is G R G R (red row) */ +#define ISC_CFA_CFG_BAYCFG_RGRG (0x1u << 0) /**< \brief (ISC_CFA_CFG) Starting row configuration is R G R G (red row */ +#define ISC_CFA_CFG_BAYCFG_GBGB (0x2u << 0) /**< \brief (ISC_CFA_CFG) Starting row configuration is G B G B (blue row */ +#define ISC_CFA_CFG_BAYCFG_BGBG (0x3u << 0) /**< \brief (ISC_CFA_CFG) Starting row configuration is B G B G (blue row) */ +#define ISC_CFA_CFG_EITPOL (0x1u << 4) /**< \brief (ISC_CFA_CFG) Edge Interpolation */ +/* -------- ISC_CC_CTRL : (ISC Offset: 0x78) Color Correction Control Register -------- */ +#define ISC_CC_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_CC_CTRL) Color Correction Enable */ +/* -------- ISC_CC_RR_RG : (ISC Offset: 0x7C) Color Correction RR RG Register -------- */ +#define ISC_CC_RR_RG_RRGAIN_Pos 0 +#define ISC_CC_RR_RG_RRGAIN_Msk (0xfffu << ISC_CC_RR_RG_RRGAIN_Pos) /**< \brief (ISC_CC_RR_RG) Red Gain for Red Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_RR_RG_RRGAIN(value) ((ISC_CC_RR_RG_RRGAIN_Msk & ((value) << ISC_CC_RR_RG_RRGAIN_Pos))) +#define ISC_CC_RR_RG_RGGAIN_Pos 16 +#define ISC_CC_RR_RG_RGGAIN_Msk (0xfffu << ISC_CC_RR_RG_RGGAIN_Pos) /**< \brief (ISC_CC_RR_RG) Green Gain for Red Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_RR_RG_RGGAIN(value) ((ISC_CC_RR_RG_RGGAIN_Msk & ((value) << ISC_CC_RR_RG_RGGAIN_Pos))) +/* -------- ISC_CC_RB_OR : (ISC Offset: 0x80) Color Correction RB OR Register -------- */ +#define ISC_CC_RB_OR_RBGAIN_Pos 0 +#define ISC_CC_RB_OR_RBGAIN_Msk (0xfffu << ISC_CC_RB_OR_RBGAIN_Pos) /**< \brief (ISC_CC_RB_OR) Blue Gain for Red Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_RB_OR_RBGAIN(value) ((ISC_CC_RB_OR_RBGAIN_Msk & ((value) << ISC_CC_RB_OR_RBGAIN_Pos))) +#define ISC_CC_RB_OR_ROFST_Pos 16 +#define ISC_CC_RB_OR_ROFST_Msk (0x1fffu << ISC_CC_RB_OR_ROFST_Pos) /**< \brief (ISC_CC_RB_OR) Red Component Offset (signed 13 bits, 1:12:0) */ +#define ISC_CC_RB_OR_ROFST(value) ((ISC_CC_RB_OR_ROFST_Msk & ((value) << ISC_CC_RB_OR_ROFST_Pos))) +/* -------- ISC_CC_GR_GG : (ISC Offset: 0x84) Color Correction GR GG Register -------- */ +#define ISC_CC_GR_GG_GRGAIN_Pos 0 +#define ISC_CC_GR_GG_GRGAIN_Msk (0xfffu << ISC_CC_GR_GG_GRGAIN_Pos) /**< \brief (ISC_CC_GR_GG) Red Gain for Green Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_GR_GG_GRGAIN(value) ((ISC_CC_GR_GG_GRGAIN_Msk & ((value) << ISC_CC_GR_GG_GRGAIN_Pos))) +#define ISC_CC_GR_GG_GGGAIN_Pos 16 +#define ISC_CC_GR_GG_GGGAIN_Msk (0xfffu << ISC_CC_GR_GG_GGGAIN_Pos) /**< \brief (ISC_CC_GR_GG) Green Gain for Green Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_GR_GG_GGGAIN(value) ((ISC_CC_GR_GG_GGGAIN_Msk & ((value) << ISC_CC_GR_GG_GGGAIN_Pos))) +/* -------- ISC_CC_GB_OG : (ISC Offset: 0x88) Color Correction GB OG Register -------- */ +#define ISC_CC_GB_OG_GBGAIN_Pos 0 +#define ISC_CC_GB_OG_GBGAIN_Msk (0xfffu << ISC_CC_GB_OG_GBGAIN_Pos) /**< \brief (ISC_CC_GB_OG) Blue Gain for Green Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_GB_OG_GBGAIN(value) ((ISC_CC_GB_OG_GBGAIN_Msk & ((value) << ISC_CC_GB_OG_GBGAIN_Pos))) +#define ISC_CC_GB_OG_ROFST_Pos 16 +#define ISC_CC_GB_OG_ROFST_Msk (0x1fffu << ISC_CC_GB_OG_ROFST_Pos) /**< \brief (ISC_CC_GB_OG) Green Component Offset (signed 13 bits, 1:12:0) */ +#define ISC_CC_GB_OG_ROFST(value) ((ISC_CC_GB_OG_ROFST_Msk & ((value) << ISC_CC_GB_OG_ROFST_Pos))) +/* -------- ISC_CC_BR_BG : (ISC Offset: 0x8C) Color Correction BR BG Register -------- */ +#define ISC_CC_BR_BG_BRGAIN_Pos 0 +#define ISC_CC_BR_BG_BRGAIN_Msk (0xfffu << ISC_CC_BR_BG_BRGAIN_Pos) /**< \brief (ISC_CC_BR_BG) Red Gain for Blue Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_BR_BG_BRGAIN(value) ((ISC_CC_BR_BG_BRGAIN_Msk & ((value) << ISC_CC_BR_BG_BRGAIN_Pos))) +#define ISC_CC_BR_BG_BGGAIN_Pos 16 +#define ISC_CC_BR_BG_BGGAIN_Msk (0xfffu << ISC_CC_BR_BG_BGGAIN_Pos) /**< \brief (ISC_CC_BR_BG) Green Gain for Blue Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_BR_BG_BGGAIN(value) ((ISC_CC_BR_BG_BGGAIN_Msk & ((value) << ISC_CC_BR_BG_BGGAIN_Pos))) +/* -------- ISC_CC_BB_OB : (ISC Offset: 0x90) Color Correction BB OB Register -------- */ +#define ISC_CC_BB_OB_BBGAIN_Pos 0 +#define ISC_CC_BB_OB_BBGAIN_Msk (0xfffu << ISC_CC_BB_OB_BBGAIN_Pos) /**< \brief (ISC_CC_BB_OB) Blue Gain for Blue Component (signed 12 bits, 1:3:8) */ +#define ISC_CC_BB_OB_BBGAIN(value) ((ISC_CC_BB_OB_BBGAIN_Msk & ((value) << ISC_CC_BB_OB_BBGAIN_Pos))) +#define ISC_CC_BB_OB_BOFST_Pos 16 +#define ISC_CC_BB_OB_BOFST_Msk (0x1fffu << ISC_CC_BB_OB_BOFST_Pos) /**< \brief (ISC_CC_BB_OB) Blue Component Offset (signed 13 bits, 1:12:0) */ +#define ISC_CC_BB_OB_BOFST(value) ((ISC_CC_BB_OB_BOFST_Msk & ((value) << ISC_CC_BB_OB_BOFST_Pos))) +/* -------- ISC_GAM_CTRL : (ISC Offset: 0x94) Gamma Correction Control Register -------- */ +#define ISC_GAM_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_GAM_CTRL) Gamma Correction Enable */ +#define ISC_GAM_CTRL_BENABLE (0x1u << 1) /**< \brief (ISC_GAM_CTRL) Gamma Correction Enable for B Channel */ +#define ISC_GAM_CTRL_GENABLE (0x1u << 2) /**< \brief (ISC_GAM_CTRL) Gamma Correction Enable for G Channel */ +#define ISC_GAM_CTRL_RENABLE (0x1u << 3) /**< \brief (ISC_GAM_CTRL) Gamma Correction Enable for R Channel */ +/* -------- ISC_GAM_BENTRY[64] : (ISC Offset: 0x98) Gamma Correction Blue Entry -------- */ +#define ISC_GAM_BENTRY_BSLOPE_Pos 0 +#define ISC_GAM_BENTRY_BSLOPE_Msk (0x3ffu << ISC_GAM_BENTRY_BSLOPE_Pos) /**< \brief (ISC_GAM_BENTRY[64]) Blue Color Slope for Piecewise Interpolation (signed 10 bits 1:3:6) */ +#define ISC_GAM_BENTRY_BSLOPE(value) ((ISC_GAM_BENTRY_BSLOPE_Msk & ((value) << ISC_GAM_BENTRY_BSLOPE_Pos))) +#define ISC_GAM_BENTRY_BCONSTANT_Pos 16 +#define ISC_GAM_BENTRY_BCONSTANT_Msk (0x3ffu << ISC_GAM_BENTRY_BCONSTANT_Pos) /**< \brief (ISC_GAM_BENTRY[64]) Blue Color Constant for Piecewise Interpolation (unsigned 10 bits 0:10:0) */ +#define ISC_GAM_BENTRY_BCONSTANT(value) ((ISC_GAM_BENTRY_BCONSTANT_Msk & ((value) << ISC_GAM_BENTRY_BCONSTANT_Pos))) +/* -------- ISC_GAM_GENTRY[64] : (ISC Offset: 0x198) Gamma Correction Green Entry -------- */ +#define ISC_GAM_GENTRY_GSLOPE_Pos 0 +#define ISC_GAM_GENTRY_GSLOPE_Msk (0x3ffu << ISC_GAM_GENTRY_GSLOPE_Pos) /**< \brief (ISC_GAM_GENTRY[64]) Green Color Slope for Piecewise Interpolation (signed 10 bits 1:3:6) */ +#define ISC_GAM_GENTRY_GSLOPE(value) ((ISC_GAM_GENTRY_GSLOPE_Msk & ((value) << ISC_GAM_GENTRY_GSLOPE_Pos))) +#define ISC_GAM_GENTRY_GCONSTANT_Pos 16 +#define ISC_GAM_GENTRY_GCONSTANT_Msk (0x3ffu << ISC_GAM_GENTRY_GCONSTANT_Pos) /**< \brief (ISC_GAM_GENTRY[64]) Green Color Constant for Piecewise Interpolation (unsigned 10 bits 0:10:0) */ +#define ISC_GAM_GENTRY_GCONSTANT(value) ((ISC_GAM_GENTRY_GCONSTANT_Msk & ((value) << ISC_GAM_GENTRY_GCONSTANT_Pos))) +/* -------- ISC_GAM_RENTRY[64] : (ISC Offset: 0x298) Gamma Correction Red Entry -------- */ +#define ISC_GAM_RENTRY_RSLOPE_Pos 0 +#define ISC_GAM_RENTRY_RSLOPE_Msk (0x3ffu << ISC_GAM_RENTRY_RSLOPE_Pos) /**< \brief (ISC_GAM_RENTRY[64]) Red Color Slope for Piecewise Interpolation (signed 10 bits 1:3:6) */ +#define ISC_GAM_RENTRY_RSLOPE(value) ((ISC_GAM_RENTRY_RSLOPE_Msk & ((value) << ISC_GAM_RENTRY_RSLOPE_Pos))) +#define ISC_GAM_RENTRY_RCONSTANT_Pos 16 +#define ISC_GAM_RENTRY_RCONSTANT_Msk (0x3ffu << ISC_GAM_RENTRY_RCONSTANT_Pos) /**< \brief (ISC_GAM_RENTRY[64]) Red Color Constant for Piecewise Interpolation (unsigned 10 bits 0:10:0) */ +#define ISC_GAM_RENTRY_RCONSTANT(value) ((ISC_GAM_RENTRY_RCONSTANT_Msk & ((value) << ISC_GAM_RENTRY_RCONSTANT_Pos))) +/* -------- ISC_CSC_CTRL : (ISC Offset: 0x398) Color Space Conversion Control Register -------- */ +#define ISC_CSC_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_CSC_CTRL) RGB to YCbCr Color Space Conversion Enable */ +/* -------- ISC_CSC_YR_YG : (ISC Offset: 0x39C) Color Space Conversion YR, YG Register -------- */ +#define ISC_CSC_YR_YG_YRGAIN_Pos 0 +#define ISC_CSC_YR_YG_YRGAIN_Msk (0xfffu << ISC_CSC_YR_YG_YRGAIN_Pos) /**< \brief (ISC_CSC_YR_YG) Reg Gain for Luminance (signed 12 bits 1:3:8) */ +#define ISC_CSC_YR_YG_YRGAIN(value) ((ISC_CSC_YR_YG_YRGAIN_Msk & ((value) << ISC_CSC_YR_YG_YRGAIN_Pos))) +#define ISC_CSC_YR_YG_YGGAIN_Pos 16 +#define ISC_CSC_YR_YG_YGGAIN_Msk (0xfffu << ISC_CSC_YR_YG_YGGAIN_Pos) /**< \brief (ISC_CSC_YR_YG) Green Gain for Luminance (signed 12 bits 1:3:8) */ +#define ISC_CSC_YR_YG_YGGAIN(value) ((ISC_CSC_YR_YG_YGGAIN_Msk & ((value) << ISC_CSC_YR_YG_YGGAIN_Pos))) +/* -------- ISC_CSC_YB_OY : (ISC Offset: 0x3A0) Color Space Conversion YB, OY Register -------- */ +#define ISC_CSC_YB_OY_YBGAIN_Pos 0 +#define ISC_CSC_YB_OY_YBGAIN_Msk (0xfffu << ISC_CSC_YB_OY_YBGAIN_Pos) /**< \brief (ISC_CSC_YB_OY) Blue Gain for Luminance Component (12 bits signed 1:3:8) */ +#define ISC_CSC_YB_OY_YBGAIN(value) ((ISC_CSC_YB_OY_YBGAIN_Msk & ((value) << ISC_CSC_YB_OY_YBGAIN_Pos))) +#define ISC_CSC_YB_OY_YOFST_Pos 16 +#define ISC_CSC_YB_OY_YOFST_Msk (0x7ffu << ISC_CSC_YB_OY_YOFST_Pos) /**< \brief (ISC_CSC_YB_OY) Luminance Offset (11 bits signed 1:10:0) */ +#define ISC_CSC_YB_OY_YOFST(value) ((ISC_CSC_YB_OY_YOFST_Msk & ((value) << ISC_CSC_YB_OY_YOFST_Pos))) +/* -------- ISC_CSC_CBR_CBG : (ISC Offset: 0x3A4) Color Space Conversion CBR CBG Register -------- */ +#define ISC_CSC_CBR_CBG_CBRGAIN_Pos 0 +#define ISC_CSC_CBR_CBG_CBRGAIN_Msk (0xfffu << ISC_CSC_CBR_CBG_CBRGAIN_Pos) /**< \brief (ISC_CSC_CBR_CBG) Red Gain for Blue Chrominance (signed 12 bits, 1:3:8) */ +#define ISC_CSC_CBR_CBG_CBRGAIN(value) ((ISC_CSC_CBR_CBG_CBRGAIN_Msk & ((value) << ISC_CSC_CBR_CBG_CBRGAIN_Pos))) +#define ISC_CSC_CBR_CBG_CBGGAIN_Pos 16 +#define ISC_CSC_CBR_CBG_CBGGAIN_Msk (0xfffu << ISC_CSC_CBR_CBG_CBGGAIN_Pos) /**< \brief (ISC_CSC_CBR_CBG) Green Gain for Blue Chrominance (signed 12 bits 1:3:8) */ +#define ISC_CSC_CBR_CBG_CBGGAIN(value) ((ISC_CSC_CBR_CBG_CBGGAIN_Msk & ((value) << ISC_CSC_CBR_CBG_CBGGAIN_Pos))) +/* -------- ISC_CSC_CBB_OCB : (ISC Offset: 0x3A8) Color Space Conversion CBB OCB Register -------- */ +#define ISC_CSC_CBB_OCB_CBBGAIN_Pos 0 +#define ISC_CSC_CBB_OCB_CBBGAIN_Msk (0xfffu << ISC_CSC_CBB_OCB_CBBGAIN_Pos) /**< \brief (ISC_CSC_CBB_OCB) Blue Gain for Blue Chrominance (signed 12 bits 1:3:8) */ +#define ISC_CSC_CBB_OCB_CBBGAIN(value) ((ISC_CSC_CBB_OCB_CBBGAIN_Msk & ((value) << ISC_CSC_CBB_OCB_CBBGAIN_Pos))) +#define ISC_CSC_CBB_OCB_CBOFST_Pos 16 +#define ISC_CSC_CBB_OCB_CBOFST_Msk (0x7ffu << ISC_CSC_CBB_OCB_CBOFST_Pos) /**< \brief (ISC_CSC_CBB_OCB) Blue Chrominance Offset (signed 11 bits 1:10:0) */ +#define ISC_CSC_CBB_OCB_CBOFST(value) ((ISC_CSC_CBB_OCB_CBOFST_Msk & ((value) << ISC_CSC_CBB_OCB_CBOFST_Pos))) +/* -------- ISC_CSC_CRR_CRG : (ISC Offset: 0x3AC) Color Space Conversion CRR CRG Register -------- */ +#define ISC_CSC_CRR_CRG_CRRGAIN_Pos 0 +#define ISC_CSC_CRR_CRG_CRRGAIN_Msk (0xfffu << ISC_CSC_CRR_CRG_CRRGAIN_Pos) /**< \brief (ISC_CSC_CRR_CRG) Red Gain for Red Chrominance (signed 12 bits 1:3:8) */ +#define ISC_CSC_CRR_CRG_CRRGAIN(value) ((ISC_CSC_CRR_CRG_CRRGAIN_Msk & ((value) << ISC_CSC_CRR_CRG_CRRGAIN_Pos))) +#define ISC_CSC_CRR_CRG_CRGGAIN_Pos 16 +#define ISC_CSC_CRR_CRG_CRGGAIN_Msk (0xfffu << ISC_CSC_CRR_CRG_CRGGAIN_Pos) /**< \brief (ISC_CSC_CRR_CRG) Green Gain for Red Chrominance (signed 12 bits 1:3:8) */ +#define ISC_CSC_CRR_CRG_CRGGAIN(value) ((ISC_CSC_CRR_CRG_CRGGAIN_Msk & ((value) << ISC_CSC_CRR_CRG_CRGGAIN_Pos))) +/* -------- ISC_CSC_CRB_OCR : (ISC Offset: 0x3B0) Color Space Conversion CRB OCR Register -------- */ +#define ISC_CSC_CRB_OCR_CRBGAIN_Pos 0 +#define ISC_CSC_CRB_OCR_CRBGAIN_Msk (0xfffu << ISC_CSC_CRB_OCR_CRBGAIN_Pos) /**< \brief (ISC_CSC_CRB_OCR) Blue Gain for Red Chrominance (signed 12 bits 1:3:8) */ +#define ISC_CSC_CRB_OCR_CRBGAIN(value) ((ISC_CSC_CRB_OCR_CRBGAIN_Msk & ((value) << ISC_CSC_CRB_OCR_CRBGAIN_Pos))) +#define ISC_CSC_CRB_OCR_CROFST_Pos 16 +#define ISC_CSC_CRB_OCR_CROFST_Msk (0x7ffu << ISC_CSC_CRB_OCR_CROFST_Pos) /**< \brief (ISC_CSC_CRB_OCR) Red Chrominance Offset (signed 11 bits 1:10:0) */ +#define ISC_CSC_CRB_OCR_CROFST(value) ((ISC_CSC_CRB_OCR_CROFST_Msk & ((value) << ISC_CSC_CRB_OCR_CROFST_Pos))) +/* -------- ISC_CBC_CTRL : (ISC Offset: 0x3B4) Contrast and Brightness Control Register -------- */ +#define ISC_CBC_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_CBC_CTRL) Contrast and Brightness Control Enable */ +/* -------- ISC_CBC_CFG : (ISC Offset: 0x3B8) Contrast and Brightness Configuration Register -------- */ +#define ISC_CBC_CFG_CCIR (0x1u << 0) /**< \brief (ISC_CBC_CFG) CCIR656 Stream Enable */ +#define ISC_CBC_CFG_CCIRMODE_Pos 1 +#define ISC_CBC_CFG_CCIRMODE_Msk (0x3u << ISC_CBC_CFG_CCIRMODE_Pos) /**< \brief (ISC_CBC_CFG) CCIR656 Byte Ordering */ +#define ISC_CBC_CFG_CCIRMODE(value) ((ISC_CBC_CFG_CCIRMODE_Msk & ((value) << ISC_CBC_CFG_CCIRMODE_Pos))) +#define ISC_CBC_CFG_CCIRMODE_CBY (0x0u << 1) /**< \brief (ISC_CBC_CFG) Byte ordering Cb0, Y0, Cr0, Y1 */ +#define ISC_CBC_CFG_CCIRMODE_CRY (0x1u << 1) /**< \brief (ISC_CBC_CFG) Byte ordering Cr0, Y0, Cb0, Y1 */ +#define ISC_CBC_CFG_CCIRMODE_YCB (0x2u << 1) /**< \brief (ISC_CBC_CFG) Byte ordering Y0, Cb0, Y1, Cr0 */ +#define ISC_CBC_CFG_CCIRMODE_YCR (0x3u << 1) /**< \brief (ISC_CBC_CFG) Byte ordering Y0, Cr0, Y1, Cb0 */ +/* -------- ISC_CBC_BRIGHT : (ISC Offset: 0x3BC) Contrast and Brightness, Brightness Register -------- */ +#define ISC_CBC_BRIGHT_BRIGHT_Pos 0 +#define ISC_CBC_BRIGHT_BRIGHT_Msk (0x7ffu << ISC_CBC_BRIGHT_BRIGHT_Pos) /**< \brief (ISC_CBC_BRIGHT) Brightness Control (signed 11 bits 1:10:0) */ +#define ISC_CBC_BRIGHT_BRIGHT(value) ((ISC_CBC_BRIGHT_BRIGHT_Msk & ((value) << ISC_CBC_BRIGHT_BRIGHT_Pos))) +/* -------- ISC_CBC_CONTRAST : (ISC Offset: 0x3C0) Contrast and Brightness, Contrast Register -------- */ +#define ISC_CBC_CONTRAST_CONTRAST_Pos 0 +#define ISC_CBC_CONTRAST_CONTRAST_Msk (0xfffu << ISC_CBC_CONTRAST_CONTRAST_Pos) /**< \brief (ISC_CBC_CONTRAST) Contrast (signed 12 bits 1:3:8) */ +#define ISC_CBC_CONTRAST_CONTRAST(value) ((ISC_CBC_CONTRAST_CONTRAST_Msk & ((value) << ISC_CBC_CONTRAST_CONTRAST_Pos))) +/* -------- ISC_SUB422_CTRL : (ISC Offset: 0x3C4) Subsampling 4:4:4 to 4:2:2 Control Register -------- */ +#define ISC_SUB422_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_SUB422_CTRL) 4:4:4 to 4:2:2 Chrominance Horizontal Subsampling Filter Enable */ +/* -------- ISC_SUB422_CFG : (ISC Offset: 0x3C8) Subsampling 4:4:4 to 4:2:2 Configuration Register -------- */ +#define ISC_SUB422_CFG_CCIR (0x1u << 0) /**< \brief (ISC_SUB422_CFG) CCIR656 Input Stream */ +#define ISC_SUB422_CFG_CCIRMODE_Pos 1 +#define ISC_SUB422_CFG_CCIRMODE_Msk (0x3u << ISC_SUB422_CFG_CCIRMODE_Pos) /**< \brief (ISC_SUB422_CFG) CCIR656 Byte Ordering */ +#define ISC_SUB422_CFG_CCIRMODE(value) ((ISC_SUB422_CFG_CCIRMODE_Msk & ((value) << ISC_SUB422_CFG_CCIRMODE_Pos))) +#define ISC_SUB422_CFG_CCIRMODE_CBY (0x0u << 1) /**< \brief (ISC_SUB422_CFG) Byte ordering Cb0, Y0, Cr0, Y1 */ +#define ISC_SUB422_CFG_CCIRMODE_CRY (0x1u << 1) /**< \brief (ISC_SUB422_CFG) Byte ordering Cr0, Y0, Cb0, Y1 */ +#define ISC_SUB422_CFG_CCIRMODE_YCB (0x2u << 1) /**< \brief (ISC_SUB422_CFG) Byte ordering Y0, Cb0, Y1, Cr0 */ +#define ISC_SUB422_CFG_CCIRMODE_YCR (0x3u << 1) /**< \brief (ISC_SUB422_CFG) Byte ordering Y0, Cr0, Y1, Cb0 */ +#define ISC_SUB422_CFG_FILTER_Pos 4 +#define ISC_SUB422_CFG_FILTER_Msk (0x3u << ISC_SUB422_CFG_FILTER_Pos) /**< \brief (ISC_SUB422_CFG) Low Pass Filter Selection */ +#define ISC_SUB422_CFG_FILTER(value) ((ISC_SUB422_CFG_FILTER_Msk & ((value) << ISC_SUB422_CFG_FILTER_Pos))) +#define ISC_SUB422_CFG_FILTER_FILT0CO (0x0u << 4) /**< \brief (ISC_SUB422_CFG) Cosited, {1} */ +#define ISC_SUB422_CFG_FILTER_FILT1CE (0x1u << 4) /**< \brief (ISC_SUB422_CFG) Centered {1, 1} */ +#define ISC_SUB422_CFG_FILTER_FILT2CO (0x2u << 4) /**< \brief (ISC_SUB422_CFG) Cosited {1,2,1} */ +#define ISC_SUB422_CFG_FILTER_FILT3CE (0x3u << 4) /**< \brief (ISC_SUB422_CFG) Centered {1, 3, 3, 1} */ +/* -------- ISC_SUB420_CTRL : (ISC Offset: 0x3CC) Subsampling 4:2:2 to 4:2:0 Control Register -------- */ +#define ISC_SUB420_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_SUB420_CTRL) 4:2:2 to 4:2:0 Vertical Subsampling Filter Enable (Center Aligned) */ +#define ISC_SUB420_CTRL_FILTER (0x1u << 4) /**< \brief (ISC_SUB420_CTRL) Interlaced or Progressive Chrominance Filter */ +/* -------- ISC_RLP_CFG : (ISC Offset: 0x3D0) Rounding, Limiting and Packing Config Register -------- */ +#define ISC_RLP_CFG_MODE_Pos 0 +#define ISC_RLP_CFG_MODE_Msk (0xfu << ISC_RLP_CFG_MODE_Pos) /**< \brief (ISC_RLP_CFG) Rounding, Limiting and Packing Mode */ +#define ISC_RLP_CFG_MODE(value) ((ISC_RLP_CFG_MODE_Msk & ((value) << ISC_RLP_CFG_MODE_Pos))) +#define ISC_RLP_CFG_MODE_DAT8 (0x0u << 0) /**< \brief (ISC_RLP_CFG) 8-bit data */ +#define ISC_RLP_CFG_MODE_DAT9 (0x1u << 0) /**< \brief (ISC_RLP_CFG) 9-bit data */ +#define ISC_RLP_CFG_MODE_DAT10 (0x2u << 0) /**< \brief (ISC_RLP_CFG) 10-bit data */ +#define ISC_RLP_CFG_MODE_DAT11 (0x3u << 0) /**< \brief (ISC_RLP_CFG) 11-bit data */ +#define ISC_RLP_CFG_MODE_DAT12 (0x4u << 0) /**< \brief (ISC_RLP_CFG) 12-bit data */ +#define ISC_RLP_CFG_MODE_DATY8 (0x5u << 0) /**< \brief (ISC_RLP_CFG) 8-bit luminance only */ +#define ISC_RLP_CFG_MODE_DATY10 (0x6u << 0) /**< \brief (ISC_RLP_CFG) 10-bit luminance only */ +#define ISC_RLP_CFG_MODE_ARGB444 (0x7u << 0) /**< \brief (ISC_RLP_CFG) 12-bit RGB+4-bit Alpha (MSB) */ +#define ISC_RLP_CFG_MODE_ARGB555 (0x8u << 0) /**< \brief (ISC_RLP_CFG) 15-bit RGB+1-bit Alpha (MSB) */ +#define ISC_RLP_CFG_MODE_RGB565 (0x9u << 0) /**< \brief (ISC_RLP_CFG) 16-bit RGB */ +#define ISC_RLP_CFG_MODE_ARGB32 (0xAu << 0) /**< \brief (ISC_RLP_CFG) 24-bits RGB mode+8-bit Alpha */ +#define ISC_RLP_CFG_MODE_YYCC (0xBu << 0) /**< \brief (ISC_RLP_CFG) YCbCr mode (full range, [0-255]) */ +#define ISC_RLP_CFG_MODE_YYCC_LIMITED (0xCu << 0) /**< \brief (ISC_RLP_CFG) YCbCr mode (limited range) */ +#define ISC_RLP_CFG_ALPHA_Pos 8 +#define ISC_RLP_CFG_ALPHA_Msk (0xffu << ISC_RLP_CFG_ALPHA_Pos) /**< \brief (ISC_RLP_CFG) Alpha Value for Alpha-enabled RGB Mode */ +#define ISC_RLP_CFG_ALPHA(value) ((ISC_RLP_CFG_ALPHA_Msk & ((value) << ISC_RLP_CFG_ALPHA_Pos))) +/* -------- ISC_HIS_CTRL : (ISC Offset: 0x3D4) Histogram Control Register -------- */ +#define ISC_HIS_CTRL_ENABLE (0x1u << 0) /**< \brief (ISC_HIS_CTRL) Histogram Sub Module Enable */ +/* -------- ISC_HIS_CFG : (ISC Offset: 0x3D8) Histogram Configuration Register -------- */ +#define ISC_HIS_CFG_MODE_Pos 0 +#define ISC_HIS_CFG_MODE_Msk (0x7u << ISC_HIS_CFG_MODE_Pos) /**< \brief (ISC_HIS_CFG) Histogram Operating Mode */ +#define ISC_HIS_CFG_MODE(value) ((ISC_HIS_CFG_MODE_Msk & ((value) << ISC_HIS_CFG_MODE_Pos))) +#define ISC_HIS_CFG_MODE_Gr (0x0u << 0) /**< \brief (ISC_HIS_CFG) Gr sampling */ +#define ISC_HIS_CFG_MODE_R (0x1u << 0) /**< \brief (ISC_HIS_CFG) R sampling */ +#define ISC_HIS_CFG_MODE_Gb (0x2u << 0) /**< \brief (ISC_HIS_CFG) Gb sampling */ +#define ISC_HIS_CFG_MODE_B (0x3u << 0) /**< \brief (ISC_HIS_CFG) B sampling */ +#define ISC_HIS_CFG_MODE_Y (0x4u << 0) /**< \brief (ISC_HIS_CFG) Luminance-only mode */ +#define ISC_HIS_CFG_MODE_RAW (0x5u << 0) /**< \brief (ISC_HIS_CFG) Raw sampling */ +#define ISC_HIS_CFG_MODE_YCCIR656 (0x6u << 0) /**< \brief (ISC_HIS_CFG) Luminance only with CCIR656 10-bit or 8-bit mode */ +#define ISC_HIS_CFG_BAYSEL_Pos 4 +#define ISC_HIS_CFG_BAYSEL_Msk (0x3u << ISC_HIS_CFG_BAYSEL_Pos) /**< \brief (ISC_HIS_CFG) Bayer Color Component Selection */ +#define ISC_HIS_CFG_BAYSEL(value) ((ISC_HIS_CFG_BAYSEL_Msk & ((value) << ISC_HIS_CFG_BAYSEL_Pos))) +#define ISC_HIS_CFG_BAYSEL_GRGR (0x0u << 4) /**< \brief (ISC_HIS_CFG) Starting row configuration is G R G R (red row) */ +#define ISC_HIS_CFG_BAYSEL_RGRG (0x1u << 4) /**< \brief (ISC_HIS_CFG) Starting row configuration is R G R G (red row */ +#define ISC_HIS_CFG_BAYSEL_GBGB (0x2u << 4) /**< \brief (ISC_HIS_CFG) Starting row configuration is G B G B (blue row */ +#define ISC_HIS_CFG_BAYSEL_BGBG (0x3u << 4) /**< \brief (ISC_HIS_CFG) Starting row configuration is B G B G (blue row) */ +#define ISC_HIS_CFG_RAR (0x1u << 8) /**< \brief (ISC_HIS_CFG) Histogram Reset After Read */ +/* -------- ISC_DCFG : (ISC Offset: 0x3E0) DMA Configuration Register -------- */ +#define ISC_DCFG_IMODE_Pos 0 +#define ISC_DCFG_IMODE_Msk (0x7u << ISC_DCFG_IMODE_Pos) /**< \brief (ISC_DCFG) DMA Input Mode Selection */ +#define ISC_DCFG_IMODE(value) ((ISC_DCFG_IMODE_Msk & ((value) << ISC_DCFG_IMODE_Pos))) +#define ISC_DCFG_IMODE_PACKED8 (0x0u << 0) /**< \brief (ISC_DCFG) 8 bits, single channel packed */ +#define ISC_DCFG_IMODE_PACKED16 (0x1u << 0) /**< \brief (ISC_DCFG) 16 bits, single channel packed */ +#define ISC_DCFG_IMODE_PACKED32 (0x2u << 0) /**< \brief (ISC_DCFG) 32 bits, single channel packed */ +#define ISC_DCFG_IMODE_YC422SP (0x3u << 0) /**< \brief (ISC_DCFG) 32 bits, dual channel */ +#define ISC_DCFG_IMODE_YC422P (0x4u << 0) /**< \brief (ISC_DCFG) 32 bits, triple channel */ +#define ISC_DCFG_IMODE_YC420SP (0x5u << 0) /**< \brief (ISC_DCFG) 32 bits, dual channel */ +#define ISC_DCFG_IMODE_YC420P (0x6u << 0) /**< \brief (ISC_DCFG) 32 bits, triple channel */ +#define ISC_DCFG_YMBSIZE_Pos 4 +#define ISC_DCFG_YMBSIZE_Msk (0x3u << ISC_DCFG_YMBSIZE_Pos) /**< \brief (ISC_DCFG) DMA Memory Burst Size Y channel */ +#define ISC_DCFG_YMBSIZE(value) ((ISC_DCFG_YMBSIZE_Msk & ((value) << ISC_DCFG_YMBSIZE_Pos))) +#define ISC_DCFG_YMBSIZE_SINGLE (0x0u << 4) /**< \brief (ISC_DCFG) DMA single access */ +#define ISC_DCFG_YMBSIZE_BEATS4 (0x1u << 4) /**< \brief (ISC_DCFG) 4-beat burst access */ +#define ISC_DCFG_YMBSIZE_BEATS8 (0x2u << 4) /**< \brief (ISC_DCFG) 8-beat burst access */ +#define ISC_DCFG_YMBSIZE_BEATS16 (0x3u << 4) /**< \brief (ISC_DCFG) 16-beat burst access */ +#define ISC_DCFG_CMBSIZE_Pos 8 +#define ISC_DCFG_CMBSIZE_Msk (0x3u << ISC_DCFG_CMBSIZE_Pos) /**< \brief (ISC_DCFG) DMA Memory Burst Size C channel */ +#define ISC_DCFG_CMBSIZE(value) ((ISC_DCFG_CMBSIZE_Msk & ((value) << ISC_DCFG_CMBSIZE_Pos))) +#define ISC_DCFG_CMBSIZE_SINGLE (0x0u << 8) /**< \brief (ISC_DCFG) DMA single access */ +#define ISC_DCFG_CMBSIZE_BEATS4 (0x1u << 8) /**< \brief (ISC_DCFG) 4-beat burst access */ +#define ISC_DCFG_CMBSIZE_BEATS8 (0x2u << 8) /**< \brief (ISC_DCFG) 8-beat burst access */ +#define ISC_DCFG_CMBSIZE_BEATS16 (0x3u << 8) /**< \brief (ISC_DCFG) 16-beat burst access */ +/* -------- ISC_DCTRL : (ISC Offset: 0x3E4) DMA Control Register -------- */ +#define ISC_DCTRL_DE (0x1u << 0) /**< \brief (ISC_DCTRL) Descriptor Enable */ +#define ISC_DCTRL_DVIEW_Pos 1 +#define ISC_DCTRL_DVIEW_Msk (0x3u << ISC_DCTRL_DVIEW_Pos) /**< \brief (ISC_DCTRL) Descriptor View */ +#define ISC_DCTRL_DVIEW(value) ((ISC_DCTRL_DVIEW_Msk & ((value) << ISC_DCTRL_DVIEW_Pos))) +#define ISC_DCTRL_DVIEW_PACKED (0x0u << 1) /**< \brief (ISC_DCTRL) Address {0} Stride {0} are updated */ +#define ISC_DCTRL_DVIEW_SEMIPLANAR (0x1u << 1) /**< \brief (ISC_DCTRL) Address {0,1} Stride {0,1} are updated */ +#define ISC_DCTRL_DVIEW_PLANAR (0x2u << 1) /**< \brief (ISC_DCTRL) Address {0,1,2} Stride {0,1,2} are updated */ +#define ISC_DCTRL_IE (0x1u << 4) /**< \brief (ISC_DCTRL) Interrupt Enable */ +#define ISC_DCTRL_WB (0x1u << 5) /**< \brief (ISC_DCTRL) Write Back Operation Enable */ +/* -------- ISC_DNDA : (ISC Offset: 0x3E8) DMA Descriptor Address Register -------- */ +#define ISC_DNDA_NDA_Pos 2 +#define ISC_DNDA_NDA_Msk (0x3fffffffu << ISC_DNDA_NDA_Pos) /**< \brief (ISC_DNDA) Next Descriptor Address Register */ +#define ISC_DNDA_NDA(value) ((ISC_DNDA_NDA_Msk & ((value) << ISC_DNDA_NDA_Pos))) +/* -------- ISC_DAD : (ISC Offset: N/A) DMA Address 0 Register -------- */ +#define ISC_DAD_AD0_Pos 0 +#define ISC_DAD_AD0_Msk (0xffffffffu << ISC_DAD_AD0_Pos) /**< \brief (ISC_DAD) Channel 0 Address */ +#define ISC_DAD_AD0(value) ((ISC_DAD_AD0_Msk & ((value) << ISC_DAD_AD0_Pos))) +/* -------- ISC_DST : (ISC Offset: N/A) DMA Stride 0 Register -------- */ +#define ISC_DST_ST0_Pos 0 +#define ISC_DST_ST0_Msk (0xffffffffu << ISC_DST_ST0_Pos) /**< \brief (ISC_DST) Channel 0 Stride */ +#define ISC_DST_ST0(value) ((ISC_DST_ST0_Msk & ((value) << ISC_DST_ST0_Pos))) +/* -------- IPB_VERSION : (ISC Offset: 0x40C) Version Register -------- */ +#define IPB_VERSION_VERSION_Pos 0 +#define IPB_VERSION_VERSION_Msk (0xfffu << IPB_VERSION_VERSION_Pos) /**< \brief (IPB_VERSION) */ +#define IPB_VERSION_MFN_Pos 16 +#define IPB_VERSION_MFN_Msk (0x7u << IPB_VERSION_MFN_Pos) /**< \brief (IPB_VERSION) */ +/* -------- ISC_HIS_ENTRY[512] : (ISC Offset: 0x410) Histogram Entry -------- */ +#define ISC_HIS_ENTRY_COUNT_Pos 0 +#define ISC_HIS_ENTRY_COUNT_Msk (0xfffffu << ISC_HIS_ENTRY_COUNT_Pos) /**< \brief (ISC_HIS_ENTRY[512]) Entry Counter */ + +/*@}*/ + + +#endif /* _SAMA5D2_ISC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_l2cc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_l2cc.h new file mode 100644 index 000000000..17b07791c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_l2cc.h @@ -0,0 +1,354 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_L2CC_COMPONENT_ +#define _SAMA5D2_L2CC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR L2 Cache Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_L2CC L2 Cache Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief L2cc hardware registers */ +typedef struct { + __I uint32_t L2CC_IDR; /**< \brief (L2cc Offset: 0x000) Cache ID Register */ + __I uint32_t L2CC_TYPR; /**< \brief (L2cc Offset: 0x004) Cache Type Register */ + __I uint32_t Reserved1[62]; + __IO uint32_t L2CC_CR; /**< \brief (L2cc Offset: 0x100) Control Register */ + __IO uint32_t L2CC_ACR; /**< \brief (L2cc Offset: 0x104) Auxiliary Control Register */ + __IO uint32_t L2CC_TRCR; /**< \brief (L2cc Offset: 0x108) Tag RAM Control Register */ + __IO uint32_t L2CC_DRCR; /**< \brief (L2cc Offset: 0x10C) Data RAM Control Register */ + __I uint32_t Reserved2[60]; + __IO uint32_t L2CC_ECR; /**< \brief (L2cc Offset: 0x200) Event Counter Control Register */ + __IO uint32_t L2CC_ECFGR1; /**< \brief (L2cc Offset: 0x204) Event Counter 1 Configuration Register */ + __IO uint32_t L2CC_ECFGR0; /**< \brief (L2cc Offset: 0x208) Event Counter 0 Configuration Register */ + __IO uint32_t L2CC_EVR1; /**< \brief (L2cc Offset: 0x20C) Event Counter 1 Value Register */ + __IO uint32_t L2CC_EVR0; /**< \brief (L2cc Offset: 0x210) Event Counter 0 Value Register */ + __IO uint32_t L2CC_IMR; /**< \brief (L2cc Offset: 0x214) Interrupt Mask Register */ + __I uint32_t L2CC_MISR; /**< \brief (L2cc Offset: 0x218) Masked Interrupt Status Register */ + __I uint32_t L2CC_RISR; /**< \brief (L2cc Offset: 0x21C) Raw Interrupt Status Register */ + __IO uint32_t L2CC_ICR; /**< \brief (L2cc Offset: 0x220) Interrupt Clear Register */ + __I uint32_t Reserved3[323]; + __IO uint32_t L2CC_CSR; /**< \brief (L2cc Offset: 0x730) Cache Synchronization Register */ + __I uint32_t Reserved4[15]; + __IO uint32_t L2CC_IPALR; /**< \brief (L2cc Offset: 0x770) Invalidate Physical Address Line Register */ + __I uint32_t Reserved5[2]; + __IO uint32_t L2CC_IWR; /**< \brief (L2cc Offset: 0x77C) Invalidate Way Register */ + __I uint32_t Reserved6[12]; + __IO uint32_t L2CC_CPALR; /**< \brief (L2cc Offset: 0x7B0) Clean Physical Address Line Register */ + __I uint32_t Reserved7[1]; + __IO uint32_t L2CC_CIR; /**< \brief (L2cc Offset: 0x7B8) Clean Index Register */ + __IO uint32_t L2CC_CWR; /**< \brief (L2cc Offset: 0x7BC) Clean Way Register */ + __I uint32_t Reserved8[12]; + __IO uint32_t L2CC_CIPALR; /**< \brief (L2cc Offset: 0x7F0) Clean Invalidate Physical Address Line Register */ + __I uint32_t Reserved9[1]; + __IO uint32_t L2CC_CIIR; /**< \brief (L2cc Offset: 0x7F8) Clean Invalidate Index Register */ + __IO uint32_t L2CC_CIWR; /**< \brief (L2cc Offset: 0x7FC) Clean Invalidate Way Register */ + __I uint32_t Reserved10[64]; + __IO uint32_t L2CC_DLKR; /**< \brief (L2cc Offset: 0x900) Data Lockdown Register */ + __IO uint32_t L2CC_ILKR; /**< \brief (L2cc Offset: 0x904) Instruction Lockdown Register */ + __I uint32_t Reserved11[398]; + __IO uint32_t L2CC_DCR; /**< \brief (L2cc Offset: 0xF40) Debug Control Register */ + __I uint32_t Reserved12[7]; + __IO uint32_t L2CC_PCR; /**< \brief (L2cc Offset: 0xF60) Prefetch Control Register */ + __I uint32_t Reserved13[7]; + __IO uint32_t L2CC_POWCR; /**< \brief (L2cc Offset: 0xF80) Power Control Register */ +} L2cc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- L2CC_IDR : (L2CC Offset: 0x000) Cache ID Register -------- */ +#define L2CC_IDR_ID_Pos 0 +#define L2CC_IDR_ID_Msk (0xffffffffu << L2CC_IDR_ID_Pos) /**< \brief (L2CC_IDR) Cache Controller ID */ +/* -------- L2CC_TYPR : (L2CC Offset: 0x004) Cache Type Register -------- */ +#define L2CC_TYPR_IL2ASS (0x1u << 6) /**< \brief (L2CC_TYPR) Instruction L2 Cache Associativity */ +#define L2CC_TYPR_IL2WSIZE_Pos 8 +#define L2CC_TYPR_IL2WSIZE_Msk (0x7u << L2CC_TYPR_IL2WSIZE_Pos) /**< \brief (L2CC_TYPR) Instruction L2 Cache Way Size */ +#define L2CC_TYPR_DL2ASS (0x1u << 18) /**< \brief (L2CC_TYPR) Data L2 Cache Associativity */ +#define L2CC_TYPR_DL2WSIZE_Pos 20 +#define L2CC_TYPR_DL2WSIZE_Msk (0x7u << L2CC_TYPR_DL2WSIZE_Pos) /**< \brief (L2CC_TYPR) Data L2 Cache Way Size */ +/* -------- L2CC_CR : (L2CC Offset: 0x100) Control Register -------- */ +#define L2CC_CR_L2CEN (0x1u << 0) /**< \brief (L2CC_CR) L2 Cache Enable */ +/* -------- L2CC_ACR : (L2CC Offset: 0x104) Auxiliary Control Register -------- */ +#define L2CC_ACR_HPSO (0x1u << 10) /**< \brief (L2CC_ACR) High Priority for SO and Dev Reads Enable */ +#define L2CC_ACR_SBDLE (0x1u << 11) /**< \brief (L2CC_ACR) Store Buffer Device Limitation Enable */ +#define L2CC_ACR_EXCC (0x1u << 12) /**< \brief (L2CC_ACR) Exclusive Cache Configuration */ +#define L2CC_ACR_SAIE (0x1u << 13) /**< \brief (L2CC_ACR) Shared Attribute Invalidate Enable */ +#define L2CC_ACR_ASS (0x1u << 16) /**< \brief (L2CC_ACR) Associativity */ +#define L2CC_ACR_WAYSIZE_Pos 17 +#define L2CC_ACR_WAYSIZE_Msk (0x7u << L2CC_ACR_WAYSIZE_Pos) /**< \brief (L2CC_ACR) Way Size */ +#define L2CC_ACR_WAYSIZE(value) ((L2CC_ACR_WAYSIZE_Msk & ((value) << L2CC_ACR_WAYSIZE_Pos))) +#define L2CC_ACR_WAYSIZE_16KB_WAY (0x1u << 17) /**< \brief (L2CC_ACR) 16-Kbyte way set associative */ +#define L2CC_ACR_EMBEN (0x1u << 20) /**< \brief (L2CC_ACR) Event Monitor Bus Enable */ +#define L2CC_ACR_PEN (0x1u << 21) /**< \brief (L2CC_ACR) Parity Enable */ +#define L2CC_ACR_SAOEN (0x1u << 22) /**< \brief (L2CC_ACR) Shared Attribute Override Enable */ +#define L2CC_ACR_FWA_Pos 23 +#define L2CC_ACR_FWA_Msk (0x3u << L2CC_ACR_FWA_Pos) /**< \brief (L2CC_ACR) Force Write Allocate */ +#define L2CC_ACR_FWA(value) ((L2CC_ACR_FWA_Msk & ((value) << L2CC_ACR_FWA_Pos))) +#define L2CC_ACR_CRPOL (0x1u << 25) /**< \brief (L2CC_ACR) Cache Replacement Policy */ +#define L2CC_ACR_NSLEN (0x1u << 26) /**< \brief (L2CC_ACR) Non-Secure Lockdown Enable */ +#define L2CC_ACR_NSIAC (0x1u << 27) /**< \brief (L2CC_ACR) Non-Secure Interrupt Access Control */ +#define L2CC_ACR_DPEN (0x1u << 28) /**< \brief (L2CC_ACR) Data Prefetch Enable */ +#define L2CC_ACR_IPEN (0x1u << 29) /**< \brief (L2CC_ACR) Instruction Prefetch Enable */ +/* -------- L2CC_TRCR : (L2CC Offset: 0x108) Tag RAM Control Register -------- */ +#define L2CC_TRCR_TSETLAT_Pos 0 +#define L2CC_TRCR_TSETLAT_Msk (0x7u << L2CC_TRCR_TSETLAT_Pos) /**< \brief (L2CC_TRCR) Setup Latency */ +#define L2CC_TRCR_TSETLAT(value) ((L2CC_TRCR_TSETLAT_Msk & ((value) << L2CC_TRCR_TSETLAT_Pos))) +#define L2CC_TRCR_TRDLAT_Pos 4 +#define L2CC_TRCR_TRDLAT_Msk (0x7u << L2CC_TRCR_TRDLAT_Pos) /**< \brief (L2CC_TRCR) Read Access Latency */ +#define L2CC_TRCR_TRDLAT(value) ((L2CC_TRCR_TRDLAT_Msk & ((value) << L2CC_TRCR_TRDLAT_Pos))) +#define L2CC_TRCR_TWRLAT_Pos 8 +#define L2CC_TRCR_TWRLAT_Msk (0x7u << L2CC_TRCR_TWRLAT_Pos) /**< \brief (L2CC_TRCR) Write Access Latency */ +#define L2CC_TRCR_TWRLAT(value) ((L2CC_TRCR_TWRLAT_Msk & ((value) << L2CC_TRCR_TWRLAT_Pos))) +/* -------- L2CC_DRCR : (L2CC Offset: 0x10C) Data RAM Control Register -------- */ +#define L2CC_DRCR_DSETLAT_Pos 0 +#define L2CC_DRCR_DSETLAT_Msk (0x7u << L2CC_DRCR_DSETLAT_Pos) /**< \brief (L2CC_DRCR) Setup Latency */ +#define L2CC_DRCR_DSETLAT(value) ((L2CC_DRCR_DSETLAT_Msk & ((value) << L2CC_DRCR_DSETLAT_Pos))) +#define L2CC_DRCR_DRDLAT_Pos 4 +#define L2CC_DRCR_DRDLAT_Msk (0x7u << L2CC_DRCR_DRDLAT_Pos) /**< \brief (L2CC_DRCR) Read Access Latency */ +#define L2CC_DRCR_DRDLAT(value) ((L2CC_DRCR_DRDLAT_Msk & ((value) << L2CC_DRCR_DRDLAT_Pos))) +#define L2CC_DRCR_DWRLAT_Pos 8 +#define L2CC_DRCR_DWRLAT_Msk (0x7u << L2CC_DRCR_DWRLAT_Pos) /**< \brief (L2CC_DRCR) Write Access Latency */ +#define L2CC_DRCR_DWRLAT(value) ((L2CC_DRCR_DWRLAT_Msk & ((value) << L2CC_DRCR_DWRLAT_Pos))) +/* -------- L2CC_ECR : (L2CC Offset: 0x200) Event Counter Control Register -------- */ +#define L2CC_ECR_EVCEN (0x1u << 0) /**< \brief (L2CC_ECR) Event Counter Enable */ +#define L2CC_ECR_EVC0RST (0x1u << 1) /**< \brief (L2CC_ECR) Event Counter 0 Reset */ +#define L2CC_ECR_EVC1RST (0x1u << 2) /**< \brief (L2CC_ECR) Event Counter 1 Reset */ +/* -------- L2CC_ECFGR1 : (L2CC Offset: 0x204) Event Counter 1 Configuration Register -------- */ +#define L2CC_ECFGR1_EIGEN_Pos 0 +#define L2CC_ECFGR1_EIGEN_Msk (0x3u << L2CC_ECFGR1_EIGEN_Pos) /**< \brief (L2CC_ECFGR1) Event Counter Interrupt Generation */ +#define L2CC_ECFGR1_EIGEN(value) ((L2CC_ECFGR1_EIGEN_Msk & ((value) << L2CC_ECFGR1_EIGEN_Pos))) +#define L2CC_ECFGR1_EIGEN_INT_DIS (0x0u << 0) /**< \brief (L2CC_ECFGR1) Disables (default) */ +#define L2CC_ECFGR1_EIGEN_INT_EN_INCR (0x1u << 0) /**< \brief (L2CC_ECFGR1) Enables with Increment condition */ +#define L2CC_ECFGR1_EIGEN_INT_EN_OVER (0x2u << 0) /**< \brief (L2CC_ECFGR1) Enables with Overflow condition */ +#define L2CC_ECFGR1_EIGEN_INT_GEN_DIS (0x3u << 0) /**< \brief (L2CC_ECFGR1) Disables Interrupt generation */ +#define L2CC_ECFGR1_ESRC_Pos 2 +#define L2CC_ECFGR1_ESRC_Msk (0xfu << L2CC_ECFGR1_ESRC_Pos) /**< \brief (L2CC_ECFGR1) Event Counter Source */ +#define L2CC_ECFGR1_ESRC(value) ((L2CC_ECFGR1_ESRC_Msk & ((value) << L2CC_ECFGR1_ESRC_Pos))) +#define L2CC_ECFGR1_ESRC_CNT_DIS (0x0u << 2) /**< \brief (L2CC_ECFGR1) Counter Disabled */ +#define L2CC_ECFGR1_ESRC_SRC_CO (0x1u << 2) /**< \brief (L2CC_ECFGR1) Source is CO */ +#define L2CC_ECFGR1_ESRC_SRC_DRHIT (0x2u << 2) /**< \brief (L2CC_ECFGR1) Source is DRHIT */ +#define L2CC_ECFGR1_ESRC_SRC_DRREQ (0x3u << 2) /**< \brief (L2CC_ECFGR1) Source is DRREQ */ +#define L2CC_ECFGR1_ESRC_SRC_DWHIT (0x4u << 2) /**< \brief (L2CC_ECFGR1) Source is DWHIT */ +#define L2CC_ECFGR1_ESRC_SRC_DWREQ (0x5u << 2) /**< \brief (L2CC_ECFGR1) Source is DWREQ */ +#define L2CC_ECFGR1_ESRC_SRC_DWTREQ (0x6u << 2) /**< \brief (L2CC_ECFGR1) Source is DWTREQ */ +#define L2CC_ECFGR1_ESRC_SRC_IRHIT (0x7u << 2) /**< \brief (L2CC_ECFGR1) Source is IRHIT */ +#define L2CC_ECFGR1_ESRC_SRC_IRREQ (0x8u << 2) /**< \brief (L2CC_ECFGR1) Source is IRREQ */ +#define L2CC_ECFGR1_ESRC_SRC_WA (0x9u << 2) /**< \brief (L2CC_ECFGR1) Source is WA */ +#define L2CC_ECFGR1_ESRC_SRC_IPFALLOC (0xAu << 2) /**< \brief (L2CC_ECFGR1) Source is IPFALLOC */ +#define L2CC_ECFGR1_ESRC_SRC_EPFHIT (0xBu << 2) /**< \brief (L2CC_ECFGR1) Source is EPFHIT */ +#define L2CC_ECFGR1_ESRC_SRC_EPFALLOC (0xCu << 2) /**< \brief (L2CC_ECFGR1) Source is EPFALLOC */ +#define L2CC_ECFGR1_ESRC_SRC_SRRCVD (0xDu << 2) /**< \brief (L2CC_ECFGR1) Source is SRRCVD */ +#define L2CC_ECFGR1_ESRC_SRC_SRCONF (0xEu << 2) /**< \brief (L2CC_ECFGR1) Source is SRCONF */ +#define L2CC_ECFGR1_ESRC_SRC_EPFRCVD (0xFu << 2) /**< \brief (L2CC_ECFGR1) Source is EPFRCVD */ +/* -------- L2CC_ECFGR0 : (L2CC Offset: 0x208) Event Counter 0 Configuration Register -------- */ +#define L2CC_ECFGR0_EIGEN_Pos 0 +#define L2CC_ECFGR0_EIGEN_Msk (0x3u << L2CC_ECFGR0_EIGEN_Pos) /**< \brief (L2CC_ECFGR0) Event Counter Interrupt Generation */ +#define L2CC_ECFGR0_EIGEN(value) ((L2CC_ECFGR0_EIGEN_Msk & ((value) << L2CC_ECFGR0_EIGEN_Pos))) +#define L2CC_ECFGR0_EIGEN_INT_DIS (0x0u << 0) /**< \brief (L2CC_ECFGR0) Disables (default) */ +#define L2CC_ECFGR0_EIGEN_INT_EN_INCR (0x1u << 0) /**< \brief (L2CC_ECFGR0) Enables with Increment condition */ +#define L2CC_ECFGR0_EIGEN_INT_EN_OVER (0x2u << 0) /**< \brief (L2CC_ECFGR0) Enables with Overflow condition */ +#define L2CC_ECFGR0_EIGEN_INT_GEN_DIS (0x3u << 0) /**< \brief (L2CC_ECFGR0) Disables Interrupt generation */ +#define L2CC_ECFGR0_ESRC_Pos 2 +#define L2CC_ECFGR0_ESRC_Msk (0xfu << L2CC_ECFGR0_ESRC_Pos) /**< \brief (L2CC_ECFGR0) Event Counter Source */ +#define L2CC_ECFGR0_ESRC(value) ((L2CC_ECFGR0_ESRC_Msk & ((value) << L2CC_ECFGR0_ESRC_Pos))) +#define L2CC_ECFGR0_ESRC_CNT_DIS (0x0u << 2) /**< \brief (L2CC_ECFGR0) Counter Disabled */ +#define L2CC_ECFGR0_ESRC_SRC_CO (0x1u << 2) /**< \brief (L2CC_ECFGR0) Source is CO */ +#define L2CC_ECFGR0_ESRC_SRC_DRHIT (0x2u << 2) /**< \brief (L2CC_ECFGR0) Source is DRHIT */ +#define L2CC_ECFGR0_ESRC_SRC_DRREQ (0x3u << 2) /**< \brief (L2CC_ECFGR0) Source is DRREQ */ +#define L2CC_ECFGR0_ESRC_SRC_DWHIT (0x4u << 2) /**< \brief (L2CC_ECFGR0) Source is DWHIT */ +#define L2CC_ECFGR0_ESRC_SRC_DWREQ (0x5u << 2) /**< \brief (L2CC_ECFGR0) Source is DWREQ */ +#define L2CC_ECFGR0_ESRC_SRC_DWTREQ (0x6u << 2) /**< \brief (L2CC_ECFGR0) Source is DWTREQ */ +#define L2CC_ECFGR0_ESRC_SRC_IRHIT (0x7u << 2) /**< \brief (L2CC_ECFGR0) Source is IRHIT */ +#define L2CC_ECFGR0_ESRC_SRC_IRREQ (0x8u << 2) /**< \brief (L2CC_ECFGR0) Source is IRREQ */ +#define L2CC_ECFGR0_ESRC_SRC_WA (0x9u << 2) /**< \brief (L2CC_ECFGR0) Source is WA */ +#define L2CC_ECFGR0_ESRC_SRC_IPFALLOC (0xAu << 2) /**< \brief (L2CC_ECFGR0) Source is IPFALLOC */ +#define L2CC_ECFGR0_ESRC_SRC_EPFHIT (0xBu << 2) /**< \brief (L2CC_ECFGR0) Source is EPFHIT */ +#define L2CC_ECFGR0_ESRC_SRC_EPFALLOC (0xCu << 2) /**< \brief (L2CC_ECFGR0) Source is EPFALLOC */ +#define L2CC_ECFGR0_ESRC_SRC_SRRCVD (0xDu << 2) /**< \brief (L2CC_ECFGR0) Source is SRRCVD */ +#define L2CC_ECFGR0_ESRC_SRC_SRCONF (0xEu << 2) /**< \brief (L2CC_ECFGR0) Source is SRCONF */ +#define L2CC_ECFGR0_ESRC_SRC_EPFRCVD (0xFu << 2) /**< \brief (L2CC_ECFGR0) Source is EPFRCVD */ +/* -------- L2CC_EVR1 : (L2CC Offset: 0x20C) Event Counter 1 Value Register -------- */ +#define L2CC_EVR1_VALUE_Pos 0 +#define L2CC_EVR1_VALUE_Msk (0xffffffffu << L2CC_EVR1_VALUE_Pos) /**< \brief (L2CC_EVR1) Event Counter Value */ +#define L2CC_EVR1_VALUE(value) ((L2CC_EVR1_VALUE_Msk & ((value) << L2CC_EVR1_VALUE_Pos))) +/* -------- L2CC_EVR0 : (L2CC Offset: 0x210) Event Counter 0 Value Register -------- */ +#define L2CC_EVR0_VALUE_Pos 0 +#define L2CC_EVR0_VALUE_Msk (0xffffffffu << L2CC_EVR0_VALUE_Pos) /**< \brief (L2CC_EVR0) Event Counter Value */ +#define L2CC_EVR0_VALUE(value) ((L2CC_EVR0_VALUE_Msk & ((value) << L2CC_EVR0_VALUE_Pos))) +/* -------- L2CC_IMR : (L2CC Offset: 0x214) Interrupt Mask Register -------- */ +#define L2CC_IMR_ECNTR (0x1u << 0) /**< \brief (L2CC_IMR) Event Counter 1/0 Overflow Increment */ +#define L2CC_IMR_PARRT (0x1u << 1) /**< \brief (L2CC_IMR) Parity Error on L2 Tag RAM, Read */ +#define L2CC_IMR_PARRD (0x1u << 2) /**< \brief (L2CC_IMR) Parity Error on L2 Data RAM, Read */ +#define L2CC_IMR_ERRWT (0x1u << 3) /**< \brief (L2CC_IMR) Error on L2 Tag RAM, Write */ +#define L2CC_IMR_ERRWD (0x1u << 4) /**< \brief (L2CC_IMR) Error on L2 Data RAM, Write */ +#define L2CC_IMR_ERRRT (0x1u << 5) /**< \brief (L2CC_IMR) Error on L2 Tag RAM, Read */ +#define L2CC_IMR_ERRRD (0x1u << 6) /**< \brief (L2CC_IMR) Error on L2 Data RAM, Read */ +#define L2CC_IMR_SLVERR (0x1u << 7) /**< \brief (L2CC_IMR) SLVERR from L3 Memory */ +#define L2CC_IMR_DECERR (0x1u << 8) /**< \brief (L2CC_IMR) DECERR from L3 Memory */ +/* -------- L2CC_MISR : (L2CC Offset: 0x218) Masked Interrupt Status Register -------- */ +#define L2CC_MISR_ECNTR (0x1u << 0) /**< \brief (L2CC_MISR) Event Counter 1/0 Overflow Increment */ +#define L2CC_MISR_PARRT (0x1u << 1) /**< \brief (L2CC_MISR) Parity Error on L2 Tag RAM, Read */ +#define L2CC_MISR_PARRD (0x1u << 2) /**< \brief (L2CC_MISR) Parity Error on L2 Data RAM, Read */ +#define L2CC_MISR_ERRWT (0x1u << 3) /**< \brief (L2CC_MISR) Error on L2 Tag RAM, Write */ +#define L2CC_MISR_ERRWD (0x1u << 4) /**< \brief (L2CC_MISR) Error on L2 Data RAM, Write */ +#define L2CC_MISR_ERRRT (0x1u << 5) /**< \brief (L2CC_MISR) Error on L2 Tag RAM, Read */ +#define L2CC_MISR_ERRRD (0x1u << 6) /**< \brief (L2CC_MISR) Error on L2 Data RAM, Read */ +#define L2CC_MISR_SLVERR (0x1u << 7) /**< \brief (L2CC_MISR) SLVERR from L3 memory */ +#define L2CC_MISR_DECERR (0x1u << 8) /**< \brief (L2CC_MISR) DECERR from L3 memory */ +/* -------- L2CC_RISR : (L2CC Offset: 0x21C) Raw Interrupt Status Register -------- */ +#define L2CC_RISR_ECNTR (0x1u << 0) /**< \brief (L2CC_RISR) Event Counter 1/0 Overflow Increment */ +#define L2CC_RISR_PARRT (0x1u << 1) /**< \brief (L2CC_RISR) Parity Error on L2 Tag RAM, Read */ +#define L2CC_RISR_PARRD (0x1u << 2) /**< \brief (L2CC_RISR) Parity Error on L2 Data RAM, Read */ +#define L2CC_RISR_ERRWT (0x1u << 3) /**< \brief (L2CC_RISR) Error on L2 Tag RAM, Write */ +#define L2CC_RISR_ERRWD (0x1u << 4) /**< \brief (L2CC_RISR) Error on L2 Data RAM, Write */ +#define L2CC_RISR_ERRRT (0x1u << 5) /**< \brief (L2CC_RISR) Error on L2 Tag RAM, Read */ +#define L2CC_RISR_ERRRD (0x1u << 6) /**< \brief (L2CC_RISR) Error on L2 Data RAM, Read */ +#define L2CC_RISR_SLVERR (0x1u << 7) /**< \brief (L2CC_RISR) SLVERR from L3 memory */ +#define L2CC_RISR_DECERR (0x1u << 8) /**< \brief (L2CC_RISR) DECERR from L3 memory */ +/* -------- L2CC_ICR : (L2CC Offset: 0x220) Interrupt Clear Register -------- */ +#define L2CC_ICR_ECNTR (0x1u << 0) /**< \brief (L2CC_ICR) Event Counter 1/0 Overflow Increment */ +#define L2CC_ICR_PARRT (0x1u << 1) /**< \brief (L2CC_ICR) Parity Error on L2 Tag RAM, Read */ +#define L2CC_ICR_PARRD (0x1u << 2) /**< \brief (L2CC_ICR) Parity Error on L2 Data RAM, Read */ +#define L2CC_ICR_ERRWT (0x1u << 3) /**< \brief (L2CC_ICR) Error on L2 Tag RAM, Write */ +#define L2CC_ICR_ERRWD (0x1u << 4) /**< \brief (L2CC_ICR) Error on L2 Data RAM, Write */ +#define L2CC_ICR_ERRRT (0x1u << 5) /**< \brief (L2CC_ICR) Error on L2 Tag RAM, Read */ +#define L2CC_ICR_ERRRD (0x1u << 6) /**< \brief (L2CC_ICR) Error on L2 Data RAM, Read */ +#define L2CC_ICR_SLVERR (0x1u << 7) /**< \brief (L2CC_ICR) SLVERR from L3 memory */ +#define L2CC_ICR_DECERR (0x1u << 8) /**< \brief (L2CC_ICR) DECERR from L3 memory */ +/* -------- L2CC_CSR : (L2CC Offset: 0x730) Cache Synchronization Register -------- */ +#define L2CC_CSR_C (0x1u << 0) /**< \brief (L2CC_CSR) Cache Synchronization Status */ +/* -------- L2CC_IPALR : (L2CC Offset: 0x770) Invalidate Physical Address Line Register -------- */ +#define L2CC_IPALR_C (0x1u << 0) /**< \brief (L2CC_IPALR) Cache Synchronization Status */ +#define L2CC_IPALR_IDX_Pos 5 +#define L2CC_IPALR_IDX_Msk (0x1ffu << L2CC_IPALR_IDX_Pos) /**< \brief (L2CC_IPALR) Index Number */ +#define L2CC_IPALR_IDX(value) ((L2CC_IPALR_IDX_Msk & ((value) << L2CC_IPALR_IDX_Pos))) +#define L2CC_IPALR_TAG_Pos 14 +#define L2CC_IPALR_TAG_Msk (0x3ffffu << L2CC_IPALR_TAG_Pos) /**< \brief (L2CC_IPALR) Tag Number */ +#define L2CC_IPALR_TAG(value) ((L2CC_IPALR_TAG_Msk & ((value) << L2CC_IPALR_TAG_Pos))) +/* -------- L2CC_IWR : (L2CC Offset: 0x77C) Invalidate Way Register -------- */ +#define L2CC_IWR_WAY0 (0x1u << 0) /**< \brief (L2CC_IWR) Invalidate Way Number 0 */ +#define L2CC_IWR_WAY1 (0x1u << 1) /**< \brief (L2CC_IWR) Invalidate Way Number 1 */ +#define L2CC_IWR_WAY2 (0x1u << 2) /**< \brief (L2CC_IWR) Invalidate Way Number 2 */ +#define L2CC_IWR_WAY3 (0x1u << 3) /**< \brief (L2CC_IWR) Invalidate Way Number 3 */ +#define L2CC_IWR_WAY4 (0x1u << 4) /**< \brief (L2CC_IWR) Invalidate Way Number 4 */ +#define L2CC_IWR_WAY5 (0x1u << 5) /**< \brief (L2CC_IWR) Invalidate Way Number 5 */ +#define L2CC_IWR_WAY6 (0x1u << 6) /**< \brief (L2CC_IWR) Invalidate Way Number 6 */ +#define L2CC_IWR_WAY7 (0x1u << 7) /**< \brief (L2CC_IWR) Invalidate Way Number 7 */ +/* -------- L2CC_CPALR : (L2CC Offset: 0x7B0) Clean Physical Address Line Register -------- */ +#define L2CC_CPALR_C (0x1u << 0) /**< \brief (L2CC_CPALR) Cache Synchronization Status */ +#define L2CC_CPALR_IDX_Pos 5 +#define L2CC_CPALR_IDX_Msk (0x1ffu << L2CC_CPALR_IDX_Pos) /**< \brief (L2CC_CPALR) Index number */ +#define L2CC_CPALR_IDX(value) ((L2CC_CPALR_IDX_Msk & ((value) << L2CC_CPALR_IDX_Pos))) +#define L2CC_CPALR_TAG_Pos 14 +#define L2CC_CPALR_TAG_Msk (0x3ffffu << L2CC_CPALR_TAG_Pos) /**< \brief (L2CC_CPALR) Tag number */ +#define L2CC_CPALR_TAG(value) ((L2CC_CPALR_TAG_Msk & ((value) << L2CC_CPALR_TAG_Pos))) +/* -------- L2CC_CIR : (L2CC Offset: 0x7B8) Clean Index Register -------- */ +#define L2CC_CIR_C (0x1u << 0) /**< \brief (L2CC_CIR) Cache Synchronization Status */ +#define L2CC_CIR_IDX_Pos 5 +#define L2CC_CIR_IDX_Msk (0x1ffu << L2CC_CIR_IDX_Pos) /**< \brief (L2CC_CIR) Index number */ +#define L2CC_CIR_IDX(value) ((L2CC_CIR_IDX_Msk & ((value) << L2CC_CIR_IDX_Pos))) +#define L2CC_CIR_WAY_Pos 28 +#define L2CC_CIR_WAY_Msk (0x7u << L2CC_CIR_WAY_Pos) /**< \brief (L2CC_CIR) Way number */ +#define L2CC_CIR_WAY(value) ((L2CC_CIR_WAY_Msk & ((value) << L2CC_CIR_WAY_Pos))) +/* -------- L2CC_CWR : (L2CC Offset: 0x7BC) Clean Way Register -------- */ +#define L2CC_CWR_WAY0 (0x1u << 0) /**< \brief (L2CC_CWR) Clean Way Number 0 */ +#define L2CC_CWR_WAY1 (0x1u << 1) /**< \brief (L2CC_CWR) Clean Way Number 1 */ +#define L2CC_CWR_WAY2 (0x1u << 2) /**< \brief (L2CC_CWR) Clean Way Number 2 */ +#define L2CC_CWR_WAY3 (0x1u << 3) /**< \brief (L2CC_CWR) Clean Way Number 3 */ +#define L2CC_CWR_WAY4 (0x1u << 4) /**< \brief (L2CC_CWR) Clean Way Number 4 */ +#define L2CC_CWR_WAY5 (0x1u << 5) /**< \brief (L2CC_CWR) Clean Way Number 5 */ +#define L2CC_CWR_WAY6 (0x1u << 6) /**< \brief (L2CC_CWR) Clean Way Number 6 */ +#define L2CC_CWR_WAY7 (0x1u << 7) /**< \brief (L2CC_CWR) Clean Way Number 7 */ +/* -------- L2CC_CIPALR : (L2CC Offset: 0x7F0) Clean Invalidate Physical Address Line Register -------- */ +#define L2CC_CIPALR_C (0x1u << 0) /**< \brief (L2CC_CIPALR) Cache Synchronization Status */ +#define L2CC_CIPALR_IDX_Pos 5 +#define L2CC_CIPALR_IDX_Msk (0x1ffu << L2CC_CIPALR_IDX_Pos) /**< \brief (L2CC_CIPALR) Index Number */ +#define L2CC_CIPALR_IDX(value) ((L2CC_CIPALR_IDX_Msk & ((value) << L2CC_CIPALR_IDX_Pos))) +#define L2CC_CIPALR_TAG_Pos 14 +#define L2CC_CIPALR_TAG_Msk (0x3ffffu << L2CC_CIPALR_TAG_Pos) /**< \brief (L2CC_CIPALR) Tag Number */ +#define L2CC_CIPALR_TAG(value) ((L2CC_CIPALR_TAG_Msk & ((value) << L2CC_CIPALR_TAG_Pos))) +/* -------- L2CC_CIIR : (L2CC Offset: 0x7F8) Clean Invalidate Index Register -------- */ +#define L2CC_CIIR_C (0x1u << 0) /**< \brief (L2CC_CIIR) Cache Synchronization Status */ +#define L2CC_CIIR_IDX_Pos 5 +#define L2CC_CIIR_IDX_Msk (0x1ffu << L2CC_CIIR_IDX_Pos) /**< \brief (L2CC_CIIR) Index Number */ +#define L2CC_CIIR_IDX(value) ((L2CC_CIIR_IDX_Msk & ((value) << L2CC_CIIR_IDX_Pos))) +#define L2CC_CIIR_WAY_Pos 28 +#define L2CC_CIIR_WAY_Msk (0x7u << L2CC_CIIR_WAY_Pos) /**< \brief (L2CC_CIIR) Way Number */ +#define L2CC_CIIR_WAY(value) ((L2CC_CIIR_WAY_Msk & ((value) << L2CC_CIIR_WAY_Pos))) +/* -------- L2CC_CIWR : (L2CC Offset: 0x7FC) Clean Invalidate Way Register -------- */ +#define L2CC_CIWR_WAY0 (0x1u << 0) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 0 */ +#define L2CC_CIWR_WAY1 (0x1u << 1) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 1 */ +#define L2CC_CIWR_WAY2 (0x1u << 2) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 2 */ +#define L2CC_CIWR_WAY3 (0x1u << 3) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 3 */ +#define L2CC_CIWR_WAY4 (0x1u << 4) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 4 */ +#define L2CC_CIWR_WAY5 (0x1u << 5) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 5 */ +#define L2CC_CIWR_WAY6 (0x1u << 6) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 6 */ +#define L2CC_CIWR_WAY7 (0x1u << 7) /**< \brief (L2CC_CIWR) Clean Invalidate Way Number 7 */ +/* -------- L2CC_DLKR : (L2CC Offset: 0x900) Data Lockdown Register -------- */ +#define L2CC_DLKR_DLK0 (0x1u << 0) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 0 */ +#define L2CC_DLKR_DLK1 (0x1u << 1) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 1 */ +#define L2CC_DLKR_DLK2 (0x1u << 2) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 2 */ +#define L2CC_DLKR_DLK3 (0x1u << 3) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 3 */ +#define L2CC_DLKR_DLK4 (0x1u << 4) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 4 */ +#define L2CC_DLKR_DLK5 (0x1u << 5) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 5 */ +#define L2CC_DLKR_DLK6 (0x1u << 6) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 6 */ +#define L2CC_DLKR_DLK7 (0x1u << 7) /**< \brief (L2CC_DLKR) Data Lockdown in Way Number 7 */ +/* -------- L2CC_ILKR : (L2CC Offset: 0x904) Instruction Lockdown Register -------- */ +#define L2CC_ILKR_ILK0 (0x1u << 0) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 0 */ +#define L2CC_ILKR_ILK1 (0x1u << 1) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 1 */ +#define L2CC_ILKR_ILK2 (0x1u << 2) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 2 */ +#define L2CC_ILKR_ILK3 (0x1u << 3) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 3 */ +#define L2CC_ILKR_ILK4 (0x1u << 4) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 4 */ +#define L2CC_ILKR_ILK5 (0x1u << 5) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 5 */ +#define L2CC_ILKR_ILK6 (0x1u << 6) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 6 */ +#define L2CC_ILKR_ILK7 (0x1u << 7) /**< \brief (L2CC_ILKR) Instruction Lockdown in Way Number 7 */ +/* -------- L2CC_DCR : (L2CC Offset: 0xF40) Debug Control Register -------- */ +#define L2CC_DCR_DCL (0x1u << 0) /**< \brief (L2CC_DCR) Disable Cache Linefill */ +#define L2CC_DCR_DWB (0x1u << 1) /**< \brief (L2CC_DCR) Disable Write-back, Force Write-through */ +#define L2CC_DCR_SPNIDEN (0x1u << 2) /**< \brief (L2CC_DCR) SPNIDEN Value */ +/* -------- L2CC_PCR : (L2CC Offset: 0xF60) Prefetch Control Register -------- */ +#define L2CC_PCR_OFFSET_Pos 0 +#define L2CC_PCR_OFFSET_Msk (0x1fu << L2CC_PCR_OFFSET_Pos) /**< \brief (L2CC_PCR) Prefetch Offset */ +#define L2CC_PCR_OFFSET(value) ((L2CC_PCR_OFFSET_Msk & ((value) << L2CC_PCR_OFFSET_Pos))) +#define L2CC_PCR_NSIDEN (0x1u << 21) /**< \brief (L2CC_PCR) Not Same ID on Exclusive Sequence Enable */ +#define L2CC_PCR_IDLEN (0x1u << 23) /**< \brief (L2CC_PCR) INCR Double Linefill Enable */ +#define L2CC_PCR_PDEN (0x1u << 24) /**< \brief (L2CC_PCR) Prefetch Drop Enable */ +#define L2CC_PCR_DLFWRDIS (0x1u << 27) /**< \brief (L2CC_PCR) Double Linefill on WRAP Read Disable */ +#define L2CC_PCR_DATPEN (0x1u << 28) /**< \brief (L2CC_PCR) Data Prefetch Enable */ +#define L2CC_PCR_INSPEN (0x1u << 29) /**< \brief (L2CC_PCR) Instruction Prefetch Enable */ +#define L2CC_PCR_DLEN (0x1u << 30) /**< \brief (L2CC_PCR) Double Linefill Enable */ +/* -------- L2CC_POWCR : (L2CC Offset: 0xF80) Power Control Register -------- */ +#define L2CC_POWCR_STBYEN (0x1u << 0) /**< \brief (L2CC_POWCR) Standby Mode Enable */ +#define L2CC_POWCR_DCKGATEN (0x1u << 1) /**< \brief (L2CC_POWCR) Dynamic Clock Gating Enable */ + +/*@}*/ + + +#endif /* _SAMA5D2_L2CC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_lcdc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_lcdc.h new file mode 100644 index 000000000..e30788204 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_lcdc.h @@ -0,0 +1,1499 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_LCDC_COMPONENT_ +#define _SAMA5D2_LCDC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR LCD Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_LCDC LCD Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Lcdc hardware registers */ +typedef struct { + __IO uint32_t LCDC_LCDCFG0; /**< \brief (Lcdc Offset: 0x00000000) LCD Controller Configuration Register 0 */ + __IO uint32_t LCDC_LCDCFG1; /**< \brief (Lcdc Offset: 0x00000004) LCD Controller Configuration Register 1 */ + __IO uint32_t LCDC_LCDCFG2; /**< \brief (Lcdc Offset: 0x00000008) LCD Controller Configuration Register 2 */ + __IO uint32_t LCDC_LCDCFG3; /**< \brief (Lcdc Offset: 0x0000000C) LCD Controller Configuration Register 3 */ + __IO uint32_t LCDC_LCDCFG4; /**< \brief (Lcdc Offset: 0x00000010) LCD Controller Configuration Register 4 */ + __IO uint32_t LCDC_LCDCFG5; /**< \brief (Lcdc Offset: 0x00000014) LCD Controller Configuration Register 5 */ + __IO uint32_t LCDC_LCDCFG6; /**< \brief (Lcdc Offset: 0x00000018) LCD Controller Configuration Register 6 */ + __I uint32_t Reserved1[1]; + __O uint32_t LCDC_LCDEN; /**< \brief (Lcdc Offset: 0x00000020) LCD Controller Enable Register */ + __O uint32_t LCDC_LCDDIS; /**< \brief (Lcdc Offset: 0x00000024) LCD Controller Disable Register */ + __I uint32_t LCDC_LCDSR; /**< \brief (Lcdc Offset: 0x00000028) LCD Controller Status Register */ + __O uint32_t LCDC_LCDIER; /**< \brief (Lcdc Offset: 0x0000002C) LCD Controller Interrupt Enable Register */ + __O uint32_t LCDC_LCDIDR; /**< \brief (Lcdc Offset: 0x00000030) LCD Controller Interrupt Disable Register */ + __I uint32_t LCDC_LCDIMR; /**< \brief (Lcdc Offset: 0x00000034) LCD Controller Interrupt Mask Register */ + __I uint32_t LCDC_LCDISR; /**< \brief (Lcdc Offset: 0x00000038) LCD Controller Interrupt Status Register */ + __O uint32_t LCDC_ATTR; /**< \brief (Lcdc Offset: 0x0000003C) LCD Controller Attribute Register */ + __O uint32_t LCDC_BASECHER; /**< \brief (Lcdc Offset: 0x00000040) Base Layer Channel Enable Register */ + __O uint32_t LCDC_BASECHDR; /**< \brief (Lcdc Offset: 0x00000044) Base Layer Channel Disable Register */ + __I uint32_t LCDC_BASECHSR; /**< \brief (Lcdc Offset: 0x00000048) Base Layer Channel Status Register */ + __O uint32_t LCDC_BASEIER; /**< \brief (Lcdc Offset: 0x0000004C) Base Layer Interrupt Enable Register */ + __O uint32_t LCDC_BASEIDR; /**< \brief (Lcdc Offset: 0x00000050) Base Layer Interrupt Disabled Register */ + __I uint32_t LCDC_BASEIMR; /**< \brief (Lcdc Offset: 0x00000054) Base Layer Interrupt Mask Register */ + __I uint32_t LCDC_BASEISR; /**< \brief (Lcdc Offset: 0x00000058) Base Layer Interrupt Status Register */ + __IO uint32_t LCDC_BASEHEAD; /**< \brief (Lcdc Offset: 0x0000005C) Base DMA Head Register */ + __IO uint32_t LCDC_BASEADDR; /**< \brief (Lcdc Offset: 0x00000060) Base DMA Address Register */ + __IO uint32_t LCDC_BASECTRL; /**< \brief (Lcdc Offset: 0x00000064) Base DMA Control Register */ + __IO uint32_t LCDC_BASENEXT; /**< \brief (Lcdc Offset: 0x00000068) Base DMA Next Register */ + __IO uint32_t LCDC_BASECFG0; /**< \brief (Lcdc Offset: 0x0000006C) Base Layer Configuration Register 0 */ + __IO uint32_t LCDC_BASECFG1; /**< \brief (Lcdc Offset: 0x00000070) Base Layer Configuration Register 1 */ + __IO uint32_t LCDC_BASECFG2; /**< \brief (Lcdc Offset: 0x00000074) Base Layer Configuration Register 2 */ + __IO uint32_t LCDC_BASECFG3; /**< \brief (Lcdc Offset: 0x00000078) Base Layer Configuration Register 3 */ + __IO uint32_t LCDC_BASECFG4; /**< \brief (Lcdc Offset: 0x0000007C) Base Layer Configuration Register 4 */ + __IO uint32_t LCDC_BASECFG5; /**< \brief (Lcdc Offset: 0x00000080) Base Layer Configuration Register 5 */ + __IO uint32_t LCDC_BASECFG6; /**< \brief (Lcdc Offset: 0x00000084) Base Layer Configuration Register 6 */ + __I uint32_t Reserved2[46]; + __O uint32_t LCDC_OVR1CHER; /**< \brief (Lcdc Offset: 0x00000140) Overlay 1 Channel Enable Register */ + __O uint32_t LCDC_OVR1CHDR; /**< \brief (Lcdc Offset: 0x00000144) Overlay 1 Channel Disable Register */ + __I uint32_t LCDC_OVR1CHSR; /**< \brief (Lcdc Offset: 0x00000148) Overlay 1 Channel Status Register */ + __O uint32_t LCDC_OVR1IER; /**< \brief (Lcdc Offset: 0x0000014C) Overlay 1 Interrupt Enable Register */ + __O uint32_t LCDC_OVR1IDR; /**< \brief (Lcdc Offset: 0x00000150) Overlay 1 Interrupt Disable Register */ + __I uint32_t LCDC_OVR1IMR; /**< \brief (Lcdc Offset: 0x00000154) Overlay 1 Interrupt Mask Register */ + __I uint32_t LCDC_OVR1ISR; /**< \brief (Lcdc Offset: 0x00000158) Overlay 1 Interrupt Status Register */ + __IO uint32_t LCDC_OVR1HEAD; /**< \brief (Lcdc Offset: 0x0000015C) Overlay 1 DMA Head Register */ + __IO uint32_t LCDC_OVR1ADDR; /**< \brief (Lcdc Offset: 0x00000160) Overlay 1 DMA Address Register */ + __IO uint32_t LCDC_OVR1CTRL; /**< \brief (Lcdc Offset: 0x00000164) Overlay 1 DMA Control Register */ + __IO uint32_t LCDC_OVR1NEXT; /**< \brief (Lcdc Offset: 0x00000168) Overlay 1 DMA Next Register */ + __IO uint32_t LCDC_OVR1CFG0; /**< \brief (Lcdc Offset: 0x0000016C) Overlay 1 Configuration Register 0 */ + __IO uint32_t LCDC_OVR1CFG1; /**< \brief (Lcdc Offset: 0x00000170) Overlay 1 Configuration Register 1 */ + __IO uint32_t LCDC_OVR1CFG2; /**< \brief (Lcdc Offset: 0x00000174) Overlay 1 Configuration Register 2 */ + __IO uint32_t LCDC_OVR1CFG3; /**< \brief (Lcdc Offset: 0x00000178) Overlay 1 Configuration Register 3 */ + __IO uint32_t LCDC_OVR1CFG4; /**< \brief (Lcdc Offset: 0x0000017C) Overlay 1 Configuration Register 4 */ + __IO uint32_t LCDC_OVR1CFG5; /**< \brief (Lcdc Offset: 0x00000180) Overlay 1 Configuration Register 5 */ + __IO uint32_t LCDC_OVR1CFG6; /**< \brief (Lcdc Offset: 0x00000184) Overlay 1 Configuration Register 6 */ + __IO uint32_t LCDC_OVR1CFG7; /**< \brief (Lcdc Offset: 0x00000188) Overlay 1 Configuration Register 7 */ + __IO uint32_t LCDC_OVR1CFG8; /**< \brief (Lcdc Offset: 0x0000018C) Overlay 1 Configuration Register 8 */ + __IO uint32_t LCDC_OVR1CFG9; /**< \brief (Lcdc Offset: 0x00000190) Overlay 1 Configuration Register 9 */ + __I uint32_t Reserved3[43]; + __O uint32_t LCDC_OVR2CHER; /**< \brief (Lcdc Offset: 0x00000240) Overlay 2 Channel Enable Register */ + __O uint32_t LCDC_OVR2CHDR; /**< \brief (Lcdc Offset: 0x00000244) Overlay 2 Channel Disable Register */ + __I uint32_t LCDC_OVR2CHSR; /**< \brief (Lcdc Offset: 0x00000248) Overlay 2 Channel Status Register */ + __O uint32_t LCDC_OVR2IER; /**< \brief (Lcdc Offset: 0x0000024C) Overlay 2 Interrupt Enable Register */ + __O uint32_t LCDC_OVR2IDR; /**< \brief (Lcdc Offset: 0x00000250) Overlay 2 Interrupt Disable Register */ + __I uint32_t LCDC_OVR2IMR; /**< \brief (Lcdc Offset: 0x00000254) Overlay 2 Interrupt Mask Register */ + __I uint32_t LCDC_OVR2ISR; /**< \brief (Lcdc Offset: 0x00000258) Overlay 2 Interrupt Status Register */ + __IO uint32_t LCDC_OVR2HEAD; /**< \brief (Lcdc Offset: 0x0000025C) Overlay 2 DMA Head Register */ + __IO uint32_t LCDC_OVR2ADDR; /**< \brief (Lcdc Offset: 0x00000260) Overlay 2 DMA Address Register */ + __IO uint32_t LCDC_OVR2CTRL; /**< \brief (Lcdc Offset: 0x00000264) Overlay 2 DMA Control Register */ + __IO uint32_t LCDC_OVR2NEXT; /**< \brief (Lcdc Offset: 0x00000268) Overlay 2 DMA Next Register */ + __IO uint32_t LCDC_OVR2CFG0; /**< \brief (Lcdc Offset: 0x0000026C) Overlay 2 Configuration Register 0 */ + __IO uint32_t LCDC_OVR2CFG1; /**< \brief (Lcdc Offset: 0x00000270) Overlay 2 Configuration Register 1 */ + __IO uint32_t LCDC_OVR2CFG2; /**< \brief (Lcdc Offset: 0x00000274) Overlay 2 Configuration Register 2 */ + __IO uint32_t LCDC_OVR2CFG3; /**< \brief (Lcdc Offset: 0x00000278) Overlay 2 Configuration Register 3 */ + __IO uint32_t LCDC_OVR2CFG4; /**< \brief (Lcdc Offset: 0x0000027C) Overlay 2 Configuration Register 4 */ + __IO uint32_t LCDC_OVR2CFG5; /**< \brief (Lcdc Offset: 0x00000280) Overlay 2 Configuration Register 5 */ + __IO uint32_t LCDC_OVR2CFG6; /**< \brief (Lcdc Offset: 0x00000284) Overlay 2 Configuration Register 6 */ + __IO uint32_t LCDC_OVR2CFG7; /**< \brief (Lcdc Offset: 0x00000288) Overlay 2 Configuration Register 7 */ + __IO uint32_t LCDC_OVR2CFG8; /**< \brief (Lcdc Offset: 0x0000028C) Overlay 2 Configuration Register 8 */ + __IO uint32_t LCDC_OVR2CFG9; /**< \brief (Lcdc Offset: 0x00000290) Overlay 2 Configuration Register 8 */ + __I uint32_t Reserved4[43]; + __O uint32_t LCDC_HEOCHER; /**< \brief (Lcdc Offset: 0x00000340) High End Overlay Channel Enable Register */ + __O uint32_t LCDC_HEOCHDR; /**< \brief (Lcdc Offset: 0x00000344) High End Overlay Channel Disable Register */ + __I uint32_t LCDC_HEOCHSR; /**< \brief (Lcdc Offset: 0x00000348) High End Overlay Channel Status Register */ + __O uint32_t LCDC_HEOIER; /**< \brief (Lcdc Offset: 0x0000034C) High End Overlay Interrupt Enable Register */ + __O uint32_t LCDC_HEOIDR; /**< \brief (Lcdc Offset: 0x00000350) High End Overlay Interrupt Disable Register */ + __I uint32_t LCDC_HEOIMR; /**< \brief (Lcdc Offset: 0x00000354) High End Overlay Interrupt Mask Register */ + __I uint32_t LCDC_HEOISR; /**< \brief (Lcdc Offset: 0x00000358) High End Overlay Interrupt Status Register */ + __IO uint32_t LCDC_HEOHEAD; /**< \brief (Lcdc Offset: 0x0000035C) High End Overlay DMA Head Register */ + __IO uint32_t LCDC_HEOADDR; /**< \brief (Lcdc Offset: 0x00000360) High End Overlay DMA Address Register */ + __IO uint32_t LCDC_HEOCTRL; /**< \brief (Lcdc Offset: 0x00000364) High End Overlay DMA Control Register */ + __IO uint32_t LCDC_HEONEXT; /**< \brief (Lcdc Offset: 0x00000368) High End Overlay DMA Next Register */ + __IO uint32_t LCDC_HEOUHEAD; /**< \brief (Lcdc Offset: 0x0000036C) High End Overlay U-UV DMA Head Register */ + __IO uint32_t LCDC_HEOUADDR; /**< \brief (Lcdc Offset: 0x00000370) High End Overlay U-UV DMA Address Register */ + __IO uint32_t LCDC_HEOUCTRL; /**< \brief (Lcdc Offset: 0x00000374) High End Overlay U-UV DMA Control Register */ + __IO uint32_t LCDC_HEOUNEXT; /**< \brief (Lcdc Offset: 0x00000378) High End Overlay U-UV DMA Next Register */ + __IO uint32_t LCDC_HEOVHEAD; /**< \brief (Lcdc Offset: 0x0000037C) High End Overlay V DMA Head Register */ + __IO uint32_t LCDC_HEOVADDR; /**< \brief (Lcdc Offset: 0x00000380) High End Overlay V DMA Address Register */ + __IO uint32_t LCDC_HEOVCTRL; /**< \brief (Lcdc Offset: 0x00000384) High End Overlay V DMA Control Register */ + __IO uint32_t LCDC_HEOVNEXT; /**< \brief (Lcdc Offset: 0x00000388) High End Overlay V DMA Next Register */ + __IO uint32_t LCDC_HEOCFG0; /**< \brief (Lcdc Offset: 0x0000038C) High End Overlay Configuration Register 0 */ + __IO uint32_t LCDC_HEOCFG1; /**< \brief (Lcdc Offset: 0x00000390) High End Overlay Configuration Register 1 */ + __IO uint32_t LCDC_HEOCFG2; /**< \brief (Lcdc Offset: 0x00000394) High End Overlay Configuration Register 2 */ + __IO uint32_t LCDC_HEOCFG3; /**< \brief (Lcdc Offset: 0x00000398) High End Overlay Configuration Register 3 */ + __IO uint32_t LCDC_HEOCFG4; /**< \brief (Lcdc Offset: 0x0000039C) High End Overlay Configuration Register 4 */ + __IO uint32_t LCDC_HEOCFG5; /**< \brief (Lcdc Offset: 0x000003A0) High End Overlay Configuration Register 5 */ + __IO uint32_t LCDC_HEOCFG6; /**< \brief (Lcdc Offset: 0x000003A4) High End Overlay Configuration Register 6 */ + __IO uint32_t LCDC_HEOCFG7; /**< \brief (Lcdc Offset: 0x000003A8) High End Overlay Configuration Register 7 */ + __IO uint32_t LCDC_HEOCFG8; /**< \brief (Lcdc Offset: 0x000003AC) High End Overlay Configuration Register 8 */ + __IO uint32_t LCDC_HEOCFG9; /**< \brief (Lcdc Offset: 0x000003B0) High End Overlay Configuration Register 9 */ + __IO uint32_t LCDC_HEOCFG10; /**< \brief (Lcdc Offset: 0x000003B4) High End Overlay Configuration Register 10 */ + __IO uint32_t LCDC_HEOCFG11; /**< \brief (Lcdc Offset: 0x000003B8) High End Overlay Configuration Register 11 */ + __IO uint32_t LCDC_HEOCFG12; /**< \brief (Lcdc Offset: 0x000003BC) High End Overlay Configuration Register 12 */ + __IO uint32_t LCDC_HEOCFG13; /**< \brief (Lcdc Offset: 0x000003C0) High End Overlay Configuration Register 13 */ + __IO uint32_t LCDC_HEOCFG14; /**< \brief (Lcdc Offset: 0x000003C4) High End Overlay Configuration Register 14 */ + __IO uint32_t LCDC_HEOCFG15; /**< \brief (Lcdc Offset: 0x000003C8) High End Overlay Configuration Register 15 */ + __IO uint32_t LCDC_HEOCFG16; /**< \brief (Lcdc Offset: 0x000003CC) High End Overlay Configuration Register 16 */ + __IO uint32_t LCDC_HEOCFG17; /**< \brief (Lcdc Offset: 0x000003D0) High End Overlay Configuration Register 17 */ + __IO uint32_t LCDC_HEOCFG18; /**< \brief (Lcdc Offset: 0x000003D4) High End Overlay Configuration Register 18 */ + __IO uint32_t LCDC_HEOCFG19; /**< \brief (Lcdc Offset: 0x000003D8) High End Overlay Configuration Register 19 */ + __IO uint32_t LCDC_HEOCFG20; /**< \brief (Lcdc Offset: 0x000003DC) High End Overlay Configuration Register 20 */ + __IO uint32_t LCDC_HEOCFG21; /**< \brief (Lcdc Offset: 0x000003E0) High End Overlay Configuration Register 21 */ + __IO uint32_t LCDC_HEOCFG22; /**< \brief (Lcdc Offset: 0x000003E4) High End Overlay Configuration Register 22 */ + __IO uint32_t LCDC_HEOCFG23; /**< \brief (Lcdc Offset: 0x000003E8) High End Overlay Configuration Register 23 */ + __IO uint32_t LCDC_HEOCFG24; /**< \brief (Lcdc Offset: 0x000003EC) High End Overlay Configuration Register 24 */ + __IO uint32_t LCDC_HEOCFG25; /**< \brief (Lcdc Offset: 0x000003F0) High End Overlay Configuration Register 25 */ + __IO uint32_t LCDC_HEOCFG26; /**< \brief (Lcdc Offset: 0x000003F4) High End Overlay Configuration Register 26 */ + __IO uint32_t LCDC_HEOCFG27; /**< \brief (Lcdc Offset: 0x000003F8) High End Overlay Configuration Register 27 */ + __IO uint32_t LCDC_HEOCFG28; /**< \brief (Lcdc Offset: 0x000003FC) High End Overlay Configuration Register 28 */ + __IO uint32_t LCDC_HEOCFG29; /**< \brief (Lcdc Offset: 0x00000400) High End Overlay Configuration Register 29 */ + __IO uint32_t LCDC_HEOCFG30; /**< \brief (Lcdc Offset: 0x00000404) High End Overlay Configuration Register 30 */ + __IO uint32_t LCDC_HEOCFG31; /**< \brief (Lcdc Offset: 0x00000408) High End Overlay Configuration Register 31 */ + __IO uint32_t LCDC_HEOCFG32; /**< \brief (Lcdc Offset: 0x0000040C) High End Overlay Configuration Register 32 */ + __IO uint32_t LCDC_HEOCFG33; /**< \brief (Lcdc Offset: 0x00000410) High End Overlay Configuration Register 33 */ + __IO uint32_t LCDC_HEOCFG34; /**< \brief (Lcdc Offset: 0x00000414) High End Overlay Configuration Register 34 */ + __IO uint32_t LCDC_HEOCFG35; /**< \brief (Lcdc Offset: 0x00000418) High End Overlay Configuration Register 35 */ + __IO uint32_t LCDC_HEOCFG36; /**< \brief (Lcdc Offset: 0x0000041C) High End Overlay Configuration Register 36 */ + __IO uint32_t LCDC_HEOCFG37; /**< \brief (Lcdc Offset: 0x00000420) High End Overlay Configuration Register 37 */ + __IO uint32_t LCDC_HEOCFG38; /**< \brief (Lcdc Offset: 0x00000424) High End Overlay Configuration Register 38 */ + __IO uint32_t LCDC_HEOCFG39; /**< \brief (Lcdc Offset: 0x00000428) High End Overlay Configuration Register 39 */ + __IO uint32_t LCDC_HEOCFG40; /**< \brief (Lcdc Offset: 0x0000042C) High End Overlay Configuration Register 40 */ + __IO uint32_t LCDC_HEOCFG41; /**< \brief (Lcdc Offset: 0x00000430) High End Overlay Configuration Register 41 */ + __I uint32_t Reserved5[67]; + __O uint32_t LCDC_PPCHER; /**< \brief (Lcdc Offset: 0x00000540) Post Processing Channel Enable Register */ + __O uint32_t LCDC_PPCHDR; /**< \brief (Lcdc Offset: 0x00000544) Post Processing Channel Disable Register */ + __I uint32_t LCDC_PPCHSR; /**< \brief (Lcdc Offset: 0x00000548) Post Processing Channel Status Register */ + __O uint32_t LCDC_PPIER; /**< \brief (Lcdc Offset: 0x0000054C) Post Processing Interrupt Enable Register */ + __O uint32_t LCDC_PPIDR; /**< \brief (Lcdc Offset: 0x00000550) Post Processing Interrupt Disable Register */ + __I uint32_t LCDC_PPIMR; /**< \brief (Lcdc Offset: 0x00000554) Post Processing Interrupt Mask Register */ + __I uint32_t LCDC_PPISR; /**< \brief (Lcdc Offset: 0x00000558) Post Processing Interrupt Status Register */ + __IO uint32_t LCDC_PPHEAD; /**< \brief (Lcdc Offset: 0x0000055C) Post Processing Head Register */ + __IO uint32_t LCDC_PPADDR; /**< \brief (Lcdc Offset: 0x00000560) Post Processing Address Register */ + __IO uint32_t LCDC_PPCTRL; /**< \brief (Lcdc Offset: 0x00000564) Post Processing Control Register */ + __IO uint32_t LCDC_PPNEXT; /**< \brief (Lcdc Offset: 0x00000568) Post Processing Next Register */ + __IO uint32_t LCDC_PPCFG0; /**< \brief (Lcdc Offset: 0x0000056C) Post Processing Configuration Register 0 */ + __IO uint32_t LCDC_PPCFG1; /**< \brief (Lcdc Offset: 0x00000570) Post Processing Configuration Register 1 */ + __IO uint32_t LCDC_PPCFG2; /**< \brief (Lcdc Offset: 0x00000574) Post Processing Configuration Register 2 */ + __IO uint32_t LCDC_PPCFG3; /**< \brief (Lcdc Offset: 0x00000578) Post Processing Configuration Register 3 */ + __IO uint32_t LCDC_PPCFG4; /**< \brief (Lcdc Offset: 0x0000057C) Post Processing Configuration Register 4 */ + __IO uint32_t LCDC_PPCFG5; /**< \brief (Lcdc Offset: 0x00000580) Post Processing Configuration Register 5 */ + __I uint32_t Reserved6[31]; + __IO uint32_t LCDC_BASECLUT[256]; /**< \brief (Lcdc Offset: 0x00000600) Base CLUT Register */ + __IO uint32_t LCDC_OVR1CLUT[256]; /**< \brief (Lcdc Offset: 0x00000A00) Overlay 1 CLUT Register */ + __IO uint32_t LCDC_OVR2CLUT[256]; /**< \brief (Lcdc Offset: 0x00000E00) Overlay 2 CLUT Register */ + __IO uint32_t LCDC_HEOCLUT[256]; /**< \brief (Lcdc Offset: 0x00001200) High End Overlay CLUT Register */ + __I uint32_t Reserved7[639]; + __I uint32_t LCDC_VERSION; /**< \brief (Lcdc Offset: 0x00001FFC) Version Register */ +} Lcdc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- LCDC_LCDCFG0 : (LCDC Offset: 0x00000000) LCD Controller Configuration Register 0 -------- */ +#define LCDC_LCDCFG0_CLKPOL (0x1u << 0) /**< \brief (LCDC_LCDCFG0) LCD Controller Clock Polarity */ +#define LCDC_LCDCFG0_CLKSEL (0x1u << 2) /**< \brief (LCDC_LCDCFG0) LCD Controller Clock Source Selection */ +#define LCDC_LCDCFG0_CLKPWMSEL (0x1u << 3) /**< \brief (LCDC_LCDCFG0) LCD Controller PWM Clock Source Selection */ +#define LCDC_LCDCFG0_CGDISBASE (0x1u << 8) /**< \brief (LCDC_LCDCFG0) Clock Gating Disable Control for the Base Layer */ +#define LCDC_LCDCFG0_CGDISOVR1 (0x1u << 9) /**< \brief (LCDC_LCDCFG0) Clock Gating Disable Control for the Overlay 1 Layer */ +#define LCDC_LCDCFG0_CGDISOVR2 (0x1u << 10) /**< \brief (LCDC_LCDCFG0) Clock Gating Disable Control for the Overlay 2 Layer */ +#define LCDC_LCDCFG0_CGDISHEO (0x1u << 11) /**< \brief (LCDC_LCDCFG0) Clock Gating Disable Control for the High End Overlay */ +#define LCDC_LCDCFG0_CGDISPP (0x1u << 13) /**< \brief (LCDC_LCDCFG0) Clock Gating Disable Control for the Post Processing Layer */ +#define LCDC_LCDCFG0_CLKDIV_Pos 16 +#define LCDC_LCDCFG0_CLKDIV_Msk (0xffu << LCDC_LCDCFG0_CLKDIV_Pos) /**< \brief (LCDC_LCDCFG0) LCD Controller Clock Divider */ +#define LCDC_LCDCFG0_CLKDIV(value) ((LCDC_LCDCFG0_CLKDIV_Msk & ((value) << LCDC_LCDCFG0_CLKDIV_Pos))) +/* -------- LCDC_LCDCFG1 : (LCDC Offset: 0x00000004) LCD Controller Configuration Register 1 -------- */ +#define LCDC_LCDCFG1_HSPW_Pos 0 +#define LCDC_LCDCFG1_HSPW_Msk (0xffu << LCDC_LCDCFG1_HSPW_Pos) /**< \brief (LCDC_LCDCFG1) Horizontal Synchronization Pulse Width */ +#define LCDC_LCDCFG1_HSPW(value) ((LCDC_LCDCFG1_HSPW_Msk & ((value) << LCDC_LCDCFG1_HSPW_Pos))) +#define LCDC_LCDCFG1_VSPW_Pos 16 +#define LCDC_LCDCFG1_VSPW_Msk (0xffu << LCDC_LCDCFG1_VSPW_Pos) /**< \brief (LCDC_LCDCFG1) Vertical Synchronization Pulse Width */ +#define LCDC_LCDCFG1_VSPW(value) ((LCDC_LCDCFG1_VSPW_Msk & ((value) << LCDC_LCDCFG1_VSPW_Pos))) +/* -------- LCDC_LCDCFG2 : (LCDC Offset: 0x00000008) LCD Controller Configuration Register 2 -------- */ +#define LCDC_LCDCFG2_VFPW_Pos 0 +#define LCDC_LCDCFG2_VFPW_Msk (0xffu << LCDC_LCDCFG2_VFPW_Pos) /**< \brief (LCDC_LCDCFG2) Vertical Front Porch Width */ +#define LCDC_LCDCFG2_VFPW(value) ((LCDC_LCDCFG2_VFPW_Msk & ((value) << LCDC_LCDCFG2_VFPW_Pos))) +#define LCDC_LCDCFG2_VBPW_Pos 16 +#define LCDC_LCDCFG2_VBPW_Msk (0xffu << LCDC_LCDCFG2_VBPW_Pos) /**< \brief (LCDC_LCDCFG2) Vertical Back Porch Width */ +#define LCDC_LCDCFG2_VBPW(value) ((LCDC_LCDCFG2_VBPW_Msk & ((value) << LCDC_LCDCFG2_VBPW_Pos))) +/* -------- LCDC_LCDCFG3 : (LCDC Offset: 0x0000000C) LCD Controller Configuration Register 3 -------- */ +#define LCDC_LCDCFG3_HFPW_Pos 0 +#define LCDC_LCDCFG3_HFPW_Msk (0x3ffu << LCDC_LCDCFG3_HFPW_Pos) /**< \brief (LCDC_LCDCFG3) Horizontal Front Porch Width */ +#define LCDC_LCDCFG3_HFPW(value) ((LCDC_LCDCFG3_HFPW_Msk & ((value) << LCDC_LCDCFG3_HFPW_Pos))) +#define LCDC_LCDCFG3_HBPW_Pos 16 +#define LCDC_LCDCFG3_HBPW_Msk (0x3ffu << LCDC_LCDCFG3_HBPW_Pos) /**< \brief (LCDC_LCDCFG3) Horizontal Back Porch Width */ +#define LCDC_LCDCFG3_HBPW(value) ((LCDC_LCDCFG3_HBPW_Msk & ((value) << LCDC_LCDCFG3_HBPW_Pos))) +/* -------- LCDC_LCDCFG4 : (LCDC Offset: 0x00000010) LCD Controller Configuration Register 4 -------- */ +#define LCDC_LCDCFG4_PPL_Pos 0 +#define LCDC_LCDCFG4_PPL_Msk (0x7ffu << LCDC_LCDCFG4_PPL_Pos) /**< \brief (LCDC_LCDCFG4) Number of Pixels Per Line */ +#define LCDC_LCDCFG4_PPL(value) ((LCDC_LCDCFG4_PPL_Msk & ((value) << LCDC_LCDCFG4_PPL_Pos))) +#define LCDC_LCDCFG4_RPF_Pos 16 +#define LCDC_LCDCFG4_RPF_Msk (0x7ffu << LCDC_LCDCFG4_RPF_Pos) /**< \brief (LCDC_LCDCFG4) Number of Active Row Per Frame */ +#define LCDC_LCDCFG4_RPF(value) ((LCDC_LCDCFG4_RPF_Msk & ((value) << LCDC_LCDCFG4_RPF_Pos))) +/* -------- LCDC_LCDCFG5 : (LCDC Offset: 0x00000014) LCD Controller Configuration Register 5 -------- */ +#define LCDC_LCDCFG5_HSPOL (0x1u << 0) /**< \brief (LCDC_LCDCFG5) Horizontal Synchronization Pulse Polarity */ +#define LCDC_LCDCFG5_VSPOL (0x1u << 1) /**< \brief (LCDC_LCDCFG5) Vertical Synchronization Pulse Polarity */ +#define LCDC_LCDCFG5_VSPDLYS (0x1u << 2) /**< \brief (LCDC_LCDCFG5) Vertical Synchronization Pulse Start */ +#define LCDC_LCDCFG5_VSPDLYE (0x1u << 3) /**< \brief (LCDC_LCDCFG5) Vertical Synchronization Pulse End */ +#define LCDC_LCDCFG5_DISPPOL (0x1u << 4) /**< \brief (LCDC_LCDCFG5) Display Signal Polarity */ +#define LCDC_LCDCFG5_DITHER (0x1u << 6) /**< \brief (LCDC_LCDCFG5) LCD Controller Dithering */ +#define LCDC_LCDCFG5_DISPDLY (0x1u << 7) /**< \brief (LCDC_LCDCFG5) LCD Controller Display Power Signal Synchronization */ +#define LCDC_LCDCFG5_MODE_Pos 8 +#define LCDC_LCDCFG5_MODE_Msk (0x3u << LCDC_LCDCFG5_MODE_Pos) /**< \brief (LCDC_LCDCFG5) LCD Controller Output Mode */ +#define LCDC_LCDCFG5_MODE(value) ((LCDC_LCDCFG5_MODE_Msk & ((value) << LCDC_LCDCFG5_MODE_Pos))) +#define LCDC_LCDCFG5_MODE_OUTPUT_12BPP (0x0u << 8) /**< \brief (LCDC_LCDCFG5) LCD Output mode is set to 12 bits per pixel */ +#define LCDC_LCDCFG5_MODE_OUTPUT_16BPP (0x1u << 8) /**< \brief (LCDC_LCDCFG5) LCD Output mode is set to 16 bits per pixel */ +#define LCDC_LCDCFG5_MODE_OUTPUT_18BPP (0x2u << 8) /**< \brief (LCDC_LCDCFG5) LCD Output mode is set to 18 bits per pixel */ +#define LCDC_LCDCFG5_MODE_OUTPUT_24BPP (0x3u << 8) /**< \brief (LCDC_LCDCFG5) LCD Output mode is set to 24 bits per pixel */ +#define LCDC_LCDCFG5_PP (0x1u << 10) /**< \brief (LCDC_LCDCFG5) Post Processing Enable */ +#define LCDC_LCDCFG5_VSPSU (0x1u << 12) /**< \brief (LCDC_LCDCFG5) LCD Controller Vertical synchronization Pulse Setup Configuration */ +#define LCDC_LCDCFG5_VSPHO (0x1u << 13) /**< \brief (LCDC_LCDCFG5) LCD Controller Vertical synchronization Pulse Hold Configuration */ +#define LCDC_LCDCFG5_GUARDTIME_Pos 16 +#define LCDC_LCDCFG5_GUARDTIME_Msk (0xffu << LCDC_LCDCFG5_GUARDTIME_Pos) /**< \brief (LCDC_LCDCFG5) LCD DISPLAY Guard Time */ +#define LCDC_LCDCFG5_GUARDTIME(value) ((LCDC_LCDCFG5_GUARDTIME_Msk & ((value) << LCDC_LCDCFG5_GUARDTIME_Pos))) +/* -------- LCDC_LCDCFG6 : (LCDC Offset: 0x00000018) LCD Controller Configuration Register 6 -------- */ +#define LCDC_LCDCFG6_PWMPS_Pos 0 +#define LCDC_LCDCFG6_PWMPS_Msk (0x7u << LCDC_LCDCFG6_PWMPS_Pos) /**< \brief (LCDC_LCDCFG6) PWM Clock Prescaler */ +#define LCDC_LCDCFG6_PWMPS(value) ((LCDC_LCDCFG6_PWMPS_Msk & ((value) << LCDC_LCDCFG6_PWMPS_Pos))) +#define LCDC_LCDCFG6_PWMPS_DIV_1 (0x0u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a rate of fCOUNTER = fPWM_SELECTED_CLOCK */ +#define LCDC_LCDCFG6_PWMPS_DIV_2 (0x1u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a rate of fCOUNTER = fPWM_SELECTED_CLOCK/2 */ +#define LCDC_LCDCFG6_PWMPS_DIV_4 (0x2u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a rate of fCOUNTER = fPWM_SELECTED_CLOCK/4 */ +#define LCDC_LCDCFG6_PWMPS_DIV_8 (0x3u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a rate of fCOUNTER = fPWM_SELECTED_CLOCK/8 */ +#define LCDC_LCDCFG6_PWMPS_DIV_16 (0x4u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a rate of fCOUNTER = fPWM_SELECTED_CLOCK/16 */ +#define LCDC_LCDCFG6_PWMPS_DIV_32 (0x5u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a of rate fCOUNTER = fPWM_SELECTED_CLOCK/32 */ +#define LCDC_LCDCFG6_PWMPS_DIV_64 (0x6u << 0) /**< \brief (LCDC_LCDCFG6) The counter advances at a of rate fCOUNTER = fPWM_SELECTED_CLOCK/64 */ +#define LCDC_LCDCFG6_PWMPOL (0x1u << 4) /**< \brief (LCDC_LCDCFG6) LCD Controller PWM Signal Polarity */ +#define LCDC_LCDCFG6_PWMCVAL_Pos 8 +#define LCDC_LCDCFG6_PWMCVAL_Msk (0xffu << LCDC_LCDCFG6_PWMCVAL_Pos) /**< \brief (LCDC_LCDCFG6) LCD Controller PWM Compare Value */ +#define LCDC_LCDCFG6_PWMCVAL(value) ((LCDC_LCDCFG6_PWMCVAL_Msk & ((value) << LCDC_LCDCFG6_PWMCVAL_Pos))) +/* -------- LCDC_LCDEN : (LCDC Offset: 0x00000020) LCD Controller Enable Register -------- */ +#define LCDC_LCDEN_CLKEN (0x1u << 0) /**< \brief (LCDC_LCDEN) LCD Controller Pixel Clock Enable */ +#define LCDC_LCDEN_SYNCEN (0x1u << 1) /**< \brief (LCDC_LCDEN) LCD Controller Horizontal and Vertical Synchronization Enable */ +#define LCDC_LCDEN_DISPEN (0x1u << 2) /**< \brief (LCDC_LCDEN) LCD Controller DISP Signal Enable */ +#define LCDC_LCDEN_PWMEN (0x1u << 3) /**< \brief (LCDC_LCDEN) LCD Controller Pulse Width Modulation Enable */ +/* -------- LCDC_LCDDIS : (LCDC Offset: 0x00000024) LCD Controller Disable Register -------- */ +#define LCDC_LCDDIS_CLKDIS (0x1u << 0) /**< \brief (LCDC_LCDDIS) LCD Controller Pixel Clock Disable */ +#define LCDC_LCDDIS_SYNCDIS (0x1u << 1) /**< \brief (LCDC_LCDDIS) LCD Controller Horizontal and Vertical Synchronization Disable */ +#define LCDC_LCDDIS_DISPDIS (0x1u << 2) /**< \brief (LCDC_LCDDIS) LCD Controller DISP Signal Disable */ +#define LCDC_LCDDIS_PWMDIS (0x1u << 3) /**< \brief (LCDC_LCDDIS) LCD Controller Pulse Width Modulation Disable */ +#define LCDC_LCDDIS_CLKRST (0x1u << 8) /**< \brief (LCDC_LCDDIS) LCD Controller Clock Reset */ +#define LCDC_LCDDIS_SYNCRST (0x1u << 9) /**< \brief (LCDC_LCDDIS) LCD Controller Horizontal and Vertical Synchronization Reset */ +#define LCDC_LCDDIS_DISPRST (0x1u << 10) /**< \brief (LCDC_LCDDIS) LCD Controller DISP Signal Reset */ +#define LCDC_LCDDIS_PWMRST (0x1u << 11) /**< \brief (LCDC_LCDDIS) LCD Controller PWM Reset */ +/* -------- LCDC_LCDSR : (LCDC Offset: 0x00000028) LCD Controller Status Register -------- */ +#define LCDC_LCDSR_CLKSTS (0x1u << 0) /**< \brief (LCDC_LCDSR) Clock Status */ +#define LCDC_LCDSR_LCDSTS (0x1u << 1) /**< \brief (LCDC_LCDSR) LCD Controller Synchronization status */ +#define LCDC_LCDSR_DISPSTS (0x1u << 2) /**< \brief (LCDC_LCDSR) LCD Controller DISP Signal Status */ +#define LCDC_LCDSR_PWMSTS (0x1u << 3) /**< \brief (LCDC_LCDSR) LCD Controller PWM Signal Status */ +#define LCDC_LCDSR_SIPSTS (0x1u << 4) /**< \brief (LCDC_LCDSR) Synchronization In Progress */ +/* -------- LCDC_LCDIER : (LCDC Offset: 0x0000002C) LCD Controller Interrupt Enable Register -------- */ +#define LCDC_LCDIER_SOFIE (0x1u << 0) /**< \brief (LCDC_LCDIER) Start of Frame Interrupt Enable Register */ +#define LCDC_LCDIER_DISIE (0x1u << 1) /**< \brief (LCDC_LCDIER) LCD Disable Interrupt Enable Register */ +#define LCDC_LCDIER_DISPIE (0x1u << 2) /**< \brief (LCDC_LCDIER) Power UP/Down Sequence Terminated Interrupt Enable Register */ +#define LCDC_LCDIER_FIFOERRIE (0x1u << 4) /**< \brief (LCDC_LCDIER) Output FIFO Error Interrupt Enable Register */ +#define LCDC_LCDIER_BASEIE (0x1u << 8) /**< \brief (LCDC_LCDIER) Base Layer Interrupt Enable Register */ +#define LCDC_LCDIER_OVR1IE (0x1u << 9) /**< \brief (LCDC_LCDIER) Overlay 1 Interrupt Enable Register */ +#define LCDC_LCDIER_OVR2IE (0x1u << 10) /**< \brief (LCDC_LCDIER) Overlay 2 Interrupt Enable Register */ +#define LCDC_LCDIER_HEOIE (0x1u << 11) /**< \brief (LCDC_LCDIER) High End Overlay Interrupt Enable Register */ +#define LCDC_LCDIER_PPIE (0x1u << 13) /**< \brief (LCDC_LCDIER) Post Processing Interrupt Enable Register */ +/* -------- LCDC_LCDIDR : (LCDC Offset: 0x00000030) LCD Controller Interrupt Disable Register -------- */ +#define LCDC_LCDIDR_SOFID (0x1u << 0) /**< \brief (LCDC_LCDIDR) Start of Frame Interrupt Disable Register */ +#define LCDC_LCDIDR_DISID (0x1u << 1) /**< \brief (LCDC_LCDIDR) LCD Disable Interrupt Disable Register */ +#define LCDC_LCDIDR_DISPID (0x1u << 2) /**< \brief (LCDC_LCDIDR) Power UP/Down Sequence Terminated Interrupt Disable Register */ +#define LCDC_LCDIDR_FIFOERRID (0x1u << 4) /**< \brief (LCDC_LCDIDR) Output FIFO Error Interrupt Disable Register */ +#define LCDC_LCDIDR_BASEID (0x1u << 8) /**< \brief (LCDC_LCDIDR) Base Layer Interrupt Disable Register */ +#define LCDC_LCDIDR_OVR1ID (0x1u << 9) /**< \brief (LCDC_LCDIDR) Overlay 1 Interrupt Disable Register */ +#define LCDC_LCDIDR_OVR2ID (0x1u << 10) /**< \brief (LCDC_LCDIDR) Overlay 2 Interrupt Disable Register */ +#define LCDC_LCDIDR_HEOID (0x1u << 11) /**< \brief (LCDC_LCDIDR) High End Overlay Interrupt Disable Register */ +#define LCDC_LCDIDR_PPID (0x1u << 13) /**< \brief (LCDC_LCDIDR) Post Processing Interrupt Disable Register */ +/* -------- LCDC_LCDIMR : (LCDC Offset: 0x00000034) LCD Controller Interrupt Mask Register -------- */ +#define LCDC_LCDIMR_SOFIM (0x1u << 0) /**< \brief (LCDC_LCDIMR) Start of Frame Interrupt Mask Register */ +#define LCDC_LCDIMR_DISIM (0x1u << 1) /**< \brief (LCDC_LCDIMR) LCD Disable Interrupt Mask Register */ +#define LCDC_LCDIMR_DISPIM (0x1u << 2) /**< \brief (LCDC_LCDIMR) Power UP/Down Sequence Terminated Interrupt Mask Register */ +#define LCDC_LCDIMR_FIFOERRIM (0x1u << 4) /**< \brief (LCDC_LCDIMR) Output FIFO Error Interrupt Mask Register */ +#define LCDC_LCDIMR_BASEIM (0x1u << 8) /**< \brief (LCDC_LCDIMR) Base Layer Interrupt Mask Register */ +#define LCDC_LCDIMR_OVR1IM (0x1u << 9) /**< \brief (LCDC_LCDIMR) Overlay 1 Interrupt Mask Register */ +#define LCDC_LCDIMR_OVR2IM (0x1u << 10) /**< \brief (LCDC_LCDIMR) Overlay 2 Interrupt Mask Register */ +#define LCDC_LCDIMR_HEOIM (0x1u << 11) /**< \brief (LCDC_LCDIMR) High End Overlay Interrupt Mask Register */ +#define LCDC_LCDIMR_PPIM (0x1u << 13) /**< \brief (LCDC_LCDIMR) Post Processing Interrupt Mask Register */ +/* -------- LCDC_LCDISR : (LCDC Offset: 0x00000038) LCD Controller Interrupt Status Register -------- */ +#define LCDC_LCDISR_SOF (0x1u << 0) /**< \brief (LCDC_LCDISR) Start of Frame Interrupt Status Register */ +#define LCDC_LCDISR_DIS (0x1u << 1) /**< \brief (LCDC_LCDISR) LCD Disable Interrupt Status Register */ +#define LCDC_LCDISR_DISP (0x1u << 2) /**< \brief (LCDC_LCDISR) Power-up/Power-down Sequence Terminated Interrupt Status Register */ +#define LCDC_LCDISR_FIFOERR (0x1u << 4) /**< \brief (LCDC_LCDISR) Output FIFO Error */ +#define LCDC_LCDISR_BASE (0x1u << 8) /**< \brief (LCDC_LCDISR) Base Layer Raw Interrupt Status Register */ +#define LCDC_LCDISR_OVR1 (0x1u << 9) /**< \brief (LCDC_LCDISR) Overlay 1 Raw Interrupt Status Register */ +#define LCDC_LCDISR_OVR2 (0x1u << 10) /**< \brief (LCDC_LCDISR) Overlay 2 Raw Interrupt Status Register */ +#define LCDC_LCDISR_HEO (0x1u << 11) /**< \brief (LCDC_LCDISR) High End Overlay Raw Interrupt Status Register */ +#define LCDC_LCDISR_PP (0x1u << 13) /**< \brief (LCDC_LCDISR) Post Processing Raw Interrupt Status Register */ +/* -------- LCDC_ATTR : (LCDC Offset: 0x0000003C) LCD Controller Attribute Register -------- */ +#define LCDC_ATTR_BASE (0x1u << 0) /**< \brief (LCDC_ATTR) Base Layer Update Attribute Register */ +#define LCDC_ATTR_OVR1 (0x1u << 1) /**< \brief (LCDC_ATTR) Overlay 1 Update Attribute Register */ +#define LCDC_ATTR_OVR2 (0x1u << 2) /**< \brief (LCDC_ATTR) Overlay 2 Update Attribute Register */ +#define LCDC_ATTR_HEO (0x1u << 3) /**< \brief (LCDC_ATTR) High End Overlay Update Attribute Register */ +#define LCDC_ATTR_PP (0x1u << 5) /**< \brief (LCDC_ATTR) Post-Processing Update Attribute Register */ +#define LCDC_ATTR_BASEA2Q (0x1u << 8) /**< \brief (LCDC_ATTR) Base Layer Update Add To Queue */ +#define LCDC_ATTR_OVR1A2Q (0x1u << 9) /**< \brief (LCDC_ATTR) Overlay 1 Update Add To Queue */ +#define LCDC_ATTR_OVR2A2Q (0x1u << 10) /**< \brief (LCDC_ATTR) Overlay 2 Update Add to Queue */ +#define LCDC_ATTR_HEOA2Q (0x1u << 11) /**< \brief (LCDC_ATTR) High End Overlay Update Add To Queue */ +#define LCDC_ATTR_PPA2Q (0x1u << 13) /**< \brief (LCDC_ATTR) Post-Processing Update Add To Queue */ +/* -------- LCDC_BASECHER : (LCDC Offset: 0x00000040) Base Layer Channel Enable Register -------- */ +#define LCDC_BASECHER_CHEN (0x1u << 0) /**< \brief (LCDC_BASECHER) Channel Enable Register */ +#define LCDC_BASECHER_UPDATEEN (0x1u << 1) /**< \brief (LCDC_BASECHER) Update Overlay Attributes Enable Register */ +#define LCDC_BASECHER_A2QEN (0x1u << 2) /**< \brief (LCDC_BASECHER) Add To Queue Enable Register */ +/* -------- LCDC_BASECHDR : (LCDC Offset: 0x00000044) Base Layer Channel Disable Register -------- */ +#define LCDC_BASECHDR_CHDIS (0x1u << 0) /**< \brief (LCDC_BASECHDR) Channel Disable Register */ +#define LCDC_BASECHDR_CHRST (0x1u << 8) /**< \brief (LCDC_BASECHDR) Channel Reset Register */ +/* -------- LCDC_BASECHSR : (LCDC Offset: 0x00000048) Base Layer Channel Status Register -------- */ +#define LCDC_BASECHSR_CHSR (0x1u << 0) /**< \brief (LCDC_BASECHSR) Channel Status Register */ +#define LCDC_BASECHSR_UPDATESR (0x1u << 1) /**< \brief (LCDC_BASECHSR) Update Overlay Attributes In Progress Status Register */ +#define LCDC_BASECHSR_A2QSR (0x1u << 2) /**< \brief (LCDC_BASECHSR) Add To Queue Status Register */ +/* -------- LCDC_BASEIER : (LCDC Offset: 0x0000004C) Base Layer Interrupt Enable Register -------- */ +#define LCDC_BASEIER_DMA (0x1u << 2) /**< \brief (LCDC_BASEIER) End of DMA Transfer Interrupt Enable Register */ +#define LCDC_BASEIER_DSCR (0x1u << 3) /**< \brief (LCDC_BASEIER) Descriptor Loaded Interrupt Enable Register */ +#define LCDC_BASEIER_ADD (0x1u << 4) /**< \brief (LCDC_BASEIER) Head Descriptor Loaded Interrupt Enable Register */ +#define LCDC_BASEIER_DONE (0x1u << 5) /**< \brief (LCDC_BASEIER) End of List Interrupt Enable Register */ +#define LCDC_BASEIER_OVR (0x1u << 6) /**< \brief (LCDC_BASEIER) Overflow Interrupt Enable Register */ +/* -------- LCDC_BASEIDR : (LCDC Offset: 0x00000050) Base Layer Interrupt Disabled Register -------- */ +#define LCDC_BASEIDR_DMA (0x1u << 2) /**< \brief (LCDC_BASEIDR) End of DMA Transfer Interrupt Disable Register */ +#define LCDC_BASEIDR_DSCR (0x1u << 3) /**< \brief (LCDC_BASEIDR) Descriptor Loaded Interrupt Disable Register */ +#define LCDC_BASEIDR_ADD (0x1u << 4) /**< \brief (LCDC_BASEIDR) Head Descriptor Loaded Interrupt Disable Register */ +#define LCDC_BASEIDR_DONE (0x1u << 5) /**< \brief (LCDC_BASEIDR) End of List Interrupt Disable Register */ +#define LCDC_BASEIDR_OVR (0x1u << 6) /**< \brief (LCDC_BASEIDR) Overflow Interrupt Disable Register */ +/* -------- LCDC_BASEIMR : (LCDC Offset: 0x00000054) Base Layer Interrupt Mask Register -------- */ +#define LCDC_BASEIMR_DMA (0x1u << 2) /**< \brief (LCDC_BASEIMR) End of DMA Transfer Interrupt Mask Register */ +#define LCDC_BASEIMR_DSCR (0x1u << 3) /**< \brief (LCDC_BASEIMR) Descriptor Loaded Interrupt Mask Register */ +#define LCDC_BASEIMR_ADD (0x1u << 4) /**< \brief (LCDC_BASEIMR) Head Descriptor Loaded Interrupt Mask Register */ +#define LCDC_BASEIMR_DONE (0x1u << 5) /**< \brief (LCDC_BASEIMR) End of List Interrupt Mask Register */ +#define LCDC_BASEIMR_OVR (0x1u << 6) /**< \brief (LCDC_BASEIMR) Overflow Interrupt Mask Register */ +/* -------- LCDC_BASEISR : (LCDC Offset: 0x00000058) Base Layer Interrupt Status Register -------- */ +#define LCDC_BASEISR_DMA (0x1u << 2) /**< \brief (LCDC_BASEISR) End of DMA Transfer */ +#define LCDC_BASEISR_DSCR (0x1u << 3) /**< \brief (LCDC_BASEISR) DMA Descriptor Loaded */ +#define LCDC_BASEISR_ADD (0x1u << 4) /**< \brief (LCDC_BASEISR) Head Descriptor Loaded */ +#define LCDC_BASEISR_DONE (0x1u << 5) /**< \brief (LCDC_BASEISR) End of List Detected */ +#define LCDC_BASEISR_OVR (0x1u << 6) /**< \brief (LCDC_BASEISR) Overflow Detected */ +/* -------- LCDC_BASEHEAD : (LCDC Offset: 0x0000005C) Base DMA Head Register -------- */ +#define LCDC_BASEHEAD_HEAD_Pos 2 +#define LCDC_BASEHEAD_HEAD_Msk (0x3fffffffu << LCDC_BASEHEAD_HEAD_Pos) /**< \brief (LCDC_BASEHEAD) DMA Head Pointer */ +#define LCDC_BASEHEAD_HEAD(value) ((LCDC_BASEHEAD_HEAD_Msk & ((value) << LCDC_BASEHEAD_HEAD_Pos))) +/* -------- LCDC_BASEADDR : (LCDC Offset: 0x00000060) Base DMA Address Register -------- */ +#define LCDC_BASEADDR_ADDR_Pos 0 +#define LCDC_BASEADDR_ADDR_Msk (0xffffffffu << LCDC_BASEADDR_ADDR_Pos) /**< \brief (LCDC_BASEADDR) DMA Transfer Start Address */ +#define LCDC_BASEADDR_ADDR(value) ((LCDC_BASEADDR_ADDR_Msk & ((value) << LCDC_BASEADDR_ADDR_Pos))) +/* -------- LCDC_BASECTRL : (LCDC Offset: 0x00000064) Base DMA Control Register -------- */ +#define LCDC_BASECTRL_DFETCH (0x1u << 0) /**< \brief (LCDC_BASECTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_BASECTRL_LFETCH (0x1u << 1) /**< \brief (LCDC_BASECTRL) Lookup Table Fetch Enable */ +#define LCDC_BASECTRL_DMAIEN (0x1u << 2) /**< \brief (LCDC_BASECTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_BASECTRL_DSCRIEN (0x1u << 3) /**< \brief (LCDC_BASECTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_BASECTRL_ADDIEN (0x1u << 4) /**< \brief (LCDC_BASECTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_BASECTRL_DONEIEN (0x1u << 5) /**< \brief (LCDC_BASECTRL) End of List Interrupt Enable */ +/* -------- LCDC_BASENEXT : (LCDC Offset: 0x00000068) Base DMA Next Register -------- */ +#define LCDC_BASENEXT_NEXT_Pos 0 +#define LCDC_BASENEXT_NEXT_Msk (0xffffffffu << LCDC_BASENEXT_NEXT_Pos) /**< \brief (LCDC_BASENEXT) DMA Descriptor Next Address */ +#define LCDC_BASENEXT_NEXT(value) ((LCDC_BASENEXT_NEXT_Msk & ((value) << LCDC_BASENEXT_NEXT_Pos))) +/* -------- LCDC_BASECFG0 : (LCDC Offset: 0x0000006C) Base Layer Configuration Register 0 -------- */ +#define LCDC_BASECFG0_SIF (0x1u << 0) /**< \brief (LCDC_BASECFG0) Source Interface */ +#define LCDC_BASECFG0_BLEN_Pos 4 +#define LCDC_BASECFG0_BLEN_Msk (0x3u << LCDC_BASECFG0_BLEN_Pos) /**< \brief (LCDC_BASECFG0) AHB Burst Length */ +#define LCDC_BASECFG0_BLEN(value) ((LCDC_BASECFG0_BLEN_Msk & ((value) << LCDC_BASECFG0_BLEN_Pos))) +#define LCDC_BASECFG0_BLEN_AHB_SINGLE (0x0u << 4) /**< \brief (LCDC_BASECFG0) AHB Access is started as soon as there is enough space in the FIFO to store one data. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_BASECFG0_BLEN_AHB_INCR4 (0x1u << 4) /**< \brief (LCDC_BASECFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 4 data. An AHB INCR4 Burst is used. SINGLE, INCR and INCR4 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_BASECFG0_BLEN_AHB_INCR8 (0x2u << 4) /**< \brief (LCDC_BASECFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 8 data. An AHB INCR8 Burst is used. SINGLE, INCR, INCR4 and INCR8 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_BASECFG0_BLEN_AHB_INCR16 (0x3u << 4) /**< \brief (LCDC_BASECFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 16 data. An AHB INCR16 Burst is used. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_BASECFG0_DLBO (0x1u << 8) /**< \brief (LCDC_BASECFG0) Defined Length Burst Only For Channel Bus Transaction */ +/* -------- LCDC_BASECFG1 : (LCDC Offset: 0x00000070) Base Layer Configuration Register 1 -------- */ +#define LCDC_BASECFG1_CLUTEN (0x1u << 0) /**< \brief (LCDC_BASECFG1) Color Lookup Table Mode Enable */ +#define LCDC_BASECFG1_RGBMODE_Pos 4 +#define LCDC_BASECFG1_RGBMODE_Msk (0xfu << LCDC_BASECFG1_RGBMODE_Pos) /**< \brief (LCDC_BASECFG1) RGB Mode Input Selection */ +#define LCDC_BASECFG1_RGBMODE(value) ((LCDC_BASECFG1_RGBMODE_Msk & ((value) << LCDC_BASECFG1_RGBMODE_Pos))) +#define LCDC_BASECFG1_RGBMODE_12BPP_RGB_444 (0x0u << 4) /**< \brief (LCDC_BASECFG1) 12 bpp RGB 444 */ +#define LCDC_BASECFG1_RGBMODE_16BPP_ARGB_4444 (0x1u << 4) /**< \brief (LCDC_BASECFG1) 16 bpp ARGB 4444 */ +#define LCDC_BASECFG1_RGBMODE_16BPP_RGBA_4444 (0x2u << 4) /**< \brief (LCDC_BASECFG1) 16 bpp RGBA 4444 */ +#define LCDC_BASECFG1_RGBMODE_16BPP_RGB_565 (0x3u << 4) /**< \brief (LCDC_BASECFG1) 16 bpp RGB 565 */ +#define LCDC_BASECFG1_RGBMODE_16BPP_TRGB_1555 (0x4u << 4) /**< \brief (LCDC_BASECFG1) 16 bpp TRGB 1555 */ +#define LCDC_BASECFG1_RGBMODE_18BPP_RGB_666 (0x5u << 4) /**< \brief (LCDC_BASECFG1) 18 bpp RGB 666 */ +#define LCDC_BASECFG1_RGBMODE_18BPP_RGB_666PACKED (0x6u << 4) /**< \brief (LCDC_BASECFG1) 18 bpp RGB 666 PACKED */ +#define LCDC_BASECFG1_RGBMODE_19BPP_TRGB_1666 (0x7u << 4) /**< \brief (LCDC_BASECFG1) 19 bpp TRGB 1666 */ +#define LCDC_BASECFG1_RGBMODE_19BPP_TRGB_PACKED (0x8u << 4) /**< \brief (LCDC_BASECFG1) 19 bpp TRGB 1666 PACKED */ +#define LCDC_BASECFG1_RGBMODE_24BPP_RGB_888 (0x9u << 4) /**< \brief (LCDC_BASECFG1) 24 bpp RGB 888 */ +#define LCDC_BASECFG1_RGBMODE_24BPP_RGB_888_PACKED (0xAu << 4) /**< \brief (LCDC_BASECFG1) 24 bpp RGB 888 PACKED */ +#define LCDC_BASECFG1_RGBMODE_25BPP_TRGB_1888 (0xBu << 4) /**< \brief (LCDC_BASECFG1) 25 bpp TRGB 1888 */ +#define LCDC_BASECFG1_RGBMODE_32BPP_ARGB_8888 (0xCu << 4) /**< \brief (LCDC_BASECFG1) 32 bpp ARGB 8888 */ +#define LCDC_BASECFG1_RGBMODE_32BPP_RGBA_8888 (0xDu << 4) /**< \brief (LCDC_BASECFG1) 32 bpp RGBA 8888 */ +#define LCDC_BASECFG1_CLUTMODE_Pos 8 +#define LCDC_BASECFG1_CLUTMODE_Msk (0x3u << LCDC_BASECFG1_CLUTMODE_Pos) /**< \brief (LCDC_BASECFG1) Color Lookup Table Mode Input Selection */ +#define LCDC_BASECFG1_CLUTMODE(value) ((LCDC_BASECFG1_CLUTMODE_Msk & ((value) << LCDC_BASECFG1_CLUTMODE_Pos))) +#define LCDC_BASECFG1_CLUTMODE_CLUT_1BPP (0x0u << 8) /**< \brief (LCDC_BASECFG1) Color Lookup Table mode set to 1 bit per pixel */ +#define LCDC_BASECFG1_CLUTMODE_CLUT_2BPP (0x1u << 8) /**< \brief (LCDC_BASECFG1) Color Lookup Table mode set to 2 bits per pixel */ +#define LCDC_BASECFG1_CLUTMODE_CLUT_4BPP (0x2u << 8) /**< \brief (LCDC_BASECFG1) Color Lookup Table mode set to 4 bits per pixel */ +#define LCDC_BASECFG1_CLUTMODE_CLUT_8BPP (0x3u << 8) /**< \brief (LCDC_BASECFG1) Color Lookup Table mode set to 8 bits per pixel */ +/* -------- LCDC_BASECFG2 : (LCDC Offset: 0x00000074) Base Layer Configuration Register 2 -------- */ +#define LCDC_BASECFG2_XSTRIDE_Pos 0 +#define LCDC_BASECFG2_XSTRIDE_Msk (0xffffffffu << LCDC_BASECFG2_XSTRIDE_Pos) /**< \brief (LCDC_BASECFG2) Horizontal Stride */ +#define LCDC_BASECFG2_XSTRIDE(value) ((LCDC_BASECFG2_XSTRIDE_Msk & ((value) << LCDC_BASECFG2_XSTRIDE_Pos))) +/* -------- LCDC_BASECFG3 : (LCDC Offset: 0x00000078) Base Layer Configuration Register 3 -------- */ +#define LCDC_BASECFG3_BDEF_Pos 0 +#define LCDC_BASECFG3_BDEF_Msk (0xffu << LCDC_BASECFG3_BDEF_Pos) /**< \brief (LCDC_BASECFG3) Blue Default */ +#define LCDC_BASECFG3_BDEF(value) ((LCDC_BASECFG3_BDEF_Msk & ((value) << LCDC_BASECFG3_BDEF_Pos))) +#define LCDC_BASECFG3_GDEF_Pos 8 +#define LCDC_BASECFG3_GDEF_Msk (0xffu << LCDC_BASECFG3_GDEF_Pos) /**< \brief (LCDC_BASECFG3) Green Default */ +#define LCDC_BASECFG3_GDEF(value) ((LCDC_BASECFG3_GDEF_Msk & ((value) << LCDC_BASECFG3_GDEF_Pos))) +#define LCDC_BASECFG3_RDEF_Pos 16 +#define LCDC_BASECFG3_RDEF_Msk (0xffu << LCDC_BASECFG3_RDEF_Pos) /**< \brief (LCDC_BASECFG3) Red Default */ +#define LCDC_BASECFG3_RDEF(value) ((LCDC_BASECFG3_RDEF_Msk & ((value) << LCDC_BASECFG3_RDEF_Pos))) +/* -------- LCDC_BASECFG4 : (LCDC Offset: 0x0000007C) Base Layer Configuration Register 4 -------- */ +#define LCDC_BASECFG4_DMA (0x1u << 8) /**< \brief (LCDC_BASECFG4) Use DMA Data Path */ +#define LCDC_BASECFG4_REP (0x1u << 9) /**< \brief (LCDC_BASECFG4) Use Replication logic to expand RGB color to 24 bits */ +#define LCDC_BASECFG4_DISCEN (0x1u << 11) /**< \brief (LCDC_BASECFG4) Discard Area Enable */ +/* -------- LCDC_BASECFG5 : (LCDC Offset: 0x00000080) Base Layer Configuration Register 5 -------- */ +#define LCDC_BASECFG5_DISCXPOS_Pos 0 +#define LCDC_BASECFG5_DISCXPOS_Msk (0x7ffu << LCDC_BASECFG5_DISCXPOS_Pos) /**< \brief (LCDC_BASECFG5) Discard Area Horizontal Coordinate */ +#define LCDC_BASECFG5_DISCXPOS(value) ((LCDC_BASECFG5_DISCXPOS_Msk & ((value) << LCDC_BASECFG5_DISCXPOS_Pos))) +#define LCDC_BASECFG5_DISCYPOS_Pos 16 +#define LCDC_BASECFG5_DISCYPOS_Msk (0x7ffu << LCDC_BASECFG5_DISCYPOS_Pos) /**< \brief (LCDC_BASECFG5) Discard Area Vertical Coordinate */ +#define LCDC_BASECFG5_DISCYPOS(value) ((LCDC_BASECFG5_DISCYPOS_Msk & ((value) << LCDC_BASECFG5_DISCYPOS_Pos))) +/* -------- LCDC_BASECFG6 : (LCDC Offset: 0x00000084) Base Layer Configuration Register 6 -------- */ +#define LCDC_BASECFG6_DISCXSIZE_Pos 0 +#define LCDC_BASECFG6_DISCXSIZE_Msk (0x7ffu << LCDC_BASECFG6_DISCXSIZE_Pos) /**< \brief (LCDC_BASECFG6) Discard Area Horizontal Size */ +#define LCDC_BASECFG6_DISCXSIZE(value) ((LCDC_BASECFG6_DISCXSIZE_Msk & ((value) << LCDC_BASECFG6_DISCXSIZE_Pos))) +#define LCDC_BASECFG6_DISCYSIZE_Pos 16 +#define LCDC_BASECFG6_DISCYSIZE_Msk (0x7ffu << LCDC_BASECFG6_DISCYSIZE_Pos) /**< \brief (LCDC_BASECFG6) Discard Area Vertical Size */ +#define LCDC_BASECFG6_DISCYSIZE(value) ((LCDC_BASECFG6_DISCYSIZE_Msk & ((value) << LCDC_BASECFG6_DISCYSIZE_Pos))) +/* -------- LCDC_OVR1CHER : (LCDC Offset: 0x00000140) Overlay 1 Channel Enable Register -------- */ +#define LCDC_OVR1CHER_CHEN (0x1u << 0) /**< \brief (LCDC_OVR1CHER) Channel Enable Register */ +#define LCDC_OVR1CHER_UPDATEEN (0x1u << 1) /**< \brief (LCDC_OVR1CHER) Update Overlay Attributes Enable Register */ +#define LCDC_OVR1CHER_A2QEN (0x1u << 2) /**< \brief (LCDC_OVR1CHER) Add To Queue Enable Register */ +/* -------- LCDC_OVR1CHDR : (LCDC Offset: 0x00000144) Overlay 1 Channel Disable Register -------- */ +#define LCDC_OVR1CHDR_CHDIS (0x1u << 0) /**< \brief (LCDC_OVR1CHDR) Channel Disable Register */ +#define LCDC_OVR1CHDR_CHRST (0x1u << 8) /**< \brief (LCDC_OVR1CHDR) Channel Reset Register */ +/* -------- LCDC_OVR1CHSR : (LCDC Offset: 0x00000148) Overlay 1 Channel Status Register -------- */ +#define LCDC_OVR1CHSR_CHSR (0x1u << 0) /**< \brief (LCDC_OVR1CHSR) Channel Status Register */ +#define LCDC_OVR1CHSR_UPDATESR (0x1u << 1) /**< \brief (LCDC_OVR1CHSR) Update Overlay Attributes In Progress Status Register */ +#define LCDC_OVR1CHSR_A2QSR (0x1u << 2) /**< \brief (LCDC_OVR1CHSR) Add To Queue Status Register */ +/* -------- LCDC_OVR1IER : (LCDC Offset: 0x0000014C) Overlay 1 Interrupt Enable Register -------- */ +#define LCDC_OVR1IER_DMA (0x1u << 2) /**< \brief (LCDC_OVR1IER) End of DMA Transfer Interrupt Enable Register */ +#define LCDC_OVR1IER_DSCR (0x1u << 3) /**< \brief (LCDC_OVR1IER) Descriptor Loaded Interrupt Enable Register */ +#define LCDC_OVR1IER_ADD (0x1u << 4) /**< \brief (LCDC_OVR1IER) Head Descriptor Loaded Interrupt Enable Register */ +#define LCDC_OVR1IER_DONE (0x1u << 5) /**< \brief (LCDC_OVR1IER) End of List Interrupt Enable Register */ +#define LCDC_OVR1IER_OVR (0x1u << 6) /**< \brief (LCDC_OVR1IER) Overflow Interrupt Enable Register */ +/* -------- LCDC_OVR1IDR : (LCDC Offset: 0x00000150) Overlay 1 Interrupt Disable Register -------- */ +#define LCDC_OVR1IDR_DMA (0x1u << 2) /**< \brief (LCDC_OVR1IDR) End of DMA Transfer Interrupt Disable Register */ +#define LCDC_OVR1IDR_DSCR (0x1u << 3) /**< \brief (LCDC_OVR1IDR) Descriptor Loaded Interrupt Disable Register */ +#define LCDC_OVR1IDR_ADD (0x1u << 4) /**< \brief (LCDC_OVR1IDR) Head Descriptor Loaded Interrupt Disable Register */ +#define LCDC_OVR1IDR_DONE (0x1u << 5) /**< \brief (LCDC_OVR1IDR) End of List Interrupt Disable Register */ +#define LCDC_OVR1IDR_OVR (0x1u << 6) /**< \brief (LCDC_OVR1IDR) Overflow Interrupt Disable Register */ +/* -------- LCDC_OVR1IMR : (LCDC Offset: 0x00000154) Overlay 1 Interrupt Mask Register -------- */ +#define LCDC_OVR1IMR_DMA (0x1u << 2) /**< \brief (LCDC_OVR1IMR) End of DMA Transfer Interrupt Mask Register */ +#define LCDC_OVR1IMR_DSCR (0x1u << 3) /**< \brief (LCDC_OVR1IMR) Descriptor Loaded Interrupt Mask Register */ +#define LCDC_OVR1IMR_ADD (0x1u << 4) /**< \brief (LCDC_OVR1IMR) Head Descriptor Loaded Interrupt Mask Register */ +#define LCDC_OVR1IMR_DONE (0x1u << 5) /**< \brief (LCDC_OVR1IMR) End of List Interrupt Mask Register */ +#define LCDC_OVR1IMR_OVR (0x1u << 6) /**< \brief (LCDC_OVR1IMR) Overflow Interrupt Mask Register */ +/* -------- LCDC_OVR1ISR : (LCDC Offset: 0x00000158) Overlay 1 Interrupt Status Register -------- */ +#define LCDC_OVR1ISR_DMA (0x1u << 2) /**< \brief (LCDC_OVR1ISR) End of DMA Transfer */ +#define LCDC_OVR1ISR_DSCR (0x1u << 3) /**< \brief (LCDC_OVR1ISR) DMA Descriptor Loaded */ +#define LCDC_OVR1ISR_ADD (0x1u << 4) /**< \brief (LCDC_OVR1ISR) Head Descriptor Loaded */ +#define LCDC_OVR1ISR_DONE (0x1u << 5) /**< \brief (LCDC_OVR1ISR) End of List Detected */ +#define LCDC_OVR1ISR_OVR (0x1u << 6) /**< \brief (LCDC_OVR1ISR) Overflow Detected */ +/* -------- LCDC_OVR1HEAD : (LCDC Offset: 0x0000015C) Overlay 1 DMA Head Register -------- */ +#define LCDC_OVR1HEAD_HEAD_Pos 2 +#define LCDC_OVR1HEAD_HEAD_Msk (0x3fffffffu << LCDC_OVR1HEAD_HEAD_Pos) /**< \brief (LCDC_OVR1HEAD) DMA Head Pointer */ +#define LCDC_OVR1HEAD_HEAD(value) ((LCDC_OVR1HEAD_HEAD_Msk & ((value) << LCDC_OVR1HEAD_HEAD_Pos))) +/* -------- LCDC_OVR1ADDR : (LCDC Offset: 0x00000160) Overlay 1 DMA Address Register -------- */ +#define LCDC_OVR1ADDR_ADDR_Pos 0 +#define LCDC_OVR1ADDR_ADDR_Msk (0xffffffffu << LCDC_OVR1ADDR_ADDR_Pos) /**< \brief (LCDC_OVR1ADDR) DMA Transfer Overlay 1 Address */ +#define LCDC_OVR1ADDR_ADDR(value) ((LCDC_OVR1ADDR_ADDR_Msk & ((value) << LCDC_OVR1ADDR_ADDR_Pos))) +/* -------- LCDC_OVR1CTRL : (LCDC Offset: 0x00000164) Overlay 1 DMA Control Register -------- */ +#define LCDC_OVR1CTRL_DFETCH (0x1u << 0) /**< \brief (LCDC_OVR1CTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_OVR1CTRL_LFETCH (0x1u << 1) /**< \brief (LCDC_OVR1CTRL) Lookup Table Fetch Enable */ +#define LCDC_OVR1CTRL_DMAIEN (0x1u << 2) /**< \brief (LCDC_OVR1CTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_OVR1CTRL_DSCRIEN (0x1u << 3) /**< \brief (LCDC_OVR1CTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_OVR1CTRL_ADDIEN (0x1u << 4) /**< \brief (LCDC_OVR1CTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_OVR1CTRL_DONEIEN (0x1u << 5) /**< \brief (LCDC_OVR1CTRL) End of List Interrupt Enable */ +/* -------- LCDC_OVR1NEXT : (LCDC Offset: 0x00000168) Overlay 1 DMA Next Register -------- */ +#define LCDC_OVR1NEXT_NEXT_Pos 0 +#define LCDC_OVR1NEXT_NEXT_Msk (0xffffffffu << LCDC_OVR1NEXT_NEXT_Pos) /**< \brief (LCDC_OVR1NEXT) DMA Descriptor Next Address */ +#define LCDC_OVR1NEXT_NEXT(value) ((LCDC_OVR1NEXT_NEXT_Msk & ((value) << LCDC_OVR1NEXT_NEXT_Pos))) +/* -------- LCDC_OVR1CFG0 : (LCDC Offset: 0x0000016C) Overlay 1 Configuration Register 0 -------- */ +#define LCDC_OVR1CFG0_SIF (0x1u << 0) /**< \brief (LCDC_OVR1CFG0) Source Interface */ +#define LCDC_OVR1CFG0_BLEN_Pos 4 +#define LCDC_OVR1CFG0_BLEN_Msk (0x3u << LCDC_OVR1CFG0_BLEN_Pos) /**< \brief (LCDC_OVR1CFG0) AHB Burst Length */ +#define LCDC_OVR1CFG0_BLEN(value) ((LCDC_OVR1CFG0_BLEN_Msk & ((value) << LCDC_OVR1CFG0_BLEN_Pos))) +#define LCDC_OVR1CFG0_BLEN_AHB_BLEN_SINGLE (0x0u << 4) /**< \brief (LCDC_OVR1CFG0) AHB Access is started as soon as there is enough space in the FIFO to store one data. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR1CFG0_BLEN_AHB_BLEN_INCR4 (0x1u << 4) /**< \brief (LCDC_OVR1CFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 4 data. An AHB INCR4 Burst is used. SINGLE, INCR and INCR4 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR1CFG0_BLEN_AHB_BLEN_INCR8 (0x2u << 4) /**< \brief (LCDC_OVR1CFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 8 data. An AHB INCR8 Burst is used. SINGLE, INCR, INCR4 and INCR8 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR1CFG0_BLEN_AHB_BLEN_INCR16 (0x3u << 4) /**< \brief (LCDC_OVR1CFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 16 data. An AHB INCR16 Burst is used. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR1CFG0_DLBO (0x1u << 8) /**< \brief (LCDC_OVR1CFG0) Defined Length Burst Only for Channel Bus Transaction. */ +#define LCDC_OVR1CFG0_ROTDIS (0x1u << 12) /**< \brief (LCDC_OVR1CFG0) Hardware Rotation Optimization Disable */ +#define LCDC_OVR1CFG0_LOCKDIS (0x1u << 13) /**< \brief (LCDC_OVR1CFG0) Hardware Rotation Lock Disable */ +/* -------- LCDC_OVR1CFG1 : (LCDC Offset: 0x00000170) Overlay 1 Configuration Register 1 -------- */ +#define LCDC_OVR1CFG1_CLUTEN (0x1u << 0) /**< \brief (LCDC_OVR1CFG1) Color Lookup Table Mode Enable */ +#define LCDC_OVR1CFG1_RGBMODE_Pos 4 +#define LCDC_OVR1CFG1_RGBMODE_Msk (0xfu << LCDC_OVR1CFG1_RGBMODE_Pos) /**< \brief (LCDC_OVR1CFG1) RGB Mode Input Selection */ +#define LCDC_OVR1CFG1_RGBMODE(value) ((LCDC_OVR1CFG1_RGBMODE_Msk & ((value) << LCDC_OVR1CFG1_RGBMODE_Pos))) +#define LCDC_OVR1CFG1_RGBMODE_12BPP_RGB_444 (0x0u << 4) /**< \brief (LCDC_OVR1CFG1) 12 bpp RGB 444 */ +#define LCDC_OVR1CFG1_RGBMODE_16BPP_ARGB_4444 (0x1u << 4) /**< \brief (LCDC_OVR1CFG1) 16 bpp ARGB 4444 */ +#define LCDC_OVR1CFG1_RGBMODE_16BPP_RGBA_4444 (0x2u << 4) /**< \brief (LCDC_OVR1CFG1) 16 bpp RGBA 4444 */ +#define LCDC_OVR1CFG1_RGBMODE_16BPP_RGB_565 (0x3u << 4) /**< \brief (LCDC_OVR1CFG1) 16 bpp RGB 565 */ +#define LCDC_OVR1CFG1_RGBMODE_16BPP_TRGB_1555 (0x4u << 4) /**< \brief (LCDC_OVR1CFG1) 16 bpp TRGB 1555 */ +#define LCDC_OVR1CFG1_RGBMODE_18BPP_RGB_666 (0x5u << 4) /**< \brief (LCDC_OVR1CFG1) 18 bpp RGB 666 */ +#define LCDC_OVR1CFG1_RGBMODE_18BPP_RGB_666PACKED (0x6u << 4) /**< \brief (LCDC_OVR1CFG1) 18 bpp RGB 666 PACKED */ +#define LCDC_OVR1CFG1_RGBMODE_19BPP_TRGB_1666 (0x7u << 4) /**< \brief (LCDC_OVR1CFG1) 19 bpp TRGB 1666 */ +#define LCDC_OVR1CFG1_RGBMODE_19BPP_TRGB_PACKED (0x8u << 4) /**< \brief (LCDC_OVR1CFG1) 19 bpp TRGB 1666 PACKED */ +#define LCDC_OVR1CFG1_RGBMODE_24BPP_RGB_888 (0x9u << 4) /**< \brief (LCDC_OVR1CFG1) 24 bpp RGB 888 */ +#define LCDC_OVR1CFG1_RGBMODE_24BPP_RGB_888_PACKED (0xAu << 4) /**< \brief (LCDC_OVR1CFG1) 24 bpp RGB 888 PACKED */ +#define LCDC_OVR1CFG1_RGBMODE_25BPP_TRGB_1888 (0xBu << 4) /**< \brief (LCDC_OVR1CFG1) 25 bpp TRGB 1888 */ +#define LCDC_OVR1CFG1_RGBMODE_32BPP_ARGB_8888 (0xCu << 4) /**< \brief (LCDC_OVR1CFG1) 32 bpp ARGB 8888 */ +#define LCDC_OVR1CFG1_RGBMODE_32BPP_RGBA_8888 (0xDu << 4) /**< \brief (LCDC_OVR1CFG1) 32 bpp RGBA 8888 */ +#define LCDC_OVR1CFG1_CLUTMODE_Pos 8 +#define LCDC_OVR1CFG1_CLUTMODE_Msk (0x3u << LCDC_OVR1CFG1_CLUTMODE_Pos) /**< \brief (LCDC_OVR1CFG1) Color Lookup Table Mode Input Selection */ +#define LCDC_OVR1CFG1_CLUTMODE(value) ((LCDC_OVR1CFG1_CLUTMODE_Msk & ((value) << LCDC_OVR1CFG1_CLUTMODE_Pos))) +#define LCDC_OVR1CFG1_CLUTMODE_CLUT_1BPP (0x0u << 8) /**< \brief (LCDC_OVR1CFG1) Color Lookup Table mode set to 1 bit per pixel */ +#define LCDC_OVR1CFG1_CLUTMODE_CLUT_2BPP (0x1u << 8) /**< \brief (LCDC_OVR1CFG1) Color Lookup Table mode set to 2 bits per pixel */ +#define LCDC_OVR1CFG1_CLUTMODE_CLUT_4BPP (0x2u << 8) /**< \brief (LCDC_OVR1CFG1) Color Lookup Table mode set to 4 bits per pixel */ +#define LCDC_OVR1CFG1_CLUTMODE_CLUT_8BPP (0x3u << 8) /**< \brief (LCDC_OVR1CFG1) Color Lookup Table mode set to 8 bits per pixel */ +/* -------- LCDC_OVR1CFG2 : (LCDC Offset: 0x00000174) Overlay 1 Configuration Register 2 -------- */ +#define LCDC_OVR1CFG2_XPOS_Pos 0 +#define LCDC_OVR1CFG2_XPOS_Msk (0x7ffu << LCDC_OVR1CFG2_XPOS_Pos) /**< \brief (LCDC_OVR1CFG2) Horizontal Window Position */ +#define LCDC_OVR1CFG2_XPOS(value) ((LCDC_OVR1CFG2_XPOS_Msk & ((value) << LCDC_OVR1CFG2_XPOS_Pos))) +#define LCDC_OVR1CFG2_YPOS_Pos 16 +#define LCDC_OVR1CFG2_YPOS_Msk (0x7ffu << LCDC_OVR1CFG2_YPOS_Pos) /**< \brief (LCDC_OVR1CFG2) Vertical Window Position */ +#define LCDC_OVR1CFG2_YPOS(value) ((LCDC_OVR1CFG2_YPOS_Msk & ((value) << LCDC_OVR1CFG2_YPOS_Pos))) +/* -------- LCDC_OVR1CFG3 : (LCDC Offset: 0x00000178) Overlay 1 Configuration Register 3 -------- */ +#define LCDC_OVR1CFG3_XSIZE_Pos 0 +#define LCDC_OVR1CFG3_XSIZE_Msk (0x7ffu << LCDC_OVR1CFG3_XSIZE_Pos) /**< \brief (LCDC_OVR1CFG3) Horizontal Window Size */ +#define LCDC_OVR1CFG3_XSIZE(value) ((LCDC_OVR1CFG3_XSIZE_Msk & ((value) << LCDC_OVR1CFG3_XSIZE_Pos))) +#define LCDC_OVR1CFG3_YSIZE_Pos 16 +#define LCDC_OVR1CFG3_YSIZE_Msk (0x7ffu << LCDC_OVR1CFG3_YSIZE_Pos) /**< \brief (LCDC_OVR1CFG3) Vertical Window Size */ +#define LCDC_OVR1CFG3_YSIZE(value) ((LCDC_OVR1CFG3_YSIZE_Msk & ((value) << LCDC_OVR1CFG3_YSIZE_Pos))) +/* -------- LCDC_OVR1CFG4 : (LCDC Offset: 0x0000017C) Overlay 1 Configuration Register 4 -------- */ +#define LCDC_OVR1CFG4_XSTRIDE_Pos 0 +#define LCDC_OVR1CFG4_XSTRIDE_Msk (0xffffffffu << LCDC_OVR1CFG4_XSTRIDE_Pos) /**< \brief (LCDC_OVR1CFG4) Horizontal Stride */ +#define LCDC_OVR1CFG4_XSTRIDE(value) ((LCDC_OVR1CFG4_XSTRIDE_Msk & ((value) << LCDC_OVR1CFG4_XSTRIDE_Pos))) +/* -------- LCDC_OVR1CFG5 : (LCDC Offset: 0x00000180) Overlay 1 Configuration Register 5 -------- */ +#define LCDC_OVR1CFG5_PSTRIDE_Pos 0 +#define LCDC_OVR1CFG5_PSTRIDE_Msk (0xffffffffu << LCDC_OVR1CFG5_PSTRIDE_Pos) /**< \brief (LCDC_OVR1CFG5) Pixel Stride */ +#define LCDC_OVR1CFG5_PSTRIDE(value) ((LCDC_OVR1CFG5_PSTRIDE_Msk & ((value) << LCDC_OVR1CFG5_PSTRIDE_Pos))) +/* -------- LCDC_OVR1CFG6 : (LCDC Offset: 0x00000184) Overlay 1 Configuration Register 6 -------- */ +#define LCDC_OVR1CFG6_BDEF_Pos 0 +#define LCDC_OVR1CFG6_BDEF_Msk (0xffu << LCDC_OVR1CFG6_BDEF_Pos) /**< \brief (LCDC_OVR1CFG6) Blue Default */ +#define LCDC_OVR1CFG6_BDEF(value) ((LCDC_OVR1CFG6_BDEF_Msk & ((value) << LCDC_OVR1CFG6_BDEF_Pos))) +#define LCDC_OVR1CFG6_GDEF_Pos 8 +#define LCDC_OVR1CFG6_GDEF_Msk (0xffu << LCDC_OVR1CFG6_GDEF_Pos) /**< \brief (LCDC_OVR1CFG6) Green Default */ +#define LCDC_OVR1CFG6_GDEF(value) ((LCDC_OVR1CFG6_GDEF_Msk & ((value) << LCDC_OVR1CFG6_GDEF_Pos))) +#define LCDC_OVR1CFG6_RDEF_Pos 16 +#define LCDC_OVR1CFG6_RDEF_Msk (0xffu << LCDC_OVR1CFG6_RDEF_Pos) /**< \brief (LCDC_OVR1CFG6) Red Default */ +#define LCDC_OVR1CFG6_RDEF(value) ((LCDC_OVR1CFG6_RDEF_Msk & ((value) << LCDC_OVR1CFG6_RDEF_Pos))) +/* -------- LCDC_OVR1CFG7 : (LCDC Offset: 0x00000188) Overlay 1 Configuration Register 7 -------- */ +#define LCDC_OVR1CFG7_BKEY_Pos 0 +#define LCDC_OVR1CFG7_BKEY_Msk (0xffu << LCDC_OVR1CFG7_BKEY_Pos) /**< \brief (LCDC_OVR1CFG7) Blue Color Component Chroma Key */ +#define LCDC_OVR1CFG7_BKEY(value) ((LCDC_OVR1CFG7_BKEY_Msk & ((value) << LCDC_OVR1CFG7_BKEY_Pos))) +#define LCDC_OVR1CFG7_GKEY_Pos 8 +#define LCDC_OVR1CFG7_GKEY_Msk (0xffu << LCDC_OVR1CFG7_GKEY_Pos) /**< \brief (LCDC_OVR1CFG7) Green Color Component Chroma Key */ +#define LCDC_OVR1CFG7_GKEY(value) ((LCDC_OVR1CFG7_GKEY_Msk & ((value) << LCDC_OVR1CFG7_GKEY_Pos))) +#define LCDC_OVR1CFG7_RKEY_Pos 16 +#define LCDC_OVR1CFG7_RKEY_Msk (0xffu << LCDC_OVR1CFG7_RKEY_Pos) /**< \brief (LCDC_OVR1CFG7) Red Color Component Chroma Key */ +#define LCDC_OVR1CFG7_RKEY(value) ((LCDC_OVR1CFG7_RKEY_Msk & ((value) << LCDC_OVR1CFG7_RKEY_Pos))) +/* -------- LCDC_OVR1CFG8 : (LCDC Offset: 0x0000018C) Overlay 1 Configuration Register 8 -------- */ +#define LCDC_OVR1CFG8_BMASK_Pos 0 +#define LCDC_OVR1CFG8_BMASK_Msk (0xffu << LCDC_OVR1CFG8_BMASK_Pos) /**< \brief (LCDC_OVR1CFG8) Blue Color Component Chroma Key Mask */ +#define LCDC_OVR1CFG8_BMASK(value) ((LCDC_OVR1CFG8_BMASK_Msk & ((value) << LCDC_OVR1CFG8_BMASK_Pos))) +#define LCDC_OVR1CFG8_GMASK_Pos 8 +#define LCDC_OVR1CFG8_GMASK_Msk (0xffu << LCDC_OVR1CFG8_GMASK_Pos) /**< \brief (LCDC_OVR1CFG8) Green Color Component Chroma Key Mask */ +#define LCDC_OVR1CFG8_GMASK(value) ((LCDC_OVR1CFG8_GMASK_Msk & ((value) << LCDC_OVR1CFG8_GMASK_Pos))) +#define LCDC_OVR1CFG8_RMASK_Pos 16 +#define LCDC_OVR1CFG8_RMASK_Msk (0xffu << LCDC_OVR1CFG8_RMASK_Pos) /**< \brief (LCDC_OVR1CFG8) Red Color Component Chroma Key Mask */ +#define LCDC_OVR1CFG8_RMASK(value) ((LCDC_OVR1CFG8_RMASK_Msk & ((value) << LCDC_OVR1CFG8_RMASK_Pos))) +/* -------- LCDC_OVR1CFG9 : (LCDC Offset: 0x00000190) Overlay 1 Configuration Register 9 -------- */ +#define LCDC_OVR1CFG9_CRKEY (0x1u << 0) /**< \brief (LCDC_OVR1CFG9) Blender Chroma Key Enable */ +#define LCDC_OVR1CFG9_INV (0x1u << 1) /**< \brief (LCDC_OVR1CFG9) Blender Inverted Blender Output Enable */ +#define LCDC_OVR1CFG9_ITER2BL (0x1u << 2) /**< \brief (LCDC_OVR1CFG9) Blender Iterated Color Enable */ +#define LCDC_OVR1CFG9_ITER (0x1u << 3) /**< \brief (LCDC_OVR1CFG9) Blender Use Iterated Color */ +#define LCDC_OVR1CFG9_REVALPHA (0x1u << 4) /**< \brief (LCDC_OVR1CFG9) Blender Reverse Alpha */ +#define LCDC_OVR1CFG9_GAEN (0x1u << 5) /**< \brief (LCDC_OVR1CFG9) Blender Global Alpha Enable */ +#define LCDC_OVR1CFG9_LAEN (0x1u << 6) /**< \brief (LCDC_OVR1CFG9) Blender Local Alpha Enable */ +#define LCDC_OVR1CFG9_OVR (0x1u << 7) /**< \brief (LCDC_OVR1CFG9) Blender Overlay Layer Enable */ +#define LCDC_OVR1CFG9_DMA (0x1u << 8) /**< \brief (LCDC_OVR1CFG9) Blender DMA Layer Enable */ +#define LCDC_OVR1CFG9_REP (0x1u << 9) /**< \brief (LCDC_OVR1CFG9) Use Replication logic to expand RGB color to 24 bits */ +#define LCDC_OVR1CFG9_DSTKEY (0x1u << 10) /**< \brief (LCDC_OVR1CFG9) Destination Chroma Keying */ +#define LCDC_OVR1CFG9_GA_Pos 16 +#define LCDC_OVR1CFG9_GA_Msk (0xffu << LCDC_OVR1CFG9_GA_Pos) /**< \brief (LCDC_OVR1CFG9) Blender Global Alpha */ +#define LCDC_OVR1CFG9_GA(value) ((LCDC_OVR1CFG9_GA_Msk & ((value) << LCDC_OVR1CFG9_GA_Pos))) +/* -------- LCDC_OVR2CHER : (LCDC Offset: 0x00000240) Overlay 2 Channel Enable Register -------- */ +#define LCDC_OVR2CHER_CHEN (0x1u << 0) /**< \brief (LCDC_OVR2CHER) Channel Enable Register */ +#define LCDC_OVR2CHER_UPDATEEN (0x1u << 1) /**< \brief (LCDC_OVR2CHER) Update Overlay Attributes Enable Register */ +#define LCDC_OVR2CHER_A2QEN (0x1u << 2) /**< \brief (LCDC_OVR2CHER) Add To Queue Enable Register */ +/* -------- LCDC_OVR2CHDR : (LCDC Offset: 0x00000244) Overlay 2 Channel Disable Register -------- */ +#define LCDC_OVR2CHDR_CHDIS (0x1u << 0) /**< \brief (LCDC_OVR2CHDR) Channel Disable Register */ +#define LCDC_OVR2CHDR_CHRST (0x1u << 8) /**< \brief (LCDC_OVR2CHDR) Channel Reset Register */ +/* -------- LCDC_OVR2CHSR : (LCDC Offset: 0x00000248) Overlay 2 Channel Status Register -------- */ +#define LCDC_OVR2CHSR_CHSR (0x1u << 0) /**< \brief (LCDC_OVR2CHSR) Channel Status Register */ +#define LCDC_OVR2CHSR_UPDATESR (0x1u << 1) /**< \brief (LCDC_OVR2CHSR) Update Overlay Attributes In Progress Status Register */ +#define LCDC_OVR2CHSR_A2QSR (0x1u << 2) /**< \brief (LCDC_OVR2CHSR) Add To Queue Status Register */ +/* -------- LCDC_OVR2IER : (LCDC Offset: 0x0000024C) Overlay 2 Interrupt Enable Register -------- */ +#define LCDC_OVR2IER_DMA (0x1u << 2) /**< \brief (LCDC_OVR2IER) End of DMA Transfer Interrupt Enable Register */ +#define LCDC_OVR2IER_DSCR (0x1u << 3) /**< \brief (LCDC_OVR2IER) Descriptor Loaded Interrupt Enable Register */ +#define LCDC_OVR2IER_ADD (0x1u << 4) /**< \brief (LCDC_OVR2IER) Head Descriptor Loaded Interrupt Enable Register */ +#define LCDC_OVR2IER_DONE (0x1u << 5) /**< \brief (LCDC_OVR2IER) End of List Interrupt Enable Register */ +#define LCDC_OVR2IER_OVR (0x1u << 6) /**< \brief (LCDC_OVR2IER) Overflow Interrupt Enable Register */ +/* -------- LCDC_OVR2IDR : (LCDC Offset: 0x00000250) Overlay 2 Interrupt Disable Register -------- */ +#define LCDC_OVR2IDR_DMA (0x1u << 2) /**< \brief (LCDC_OVR2IDR) End of DMA Transfer Interrupt Disable Register */ +#define LCDC_OVR2IDR_DSCR (0x1u << 3) /**< \brief (LCDC_OVR2IDR) Descriptor Loaded Interrupt Disable Register */ +#define LCDC_OVR2IDR_ADD (0x1u << 4) /**< \brief (LCDC_OVR2IDR) Head Descriptor Loaded Interrupt Disable Register */ +#define LCDC_OVR2IDR_DONE (0x1u << 5) /**< \brief (LCDC_OVR2IDR) End of List Interrupt Disable Register */ +#define LCDC_OVR2IDR_OVR (0x1u << 6) /**< \brief (LCDC_OVR2IDR) Overflow Interrupt Disable Register */ +/* -------- LCDC_OVR2IMR : (LCDC Offset: 0x00000254) Overlay 2 Interrupt Mask Register -------- */ +#define LCDC_OVR2IMR_DMA (0x1u << 2) /**< \brief (LCDC_OVR2IMR) End of DMA Transfer Interrupt Mask Register */ +#define LCDC_OVR2IMR_DSCR (0x1u << 3) /**< \brief (LCDC_OVR2IMR) Descriptor Loaded Interrupt Mask Register */ +#define LCDC_OVR2IMR_ADD (0x1u << 4) /**< \brief (LCDC_OVR2IMR) Head Descriptor Loaded Interrupt Mask Register */ +#define LCDC_OVR2IMR_DONE (0x1u << 5) /**< \brief (LCDC_OVR2IMR) End of List Interrupt Mask Register */ +#define LCDC_OVR2IMR_OVR (0x1u << 6) /**< \brief (LCDC_OVR2IMR) Overflow Interrupt Mask Register */ +/* -------- LCDC_OVR2ISR : (LCDC Offset: 0x00000258) Overlay 2 Interrupt Status Register -------- */ +#define LCDC_OVR2ISR_DMA (0x1u << 2) /**< \brief (LCDC_OVR2ISR) End of DMA Transfer */ +#define LCDC_OVR2ISR_DSCR (0x1u << 3) /**< \brief (LCDC_OVR2ISR) DMA Descriptor Loaded */ +#define LCDC_OVR2ISR_ADD (0x1u << 4) /**< \brief (LCDC_OVR2ISR) Head Descriptor Loaded */ +#define LCDC_OVR2ISR_DONE (0x1u << 5) /**< \brief (LCDC_OVR2ISR) End of List Detected */ +#define LCDC_OVR2ISR_OVR (0x1u << 6) /**< \brief (LCDC_OVR2ISR) Overflow Detected */ +/* -------- LCDC_OVR2HEAD : (LCDC Offset: 0x0000025C) Overlay 2 DMA Head Register -------- */ +#define LCDC_OVR2HEAD_HEAD_Pos 2 +#define LCDC_OVR2HEAD_HEAD_Msk (0x3fffffffu << LCDC_OVR2HEAD_HEAD_Pos) /**< \brief (LCDC_OVR2HEAD) DMA Head Pointer */ +#define LCDC_OVR2HEAD_HEAD(value) ((LCDC_OVR2HEAD_HEAD_Msk & ((value) << LCDC_OVR2HEAD_HEAD_Pos))) +/* -------- LCDC_OVR2ADDR : (LCDC Offset: 0x00000260) Overlay 2 DMA Address Register -------- */ +#define LCDC_OVR2ADDR_ADDR_Pos 0 +#define LCDC_OVR2ADDR_ADDR_Msk (0xffffffffu << LCDC_OVR2ADDR_ADDR_Pos) /**< \brief (LCDC_OVR2ADDR) DMA Transfer Overlay 2 Address */ +#define LCDC_OVR2ADDR_ADDR(value) ((LCDC_OVR2ADDR_ADDR_Msk & ((value) << LCDC_OVR2ADDR_ADDR_Pos))) +/* -------- LCDC_OVR2CTRL : (LCDC Offset: 0x00000264) Overlay 2 DMA Control Register -------- */ +#define LCDC_OVR2CTRL_DFETCH (0x1u << 0) /**< \brief (LCDC_OVR2CTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_OVR2CTRL_LFETCH (0x1u << 1) /**< \brief (LCDC_OVR2CTRL) Lookup Table Fetch Enable */ +#define LCDC_OVR2CTRL_DMAIEN (0x1u << 2) /**< \brief (LCDC_OVR2CTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_OVR2CTRL_DSCRIEN (0x1u << 3) /**< \brief (LCDC_OVR2CTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_OVR2CTRL_ADDIEN (0x1u << 4) /**< \brief (LCDC_OVR2CTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_OVR2CTRL_DONEIEN (0x1u << 5) /**< \brief (LCDC_OVR2CTRL) End of List Interrupt Enable */ +/* -------- LCDC_OVR2NEXT : (LCDC Offset: 0x00000268) Overlay 2 DMA Next Register -------- */ +#define LCDC_OVR2NEXT_NEXT_Pos 0 +#define LCDC_OVR2NEXT_NEXT_Msk (0xffffffffu << LCDC_OVR2NEXT_NEXT_Pos) /**< \brief (LCDC_OVR2NEXT) DMA Descriptor Next Address */ +#define LCDC_OVR2NEXT_NEXT(value) ((LCDC_OVR2NEXT_NEXT_Msk & ((value) << LCDC_OVR2NEXT_NEXT_Pos))) +/* -------- LCDC_OVR2CFG0 : (LCDC Offset: 0x0000026C) Overlay 2 Configuration Register 0 -------- */ +#define LCDC_OVR2CFG0_BLEN_Pos 4 +#define LCDC_OVR2CFG0_BLEN_Msk (0x3u << LCDC_OVR2CFG0_BLEN_Pos) /**< \brief (LCDC_OVR2CFG0) AHB Burst Length */ +#define LCDC_OVR2CFG0_BLEN(value) ((LCDC_OVR2CFG0_BLEN_Msk & ((value) << LCDC_OVR2CFG0_BLEN_Pos))) +#define LCDC_OVR2CFG0_BLEN_AHB_SINGLE (0x0u << 4) /**< \brief (LCDC_OVR2CFG0) AHB Access is started as soon as there is enough space in the FIFO to store one data. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR2CFG0_BLEN_AHB_INCR4 (0x1u << 4) /**< \brief (LCDC_OVR2CFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 4 data. An AHB INCR4 Burst is used. SINGLE, INCR and INCR4 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR2CFG0_BLEN_AHB_INCR8 (0x2u << 4) /**< \brief (LCDC_OVR2CFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 8 data. An AHB INCR8 Burst is used. SINGLE, INCR, INCR4 and INCR8 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR2CFG0_BLEN_AHB_INCR16 (0x3u << 4) /**< \brief (LCDC_OVR2CFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 16 data. An AHB INCR16 Burst is used. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_OVR2CFG0_DLBO (0x1u << 8) /**< \brief (LCDC_OVR2CFG0) Defined Length Burst Only For Channel Bus Transaction. */ +#define LCDC_OVR2CFG0_ROTDIS (0x1u << 12) /**< \brief (LCDC_OVR2CFG0) Hardware Rotation Optimization Disable */ +#define LCDC_OVR2CFG0_LOCKDIS (0x1u << 13) /**< \brief (LCDC_OVR2CFG0) Hardware Rotation Lock Disable */ +/* -------- LCDC_OVR2CFG1 : (LCDC Offset: 0x00000270) Overlay 2 Configuration Register 1 -------- */ +#define LCDC_OVR2CFG1_CLUTEN (0x1u << 0) /**< \brief (LCDC_OVR2CFG1) Color Lookup Table Mode Enable */ +#define LCDC_OVR2CFG1_RGBMODE_Pos 4 +#define LCDC_OVR2CFG1_RGBMODE_Msk (0xfu << LCDC_OVR2CFG1_RGBMODE_Pos) /**< \brief (LCDC_OVR2CFG1) RGB Mode Input Selection */ +#define LCDC_OVR2CFG1_RGBMODE(value) ((LCDC_OVR2CFG1_RGBMODE_Msk & ((value) << LCDC_OVR2CFG1_RGBMODE_Pos))) +#define LCDC_OVR2CFG1_RGBMODE_12BPP_RGB_444 (0x0u << 4) /**< \brief (LCDC_OVR2CFG1) 12 bpp RGB 444 */ +#define LCDC_OVR2CFG1_RGBMODE_16BPP_ARGB_4444 (0x1u << 4) /**< \brief (LCDC_OVR2CFG1) 16 bpp ARGB 4444 */ +#define LCDC_OVR2CFG1_RGBMODE_16BPP_RGBA_4444 (0x2u << 4) /**< \brief (LCDC_OVR2CFG1) 16 bpp RGBA 4444 */ +#define LCDC_OVR2CFG1_RGBMODE_16BPP_RGB_565 (0x3u << 4) /**< \brief (LCDC_OVR2CFG1) 16 bpp RGB 565 */ +#define LCDC_OVR2CFG1_RGBMODE_16BPP_TRGB_1555 (0x4u << 4) /**< \brief (LCDC_OVR2CFG1) 16 bpp TRGB 1555 */ +#define LCDC_OVR2CFG1_RGBMODE_18BPP_RGB_666 (0x5u << 4) /**< \brief (LCDC_OVR2CFG1) 18 bpp RGB 666 */ +#define LCDC_OVR2CFG1_RGBMODE_18BPP_RGB_666PACKED (0x6u << 4) /**< \brief (LCDC_OVR2CFG1) 18 bpp RGB 666 PACKED */ +#define LCDC_OVR2CFG1_RGBMODE_19BPP_TRGB_1666 (0x7u << 4) /**< \brief (LCDC_OVR2CFG1) 19 bpp TRGB 1666 */ +#define LCDC_OVR2CFG1_RGBMODE_19BPP_TRGB_PACKED (0x8u << 4) /**< \brief (LCDC_OVR2CFG1) 19 bpp TRGB 1666 PACKED */ +#define LCDC_OVR2CFG1_RGBMODE_24BPP_RGB_888 (0x9u << 4) /**< \brief (LCDC_OVR2CFG1) 24 bpp RGB 888 */ +#define LCDC_OVR2CFG1_RGBMODE_24BPP_RGB_888_PACKED (0xAu << 4) /**< \brief (LCDC_OVR2CFG1) 24 bpp RGB 888 PACKED */ +#define LCDC_OVR2CFG1_RGBMODE_25BPP_TRGB_1888 (0xBu << 4) /**< \brief (LCDC_OVR2CFG1) 25 bpp TRGB 1888 */ +#define LCDC_OVR2CFG1_RGBMODE_32BPP_ARGB_8888 (0xCu << 4) /**< \brief (LCDC_OVR2CFG1) 32 bpp ARGB 8888 */ +#define LCDC_OVR2CFG1_RGBMODE_32BPP_RGBA_8888 (0xDu << 4) /**< \brief (LCDC_OVR2CFG1) 32 bpp RGBA 8888 */ +#define LCDC_OVR2CFG1_CLUTMODE_Pos 8 +#define LCDC_OVR2CFG1_CLUTMODE_Msk (0x3u << LCDC_OVR2CFG1_CLUTMODE_Pos) /**< \brief (LCDC_OVR2CFG1) Color Lookup Table Mode Input Selection */ +#define LCDC_OVR2CFG1_CLUTMODE(value) ((LCDC_OVR2CFG1_CLUTMODE_Msk & ((value) << LCDC_OVR2CFG1_CLUTMODE_Pos))) +#define LCDC_OVR2CFG1_CLUTMODE_CLUT_1BPP (0x0u << 8) /**< \brief (LCDC_OVR2CFG1) Color Lookup Table mode set to 1 bit per pixel */ +#define LCDC_OVR2CFG1_CLUTMODE_CLUT_2BPP (0x1u << 8) /**< \brief (LCDC_OVR2CFG1) Color Lookup Table mode set to 2 bits per pixel */ +#define LCDC_OVR2CFG1_CLUTMODE_CLUT_4BPP (0x2u << 8) /**< \brief (LCDC_OVR2CFG1) Color Lookup Table mode set to 4 bits per pixel */ +#define LCDC_OVR2CFG1_CLUTMODE_CLUT_8BPP (0x3u << 8) /**< \brief (LCDC_OVR2CFG1) Color Lookup Table mode set to 8 bits per pixel */ +/* -------- LCDC_OVR2CFG2 : (LCDC Offset: 0x00000274) Overlay 2 Configuration Register 2 -------- */ +#define LCDC_OVR2CFG2_XPOS_Pos 0 +#define LCDC_OVR2CFG2_XPOS_Msk (0x7ffu << LCDC_OVR2CFG2_XPOS_Pos) /**< \brief (LCDC_OVR2CFG2) Horizontal Window Position */ +#define LCDC_OVR2CFG2_XPOS(value) ((LCDC_OVR2CFG2_XPOS_Msk & ((value) << LCDC_OVR2CFG2_XPOS_Pos))) +#define LCDC_OVR2CFG2_YPOS_Pos 16 +#define LCDC_OVR2CFG2_YPOS_Msk (0x7ffu << LCDC_OVR2CFG2_YPOS_Pos) /**< \brief (LCDC_OVR2CFG2) Vertical Window Position */ +#define LCDC_OVR2CFG2_YPOS(value) ((LCDC_OVR2CFG2_YPOS_Msk & ((value) << LCDC_OVR2CFG2_YPOS_Pos))) +/* -------- LCDC_OVR2CFG3 : (LCDC Offset: 0x00000278) Overlay 2 Configuration Register 3 -------- */ +#define LCDC_OVR2CFG3_XSIZE_Pos 0 +#define LCDC_OVR2CFG3_XSIZE_Msk (0x7ffu << LCDC_OVR2CFG3_XSIZE_Pos) /**< \brief (LCDC_OVR2CFG3) Horizontal Window Size */ +#define LCDC_OVR2CFG3_XSIZE(value) ((LCDC_OVR2CFG3_XSIZE_Msk & ((value) << LCDC_OVR2CFG3_XSIZE_Pos))) +#define LCDC_OVR2CFG3_YSIZE_Pos 16 +#define LCDC_OVR2CFG3_YSIZE_Msk (0x7ffu << LCDC_OVR2CFG3_YSIZE_Pos) /**< \brief (LCDC_OVR2CFG3) Vertical Window Size */ +#define LCDC_OVR2CFG3_YSIZE(value) ((LCDC_OVR2CFG3_YSIZE_Msk & ((value) << LCDC_OVR2CFG3_YSIZE_Pos))) +/* -------- LCDC_OVR2CFG4 : (LCDC Offset: 0x0000027C) Overlay 2 Configuration Register 4 -------- */ +#define LCDC_OVR2CFG4_XSTRIDE_Pos 0 +#define LCDC_OVR2CFG4_XSTRIDE_Msk (0xffffffffu << LCDC_OVR2CFG4_XSTRIDE_Pos) /**< \brief (LCDC_OVR2CFG4) Horizontal Stride */ +#define LCDC_OVR2CFG4_XSTRIDE(value) ((LCDC_OVR2CFG4_XSTRIDE_Msk & ((value) << LCDC_OVR2CFG4_XSTRIDE_Pos))) +/* -------- LCDC_OVR2CFG5 : (LCDC Offset: 0x00000280) Overlay 2 Configuration Register 5 -------- */ +#define LCDC_OVR2CFG5_PSTRIDE_Pos 0 +#define LCDC_OVR2CFG5_PSTRIDE_Msk (0xffffffffu << LCDC_OVR2CFG5_PSTRIDE_Pos) /**< \brief (LCDC_OVR2CFG5) Pixel Stride */ +#define LCDC_OVR2CFG5_PSTRIDE(value) ((LCDC_OVR2CFG5_PSTRIDE_Msk & ((value) << LCDC_OVR2CFG5_PSTRIDE_Pos))) +/* -------- LCDC_OVR2CFG6 : (LCDC Offset: 0x00000284) Overlay 2 Configuration Register 6 -------- */ +#define LCDC_OVR2CFG6_BDEF_Pos 0 +#define LCDC_OVR2CFG6_BDEF_Msk (0xffu << LCDC_OVR2CFG6_BDEF_Pos) /**< \brief (LCDC_OVR2CFG6) Blue Default */ +#define LCDC_OVR2CFG6_BDEF(value) ((LCDC_OVR2CFG6_BDEF_Msk & ((value) << LCDC_OVR2CFG6_BDEF_Pos))) +#define LCDC_OVR2CFG6_GDEF_Pos 8 +#define LCDC_OVR2CFG6_GDEF_Msk (0xffu << LCDC_OVR2CFG6_GDEF_Pos) /**< \brief (LCDC_OVR2CFG6) Green Default */ +#define LCDC_OVR2CFG6_GDEF(value) ((LCDC_OVR2CFG6_GDEF_Msk & ((value) << LCDC_OVR2CFG6_GDEF_Pos))) +#define LCDC_OVR2CFG6_RDEF_Pos 16 +#define LCDC_OVR2CFG6_RDEF_Msk (0xffu << LCDC_OVR2CFG6_RDEF_Pos) /**< \brief (LCDC_OVR2CFG6) Red Default */ +#define LCDC_OVR2CFG6_RDEF(value) ((LCDC_OVR2CFG6_RDEF_Msk & ((value) << LCDC_OVR2CFG6_RDEF_Pos))) +/* -------- LCDC_OVR2CFG7 : (LCDC Offset: 0x00000288) Overlay 2 Configuration Register 7 -------- */ +#define LCDC_OVR2CFG7_BKEY_Pos 0 +#define LCDC_OVR2CFG7_BKEY_Msk (0xffu << LCDC_OVR2CFG7_BKEY_Pos) /**< \brief (LCDC_OVR2CFG7) Blue Color Component Chroma Key */ +#define LCDC_OVR2CFG7_BKEY(value) ((LCDC_OVR2CFG7_BKEY_Msk & ((value) << LCDC_OVR2CFG7_BKEY_Pos))) +#define LCDC_OVR2CFG7_GKEY_Pos 8 +#define LCDC_OVR2CFG7_GKEY_Msk (0xffu << LCDC_OVR2CFG7_GKEY_Pos) /**< \brief (LCDC_OVR2CFG7) Green Color Component Chroma Key */ +#define LCDC_OVR2CFG7_GKEY(value) ((LCDC_OVR2CFG7_GKEY_Msk & ((value) << LCDC_OVR2CFG7_GKEY_Pos))) +#define LCDC_OVR2CFG7_RKEY_Pos 16 +#define LCDC_OVR2CFG7_RKEY_Msk (0xffu << LCDC_OVR2CFG7_RKEY_Pos) /**< \brief (LCDC_OVR2CFG7) Red Color Component Chroma Key */ +#define LCDC_OVR2CFG7_RKEY(value) ((LCDC_OVR2CFG7_RKEY_Msk & ((value) << LCDC_OVR2CFG7_RKEY_Pos))) +/* -------- LCDC_OVR2CFG8 : (LCDC Offset: 0x0000028C) Overlay 2 Configuration Register 8 -------- */ +#define LCDC_OVR2CFG8_BMASK_Pos 0 +#define LCDC_OVR2CFG8_BMASK_Msk (0xffu << LCDC_OVR2CFG8_BMASK_Pos) /**< \brief (LCDC_OVR2CFG8) Blue Color Component Chroma Key Mask */ +#define LCDC_OVR2CFG8_BMASK(value) ((LCDC_OVR2CFG8_BMASK_Msk & ((value) << LCDC_OVR2CFG8_BMASK_Pos))) +#define LCDC_OVR2CFG8_GMASK_Pos 8 +#define LCDC_OVR2CFG8_GMASK_Msk (0xffu << LCDC_OVR2CFG8_GMASK_Pos) /**< \brief (LCDC_OVR2CFG8) Green Color Component Chroma Key Mask */ +#define LCDC_OVR2CFG8_GMASK(value) ((LCDC_OVR2CFG8_GMASK_Msk & ((value) << LCDC_OVR2CFG8_GMASK_Pos))) +#define LCDC_OVR2CFG8_RMASK_Pos 16 +#define LCDC_OVR2CFG8_RMASK_Msk (0xffu << LCDC_OVR2CFG8_RMASK_Pos) /**< \brief (LCDC_OVR2CFG8) Red Color Component Chroma Key Mask */ +#define LCDC_OVR2CFG8_RMASK(value) ((LCDC_OVR2CFG8_RMASK_Msk & ((value) << LCDC_OVR2CFG8_RMASK_Pos))) +/* -------- LCDC_OVR2CFG9 : (LCDC Offset: 0x00000290) Overlay 2 Configuration Register 8 -------- */ +#define LCDC_OVR2CFG9_CRKEY (0x1u << 0) /**< \brief (LCDC_OVR2CFG9) Blender Chroma Key Enable */ +#define LCDC_OVR2CFG9_INV (0x1u << 1) /**< \brief (LCDC_OVR2CFG9) Blender Inverted Blender Output Enable */ +#define LCDC_OVR2CFG9_ITER2BL (0x1u << 2) /**< \brief (LCDC_OVR2CFG9) Blender Iterated Color Enable */ +#define LCDC_OVR2CFG9_ITER (0x1u << 3) /**< \brief (LCDC_OVR2CFG9) Blender Use Iterated Color */ +#define LCDC_OVR2CFG9_REVALPHA (0x1u << 4) /**< \brief (LCDC_OVR2CFG9) Blender Reverse Alpha */ +#define LCDC_OVR2CFG9_GAEN (0x1u << 5) /**< \brief (LCDC_OVR2CFG9) Blender Global Alpha Enable */ +#define LCDC_OVR2CFG9_LAEN (0x1u << 6) /**< \brief (LCDC_OVR2CFG9) Blender Local Alpha Enable */ +#define LCDC_OVR2CFG9_OVR (0x1u << 7) /**< \brief (LCDC_OVR2CFG9) Blender Overlay Layer Enable */ +#define LCDC_OVR2CFG9_DMA (0x1u << 8) /**< \brief (LCDC_OVR2CFG9) Blender DMA Layer Enable */ +#define LCDC_OVR2CFG9_REP (0x1u << 9) /**< \brief (LCDC_OVR2CFG9) Use Replication logic to expand RGB color to 24 bits */ +#define LCDC_OVR2CFG9_DSTKEY (0x1u << 10) /**< \brief (LCDC_OVR2CFG9) Destination Chroma Keying */ +#define LCDC_OVR2CFG9_GA_Pos 16 +#define LCDC_OVR2CFG9_GA_Msk (0xffu << LCDC_OVR2CFG9_GA_Pos) /**< \brief (LCDC_OVR2CFG9) Blender Global Alpha */ +#define LCDC_OVR2CFG9_GA(value) ((LCDC_OVR2CFG9_GA_Msk & ((value) << LCDC_OVR2CFG9_GA_Pos))) +/* -------- LCDC_HEOCHER : (LCDC Offset: 0x00000340) High End Overlay Channel Enable Register -------- */ +#define LCDC_HEOCHER_CHEN (0x1u << 0) /**< \brief (LCDC_HEOCHER) Channel Enable Register */ +#define LCDC_HEOCHER_UPDATEEN (0x1u << 1) /**< \brief (LCDC_HEOCHER) Update Overlay Attributes Enable Register */ +#define LCDC_HEOCHER_A2QEN (0x1u << 2) /**< \brief (LCDC_HEOCHER) Add To Queue Enable Register */ +/* -------- LCDC_HEOCHDR : (LCDC Offset: 0x00000344) High End Overlay Channel Disable Register -------- */ +#define LCDC_HEOCHDR_CHDIS (0x1u << 0) /**< \brief (LCDC_HEOCHDR) Channel Disable Register */ +#define LCDC_HEOCHDR_CHRST (0x1u << 8) /**< \brief (LCDC_HEOCHDR) Channel Reset Register */ +/* -------- LCDC_HEOCHSR : (LCDC Offset: 0x00000348) High End Overlay Channel Status Register -------- */ +#define LCDC_HEOCHSR_CHSR (0x1u << 0) /**< \brief (LCDC_HEOCHSR) Channel Status Register */ +#define LCDC_HEOCHSR_UPDATESR (0x1u << 1) /**< \brief (LCDC_HEOCHSR) Update Overlay Attributes In Progress Status Register */ +#define LCDC_HEOCHSR_A2QSR (0x1u << 2) /**< \brief (LCDC_HEOCHSR) Add To Queue Status Register */ +/* -------- LCDC_HEOIER : (LCDC Offset: 0x0000034C) High End Overlay Interrupt Enable Register -------- */ +#define LCDC_HEOIER_DMA (0x1u << 2) /**< \brief (LCDC_HEOIER) End of DMA Transfer Interrupt Enable Register */ +#define LCDC_HEOIER_DSCR (0x1u << 3) /**< \brief (LCDC_HEOIER) Descriptor Loaded Interrupt Enable Register */ +#define LCDC_HEOIER_ADD (0x1u << 4) /**< \brief (LCDC_HEOIER) Head Descriptor Loaded Interrupt Enable Register */ +#define LCDC_HEOIER_DONE (0x1u << 5) /**< \brief (LCDC_HEOIER) End of List Interrupt Enable Register */ +#define LCDC_HEOIER_OVR (0x1u << 6) /**< \brief (LCDC_HEOIER) Overflow Interrupt Enable Register */ +#define LCDC_HEOIER_UDMA (0x1u << 10) /**< \brief (LCDC_HEOIER) End of DMA Transfer for U or UV Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_UDSCR (0x1u << 11) /**< \brief (LCDC_HEOIER) Descriptor Loaded for U or UV Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_UADD (0x1u << 12) /**< \brief (LCDC_HEOIER) Head Descriptor Loaded for U or UV Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_UDONE (0x1u << 13) /**< \brief (LCDC_HEOIER) End of List for U or UV Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_UOVR (0x1u << 14) /**< \brief (LCDC_HEOIER) Overflow for U or UV Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_VDMA (0x1u << 18) /**< \brief (LCDC_HEOIER) End of DMA for V Chrominance Transfer Interrupt Enable Register */ +#define LCDC_HEOIER_VDSCR (0x1u << 19) /**< \brief (LCDC_HEOIER) Descriptor Loaded for V Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_VADD (0x1u << 20) /**< \brief (LCDC_HEOIER) Head Descriptor Loaded for V Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_VDONE (0x1u << 21) /**< \brief (LCDC_HEOIER) End of List for V Chrominance Interrupt Enable Register */ +#define LCDC_HEOIER_VOVR (0x1u << 22) /**< \brief (LCDC_HEOIER) Overflow for V Chrominance Interrupt Enable Register */ +/* -------- LCDC_HEOIDR : (LCDC Offset: 0x00000350) High End Overlay Interrupt Disable Register -------- */ +#define LCDC_HEOIDR_DMA (0x1u << 2) /**< \brief (LCDC_HEOIDR) End of DMA Transfer Interrupt Disable Register */ +#define LCDC_HEOIDR_DSCR (0x1u << 3) /**< \brief (LCDC_HEOIDR) Descriptor Loaded Interrupt Disable Register */ +#define LCDC_HEOIDR_ADD (0x1u << 4) /**< \brief (LCDC_HEOIDR) Head Descriptor Loaded Interrupt Disable Register */ +#define LCDC_HEOIDR_DONE (0x1u << 5) /**< \brief (LCDC_HEOIDR) End of List Interrupt Disable Register */ +#define LCDC_HEOIDR_OVR (0x1u << 6) /**< \brief (LCDC_HEOIDR) Overflow Interrupt Disable Register */ +#define LCDC_HEOIDR_UDMA (0x1u << 10) /**< \brief (LCDC_HEOIDR) End of DMA Transfer for U or UV Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_UDSCR (0x1u << 11) /**< \brief (LCDC_HEOIDR) Descriptor Loaded for U or UV Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_UADD (0x1u << 12) /**< \brief (LCDC_HEOIDR) Head Descriptor Loaded for U or UV Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_UDONE (0x1u << 13) /**< \brief (LCDC_HEOIDR) End of List Interrupt for U or UV Chrominance Component Disable Register */ +#define LCDC_HEOIDR_UOVR (0x1u << 14) /**< \brief (LCDC_HEOIDR) Overflow Interrupt for U or UV Chrominance Component Disable Register */ +#define LCDC_HEOIDR_VDMA (0x1u << 18) /**< \brief (LCDC_HEOIDR) End of DMA Transfer for V Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_VDSCR (0x1u << 19) /**< \brief (LCDC_HEOIDR) Descriptor Loaded for V Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_VADD (0x1u << 20) /**< \brief (LCDC_HEOIDR) Head Descriptor Loaded for V Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_VDONE (0x1u << 21) /**< \brief (LCDC_HEOIDR) End of List for V Chrominance Component Interrupt Disable Register */ +#define LCDC_HEOIDR_VOVR (0x1u << 22) /**< \brief (LCDC_HEOIDR) Overflow for V Chrominance Component Interrupt Disable Register */ +/* -------- LCDC_HEOIMR : (LCDC Offset: 0x00000354) High End Overlay Interrupt Mask Register -------- */ +#define LCDC_HEOIMR_DMA (0x1u << 2) /**< \brief (LCDC_HEOIMR) End of DMA Transfer Interrupt Mask Register */ +#define LCDC_HEOIMR_DSCR (0x1u << 3) /**< \brief (LCDC_HEOIMR) Descriptor Loaded Interrupt Mask Register */ +#define LCDC_HEOIMR_ADD (0x1u << 4) /**< \brief (LCDC_HEOIMR) Head Descriptor Loaded Interrupt Mask Register */ +#define LCDC_HEOIMR_DONE (0x1u << 5) /**< \brief (LCDC_HEOIMR) End of List Interrupt Mask Register */ +#define LCDC_HEOIMR_OVR (0x1u << 6) /**< \brief (LCDC_HEOIMR) Overflow Interrupt Mask Register */ +#define LCDC_HEOIMR_UDMA (0x1u << 10) /**< \brief (LCDC_HEOIMR) End of DMA Transfer for U or UV Chrominance Component Interrupt Mask Register */ +#define LCDC_HEOIMR_UDSCR (0x1u << 11) /**< \brief (LCDC_HEOIMR) Descriptor Loaded for U or UV Chrominance Component Interrupt Mask Register */ +#define LCDC_HEOIMR_UADD (0x1u << 12) /**< \brief (LCDC_HEOIMR) Head Descriptor Loaded for U or UV Chrominance Component Mask Register */ +#define LCDC_HEOIMR_UDONE (0x1u << 13) /**< \brief (LCDC_HEOIMR) End of List for U or UV Chrominance Component Mask Register */ +#define LCDC_HEOIMR_UOVR (0x1u << 14) /**< \brief (LCDC_HEOIMR) Overflow for U Chrominance Interrupt Mask Register */ +#define LCDC_HEOIMR_VDMA (0x1u << 18) /**< \brief (LCDC_HEOIMR) End of DMA Transfer for V Chrominance Component Interrupt Mask Register */ +#define LCDC_HEOIMR_VDSCR (0x1u << 19) /**< \brief (LCDC_HEOIMR) Descriptor Loaded for V Chrominance Component Interrupt Mask Register */ +#define LCDC_HEOIMR_VADD (0x1u << 20) /**< \brief (LCDC_HEOIMR) Head Descriptor Loaded for V Chrominance Component Mask Register */ +#define LCDC_HEOIMR_VDONE (0x1u << 21) /**< \brief (LCDC_HEOIMR) End of List for V Chrominance Component Mask Register */ +#define LCDC_HEOIMR_VOVR (0x1u << 22) /**< \brief (LCDC_HEOIMR) Overflow for V Chrominance Interrupt Mask Register */ +/* -------- LCDC_HEOISR : (LCDC Offset: 0x00000358) High End Overlay Interrupt Status Register -------- */ +#define LCDC_HEOISR_DMA (0x1u << 2) /**< \brief (LCDC_HEOISR) End of DMA Transfer */ +#define LCDC_HEOISR_DSCR (0x1u << 3) /**< \brief (LCDC_HEOISR) DMA Descriptor Loaded */ +#define LCDC_HEOISR_ADD (0x1u << 4) /**< \brief (LCDC_HEOISR) Head Descriptor Loaded */ +#define LCDC_HEOISR_DONE (0x1u << 5) /**< \brief (LCDC_HEOISR) End of List Detected */ +#define LCDC_HEOISR_OVR (0x1u << 6) /**< \brief (LCDC_HEOISR) Overflow Detected */ +#define LCDC_HEOISR_UDMA (0x1u << 10) /**< \brief (LCDC_HEOISR) End of DMA Transfer for U Component */ +#define LCDC_HEOISR_UDSCR (0x1u << 11) /**< \brief (LCDC_HEOISR) DMA Descriptor Loaded for U Component */ +#define LCDC_HEOISR_UADD (0x1u << 12) /**< \brief (LCDC_HEOISR) Head Descriptor Loaded for U Component */ +#define LCDC_HEOISR_UDONE (0x1u << 13) /**< \brief (LCDC_HEOISR) End of List Detected for U Component */ +#define LCDC_HEOISR_UOVR (0x1u << 14) /**< \brief (LCDC_HEOISR) Overflow Detected for U Component */ +#define LCDC_HEOISR_VDMA (0x1u << 18) /**< \brief (LCDC_HEOISR) End of DMA Transfer for V Component */ +#define LCDC_HEOISR_VDSCR (0x1u << 19) /**< \brief (LCDC_HEOISR) DMA Descriptor Loaded for V Component */ +#define LCDC_HEOISR_VADD (0x1u << 20) /**< \brief (LCDC_HEOISR) Head Descriptor Loaded for V Component */ +#define LCDC_HEOISR_VDONE (0x1u << 21) /**< \brief (LCDC_HEOISR) End of List Detected for V Component */ +#define LCDC_HEOISR_VOVR (0x1u << 22) /**< \brief (LCDC_HEOISR) Overflow Detected for V Component */ +/* -------- LCDC_HEOHEAD : (LCDC Offset: 0x0000035C) High End Overlay DMA Head Register -------- */ +#define LCDC_HEOHEAD_HEAD_Pos 2 +#define LCDC_HEOHEAD_HEAD_Msk (0x3fffffffu << LCDC_HEOHEAD_HEAD_Pos) /**< \brief (LCDC_HEOHEAD) DMA Head Pointer */ +#define LCDC_HEOHEAD_HEAD(value) ((LCDC_HEOHEAD_HEAD_Msk & ((value) << LCDC_HEOHEAD_HEAD_Pos))) +/* -------- LCDC_HEOADDR : (LCDC Offset: 0x00000360) High End Overlay DMA Address Register -------- */ +#define LCDC_HEOADDR_ADDR_Pos 0 +#define LCDC_HEOADDR_ADDR_Msk (0xffffffffu << LCDC_HEOADDR_ADDR_Pos) /**< \brief (LCDC_HEOADDR) DMA Transfer start Address */ +#define LCDC_HEOADDR_ADDR(value) ((LCDC_HEOADDR_ADDR_Msk & ((value) << LCDC_HEOADDR_ADDR_Pos))) +/* -------- LCDC_HEOCTRL : (LCDC Offset: 0x00000364) High End Overlay DMA Control Register -------- */ +#define LCDC_HEOCTRL_DFETCH (0x1u << 0) /**< \brief (LCDC_HEOCTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_HEOCTRL_LFETCH (0x1u << 1) /**< \brief (LCDC_HEOCTRL) Lookup Table Fetch Enable */ +#define LCDC_HEOCTRL_DMAIEN (0x1u << 2) /**< \brief (LCDC_HEOCTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_HEOCTRL_DSCRIEN (0x1u << 3) /**< \brief (LCDC_HEOCTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_HEOCTRL_ADDIEN (0x1u << 4) /**< \brief (LCDC_HEOCTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_HEOCTRL_DONEIEN (0x1u << 5) /**< \brief (LCDC_HEOCTRL) End of List Interrupt Enable */ +/* -------- LCDC_HEONEXT : (LCDC Offset: 0x00000368) High End Overlay DMA Next Register -------- */ +#define LCDC_HEONEXT_NEXT_Pos 0 +#define LCDC_HEONEXT_NEXT_Msk (0xffffffffu << LCDC_HEONEXT_NEXT_Pos) /**< \brief (LCDC_HEONEXT) DMA Descriptor Next Address */ +#define LCDC_HEONEXT_NEXT(value) ((LCDC_HEONEXT_NEXT_Msk & ((value) << LCDC_HEONEXT_NEXT_Pos))) +/* -------- LCDC_HEOUHEAD : (LCDC Offset: 0x0000036C) High End Overlay U-UV DMA Head Register -------- */ +#define LCDC_HEOUHEAD_UHEAD_Pos 0 +#define LCDC_HEOUHEAD_UHEAD_Msk (0xffffffffu << LCDC_HEOUHEAD_UHEAD_Pos) /**< \brief (LCDC_HEOUHEAD) DMA Head Pointer */ +#define LCDC_HEOUHEAD_UHEAD(value) ((LCDC_HEOUHEAD_UHEAD_Msk & ((value) << LCDC_HEOUHEAD_UHEAD_Pos))) +/* -------- LCDC_HEOUADDR : (LCDC Offset: 0x00000370) High End Overlay U-UV DMA Address Register -------- */ +#define LCDC_HEOUADDR_UADDR_Pos 0 +#define LCDC_HEOUADDR_UADDR_Msk (0xffffffffu << LCDC_HEOUADDR_UADDR_Pos) /**< \brief (LCDC_HEOUADDR) DMA Transfer Start Address for U or UV Chrominance */ +#define LCDC_HEOUADDR_UADDR(value) ((LCDC_HEOUADDR_UADDR_Msk & ((value) << LCDC_HEOUADDR_UADDR_Pos))) +/* -------- LCDC_HEOUCTRL : (LCDC Offset: 0x00000374) High End Overlay U-UV DMA Control Register -------- */ +#define LCDC_HEOUCTRL_UDFETCH (0x1u << 0) /**< \brief (LCDC_HEOUCTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_HEOUCTRL_UDMAIEN (0x1u << 2) /**< \brief (LCDC_HEOUCTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_HEOUCTRL_UDSCRIEN (0x1u << 3) /**< \brief (LCDC_HEOUCTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_HEOUCTRL_UADDIEN (0x1u << 4) /**< \brief (LCDC_HEOUCTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_HEOUCTRL_UDONEIEN (0x1u << 5) /**< \brief (LCDC_HEOUCTRL) End of List Interrupt Enable */ +/* -------- LCDC_HEOUNEXT : (LCDC Offset: 0x00000378) High End Overlay U-UV DMA Next Register -------- */ +#define LCDC_HEOUNEXT_UNEXT_Pos 0 +#define LCDC_HEOUNEXT_UNEXT_Msk (0xffffffffu << LCDC_HEOUNEXT_UNEXT_Pos) /**< \brief (LCDC_HEOUNEXT) DMA Descriptor Next Address */ +#define LCDC_HEOUNEXT_UNEXT(value) ((LCDC_HEOUNEXT_UNEXT_Msk & ((value) << LCDC_HEOUNEXT_UNEXT_Pos))) +/* -------- LCDC_HEOVHEAD : (LCDC Offset: 0x0000037C) High End Overlay V DMA Head Register -------- */ +#define LCDC_HEOVHEAD_VHEAD_Pos 0 +#define LCDC_HEOVHEAD_VHEAD_Msk (0xffffffffu << LCDC_HEOVHEAD_VHEAD_Pos) /**< \brief (LCDC_HEOVHEAD) DMA Head Pointer */ +#define LCDC_HEOVHEAD_VHEAD(value) ((LCDC_HEOVHEAD_VHEAD_Msk & ((value) << LCDC_HEOVHEAD_VHEAD_Pos))) +/* -------- LCDC_HEOVADDR : (LCDC Offset: 0x00000380) High End Overlay V DMA Address Register -------- */ +#define LCDC_HEOVADDR_VADDR_Pos 0 +#define LCDC_HEOVADDR_VADDR_Msk (0xffffffffu << LCDC_HEOVADDR_VADDR_Pos) /**< \brief (LCDC_HEOVADDR) DMA Transfer Start Address for V Chrominance */ +#define LCDC_HEOVADDR_VADDR(value) ((LCDC_HEOVADDR_VADDR_Msk & ((value) << LCDC_HEOVADDR_VADDR_Pos))) +/* -------- LCDC_HEOVCTRL : (LCDC Offset: 0x00000384) High End Overlay V DMA Control Register -------- */ +#define LCDC_HEOVCTRL_VDFETCH (0x1u << 0) /**< \brief (LCDC_HEOVCTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_HEOVCTRL_VDMAIEN (0x1u << 2) /**< \brief (LCDC_HEOVCTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_HEOVCTRL_VDSCRIEN (0x1u << 3) /**< \brief (LCDC_HEOVCTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_HEOVCTRL_VADDIEN (0x1u << 4) /**< \brief (LCDC_HEOVCTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_HEOVCTRL_VDONEIEN (0x1u << 5) /**< \brief (LCDC_HEOVCTRL) End of List Interrupt Enable */ +/* -------- LCDC_HEOVNEXT : (LCDC Offset: 0x00000388) High End Overlay V DMA Next Register -------- */ +#define LCDC_HEOVNEXT_VNEXT_Pos 0 +#define LCDC_HEOVNEXT_VNEXT_Msk (0xffffffffu << LCDC_HEOVNEXT_VNEXT_Pos) /**< \brief (LCDC_HEOVNEXT) DMA Descriptor Next Address */ +#define LCDC_HEOVNEXT_VNEXT(value) ((LCDC_HEOVNEXT_VNEXT_Msk & ((value) << LCDC_HEOVNEXT_VNEXT_Pos))) +/* -------- LCDC_HEOCFG0 : (LCDC Offset: 0x0000038C) High End Overlay Configuration Register 0 -------- */ +#define LCDC_HEOCFG0_SIF (0x1u << 0) /**< \brief (LCDC_HEOCFG0) Source Interface */ +#define LCDC_HEOCFG0_BLEN_Pos 4 +#define LCDC_HEOCFG0_BLEN_Msk (0x3u << LCDC_HEOCFG0_BLEN_Pos) /**< \brief (LCDC_HEOCFG0) AHB Burst Length */ +#define LCDC_HEOCFG0_BLEN(value) ((LCDC_HEOCFG0_BLEN_Msk & ((value) << LCDC_HEOCFG0_BLEN_Pos))) +#define LCDC_HEOCFG0_BLEN_AHB_BLEN_SINGLE (0x0u << 4) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store one data. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLEN_AHB_BLEN_INCR4 (0x1u << 4) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 4 data. An AHB INCR4 Burst is used. SINGLE, INCR and INCR4 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLEN_AHB_BLEN_INCR8 (0x2u << 4) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 8 data. An AHB INCR8 Burst is used. SINGLE, INCR, INCR4 and INCR8 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLEN_AHB_BLEN_INCR16 (0x3u << 4) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 16 data. An AHB INCR16 Burst is used. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLENUV_Pos 6 +#define LCDC_HEOCFG0_BLENUV_Msk (0x3u << LCDC_HEOCFG0_BLENUV_Pos) /**< \brief (LCDC_HEOCFG0) AHB Burst Length for U-V channel */ +#define LCDC_HEOCFG0_BLENUV(value) ((LCDC_HEOCFG0_BLENUV_Msk & ((value) << LCDC_HEOCFG0_BLENUV_Pos))) +#define LCDC_HEOCFG0_BLENUV_AHB_SINGLE (0x0u << 6) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store one data. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLENUV_AHB_INCR4 (0x1u << 6) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 4 data. An AHB INCR4 Burst is used. SINGLE, INCR and INCR4 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLENUV_AHB_INCR8 (0x2u << 6) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 8 data. An AHB INCR8 Burst is used. SINGLE, INCR, INCR4 and INCR8 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_BLENUV_AHB_INCR16 (0x3u << 6) /**< \brief (LCDC_HEOCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 16 data. An AHB INCR16 Burst is used. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_HEOCFG0_DLBO (0x1u << 8) /**< \brief (LCDC_HEOCFG0) Defined Length Burst Only For Channel Bus Transaction. */ +#define LCDC_HEOCFG0_ROTDIS (0x1u << 12) /**< \brief (LCDC_HEOCFG0) Hardware Rotation Optimization Disable */ +#define LCDC_HEOCFG0_LOCKDIS (0x1u << 13) /**< \brief (LCDC_HEOCFG0) Hardware Rotation Lock Disable */ +/* -------- LCDC_HEOCFG1 : (LCDC Offset: 0x00000390) High End Overlay Configuration Register 1 -------- */ +#define LCDC_HEOCFG1_CLUTEN (0x1u << 0) /**< \brief (LCDC_HEOCFG1) Color Lookup Table Mode Enable */ +#define LCDC_HEOCFG1_YUVEN (0x1u << 1) /**< \brief (LCDC_HEOCFG1) YUV Color Space Enable */ +#define LCDC_HEOCFG1_RGBMODE_Pos 4 +#define LCDC_HEOCFG1_RGBMODE_Msk (0xfu << LCDC_HEOCFG1_RGBMODE_Pos) /**< \brief (LCDC_HEOCFG1) RGB Mode Input selection */ +#define LCDC_HEOCFG1_RGBMODE(value) ((LCDC_HEOCFG1_RGBMODE_Msk & ((value) << LCDC_HEOCFG1_RGBMODE_Pos))) +#define LCDC_HEOCFG1_RGBMODE_12BPP_RGB_444 (0x0u << 4) /**< \brief (LCDC_HEOCFG1) 12 bpp RGB 444 */ +#define LCDC_HEOCFG1_RGBMODE_16BPP_ARGB_4444 (0x1u << 4) /**< \brief (LCDC_HEOCFG1) 16 bpp ARGB 4444 */ +#define LCDC_HEOCFG1_RGBMODE_16BPP_RGBA_4444 (0x2u << 4) /**< \brief (LCDC_HEOCFG1) 16 bpp RGBA 4444 */ +#define LCDC_HEOCFG1_RGBMODE_16BPP_RGB_565 (0x3u << 4) /**< \brief (LCDC_HEOCFG1) 16 bpp RGB 565 */ +#define LCDC_HEOCFG1_RGBMODE_16BPP_TRGB_1555 (0x4u << 4) /**< \brief (LCDC_HEOCFG1) 16 bpp TRGB 1555 */ +#define LCDC_HEOCFG1_RGBMODE_18BPP_RGB_666 (0x5u << 4) /**< \brief (LCDC_HEOCFG1) 18 bpp RGB 666 */ +#define LCDC_HEOCFG1_RGBMODE_18BPP_RGB_666PACKED (0x6u << 4) /**< \brief (LCDC_HEOCFG1) 18 bpp RGB 666 PACKED */ +#define LCDC_HEOCFG1_RGBMODE_19BPP_TRGB_1666 (0x7u << 4) /**< \brief (LCDC_HEOCFG1) 19 bpp TRGB 1666 */ +#define LCDC_HEOCFG1_RGBMODE_19BPP_TRGB_PACKED (0x8u << 4) /**< \brief (LCDC_HEOCFG1) 19 bpp TRGB 1666 PACKED */ +#define LCDC_HEOCFG1_RGBMODE_24BPP_RGB_888 (0x9u << 4) /**< \brief (LCDC_HEOCFG1) 24 bpp RGB 888 */ +#define LCDC_HEOCFG1_RGBMODE_24BPP_RGB_888_PACKED (0xAu << 4) /**< \brief (LCDC_HEOCFG1) 24 bpp RGB 888 PACKED */ +#define LCDC_HEOCFG1_RGBMODE_25BPP_TRGB_1888 (0xBu << 4) /**< \brief (LCDC_HEOCFG1) 25 bpp TRGB 1888 */ +#define LCDC_HEOCFG1_RGBMODE_32BPP_ARGB_8888 (0xCu << 4) /**< \brief (LCDC_HEOCFG1) 32 bpp ARGB 8888 */ +#define LCDC_HEOCFG1_RGBMODE_32BPP_RGBA_8888 (0xDu << 4) /**< \brief (LCDC_HEOCFG1) 32 bpp RGBA 8888 */ +#define LCDC_HEOCFG1_CLUTMODE_Pos 8 +#define LCDC_HEOCFG1_CLUTMODE_Msk (0x3u << LCDC_HEOCFG1_CLUTMODE_Pos) /**< \brief (LCDC_HEOCFG1) Color Lookup Table Mode Input Selection */ +#define LCDC_HEOCFG1_CLUTMODE(value) ((LCDC_HEOCFG1_CLUTMODE_Msk & ((value) << LCDC_HEOCFG1_CLUTMODE_Pos))) +#define LCDC_HEOCFG1_CLUTMODE_CLUT_1BPP (0x0u << 8) /**< \brief (LCDC_HEOCFG1) Color Lookup Table mode set to 1 bit per pixel */ +#define LCDC_HEOCFG1_CLUTMODE_CLUT_2BPP (0x1u << 8) /**< \brief (LCDC_HEOCFG1) Color Lookup Table mode set to 2 bits per pixel */ +#define LCDC_HEOCFG1_CLUTMODE_CLUT_4BPP (0x2u << 8) /**< \brief (LCDC_HEOCFG1) Color Lookup Table mode set to 4 bits per pixel */ +#define LCDC_HEOCFG1_CLUTMODE_CLUT_8BPP (0x3u << 8) /**< \brief (LCDC_HEOCFG1) Color Lookup Table mode set to 8 bits per pixel */ +#define LCDC_HEOCFG1_YUVMODE_Pos 12 +#define LCDC_HEOCFG1_YUVMODE_Msk (0xfu << LCDC_HEOCFG1_YUVMODE_Pos) /**< \brief (LCDC_HEOCFG1) YUV Mode Input Selection */ +#define LCDC_HEOCFG1_YUVMODE(value) ((LCDC_HEOCFG1_YUVMODE_Msk & ((value) << LCDC_HEOCFG1_YUVMODE_Pos))) +#define LCDC_HEOCFG1_YUVMODE_32BPP_AYCBCR (0x0u << 12) /**< \brief (LCDC_HEOCFG1) 32 bpp AYCbCr 444 */ +#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE0 (0x1u << 12) /**< \brief (LCDC_HEOCFG1) 16 bpp Cr(n)Y(n+1)Cb(n)Y(n) 422 */ +#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE1 (0x2u << 12) /**< \brief (LCDC_HEOCFG1) 16 bpp Y(n+1)Cr(n)Y(n)Cb(n) 422 */ +#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE2 (0x3u << 12) /**< \brief (LCDC_HEOCFG1) 16 bpp Cb(n)Y(+1)Cr(n)Y(n) 422 */ +#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE3 (0x4u << 12) /**< \brief (LCDC_HEOCFG1) 16 bpp Y(n+1)Cb(n)Y(n)Cr(n) 422 */ +#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_SEMIPLANAR (0x5u << 12) /**< \brief (LCDC_HEOCFG1) 16 bpp Semiplanar 422 YCbCr */ +#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_PLANAR (0x6u << 12) /**< \brief (LCDC_HEOCFG1) 16 bpp Planar 422 YCbCr */ +#define LCDC_HEOCFG1_YUVMODE_12BPP_YCBCR_SEMIPLANAR (0x7u << 12) /**< \brief (LCDC_HEOCFG1) 12 bpp Semiplanar 420 YCbCr */ +#define LCDC_HEOCFG1_YUVMODE_12BPP_YCBCR_PLANAR (0x8u << 12) /**< \brief (LCDC_HEOCFG1) 12 bpp Planar 420 YCbCr */ +#define LCDC_HEOCFG1_YUV422ROT (0x1u << 16) /**< \brief (LCDC_HEOCFG1) YUV 4:2:2 Rotation */ +#define LCDC_HEOCFG1_YUV422SWP (0x1u << 17) /**< \brief (LCDC_HEOCFG1) YUV 4:2:2 Swap */ +#define LCDC_HEOCFG1_DSCALEOPT (0x1u << 20) /**< \brief (LCDC_HEOCFG1) Down Scaling Bandwidth Optimization */ +/* -------- LCDC_HEOCFG2 : (LCDC Offset: 0x00000394) High End Overlay Configuration Register 2 -------- */ +#define LCDC_HEOCFG2_XPOS_Pos 0 +#define LCDC_HEOCFG2_XPOS_Msk (0x7ffu << LCDC_HEOCFG2_XPOS_Pos) /**< \brief (LCDC_HEOCFG2) Horizontal Window Position */ +#define LCDC_HEOCFG2_XPOS(value) ((LCDC_HEOCFG2_XPOS_Msk & ((value) << LCDC_HEOCFG2_XPOS_Pos))) +#define LCDC_HEOCFG2_YPOS_Pos 16 +#define LCDC_HEOCFG2_YPOS_Msk (0x7ffu << LCDC_HEOCFG2_YPOS_Pos) /**< \brief (LCDC_HEOCFG2) Vertical Window Position */ +#define LCDC_HEOCFG2_YPOS(value) ((LCDC_HEOCFG2_YPOS_Msk & ((value) << LCDC_HEOCFG2_YPOS_Pos))) +/* -------- LCDC_HEOCFG3 : (LCDC Offset: 0x00000398) High End Overlay Configuration Register 3 -------- */ +#define LCDC_HEOCFG3_XSIZE_Pos 0 +#define LCDC_HEOCFG3_XSIZE_Msk (0x7ffu << LCDC_HEOCFG3_XSIZE_Pos) /**< \brief (LCDC_HEOCFG3) Horizontal Window Size */ +#define LCDC_HEOCFG3_XSIZE(value) ((LCDC_HEOCFG3_XSIZE_Msk & ((value) << LCDC_HEOCFG3_XSIZE_Pos))) +#define LCDC_HEOCFG3_YSIZE_Pos 16 +#define LCDC_HEOCFG3_YSIZE_Msk (0x7ffu << LCDC_HEOCFG3_YSIZE_Pos) /**< \brief (LCDC_HEOCFG3) Vertical Window Size */ +#define LCDC_HEOCFG3_YSIZE(value) ((LCDC_HEOCFG3_YSIZE_Msk & ((value) << LCDC_HEOCFG3_YSIZE_Pos))) +/* -------- LCDC_HEOCFG4 : (LCDC Offset: 0x0000039C) High End Overlay Configuration Register 4 -------- */ +#define LCDC_HEOCFG4_XMEMSIZE_Pos 0 +#define LCDC_HEOCFG4_XMEMSIZE_Msk (0x7ffu << LCDC_HEOCFG4_XMEMSIZE_Pos) /**< \brief (LCDC_HEOCFG4) Horizontal image Size in Memory */ +#define LCDC_HEOCFG4_XMEMSIZE(value) ((LCDC_HEOCFG4_XMEMSIZE_Msk & ((value) << LCDC_HEOCFG4_XMEMSIZE_Pos))) +#define LCDC_HEOCFG4_YMEMSIZE_Pos 16 +#define LCDC_HEOCFG4_YMEMSIZE_Msk (0x7ffu << LCDC_HEOCFG4_YMEMSIZE_Pos) /**< \brief (LCDC_HEOCFG4) Vertical image Size in Memory */ +#define LCDC_HEOCFG4_YMEMSIZE(value) ((LCDC_HEOCFG4_YMEMSIZE_Msk & ((value) << LCDC_HEOCFG4_YMEMSIZE_Pos))) +/* -------- LCDC_HEOCFG5 : (LCDC Offset: 0x000003A0) High End Overlay Configuration Register 5 -------- */ +#define LCDC_HEOCFG5_XSTRIDE_Pos 0 +#define LCDC_HEOCFG5_XSTRIDE_Msk (0xffffffffu << LCDC_HEOCFG5_XSTRIDE_Pos) /**< \brief (LCDC_HEOCFG5) Horizontal Stride */ +#define LCDC_HEOCFG5_XSTRIDE(value) ((LCDC_HEOCFG5_XSTRIDE_Msk & ((value) << LCDC_HEOCFG5_XSTRIDE_Pos))) +/* -------- LCDC_HEOCFG6 : (LCDC Offset: 0x000003A4) High End Overlay Configuration Register 6 -------- */ +#define LCDC_HEOCFG6_PSTRIDE_Pos 0 +#define LCDC_HEOCFG6_PSTRIDE_Msk (0xffffffffu << LCDC_HEOCFG6_PSTRIDE_Pos) /**< \brief (LCDC_HEOCFG6) Pixel Stride */ +#define LCDC_HEOCFG6_PSTRIDE(value) ((LCDC_HEOCFG6_PSTRIDE_Msk & ((value) << LCDC_HEOCFG6_PSTRIDE_Pos))) +/* -------- LCDC_HEOCFG7 : (LCDC Offset: 0x000003A8) High End Overlay Configuration Register 7 -------- */ +#define LCDC_HEOCFG7_UVXSTRIDE_Pos 0 +#define LCDC_HEOCFG7_UVXSTRIDE_Msk (0xffffffffu << LCDC_HEOCFG7_UVXSTRIDE_Pos) /**< \brief (LCDC_HEOCFG7) UV Horizontal Stride */ +#define LCDC_HEOCFG7_UVXSTRIDE(value) ((LCDC_HEOCFG7_UVXSTRIDE_Msk & ((value) << LCDC_HEOCFG7_UVXSTRIDE_Pos))) +/* -------- LCDC_HEOCFG8 : (LCDC Offset: 0x000003AC) High End Overlay Configuration Register 8 -------- */ +#define LCDC_HEOCFG8_UVPSTRIDE_Pos 0 +#define LCDC_HEOCFG8_UVPSTRIDE_Msk (0xffffffffu << LCDC_HEOCFG8_UVPSTRIDE_Pos) /**< \brief (LCDC_HEOCFG8) UV Pixel Stride */ +#define LCDC_HEOCFG8_UVPSTRIDE(value) ((LCDC_HEOCFG8_UVPSTRIDE_Msk & ((value) << LCDC_HEOCFG8_UVPSTRIDE_Pos))) +/* -------- LCDC_HEOCFG9 : (LCDC Offset: 0x000003B0) High End Overlay Configuration Register 9 -------- */ +#define LCDC_HEOCFG9_BDEF_Pos 0 +#define LCDC_HEOCFG9_BDEF_Msk (0xffu << LCDC_HEOCFG9_BDEF_Pos) /**< \brief (LCDC_HEOCFG9) Blue Default */ +#define LCDC_HEOCFG9_BDEF(value) ((LCDC_HEOCFG9_BDEF_Msk & ((value) << LCDC_HEOCFG9_BDEF_Pos))) +#define LCDC_HEOCFG9_GDEF_Pos 8 +#define LCDC_HEOCFG9_GDEF_Msk (0xffu << LCDC_HEOCFG9_GDEF_Pos) /**< \brief (LCDC_HEOCFG9) Green Default */ +#define LCDC_HEOCFG9_GDEF(value) ((LCDC_HEOCFG9_GDEF_Msk & ((value) << LCDC_HEOCFG9_GDEF_Pos))) +#define LCDC_HEOCFG9_RDEF_Pos 16 +#define LCDC_HEOCFG9_RDEF_Msk (0xffu << LCDC_HEOCFG9_RDEF_Pos) /**< \brief (LCDC_HEOCFG9) Red Default */ +#define LCDC_HEOCFG9_RDEF(value) ((LCDC_HEOCFG9_RDEF_Msk & ((value) << LCDC_HEOCFG9_RDEF_Pos))) +/* -------- LCDC_HEOCFG10 : (LCDC Offset: 0x000003B4) High End Overlay Configuration Register 10 -------- */ +#define LCDC_HEOCFG10_BKEY_Pos 0 +#define LCDC_HEOCFG10_BKEY_Msk (0xffu << LCDC_HEOCFG10_BKEY_Pos) /**< \brief (LCDC_HEOCFG10) Blue Color Component Chroma Key */ +#define LCDC_HEOCFG10_BKEY(value) ((LCDC_HEOCFG10_BKEY_Msk & ((value) << LCDC_HEOCFG10_BKEY_Pos))) +#define LCDC_HEOCFG10_GKEY_Pos 8 +#define LCDC_HEOCFG10_GKEY_Msk (0xffu << LCDC_HEOCFG10_GKEY_Pos) /**< \brief (LCDC_HEOCFG10) Green Color Component Chroma Key */ +#define LCDC_HEOCFG10_GKEY(value) ((LCDC_HEOCFG10_GKEY_Msk & ((value) << LCDC_HEOCFG10_GKEY_Pos))) +#define LCDC_HEOCFG10_RKEY_Pos 16 +#define LCDC_HEOCFG10_RKEY_Msk (0xffu << LCDC_HEOCFG10_RKEY_Pos) /**< \brief (LCDC_HEOCFG10) Red Color Component Chroma Key */ +#define LCDC_HEOCFG10_RKEY(value) ((LCDC_HEOCFG10_RKEY_Msk & ((value) << LCDC_HEOCFG10_RKEY_Pos))) +/* -------- LCDC_HEOCFG11 : (LCDC Offset: 0x000003B8) High End Overlay Configuration Register 11 -------- */ +#define LCDC_HEOCFG11_BMASK_Pos 0 +#define LCDC_HEOCFG11_BMASK_Msk (0xffu << LCDC_HEOCFG11_BMASK_Pos) /**< \brief (LCDC_HEOCFG11) Blue Color Component Chroma Key Mask */ +#define LCDC_HEOCFG11_BMASK(value) ((LCDC_HEOCFG11_BMASK_Msk & ((value) << LCDC_HEOCFG11_BMASK_Pos))) +#define LCDC_HEOCFG11_GMASK_Pos 8 +#define LCDC_HEOCFG11_GMASK_Msk (0xffu << LCDC_HEOCFG11_GMASK_Pos) /**< \brief (LCDC_HEOCFG11) Green Color Component Chroma Key Mask */ +#define LCDC_HEOCFG11_GMASK(value) ((LCDC_HEOCFG11_GMASK_Msk & ((value) << LCDC_HEOCFG11_GMASK_Pos))) +#define LCDC_HEOCFG11_RMASK_Pos 16 +#define LCDC_HEOCFG11_RMASK_Msk (0xffu << LCDC_HEOCFG11_RMASK_Pos) /**< \brief (LCDC_HEOCFG11) Red Color Component Chroma Key Mask */ +#define LCDC_HEOCFG11_RMASK(value) ((LCDC_HEOCFG11_RMASK_Msk & ((value) << LCDC_HEOCFG11_RMASK_Pos))) +/* -------- LCDC_HEOCFG12 : (LCDC Offset: 0x000003BC) High End Overlay Configuration Register 12 -------- */ +#define LCDC_HEOCFG12_CRKEY (0x1u << 0) /**< \brief (LCDC_HEOCFG12) Blender Chroma Key Enable */ +#define LCDC_HEOCFG12_INV (0x1u << 1) /**< \brief (LCDC_HEOCFG12) Blender Inverted Blender Output Enable */ +#define LCDC_HEOCFG12_ITER2BL (0x1u << 2) /**< \brief (LCDC_HEOCFG12) Blender Iterated Color Enable */ +#define LCDC_HEOCFG12_ITER (0x1u << 3) /**< \brief (LCDC_HEOCFG12) Blender Use Iterated Color */ +#define LCDC_HEOCFG12_REVALPHA (0x1u << 4) /**< \brief (LCDC_HEOCFG12) Blender Reverse Alpha */ +#define LCDC_HEOCFG12_GAEN (0x1u << 5) /**< \brief (LCDC_HEOCFG12) Blender Global Alpha Enable */ +#define LCDC_HEOCFG12_LAEN (0x1u << 6) /**< \brief (LCDC_HEOCFG12) Blender Local Alpha Enable */ +#define LCDC_HEOCFG12_OVR (0x1u << 7) /**< \brief (LCDC_HEOCFG12) Blender Overlay Layer Enable */ +#define LCDC_HEOCFG12_DMA (0x1u << 8) /**< \brief (LCDC_HEOCFG12) Blender DMA Layer Enable */ +#define LCDC_HEOCFG12_REP (0x1u << 9) /**< \brief (LCDC_HEOCFG12) Use Replication logic to expand RGB color to 24 bits */ +#define LCDC_HEOCFG12_DSTKEY (0x1u << 10) /**< \brief (LCDC_HEOCFG12) Destination Chroma Keying */ +#define LCDC_HEOCFG12_VIDPRI (0x1u << 12) /**< \brief (LCDC_HEOCFG12) Video Priority */ +#define LCDC_HEOCFG12_GA_Pos 16 +#define LCDC_HEOCFG12_GA_Msk (0xffu << LCDC_HEOCFG12_GA_Pos) /**< \brief (LCDC_HEOCFG12) Blender Global Alpha */ +#define LCDC_HEOCFG12_GA(value) ((LCDC_HEOCFG12_GA_Msk & ((value) << LCDC_HEOCFG12_GA_Pos))) +/* -------- LCDC_HEOCFG13 : (LCDC Offset: 0x000003C0) High End Overlay Configuration Register 13 -------- */ +#define LCDC_HEOCFG13_XFACTOR_Pos 0 +#define LCDC_HEOCFG13_XFACTOR_Msk (0x3fffu << LCDC_HEOCFG13_XFACTOR_Pos) /**< \brief (LCDC_HEOCFG13) Horizontal Scaling Factor */ +#define LCDC_HEOCFG13_XFACTOR(value) ((LCDC_HEOCFG13_XFACTOR_Msk & ((value) << LCDC_HEOCFG13_XFACTOR_Pos))) +#define LCDC_HEOCFG13_YFACTOR_Pos 16 +#define LCDC_HEOCFG13_YFACTOR_Msk (0x3fffu << LCDC_HEOCFG13_YFACTOR_Pos) /**< \brief (LCDC_HEOCFG13) Vertical Scaling Factor */ +#define LCDC_HEOCFG13_YFACTOR(value) ((LCDC_HEOCFG13_YFACTOR_Msk & ((value) << LCDC_HEOCFG13_YFACTOR_Pos))) +#define LCDC_HEOCFG13_SCALEN (0x1u << 31) /**< \brief (LCDC_HEOCFG13) Hardware Scaler Enable */ +/* -------- LCDC_HEOCFG14 : (LCDC Offset: 0x000003C4) High End Overlay Configuration Register 14 -------- */ +#define LCDC_HEOCFG14_CSCRY_Pos 0 +#define LCDC_HEOCFG14_CSCRY_Msk (0x3ffu << LCDC_HEOCFG14_CSCRY_Pos) /**< \brief (LCDC_HEOCFG14) Color Space Conversion Y coefficient for Red Component 1:2:7 format */ +#define LCDC_HEOCFG14_CSCRY(value) ((LCDC_HEOCFG14_CSCRY_Msk & ((value) << LCDC_HEOCFG14_CSCRY_Pos))) +#define LCDC_HEOCFG14_CSCRU_Pos 10 +#define LCDC_HEOCFG14_CSCRU_Msk (0x3ffu << LCDC_HEOCFG14_CSCRU_Pos) /**< \brief (LCDC_HEOCFG14) Color Space Conversion U coefficient for Red Component 1:2:7 format */ +#define LCDC_HEOCFG14_CSCRU(value) ((LCDC_HEOCFG14_CSCRU_Msk & ((value) << LCDC_HEOCFG14_CSCRU_Pos))) +#define LCDC_HEOCFG14_CSCRV_Pos 20 +#define LCDC_HEOCFG14_CSCRV_Msk (0x3ffu << LCDC_HEOCFG14_CSCRV_Pos) /**< \brief (LCDC_HEOCFG14) Color Space Conversion V coefficient for Red Component 1:2:7 format */ +#define LCDC_HEOCFG14_CSCRV(value) ((LCDC_HEOCFG14_CSCRV_Msk & ((value) << LCDC_HEOCFG14_CSCRV_Pos))) +#define LCDC_HEOCFG14_CSCYOFF (0x1u << 30) /**< \brief (LCDC_HEOCFG14) Color Space Conversion Offset */ +/* -------- LCDC_HEOCFG15 : (LCDC Offset: 0x000003C8) High End Overlay Configuration Register 15 -------- */ +#define LCDC_HEOCFG15_CSCGY_Pos 0 +#define LCDC_HEOCFG15_CSCGY_Msk (0x3ffu << LCDC_HEOCFG15_CSCGY_Pos) /**< \brief (LCDC_HEOCFG15) Color Space Conversion Y coefficient for Green Component 1:2:7 format */ +#define LCDC_HEOCFG15_CSCGY(value) ((LCDC_HEOCFG15_CSCGY_Msk & ((value) << LCDC_HEOCFG15_CSCGY_Pos))) +#define LCDC_HEOCFG15_CSCGU_Pos 10 +#define LCDC_HEOCFG15_CSCGU_Msk (0x3ffu << LCDC_HEOCFG15_CSCGU_Pos) /**< \brief (LCDC_HEOCFG15) Color Space Conversion U coefficient for Green Component 1:2:7 format */ +#define LCDC_HEOCFG15_CSCGU(value) ((LCDC_HEOCFG15_CSCGU_Msk & ((value) << LCDC_HEOCFG15_CSCGU_Pos))) +#define LCDC_HEOCFG15_CSCGV_Pos 20 +#define LCDC_HEOCFG15_CSCGV_Msk (0x3ffu << LCDC_HEOCFG15_CSCGV_Pos) /**< \brief (LCDC_HEOCFG15) Color Space Conversion V coefficient for Green Component 1:2:7 format */ +#define LCDC_HEOCFG15_CSCGV(value) ((LCDC_HEOCFG15_CSCGV_Msk & ((value) << LCDC_HEOCFG15_CSCGV_Pos))) +#define LCDC_HEOCFG15_CSCUOFF (0x1u << 30) /**< \brief (LCDC_HEOCFG15) Color Space Conversion Offset */ +/* -------- LCDC_HEOCFG16 : (LCDC Offset: 0x000003CC) High End Overlay Configuration Register 16 -------- */ +#define LCDC_HEOCFG16_CSCBY_Pos 0 +#define LCDC_HEOCFG16_CSCBY_Msk (0x3ffu << LCDC_HEOCFG16_CSCBY_Pos) /**< \brief (LCDC_HEOCFG16) Color Space Conversion Y coefficient for Blue Component 1:2:7 format */ +#define LCDC_HEOCFG16_CSCBY(value) ((LCDC_HEOCFG16_CSCBY_Msk & ((value) << LCDC_HEOCFG16_CSCBY_Pos))) +#define LCDC_HEOCFG16_CSCBU_Pos 10 +#define LCDC_HEOCFG16_CSCBU_Msk (0x3ffu << LCDC_HEOCFG16_CSCBU_Pos) /**< \brief (LCDC_HEOCFG16) Color Space Conversion U coefficient for Blue Component 1:2:7 format */ +#define LCDC_HEOCFG16_CSCBU(value) ((LCDC_HEOCFG16_CSCBU_Msk & ((value) << LCDC_HEOCFG16_CSCBU_Pos))) +#define LCDC_HEOCFG16_CSCBV_Pos 20 +#define LCDC_HEOCFG16_CSCBV_Msk (0x3ffu << LCDC_HEOCFG16_CSCBV_Pos) /**< \brief (LCDC_HEOCFG16) Color Space Conversion V coefficient for Blue Component 1:2:7 format */ +#define LCDC_HEOCFG16_CSCBV(value) ((LCDC_HEOCFG16_CSCBV_Msk & ((value) << LCDC_HEOCFG16_CSCBV_Pos))) +#define LCDC_HEOCFG16_CSCVOFF (0x1u << 30) /**< \brief (LCDC_HEOCFG16) Color Space Conversion Offset */ +/* -------- LCDC_HEOCFG17 : (LCDC Offset: 0x000003D0) High End Overlay Configuration Register 17 -------- */ +#define LCDC_HEOCFG17_XPHI0COEFF0_Pos 0 +#define LCDC_HEOCFG17_XPHI0COEFF0_Msk (0xffu << LCDC_HEOCFG17_XPHI0COEFF0_Pos) /**< \brief (LCDC_HEOCFG17) Horizontal Coefficient for phase 0 tap 0 */ +#define LCDC_HEOCFG17_XPHI0COEFF0(value) ((LCDC_HEOCFG17_XPHI0COEFF0_Msk & ((value) << LCDC_HEOCFG17_XPHI0COEFF0_Pos))) +#define LCDC_HEOCFG17_XPHI0COEFF1_Pos 8 +#define LCDC_HEOCFG17_XPHI0COEFF1_Msk (0xffu << LCDC_HEOCFG17_XPHI0COEFF1_Pos) /**< \brief (LCDC_HEOCFG17) Horizontal Coefficient for phase 0 tap 1 */ +#define LCDC_HEOCFG17_XPHI0COEFF1(value) ((LCDC_HEOCFG17_XPHI0COEFF1_Msk & ((value) << LCDC_HEOCFG17_XPHI0COEFF1_Pos))) +#define LCDC_HEOCFG17_XPHI0COEFF2_Pos 16 +#define LCDC_HEOCFG17_XPHI0COEFF2_Msk (0xffu << LCDC_HEOCFG17_XPHI0COEFF2_Pos) /**< \brief (LCDC_HEOCFG17) Horizontal Coefficient for phase 0 tap 2 */ +#define LCDC_HEOCFG17_XPHI0COEFF2(value) ((LCDC_HEOCFG17_XPHI0COEFF2_Msk & ((value) << LCDC_HEOCFG17_XPHI0COEFF2_Pos))) +#define LCDC_HEOCFG17_XPHI0COEFF3_Pos 24 +#define LCDC_HEOCFG17_XPHI0COEFF3_Msk (0xffu << LCDC_HEOCFG17_XPHI0COEFF3_Pos) /**< \brief (LCDC_HEOCFG17) Horizontal Coefficient for phase 0 tap 3 */ +#define LCDC_HEOCFG17_XPHI0COEFF3(value) ((LCDC_HEOCFG17_XPHI0COEFF3_Msk & ((value) << LCDC_HEOCFG17_XPHI0COEFF3_Pos))) +/* -------- LCDC_HEOCFG18 : (LCDC Offset: 0x000003D4) High End Overlay Configuration Register 18 -------- */ +#define LCDC_HEOCFG18_XPHI0COEFF4_Pos 0 +#define LCDC_HEOCFG18_XPHI0COEFF4_Msk (0xffu << LCDC_HEOCFG18_XPHI0COEFF4_Pos) /**< \brief (LCDC_HEOCFG18) Horizontal Coefficient for phase 0 tap 4 */ +#define LCDC_HEOCFG18_XPHI0COEFF4(value) ((LCDC_HEOCFG18_XPHI0COEFF4_Msk & ((value) << LCDC_HEOCFG18_XPHI0COEFF4_Pos))) +/* -------- LCDC_HEOCFG19 : (LCDC Offset: 0x000003D8) High End Overlay Configuration Register 19 -------- */ +#define LCDC_HEOCFG19_XPHI1COEFF0_Pos 0 +#define LCDC_HEOCFG19_XPHI1COEFF0_Msk (0xffu << LCDC_HEOCFG19_XPHI1COEFF0_Pos) /**< \brief (LCDC_HEOCFG19) Horizontal Coefficient for phase 1 tap 0 */ +#define LCDC_HEOCFG19_XPHI1COEFF0(value) ((LCDC_HEOCFG19_XPHI1COEFF0_Msk & ((value) << LCDC_HEOCFG19_XPHI1COEFF0_Pos))) +#define LCDC_HEOCFG19_XPHI1COEFF1_Pos 8 +#define LCDC_HEOCFG19_XPHI1COEFF1_Msk (0xffu << LCDC_HEOCFG19_XPHI1COEFF1_Pos) /**< \brief (LCDC_HEOCFG19) Horizontal Coefficient for phase 1 tap 1 */ +#define LCDC_HEOCFG19_XPHI1COEFF1(value) ((LCDC_HEOCFG19_XPHI1COEFF1_Msk & ((value) << LCDC_HEOCFG19_XPHI1COEFF1_Pos))) +#define LCDC_HEOCFG19_XPHI1COEFF2_Pos 16 +#define LCDC_HEOCFG19_XPHI1COEFF2_Msk (0xffu << LCDC_HEOCFG19_XPHI1COEFF2_Pos) /**< \brief (LCDC_HEOCFG19) Horizontal Coefficient for phase 1 tap 2 */ +#define LCDC_HEOCFG19_XPHI1COEFF2(value) ((LCDC_HEOCFG19_XPHI1COEFF2_Msk & ((value) << LCDC_HEOCFG19_XPHI1COEFF2_Pos))) +#define LCDC_HEOCFG19_XPHI1COEFF3_Pos 24 +#define LCDC_HEOCFG19_XPHI1COEFF3_Msk (0xffu << LCDC_HEOCFG19_XPHI1COEFF3_Pos) /**< \brief (LCDC_HEOCFG19) Horizontal Coefficient for phase 1 tap 3 */ +#define LCDC_HEOCFG19_XPHI1COEFF3(value) ((LCDC_HEOCFG19_XPHI1COEFF3_Msk & ((value) << LCDC_HEOCFG19_XPHI1COEFF3_Pos))) +/* -------- LCDC_HEOCFG20 : (LCDC Offset: 0x000003DC) High End Overlay Configuration Register 20 -------- */ +#define LCDC_HEOCFG20_XPHI1COEFF4_Pos 0 +#define LCDC_HEOCFG20_XPHI1COEFF4_Msk (0xffu << LCDC_HEOCFG20_XPHI1COEFF4_Pos) /**< \brief (LCDC_HEOCFG20) Horizontal Coefficient for phase 1 tap 4 */ +#define LCDC_HEOCFG20_XPHI1COEFF4(value) ((LCDC_HEOCFG20_XPHI1COEFF4_Msk & ((value) << LCDC_HEOCFG20_XPHI1COEFF4_Pos))) +/* -------- LCDC_HEOCFG21 : (LCDC Offset: 0x000003E0) High End Overlay Configuration Register 21 -------- */ +#define LCDC_HEOCFG21_XPHI2COEFF0_Pos 0 +#define LCDC_HEOCFG21_XPHI2COEFF0_Msk (0xffu << LCDC_HEOCFG21_XPHI2COEFF0_Pos) /**< \brief (LCDC_HEOCFG21) Horizontal Coefficient for phase 2 tap 0 */ +#define LCDC_HEOCFG21_XPHI2COEFF0(value) ((LCDC_HEOCFG21_XPHI2COEFF0_Msk & ((value) << LCDC_HEOCFG21_XPHI2COEFF0_Pos))) +#define LCDC_HEOCFG21_XPHI2COEFF1_Pos 8 +#define LCDC_HEOCFG21_XPHI2COEFF1_Msk (0xffu << LCDC_HEOCFG21_XPHI2COEFF1_Pos) /**< \brief (LCDC_HEOCFG21) Horizontal Coefficient for phase 2 tap 1 */ +#define LCDC_HEOCFG21_XPHI2COEFF1(value) ((LCDC_HEOCFG21_XPHI2COEFF1_Msk & ((value) << LCDC_HEOCFG21_XPHI2COEFF1_Pos))) +#define LCDC_HEOCFG21_XPHI2COEFF2_Pos 16 +#define LCDC_HEOCFG21_XPHI2COEFF2_Msk (0xffu << LCDC_HEOCFG21_XPHI2COEFF2_Pos) /**< \brief (LCDC_HEOCFG21) Horizontal Coefficient for phase 2 tap 2 */ +#define LCDC_HEOCFG21_XPHI2COEFF2(value) ((LCDC_HEOCFG21_XPHI2COEFF2_Msk & ((value) << LCDC_HEOCFG21_XPHI2COEFF2_Pos))) +#define LCDC_HEOCFG21_XPHI2COEFF3_Pos 24 +#define LCDC_HEOCFG21_XPHI2COEFF3_Msk (0xffu << LCDC_HEOCFG21_XPHI2COEFF3_Pos) /**< \brief (LCDC_HEOCFG21) Horizontal Coefficient for phase 2 tap 3 */ +#define LCDC_HEOCFG21_XPHI2COEFF3(value) ((LCDC_HEOCFG21_XPHI2COEFF3_Msk & ((value) << LCDC_HEOCFG21_XPHI2COEFF3_Pos))) +/* -------- LCDC_HEOCFG22 : (LCDC Offset: 0x000003E4) High End Overlay Configuration Register 22 -------- */ +#define LCDC_HEOCFG22_XPHI2COEFF4_Pos 0 +#define LCDC_HEOCFG22_XPHI2COEFF4_Msk (0xffu << LCDC_HEOCFG22_XPHI2COEFF4_Pos) /**< \brief (LCDC_HEOCFG22) Horizontal Coefficient for phase 2 tap 4 */ +#define LCDC_HEOCFG22_XPHI2COEFF4(value) ((LCDC_HEOCFG22_XPHI2COEFF4_Msk & ((value) << LCDC_HEOCFG22_XPHI2COEFF4_Pos))) +/* -------- LCDC_HEOCFG23 : (LCDC Offset: 0x000003E8) High End Overlay Configuration Register 23 -------- */ +#define LCDC_HEOCFG23_XPHI3COEFF0_Pos 0 +#define LCDC_HEOCFG23_XPHI3COEFF0_Msk (0xffu << LCDC_HEOCFG23_XPHI3COEFF0_Pos) /**< \brief (LCDC_HEOCFG23) Horizontal Coefficient for phase 3 tap 0 */ +#define LCDC_HEOCFG23_XPHI3COEFF0(value) ((LCDC_HEOCFG23_XPHI3COEFF0_Msk & ((value) << LCDC_HEOCFG23_XPHI3COEFF0_Pos))) +#define LCDC_HEOCFG23_XPHI3COEFF1_Pos 8 +#define LCDC_HEOCFG23_XPHI3COEFF1_Msk (0xffu << LCDC_HEOCFG23_XPHI3COEFF1_Pos) /**< \brief (LCDC_HEOCFG23) Horizontal Coefficient for phase 3 tap 1 */ +#define LCDC_HEOCFG23_XPHI3COEFF1(value) ((LCDC_HEOCFG23_XPHI3COEFF1_Msk & ((value) << LCDC_HEOCFG23_XPHI3COEFF1_Pos))) +#define LCDC_HEOCFG23_XPHI3COEFF2_Pos 16 +#define LCDC_HEOCFG23_XPHI3COEFF2_Msk (0xffu << LCDC_HEOCFG23_XPHI3COEFF2_Pos) /**< \brief (LCDC_HEOCFG23) Horizontal Coefficient for phase 3 tap 2 */ +#define LCDC_HEOCFG23_XPHI3COEFF2(value) ((LCDC_HEOCFG23_XPHI3COEFF2_Msk & ((value) << LCDC_HEOCFG23_XPHI3COEFF2_Pos))) +#define LCDC_HEOCFG23_XPHI3COEFF3_Pos 24 +#define LCDC_HEOCFG23_XPHI3COEFF3_Msk (0xffu << LCDC_HEOCFG23_XPHI3COEFF3_Pos) /**< \brief (LCDC_HEOCFG23) Horizontal Coefficient for phase 3 tap 3 */ +#define LCDC_HEOCFG23_XPHI3COEFF3(value) ((LCDC_HEOCFG23_XPHI3COEFF3_Msk & ((value) << LCDC_HEOCFG23_XPHI3COEFF3_Pos))) +/* -------- LCDC_HEOCFG24 : (LCDC Offset: 0x000003EC) High End Overlay Configuration Register 24 -------- */ +#define LCDC_HEOCFG24_XPHI3COEFF4_Pos 0 +#define LCDC_HEOCFG24_XPHI3COEFF4_Msk (0xffu << LCDC_HEOCFG24_XPHI3COEFF4_Pos) /**< \brief (LCDC_HEOCFG24) Horizontal Coefficient for phase 3 tap 4 */ +#define LCDC_HEOCFG24_XPHI3COEFF4(value) ((LCDC_HEOCFG24_XPHI3COEFF4_Msk & ((value) << LCDC_HEOCFG24_XPHI3COEFF4_Pos))) +/* -------- LCDC_HEOCFG25 : (LCDC Offset: 0x000003F0) High End Overlay Configuration Register 25 -------- */ +#define LCDC_HEOCFG25_XPHI4COEFF0_Pos 0 +#define LCDC_HEOCFG25_XPHI4COEFF0_Msk (0xffu << LCDC_HEOCFG25_XPHI4COEFF0_Pos) /**< \brief (LCDC_HEOCFG25) Horizontal Coefficient for phase 4 tap 0 */ +#define LCDC_HEOCFG25_XPHI4COEFF0(value) ((LCDC_HEOCFG25_XPHI4COEFF0_Msk & ((value) << LCDC_HEOCFG25_XPHI4COEFF0_Pos))) +#define LCDC_HEOCFG25_XPHI4COEFF1_Pos 8 +#define LCDC_HEOCFG25_XPHI4COEFF1_Msk (0xffu << LCDC_HEOCFG25_XPHI4COEFF1_Pos) /**< \brief (LCDC_HEOCFG25) Horizontal Coefficient for phase 4 tap 1 */ +#define LCDC_HEOCFG25_XPHI4COEFF1(value) ((LCDC_HEOCFG25_XPHI4COEFF1_Msk & ((value) << LCDC_HEOCFG25_XPHI4COEFF1_Pos))) +#define LCDC_HEOCFG25_XPHI4COEFF2_Pos 16 +#define LCDC_HEOCFG25_XPHI4COEFF2_Msk (0xffu << LCDC_HEOCFG25_XPHI4COEFF2_Pos) /**< \brief (LCDC_HEOCFG25) Horizontal Coefficient for phase 4 tap 2 */ +#define LCDC_HEOCFG25_XPHI4COEFF2(value) ((LCDC_HEOCFG25_XPHI4COEFF2_Msk & ((value) << LCDC_HEOCFG25_XPHI4COEFF2_Pos))) +#define LCDC_HEOCFG25_XPHI4COEFF3_Pos 24 +#define LCDC_HEOCFG25_XPHI4COEFF3_Msk (0xffu << LCDC_HEOCFG25_XPHI4COEFF3_Pos) /**< \brief (LCDC_HEOCFG25) Horizontal Coefficient for phase 4 tap 3 */ +#define LCDC_HEOCFG25_XPHI4COEFF3(value) ((LCDC_HEOCFG25_XPHI4COEFF3_Msk & ((value) << LCDC_HEOCFG25_XPHI4COEFF3_Pos))) +/* -------- LCDC_HEOCFG26 : (LCDC Offset: 0x000003F4) High End Overlay Configuration Register 26 -------- */ +#define LCDC_HEOCFG26_XPHI4COEFF4_Pos 0 +#define LCDC_HEOCFG26_XPHI4COEFF4_Msk (0xffu << LCDC_HEOCFG26_XPHI4COEFF4_Pos) /**< \brief (LCDC_HEOCFG26) Horizontal Coefficient for phase 4 tap 4 */ +#define LCDC_HEOCFG26_XPHI4COEFF4(value) ((LCDC_HEOCFG26_XPHI4COEFF4_Msk & ((value) << LCDC_HEOCFG26_XPHI4COEFF4_Pos))) +/* -------- LCDC_HEOCFG27 : (LCDC Offset: 0x000003F8) High End Overlay Configuration Register 27 -------- */ +#define LCDC_HEOCFG27_XPHI5COEFF0_Pos 0 +#define LCDC_HEOCFG27_XPHI5COEFF0_Msk (0xffu << LCDC_HEOCFG27_XPHI5COEFF0_Pos) /**< \brief (LCDC_HEOCFG27) Horizontal Coefficient for phase 5 tap 0 */ +#define LCDC_HEOCFG27_XPHI5COEFF0(value) ((LCDC_HEOCFG27_XPHI5COEFF0_Msk & ((value) << LCDC_HEOCFG27_XPHI5COEFF0_Pos))) +#define LCDC_HEOCFG27_XPHI5COEFF1_Pos 8 +#define LCDC_HEOCFG27_XPHI5COEFF1_Msk (0xffu << LCDC_HEOCFG27_XPHI5COEFF1_Pos) /**< \brief (LCDC_HEOCFG27) Horizontal Coefficient for phase 5 tap 1 */ +#define LCDC_HEOCFG27_XPHI5COEFF1(value) ((LCDC_HEOCFG27_XPHI5COEFF1_Msk & ((value) << LCDC_HEOCFG27_XPHI5COEFF1_Pos))) +#define LCDC_HEOCFG27_XPHI5COEFF2_Pos 16 +#define LCDC_HEOCFG27_XPHI5COEFF2_Msk (0xffu << LCDC_HEOCFG27_XPHI5COEFF2_Pos) /**< \brief (LCDC_HEOCFG27) Horizontal Coefficient for phase 5 tap 2 */ +#define LCDC_HEOCFG27_XPHI5COEFF2(value) ((LCDC_HEOCFG27_XPHI5COEFF2_Msk & ((value) << LCDC_HEOCFG27_XPHI5COEFF2_Pos))) +#define LCDC_HEOCFG27_XPHI5COEFF3_Pos 24 +#define LCDC_HEOCFG27_XPHI5COEFF3_Msk (0xffu << LCDC_HEOCFG27_XPHI5COEFF3_Pos) /**< \brief (LCDC_HEOCFG27) Horizontal Coefficient for phase 5 tap 3 */ +#define LCDC_HEOCFG27_XPHI5COEFF3(value) ((LCDC_HEOCFG27_XPHI5COEFF3_Msk & ((value) << LCDC_HEOCFG27_XPHI5COEFF3_Pos))) +/* -------- LCDC_HEOCFG28 : (LCDC Offset: 0x000003FC) High End Overlay Configuration Register 28 -------- */ +#define LCDC_HEOCFG28_XPHI5COEFF4_Pos 0 +#define LCDC_HEOCFG28_XPHI5COEFF4_Msk (0xffu << LCDC_HEOCFG28_XPHI5COEFF4_Pos) /**< \brief (LCDC_HEOCFG28) Horizontal Coefficient for phase 5 tap 4 */ +#define LCDC_HEOCFG28_XPHI5COEFF4(value) ((LCDC_HEOCFG28_XPHI5COEFF4_Msk & ((value) << LCDC_HEOCFG28_XPHI5COEFF4_Pos))) +/* -------- LCDC_HEOCFG29 : (LCDC Offset: 0x00000400) High End Overlay Configuration Register 29 -------- */ +#define LCDC_HEOCFG29_XPHI6COEFF0_Pos 0 +#define LCDC_HEOCFG29_XPHI6COEFF0_Msk (0xffu << LCDC_HEOCFG29_XPHI6COEFF0_Pos) /**< \brief (LCDC_HEOCFG29) Horizontal Coefficient for phase 6 tap 0 */ +#define LCDC_HEOCFG29_XPHI6COEFF0(value) ((LCDC_HEOCFG29_XPHI6COEFF0_Msk & ((value) << LCDC_HEOCFG29_XPHI6COEFF0_Pos))) +#define LCDC_HEOCFG29_XPHI6COEFF1_Pos 8 +#define LCDC_HEOCFG29_XPHI6COEFF1_Msk (0xffu << LCDC_HEOCFG29_XPHI6COEFF1_Pos) /**< \brief (LCDC_HEOCFG29) Horizontal Coefficient for phase 6 tap 1 */ +#define LCDC_HEOCFG29_XPHI6COEFF1(value) ((LCDC_HEOCFG29_XPHI6COEFF1_Msk & ((value) << LCDC_HEOCFG29_XPHI6COEFF1_Pos))) +#define LCDC_HEOCFG29_XPHI6COEFF2_Pos 16 +#define LCDC_HEOCFG29_XPHI6COEFF2_Msk (0xffu << LCDC_HEOCFG29_XPHI6COEFF2_Pos) /**< \brief (LCDC_HEOCFG29) Horizontal Coefficient for phase 6 tap 2 */ +#define LCDC_HEOCFG29_XPHI6COEFF2(value) ((LCDC_HEOCFG29_XPHI6COEFF2_Msk & ((value) << LCDC_HEOCFG29_XPHI6COEFF2_Pos))) +#define LCDC_HEOCFG29_XPHI6COEFF3_Pos 24 +#define LCDC_HEOCFG29_XPHI6COEFF3_Msk (0xffu << LCDC_HEOCFG29_XPHI6COEFF3_Pos) /**< \brief (LCDC_HEOCFG29) Horizontal Coefficient for phase 6 tap 3 */ +#define LCDC_HEOCFG29_XPHI6COEFF3(value) ((LCDC_HEOCFG29_XPHI6COEFF3_Msk & ((value) << LCDC_HEOCFG29_XPHI6COEFF3_Pos))) +/* -------- LCDC_HEOCFG30 : (LCDC Offset: 0x00000404) High End Overlay Configuration Register 30 -------- */ +#define LCDC_HEOCFG30_XPHI6COEFF4_Pos 0 +#define LCDC_HEOCFG30_XPHI6COEFF4_Msk (0xffu << LCDC_HEOCFG30_XPHI6COEFF4_Pos) /**< \brief (LCDC_HEOCFG30) Horizontal Coefficient for phase 6 tap 4 */ +#define LCDC_HEOCFG30_XPHI6COEFF4(value) ((LCDC_HEOCFG30_XPHI6COEFF4_Msk & ((value) << LCDC_HEOCFG30_XPHI6COEFF4_Pos))) +/* -------- LCDC_HEOCFG31 : (LCDC Offset: 0x00000408) High End Overlay Configuration Register 31 -------- */ +#define LCDC_HEOCFG31_XPHI7COEFF0_Pos 0 +#define LCDC_HEOCFG31_XPHI7COEFF0_Msk (0xffu << LCDC_HEOCFG31_XPHI7COEFF0_Pos) /**< \brief (LCDC_HEOCFG31) Horizontal Coefficient for phase 7 tap 0 */ +#define LCDC_HEOCFG31_XPHI7COEFF0(value) ((LCDC_HEOCFG31_XPHI7COEFF0_Msk & ((value) << LCDC_HEOCFG31_XPHI7COEFF0_Pos))) +#define LCDC_HEOCFG31_XPHI7COEFF1_Pos 8 +#define LCDC_HEOCFG31_XPHI7COEFF1_Msk (0xffu << LCDC_HEOCFG31_XPHI7COEFF1_Pos) /**< \brief (LCDC_HEOCFG31) Horizontal Coefficient for phase 7 tap 1 */ +#define LCDC_HEOCFG31_XPHI7COEFF1(value) ((LCDC_HEOCFG31_XPHI7COEFF1_Msk & ((value) << LCDC_HEOCFG31_XPHI7COEFF1_Pos))) +#define LCDC_HEOCFG31_XPHI7COEFF2_Pos 16 +#define LCDC_HEOCFG31_XPHI7COEFF2_Msk (0xffu << LCDC_HEOCFG31_XPHI7COEFF2_Pos) /**< \brief (LCDC_HEOCFG31) Horizontal Coefficient for phase 7 tap 2 */ +#define LCDC_HEOCFG31_XPHI7COEFF2(value) ((LCDC_HEOCFG31_XPHI7COEFF2_Msk & ((value) << LCDC_HEOCFG31_XPHI7COEFF2_Pos))) +#define LCDC_HEOCFG31_XPHI7COEFF3_Pos 24 +#define LCDC_HEOCFG31_XPHI7COEFF3_Msk (0xffu << LCDC_HEOCFG31_XPHI7COEFF3_Pos) /**< \brief (LCDC_HEOCFG31) Horizontal Coefficient for phase 7 tap 3 */ +#define LCDC_HEOCFG31_XPHI7COEFF3(value) ((LCDC_HEOCFG31_XPHI7COEFF3_Msk & ((value) << LCDC_HEOCFG31_XPHI7COEFF3_Pos))) +/* -------- LCDC_HEOCFG32 : (LCDC Offset: 0x0000040C) High End Overlay Configuration Register 32 -------- */ +#define LCDC_HEOCFG32_XPHI7COEFF4_Pos 0 +#define LCDC_HEOCFG32_XPHI7COEFF4_Msk (0xffu << LCDC_HEOCFG32_XPHI7COEFF4_Pos) /**< \brief (LCDC_HEOCFG32) Horizontal Coefficient for phase 7 tap 4 */ +#define LCDC_HEOCFG32_XPHI7COEFF4(value) ((LCDC_HEOCFG32_XPHI7COEFF4_Msk & ((value) << LCDC_HEOCFG32_XPHI7COEFF4_Pos))) +/* -------- LCDC_HEOCFG33 : (LCDC Offset: 0x00000410) High End Overlay Configuration Register 33 -------- */ +#define LCDC_HEOCFG33_YPHI0COEFF0_Pos 0 +#define LCDC_HEOCFG33_YPHI0COEFF0_Msk (0xffu << LCDC_HEOCFG33_YPHI0COEFF0_Pos) /**< \brief (LCDC_HEOCFG33) Vertical Coefficient for phase 0 tap 0 */ +#define LCDC_HEOCFG33_YPHI0COEFF0(value) ((LCDC_HEOCFG33_YPHI0COEFF0_Msk & ((value) << LCDC_HEOCFG33_YPHI0COEFF0_Pos))) +#define LCDC_HEOCFG33_YPHI0COEFF1_Pos 8 +#define LCDC_HEOCFG33_YPHI0COEFF1_Msk (0xffu << LCDC_HEOCFG33_YPHI0COEFF1_Pos) /**< \brief (LCDC_HEOCFG33) Vertical Coefficient for phase 0 tap 1 */ +#define LCDC_HEOCFG33_YPHI0COEFF1(value) ((LCDC_HEOCFG33_YPHI0COEFF1_Msk & ((value) << LCDC_HEOCFG33_YPHI0COEFF1_Pos))) +#define LCDC_HEOCFG33_YPHI0COEFF2_Pos 16 +#define LCDC_HEOCFG33_YPHI0COEFF2_Msk (0xffu << LCDC_HEOCFG33_YPHI0COEFF2_Pos) /**< \brief (LCDC_HEOCFG33) Vertical Coefficient for phase 0 tap 2 */ +#define LCDC_HEOCFG33_YPHI0COEFF2(value) ((LCDC_HEOCFG33_YPHI0COEFF2_Msk & ((value) << LCDC_HEOCFG33_YPHI0COEFF2_Pos))) +/* -------- LCDC_HEOCFG34 : (LCDC Offset: 0x00000414) High End Overlay Configuration Register 34 -------- */ +#define LCDC_HEOCFG34_YPHI1COEFF0_Pos 0 +#define LCDC_HEOCFG34_YPHI1COEFF0_Msk (0xffu << LCDC_HEOCFG34_YPHI1COEFF0_Pos) /**< \brief (LCDC_HEOCFG34) Vertical Coefficient for phase 1 tap 0 */ +#define LCDC_HEOCFG34_YPHI1COEFF0(value) ((LCDC_HEOCFG34_YPHI1COEFF0_Msk & ((value) << LCDC_HEOCFG34_YPHI1COEFF0_Pos))) +#define LCDC_HEOCFG34_YPHI1COEFF1_Pos 8 +#define LCDC_HEOCFG34_YPHI1COEFF1_Msk (0xffu << LCDC_HEOCFG34_YPHI1COEFF1_Pos) /**< \brief (LCDC_HEOCFG34) Vertical Coefficient for phase 1 tap 1 */ +#define LCDC_HEOCFG34_YPHI1COEFF1(value) ((LCDC_HEOCFG34_YPHI1COEFF1_Msk & ((value) << LCDC_HEOCFG34_YPHI1COEFF1_Pos))) +#define LCDC_HEOCFG34_YPHI1COEFF2_Pos 16 +#define LCDC_HEOCFG34_YPHI1COEFF2_Msk (0xffu << LCDC_HEOCFG34_YPHI1COEFF2_Pos) /**< \brief (LCDC_HEOCFG34) Vertical Coefficient for phase 1 tap 2 */ +#define LCDC_HEOCFG34_YPHI1COEFF2(value) ((LCDC_HEOCFG34_YPHI1COEFF2_Msk & ((value) << LCDC_HEOCFG34_YPHI1COEFF2_Pos))) +/* -------- LCDC_HEOCFG35 : (LCDC Offset: 0x00000418) High End Overlay Configuration Register 35 -------- */ +#define LCDC_HEOCFG35_YPHI2COEFF0_Pos 0 +#define LCDC_HEOCFG35_YPHI2COEFF0_Msk (0xffu << LCDC_HEOCFG35_YPHI2COEFF0_Pos) /**< \brief (LCDC_HEOCFG35) Vertical Coefficient for phase 2 tap 0 */ +#define LCDC_HEOCFG35_YPHI2COEFF0(value) ((LCDC_HEOCFG35_YPHI2COEFF0_Msk & ((value) << LCDC_HEOCFG35_YPHI2COEFF0_Pos))) +#define LCDC_HEOCFG35_YPHI2COEFF1_Pos 8 +#define LCDC_HEOCFG35_YPHI2COEFF1_Msk (0xffu << LCDC_HEOCFG35_YPHI2COEFF1_Pos) /**< \brief (LCDC_HEOCFG35) Vertical Coefficient for phase 2 tap 1 */ +#define LCDC_HEOCFG35_YPHI2COEFF1(value) ((LCDC_HEOCFG35_YPHI2COEFF1_Msk & ((value) << LCDC_HEOCFG35_YPHI2COEFF1_Pos))) +#define LCDC_HEOCFG35_YPHI2COEFF2_Pos 16 +#define LCDC_HEOCFG35_YPHI2COEFF2_Msk (0xffu << LCDC_HEOCFG35_YPHI2COEFF2_Pos) /**< \brief (LCDC_HEOCFG35) Vertical Coefficient for phase 2 tap 2 */ +#define LCDC_HEOCFG35_YPHI2COEFF2(value) ((LCDC_HEOCFG35_YPHI2COEFF2_Msk & ((value) << LCDC_HEOCFG35_YPHI2COEFF2_Pos))) +/* -------- LCDC_HEOCFG36 : (LCDC Offset: 0x0000041C) High End Overlay Configuration Register 36 -------- */ +#define LCDC_HEOCFG36_YPHI3COEFF0_Pos 0 +#define LCDC_HEOCFG36_YPHI3COEFF0_Msk (0xffu << LCDC_HEOCFG36_YPHI3COEFF0_Pos) /**< \brief (LCDC_HEOCFG36) Vertical Coefficient for phase 3 tap 0 */ +#define LCDC_HEOCFG36_YPHI3COEFF0(value) ((LCDC_HEOCFG36_YPHI3COEFF0_Msk & ((value) << LCDC_HEOCFG36_YPHI3COEFF0_Pos))) +#define LCDC_HEOCFG36_YPHI3COEFF1_Pos 8 +#define LCDC_HEOCFG36_YPHI3COEFF1_Msk (0xffu << LCDC_HEOCFG36_YPHI3COEFF1_Pos) /**< \brief (LCDC_HEOCFG36) Vertical Coefficient for phase 3 tap 1 */ +#define LCDC_HEOCFG36_YPHI3COEFF1(value) ((LCDC_HEOCFG36_YPHI3COEFF1_Msk & ((value) << LCDC_HEOCFG36_YPHI3COEFF1_Pos))) +#define LCDC_HEOCFG36_YPHI3COEFF2_Pos 16 +#define LCDC_HEOCFG36_YPHI3COEFF2_Msk (0xffu << LCDC_HEOCFG36_YPHI3COEFF2_Pos) /**< \brief (LCDC_HEOCFG36) Vertical Coefficient for phase 3 tap 2 */ +#define LCDC_HEOCFG36_YPHI3COEFF2(value) ((LCDC_HEOCFG36_YPHI3COEFF2_Msk & ((value) << LCDC_HEOCFG36_YPHI3COEFF2_Pos))) +/* -------- LCDC_HEOCFG37 : (LCDC Offset: 0x00000420) High End Overlay Configuration Register 37 -------- */ +#define LCDC_HEOCFG37_YPHI4COEFF0_Pos 0 +#define LCDC_HEOCFG37_YPHI4COEFF0_Msk (0xffu << LCDC_HEOCFG37_YPHI4COEFF0_Pos) /**< \brief (LCDC_HEOCFG37) Vertical Coefficient for phase 4 tap 0 */ +#define LCDC_HEOCFG37_YPHI4COEFF0(value) ((LCDC_HEOCFG37_YPHI4COEFF0_Msk & ((value) << LCDC_HEOCFG37_YPHI4COEFF0_Pos))) +#define LCDC_HEOCFG37_YPHI4COEFF1_Pos 8 +#define LCDC_HEOCFG37_YPHI4COEFF1_Msk (0xffu << LCDC_HEOCFG37_YPHI4COEFF1_Pos) /**< \brief (LCDC_HEOCFG37) Vertical Coefficient for phase 4 tap 1 */ +#define LCDC_HEOCFG37_YPHI4COEFF1(value) ((LCDC_HEOCFG37_YPHI4COEFF1_Msk & ((value) << LCDC_HEOCFG37_YPHI4COEFF1_Pos))) +#define LCDC_HEOCFG37_YPHI4COEFF2_Pos 16 +#define LCDC_HEOCFG37_YPHI4COEFF2_Msk (0xffu << LCDC_HEOCFG37_YPHI4COEFF2_Pos) /**< \brief (LCDC_HEOCFG37) Vertical Coefficient for phase 4 tap 2 */ +#define LCDC_HEOCFG37_YPHI4COEFF2(value) ((LCDC_HEOCFG37_YPHI4COEFF2_Msk & ((value) << LCDC_HEOCFG37_YPHI4COEFF2_Pos))) +/* -------- LCDC_HEOCFG38 : (LCDC Offset: 0x00000424) High End Overlay Configuration Register 38 -------- */ +#define LCDC_HEOCFG38_YPHI5COEFF0_Pos 0 +#define LCDC_HEOCFG38_YPHI5COEFF0_Msk (0xffu << LCDC_HEOCFG38_YPHI5COEFF0_Pos) /**< \brief (LCDC_HEOCFG38) Vertical Coefficient for phase 5 tap 0 */ +#define LCDC_HEOCFG38_YPHI5COEFF0(value) ((LCDC_HEOCFG38_YPHI5COEFF0_Msk & ((value) << LCDC_HEOCFG38_YPHI5COEFF0_Pos))) +#define LCDC_HEOCFG38_YPHI5COEFF1_Pos 8 +#define LCDC_HEOCFG38_YPHI5COEFF1_Msk (0xffu << LCDC_HEOCFG38_YPHI5COEFF1_Pos) /**< \brief (LCDC_HEOCFG38) Vertical Coefficient for phase 5 tap 1 */ +#define LCDC_HEOCFG38_YPHI5COEFF1(value) ((LCDC_HEOCFG38_YPHI5COEFF1_Msk & ((value) << LCDC_HEOCFG38_YPHI5COEFF1_Pos))) +#define LCDC_HEOCFG38_YPHI5COEFF2_Pos 16 +#define LCDC_HEOCFG38_YPHI5COEFF2_Msk (0xffu << LCDC_HEOCFG38_YPHI5COEFF2_Pos) /**< \brief (LCDC_HEOCFG38) Vertical Coefficient for phase 5 tap 2 */ +#define LCDC_HEOCFG38_YPHI5COEFF2(value) ((LCDC_HEOCFG38_YPHI5COEFF2_Msk & ((value) << LCDC_HEOCFG38_YPHI5COEFF2_Pos))) +/* -------- LCDC_HEOCFG39 : (LCDC Offset: 0x00000428) High End Overlay Configuration Register 39 -------- */ +#define LCDC_HEOCFG39_YPHI6COEFF0_Pos 0 +#define LCDC_HEOCFG39_YPHI6COEFF0_Msk (0xffu << LCDC_HEOCFG39_YPHI6COEFF0_Pos) /**< \brief (LCDC_HEOCFG39) Vertical Coefficient for phase 6 tap 0 */ +#define LCDC_HEOCFG39_YPHI6COEFF0(value) ((LCDC_HEOCFG39_YPHI6COEFF0_Msk & ((value) << LCDC_HEOCFG39_YPHI6COEFF0_Pos))) +#define LCDC_HEOCFG39_YPHI6COEFF1_Pos 8 +#define LCDC_HEOCFG39_YPHI6COEFF1_Msk (0xffu << LCDC_HEOCFG39_YPHI6COEFF1_Pos) /**< \brief (LCDC_HEOCFG39) Vertical Coefficient for phase 6 tap 1 */ +#define LCDC_HEOCFG39_YPHI6COEFF1(value) ((LCDC_HEOCFG39_YPHI6COEFF1_Msk & ((value) << LCDC_HEOCFG39_YPHI6COEFF1_Pos))) +#define LCDC_HEOCFG39_YPHI6COEFF2_Pos 16 +#define LCDC_HEOCFG39_YPHI6COEFF2_Msk (0xffu << LCDC_HEOCFG39_YPHI6COEFF2_Pos) /**< \brief (LCDC_HEOCFG39) Vertical Coefficient for phase 6 tap 2 */ +#define LCDC_HEOCFG39_YPHI6COEFF2(value) ((LCDC_HEOCFG39_YPHI6COEFF2_Msk & ((value) << LCDC_HEOCFG39_YPHI6COEFF2_Pos))) +/* -------- LCDC_HEOCFG40 : (LCDC Offset: 0x0000042C) High End Overlay Configuration Register 40 -------- */ +#define LCDC_HEOCFG40_YPHI7COEFF0_Pos 0 +#define LCDC_HEOCFG40_YPHI7COEFF0_Msk (0xffu << LCDC_HEOCFG40_YPHI7COEFF0_Pos) /**< \brief (LCDC_HEOCFG40) Vertical Coefficient for phase 7 tap 0 */ +#define LCDC_HEOCFG40_YPHI7COEFF0(value) ((LCDC_HEOCFG40_YPHI7COEFF0_Msk & ((value) << LCDC_HEOCFG40_YPHI7COEFF0_Pos))) +#define LCDC_HEOCFG40_YPHI7COEFF1_Pos 8 +#define LCDC_HEOCFG40_YPHI7COEFF1_Msk (0xffu << LCDC_HEOCFG40_YPHI7COEFF1_Pos) /**< \brief (LCDC_HEOCFG40) Vertical Coefficient for phase 7 tap 1 */ +#define LCDC_HEOCFG40_YPHI7COEFF1(value) ((LCDC_HEOCFG40_YPHI7COEFF1_Msk & ((value) << LCDC_HEOCFG40_YPHI7COEFF1_Pos))) +#define LCDC_HEOCFG40_YPHI7COEFF2_Pos 16 +#define LCDC_HEOCFG40_YPHI7COEFF2_Msk (0xffu << LCDC_HEOCFG40_YPHI7COEFF2_Pos) /**< \brief (LCDC_HEOCFG40) Vertical Coefficient for phase 7 tap 2 */ +#define LCDC_HEOCFG40_YPHI7COEFF2(value) ((LCDC_HEOCFG40_YPHI7COEFF2_Msk & ((value) << LCDC_HEOCFG40_YPHI7COEFF2_Pos))) +/* -------- LCDC_HEOCFG41 : (LCDC Offset: 0x00000430) High End Overlay Configuration Register 41 -------- */ +#define LCDC_HEOCFG41_XPHIDEF_Pos 0 +#define LCDC_HEOCFG41_XPHIDEF_Msk (0x7u << LCDC_HEOCFG41_XPHIDEF_Pos) /**< \brief (LCDC_HEOCFG41) Horizontal Filter Phase Offset */ +#define LCDC_HEOCFG41_XPHIDEF(value) ((LCDC_HEOCFG41_XPHIDEF_Msk & ((value) << LCDC_HEOCFG41_XPHIDEF_Pos))) +#define LCDC_HEOCFG41_YPHIDEF_Pos 16 +#define LCDC_HEOCFG41_YPHIDEF_Msk (0x7u << LCDC_HEOCFG41_YPHIDEF_Pos) /**< \brief (LCDC_HEOCFG41) Vertical Filter Phase Offset */ +#define LCDC_HEOCFG41_YPHIDEF(value) ((LCDC_HEOCFG41_YPHIDEF_Msk & ((value) << LCDC_HEOCFG41_YPHIDEF_Pos))) +/* -------- LCDC_PPCHER : (LCDC Offset: 0x00000540) Post Processing Channel Enable Register -------- */ +#define LCDC_PPCHER_CHEN (0x1u << 0) /**< \brief (LCDC_PPCHER) Channel Enable Register */ +#define LCDC_PPCHER_UPDATEEN (0x1u << 1) /**< \brief (LCDC_PPCHER) Update Overlay Attributes Enable Register */ +#define LCDC_PPCHER_A2QEN (0x1u << 2) /**< \brief (LCDC_PPCHER) Add To Queue Enable Register */ +/* -------- LCDC_PPCHDR : (LCDC Offset: 0x00000544) Post Processing Channel Disable Register -------- */ +#define LCDC_PPCHDR_CHDIS (0x1u << 0) /**< \brief (LCDC_PPCHDR) Channel Disable Register */ +#define LCDC_PPCHDR_CHRST (0x1u << 8) /**< \brief (LCDC_PPCHDR) Channel Reset Register */ +/* -------- LCDC_PPCHSR : (LCDC Offset: 0x00000548) Post Processing Channel Status Register -------- */ +#define LCDC_PPCHSR_CHSR (0x1u << 0) /**< \brief (LCDC_PPCHSR) Channel Status Register */ +#define LCDC_PPCHSR_UPDATESR (0x1u << 1) /**< \brief (LCDC_PPCHSR) Update Overlay Attributes In Progress Status Register */ +#define LCDC_PPCHSR_A2QSR (0x1u << 2) /**< \brief (LCDC_PPCHSR) Add To Queue Status Register */ +/* -------- LCDC_PPIER : (LCDC Offset: 0x0000054C) Post Processing Interrupt Enable Register -------- */ +#define LCDC_PPIER_DMA (0x1u << 2) /**< \brief (LCDC_PPIER) End of DMA Transfer Interrupt Enable Register */ +#define LCDC_PPIER_DSCR (0x1u << 3) /**< \brief (LCDC_PPIER) Descriptor Loaded Interrupt Enable Register */ +#define LCDC_PPIER_ADD (0x1u << 4) /**< \brief (LCDC_PPIER) Head Descriptor Loaded Interrupt Enable Register */ +#define LCDC_PPIER_DONE (0x1u << 5) /**< \brief (LCDC_PPIER) End of List Interrupt Enable Register */ +/* -------- LCDC_PPIDR : (LCDC Offset: 0x00000550) Post Processing Interrupt Disable Register -------- */ +#define LCDC_PPIDR_DMA (0x1u << 2) /**< \brief (LCDC_PPIDR) End of DMA Transfer Interrupt Disable Register */ +#define LCDC_PPIDR_DSCR (0x1u << 3) /**< \brief (LCDC_PPIDR) Descriptor Loaded Interrupt Disable Register */ +#define LCDC_PPIDR_ADD (0x1u << 4) /**< \brief (LCDC_PPIDR) Head Descriptor Loaded Interrupt Disable Register */ +#define LCDC_PPIDR_DONE (0x1u << 5) /**< \brief (LCDC_PPIDR) End of List Interrupt Disable Register */ +/* -------- LCDC_PPIMR : (LCDC Offset: 0x00000554) Post Processing Interrupt Mask Register -------- */ +#define LCDC_PPIMR_DMA (0x1u << 2) /**< \brief (LCDC_PPIMR) End of DMA Transfer Interrupt Mask Register */ +#define LCDC_PPIMR_DSCR (0x1u << 3) /**< \brief (LCDC_PPIMR) Descriptor Loaded Interrupt Mask Register */ +#define LCDC_PPIMR_ADD (0x1u << 4) /**< \brief (LCDC_PPIMR) Head Descriptor Loaded Interrupt Mask Register */ +#define LCDC_PPIMR_DONE (0x1u << 5) /**< \brief (LCDC_PPIMR) End of List Interrupt Mask Register */ +/* -------- LCDC_PPISR : (LCDC Offset: 0x00000558) Post Processing Interrupt Status Register -------- */ +#define LCDC_PPISR_DMA (0x1u << 2) /**< \brief (LCDC_PPISR) End of DMA Transfer */ +#define LCDC_PPISR_DSCR (0x1u << 3) /**< \brief (LCDC_PPISR) DMA Descriptor Loaded */ +#define LCDC_PPISR_ADD (0x1u << 4) /**< \brief (LCDC_PPISR) Head Descriptor Loaded */ +#define LCDC_PPISR_DONE (0x1u << 5) /**< \brief (LCDC_PPISR) End of List Detected */ +/* -------- LCDC_PPHEAD : (LCDC Offset: 0x0000055C) Post Processing Head Register -------- */ +#define LCDC_PPHEAD_HEAD_Pos 2 +#define LCDC_PPHEAD_HEAD_Msk (0x3fffffffu << LCDC_PPHEAD_HEAD_Pos) /**< \brief (LCDC_PPHEAD) DMA Head Pointer */ +#define LCDC_PPHEAD_HEAD(value) ((LCDC_PPHEAD_HEAD_Msk & ((value) << LCDC_PPHEAD_HEAD_Pos))) +/* -------- LCDC_PPADDR : (LCDC Offset: 0x00000560) Post Processing Address Register -------- */ +#define LCDC_PPADDR_ADDR_Pos 0 +#define LCDC_PPADDR_ADDR_Msk (0xffffffffu << LCDC_PPADDR_ADDR_Pos) /**< \brief (LCDC_PPADDR) DMA Transfer start address */ +#define LCDC_PPADDR_ADDR(value) ((LCDC_PPADDR_ADDR_Msk & ((value) << LCDC_PPADDR_ADDR_Pos))) +/* -------- LCDC_PPCTRL : (LCDC Offset: 0x00000564) Post Processing Control Register -------- */ +#define LCDC_PPCTRL_DFETCH (0x1u << 0) /**< \brief (LCDC_PPCTRL) Transfer Descriptor Fetch Enable */ +#define LCDC_PPCTRL_DMAIEN (0x1u << 2) /**< \brief (LCDC_PPCTRL) End of DMA Transfer Interrupt Enable */ +#define LCDC_PPCTRL_DSCRIEN (0x1u << 3) /**< \brief (LCDC_PPCTRL) Descriptor Loaded Interrupt Enable */ +#define LCDC_PPCTRL_ADDIEN (0x1u << 4) /**< \brief (LCDC_PPCTRL) Add Head Descriptor to Queue Interrupt Enable */ +#define LCDC_PPCTRL_DONEIEN (0x1u << 5) /**< \brief (LCDC_PPCTRL) End of List Interrupt Enable */ +/* -------- LCDC_PPNEXT : (LCDC Offset: 0x00000568) Post Processing Next Register -------- */ +#define LCDC_PPNEXT_NEXT_Pos 0 +#define LCDC_PPNEXT_NEXT_Msk (0xffffffffu << LCDC_PPNEXT_NEXT_Pos) /**< \brief (LCDC_PPNEXT) DMA Descriptor Next Address */ +#define LCDC_PPNEXT_NEXT(value) ((LCDC_PPNEXT_NEXT_Msk & ((value) << LCDC_PPNEXT_NEXT_Pos))) +/* -------- LCDC_PPCFG0 : (LCDC Offset: 0x0000056C) Post Processing Configuration Register 0 -------- */ +#define LCDC_PPCFG0_SIF (0x1u << 0) /**< \brief (LCDC_PPCFG0) Source Interface */ +#define LCDC_PPCFG0_BLEN_Pos 4 +#define LCDC_PPCFG0_BLEN_Msk (0x3u << LCDC_PPCFG0_BLEN_Pos) /**< \brief (LCDC_PPCFG0) AHB Burst Length */ +#define LCDC_PPCFG0_BLEN(value) ((LCDC_PPCFG0_BLEN_Msk & ((value) << LCDC_PPCFG0_BLEN_Pos))) +#define LCDC_PPCFG0_BLEN_AHB_BLEN_SINGLE (0x0u << 4) /**< \brief (LCDC_PPCFG0) AHB Access is started as soon as there is enough space in the FIFO to store one data. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_PPCFG0_BLEN_AHB_BLEN_INCR4 (0x1u << 4) /**< \brief (LCDC_PPCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 4 data. An AHB INCR4 Burst is used. SINGLE, INCR and INCR4 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_PPCFG0_BLEN_AHB_BLEN_INCR8 (0x2u << 4) /**< \brief (LCDC_PPCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 8 data. An AHB INCR8 Burst is used. SINGLE, INCR, INCR4 and INCR8 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_PPCFG0_BLEN_AHB_BLEN_INCR16 (0x3u << 4) /**< \brief (LCDC_PPCFG0) AHB Access is started as soon as there is enough space in the FIFO to store a total amount of 16 data. An AHB INCR16 Burst is used. SINGLE, INCR, INCR4, INCR8 and INCR16 bursts are used. INCR is used for a burst of 2 and 3 beats. */ +#define LCDC_PPCFG0_DLBO (0x1u << 8) /**< \brief (LCDC_PPCFG0) Defined Length Burst Only For Channel Bus Transaction. */ +/* -------- LCDC_PPCFG1 : (LCDC Offset: 0x00000570) Post Processing Configuration Register 1 -------- */ +#define LCDC_PPCFG1_PPMODE_Pos 0 +#define LCDC_PPCFG1_PPMODE_Msk (0x7u << LCDC_PPCFG1_PPMODE_Pos) /**< \brief (LCDC_PPCFG1) Post Processing Output Format selection */ +#define LCDC_PPCFG1_PPMODE(value) ((LCDC_PPCFG1_PPMODE_Msk & ((value) << LCDC_PPCFG1_PPMODE_Pos))) +#define LCDC_PPCFG1_PPMODE_PPMODE_RGB_16BPP (0x0u << 0) /**< \brief (LCDC_PPCFG1) RGB 16 bpp */ +#define LCDC_PPCFG1_PPMODE_PPMODE_RGB_24BPP_PACKED (0x1u << 0) /**< \brief (LCDC_PPCFG1) RGB 24 bpp PACKED */ +#define LCDC_PPCFG1_PPMODE_PPMODE_RGB_24BPP_UNPACKED (0x2u << 0) /**< \brief (LCDC_PPCFG1) RGB 24 bpp UNPACKED */ +#define LCDC_PPCFG1_PPMODE_PPMODE_YCBCR_422_MODE0 (0x3u << 0) /**< \brief (LCDC_PPCFG1) YCbCr 422 16 bpp (Mode 0) */ +#define LCDC_PPCFG1_PPMODE_PPMODE_YCBCR_422_MODE1 (0x4u << 0) /**< \brief (LCDC_PPCFG1) YCbCr 422 16 bpp (Mode 1) */ +#define LCDC_PPCFG1_PPMODE_PPMODE_YCBCR_422_MODE2 (0x5u << 0) /**< \brief (LCDC_PPCFG1) YCbCr 422 16 bpp (Mode 2) */ +#define LCDC_PPCFG1_PPMODE_PPMODE_YCBCR_422_MODE3 (0x6u << 0) /**< \brief (LCDC_PPCFG1) YCbCr 422 16 bpp (Mode 3) */ +#define LCDC_PPCFG1_ITUBT601 (0x1u << 4) /**< \brief (LCDC_PPCFG1) Color Space Conversion Luminance */ +/* -------- LCDC_PPCFG2 : (LCDC Offset: 0x00000574) Post Processing Configuration Register 2 -------- */ +#define LCDC_PPCFG2_XSTRIDE_Pos 0 +#define LCDC_PPCFG2_XSTRIDE_Msk (0xffffffffu << LCDC_PPCFG2_XSTRIDE_Pos) /**< \brief (LCDC_PPCFG2) Horizontal Stride */ +#define LCDC_PPCFG2_XSTRIDE(value) ((LCDC_PPCFG2_XSTRIDE_Msk & ((value) << LCDC_PPCFG2_XSTRIDE_Pos))) +/* -------- LCDC_PPCFG3 : (LCDC Offset: 0x00000578) Post Processing Configuration Register 3 -------- */ +#define LCDC_PPCFG3_CSCYR_Pos 0 +#define LCDC_PPCFG3_CSCYR_Msk (0x3ffu << LCDC_PPCFG3_CSCYR_Pos) /**< \brief (LCDC_PPCFG3) Color Space Conversion R coefficient for Luminance component, signed format, step set to 1/1024 */ +#define LCDC_PPCFG3_CSCYR(value) ((LCDC_PPCFG3_CSCYR_Msk & ((value) << LCDC_PPCFG3_CSCYR_Pos))) +#define LCDC_PPCFG3_CSCYG_Pos 10 +#define LCDC_PPCFG3_CSCYG_Msk (0x3ffu << LCDC_PPCFG3_CSCYG_Pos) /**< \brief (LCDC_PPCFG3) Color Space Conversion G coefficient for Luminance component, signed format, step set to 1/512 */ +#define LCDC_PPCFG3_CSCYG(value) ((LCDC_PPCFG3_CSCYG_Msk & ((value) << LCDC_PPCFG3_CSCYG_Pos))) +#define LCDC_PPCFG3_CSCYB_Pos 20 +#define LCDC_PPCFG3_CSCYB_Msk (0x3ffu << LCDC_PPCFG3_CSCYB_Pos) /**< \brief (LCDC_PPCFG3) Color Space Conversion B coefficient for Luminance component, signed format, step set to 1/1024 */ +#define LCDC_PPCFG3_CSCYB(value) ((LCDC_PPCFG3_CSCYB_Msk & ((value) << LCDC_PPCFG3_CSCYB_Pos))) +#define LCDC_PPCFG3_CSCYOFF (0x1u << 30) /**< \brief (LCDC_PPCFG3) Color Space Conversion Luminance Offset */ +/* -------- LCDC_PPCFG4 : (LCDC Offset: 0x0000057C) Post Processing Configuration Register 4 -------- */ +#define LCDC_PPCFG4_CSCUR_Pos 0 +#define LCDC_PPCFG4_CSCUR_Msk (0x3ffu << LCDC_PPCFG4_CSCUR_Pos) /**< \brief (LCDC_PPCFG4) Color Space Conversion R coefficient for Chrominance B component, signed format. (step 1/1024) */ +#define LCDC_PPCFG4_CSCUR(value) ((LCDC_PPCFG4_CSCUR_Msk & ((value) << LCDC_PPCFG4_CSCUR_Pos))) +#define LCDC_PPCFG4_CSCUG_Pos 10 +#define LCDC_PPCFG4_CSCUG_Msk (0x3ffu << LCDC_PPCFG4_CSCUG_Pos) /**< \brief (LCDC_PPCFG4) Color Space Conversion G coefficient for Chrominance B component, signed format. (step 1/512) */ +#define LCDC_PPCFG4_CSCUG(value) ((LCDC_PPCFG4_CSCUG_Msk & ((value) << LCDC_PPCFG4_CSCUG_Pos))) +#define LCDC_PPCFG4_CSCUB_Pos 20 +#define LCDC_PPCFG4_CSCUB_Msk (0x3ffu << LCDC_PPCFG4_CSCUB_Pos) /**< \brief (LCDC_PPCFG4) Color Space Conversion B coefficient for Chrominance B component, signed format. (step 1/512) */ +#define LCDC_PPCFG4_CSCUB(value) ((LCDC_PPCFG4_CSCUB_Msk & ((value) << LCDC_PPCFG4_CSCUB_Pos))) +#define LCDC_PPCFG4_CSCUOFF (0x1u << 30) /**< \brief (LCDC_PPCFG4) Color Space Conversion Chrominance B Offset */ +/* -------- LCDC_PPCFG5 : (LCDC Offset: 0x00000580) Post Processing Configuration Register 5 -------- */ +#define LCDC_PPCFG5_CSCVR_Pos 0 +#define LCDC_PPCFG5_CSCVR_Msk (0x3ffu << LCDC_PPCFG5_CSCVR_Pos) /**< \brief (LCDC_PPCFG5) Color Space Conversion R coefficient for Chrominance R component, signed format. (step 1/1024) */ +#define LCDC_PPCFG5_CSCVR(value) ((LCDC_PPCFG5_CSCVR_Msk & ((value) << LCDC_PPCFG5_CSCVR_Pos))) +#define LCDC_PPCFG5_CSCVG_Pos 10 +#define LCDC_PPCFG5_CSCVG_Msk (0x3ffu << LCDC_PPCFG5_CSCVG_Pos) /**< \brief (LCDC_PPCFG5) Color Space Conversion G coefficient for Chrominance R component, signed format. (step 1/512) */ +#define LCDC_PPCFG5_CSCVG(value) ((LCDC_PPCFG5_CSCVG_Msk & ((value) << LCDC_PPCFG5_CSCVG_Pos))) +#define LCDC_PPCFG5_CSCVB_Pos 20 +#define LCDC_PPCFG5_CSCVB_Msk (0x3ffu << LCDC_PPCFG5_CSCVB_Pos) /**< \brief (LCDC_PPCFG5) Color Space Conversion B coefficient for Chrominance R component, signed format. (step 1/1024) */ +#define LCDC_PPCFG5_CSCVB(value) ((LCDC_PPCFG5_CSCVB_Msk & ((value) << LCDC_PPCFG5_CSCVB_Pos))) +#define LCDC_PPCFG5_CSCVOFF (0x1u << 30) /**< \brief (LCDC_PPCFG5) Color Space Conversion Chrominance R Offset */ +/* -------- LCDC_BASECLUT[256] : (LCDC Offset: 0x00000600) Base CLUT Register -------- */ +#define LCDC_BASECLUT_BCLUT_Pos 0 +#define LCDC_BASECLUT_BCLUT_Msk (0xffu << LCDC_BASECLUT_BCLUT_Pos) /**< \brief (LCDC_BASECLUT[256]) Blue Color entry */ +#define LCDC_BASECLUT_BCLUT(value) ((LCDC_BASECLUT_BCLUT_Msk & ((value) << LCDC_BASECLUT_BCLUT_Pos))) +#define LCDC_BASECLUT_GCLUT_Pos 8 +#define LCDC_BASECLUT_GCLUT_Msk (0xffu << LCDC_BASECLUT_GCLUT_Pos) /**< \brief (LCDC_BASECLUT[256]) Green Color entry */ +#define LCDC_BASECLUT_GCLUT(value) ((LCDC_BASECLUT_GCLUT_Msk & ((value) << LCDC_BASECLUT_GCLUT_Pos))) +#define LCDC_BASECLUT_RCLUT_Pos 16 +#define LCDC_BASECLUT_RCLUT_Msk (0xffu << LCDC_BASECLUT_RCLUT_Pos) /**< \brief (LCDC_BASECLUT[256]) Red Color entry */ +#define LCDC_BASECLUT_RCLUT(value) ((LCDC_BASECLUT_RCLUT_Msk & ((value) << LCDC_BASECLUT_RCLUT_Pos))) +/* -------- LCDC_OVR1CLUT[256] : (LCDC Offset: 0x00000A00) Overlay 1 CLUT Register -------- */ +#define LCDC_OVR1CLUT_BCLUT_Pos 0 +#define LCDC_OVR1CLUT_BCLUT_Msk (0xffu << LCDC_OVR1CLUT_BCLUT_Pos) /**< \brief (LCDC_OVR1CLUT[256]) Blue Color entry */ +#define LCDC_OVR1CLUT_BCLUT(value) ((LCDC_OVR1CLUT_BCLUT_Msk & ((value) << LCDC_OVR1CLUT_BCLUT_Pos))) +#define LCDC_OVR1CLUT_GCLUT_Pos 8 +#define LCDC_OVR1CLUT_GCLUT_Msk (0xffu << LCDC_OVR1CLUT_GCLUT_Pos) /**< \brief (LCDC_OVR1CLUT[256]) Green Color entry */ +#define LCDC_OVR1CLUT_GCLUT(value) ((LCDC_OVR1CLUT_GCLUT_Msk & ((value) << LCDC_OVR1CLUT_GCLUT_Pos))) +#define LCDC_OVR1CLUT_RCLUT_Pos 16 +#define LCDC_OVR1CLUT_RCLUT_Msk (0xffu << LCDC_OVR1CLUT_RCLUT_Pos) /**< \brief (LCDC_OVR1CLUT[256]) Red Color entry */ +#define LCDC_OVR1CLUT_RCLUT(value) ((LCDC_OVR1CLUT_RCLUT_Msk & ((value) << LCDC_OVR1CLUT_RCLUT_Pos))) +#define LCDC_OVR1CLUT_ACLUT_Pos 24 +#define LCDC_OVR1CLUT_ACLUT_Msk (0xffu << LCDC_OVR1CLUT_ACLUT_Pos) /**< \brief (LCDC_OVR1CLUT[256]) Alpha Color entry */ +#define LCDC_OVR1CLUT_ACLUT(value) ((LCDC_OVR1CLUT_ACLUT_Msk & ((value) << LCDC_OVR1CLUT_ACLUT_Pos))) +/* -------- LCDC_OVR2CLUT[256] : (LCDC Offset: 0x00000E00) Overlay 2 CLUT Register -------- */ +#define LCDC_OVR2CLUT_BCLUT_Pos 0 +#define LCDC_OVR2CLUT_BCLUT_Msk (0xffu << LCDC_OVR2CLUT_BCLUT_Pos) /**< \brief (LCDC_OVR2CLUT[256]) Blue Color entry */ +#define LCDC_OVR2CLUT_BCLUT(value) ((LCDC_OVR2CLUT_BCLUT_Msk & ((value) << LCDC_OVR2CLUT_BCLUT_Pos))) +#define LCDC_OVR2CLUT_GCLUT_Pos 8 +#define LCDC_OVR2CLUT_GCLUT_Msk (0xffu << LCDC_OVR2CLUT_GCLUT_Pos) /**< \brief (LCDC_OVR2CLUT[256]) Green Color entry */ +#define LCDC_OVR2CLUT_GCLUT(value) ((LCDC_OVR2CLUT_GCLUT_Msk & ((value) << LCDC_OVR2CLUT_GCLUT_Pos))) +#define LCDC_OVR2CLUT_RCLUT_Pos 16 +#define LCDC_OVR2CLUT_RCLUT_Msk (0xffu << LCDC_OVR2CLUT_RCLUT_Pos) /**< \brief (LCDC_OVR2CLUT[256]) Red Color entry */ +#define LCDC_OVR2CLUT_RCLUT(value) ((LCDC_OVR2CLUT_RCLUT_Msk & ((value) << LCDC_OVR2CLUT_RCLUT_Pos))) +#define LCDC_OVR2CLUT_ACLUT_Pos 24 +#define LCDC_OVR2CLUT_ACLUT_Msk (0xffu << LCDC_OVR2CLUT_ACLUT_Pos) /**< \brief (LCDC_OVR2CLUT[256]) Alpha Color entry */ +#define LCDC_OVR2CLUT_ACLUT(value) ((LCDC_OVR2CLUT_ACLUT_Msk & ((value) << LCDC_OVR2CLUT_ACLUT_Pos))) +/* -------- LCDC_HEOCLUT[256] : (LCDC Offset: 0x00001200) High End Overlay CLUT Register -------- */ +#define LCDC_HEOCLUT_BCLUT_Pos 0 +#define LCDC_HEOCLUT_BCLUT_Msk (0xffu << LCDC_HEOCLUT_BCLUT_Pos) /**< \brief (LCDC_HEOCLUT[256]) Blue Color entry */ +#define LCDC_HEOCLUT_BCLUT(value) ((LCDC_HEOCLUT_BCLUT_Msk & ((value) << LCDC_HEOCLUT_BCLUT_Pos))) +#define LCDC_HEOCLUT_GCLUT_Pos 8 +#define LCDC_HEOCLUT_GCLUT_Msk (0xffu << LCDC_HEOCLUT_GCLUT_Pos) /**< \brief (LCDC_HEOCLUT[256]) Green Color entry */ +#define LCDC_HEOCLUT_GCLUT(value) ((LCDC_HEOCLUT_GCLUT_Msk & ((value) << LCDC_HEOCLUT_GCLUT_Pos))) +#define LCDC_HEOCLUT_RCLUT_Pos 16 +#define LCDC_HEOCLUT_RCLUT_Msk (0xffu << LCDC_HEOCLUT_RCLUT_Pos) /**< \brief (LCDC_HEOCLUT[256]) Red Color entry */ +#define LCDC_HEOCLUT_RCLUT(value) ((LCDC_HEOCLUT_RCLUT_Msk & ((value) << LCDC_HEOCLUT_RCLUT_Pos))) +#define LCDC_HEOCLUT_ACLUT_Pos 24 +#define LCDC_HEOCLUT_ACLUT_Msk (0xffu << LCDC_HEOCLUT_ACLUT_Pos) /**< \brief (LCDC_HEOCLUT[256]) Alpha Color entry */ +#define LCDC_HEOCLUT_ACLUT(value) ((LCDC_HEOCLUT_ACLUT_Msk & ((value) << LCDC_HEOCLUT_ACLUT_Pos))) +/* -------- LCDC_VERSION : (LCDC Offset: 0x00001FFC) Version Register -------- */ +#define LCDC_VERSION_VERSION_Pos 0 +#define LCDC_VERSION_VERSION_Msk (0xfffu << LCDC_VERSION_VERSION_Pos) /**< \brief (LCDC_VERSION) Version of the Hardware Module */ +#define LCDC_VERSION_MFN_Pos 16 +#define LCDC_VERSION_MFN_Msk (0x7u << LCDC_VERSION_MFN_Pos) /**< \brief (LCDC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_LCDC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_matrix.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_matrix.h new file mode 100644 index 000000000..640a7c05a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_matrix.h @@ -0,0 +1,1520 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_MATRIX_COMPONENT_ +#define _SAMA5D2_MATRIX_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR AHB Bus Matrix */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_MATRIX AHB Bus Matrix */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief MatrixPr hardware registers */ +typedef struct { + __IO uint32_t MATRIX_PRAS; /**< \brief (MatrixPr Offset: 0x0) Priority Register A for Slave 0 */ + __IO uint32_t MATRIX_PRBS; /**< \brief (MatrixPr Offset: 0x4) Priority Register B for Slave 0 */ +} MatrixPr; +/** \brief Matrix hardware registers */ +#define MATRIXPR_NUMBER 15 +typedef struct { + __IO uint32_t MATRIX_MCFG0; /**< \brief (Matrix Offset: 0x0000) Master Configuration Register 0 */ + __IO uint32_t MATRIX_MCFG1; /**< \brief (Matrix Offset: 0x0004) Master Configuration Register 1 */ + __IO uint32_t MATRIX_MCFG2; /**< \brief (Matrix Offset: 0x0008) Master Configuration Register 2 */ + __IO uint32_t MATRIX_MCFG3; /**< \brief (Matrix Offset: 0x000C) Master Configuration Register 3 */ + __IO uint32_t MATRIX_MCFG4; /**< \brief (Matrix Offset: 0x0010) Master Configuration Register 4 */ + __IO uint32_t MATRIX_MCFG5; /**< \brief (Matrix Offset: 0x0014) Master Configuration Register 5 */ + __IO uint32_t MATRIX_MCFG6; /**< \brief (Matrix Offset: 0x0018) Master Configuration Register 6 */ + __IO uint32_t MATRIX_MCFG7; /**< \brief (Matrix Offset: 0x001C) Master Configuration Register 7 */ + __IO uint32_t MATRIX_MCFG8; /**< \brief (Matrix Offset: 0x0020) Master Configuration Register 8 */ + __IO uint32_t MATRIX_MCFG9; /**< \brief (Matrix Offset: 0x0024) Master Configuration Register 9 */ + __IO uint32_t MATRIX_MCFG10; /**< \brief (Matrix Offset: 0x0028) Master Configuration Register 10 */ + __IO uint32_t MATRIX_MCFG11; /**< \brief (Matrix Offset: 0x002C) Master Configuration Register 11 */ + __I uint32_t Reserved1[4]; + __IO uint32_t MATRIX_SCFG0; /**< \brief (Matrix Offset: 0x0040) Slave Configuration Register 0 */ + __IO uint32_t MATRIX_SCFG1; /**< \brief (Matrix Offset: 0x0044) Slave Configuration Register 1 */ + __IO uint32_t MATRIX_SCFG2; /**< \brief (Matrix Offset: 0x0048) Slave Configuration Register 2 */ + __IO uint32_t MATRIX_SCFG3; /**< \brief (Matrix Offset: 0x004C) Slave Configuration Register 3 */ + __IO uint32_t MATRIX_SCFG4; /**< \brief (Matrix Offset: 0x0050) Slave Configuration Register 4 */ + __IO uint32_t MATRIX_SCFG5; /**< \brief (Matrix Offset: 0x0054) Slave Configuration Register 5 */ + __IO uint32_t MATRIX_SCFG6; /**< \brief (Matrix Offset: 0x0058) Slave Configuration Register 6 */ + __IO uint32_t MATRIX_SCFG7; /**< \brief (Matrix Offset: 0x005C) Slave Configuration Register 7 */ + __IO uint32_t MATRIX_SCFG8; /**< \brief (Matrix Offset: 0x0060) Slave Configuration Register 8 */ + __IO uint32_t MATRIX_SCFG9; /**< \brief (Matrix Offset: 0x0064) Slave Configuration Register 9 */ + __IO uint32_t MATRIX_SCFG10; /**< \brief (Matrix Offset: 0x0068) Slave Configuration Register 10 */ + __IO uint32_t MATRIX_SCFG11; /**< \brief (Matrix Offset: 0x006C) Slave Configuration Register 11 */ + __IO uint32_t MATRIX_SCFG12; /**< \brief (Matrix Offset: 0x0070) Slave Configuration Register 12 */ + __IO uint32_t MATRIX_SCFG13; /**< \brief (Matrix Offset: 0x0074) Slave Configuration Register 13 */ + __IO uint32_t MATRIX_SCFG14; /**< \brief (Matrix Offset: 0x0078) Slave Configuration Register 14 */ + __I uint32_t Reserved2[1]; + MatrixPr MATRIX_PR[MATRIXPR_NUMBER]; /**< \brief (Matrix Offset: 0x0080) 0 .. 14 */ + __I uint32_t Reserved3[22]; + __O uint32_t MATRIX_MEIER; /**< \brief (Matrix Offset: 0x0150) Master Error Interrupt Enable Register */ + __O uint32_t MATRIX_MEIDR; /**< \brief (Matrix Offset: 0x0154) Master Error Interrupt Disable Register */ + __I uint32_t MATRIX_MEIMR; /**< \brief (Matrix Offset: 0x0158) Master Error Interrupt Mask Register */ + __I uint32_t MATRIX_MESR; /**< \brief (Matrix Offset: 0x015C) Master Error Status Register */ + __I uint32_t MATRIX_MEAR0; /**< \brief (Matrix Offset: 0x0160) Master 0 Error Address Register */ + __I uint32_t MATRIX_MEAR1; /**< \brief (Matrix Offset: 0x0164) Master 1 Error Address Register */ + __I uint32_t MATRIX_MEAR2; /**< \brief (Matrix Offset: 0x0168) Master 2 Error Address Register */ + __I uint32_t MATRIX_MEAR3; /**< \brief (Matrix Offset: 0x016C) Master 3 Error Address Register */ + __I uint32_t MATRIX_MEAR4; /**< \brief (Matrix Offset: 0x0170) Master 4 Error Address Register */ + __I uint32_t MATRIX_MEAR5; /**< \brief (Matrix Offset: 0x0174) Master 5 Error Address Register */ + __I uint32_t MATRIX_MEAR6; /**< \brief (Matrix Offset: 0x0178) Master 6 Error Address Register */ + __I uint32_t MATRIX_MEAR7; /**< \brief (Matrix Offset: 0x017C) Master 7 Error Address Register */ + __I uint32_t MATRIX_MEAR8; /**< \brief (Matrix Offset: 0x0180) Master 8 Error Address Register */ + __I uint32_t MATRIX_MEAR9; /**< \brief (Matrix Offset: 0x0184) Master 9 Error Address Register */ + __I uint32_t MATRIX_MEAR10; /**< \brief (Matrix Offset: 0x0188) Master 10 Error Address Register */ + __I uint32_t MATRIX_MEAR11; /**< \brief (Matrix Offset: 0x018C) Master 11 Error Address Register */ + __I uint32_t Reserved4[21]; + __IO uint32_t MATRIX_WPMR; /**< \brief (Matrix Offset: 0x01E4) Write Protection Mode Register */ + __I uint32_t MATRIX_WPSR; /**< \brief (Matrix Offset: 0x01E8) Write Protection Status Register */ + __I uint32_t Reserved5[4]; + __I uint32_t MATRIX_VERSION; /**< \brief (Matrix Offset: 0x01FC) Version Register */ + __IO uint32_t MATRIX_SSR[15]; /**< \brief (Matrix Offset: 0x0200) Security Slave x Register */ + __I uint32_t Reserved6[1]; + __IO uint32_t MATRIX_SASSR[15]; /**< \brief (Matrix Offset: 0x0240) Security Areas Split Slave x Register */ + __I uint32_t Reserved7[1]; + __IO uint32_t MATRIX_SRTSR[15]; /**< \brief (Matrix Offset: 0x0284) Security Region Top Slave x Register */ + __I uint32_t Reserved8[1]; + __IO uint32_t MATRIX_SPSELR[3]; /**< \brief (Matrix Offset: 0x02C0) Security Peripheral Select x Register */ +} Matrix; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- MATRIX_MCFG0 : (MATRIX Offset: 0x0000) Master Configuration Register 0 -------- */ +#define MATRIX_MCFG0_ULBT_Pos 0 +#define MATRIX_MCFG0_ULBT_Msk (0x7u << MATRIX_MCFG0_ULBT_Pos) /**< \brief (MATRIX_MCFG0) Undefined Length Burst Type */ +#define MATRIX_MCFG0_ULBT(value) ((MATRIX_MCFG0_ULBT_Msk & ((value) << MATRIX_MCFG0_ULBT_Pos))) +#define MATRIX_MCFG0_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG0) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG0_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG0) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG0_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG0) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG0_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG0) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG0_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG0) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG0_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG0) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG0_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG0) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG0_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG0) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG1 : (MATRIX Offset: 0x0004) Master Configuration Register 1 -------- */ +#define MATRIX_MCFG1_ULBT_Pos 0 +#define MATRIX_MCFG1_ULBT_Msk (0x7u << MATRIX_MCFG1_ULBT_Pos) /**< \brief (MATRIX_MCFG1) Undefined Length Burst Type */ +#define MATRIX_MCFG1_ULBT(value) ((MATRIX_MCFG1_ULBT_Msk & ((value) << MATRIX_MCFG1_ULBT_Pos))) +#define MATRIX_MCFG1_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG1) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG1_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG1) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG1_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG1) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG1_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG1) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG1_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG1) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG1_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG1) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG1_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG1) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG1_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG1) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG2 : (MATRIX Offset: 0x0008) Master Configuration Register 2 -------- */ +#define MATRIX_MCFG2_ULBT_Pos 0 +#define MATRIX_MCFG2_ULBT_Msk (0x7u << MATRIX_MCFG2_ULBT_Pos) /**< \brief (MATRIX_MCFG2) Undefined Length Burst Type */ +#define MATRIX_MCFG2_ULBT(value) ((MATRIX_MCFG2_ULBT_Msk & ((value) << MATRIX_MCFG2_ULBT_Pos))) +#define MATRIX_MCFG2_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG2) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG2_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG2) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG2_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG2) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG2_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG2) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG2_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG2) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG2_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG2) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG2_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG2) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG2_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG2) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG3 : (MATRIX Offset: 0x000C) Master Configuration Register 3 -------- */ +#define MATRIX_MCFG3_ULBT_Pos 0 +#define MATRIX_MCFG3_ULBT_Msk (0x7u << MATRIX_MCFG3_ULBT_Pos) /**< \brief (MATRIX_MCFG3) Undefined Length Burst Type */ +#define MATRIX_MCFG3_ULBT(value) ((MATRIX_MCFG3_ULBT_Msk & ((value) << MATRIX_MCFG3_ULBT_Pos))) +#define MATRIX_MCFG3_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG3) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG3_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG3) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG3_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG3) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG3_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG3) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG3_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG3) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG3_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG3) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG3_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG3) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG3_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG3) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG4 : (MATRIX Offset: 0x0010) Master Configuration Register 4 -------- */ +#define MATRIX_MCFG4_ULBT_Pos 0 +#define MATRIX_MCFG4_ULBT_Msk (0x7u << MATRIX_MCFG4_ULBT_Pos) /**< \brief (MATRIX_MCFG4) Undefined Length Burst Type */ +#define MATRIX_MCFG4_ULBT(value) ((MATRIX_MCFG4_ULBT_Msk & ((value) << MATRIX_MCFG4_ULBT_Pos))) +#define MATRIX_MCFG4_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG4) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG4_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG4) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG4_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG4) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG4_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG4) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG4_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG4) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG4_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG4) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG4_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG4) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG4_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG4) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG5 : (MATRIX Offset: 0x0014) Master Configuration Register 5 -------- */ +#define MATRIX_MCFG5_ULBT_Pos 0 +#define MATRIX_MCFG5_ULBT_Msk (0x7u << MATRIX_MCFG5_ULBT_Pos) /**< \brief (MATRIX_MCFG5) Undefined Length Burst Type */ +#define MATRIX_MCFG5_ULBT(value) ((MATRIX_MCFG5_ULBT_Msk & ((value) << MATRIX_MCFG5_ULBT_Pos))) +#define MATRIX_MCFG5_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG5) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG5_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG5) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG5_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG5) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG5_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG5) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG5_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG5) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG5_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG5) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG5_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG5) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG5_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG5) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG6 : (MATRIX Offset: 0x0018) Master Configuration Register 6 -------- */ +#define MATRIX_MCFG6_ULBT_Pos 0 +#define MATRIX_MCFG6_ULBT_Msk (0x7u << MATRIX_MCFG6_ULBT_Pos) /**< \brief (MATRIX_MCFG6) Undefined Length Burst Type */ +#define MATRIX_MCFG6_ULBT(value) ((MATRIX_MCFG6_ULBT_Msk & ((value) << MATRIX_MCFG6_ULBT_Pos))) +#define MATRIX_MCFG6_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG6) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG6_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG6) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG6_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG6) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG6_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG6) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG6_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG6) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG6_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG6) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG6_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG6) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG6_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG6) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG7 : (MATRIX Offset: 0x001C) Master Configuration Register 7 -------- */ +#define MATRIX_MCFG7_ULBT_Pos 0 +#define MATRIX_MCFG7_ULBT_Msk (0x7u << MATRIX_MCFG7_ULBT_Pos) /**< \brief (MATRIX_MCFG7) Undefined Length Burst Type */ +#define MATRIX_MCFG7_ULBT(value) ((MATRIX_MCFG7_ULBT_Msk & ((value) << MATRIX_MCFG7_ULBT_Pos))) +#define MATRIX_MCFG7_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG7) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG7_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG7) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG7_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG7) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG7_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG7) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG7_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG7) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG7_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG7) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG7_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG7) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG7_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG7) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG8 : (MATRIX Offset: 0x0020) Master Configuration Register 8 -------- */ +#define MATRIX_MCFG8_ULBT_Pos 0 +#define MATRIX_MCFG8_ULBT_Msk (0x7u << MATRIX_MCFG8_ULBT_Pos) /**< \brief (MATRIX_MCFG8) Undefined Length Burst Type */ +#define MATRIX_MCFG8_ULBT(value) ((MATRIX_MCFG8_ULBT_Msk & ((value) << MATRIX_MCFG8_ULBT_Pos))) +#define MATRIX_MCFG8_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG8) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG8_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG8) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG8_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG8) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG8_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG8) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG8_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG8) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG8_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG8) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG8_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG8) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG8_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG8) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_MCFG9 : (MATRIX Offset: 0x0024) Master Configuration Register 9 -------- */ +#define MATRIX_MCFG9_ULBT_Pos 0 +#define MATRIX_MCFG9_ULBT_Msk (0x7u << MATRIX_MCFG9_ULBT_Pos) /**< \brief (MATRIX_MCFG9) Undefined Length Burst Type */ +#define MATRIX_MCFG9_ULBT(value) ((MATRIX_MCFG9_ULBT_Msk & ((value) << MATRIX_MCFG9_ULBT_Pos))) +#define MATRIX_MCFG9_ULBT_UNLIMITED (0x0u << 0) /**< \brief (MATRIX_MCFG9) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1 Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ +#define MATRIX_MCFG9_ULBT_SINGLE (0x1u << 0) /**< \brief (MATRIX_MCFG9) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ +#define MATRIX_MCFG9_ULBT_4_BEAT (0x2u << 0) /**< \brief (MATRIX_MCFG9) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ +#define MATRIX_MCFG9_ULBT_8_BEAT (0x3u << 0) /**< \brief (MATRIX_MCFG9) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ +#define MATRIX_MCFG9_ULBT_16_BEAT (0x4u << 0) /**< \brief (MATRIX_MCFG9) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ +#define MATRIX_MCFG9_ULBT_32_BEAT (0x5u << 0) /**< \brief (MATRIX_MCFG9) 32-beat Burst-The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ +#define MATRIX_MCFG9_ULBT_64_BEAT (0x6u << 0) /**< \brief (MATRIX_MCFG9) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ +#define MATRIX_MCFG9_ULBT_128_BEAT (0x7u << 0) /**< \brief (MATRIX_MCFG9) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats.Unless duly needed, the ULBT should be left at its default 0 value for power saving. */ +/* -------- MATRIX_SCFG0 : (MATRIX Offset: 0x0040) Slave Configuration Register 0 -------- */ +#define MATRIX_SCFG0_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG0_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG0_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG0) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG0_SLOT_CYCLE(value) ((MATRIX_SCFG0_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG0_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG0_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG0_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG0_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG0) Default Master Type */ +#define MATRIX_SCFG0_DEFMSTR_TYPE(value) ((MATRIX_SCFG0_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG0_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG0_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG0) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG0_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG0) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG0_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG0) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG0_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG0_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG0_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG0) Fixed Default Master */ +#define MATRIX_SCFG0_FIXED_DEFMSTR(value) ((MATRIX_SCFG0_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG0_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG1 : (MATRIX Offset: 0x0044) Slave Configuration Register 1 -------- */ +#define MATRIX_SCFG1_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG1_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG1_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG1) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG1_SLOT_CYCLE(value) ((MATRIX_SCFG1_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG1_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG1_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG1_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG1_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG1) Default Master Type */ +#define MATRIX_SCFG1_DEFMSTR_TYPE(value) ((MATRIX_SCFG1_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG1_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG1_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG1) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG1_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG1) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG1_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG1) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG1_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG1_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG1_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG1) Fixed Default Master */ +#define MATRIX_SCFG1_FIXED_DEFMSTR(value) ((MATRIX_SCFG1_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG1_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG2 : (MATRIX Offset: 0x0048) Slave Configuration Register 2 -------- */ +#define MATRIX_SCFG2_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG2_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG2_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG2) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG2_SLOT_CYCLE(value) ((MATRIX_SCFG2_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG2_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG2_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG2_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG2_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG2) Default Master Type */ +#define MATRIX_SCFG2_DEFMSTR_TYPE(value) ((MATRIX_SCFG2_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG2_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG2_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG2) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG2_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG2) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG2_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG2) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG2_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG2_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG2_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG2) Fixed Default Master */ +#define MATRIX_SCFG2_FIXED_DEFMSTR(value) ((MATRIX_SCFG2_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG2_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG3 : (MATRIX Offset: 0x004C) Slave Configuration Register 3 -------- */ +#define MATRIX_SCFG3_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG3_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG3_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG3) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG3_SLOT_CYCLE(value) ((MATRIX_SCFG3_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG3_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG3_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG3_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG3_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG3) Default Master Type */ +#define MATRIX_SCFG3_DEFMSTR_TYPE(value) ((MATRIX_SCFG3_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG3_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG3_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG3) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG3_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG3) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG3_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG3) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG3_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG3_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG3_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG3) Fixed Default Master */ +#define MATRIX_SCFG3_FIXED_DEFMSTR(value) ((MATRIX_SCFG3_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG3_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG4 : (MATRIX Offset: 0x0050) Slave Configuration Register 4 -------- */ +#define MATRIX_SCFG4_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG4_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG4_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG4) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG4_SLOT_CYCLE(value) ((MATRIX_SCFG4_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG4_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG4_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG4_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG4_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG4) Default Master Type */ +#define MATRIX_SCFG4_DEFMSTR_TYPE(value) ((MATRIX_SCFG4_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG4_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG4_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG4) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG4_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG4) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG4_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG4) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG4_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG4_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG4_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG4) Fixed Default Master */ +#define MATRIX_SCFG4_FIXED_DEFMSTR(value) ((MATRIX_SCFG4_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG4_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG5 : (MATRIX Offset: 0x0054) Slave Configuration Register 5 -------- */ +#define MATRIX_SCFG5_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG5_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG5_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG5) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG5_SLOT_CYCLE(value) ((MATRIX_SCFG5_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG5_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG5_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG5_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG5_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG5) Default Master Type */ +#define MATRIX_SCFG5_DEFMSTR_TYPE(value) ((MATRIX_SCFG5_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG5_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG5_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG5) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG5_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG5) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG5_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG5) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG5_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG5_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG5_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG5) Fixed Default Master */ +#define MATRIX_SCFG5_FIXED_DEFMSTR(value) ((MATRIX_SCFG5_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG5_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG6 : (MATRIX Offset: 0x0058) Slave Configuration Register 6 -------- */ +#define MATRIX_SCFG6_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG6_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG6_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG6) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG6_SLOT_CYCLE(value) ((MATRIX_SCFG6_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG6_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG6_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG6_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG6_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG6) Default Master Type */ +#define MATRIX_SCFG6_DEFMSTR_TYPE(value) ((MATRIX_SCFG6_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG6_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG6_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG6) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG6_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG6) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG6_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG6) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG6_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG6_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG6_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG6) Fixed Default Master */ +#define MATRIX_SCFG6_FIXED_DEFMSTR(value) ((MATRIX_SCFG6_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG6_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG7 : (MATRIX Offset: 0x005C) Slave Configuration Register 7 -------- */ +#define MATRIX_SCFG7_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG7_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG7_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG7) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG7_SLOT_CYCLE(value) ((MATRIX_SCFG7_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG7_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG7_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG7_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG7_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG7) Default Master Type */ +#define MATRIX_SCFG7_DEFMSTR_TYPE(value) ((MATRIX_SCFG7_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG7_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG7_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG7) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG7_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG7) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG7_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG7) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG7_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG7_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG7_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG7) Fixed Default Master */ +#define MATRIX_SCFG7_FIXED_DEFMSTR(value) ((MATRIX_SCFG7_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG7_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG8 : (MATRIX Offset: 0x0060) Slave Configuration Register 8 -------- */ +#define MATRIX_SCFG8_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG8_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG8_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG8) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG8_SLOT_CYCLE(value) ((MATRIX_SCFG8_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG8_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG8_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG8_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG8_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG8) Default Master Type */ +#define MATRIX_SCFG8_DEFMSTR_TYPE(value) ((MATRIX_SCFG8_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG8_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG8_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG8) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG8_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG8) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG8_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG8) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG8_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG8_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG8_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG8) Fixed Default Master */ +#define MATRIX_SCFG8_FIXED_DEFMSTR(value) ((MATRIX_SCFG8_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG8_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG9 : (MATRIX Offset: 0x0064) Slave Configuration Register 9 -------- */ +#define MATRIX_SCFG9_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG9_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG9_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG9) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG9_SLOT_CYCLE(value) ((MATRIX_SCFG9_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG9_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG9_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG9_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG9_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG9) Default Master Type */ +#define MATRIX_SCFG9_DEFMSTR_TYPE(value) ((MATRIX_SCFG9_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG9_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG9_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG9) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG9_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG9) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG9_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG9) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG9_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG9_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG9_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG9) Fixed Default Master */ +#define MATRIX_SCFG9_FIXED_DEFMSTR(value) ((MATRIX_SCFG9_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG9_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG10 : (MATRIX Offset: 0x0068) Slave Configuration Register 10 -------- */ +#define MATRIX_SCFG10_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG10_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG10_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG10) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG10_SLOT_CYCLE(value) ((MATRIX_SCFG10_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG10_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG10_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG10_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG10_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG10) Default Master Type */ +#define MATRIX_SCFG10_DEFMSTR_TYPE(value) ((MATRIX_SCFG10_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG10_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG10_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG10) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG10_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG10) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG10_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG10) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG10_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG10_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG10_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG10) Fixed Default Master */ +#define MATRIX_SCFG10_FIXED_DEFMSTR(value) ((MATRIX_SCFG10_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG10_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG11 : (MATRIX Offset: 0x006C) Slave Configuration Register 11 -------- */ +#define MATRIX_SCFG11_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG11_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG11_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG11) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG11_SLOT_CYCLE(value) ((MATRIX_SCFG11_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG11_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG11_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG11_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG11_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG11) Default Master Type */ +#define MATRIX_SCFG11_DEFMSTR_TYPE(value) ((MATRIX_SCFG11_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG11_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG11_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG11) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG11_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG11) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG11_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG11) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG11_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG11_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG11_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG11) Fixed Default Master */ +#define MATRIX_SCFG11_FIXED_DEFMSTR(value) ((MATRIX_SCFG11_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG11_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_SCFG12 : (MATRIX Offset: 0x0070) Slave Configuration Register 12 -------- */ +#define MATRIX_SCFG12_SLOT_CYCLE_Pos 0 +#define MATRIX_SCFG12_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG12_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG12) Maximum Bus Grant Duration for Masters */ +#define MATRIX_SCFG12_SLOT_CYCLE(value) ((MATRIX_SCFG12_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG12_SLOT_CYCLE_Pos))) +#define MATRIX_SCFG12_DEFMSTR_TYPE_Pos 16 +#define MATRIX_SCFG12_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG12_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG12) Default Master Type */ +#define MATRIX_SCFG12_DEFMSTR_TYPE(value) ((MATRIX_SCFG12_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG12_DEFMSTR_TYPE_Pos))) +#define MATRIX_SCFG12_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG12) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ +#define MATRIX_SCFG12_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG12) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ +#define MATRIX_SCFG12_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG12) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ +#define MATRIX_SCFG12_FIXED_DEFMSTR_Pos 18 +#define MATRIX_SCFG12_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG12_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG12) Fixed Default Master */ +#define MATRIX_SCFG12_FIXED_DEFMSTR(value) ((MATRIX_SCFG12_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG12_FIXED_DEFMSTR_Pos))) +/* -------- MATRIX_PRAS : (MATRIX Offset: N/A) Priority Register A for Slave 0 -------- */ +#define MATRIX_PRAS_M0PR_Pos 0 +#define MATRIX_PRAS_M0PR_Msk (0x3u << MATRIX_PRAS_M0PR_Pos) /**< \brief (MATRIX_PRAS) Master 0 Priority */ +#define MATRIX_PRAS_M0PR(value) ((MATRIX_PRAS_M0PR_Msk & ((value) << MATRIX_PRAS_M0PR_Pos))) +#define MATRIX_PRAS_M1PR_Pos 4 +#define MATRIX_PRAS_M1PR_Msk (0x3u << MATRIX_PRAS_M1PR_Pos) /**< \brief (MATRIX_PRAS) Master 1 Priority */ +#define MATRIX_PRAS_M1PR(value) ((MATRIX_PRAS_M1PR_Msk & ((value) << MATRIX_PRAS_M1PR_Pos))) +#define MATRIX_PRAS_M2PR_Pos 8 +#define MATRIX_PRAS_M2PR_Msk (0x3u << MATRIX_PRAS_M2PR_Pos) /**< \brief (MATRIX_PRAS) Master 2 Priority */ +#define MATRIX_PRAS_M2PR(value) ((MATRIX_PRAS_M2PR_Msk & ((value) << MATRIX_PRAS_M2PR_Pos))) +#define MATRIX_PRAS_M3PR_Pos 12 +#define MATRIX_PRAS_M3PR_Msk (0x3u << MATRIX_PRAS_M3PR_Pos) /**< \brief (MATRIX_PRAS) Master 3 Priority */ +#define MATRIX_PRAS_M3PR(value) ((MATRIX_PRAS_M3PR_Msk & ((value) << MATRIX_PRAS_M3PR_Pos))) +#define MATRIX_PRAS_M4PR_Pos 16 +#define MATRIX_PRAS_M4PR_Msk (0x3u << MATRIX_PRAS_M4PR_Pos) /**< \brief (MATRIX_PRAS) Master 4 Priority */ +#define MATRIX_PRAS_M4PR(value) ((MATRIX_PRAS_M4PR_Msk & ((value) << MATRIX_PRAS_M4PR_Pos))) +#define MATRIX_PRAS_M5PR_Pos 20 +#define MATRIX_PRAS_M5PR_Msk (0x3u << MATRIX_PRAS_M5PR_Pos) /**< \brief (MATRIX_PRAS) Master 5 Priority */ +#define MATRIX_PRAS_M5PR(value) ((MATRIX_PRAS_M5PR_Msk & ((value) << MATRIX_PRAS_M5PR_Pos))) +#define MATRIX_PRAS_M6PR_Pos 24 +#define MATRIX_PRAS_M6PR_Msk (0x3u << MATRIX_PRAS_M6PR_Pos) /**< \brief (MATRIX_PRAS) Master 6 Priority */ +#define MATRIX_PRAS_M6PR(value) ((MATRIX_PRAS_M6PR_Msk & ((value) << MATRIX_PRAS_M6PR_Pos))) +#define MATRIX_PRAS_M7PR_Pos 28 +#define MATRIX_PRAS_M7PR_Msk (0x3u << MATRIX_PRAS_M7PR_Pos) /**< \brief (MATRIX_PRAS) Master 7 Priority */ +#define MATRIX_PRAS_M7PR(value) ((MATRIX_PRAS_M7PR_Msk & ((value) << MATRIX_PRAS_M7PR_Pos))) +/* -------- MATRIX_PRBS : (MATRIX Offset: N/A) Priority Register B for Slave 0 -------- */ +#define MATRIX_PRBS_M8PR_Pos 0 +#define MATRIX_PRBS_M8PR_Msk (0x3u << MATRIX_PRBS_M8PR_Pos) /**< \brief (MATRIX_PRBS) Master 8 Priority */ +#define MATRIX_PRBS_M8PR(value) ((MATRIX_PRBS_M8PR_Msk & ((value) << MATRIX_PRBS_M8PR_Pos))) +#define MATRIX_PRBS_M9PR_Pos 4 +#define MATRIX_PRBS_M9PR_Msk (0x3u << MATRIX_PRBS_M9PR_Pos) /**< \brief (MATRIX_PRBS) Master 9 Priority */ +#define MATRIX_PRBS_M9PR(value) ((MATRIX_PRBS_M9PR_Msk & ((value) << MATRIX_PRBS_M9PR_Pos))) +#define MATRIX_PRBS_M10PR_Pos 8 +#define MATRIX_PRBS_M10PR_Msk (0x3u << MATRIX_PRBS_M10PR_Pos) /**< \brief (MATRIX_PRBS) Master 10 Priority */ +#define MATRIX_PRBS_M10PR(value) ((MATRIX_PRBS_M10PR_Msk & ((value) << MATRIX_PRBS_M10PR_Pos))) +#define MATRIX_PRBS_M11PR_Pos 12 +#define MATRIX_PRBS_M11PR_Msk (0x3u << MATRIX_PRBS_M11PR_Pos) /**< \brief (MATRIX_PRBS) Master 11 Priority */ +#define MATRIX_PRBS_M11PR(value) ((MATRIX_PRBS_M11PR_Msk & ((value) << MATRIX_PRBS_M11PR_Pos))) +/* -------- MATRIX_MEIER : (MATRIX Offset: 0x0150) Master Error Interrupt Enable Register -------- */ +#define MATRIX_MEIER_MERR0 (0x1u << 0) /**< \brief (MATRIX_MEIER) Master 0 Access Error */ +#define MATRIX_MEIER_MERR1 (0x1u << 1) /**< \brief (MATRIX_MEIER) Master 1 Access Error */ +#define MATRIX_MEIER_MERR2 (0x1u << 2) /**< \brief (MATRIX_MEIER) Master 2 Access Error */ +#define MATRIX_MEIER_MERR3 (0x1u << 3) /**< \brief (MATRIX_MEIER) Master 3 Access Error */ +#define MATRIX_MEIER_MERR4 (0x1u << 4) /**< \brief (MATRIX_MEIER) Master 4 Access Error */ +#define MATRIX_MEIER_MERR5 (0x1u << 5) /**< \brief (MATRIX_MEIER) Master 5 Access Error */ +#define MATRIX_MEIER_MERR6 (0x1u << 6) /**< \brief (MATRIX_MEIER) Master 6 Access Error */ +#define MATRIX_MEIER_MERR7 (0x1u << 7) /**< \brief (MATRIX_MEIER) Master 7 Access Error */ +#define MATRIX_MEIER_MERR8 (0x1u << 8) /**< \brief (MATRIX_MEIER) Master 8 Access Error */ +#define MATRIX_MEIER_MERR9 (0x1u << 9) /**< \brief (MATRIX_MEIER) Master 9 Access Error */ +#define MATRIX_MEIER_MERR10 (0x1u << 10) /**< \brief (MATRIX_MEIER) Master 10 Access Error */ +#define MATRIX_MEIER_MERR11 (0x1u << 11) /**< \brief (MATRIX_MEIER) Master 11 Access Error */ +/* -------- MATRIX_MEIDR : (MATRIX Offset: 0x0154) Master Error Interrupt Disable Register -------- */ +#define MATRIX_MEIDR_MERR0 (0x1u << 0) /**< \brief (MATRIX_MEIDR) Master 0 Access Error */ +#define MATRIX_MEIDR_MERR1 (0x1u << 1) /**< \brief (MATRIX_MEIDR) Master 1 Access Error */ +#define MATRIX_MEIDR_MERR2 (0x1u << 2) /**< \brief (MATRIX_MEIDR) Master 2 Access Error */ +#define MATRIX_MEIDR_MERR3 (0x1u << 3) /**< \brief (MATRIX_MEIDR) Master 3 Access Error */ +#define MATRIX_MEIDR_MERR4 (0x1u << 4) /**< \brief (MATRIX_MEIDR) Master 4 Access Error */ +#define MATRIX_MEIDR_MERR5 (0x1u << 5) /**< \brief (MATRIX_MEIDR) Master 5 Access Error */ +#define MATRIX_MEIDR_MERR6 (0x1u << 6) /**< \brief (MATRIX_MEIDR) Master 6 Access Error */ +#define MATRIX_MEIDR_MERR7 (0x1u << 7) /**< \brief (MATRIX_MEIDR) Master 7 Access Error */ +#define MATRIX_MEIDR_MERR8 (0x1u << 8) /**< \brief (MATRIX_MEIDR) Master 8 Access Error */ +#define MATRIX_MEIDR_MERR9 (0x1u << 9) /**< \brief (MATRIX_MEIDR) Master 9 Access Error */ +#define MATRIX_MEIDR_MERR10 (0x1u << 10) /**< \brief (MATRIX_MEIDR) Master 10 Access Error */ +#define MATRIX_MEIDR_MERR11 (0x1u << 11) /**< \brief (MATRIX_MEIDR) Master 11 Access Error */ +/* -------- MATRIX_MEIMR : (MATRIX Offset: 0x0158) Master Error Interrupt Mask Register -------- */ +#define MATRIX_MEIMR_MERR0 (0x1u << 0) /**< \brief (MATRIX_MEIMR) Master 0 Access Error */ +#define MATRIX_MEIMR_MERR1 (0x1u << 1) /**< \brief (MATRIX_MEIMR) Master 1 Access Error */ +#define MATRIX_MEIMR_MERR2 (0x1u << 2) /**< \brief (MATRIX_MEIMR) Master 2 Access Error */ +#define MATRIX_MEIMR_MERR3 (0x1u << 3) /**< \brief (MATRIX_MEIMR) Master 3 Access Error */ +#define MATRIX_MEIMR_MERR4 (0x1u << 4) /**< \brief (MATRIX_MEIMR) Master 4 Access Error */ +#define MATRIX_MEIMR_MERR5 (0x1u << 5) /**< \brief (MATRIX_MEIMR) Master 5 Access Error */ +#define MATRIX_MEIMR_MERR6 (0x1u << 6) /**< \brief (MATRIX_MEIMR) Master 6 Access Error */ +#define MATRIX_MEIMR_MERR7 (0x1u << 7) /**< \brief (MATRIX_MEIMR) Master 7 Access Error */ +#define MATRIX_MEIMR_MERR8 (0x1u << 8) /**< \brief (MATRIX_MEIMR) Master 8 Access Error */ +#define MATRIX_MEIMR_MERR9 (0x1u << 9) /**< \brief (MATRIX_MEIMR) Master 9 Access Error */ +#define MATRIX_MEIMR_MERR10 (0x1u << 10) /**< \brief (MATRIX_MEIMR) Master 10 Access Error */ +#define MATRIX_MEIMR_MERR11 (0x1u << 11) /**< \brief (MATRIX_MEIMR) Master 11 Access Error */ +/* -------- MATRIX_MESR : (MATRIX Offset: 0x015C) Master Error Status Register -------- */ +#define MATRIX_MESR_MERR0 (0x1u << 0) /**< \brief (MATRIX_MESR) Master 0 Access Error */ +#define MATRIX_MESR_MERR1 (0x1u << 1) /**< \brief (MATRIX_MESR) Master 1 Access Error */ +#define MATRIX_MESR_MERR2 (0x1u << 2) /**< \brief (MATRIX_MESR) Master 2 Access Error */ +#define MATRIX_MESR_MERR3 (0x1u << 3) /**< \brief (MATRIX_MESR) Master 3 Access Error */ +#define MATRIX_MESR_MERR4 (0x1u << 4) /**< \brief (MATRIX_MESR) Master 4 Access Error */ +#define MATRIX_MESR_MERR5 (0x1u << 5) /**< \brief (MATRIX_MESR) Master 5 Access Error */ +#define MATRIX_MESR_MERR6 (0x1u << 6) /**< \brief (MATRIX_MESR) Master 6 Access Error */ +#define MATRIX_MESR_MERR7 (0x1u << 7) /**< \brief (MATRIX_MESR) Master 7 Access Error */ +#define MATRIX_MESR_MERR8 (0x1u << 8) /**< \brief (MATRIX_MESR) Master 8 Access Error */ +#define MATRIX_MESR_MERR9 (0x1u << 9) /**< \brief (MATRIX_MESR) Master 9 Access Error */ +#define MATRIX_MESR_MERR10 (0x1u << 10) /**< \brief (MATRIX_MESR) Master 10 Access Error */ +#define MATRIX_MESR_MERR11 (0x1u << 11) /**< \brief (MATRIX_MESR) Master 11 Access Error */ +/* -------- MATRIX_MEAR0 : (MATRIX Offset: 0x0160) Master 0 Error Address Register -------- */ +#define MATRIX_MEAR0_ERRADD_Pos 0 +#define MATRIX_MEAR0_ERRADD_Msk (0xffffffffu << MATRIX_MEAR0_ERRADD_Pos) /**< \brief (MATRIX_MEAR0) Master Error Address */ +/* -------- MATRIX_MEAR1 : (MATRIX Offset: 0x0164) Master 1 Error Address Register -------- */ +#define MATRIX_MEAR1_ERRADD_Pos 0 +#define MATRIX_MEAR1_ERRADD_Msk (0xffffffffu << MATRIX_MEAR1_ERRADD_Pos) /**< \brief (MATRIX_MEAR1) Master Error Address */ +/* -------- MATRIX_MEAR2 : (MATRIX Offset: 0x0168) Master 2 Error Address Register -------- */ +#define MATRIX_MEAR2_ERRADD_Pos 0 +#define MATRIX_MEAR2_ERRADD_Msk (0xffffffffu << MATRIX_MEAR2_ERRADD_Pos) /**< \brief (MATRIX_MEAR2) Master Error Address */ +/* -------- MATRIX_MEAR3 : (MATRIX Offset: 0x016C) Master 3 Error Address Register -------- */ +#define MATRIX_MEAR3_ERRADD_Pos 0 +#define MATRIX_MEAR3_ERRADD_Msk (0xffffffffu << MATRIX_MEAR3_ERRADD_Pos) /**< \brief (MATRIX_MEAR3) Master Error Address */ +/* -------- MATRIX_MEAR4 : (MATRIX Offset: 0x0170) Master 4 Error Address Register -------- */ +#define MATRIX_MEAR4_ERRADD_Pos 0 +#define MATRIX_MEAR4_ERRADD_Msk (0xffffffffu << MATRIX_MEAR4_ERRADD_Pos) /**< \brief (MATRIX_MEAR4) Master Error Address */ +/* -------- MATRIX_MEAR5 : (MATRIX Offset: 0x0174) Master 5 Error Address Register -------- */ +#define MATRIX_MEAR5_ERRADD_Pos 0 +#define MATRIX_MEAR5_ERRADD_Msk (0xffffffffu << MATRIX_MEAR5_ERRADD_Pos) /**< \brief (MATRIX_MEAR5) Master Error Address */ +/* -------- MATRIX_MEAR6 : (MATRIX Offset: 0x0178) Master 6 Error Address Register -------- */ +#define MATRIX_MEAR6_ERRADD_Pos 0 +#define MATRIX_MEAR6_ERRADD_Msk (0xffffffffu << MATRIX_MEAR6_ERRADD_Pos) /**< \brief (MATRIX_MEAR6) Master Error Address */ +/* -------- MATRIX_MEAR7 : (MATRIX Offset: 0x017C) Master 7 Error Address Register -------- */ +#define MATRIX_MEAR7_ERRADD_Pos 0 +#define MATRIX_MEAR7_ERRADD_Msk (0xffffffffu << MATRIX_MEAR7_ERRADD_Pos) /**< \brief (MATRIX_MEAR7) Master Error Address */ +/* -------- MATRIX_MEAR8 : (MATRIX Offset: 0x0180) Master 8 Error Address Register -------- */ +#define MATRIX_MEAR8_ERRADD_Pos 0 +#define MATRIX_MEAR8_ERRADD_Msk (0xffffffffu << MATRIX_MEAR8_ERRADD_Pos) /**< \brief (MATRIX_MEAR8) Master Error Address */ +/* -------- MATRIX_MEAR9 : (MATRIX Offset: 0x0184) Master 9 Error Address Register -------- */ +#define MATRIX_MEAR9_ERRADD_Pos 0 +#define MATRIX_MEAR9_ERRADD_Msk (0xffffffffu << MATRIX_MEAR9_ERRADD_Pos) /**< \brief (MATRIX_MEAR9) Master Error Address */ +/* -------- MATRIX_WPMR : (MATRIX Offset: 0x01E4) Write Protection Mode Register -------- */ +#define MATRIX_WPMR_WPEN (0x1u << 0) /**< \brief (MATRIX_WPMR) Write Protection Enable */ +#define MATRIX_WPMR_WPKEY_Pos 8 +#define MATRIX_WPMR_WPKEY_Msk (0xffffffu << MATRIX_WPMR_WPKEY_Pos) /**< \brief (MATRIX_WPMR) Write Protection Key (Write-only) */ +#define MATRIX_WPMR_WPKEY(value) ((MATRIX_WPMR_WPKEY_Msk & ((value) << MATRIX_WPMR_WPKEY_Pos))) +#define MATRIX_WPMR_WPKEY_PASSWD (0x4D4154u << 8) /**< \brief (MATRIX_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- MATRIX_WPSR : (MATRIX Offset: 0x01E8) Write Protection Status Register -------- */ +#define MATRIX_WPSR_WPVS (0x1u << 0) /**< \brief (MATRIX_WPSR) Write Protection Violation Status */ +#define MATRIX_WPSR_WPVSRC_Pos 8 +#define MATRIX_WPSR_WPVSRC_Msk (0xffffu << MATRIX_WPSR_WPVSRC_Pos) /**< \brief (MATRIX_WPSR) Write Protection Violation Source */ +/* -------- MATRIX_VERSION : (MATRIX Offset: 0x01FC) Version Register -------- */ +#define MATRIX_VERSION_VERSION_Pos 0 +#define MATRIX_VERSION_VERSION_Msk (0xfffu << MATRIX_VERSION_VERSION_Pos) /**< \brief (MATRIX_VERSION) Version of the Hardware Module */ +#define MATRIX_VERSION_MFN_Pos 16 +#define MATRIX_VERSION_MFN_Msk (0x7u << MATRIX_VERSION_MFN_Pos) /**< \brief (MATRIX_VERSION) Metal Fix Number */ +/* -------- MATRIX_SSR0 : (MATRIX Offset: 0x0200) Security Slave 0 Register -------- */ +#define MATRIX_SSR0_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR0) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR0) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR0_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR0) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR1 : (MATRIX Offset: 0x0204) Security Slave 1 Register -------- */ +#define MATRIX_SSR1_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR1) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR1) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR1_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR1) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR2 : (MATRIX Offset: 0x0208) Security Slave 2 Register -------- */ +#define MATRIX_SSR2_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR2) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR2) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR2_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR2) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR3 : (MATRIX Offset: 0x020C) Security Slave 3 Register -------- */ +#define MATRIX_SSR3_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR3) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR3) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR3_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR3) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR4 : (MATRIX Offset: 0x0210) Security Slave 4 Register -------- */ +#define MATRIX_SSR4_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR4) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR4) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR4_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR4) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR5 : (MATRIX Offset: 0x0214) Security Slave 5 Register -------- */ +#define MATRIX_SSR5_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR5) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR5) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR5_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR5) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR6 : (MATRIX Offset: 0x0218) Security Slave 6 Register -------- */ +#define MATRIX_SSR6_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR6) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR6) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR6_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR6) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR7 : (MATRIX Offset: 0x021C) Security Slave 7 Register -------- */ +#define MATRIX_SSR7_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR7) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR7) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR7_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR7) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR8 : (MATRIX Offset: 0x0220) Security Slave 8 Register -------- */ +#define MATRIX_SSR8_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR8) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR8) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR8_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR8) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR9 : (MATRIX Offset: 0x0224) Security Slave 9 Register -------- */ +#define MATRIX_SSR9_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR9) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR9) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR9_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR9) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR10 : (MATRIX Offset: 0x0228) Security Slave 10 Register -------- */ +#define MATRIX_SSR10_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR10) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR10) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR10_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR10) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR11 : (MATRIX Offset: 0x022C) Security Slave 11 Register -------- */ +#define MATRIX_SSR11_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR11) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR11) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR11_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR11) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SSR12 : (MATRIX Offset: 0x0230) Security Slave 12 Register -------- */ +#define MATRIX_SSR12_LANSECH0 (0x1u << 0) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH1 (0x1u << 1) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH2 (0x1u << 2) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH3 (0x1u << 3) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH4 (0x1u << 4) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH5 (0x1u << 5) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH6 (0x1u << 6) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_LANSECH7 (0x1u << 7) /**< \brief (MATRIX_SSR12) Low Area Non-secured in HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH0 (0x1u << 8) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH1 (0x1u << 9) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH2 (0x1u << 10) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH3 (0x1u << 11) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH4 (0x1u << 12) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH5 (0x1u << 13) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH6 (0x1u << 14) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_RDNSECH7 (0x1u << 15) /**< \brief (MATRIX_SSR12) Read Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH0 (0x1u << 16) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH1 (0x1u << 17) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH2 (0x1u << 18) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH3 (0x1u << 19) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH4 (0x1u << 20) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH5 (0x1u << 21) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH6 (0x1u << 22) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +#define MATRIX_SSR12_WRNSECH7 (0x1u << 23) /**< \brief (MATRIX_SSR12) Write Non-secured for HSELx Security Region */ +/* -------- MATRIX_SASSR0 : (MATRIX Offset: 0x0240) Security Areas Split Slave 0 Register -------- */ +#define MATRIX_SASSR0_SASPLIT0_Pos 0 +#define MATRIX_SASSR0_SASPLIT0_Msk (0xfu << MATRIX_SASSR0_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT0(value) ((MATRIX_SASSR0_SASPLIT0_Msk & ((value) << MATRIX_SASSR0_SASPLIT0_Pos))) +#define MATRIX_SASSR0_SASPLIT1_Pos 4 +#define MATRIX_SASSR0_SASPLIT1_Msk (0xfu << MATRIX_SASSR0_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT1(value) ((MATRIX_SASSR0_SASPLIT1_Msk & ((value) << MATRIX_SASSR0_SASPLIT1_Pos))) +#define MATRIX_SASSR0_SASPLIT2_Pos 8 +#define MATRIX_SASSR0_SASPLIT2_Msk (0xfu << MATRIX_SASSR0_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT2(value) ((MATRIX_SASSR0_SASPLIT2_Msk & ((value) << MATRIX_SASSR0_SASPLIT2_Pos))) +#define MATRIX_SASSR0_SASPLIT3_Pos 12 +#define MATRIX_SASSR0_SASPLIT3_Msk (0xfu << MATRIX_SASSR0_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT3(value) ((MATRIX_SASSR0_SASPLIT3_Msk & ((value) << MATRIX_SASSR0_SASPLIT3_Pos))) +#define MATRIX_SASSR0_SASPLIT4_Pos 16 +#define MATRIX_SASSR0_SASPLIT4_Msk (0xfu << MATRIX_SASSR0_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT4(value) ((MATRIX_SASSR0_SASPLIT4_Msk & ((value) << MATRIX_SASSR0_SASPLIT4_Pos))) +#define MATRIX_SASSR0_SASPLIT5_Pos 20 +#define MATRIX_SASSR0_SASPLIT5_Msk (0xfu << MATRIX_SASSR0_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT5(value) ((MATRIX_SASSR0_SASPLIT5_Msk & ((value) << MATRIX_SASSR0_SASPLIT5_Pos))) +#define MATRIX_SASSR0_SASPLIT6_Pos 24 +#define MATRIX_SASSR0_SASPLIT6_Msk (0xfu << MATRIX_SASSR0_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT6(value) ((MATRIX_SASSR0_SASPLIT6_Msk & ((value) << MATRIX_SASSR0_SASPLIT6_Pos))) +#define MATRIX_SASSR0_SASPLIT7_Pos 28 +#define MATRIX_SASSR0_SASPLIT7_Msk (0xfu << MATRIX_SASSR0_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR0) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR0_SASPLIT7(value) ((MATRIX_SASSR0_SASPLIT7_Msk & ((value) << MATRIX_SASSR0_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR1 : (MATRIX Offset: 0x0244) Security Areas Split Slave 1 Register -------- */ +#define MATRIX_SASSR1_SASPLIT0_Pos 0 +#define MATRIX_SASSR1_SASPLIT0_Msk (0xfu << MATRIX_SASSR1_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT0(value) ((MATRIX_SASSR1_SASPLIT0_Msk & ((value) << MATRIX_SASSR1_SASPLIT0_Pos))) +#define MATRIX_SASSR1_SASPLIT1_Pos 4 +#define MATRIX_SASSR1_SASPLIT1_Msk (0xfu << MATRIX_SASSR1_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT1(value) ((MATRIX_SASSR1_SASPLIT1_Msk & ((value) << MATRIX_SASSR1_SASPLIT1_Pos))) +#define MATRIX_SASSR1_SASPLIT2_Pos 8 +#define MATRIX_SASSR1_SASPLIT2_Msk (0xfu << MATRIX_SASSR1_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT2(value) ((MATRIX_SASSR1_SASPLIT2_Msk & ((value) << MATRIX_SASSR1_SASPLIT2_Pos))) +#define MATRIX_SASSR1_SASPLIT3_Pos 12 +#define MATRIX_SASSR1_SASPLIT3_Msk (0xfu << MATRIX_SASSR1_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT3(value) ((MATRIX_SASSR1_SASPLIT3_Msk & ((value) << MATRIX_SASSR1_SASPLIT3_Pos))) +#define MATRIX_SASSR1_SASPLIT4_Pos 16 +#define MATRIX_SASSR1_SASPLIT4_Msk (0xfu << MATRIX_SASSR1_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT4(value) ((MATRIX_SASSR1_SASPLIT4_Msk & ((value) << MATRIX_SASSR1_SASPLIT4_Pos))) +#define MATRIX_SASSR1_SASPLIT5_Pos 20 +#define MATRIX_SASSR1_SASPLIT5_Msk (0xfu << MATRIX_SASSR1_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT5(value) ((MATRIX_SASSR1_SASPLIT5_Msk & ((value) << MATRIX_SASSR1_SASPLIT5_Pos))) +#define MATRIX_SASSR1_SASPLIT6_Pos 24 +#define MATRIX_SASSR1_SASPLIT6_Msk (0xfu << MATRIX_SASSR1_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT6(value) ((MATRIX_SASSR1_SASPLIT6_Msk & ((value) << MATRIX_SASSR1_SASPLIT6_Pos))) +#define MATRIX_SASSR1_SASPLIT7_Pos 28 +#define MATRIX_SASSR1_SASPLIT7_Msk (0xfu << MATRIX_SASSR1_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR1) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR1_SASPLIT7(value) ((MATRIX_SASSR1_SASPLIT7_Msk & ((value) << MATRIX_SASSR1_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR2 : (MATRIX Offset: 0x0248) Security Areas Split Slave 2 Register -------- */ +#define MATRIX_SASSR2_SASPLIT0_Pos 0 +#define MATRIX_SASSR2_SASPLIT0_Msk (0xfu << MATRIX_SASSR2_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT0(value) ((MATRIX_SASSR2_SASPLIT0_Msk & ((value) << MATRIX_SASSR2_SASPLIT0_Pos))) +#define MATRIX_SASSR2_SASPLIT1_Pos 4 +#define MATRIX_SASSR2_SASPLIT1_Msk (0xfu << MATRIX_SASSR2_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT1(value) ((MATRIX_SASSR2_SASPLIT1_Msk & ((value) << MATRIX_SASSR2_SASPLIT1_Pos))) +#define MATRIX_SASSR2_SASPLIT2_Pos 8 +#define MATRIX_SASSR2_SASPLIT2_Msk (0xfu << MATRIX_SASSR2_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT2(value) ((MATRIX_SASSR2_SASPLIT2_Msk & ((value) << MATRIX_SASSR2_SASPLIT2_Pos))) +#define MATRIX_SASSR2_SASPLIT3_Pos 12 +#define MATRIX_SASSR2_SASPLIT3_Msk (0xfu << MATRIX_SASSR2_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT3(value) ((MATRIX_SASSR2_SASPLIT3_Msk & ((value) << MATRIX_SASSR2_SASPLIT3_Pos))) +#define MATRIX_SASSR2_SASPLIT4_Pos 16 +#define MATRIX_SASSR2_SASPLIT4_Msk (0xfu << MATRIX_SASSR2_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT4(value) ((MATRIX_SASSR2_SASPLIT4_Msk & ((value) << MATRIX_SASSR2_SASPLIT4_Pos))) +#define MATRIX_SASSR2_SASPLIT5_Pos 20 +#define MATRIX_SASSR2_SASPLIT5_Msk (0xfu << MATRIX_SASSR2_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT5(value) ((MATRIX_SASSR2_SASPLIT5_Msk & ((value) << MATRIX_SASSR2_SASPLIT5_Pos))) +#define MATRIX_SASSR2_SASPLIT6_Pos 24 +#define MATRIX_SASSR2_SASPLIT6_Msk (0xfu << MATRIX_SASSR2_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT6(value) ((MATRIX_SASSR2_SASPLIT6_Msk & ((value) << MATRIX_SASSR2_SASPLIT6_Pos))) +#define MATRIX_SASSR2_SASPLIT7_Pos 28 +#define MATRIX_SASSR2_SASPLIT7_Msk (0xfu << MATRIX_SASSR2_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR2) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR2_SASPLIT7(value) ((MATRIX_SASSR2_SASPLIT7_Msk & ((value) << MATRIX_SASSR2_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR3 : (MATRIX Offset: 0x024C) Security Areas Split Slave 3 Register -------- */ +#define MATRIX_SASSR3_SASPLIT0_Pos 0 +#define MATRIX_SASSR3_SASPLIT0_Msk (0xfu << MATRIX_SASSR3_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT0(value) ((MATRIX_SASSR3_SASPLIT0_Msk & ((value) << MATRIX_SASSR3_SASPLIT0_Pos))) +#define MATRIX_SASSR3_SASPLIT1_Pos 4 +#define MATRIX_SASSR3_SASPLIT1_Msk (0xfu << MATRIX_SASSR3_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT1(value) ((MATRIX_SASSR3_SASPLIT1_Msk & ((value) << MATRIX_SASSR3_SASPLIT1_Pos))) +#define MATRIX_SASSR3_SASPLIT2_Pos 8 +#define MATRIX_SASSR3_SASPLIT2_Msk (0xfu << MATRIX_SASSR3_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT2(value) ((MATRIX_SASSR3_SASPLIT2_Msk & ((value) << MATRIX_SASSR3_SASPLIT2_Pos))) +#define MATRIX_SASSR3_SASPLIT3_Pos 12 +#define MATRIX_SASSR3_SASPLIT3_Msk (0xfu << MATRIX_SASSR3_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT3(value) ((MATRIX_SASSR3_SASPLIT3_Msk & ((value) << MATRIX_SASSR3_SASPLIT3_Pos))) +#define MATRIX_SASSR3_SASPLIT4_Pos 16 +#define MATRIX_SASSR3_SASPLIT4_Msk (0xfu << MATRIX_SASSR3_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT4(value) ((MATRIX_SASSR3_SASPLIT4_Msk & ((value) << MATRIX_SASSR3_SASPLIT4_Pos))) +#define MATRIX_SASSR3_SASPLIT5_Pos 20 +#define MATRIX_SASSR3_SASPLIT5_Msk (0xfu << MATRIX_SASSR3_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT5(value) ((MATRIX_SASSR3_SASPLIT5_Msk & ((value) << MATRIX_SASSR3_SASPLIT5_Pos))) +#define MATRIX_SASSR3_SASPLIT6_Pos 24 +#define MATRIX_SASSR3_SASPLIT6_Msk (0xfu << MATRIX_SASSR3_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT6(value) ((MATRIX_SASSR3_SASPLIT6_Msk & ((value) << MATRIX_SASSR3_SASPLIT6_Pos))) +#define MATRIX_SASSR3_SASPLIT7_Pos 28 +#define MATRIX_SASSR3_SASPLIT7_Msk (0xfu << MATRIX_SASSR3_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR3) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR3_SASPLIT7(value) ((MATRIX_SASSR3_SASPLIT7_Msk & ((value) << MATRIX_SASSR3_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR4 : (MATRIX Offset: 0x0250) Security Areas Split Slave 4 Register -------- */ +#define MATRIX_SASSR4_SASPLIT0_Pos 0 +#define MATRIX_SASSR4_SASPLIT0_Msk (0xfu << MATRIX_SASSR4_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT0(value) ((MATRIX_SASSR4_SASPLIT0_Msk & ((value) << MATRIX_SASSR4_SASPLIT0_Pos))) +#define MATRIX_SASSR4_SASPLIT1_Pos 4 +#define MATRIX_SASSR4_SASPLIT1_Msk (0xfu << MATRIX_SASSR4_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT1(value) ((MATRIX_SASSR4_SASPLIT1_Msk & ((value) << MATRIX_SASSR4_SASPLIT1_Pos))) +#define MATRIX_SASSR4_SASPLIT2_Pos 8 +#define MATRIX_SASSR4_SASPLIT2_Msk (0xfu << MATRIX_SASSR4_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT2(value) ((MATRIX_SASSR4_SASPLIT2_Msk & ((value) << MATRIX_SASSR4_SASPLIT2_Pos))) +#define MATRIX_SASSR4_SASPLIT3_Pos 12 +#define MATRIX_SASSR4_SASPLIT3_Msk (0xfu << MATRIX_SASSR4_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT3(value) ((MATRIX_SASSR4_SASPLIT3_Msk & ((value) << MATRIX_SASSR4_SASPLIT3_Pos))) +#define MATRIX_SASSR4_SASPLIT4_Pos 16 +#define MATRIX_SASSR4_SASPLIT4_Msk (0xfu << MATRIX_SASSR4_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT4(value) ((MATRIX_SASSR4_SASPLIT4_Msk & ((value) << MATRIX_SASSR4_SASPLIT4_Pos))) +#define MATRIX_SASSR4_SASPLIT5_Pos 20 +#define MATRIX_SASSR4_SASPLIT5_Msk (0xfu << MATRIX_SASSR4_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT5(value) ((MATRIX_SASSR4_SASPLIT5_Msk & ((value) << MATRIX_SASSR4_SASPLIT5_Pos))) +#define MATRIX_SASSR4_SASPLIT6_Pos 24 +#define MATRIX_SASSR4_SASPLIT6_Msk (0xfu << MATRIX_SASSR4_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT6(value) ((MATRIX_SASSR4_SASPLIT6_Msk & ((value) << MATRIX_SASSR4_SASPLIT6_Pos))) +#define MATRIX_SASSR4_SASPLIT7_Pos 28 +#define MATRIX_SASSR4_SASPLIT7_Msk (0xfu << MATRIX_SASSR4_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR4) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR4_SASPLIT7(value) ((MATRIX_SASSR4_SASPLIT7_Msk & ((value) << MATRIX_SASSR4_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR5 : (MATRIX Offset: 0x0254) Security Areas Split Slave 5 Register -------- */ +#define MATRIX_SASSR5_SASPLIT0_Pos 0 +#define MATRIX_SASSR5_SASPLIT0_Msk (0xfu << MATRIX_SASSR5_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT0(value) ((MATRIX_SASSR5_SASPLIT0_Msk & ((value) << MATRIX_SASSR5_SASPLIT0_Pos))) +#define MATRIX_SASSR5_SASPLIT1_Pos 4 +#define MATRIX_SASSR5_SASPLIT1_Msk (0xfu << MATRIX_SASSR5_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT1(value) ((MATRIX_SASSR5_SASPLIT1_Msk & ((value) << MATRIX_SASSR5_SASPLIT1_Pos))) +#define MATRIX_SASSR5_SASPLIT2_Pos 8 +#define MATRIX_SASSR5_SASPLIT2_Msk (0xfu << MATRIX_SASSR5_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT2(value) ((MATRIX_SASSR5_SASPLIT2_Msk & ((value) << MATRIX_SASSR5_SASPLIT2_Pos))) +#define MATRIX_SASSR5_SASPLIT3_Pos 12 +#define MATRIX_SASSR5_SASPLIT3_Msk (0xfu << MATRIX_SASSR5_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT3(value) ((MATRIX_SASSR5_SASPLIT3_Msk & ((value) << MATRIX_SASSR5_SASPLIT3_Pos))) +#define MATRIX_SASSR5_SASPLIT4_Pos 16 +#define MATRIX_SASSR5_SASPLIT4_Msk (0xfu << MATRIX_SASSR5_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT4(value) ((MATRIX_SASSR5_SASPLIT4_Msk & ((value) << MATRIX_SASSR5_SASPLIT4_Pos))) +#define MATRIX_SASSR5_SASPLIT5_Pos 20 +#define MATRIX_SASSR5_SASPLIT5_Msk (0xfu << MATRIX_SASSR5_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT5(value) ((MATRIX_SASSR5_SASPLIT5_Msk & ((value) << MATRIX_SASSR5_SASPLIT5_Pos))) +#define MATRIX_SASSR5_SASPLIT6_Pos 24 +#define MATRIX_SASSR5_SASPLIT6_Msk (0xfu << MATRIX_SASSR5_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT6(value) ((MATRIX_SASSR5_SASPLIT6_Msk & ((value) << MATRIX_SASSR5_SASPLIT6_Pos))) +#define MATRIX_SASSR5_SASPLIT7_Pos 28 +#define MATRIX_SASSR5_SASPLIT7_Msk (0xfu << MATRIX_SASSR5_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR5) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR5_SASPLIT7(value) ((MATRIX_SASSR5_SASPLIT7_Msk & ((value) << MATRIX_SASSR5_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR6 : (MATRIX Offset: 0x0258) Security Areas Split Slave 6 Register -------- */ +#define MATRIX_SASSR6_SASPLIT0_Pos 0 +#define MATRIX_SASSR6_SASPLIT0_Msk (0xfu << MATRIX_SASSR6_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT0(value) ((MATRIX_SASSR6_SASPLIT0_Msk & ((value) << MATRIX_SASSR6_SASPLIT0_Pos))) +#define MATRIX_SASSR6_SASPLIT1_Pos 4 +#define MATRIX_SASSR6_SASPLIT1_Msk (0xfu << MATRIX_SASSR6_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT1(value) ((MATRIX_SASSR6_SASPLIT1_Msk & ((value) << MATRIX_SASSR6_SASPLIT1_Pos))) +#define MATRIX_SASSR6_SASPLIT2_Pos 8 +#define MATRIX_SASSR6_SASPLIT2_Msk (0xfu << MATRIX_SASSR6_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT2(value) ((MATRIX_SASSR6_SASPLIT2_Msk & ((value) << MATRIX_SASSR6_SASPLIT2_Pos))) +#define MATRIX_SASSR6_SASPLIT3_Pos 12 +#define MATRIX_SASSR6_SASPLIT3_Msk (0xfu << MATRIX_SASSR6_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT3(value) ((MATRIX_SASSR6_SASPLIT3_Msk & ((value) << MATRIX_SASSR6_SASPLIT3_Pos))) +#define MATRIX_SASSR6_SASPLIT4_Pos 16 +#define MATRIX_SASSR6_SASPLIT4_Msk (0xfu << MATRIX_SASSR6_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT4(value) ((MATRIX_SASSR6_SASPLIT4_Msk & ((value) << MATRIX_SASSR6_SASPLIT4_Pos))) +#define MATRIX_SASSR6_SASPLIT5_Pos 20 +#define MATRIX_SASSR6_SASPLIT5_Msk (0xfu << MATRIX_SASSR6_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT5(value) ((MATRIX_SASSR6_SASPLIT5_Msk & ((value) << MATRIX_SASSR6_SASPLIT5_Pos))) +#define MATRIX_SASSR6_SASPLIT6_Pos 24 +#define MATRIX_SASSR6_SASPLIT6_Msk (0xfu << MATRIX_SASSR6_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT6(value) ((MATRIX_SASSR6_SASPLIT6_Msk & ((value) << MATRIX_SASSR6_SASPLIT6_Pos))) +#define MATRIX_SASSR6_SASPLIT7_Pos 28 +#define MATRIX_SASSR6_SASPLIT7_Msk (0xfu << MATRIX_SASSR6_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR6) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR6_SASPLIT7(value) ((MATRIX_SASSR6_SASPLIT7_Msk & ((value) << MATRIX_SASSR6_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR7 : (MATRIX Offset: 0x025C) Security Areas Split Slave 7 Register -------- */ +#define MATRIX_SASSR7_SASPLIT0_Pos 0 +#define MATRIX_SASSR7_SASPLIT0_Msk (0xfu << MATRIX_SASSR7_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT0(value) ((MATRIX_SASSR7_SASPLIT0_Msk & ((value) << MATRIX_SASSR7_SASPLIT0_Pos))) +#define MATRIX_SASSR7_SASPLIT1_Pos 4 +#define MATRIX_SASSR7_SASPLIT1_Msk (0xfu << MATRIX_SASSR7_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT1(value) ((MATRIX_SASSR7_SASPLIT1_Msk & ((value) << MATRIX_SASSR7_SASPLIT1_Pos))) +#define MATRIX_SASSR7_SASPLIT2_Pos 8 +#define MATRIX_SASSR7_SASPLIT2_Msk (0xfu << MATRIX_SASSR7_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT2(value) ((MATRIX_SASSR7_SASPLIT2_Msk & ((value) << MATRIX_SASSR7_SASPLIT2_Pos))) +#define MATRIX_SASSR7_SASPLIT3_Pos 12 +#define MATRIX_SASSR7_SASPLIT3_Msk (0xfu << MATRIX_SASSR7_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT3(value) ((MATRIX_SASSR7_SASPLIT3_Msk & ((value) << MATRIX_SASSR7_SASPLIT3_Pos))) +#define MATRIX_SASSR7_SASPLIT4_Pos 16 +#define MATRIX_SASSR7_SASPLIT4_Msk (0xfu << MATRIX_SASSR7_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT4(value) ((MATRIX_SASSR7_SASPLIT4_Msk & ((value) << MATRIX_SASSR7_SASPLIT4_Pos))) +#define MATRIX_SASSR7_SASPLIT5_Pos 20 +#define MATRIX_SASSR7_SASPLIT5_Msk (0xfu << MATRIX_SASSR7_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT5(value) ((MATRIX_SASSR7_SASPLIT5_Msk & ((value) << MATRIX_SASSR7_SASPLIT5_Pos))) +#define MATRIX_SASSR7_SASPLIT6_Pos 24 +#define MATRIX_SASSR7_SASPLIT6_Msk (0xfu << MATRIX_SASSR7_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT6(value) ((MATRIX_SASSR7_SASPLIT6_Msk & ((value) << MATRIX_SASSR7_SASPLIT6_Pos))) +#define MATRIX_SASSR7_SASPLIT7_Pos 28 +#define MATRIX_SASSR7_SASPLIT7_Msk (0xfu << MATRIX_SASSR7_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR7) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR7_SASPLIT7(value) ((MATRIX_SASSR7_SASPLIT7_Msk & ((value) << MATRIX_SASSR7_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR8 : (MATRIX Offset: 0x0260) Security Areas Split Slave 8 Register -------- */ +#define MATRIX_SASSR8_SASPLIT0_Pos 0 +#define MATRIX_SASSR8_SASPLIT0_Msk (0xfu << MATRIX_SASSR8_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT0(value) ((MATRIX_SASSR8_SASPLIT0_Msk & ((value) << MATRIX_SASSR8_SASPLIT0_Pos))) +#define MATRIX_SASSR8_SASPLIT1_Pos 4 +#define MATRIX_SASSR8_SASPLIT1_Msk (0xfu << MATRIX_SASSR8_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT1(value) ((MATRIX_SASSR8_SASPLIT1_Msk & ((value) << MATRIX_SASSR8_SASPLIT1_Pos))) +#define MATRIX_SASSR8_SASPLIT2_Pos 8 +#define MATRIX_SASSR8_SASPLIT2_Msk (0xfu << MATRIX_SASSR8_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT2(value) ((MATRIX_SASSR8_SASPLIT2_Msk & ((value) << MATRIX_SASSR8_SASPLIT2_Pos))) +#define MATRIX_SASSR8_SASPLIT3_Pos 12 +#define MATRIX_SASSR8_SASPLIT3_Msk (0xfu << MATRIX_SASSR8_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT3(value) ((MATRIX_SASSR8_SASPLIT3_Msk & ((value) << MATRIX_SASSR8_SASPLIT3_Pos))) +#define MATRIX_SASSR8_SASPLIT4_Pos 16 +#define MATRIX_SASSR8_SASPLIT4_Msk (0xfu << MATRIX_SASSR8_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT4(value) ((MATRIX_SASSR8_SASPLIT4_Msk & ((value) << MATRIX_SASSR8_SASPLIT4_Pos))) +#define MATRIX_SASSR8_SASPLIT5_Pos 20 +#define MATRIX_SASSR8_SASPLIT5_Msk (0xfu << MATRIX_SASSR8_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT5(value) ((MATRIX_SASSR8_SASPLIT5_Msk & ((value) << MATRIX_SASSR8_SASPLIT5_Pos))) +#define MATRIX_SASSR8_SASPLIT6_Pos 24 +#define MATRIX_SASSR8_SASPLIT6_Msk (0xfu << MATRIX_SASSR8_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT6(value) ((MATRIX_SASSR8_SASPLIT6_Msk & ((value) << MATRIX_SASSR8_SASPLIT6_Pos))) +#define MATRIX_SASSR8_SASPLIT7_Pos 28 +#define MATRIX_SASSR8_SASPLIT7_Msk (0xfu << MATRIX_SASSR8_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR8) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR8_SASPLIT7(value) ((MATRIX_SASSR8_SASPLIT7_Msk & ((value) << MATRIX_SASSR8_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR9 : (MATRIX Offset: 0x0264) Security Areas Split Slave 9 Register -------- */ +#define MATRIX_SASSR9_SASPLIT0_Pos 0 +#define MATRIX_SASSR9_SASPLIT0_Msk (0xfu << MATRIX_SASSR9_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT0(value) ((MATRIX_SASSR9_SASPLIT0_Msk & ((value) << MATRIX_SASSR9_SASPLIT0_Pos))) +#define MATRIX_SASSR9_SASPLIT1_Pos 4 +#define MATRIX_SASSR9_SASPLIT1_Msk (0xfu << MATRIX_SASSR9_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT1(value) ((MATRIX_SASSR9_SASPLIT1_Msk & ((value) << MATRIX_SASSR9_SASPLIT1_Pos))) +#define MATRIX_SASSR9_SASPLIT2_Pos 8 +#define MATRIX_SASSR9_SASPLIT2_Msk (0xfu << MATRIX_SASSR9_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT2(value) ((MATRIX_SASSR9_SASPLIT2_Msk & ((value) << MATRIX_SASSR9_SASPLIT2_Pos))) +#define MATRIX_SASSR9_SASPLIT3_Pos 12 +#define MATRIX_SASSR9_SASPLIT3_Msk (0xfu << MATRIX_SASSR9_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT3(value) ((MATRIX_SASSR9_SASPLIT3_Msk & ((value) << MATRIX_SASSR9_SASPLIT3_Pos))) +#define MATRIX_SASSR9_SASPLIT4_Pos 16 +#define MATRIX_SASSR9_SASPLIT4_Msk (0xfu << MATRIX_SASSR9_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT4(value) ((MATRIX_SASSR9_SASPLIT4_Msk & ((value) << MATRIX_SASSR9_SASPLIT4_Pos))) +#define MATRIX_SASSR9_SASPLIT5_Pos 20 +#define MATRIX_SASSR9_SASPLIT5_Msk (0xfu << MATRIX_SASSR9_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT5(value) ((MATRIX_SASSR9_SASPLIT5_Msk & ((value) << MATRIX_SASSR9_SASPLIT5_Pos))) +#define MATRIX_SASSR9_SASPLIT6_Pos 24 +#define MATRIX_SASSR9_SASPLIT6_Msk (0xfu << MATRIX_SASSR9_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT6(value) ((MATRIX_SASSR9_SASPLIT6_Msk & ((value) << MATRIX_SASSR9_SASPLIT6_Pos))) +#define MATRIX_SASSR9_SASPLIT7_Pos 28 +#define MATRIX_SASSR9_SASPLIT7_Msk (0xfu << MATRIX_SASSR9_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR9) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR9_SASPLIT7(value) ((MATRIX_SASSR9_SASPLIT7_Msk & ((value) << MATRIX_SASSR9_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR10 : (MATRIX Offset: 0x0268) Security Areas Split Slave 10 Register -------- */ +#define MATRIX_SASSR10_SASPLIT0_Pos 0 +#define MATRIX_SASSR10_SASPLIT0_Msk (0xfu << MATRIX_SASSR10_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT0(value) ((MATRIX_SASSR10_SASPLIT0_Msk & ((value) << MATRIX_SASSR10_SASPLIT0_Pos))) +#define MATRIX_SASSR10_SASPLIT1_Pos 4 +#define MATRIX_SASSR10_SASPLIT1_Msk (0xfu << MATRIX_SASSR10_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT1(value) ((MATRIX_SASSR10_SASPLIT1_Msk & ((value) << MATRIX_SASSR10_SASPLIT1_Pos))) +#define MATRIX_SASSR10_SASPLIT2_Pos 8 +#define MATRIX_SASSR10_SASPLIT2_Msk (0xfu << MATRIX_SASSR10_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT2(value) ((MATRIX_SASSR10_SASPLIT2_Msk & ((value) << MATRIX_SASSR10_SASPLIT2_Pos))) +#define MATRIX_SASSR10_SASPLIT3_Pos 12 +#define MATRIX_SASSR10_SASPLIT3_Msk (0xfu << MATRIX_SASSR10_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT3(value) ((MATRIX_SASSR10_SASPLIT3_Msk & ((value) << MATRIX_SASSR10_SASPLIT3_Pos))) +#define MATRIX_SASSR10_SASPLIT4_Pos 16 +#define MATRIX_SASSR10_SASPLIT4_Msk (0xfu << MATRIX_SASSR10_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT4(value) ((MATRIX_SASSR10_SASPLIT4_Msk & ((value) << MATRIX_SASSR10_SASPLIT4_Pos))) +#define MATRIX_SASSR10_SASPLIT5_Pos 20 +#define MATRIX_SASSR10_SASPLIT5_Msk (0xfu << MATRIX_SASSR10_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT5(value) ((MATRIX_SASSR10_SASPLIT5_Msk & ((value) << MATRIX_SASSR10_SASPLIT5_Pos))) +#define MATRIX_SASSR10_SASPLIT6_Pos 24 +#define MATRIX_SASSR10_SASPLIT6_Msk (0xfu << MATRIX_SASSR10_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT6(value) ((MATRIX_SASSR10_SASPLIT6_Msk & ((value) << MATRIX_SASSR10_SASPLIT6_Pos))) +#define MATRIX_SASSR10_SASPLIT7_Pos 28 +#define MATRIX_SASSR10_SASPLIT7_Msk (0xfu << MATRIX_SASSR10_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR10) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR10_SASPLIT7(value) ((MATRIX_SASSR10_SASPLIT7_Msk & ((value) << MATRIX_SASSR10_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR11 : (MATRIX Offset: 0x026C) Security Areas Split Slave 11 Register -------- */ +#define MATRIX_SASSR11_SASPLIT0_Pos 0 +#define MATRIX_SASSR11_SASPLIT0_Msk (0xfu << MATRIX_SASSR11_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT0(value) ((MATRIX_SASSR11_SASPLIT0_Msk & ((value) << MATRIX_SASSR11_SASPLIT0_Pos))) +#define MATRIX_SASSR11_SASPLIT1_Pos 4 +#define MATRIX_SASSR11_SASPLIT1_Msk (0xfu << MATRIX_SASSR11_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT1(value) ((MATRIX_SASSR11_SASPLIT1_Msk & ((value) << MATRIX_SASSR11_SASPLIT1_Pos))) +#define MATRIX_SASSR11_SASPLIT2_Pos 8 +#define MATRIX_SASSR11_SASPLIT2_Msk (0xfu << MATRIX_SASSR11_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT2(value) ((MATRIX_SASSR11_SASPLIT2_Msk & ((value) << MATRIX_SASSR11_SASPLIT2_Pos))) +#define MATRIX_SASSR11_SASPLIT3_Pos 12 +#define MATRIX_SASSR11_SASPLIT3_Msk (0xfu << MATRIX_SASSR11_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT3(value) ((MATRIX_SASSR11_SASPLIT3_Msk & ((value) << MATRIX_SASSR11_SASPLIT3_Pos))) +#define MATRIX_SASSR11_SASPLIT4_Pos 16 +#define MATRIX_SASSR11_SASPLIT4_Msk (0xfu << MATRIX_SASSR11_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT4(value) ((MATRIX_SASSR11_SASPLIT4_Msk & ((value) << MATRIX_SASSR11_SASPLIT4_Pos))) +#define MATRIX_SASSR11_SASPLIT5_Pos 20 +#define MATRIX_SASSR11_SASPLIT5_Msk (0xfu << MATRIX_SASSR11_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT5(value) ((MATRIX_SASSR11_SASPLIT5_Msk & ((value) << MATRIX_SASSR11_SASPLIT5_Pos))) +#define MATRIX_SASSR11_SASPLIT6_Pos 24 +#define MATRIX_SASSR11_SASPLIT6_Msk (0xfu << MATRIX_SASSR11_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT6(value) ((MATRIX_SASSR11_SASPLIT6_Msk & ((value) << MATRIX_SASSR11_SASPLIT6_Pos))) +#define MATRIX_SASSR11_SASPLIT7_Pos 28 +#define MATRIX_SASSR11_SASPLIT7_Msk (0xfu << MATRIX_SASSR11_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR11) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR11_SASPLIT7(value) ((MATRIX_SASSR11_SASPLIT7_Msk & ((value) << MATRIX_SASSR11_SASPLIT7_Pos))) +/* -------- MATRIX_SASSR12 : (MATRIX Offset: 0x0270) Security Areas Split Slave 12 Register -------- */ +#define MATRIX_SASSR12_SASPLIT0_Pos 0 +#define MATRIX_SASSR12_SASPLIT0_Msk (0xfu << MATRIX_SASSR12_SASPLIT0_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT0(value) ((MATRIX_SASSR12_SASPLIT0_Msk & ((value) << MATRIX_SASSR12_SASPLIT0_Pos))) +#define MATRIX_SASSR12_SASPLIT1_Pos 4 +#define MATRIX_SASSR12_SASPLIT1_Msk (0xfu << MATRIX_SASSR12_SASPLIT1_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT1(value) ((MATRIX_SASSR12_SASPLIT1_Msk & ((value) << MATRIX_SASSR12_SASPLIT1_Pos))) +#define MATRIX_SASSR12_SASPLIT2_Pos 8 +#define MATRIX_SASSR12_SASPLIT2_Msk (0xfu << MATRIX_SASSR12_SASPLIT2_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT2(value) ((MATRIX_SASSR12_SASPLIT2_Msk & ((value) << MATRIX_SASSR12_SASPLIT2_Pos))) +#define MATRIX_SASSR12_SASPLIT3_Pos 12 +#define MATRIX_SASSR12_SASPLIT3_Msk (0xfu << MATRIX_SASSR12_SASPLIT3_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT3(value) ((MATRIX_SASSR12_SASPLIT3_Msk & ((value) << MATRIX_SASSR12_SASPLIT3_Pos))) +#define MATRIX_SASSR12_SASPLIT4_Pos 16 +#define MATRIX_SASSR12_SASPLIT4_Msk (0xfu << MATRIX_SASSR12_SASPLIT4_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT4(value) ((MATRIX_SASSR12_SASPLIT4_Msk & ((value) << MATRIX_SASSR12_SASPLIT4_Pos))) +#define MATRIX_SASSR12_SASPLIT5_Pos 20 +#define MATRIX_SASSR12_SASPLIT5_Msk (0xfu << MATRIX_SASSR12_SASPLIT5_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT5(value) ((MATRIX_SASSR12_SASPLIT5_Msk & ((value) << MATRIX_SASSR12_SASPLIT5_Pos))) +#define MATRIX_SASSR12_SASPLIT6_Pos 24 +#define MATRIX_SASSR12_SASPLIT6_Msk (0xfu << MATRIX_SASSR12_SASPLIT6_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT6(value) ((MATRIX_SASSR12_SASPLIT6_Msk & ((value) << MATRIX_SASSR12_SASPLIT6_Pos))) +#define MATRIX_SASSR12_SASPLIT7_Pos 28 +#define MATRIX_SASSR12_SASPLIT7_Msk (0xfu << MATRIX_SASSR12_SASPLIT7_Pos) /**< \brief (MATRIX_SASSR12) Security Areas Split for HSELx Security Region */ +#define MATRIX_SASSR12_SASPLIT7(value) ((MATRIX_SASSR12_SASPLIT7_Msk & ((value) << MATRIX_SASSR12_SASPLIT7_Pos))) +/* -------- MATRIX_SRTSR1 : (MATRIX Offset: 0x0284) Security Region Top Slave 1 Register -------- */ +#define MATRIX_SRTSR1_SRTOP0_Pos 0 +#define MATRIX_SRTSR1_SRTOP0_Msk (0xfu << MATRIX_SRTSR1_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP0(value) ((MATRIX_SRTSR1_SRTOP0_Msk & ((value) << MATRIX_SRTSR1_SRTOP0_Pos))) +#define MATRIX_SRTSR1_SRTOP1_Pos 4 +#define MATRIX_SRTSR1_SRTOP1_Msk (0xfu << MATRIX_SRTSR1_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP1(value) ((MATRIX_SRTSR1_SRTOP1_Msk & ((value) << MATRIX_SRTSR1_SRTOP1_Pos))) +#define MATRIX_SRTSR1_SRTOP2_Pos 8 +#define MATRIX_SRTSR1_SRTOP2_Msk (0xfu << MATRIX_SRTSR1_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP2(value) ((MATRIX_SRTSR1_SRTOP2_Msk & ((value) << MATRIX_SRTSR1_SRTOP2_Pos))) +#define MATRIX_SRTSR1_SRTOP3_Pos 12 +#define MATRIX_SRTSR1_SRTOP3_Msk (0xfu << MATRIX_SRTSR1_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP3(value) ((MATRIX_SRTSR1_SRTOP3_Msk & ((value) << MATRIX_SRTSR1_SRTOP3_Pos))) +#define MATRIX_SRTSR1_SRTOP4_Pos 16 +#define MATRIX_SRTSR1_SRTOP4_Msk (0xfu << MATRIX_SRTSR1_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP4(value) ((MATRIX_SRTSR1_SRTOP4_Msk & ((value) << MATRIX_SRTSR1_SRTOP4_Pos))) +#define MATRIX_SRTSR1_SRTOP5_Pos 20 +#define MATRIX_SRTSR1_SRTOP5_Msk (0xfu << MATRIX_SRTSR1_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP5(value) ((MATRIX_SRTSR1_SRTOP5_Msk & ((value) << MATRIX_SRTSR1_SRTOP5_Pos))) +#define MATRIX_SRTSR1_SRTOP6_Pos 24 +#define MATRIX_SRTSR1_SRTOP6_Msk (0xfu << MATRIX_SRTSR1_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP6(value) ((MATRIX_SRTSR1_SRTOP6_Msk & ((value) << MATRIX_SRTSR1_SRTOP6_Pos))) +#define MATRIX_SRTSR1_SRTOP7_Pos 28 +#define MATRIX_SRTSR1_SRTOP7_Msk (0xfu << MATRIX_SRTSR1_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR1) HSELx Security Region Top */ +#define MATRIX_SRTSR1_SRTOP7(value) ((MATRIX_SRTSR1_SRTOP7_Msk & ((value) << MATRIX_SRTSR1_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR2 : (MATRIX Offset: 0x0288) Security Region Top Slave 2 Register -------- */ +#define MATRIX_SRTSR2_SRTOP0_Pos 0 +#define MATRIX_SRTSR2_SRTOP0_Msk (0xfu << MATRIX_SRTSR2_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP0(value) ((MATRIX_SRTSR2_SRTOP0_Msk & ((value) << MATRIX_SRTSR2_SRTOP0_Pos))) +#define MATRIX_SRTSR2_SRTOP1_Pos 4 +#define MATRIX_SRTSR2_SRTOP1_Msk (0xfu << MATRIX_SRTSR2_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP1(value) ((MATRIX_SRTSR2_SRTOP1_Msk & ((value) << MATRIX_SRTSR2_SRTOP1_Pos))) +#define MATRIX_SRTSR2_SRTOP2_Pos 8 +#define MATRIX_SRTSR2_SRTOP2_Msk (0xfu << MATRIX_SRTSR2_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP2(value) ((MATRIX_SRTSR2_SRTOP2_Msk & ((value) << MATRIX_SRTSR2_SRTOP2_Pos))) +#define MATRIX_SRTSR2_SRTOP3_Pos 12 +#define MATRIX_SRTSR2_SRTOP3_Msk (0xfu << MATRIX_SRTSR2_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP3(value) ((MATRIX_SRTSR2_SRTOP3_Msk & ((value) << MATRIX_SRTSR2_SRTOP3_Pos))) +#define MATRIX_SRTSR2_SRTOP4_Pos 16 +#define MATRIX_SRTSR2_SRTOP4_Msk (0xfu << MATRIX_SRTSR2_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP4(value) ((MATRIX_SRTSR2_SRTOP4_Msk & ((value) << MATRIX_SRTSR2_SRTOP4_Pos))) +#define MATRIX_SRTSR2_SRTOP5_Pos 20 +#define MATRIX_SRTSR2_SRTOP5_Msk (0xfu << MATRIX_SRTSR2_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP5(value) ((MATRIX_SRTSR2_SRTOP5_Msk & ((value) << MATRIX_SRTSR2_SRTOP5_Pos))) +#define MATRIX_SRTSR2_SRTOP6_Pos 24 +#define MATRIX_SRTSR2_SRTOP6_Msk (0xfu << MATRIX_SRTSR2_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP6(value) ((MATRIX_SRTSR2_SRTOP6_Msk & ((value) << MATRIX_SRTSR2_SRTOP6_Pos))) +#define MATRIX_SRTSR2_SRTOP7_Pos 28 +#define MATRIX_SRTSR2_SRTOP7_Msk (0xfu << MATRIX_SRTSR2_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR2) HSELx Security Region Top */ +#define MATRIX_SRTSR2_SRTOP7(value) ((MATRIX_SRTSR2_SRTOP7_Msk & ((value) << MATRIX_SRTSR2_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR3 : (MATRIX Offset: 0x028C) Security Region Top Slave 3 Register -------- */ +#define MATRIX_SRTSR3_SRTOP0_Pos 0 +#define MATRIX_SRTSR3_SRTOP0_Msk (0xfu << MATRIX_SRTSR3_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP0(value) ((MATRIX_SRTSR3_SRTOP0_Msk & ((value) << MATRIX_SRTSR3_SRTOP0_Pos))) +#define MATRIX_SRTSR3_SRTOP1_Pos 4 +#define MATRIX_SRTSR3_SRTOP1_Msk (0xfu << MATRIX_SRTSR3_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP1(value) ((MATRIX_SRTSR3_SRTOP1_Msk & ((value) << MATRIX_SRTSR3_SRTOP1_Pos))) +#define MATRIX_SRTSR3_SRTOP2_Pos 8 +#define MATRIX_SRTSR3_SRTOP2_Msk (0xfu << MATRIX_SRTSR3_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP2(value) ((MATRIX_SRTSR3_SRTOP2_Msk & ((value) << MATRIX_SRTSR3_SRTOP2_Pos))) +#define MATRIX_SRTSR3_SRTOP3_Pos 12 +#define MATRIX_SRTSR3_SRTOP3_Msk (0xfu << MATRIX_SRTSR3_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP3(value) ((MATRIX_SRTSR3_SRTOP3_Msk & ((value) << MATRIX_SRTSR3_SRTOP3_Pos))) +#define MATRIX_SRTSR3_SRTOP4_Pos 16 +#define MATRIX_SRTSR3_SRTOP4_Msk (0xfu << MATRIX_SRTSR3_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP4(value) ((MATRIX_SRTSR3_SRTOP4_Msk & ((value) << MATRIX_SRTSR3_SRTOP4_Pos))) +#define MATRIX_SRTSR3_SRTOP5_Pos 20 +#define MATRIX_SRTSR3_SRTOP5_Msk (0xfu << MATRIX_SRTSR3_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP5(value) ((MATRIX_SRTSR3_SRTOP5_Msk & ((value) << MATRIX_SRTSR3_SRTOP5_Pos))) +#define MATRIX_SRTSR3_SRTOP6_Pos 24 +#define MATRIX_SRTSR3_SRTOP6_Msk (0xfu << MATRIX_SRTSR3_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP6(value) ((MATRIX_SRTSR3_SRTOP6_Msk & ((value) << MATRIX_SRTSR3_SRTOP6_Pos))) +#define MATRIX_SRTSR3_SRTOP7_Pos 28 +#define MATRIX_SRTSR3_SRTOP7_Msk (0xfu << MATRIX_SRTSR3_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR3) HSELx Security Region Top */ +#define MATRIX_SRTSR3_SRTOP7(value) ((MATRIX_SRTSR3_SRTOP7_Msk & ((value) << MATRIX_SRTSR3_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR4 : (MATRIX Offset: 0x0290) Security Region Top Slave 4 Register -------- */ +#define MATRIX_SRTSR4_SRTOP0_Pos 0 +#define MATRIX_SRTSR4_SRTOP0_Msk (0xfu << MATRIX_SRTSR4_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP0(value) ((MATRIX_SRTSR4_SRTOP0_Msk & ((value) << MATRIX_SRTSR4_SRTOP0_Pos))) +#define MATRIX_SRTSR4_SRTOP1_Pos 4 +#define MATRIX_SRTSR4_SRTOP1_Msk (0xfu << MATRIX_SRTSR4_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP1(value) ((MATRIX_SRTSR4_SRTOP1_Msk & ((value) << MATRIX_SRTSR4_SRTOP1_Pos))) +#define MATRIX_SRTSR4_SRTOP2_Pos 8 +#define MATRIX_SRTSR4_SRTOP2_Msk (0xfu << MATRIX_SRTSR4_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP2(value) ((MATRIX_SRTSR4_SRTOP2_Msk & ((value) << MATRIX_SRTSR4_SRTOP2_Pos))) +#define MATRIX_SRTSR4_SRTOP3_Pos 12 +#define MATRIX_SRTSR4_SRTOP3_Msk (0xfu << MATRIX_SRTSR4_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP3(value) ((MATRIX_SRTSR4_SRTOP3_Msk & ((value) << MATRIX_SRTSR4_SRTOP3_Pos))) +#define MATRIX_SRTSR4_SRTOP4_Pos 16 +#define MATRIX_SRTSR4_SRTOP4_Msk (0xfu << MATRIX_SRTSR4_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP4(value) ((MATRIX_SRTSR4_SRTOP4_Msk & ((value) << MATRIX_SRTSR4_SRTOP4_Pos))) +#define MATRIX_SRTSR4_SRTOP5_Pos 20 +#define MATRIX_SRTSR4_SRTOP5_Msk (0xfu << MATRIX_SRTSR4_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP5(value) ((MATRIX_SRTSR4_SRTOP5_Msk & ((value) << MATRIX_SRTSR4_SRTOP5_Pos))) +#define MATRIX_SRTSR4_SRTOP6_Pos 24 +#define MATRIX_SRTSR4_SRTOP6_Msk (0xfu << MATRIX_SRTSR4_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP6(value) ((MATRIX_SRTSR4_SRTOP6_Msk & ((value) << MATRIX_SRTSR4_SRTOP6_Pos))) +#define MATRIX_SRTSR4_SRTOP7_Pos 28 +#define MATRIX_SRTSR4_SRTOP7_Msk (0xfu << MATRIX_SRTSR4_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR4) HSELx Security Region Top */ +#define MATRIX_SRTSR4_SRTOP7(value) ((MATRIX_SRTSR4_SRTOP7_Msk & ((value) << MATRIX_SRTSR4_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR5 : (MATRIX Offset: 0x0294) Security Region Top Slave 5 Register -------- */ +#define MATRIX_SRTSR5_SRTOP0_Pos 0 +#define MATRIX_SRTSR5_SRTOP0_Msk (0xfu << MATRIX_SRTSR5_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP0(value) ((MATRIX_SRTSR5_SRTOP0_Msk & ((value) << MATRIX_SRTSR5_SRTOP0_Pos))) +#define MATRIX_SRTSR5_SRTOP1_Pos 4 +#define MATRIX_SRTSR5_SRTOP1_Msk (0xfu << MATRIX_SRTSR5_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP1(value) ((MATRIX_SRTSR5_SRTOP1_Msk & ((value) << MATRIX_SRTSR5_SRTOP1_Pos))) +#define MATRIX_SRTSR5_SRTOP2_Pos 8 +#define MATRIX_SRTSR5_SRTOP2_Msk (0xfu << MATRIX_SRTSR5_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP2(value) ((MATRIX_SRTSR5_SRTOP2_Msk & ((value) << MATRIX_SRTSR5_SRTOP2_Pos))) +#define MATRIX_SRTSR5_SRTOP3_Pos 12 +#define MATRIX_SRTSR5_SRTOP3_Msk (0xfu << MATRIX_SRTSR5_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP3(value) ((MATRIX_SRTSR5_SRTOP3_Msk & ((value) << MATRIX_SRTSR5_SRTOP3_Pos))) +#define MATRIX_SRTSR5_SRTOP4_Pos 16 +#define MATRIX_SRTSR5_SRTOP4_Msk (0xfu << MATRIX_SRTSR5_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP4(value) ((MATRIX_SRTSR5_SRTOP4_Msk & ((value) << MATRIX_SRTSR5_SRTOP4_Pos))) +#define MATRIX_SRTSR5_SRTOP5_Pos 20 +#define MATRIX_SRTSR5_SRTOP5_Msk (0xfu << MATRIX_SRTSR5_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP5(value) ((MATRIX_SRTSR5_SRTOP5_Msk & ((value) << MATRIX_SRTSR5_SRTOP5_Pos))) +#define MATRIX_SRTSR5_SRTOP6_Pos 24 +#define MATRIX_SRTSR5_SRTOP6_Msk (0xfu << MATRIX_SRTSR5_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP6(value) ((MATRIX_SRTSR5_SRTOP6_Msk & ((value) << MATRIX_SRTSR5_SRTOP6_Pos))) +#define MATRIX_SRTSR5_SRTOP7_Pos 28 +#define MATRIX_SRTSR5_SRTOP7_Msk (0xfu << MATRIX_SRTSR5_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR5) HSELx Security Region Top */ +#define MATRIX_SRTSR5_SRTOP7(value) ((MATRIX_SRTSR5_SRTOP7_Msk & ((value) << MATRIX_SRTSR5_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR6 : (MATRIX Offset: 0x0298) Security Region Top Slave 6 Register -------- */ +#define MATRIX_SRTSR6_SRTOP0_Pos 0 +#define MATRIX_SRTSR6_SRTOP0_Msk (0xfu << MATRIX_SRTSR6_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP0(value) ((MATRIX_SRTSR6_SRTOP0_Msk & ((value) << MATRIX_SRTSR6_SRTOP0_Pos))) +#define MATRIX_SRTSR6_SRTOP1_Pos 4 +#define MATRIX_SRTSR6_SRTOP1_Msk (0xfu << MATRIX_SRTSR6_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP1(value) ((MATRIX_SRTSR6_SRTOP1_Msk & ((value) << MATRIX_SRTSR6_SRTOP1_Pos))) +#define MATRIX_SRTSR6_SRTOP2_Pos 8 +#define MATRIX_SRTSR6_SRTOP2_Msk (0xfu << MATRIX_SRTSR6_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP2(value) ((MATRIX_SRTSR6_SRTOP2_Msk & ((value) << MATRIX_SRTSR6_SRTOP2_Pos))) +#define MATRIX_SRTSR6_SRTOP3_Pos 12 +#define MATRIX_SRTSR6_SRTOP3_Msk (0xfu << MATRIX_SRTSR6_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP3(value) ((MATRIX_SRTSR6_SRTOP3_Msk & ((value) << MATRIX_SRTSR6_SRTOP3_Pos))) +#define MATRIX_SRTSR6_SRTOP4_Pos 16 +#define MATRIX_SRTSR6_SRTOP4_Msk (0xfu << MATRIX_SRTSR6_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP4(value) ((MATRIX_SRTSR6_SRTOP4_Msk & ((value) << MATRIX_SRTSR6_SRTOP4_Pos))) +#define MATRIX_SRTSR6_SRTOP5_Pos 20 +#define MATRIX_SRTSR6_SRTOP5_Msk (0xfu << MATRIX_SRTSR6_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP5(value) ((MATRIX_SRTSR6_SRTOP5_Msk & ((value) << MATRIX_SRTSR6_SRTOP5_Pos))) +#define MATRIX_SRTSR6_SRTOP6_Pos 24 +#define MATRIX_SRTSR6_SRTOP6_Msk (0xfu << MATRIX_SRTSR6_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP6(value) ((MATRIX_SRTSR6_SRTOP6_Msk & ((value) << MATRIX_SRTSR6_SRTOP6_Pos))) +#define MATRIX_SRTSR6_SRTOP7_Pos 28 +#define MATRIX_SRTSR6_SRTOP7_Msk (0xfu << MATRIX_SRTSR6_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR6) HSELx Security Region Top */ +#define MATRIX_SRTSR6_SRTOP7(value) ((MATRIX_SRTSR6_SRTOP7_Msk & ((value) << MATRIX_SRTSR6_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR7 : (MATRIX Offset: 0x029C) Security Region Top Slave 7 Register -------- */ +#define MATRIX_SRTSR7_SRTOP0_Pos 0 +#define MATRIX_SRTSR7_SRTOP0_Msk (0xfu << MATRIX_SRTSR7_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP0(value) ((MATRIX_SRTSR7_SRTOP0_Msk & ((value) << MATRIX_SRTSR7_SRTOP0_Pos))) +#define MATRIX_SRTSR7_SRTOP1_Pos 4 +#define MATRIX_SRTSR7_SRTOP1_Msk (0xfu << MATRIX_SRTSR7_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP1(value) ((MATRIX_SRTSR7_SRTOP1_Msk & ((value) << MATRIX_SRTSR7_SRTOP1_Pos))) +#define MATRIX_SRTSR7_SRTOP2_Pos 8 +#define MATRIX_SRTSR7_SRTOP2_Msk (0xfu << MATRIX_SRTSR7_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP2(value) ((MATRIX_SRTSR7_SRTOP2_Msk & ((value) << MATRIX_SRTSR7_SRTOP2_Pos))) +#define MATRIX_SRTSR7_SRTOP3_Pos 12 +#define MATRIX_SRTSR7_SRTOP3_Msk (0xfu << MATRIX_SRTSR7_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP3(value) ((MATRIX_SRTSR7_SRTOP3_Msk & ((value) << MATRIX_SRTSR7_SRTOP3_Pos))) +#define MATRIX_SRTSR7_SRTOP4_Pos 16 +#define MATRIX_SRTSR7_SRTOP4_Msk (0xfu << MATRIX_SRTSR7_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP4(value) ((MATRIX_SRTSR7_SRTOP4_Msk & ((value) << MATRIX_SRTSR7_SRTOP4_Pos))) +#define MATRIX_SRTSR7_SRTOP5_Pos 20 +#define MATRIX_SRTSR7_SRTOP5_Msk (0xfu << MATRIX_SRTSR7_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP5(value) ((MATRIX_SRTSR7_SRTOP5_Msk & ((value) << MATRIX_SRTSR7_SRTOP5_Pos))) +#define MATRIX_SRTSR7_SRTOP6_Pos 24 +#define MATRIX_SRTSR7_SRTOP6_Msk (0xfu << MATRIX_SRTSR7_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP6(value) ((MATRIX_SRTSR7_SRTOP6_Msk & ((value) << MATRIX_SRTSR7_SRTOP6_Pos))) +#define MATRIX_SRTSR7_SRTOP7_Pos 28 +#define MATRIX_SRTSR7_SRTOP7_Msk (0xfu << MATRIX_SRTSR7_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR7) HSELx Security Region Top */ +#define MATRIX_SRTSR7_SRTOP7(value) ((MATRIX_SRTSR7_SRTOP7_Msk & ((value) << MATRIX_SRTSR7_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR8 : (MATRIX Offset: 0x02A0) Security Region Top Slave 8 Register -------- */ +#define MATRIX_SRTSR8_SRTOP0_Pos 0 +#define MATRIX_SRTSR8_SRTOP0_Msk (0xfu << MATRIX_SRTSR8_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP0(value) ((MATRIX_SRTSR8_SRTOP0_Msk & ((value) << MATRIX_SRTSR8_SRTOP0_Pos))) +#define MATRIX_SRTSR8_SRTOP1_Pos 4 +#define MATRIX_SRTSR8_SRTOP1_Msk (0xfu << MATRIX_SRTSR8_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP1(value) ((MATRIX_SRTSR8_SRTOP1_Msk & ((value) << MATRIX_SRTSR8_SRTOP1_Pos))) +#define MATRIX_SRTSR8_SRTOP2_Pos 8 +#define MATRIX_SRTSR8_SRTOP2_Msk (0xfu << MATRIX_SRTSR8_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP2(value) ((MATRIX_SRTSR8_SRTOP2_Msk & ((value) << MATRIX_SRTSR8_SRTOP2_Pos))) +#define MATRIX_SRTSR8_SRTOP3_Pos 12 +#define MATRIX_SRTSR8_SRTOP3_Msk (0xfu << MATRIX_SRTSR8_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP3(value) ((MATRIX_SRTSR8_SRTOP3_Msk & ((value) << MATRIX_SRTSR8_SRTOP3_Pos))) +#define MATRIX_SRTSR8_SRTOP4_Pos 16 +#define MATRIX_SRTSR8_SRTOP4_Msk (0xfu << MATRIX_SRTSR8_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP4(value) ((MATRIX_SRTSR8_SRTOP4_Msk & ((value) << MATRIX_SRTSR8_SRTOP4_Pos))) +#define MATRIX_SRTSR8_SRTOP5_Pos 20 +#define MATRIX_SRTSR8_SRTOP5_Msk (0xfu << MATRIX_SRTSR8_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP5(value) ((MATRIX_SRTSR8_SRTOP5_Msk & ((value) << MATRIX_SRTSR8_SRTOP5_Pos))) +#define MATRIX_SRTSR8_SRTOP6_Pos 24 +#define MATRIX_SRTSR8_SRTOP6_Msk (0xfu << MATRIX_SRTSR8_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP6(value) ((MATRIX_SRTSR8_SRTOP6_Msk & ((value) << MATRIX_SRTSR8_SRTOP6_Pos))) +#define MATRIX_SRTSR8_SRTOP7_Pos 28 +#define MATRIX_SRTSR8_SRTOP7_Msk (0xfu << MATRIX_SRTSR8_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR8) HSELx Security Region Top */ +#define MATRIX_SRTSR8_SRTOP7(value) ((MATRIX_SRTSR8_SRTOP7_Msk & ((value) << MATRIX_SRTSR8_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR9 : (MATRIX Offset: 0x02A4) Security Region Top Slave 9 Register -------- */ +#define MATRIX_SRTSR9_SRTOP0_Pos 0 +#define MATRIX_SRTSR9_SRTOP0_Msk (0xfu << MATRIX_SRTSR9_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP0(value) ((MATRIX_SRTSR9_SRTOP0_Msk & ((value) << MATRIX_SRTSR9_SRTOP0_Pos))) +#define MATRIX_SRTSR9_SRTOP1_Pos 4 +#define MATRIX_SRTSR9_SRTOP1_Msk (0xfu << MATRIX_SRTSR9_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP1(value) ((MATRIX_SRTSR9_SRTOP1_Msk & ((value) << MATRIX_SRTSR9_SRTOP1_Pos))) +#define MATRIX_SRTSR9_SRTOP2_Pos 8 +#define MATRIX_SRTSR9_SRTOP2_Msk (0xfu << MATRIX_SRTSR9_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP2(value) ((MATRIX_SRTSR9_SRTOP2_Msk & ((value) << MATRIX_SRTSR9_SRTOP2_Pos))) +#define MATRIX_SRTSR9_SRTOP3_Pos 12 +#define MATRIX_SRTSR9_SRTOP3_Msk (0xfu << MATRIX_SRTSR9_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP3(value) ((MATRIX_SRTSR9_SRTOP3_Msk & ((value) << MATRIX_SRTSR9_SRTOP3_Pos))) +#define MATRIX_SRTSR9_SRTOP4_Pos 16 +#define MATRIX_SRTSR9_SRTOP4_Msk (0xfu << MATRIX_SRTSR9_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP4(value) ((MATRIX_SRTSR9_SRTOP4_Msk & ((value) << MATRIX_SRTSR9_SRTOP4_Pos))) +#define MATRIX_SRTSR9_SRTOP5_Pos 20 +#define MATRIX_SRTSR9_SRTOP5_Msk (0xfu << MATRIX_SRTSR9_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP5(value) ((MATRIX_SRTSR9_SRTOP5_Msk & ((value) << MATRIX_SRTSR9_SRTOP5_Pos))) +#define MATRIX_SRTSR9_SRTOP6_Pos 24 +#define MATRIX_SRTSR9_SRTOP6_Msk (0xfu << MATRIX_SRTSR9_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP6(value) ((MATRIX_SRTSR9_SRTOP6_Msk & ((value) << MATRIX_SRTSR9_SRTOP6_Pos))) +#define MATRIX_SRTSR9_SRTOP7_Pos 28 +#define MATRIX_SRTSR9_SRTOP7_Msk (0xfu << MATRIX_SRTSR9_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR9) HSELx Security Region Top */ +#define MATRIX_SRTSR9_SRTOP7(value) ((MATRIX_SRTSR9_SRTOP7_Msk & ((value) << MATRIX_SRTSR9_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR10 : (MATRIX Offset: 0x02A8) Security Region Top Slave 10 Register -------- */ +#define MATRIX_SRTSR10_SRTOP0_Pos 0 +#define MATRIX_SRTSR10_SRTOP0_Msk (0xfu << MATRIX_SRTSR10_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP0(value) ((MATRIX_SRTSR10_SRTOP0_Msk & ((value) << MATRIX_SRTSR10_SRTOP0_Pos))) +#define MATRIX_SRTSR10_SRTOP1_Pos 4 +#define MATRIX_SRTSR10_SRTOP1_Msk (0xfu << MATRIX_SRTSR10_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP1(value) ((MATRIX_SRTSR10_SRTOP1_Msk & ((value) << MATRIX_SRTSR10_SRTOP1_Pos))) +#define MATRIX_SRTSR10_SRTOP2_Pos 8 +#define MATRIX_SRTSR10_SRTOP2_Msk (0xfu << MATRIX_SRTSR10_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP2(value) ((MATRIX_SRTSR10_SRTOP2_Msk & ((value) << MATRIX_SRTSR10_SRTOP2_Pos))) +#define MATRIX_SRTSR10_SRTOP3_Pos 12 +#define MATRIX_SRTSR10_SRTOP3_Msk (0xfu << MATRIX_SRTSR10_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP3(value) ((MATRIX_SRTSR10_SRTOP3_Msk & ((value) << MATRIX_SRTSR10_SRTOP3_Pos))) +#define MATRIX_SRTSR10_SRTOP4_Pos 16 +#define MATRIX_SRTSR10_SRTOP4_Msk (0xfu << MATRIX_SRTSR10_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP4(value) ((MATRIX_SRTSR10_SRTOP4_Msk & ((value) << MATRIX_SRTSR10_SRTOP4_Pos))) +#define MATRIX_SRTSR10_SRTOP5_Pos 20 +#define MATRIX_SRTSR10_SRTOP5_Msk (0xfu << MATRIX_SRTSR10_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP5(value) ((MATRIX_SRTSR10_SRTOP5_Msk & ((value) << MATRIX_SRTSR10_SRTOP5_Pos))) +#define MATRIX_SRTSR10_SRTOP6_Pos 24 +#define MATRIX_SRTSR10_SRTOP6_Msk (0xfu << MATRIX_SRTSR10_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP6(value) ((MATRIX_SRTSR10_SRTOP6_Msk & ((value) << MATRIX_SRTSR10_SRTOP6_Pos))) +#define MATRIX_SRTSR10_SRTOP7_Pos 28 +#define MATRIX_SRTSR10_SRTOP7_Msk (0xfu << MATRIX_SRTSR10_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR10) HSELx Security Region Top */ +#define MATRIX_SRTSR10_SRTOP7(value) ((MATRIX_SRTSR10_SRTOP7_Msk & ((value) << MATRIX_SRTSR10_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR11 : (MATRIX Offset: 0x02AC) Security Region Top Slave 11 Register -------- */ +#define MATRIX_SRTSR11_SRTOP0_Pos 0 +#define MATRIX_SRTSR11_SRTOP0_Msk (0xfu << MATRIX_SRTSR11_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP0(value) ((MATRIX_SRTSR11_SRTOP0_Msk & ((value) << MATRIX_SRTSR11_SRTOP0_Pos))) +#define MATRIX_SRTSR11_SRTOP1_Pos 4 +#define MATRIX_SRTSR11_SRTOP1_Msk (0xfu << MATRIX_SRTSR11_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP1(value) ((MATRIX_SRTSR11_SRTOP1_Msk & ((value) << MATRIX_SRTSR11_SRTOP1_Pos))) +#define MATRIX_SRTSR11_SRTOP2_Pos 8 +#define MATRIX_SRTSR11_SRTOP2_Msk (0xfu << MATRIX_SRTSR11_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP2(value) ((MATRIX_SRTSR11_SRTOP2_Msk & ((value) << MATRIX_SRTSR11_SRTOP2_Pos))) +#define MATRIX_SRTSR11_SRTOP3_Pos 12 +#define MATRIX_SRTSR11_SRTOP3_Msk (0xfu << MATRIX_SRTSR11_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP3(value) ((MATRIX_SRTSR11_SRTOP3_Msk & ((value) << MATRIX_SRTSR11_SRTOP3_Pos))) +#define MATRIX_SRTSR11_SRTOP4_Pos 16 +#define MATRIX_SRTSR11_SRTOP4_Msk (0xfu << MATRIX_SRTSR11_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP4(value) ((MATRIX_SRTSR11_SRTOP4_Msk & ((value) << MATRIX_SRTSR11_SRTOP4_Pos))) +#define MATRIX_SRTSR11_SRTOP5_Pos 20 +#define MATRIX_SRTSR11_SRTOP5_Msk (0xfu << MATRIX_SRTSR11_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP5(value) ((MATRIX_SRTSR11_SRTOP5_Msk & ((value) << MATRIX_SRTSR11_SRTOP5_Pos))) +#define MATRIX_SRTSR11_SRTOP6_Pos 24 +#define MATRIX_SRTSR11_SRTOP6_Msk (0xfu << MATRIX_SRTSR11_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP6(value) ((MATRIX_SRTSR11_SRTOP6_Msk & ((value) << MATRIX_SRTSR11_SRTOP6_Pos))) +#define MATRIX_SRTSR11_SRTOP7_Pos 28 +#define MATRIX_SRTSR11_SRTOP7_Msk (0xfu << MATRIX_SRTSR11_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR11) HSELx Security Region Top */ +#define MATRIX_SRTSR11_SRTOP7(value) ((MATRIX_SRTSR11_SRTOP7_Msk & ((value) << MATRIX_SRTSR11_SRTOP7_Pos))) +/* -------- MATRIX_SRTSR12 : (MATRIX Offset: 0x02B0) Security Region Top Slave 12 Register -------- */ +#define MATRIX_SRTSR12_SRTOP0_Pos 0 +#define MATRIX_SRTSR12_SRTOP0_Msk (0xfu << MATRIX_SRTSR12_SRTOP0_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP0(value) ((MATRIX_SRTSR12_SRTOP0_Msk & ((value) << MATRIX_SRTSR12_SRTOP0_Pos))) +#define MATRIX_SRTSR12_SRTOP1_Pos 4 +#define MATRIX_SRTSR12_SRTOP1_Msk (0xfu << MATRIX_SRTSR12_SRTOP1_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP1(value) ((MATRIX_SRTSR12_SRTOP1_Msk & ((value) << MATRIX_SRTSR12_SRTOP1_Pos))) +#define MATRIX_SRTSR12_SRTOP2_Pos 8 +#define MATRIX_SRTSR12_SRTOP2_Msk (0xfu << MATRIX_SRTSR12_SRTOP2_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP2(value) ((MATRIX_SRTSR12_SRTOP2_Msk & ((value) << MATRIX_SRTSR12_SRTOP2_Pos))) +#define MATRIX_SRTSR12_SRTOP3_Pos 12 +#define MATRIX_SRTSR12_SRTOP3_Msk (0xfu << MATRIX_SRTSR12_SRTOP3_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP3(value) ((MATRIX_SRTSR12_SRTOP3_Msk & ((value) << MATRIX_SRTSR12_SRTOP3_Pos))) +#define MATRIX_SRTSR12_SRTOP4_Pos 16 +#define MATRIX_SRTSR12_SRTOP4_Msk (0xfu << MATRIX_SRTSR12_SRTOP4_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP4(value) ((MATRIX_SRTSR12_SRTOP4_Msk & ((value) << MATRIX_SRTSR12_SRTOP4_Pos))) +#define MATRIX_SRTSR12_SRTOP5_Pos 20 +#define MATRIX_SRTSR12_SRTOP5_Msk (0xfu << MATRIX_SRTSR12_SRTOP5_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP5(value) ((MATRIX_SRTSR12_SRTOP5_Msk & ((value) << MATRIX_SRTSR12_SRTOP5_Pos))) +#define MATRIX_SRTSR12_SRTOP6_Pos 24 +#define MATRIX_SRTSR12_SRTOP6_Msk (0xfu << MATRIX_SRTSR12_SRTOP6_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP6(value) ((MATRIX_SRTSR12_SRTOP6_Msk & ((value) << MATRIX_SRTSR12_SRTOP6_Pos))) +#define MATRIX_SRTSR12_SRTOP7_Pos 28 +#define MATRIX_SRTSR12_SRTOP7_Msk (0xfu << MATRIX_SRTSR12_SRTOP7_Pos) /**< \brief (MATRIX_SRTSR12) HSELx Security Region Top */ +#define MATRIX_SRTSR12_SRTOP7(value) ((MATRIX_SRTSR12_SRTOP7_Msk & ((value) << MATRIX_SRTSR12_SRTOP7_Pos))) +/* -------- MATRIX_SPSELR[3] : (MATRIX Offset: 0x02C0) Security Peripheral Select 1 Register -------- */ +#define MATRIX_SPSELR_NSECP0 (0x1u << 0) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP1 (0x1u << 1) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP2 (0x1u << 2) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP3 (0x1u << 3) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP4 (0x1u << 4) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP5 (0x1u << 5) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP6 (0x1u << 6) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP7 (0x1u << 7) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP8 (0x1u << 8) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP9 (0x1u << 9) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP10 (0x1u << 10) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP11 (0x1u << 11) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP12 (0x1u << 12) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP13 (0x1u << 13) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP14 (0x1u << 14) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP15 (0x1u << 15) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP16 (0x1u << 16) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP17 (0x1u << 17) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP18 (0x1u << 18) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP19 (0x1u << 19) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP20 (0x1u << 20) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP21 (0x1u << 21) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP22 (0x1u << 22) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP23 (0x1u << 23) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP24 (0x1u << 24) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP25 (0x1u << 25) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP26 (0x1u << 26) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP27 (0x1u << 27) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP28 (0x1u << 28) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP29 (0x1u << 29) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP30 (0x1u << 30) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ +#define MATRIX_SPSELR_NSECP31 (0x1u << 31) /**< \brief (MATRIX_SPSELR[3]) Non-secured Peripheral */ + +/*@}*/ + + +#endif /* _SAMA5D2_MATRIX_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mcan.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mcan.h new file mode 100644 index 000000000..4884df58d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mcan.h @@ -0,0 +1,961 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_MCAN_COMPONENT_ +#define _SAMA5D2_MCAN_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Controller Area Network */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_MCAN Controller Area Network */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Mcan hardware registers */ +typedef struct { + __I uint32_t MCAN_CREL; /**< \brief (Mcan Offset: 0x00) Core Release Register */ + __I uint32_t MCAN_ENDN; /**< \brief (Mcan Offset: 0x04) Endian Register */ + __IO uint32_t MCAN_CUST; /**< \brief (Mcan Offset: 0x08) Customer Register */ + __IO uint32_t MCAN_DBTP; /**< \brief (Mcan Offset: 0x0C) Fast Bit Timing and Prescaler Register */ + __IO uint32_t MCAN_TEST; /**< \brief (Mcan Offset: 0x10) Test Register */ + __IO uint32_t MCAN_RWD; /**< \brief (Mcan Offset: 0x14) RAM Watchdog Register */ + __IO uint32_t MCAN_CCCR; /**< \brief (Mcan Offset: 0x18) CC Control Register */ + __IO uint32_t MCAN_NBTP; /**< \brief (Mcan Offset: 0x1C) Bit Timing and Prescaler Register */ + __IO uint32_t MCAN_TSCC; /**< \brief (Mcan Offset: 0x20) Timestamp Counter Configuration Register */ + __IO uint32_t MCAN_TSCV; /**< \brief (Mcan Offset: 0x24) Timestamp Counter Value Register */ + __IO uint32_t MCAN_TOCC; /**< \brief (Mcan Offset: 0x28) Timeout Counter Configuration Register */ + __IO uint32_t MCAN_TOCV; /**< \brief (Mcan Offset: 0x2C) Timeout Counter Value Register */ + __I uint32_t Reserved1[4]; + __I uint32_t MCAN_ECR; /**< \brief (Mcan Offset: 0x40) Error Counter Register */ + __I uint32_t MCAN_PSR; /**< \brief (Mcan Offset: 0x44) Protocol Status Register */ + __IO uint32_t MCAN_TDCR; /**< \brief (Mcan Offset: 0x48) Transmit Delay Compensation Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t MCAN_IR; /**< \brief (Mcan Offset: 0x50) Interrupt Register */ + __IO uint32_t MCAN_IE; /**< \brief (Mcan Offset: 0x54) Interrupt Enable Register */ + __IO uint32_t MCAN_ILS; /**< \brief (Mcan Offset: 0x58) Interrupt Line Select Register */ + __IO uint32_t MCAN_ILE; /**< \brief (Mcan Offset: 0x5C) Interrupt Line Enable Register */ + __I uint32_t Reserved3[8]; + __IO uint32_t MCAN_GFC; /**< \brief (Mcan Offset: 0x80) Global Filter Configuration Register */ + __IO uint32_t MCAN_SIDFC; /**< \brief (Mcan Offset: 0x84) Standard ID Filter Configuration Register */ + __IO uint32_t MCAN_XIDFC; /**< \brief (Mcan Offset: 0x88) Extended ID Filter Configuration Register */ + __I uint32_t Reserved4[1]; + __IO uint32_t MCAN_XIDAM; /**< \brief (Mcan Offset: 0x90) Extended ID AND Mask Register */ + __I uint32_t MCAN_HPMS; /**< \brief (Mcan Offset: 0x94) High Priority Message Status Register */ + __IO uint32_t MCAN_NDAT1; /**< \brief (Mcan Offset: 0x98) New Data 1 Register */ + __IO uint32_t MCAN_NDAT2; /**< \brief (Mcan Offset: 0x9C) New Data 2 Register */ + __IO uint32_t MCAN_RXF0C; /**< \brief (Mcan Offset: 0xA0) Receive FIFO 0 Configuration Register */ + __I uint32_t MCAN_RXF0S; /**< \brief (Mcan Offset: 0xA4) Receive FIFO 0 Status Register */ + __IO uint32_t MCAN_RXF0A; /**< \brief (Mcan Offset: 0xA8) Receive FIFO 0 Acknowledge Register */ + __IO uint32_t MCAN_RXBC; /**< \brief (Mcan Offset: 0xAC) Receive Rx Buffer Configuration Register */ + __IO uint32_t MCAN_RXF1C; /**< \brief (Mcan Offset: 0xB0) Receive FIFO 1 Configuration Register */ + __I uint32_t MCAN_RXF1S; /**< \brief (Mcan Offset: 0xB4) Receive FIFO 1 Status Register */ + __IO uint32_t MCAN_RXF1A; /**< \brief (Mcan Offset: 0xB8) Receive FIFO 1 Acknowledge Register */ + __IO uint32_t MCAN_RXESC; /**< \brief (Mcan Offset: 0xBC) Receive Buffer / FIFO Element Size Configuration Register */ + __IO uint32_t MCAN_TXBC; /**< \brief (Mcan Offset: 0xC0) Transmit Buffer Configuration Register */ + __I uint32_t MCAN_TXFQS; /**< \brief (Mcan Offset: 0xC4) Transmit FIFO/Queue Status Register */ + __IO uint32_t MCAN_TXESC; /**< \brief (Mcan Offset: 0xC8) Transmit Buffer Element Size Configuration Register */ + __I uint32_t MCAN_TXBRP; /**< \brief (Mcan Offset: 0xCC) Transmit Buffer Request Pending Register */ + __IO uint32_t MCAN_TXBAR; /**< \brief (Mcan Offset: 0xD0) Transmit Buffer Add Request Register */ + __IO uint32_t MCAN_TXBCR; /**< \brief (Mcan Offset: 0xD4) Transmit Buffer Cancellation Request Register */ + __I uint32_t MCAN_TXBTO; /**< \brief (Mcan Offset: 0xD8) Transmit Buffer Transmission Occurred Register */ + __I uint32_t MCAN_TXBCF; /**< \brief (Mcan Offset: 0xDC) Transmit Buffer Cancellation Finished Register */ + __IO uint32_t MCAN_TXBTIE; /**< \brief (Mcan Offset: 0xE0) Transmit Buffer Transmission Interrupt Enable Register */ + __IO uint32_t MCAN_TXBCIE; /**< \brief (Mcan Offset: 0xE4) Transmit Buffer Cancellation Finished Interrupt Enable Register */ + __I uint32_t Reserved5[2]; + __IO uint32_t MCAN_TXEFC; /**< \brief (Mcan Offset: 0xF0) Transmit Event FIFO Configuration Register */ + __I uint32_t MCAN_TXEFS; /**< \brief (Mcan Offset: 0xF4) Transmit Event FIFO Status Register */ + __IO uint32_t MCAN_TXEFA; /**< \brief (Mcan Offset: 0xF8) Transmit Event FIFO Acknowledge Register */ +} Mcan; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- MCAN_CREL : (MCAN Offset: 0x00) Core Release Register -------- */ +#define MCAN_CREL_DAY_Pos 0 +#define MCAN_CREL_DAY_Msk (0xffu << MCAN_CREL_DAY_Pos) /**< \brief (MCAN_CREL) Timestamp Day */ +#define MCAN_CREL_MON_Pos 8 +#define MCAN_CREL_MON_Msk (0xffu << MCAN_CREL_MON_Pos) /**< \brief (MCAN_CREL) Timestamp Month */ +#define MCAN_CREL_YEAR_Pos 16 +#define MCAN_CREL_YEAR_Msk (0xfu << MCAN_CREL_YEAR_Pos) /**< \brief (MCAN_CREL) Timestamp Year */ +#define MCAN_CREL_SUBSTEP_Pos 20 +#define MCAN_CREL_SUBSTEP_Msk (0xfu << MCAN_CREL_SUBSTEP_Pos) /**< \brief (MCAN_CREL) Sub-step of Core Release */ +#define MCAN_CREL_STEP_Pos 24 +#define MCAN_CREL_STEP_Msk (0xfu << MCAN_CREL_STEP_Pos) /**< \brief (MCAN_CREL) Step of Core Release */ +#define MCAN_CREL_REL_Pos 28 +#define MCAN_CREL_REL_Msk (0xfu << MCAN_CREL_REL_Pos) /**< \brief (MCAN_CREL) Core Release */ +/* -------- MCAN_ENDN : (MCAN Offset: 0x04) Endian Register -------- */ +#define MCAN_ENDN_ETV_Pos 0 +#define MCAN_ENDN_ETV_Msk (0xffffffffu << MCAN_ENDN_ETV_Pos) /**< \brief (MCAN_ENDN) Endianness Test Value */ +/* -------- MCAN_CUST : (MCAN Offset: 0x08) Customer Register -------- */ +#define MCAN_CUST_CSV_Pos 0 +#define MCAN_CUST_CSV_Msk (0xffffffffu << MCAN_CUST_CSV_Pos) /**< \brief (MCAN_CUST) Customer-specific Value */ +#define MCAN_CUST_CSV(value) ((MCAN_CUST_CSV_Msk & ((value) << MCAN_CUST_CSV_Pos))) +/* -------- MCAN_DBTP : (MCAN Offset: 0x0C) Fast Bit Timing and Prescaler Register -------- */ +#define MCAN_DBTP_DSJW_Pos 0 +#define MCAN_DBTP_DSJW_Msk (0x7u << MCAN_DBTP_DSJW_Pos) /**< \brief (MCAN_DBTP) Fast (Re) Synchronization Jump Width */ +#define MCAN_DBTP_DSJW(value) ((MCAN_DBTP_DSJW_Msk & ((value) << MCAN_DBTP_DSJW_Pos))) +#define MCAN_DBTP_DTSEG2_Pos 4 +#define MCAN_DBTP_DTSEG2_Msk (0xfu << MCAN_DBTP_DTSEG2_Pos) /**< \brief (MCAN_DBTP) Fast Time Segment After Sample Point */ +#define MCAN_DBTP_DTSEG2(value) ((MCAN_DBTP_DTSEG2_Msk & ((value) << MCAN_DBTP_DTSEG2_Pos))) +#define MCAN_DBTP_DTSEG1_Pos 8 +#define MCAN_DBTP_DTSEG1_Msk (0x1fu << MCAN_DBTP_DTSEG1_Pos) /**< \brief (MCAN_DBTP) Fast Time Segment Before Sample Point */ +#define MCAN_DBTP_DTSEG1(value) ((MCAN_DBTP_DTSEG1_Msk & ((value) << MCAN_DBTP_DTSEG1_Pos))) +#define MCAN_DBTP_FBRP_Pos 16 +#define MCAN_DBTP_FBRP_Msk (0x1fu << MCAN_DBTP_FBRP_Pos) /**< \brief (MCAN_DBTP) Fast Baud Rate Prescaler */ +#define MCAN_DBTP_FBRP(value) ((MCAN_DBTP_FBRP_Msk & ((value) << MCAN_DBTP_FBRP_Pos))) +#define MCAN_DBTP_TDC (0x1u << 23) /**< \brief (MCAN_DBTP) Transceiver Delay Compensation */ +#define MCAN_DBTP_TDC_DISABLED (0x0u << 23) /**< \brief (MCAN_DBTP) Transceiver Delay Compensation disabled. */ +#define MCAN_DBTP_TDC_ENABLED (0x1u << 23) /**< \brief (MCAN_DBTP) Transceiver Delay Compensation enabled. */ +/* -------- MCAN_TEST : (MCAN Offset: 0x10) Test Register -------- */ +#define MCAN_TEST_LBCK (0x1u << 4) /**< \brief (MCAN_TEST) Loop Back Mode (read/write) */ +#define MCAN_TEST_LBCK_DISABLED (0x0u << 4) /**< \brief (MCAN_TEST) Reset value. Loop Back mode is disabled. */ +#define MCAN_TEST_LBCK_ENABLED (0x1u << 4) /**< \brief (MCAN_TEST) Loop Back mode is enabled (see Section 1.5.1.9). */ +#define MCAN_TEST_TX_Pos 5 +#define MCAN_TEST_TX_Msk (0x3u << MCAN_TEST_TX_Pos) /**< \brief (MCAN_TEST) Control of Transmit Pin (read/write) */ +#define MCAN_TEST_TX(value) ((MCAN_TEST_TX_Msk & ((value) << MCAN_TEST_TX_Pos))) +#define MCAN_TEST_TX_RESET (0x0u << 5) /**< \brief (MCAN_TEST) Reset value, CANTX controlled by the CAN Core, updated at the end of the CAN bit time. */ +#define MCAN_TEST_TX_SAMPLE_POINT_MONITORING (0x1u << 5) /**< \brief (MCAN_TEST) Sample Point can be monitored at pin CANTX. */ +#define MCAN_TEST_TX_DOMINANT (0x2u << 5) /**< \brief (MCAN_TEST) Dominant ('0') level at pin CANTX. */ +#define MCAN_TEST_TX_RECESSIVE (0x3u << 5) /**< \brief (MCAN_TEST) Recessive ('1') at pin CANTX. */ +#define MCAN_TEST_RX (0x1u << 7) /**< \brief (MCAN_TEST) Receive Pin (read-only) */ +/* -------- MCAN_RWD : (MCAN Offset: 0x14) RAM Watchdog Register -------- */ +#define MCAN_RWD_WDC_Pos 0 +#define MCAN_RWD_WDC_Msk (0xffu << MCAN_RWD_WDC_Pos) /**< \brief (MCAN_RWD) Watchdog Configuration (read/write) */ +#define MCAN_RWD_WDC(value) ((MCAN_RWD_WDC_Msk & ((value) << MCAN_RWD_WDC_Pos))) +#define MCAN_RWD_WDV_Pos 8 +#define MCAN_RWD_WDV_Msk (0xffu << MCAN_RWD_WDV_Pos) /**< \brief (MCAN_RWD) Watchdog Value (read-only) */ +#define MCAN_RWD_WDV(value) ((MCAN_RWD_WDV_Msk & ((value) << MCAN_RWD_WDV_Pos))) +/* -------- MCAN_CCCR : (MCAN Offset: 0x18) CC Control Register -------- */ +#define MCAN_CCCR_INIT (0x1u << 0) /**< \brief (MCAN_CCCR) Initialization (read/write) */ +#define MCAN_CCCR_INIT_DISABLED (0x0u << 0) /**< \brief (MCAN_CCCR) Normal operation. */ +#define MCAN_CCCR_INIT_ENABLED (0x1u << 0) /**< \brief (MCAN_CCCR) Initialization is started. */ +#define MCAN_CCCR_CCE (0x1u << 1) /**< \brief (MCAN_CCCR) Configuration Change Enable (read/write, write protection) */ +#define MCAN_CCCR_CCE_PROTECTED (0x0u << 1) /**< \brief (MCAN_CCCR) The processor has no write access to the protected configuration registers. */ +#define MCAN_CCCR_CCE_CONFIGURABLE (0x1u << 1) /**< \brief (MCAN_CCCR) The processor has write access to the protected configuration registers (while MCAN_CCCR.INIT = '1'). */ +#define MCAN_CCCR_ASM (0x1u << 2) /**< \brief (MCAN_CCCR) Restricted Operation Mode (read/write, write protection against '1') */ +#define MCAN_CCCR_ASM_NORMAL (0x0u << 2) /**< \brief (MCAN_CCCR) Normal CAN operation. */ +#define MCAN_CCCR_ASM_RESTRICTED (0x1u << 2) /**< \brief (MCAN_CCCR) Restricted operation mode active. */ +#define MCAN_CCCR_CSA (0x1u << 3) /**< \brief (MCAN_CCCR) Clock Stop Acknowledge (read-only) */ +#define MCAN_CCCR_CSR (0x1u << 4) /**< \brief (MCAN_CCCR) Clock Stop Request (read/write) */ +#define MCAN_CCCR_CSR_NO_CLOCK_STOP (0x0u << 4) /**< \brief (MCAN_CCCR) No clock stop is requested. */ +#define MCAN_CCCR_CSR_CLOCK_STOP (0x1u << 4) /**< \brief (MCAN_CCCR) Clock stop requested. When clock stop is requested, first INIT and then CSA will be set after all pend-ing transfer requests have been completed and the CAN bus reached idle. */ +#define MCAN_CCCR_MON (0x1u << 5) /**< \brief (MCAN_CCCR) Bus Monitoring Mode (read/write, write protection against '1') */ +#define MCAN_CCCR_MON_DISABLED (0x0u << 5) /**< \brief (MCAN_CCCR) Bus Monitoring mode is disabled. */ +#define MCAN_CCCR_MON_ENABLED (0x1u << 5) /**< \brief (MCAN_CCCR) Bus Monitoring mode is enabled. */ +#define MCAN_CCCR_DAR (0x1u << 6) /**< \brief (MCAN_CCCR) Disable Automatic Retransmission (read/write, write protection) */ +#define MCAN_CCCR_DAR_AUTO_RETX (0x0u << 6) /**< \brief (MCAN_CCCR) Automatic retransmission of messages not transmitted successfully enabled. */ +#define MCAN_CCCR_DAR_NO_AUTO_RETX (0x1u << 6) /**< \brief (MCAN_CCCR) Automatic retransmission disabled. */ +#define MCAN_CCCR_TEST (0x1u << 7) /**< \brief (MCAN_CCCR) Test Mode Enable (read/write, write protection against '1') */ +#define MCAN_CCCR_TEST_DISABLED (0x0u << 7) /**< \brief (MCAN_CCCR) Normal operation, MCAN_TEST register holds reset values. */ +#define MCAN_CCCR_TEST_ENABLED (0x1u << 7) /**< \brief (MCAN_CCCR) Test mode, write access to MCAN_TEST register enabled. */ +#define MCAN_CCCR_FDOE (0x1u << 8) /**< \brief (MCAN_CCCR) CAN FD Operation Enable (read/write, write protection) */ +#define MCAN_CCCR_FDOE_DISABLED (0x0u << 8) /**< \brief (MCAN_CCCR) Classic CAN frame */ +#define MCAN_CCCR_FDOE_ENABLED (0x1u << 8) /**< \brief (MCAN_CCCR) CAN FD frame */ +#define MCAN_CCCR_BRSE (0x1u << 9) /**< \brief (MCAN_CCCR) Bit Rate Switching Enable (read/write, write protection) */ +#define MCAN_CCCR_BRSE_DISABLED (0x0u << 9) /**< \brief (MCAN_CCCR) Frames without bit rate switching */ +#define MCAN_CCCR_BRSE_ENABLED (0x1u << 9) /**< \brief (MCAN_CCCR) Frames with bit rate switching */ +#define MCAN_CCCR_PXHD (0x1u << 12) /**< \brief (MCAN_CCCR) Protocol Exception Event Handling (read/write, write protection) */ +#define MCAN_CCCR_EFBI (0x1u << 13) /**< \brief (MCAN_CCCR) Edge Filtering during Bus Integration (read/write, write protection) */ +#define MCAN_CCCR_TXP (0x1u << 14) /**< \brief (MCAN_CCCR) Transmit Pause (read/write, write protection) */ +/* -------- MCAN_NBTP : (MCAN Offset: 0x1C) Bit Timing and Prescaler Register -------- */ +#define MCAN_NBTP_NTSEG2_Pos 0 +#define MCAN_NBTP_NTSEG2_Msk (0x7fu << MCAN_NBTP_NTSEG2_Pos) /**< \brief (MCAN_NBTP) Nominal Time Segment After Sample Point */ +#define MCAN_NBTP_NTSEG2(value) ((MCAN_NBTP_NTSEG2_Msk & ((value) << MCAN_NBTP_NTSEG2_Pos))) +#define MCAN_NBTP_NTSEG1_Pos 8 +#define MCAN_NBTP_NTSEG1_Msk (0xffu << MCAN_NBTP_NTSEG1_Pos) /**< \brief (MCAN_NBTP) Nominal Time Segment Before Sample Point */ +#define MCAN_NBTP_NTSEG1(value) ((MCAN_NBTP_NTSEG1_Msk & ((value) << MCAN_NBTP_NTSEG1_Pos))) +#define MCAN_NBTP_NBRP_Pos 16 +#define MCAN_NBTP_NBRP_Msk (0x1ffu << MCAN_NBTP_NBRP_Pos) /**< \brief (MCAN_NBTP) Nominal Baud Rate Prescaler */ +#define MCAN_NBTP_NBRP(value) ((MCAN_NBTP_NBRP_Msk & ((value) << MCAN_NBTP_NBRP_Pos))) +#define MCAN_NBTP_NSJW_Pos 25 +#define MCAN_NBTP_NSJW_Msk (0x7fu << MCAN_NBTP_NSJW_Pos) /**< \brief (MCAN_NBTP) Nominal (Re) Synchronization Jump Width */ +#define MCAN_NBTP_NSJW(value) ((MCAN_NBTP_NSJW_Msk & ((value) << MCAN_NBTP_NSJW_Pos))) +/* -------- MCAN_TSCC : (MCAN Offset: 0x20) Timestamp Counter Configuration Register -------- */ +#define MCAN_TSCC_TSS_Pos 0 +#define MCAN_TSCC_TSS_Msk (0x3u << MCAN_TSCC_TSS_Pos) /**< \brief (MCAN_TSCC) Timestamp Select */ +#define MCAN_TSCC_TSS(value) ((MCAN_TSCC_TSS_Msk & ((value) << MCAN_TSCC_TSS_Pos))) +#define MCAN_TSCC_TSS_ALWAYS_0 (0x0u << 0) /**< \brief (MCAN_TSCC) Timestamp counter value always 0x0000 */ +#define MCAN_TSCC_TSS_TCP_INC (0x1u << 0) /**< \brief (MCAN_TSCC) Timestamp counter value incremented according to TCP */ +#define MCAN_TSCC_TSS_EXT_TIMESTAMP (0x2u << 0) /**< \brief (MCAN_TSCC) External timestamp counter value used */ +#define MCAN_TSCC_TCP_Pos 16 +#define MCAN_TSCC_TCP_Msk (0xfu << MCAN_TSCC_TCP_Pos) /**< \brief (MCAN_TSCC) Timestamp Counter Prescaler */ +#define MCAN_TSCC_TCP(value) ((MCAN_TSCC_TCP_Msk & ((value) << MCAN_TSCC_TCP_Pos))) +/* -------- MCAN_TSCV : (MCAN Offset: 0x24) Timestamp Counter Value Register -------- */ +#define MCAN_TSCV_TSC_Pos 0 +#define MCAN_TSCV_TSC_Msk (0xffffu << MCAN_TSCV_TSC_Pos) /**< \brief (MCAN_TSCV) Timestamp Counter (cleared on write) */ +#define MCAN_TSCV_TSC(value) ((MCAN_TSCV_TSC_Msk & ((value) << MCAN_TSCV_TSC_Pos))) +/* -------- MCAN_TOCC : (MCAN Offset: 0x28) Timeout Counter Configuration Register -------- */ +#define MCAN_TOCC_ETOC (0x1u << 0) /**< \brief (MCAN_TOCC) Enable Timeout Counter */ +#define MCAN_TOCC_ETOC_NO_TIMEOUT (0x0u << 0) /**< \brief (MCAN_TOCC) Timeout Counter disabled. */ +#define MCAN_TOCC_ETOC_TOS_CONTROLLED (0x1u << 0) /**< \brief (MCAN_TOCC) Timeout Counter enabled. */ +#define MCAN_TOCC_TOS_Pos 1 +#define MCAN_TOCC_TOS_Msk (0x3u << MCAN_TOCC_TOS_Pos) /**< \brief (MCAN_TOCC) Timeout Select */ +#define MCAN_TOCC_TOS(value) ((MCAN_TOCC_TOS_Msk & ((value) << MCAN_TOCC_TOS_Pos))) +#define MCAN_TOCC_TOS_CONTINUOUS (0x0u << 1) /**< \brief (MCAN_TOCC) Continuous operation */ +#define MCAN_TOCC_TOS_TX_EV_TIMEOUT (0x1u << 1) /**< \brief (MCAN_TOCC) Timeout controlled by Tx Event FIFO */ +#define MCAN_TOCC_TOS_RX0_EV_TIMEOUT (0x2u << 1) /**< \brief (MCAN_TOCC) Timeout controlled by Receive FIFO 0 */ +#define MCAN_TOCC_TOS_RX1_EV_TIMEOUT (0x3u << 1) /**< \brief (MCAN_TOCC) Timeout controlled by Receive FIFO 1 */ +#define MCAN_TOCC_TOP_Pos 16 +#define MCAN_TOCC_TOP_Msk (0xffffu << MCAN_TOCC_TOP_Pos) /**< \brief (MCAN_TOCC) Timeout Period */ +#define MCAN_TOCC_TOP(value) ((MCAN_TOCC_TOP_Msk & ((value) << MCAN_TOCC_TOP_Pos))) +/* -------- MCAN_TOCV : (MCAN Offset: 0x2C) Timeout Counter Value Register -------- */ +#define MCAN_TOCV_TOC_Pos 0 +#define MCAN_TOCV_TOC_Msk (0xffffu << MCAN_TOCV_TOC_Pos) /**< \brief (MCAN_TOCV) Timeout Counter (cleared on write) */ +#define MCAN_TOCV_TOC(value) ((MCAN_TOCV_TOC_Msk & ((value) << MCAN_TOCV_TOC_Pos))) +/* -------- MCAN_ECR : (MCAN Offset: 0x40) Error Counter Register -------- */ +#define MCAN_ECR_TEC_Pos 0 +#define MCAN_ECR_TEC_Msk (0xffu << MCAN_ECR_TEC_Pos) /**< \brief (MCAN_ECR) Transmit Error Counter */ +#define MCAN_ECR_REC_Pos 8 +#define MCAN_ECR_REC_Msk (0x7fu << MCAN_ECR_REC_Pos) /**< \brief (MCAN_ECR) Receive Error Counter */ +#define MCAN_ECR_RP (0x1u << 15) /**< \brief (MCAN_ECR) Receive Error Passive */ +#define MCAN_ECR_CEL_Pos 16 +#define MCAN_ECR_CEL_Msk (0xffu << MCAN_ECR_CEL_Pos) /**< \brief (MCAN_ECR) CAN Error Logging (cleared on read) */ +/* -------- MCAN_PSR : (MCAN Offset: 0x44) Protocol Status Register -------- */ +#define MCAN_PSR_LEC_Pos 0 +#define MCAN_PSR_LEC_Msk (0x7u << MCAN_PSR_LEC_Pos) /**< \brief (MCAN_PSR) Last Error Code (set to 111 on read) */ +#define MCAN_PSR_LEC_NO_ERROR (0x0u << 0) /**< \brief (MCAN_PSR) No error occurred since LEC has been reset by successful reception or transmission. */ +#define MCAN_PSR_LEC_STUFF_ERROR (0x1u << 0) /**< \brief (MCAN_PSR) More than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. */ +#define MCAN_PSR_LEC_FORM_ERROR (0x2u << 0) /**< \brief (MCAN_PSR) A fixed format part of a received frame has the wrong format. */ +#define MCAN_PSR_LEC_ACK_ERROR (0x3u << 0) /**< \brief (MCAN_PSR) The message transmitted by the MCAN was not acknowledged by another node. */ +#define MCAN_PSR_LEC_BIT1_ERROR (0x4u << 0) /**< \brief (MCAN_PSR) 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. */ +#define MCAN_PSR_LEC_BIT0_ERROR (0x5u << 0) /**< \brief (MCAN_PSR) 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 processor to monitor the proceeding of the Bus_Off recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). */ +#define MCAN_PSR_LEC_CRC_ERROR (0x6u << 0) /**< \brief (MCAN_PSR) 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. */ +#define MCAN_PSR_LEC_NO_CHANGE (0x7u << 0) /**< \brief (MCAN_PSR) 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 processor read access to the Protocol Status Register. */ +#define MCAN_PSR_ACT_Pos 3 +#define MCAN_PSR_ACT_Msk (0x3u << MCAN_PSR_ACT_Pos) /**< \brief (MCAN_PSR) Activity */ +#define MCAN_PSR_ACT_SYNCHRONIZING (0x0u << 3) /**< \brief (MCAN_PSR) Node is synchronizing on CAN communication */ +#define MCAN_PSR_ACT_IDLE (0x1u << 3) /**< \brief (MCAN_PSR) Node is neither receiver nor transmitter */ +#define MCAN_PSR_ACT_RECEIVER (0x2u << 3) /**< \brief (MCAN_PSR) Node is operating as receiver */ +#define MCAN_PSR_ACT_TRANSMITTER (0x3u << 3) /**< \brief (MCAN_PSR) Node is operating as transmitter */ +#define MCAN_PSR_EP (0x1u << 5) /**< \brief (MCAN_PSR) Error Passive */ +#define MCAN_PSR_EW (0x1u << 6) /**< \brief (MCAN_PSR) Warning Status */ +#define MCAN_PSR_BO (0x1u << 7) /**< \brief (MCAN_PSR) Bus_Off Status */ +#define MCAN_PSR_DLEC_Pos 8 +#define MCAN_PSR_DLEC_Msk (0x7u << MCAN_PSR_DLEC_Pos) /**< \brief (MCAN_PSR) Data Phase Last Error Code (set to 111 on read) */ +#define MCAN_PSR_RESI (0x1u << 11) /**< \brief (MCAN_PSR) ESI Flag of Last Received CAN FD Message (cleared on read) */ +#define MCAN_PSR_RBRS (0x1u << 12) /**< \brief (MCAN_PSR) BRS Flag of Last Received CAN FD Message (cleared on read) */ +#define MCAN_PSR_RFDF (0x1u << 13) /**< \brief (MCAN_PSR) Received a CAN FD Message (cleared on read) */ +#define MCAN_PSR_PXE (0x1u << 14) /**< \brief (MCAN_PSR) Protocol Exception Event (cleared on read) */ +#define MCAN_PSR_TDCV_Pos 16 +#define MCAN_PSR_TDCV_Msk (0x7fu << MCAN_PSR_TDCV_Pos) /**< \brief (MCAN_PSR) Transceiver Delay Compensation Value */ +/* -------- MCAN_TDCR : (MCAN Offset: 0x48) Transmit Delay Compensation Register -------- */ +#define MCAN_TDCR_TDCF_Pos 0 +#define MCAN_TDCR_TDCF_Msk (0x7fu << MCAN_TDCR_TDCF_Pos) /**< \brief (MCAN_TDCR) Transmitter Delay Compensation Filter */ +#define MCAN_TDCR_TDCF(value) ((MCAN_TDCR_TDCF_Msk & ((value) << MCAN_TDCR_TDCF_Pos))) +#define MCAN_TDCR_TDCO_Pos 8 +#define MCAN_TDCR_TDCO_Msk (0x7fu << MCAN_TDCR_TDCO_Pos) /**< \brief (MCAN_TDCR) Transmitter Delay Compensation Offset */ +#define MCAN_TDCR_TDCO(value) ((MCAN_TDCR_TDCO_Msk & ((value) << MCAN_TDCR_TDCO_Pos))) +/* -------- MCAN_IR : (MCAN Offset: 0x50) Interrupt Register -------- */ +#define MCAN_IR_RF0N (0x1u << 0) /**< \brief (MCAN_IR) Receive FIFO 0 New Message */ +#define MCAN_IR_RF0W (0x1u << 1) /**< \brief (MCAN_IR) Receive FIFO 0 Watermark Reached */ +#define MCAN_IR_RF0F (0x1u << 2) /**< \brief (MCAN_IR) Receive FIFO 0 Full */ +#define MCAN_IR_RF0L (0x1u << 3) /**< \brief (MCAN_IR) Receive FIFO 0 Message Lost */ +#define MCAN_IR_RF1N (0x1u << 4) /**< \brief (MCAN_IR) Receive FIFO 1 New Message */ +#define MCAN_IR_RF1W (0x1u << 5) /**< \brief (MCAN_IR) Receive FIFO 1 Watermark Reached */ +#define MCAN_IR_RF1F (0x1u << 6) /**< \brief (MCAN_IR) Receive FIFO 1 Full */ +#define MCAN_IR_RF1L (0x1u << 7) /**< \brief (MCAN_IR) Receive FIFO 1 Message Lost */ +#define MCAN_IR_HPM (0x1u << 8) /**< \brief (MCAN_IR) High Priority Message */ +#define MCAN_IR_TC (0x1u << 9) /**< \brief (MCAN_IR) Transmission Completed */ +#define MCAN_IR_TCF (0x1u << 10) /**< \brief (MCAN_IR) Transmission Cancellation Finished */ +#define MCAN_IR_TFE (0x1u << 11) /**< \brief (MCAN_IR) Tx FIFO Empty */ +#define MCAN_IR_TEFN (0x1u << 12) /**< \brief (MCAN_IR) Tx Event FIFO New Entry */ +#define MCAN_IR_TEFW (0x1u << 13) /**< \brief (MCAN_IR) Tx Event FIFO Watermark Reached */ +#define MCAN_IR_TEFF (0x1u << 14) /**< \brief (MCAN_IR) Tx Event FIFO Full */ +#define MCAN_IR_TEFL (0x1u << 15) /**< \brief (MCAN_IR) Tx Event FIFO Element Lost */ +#define MCAN_IR_TSW (0x1u << 16) /**< \brief (MCAN_IR) Timestamp Wraparound */ +#define MCAN_IR_MRAF (0x1u << 17) /**< \brief (MCAN_IR) Message RAM Access Failure */ +#define MCAN_IR_TOO (0x1u << 18) /**< \brief (MCAN_IR) Timeout Occurred */ +#define MCAN_IR_DRX (0x1u << 19) /**< \brief (MCAN_IR) Message stored to Dedicated Receive Buffer */ +#define MCAN_IR_BEC (0x1u << 20) /**< \brief (MCAN_IR) Bit Error Corrected */ +#define MCAN_IR_BEU (0x1u << 21) /**< \brief (MCAN_IR) Bit Error Uncorrected */ +#define MCAN_IR_ELO (0x1u << 22) /**< \brief (MCAN_IR) Error Logging Overflow */ +#define MCAN_IR_EP (0x1u << 23) /**< \brief (MCAN_IR) Error Passive */ +#define MCAN_IR_EW (0x1u << 24) /**< \brief (MCAN_IR) Warning Status */ +#define MCAN_IR_BO (0x1u << 25) /**< \brief (MCAN_IR) Bus_Off Status */ +#define MCAN_IR_WDI (0x1u << 26) /**< \brief (MCAN_IR) Watchdog Interrupt */ +#define MCAN_IR_PEA (0x1u << 27) /**< \brief (MCAN_IR) Protocol Error in Arbitration Phase */ +#define MCAN_IR_PED (0x1u << 28) /**< \brief (MCAN_IR) Protocol Error in Data Phase */ +#define MCAN_IR_ARA (0x1u << 29) /**< \brief (MCAN_IR) Access to Reserved Address */ +/* -------- MCAN_IE : (MCAN Offset: 0x54) Interrupt Enable Register -------- */ +#define MCAN_IE_RF0NE (0x1u << 0) /**< \brief (MCAN_IE) Receive FIFO 0 New Message Interrupt Enable */ +#define MCAN_IE_RF0WE (0x1u << 1) /**< \brief (MCAN_IE) Receive FIFO 0 Watermark Reached Interrupt Enable */ +#define MCAN_IE_RF0FE (0x1u << 2) /**< \brief (MCAN_IE) Receive FIFO 0 Full Interrupt Enable */ +#define MCAN_IE_RF0LE (0x1u << 3) /**< \brief (MCAN_IE) Receive FIFO 0 Message Lost Interrupt Enable */ +#define MCAN_IE_RF1NE (0x1u << 4) /**< \brief (MCAN_IE) Receive FIFO 1 New Message Interrupt Enable */ +#define MCAN_IE_RF1WE (0x1u << 5) /**< \brief (MCAN_IE) Receive FIFO 1 Watermark Reached Interrupt Enable */ +#define MCAN_IE_RF1FE (0x1u << 6) /**< \brief (MCAN_IE) Receive FIFO 1 Full Interrupt Enable */ +#define MCAN_IE_RF1LE (0x1u << 7) /**< \brief (MCAN_IE) Receive FIFO 1 Message Lost Interrupt Enable */ +#define MCAN_IE_HPME (0x1u << 8) /**< \brief (MCAN_IE) High Priority Message Interrupt Enable */ +#define MCAN_IE_TCE (0x1u << 9) /**< \brief (MCAN_IE) Transmission Completed Interrupt Enable */ +#define MCAN_IE_TCFE (0x1u << 10) /**< \brief (MCAN_IE) Transmission Cancellation Finished Interrupt Enable */ +#define MCAN_IE_TFEE (0x1u << 11) /**< \brief (MCAN_IE) Tx FIFO Empty Interrupt Enable */ +#define MCAN_IE_TEFNE (0x1u << 12) /**< \brief (MCAN_IE) Tx Event FIFO New Entry Interrupt Enable */ +#define MCAN_IE_TEFWE (0x1u << 13) /**< \brief (MCAN_IE) Tx Event FIFO Watermark Reached Interrupt Enable */ +#define MCAN_IE_TEFFE (0x1u << 14) /**< \brief (MCAN_IE) Tx Event FIFO Full Interrupt Enable */ +#define MCAN_IE_TEFLE (0x1u << 15) /**< \brief (MCAN_IE) Tx Event FIFO Event Lost Interrupt Enable */ +#define MCAN_IE_TSWE (0x1u << 16) /**< \brief (MCAN_IE) Timestamp Wraparound Interrupt Enable */ +#define MCAN_IE_MRAFE (0x1u << 17) /**< \brief (MCAN_IE) Message RAM Access Failure Interrupt Enable */ +#define MCAN_IE_TOOE (0x1u << 18) /**< \brief (MCAN_IE) Timeout Occurred Interrupt Enable */ +#define MCAN_IE_DRXE (0x1u << 19) /**< \brief (MCAN_IE) Message stored to Dedicated Receive Buffer Interrupt Enable */ +#define MCAN_IE_BECE (0x1u << 20) /**< \brief (MCAN_IE) Bit Error Corrected Interrupt Enable */ +#define MCAN_IE_BEUE (0x1u << 21) /**< \brief (MCAN_IE) Bit Error Uncorrected Interrupt Enable */ +#define MCAN_IE_ELOE (0x1u << 22) /**< \brief (MCAN_IE) Error Logging Overflow Interrupt Enable */ +#define MCAN_IE_EPE (0x1u << 23) /**< \brief (MCAN_IE) Error Passive Interrupt Enable */ +#define MCAN_IE_EWE (0x1u << 24) /**< \brief (MCAN_IE) Warning Status Interrupt Enable */ +#define MCAN_IE_BOE (0x1u << 25) /**< \brief (MCAN_IE) Bus_Off Status Interrupt Enable */ +#define MCAN_IE_WDIE (0x1u << 26) /**< \brief (MCAN_IE) Watchdog Interrupt Enable */ +#define MCAN_IE_PEAE (0x1u << 27) /**< \brief (MCAN_IE) Protocol Error in Arbitration Phase Enable */ +#define MCAN_IE_PEDE (0x1u << 28) /**< \brief (MCAN_IE) Protocol Error in Data Phase Enable */ +#define MCAN_IE_ARAE (0x1u << 29) /**< \brief (MCAN_IE) Access to Reserved Address Enable */ +/* -------- MCAN_ILS : (MCAN Offset: 0x58) Interrupt Line Select Register -------- */ +#define MCAN_ILS_RF0NL (0x1u << 0) /**< \brief (MCAN_ILS) Receive FIFO 0 New Message Interrupt Line */ +#define MCAN_ILS_RF0WL (0x1u << 1) /**< \brief (MCAN_ILS) Receive FIFO 0 Watermark Reached Interrupt Line */ +#define MCAN_ILS_RF0FL (0x1u << 2) /**< \brief (MCAN_ILS) Receive FIFO 0 Full Interrupt Line */ +#define MCAN_ILS_RF0LL (0x1u << 3) /**< \brief (MCAN_ILS) Receive FIFO 0 Message Lost Interrupt Line */ +#define MCAN_ILS_RF1NL (0x1u << 4) /**< \brief (MCAN_ILS) Receive FIFO 1 New Message Interrupt Line */ +#define MCAN_ILS_RF1WL (0x1u << 5) /**< \brief (MCAN_ILS) Receive FIFO 1 Watermark Reached Interrupt Line */ +#define MCAN_ILS_RF1FL (0x1u << 6) /**< \brief (MCAN_ILS) Receive FIFO 1 Full Interrupt Line */ +#define MCAN_ILS_RF1LL (0x1u << 7) /**< \brief (MCAN_ILS) Receive FIFO 1 Message Lost Interrupt Line */ +#define MCAN_ILS_HPML (0x1u << 8) /**< \brief (MCAN_ILS) High Priority Message Interrupt Line */ +#define MCAN_ILS_TCL (0x1u << 9) /**< \brief (MCAN_ILS) Transmission Completed Interrupt Line */ +#define MCAN_ILS_TCFL (0x1u << 10) /**< \brief (MCAN_ILS) Transmission Cancellation Finished Interrupt Line */ +#define MCAN_ILS_TFEL (0x1u << 11) /**< \brief (MCAN_ILS) Tx FIFO Empty Interrupt Line */ +#define MCAN_ILS_TEFNL (0x1u << 12) /**< \brief (MCAN_ILS) Tx Event FIFO New Entry Interrupt Line */ +#define MCAN_ILS_TEFWL (0x1u << 13) /**< \brief (MCAN_ILS) Tx Event FIFO Watermark Reached Interrupt Line */ +#define MCAN_ILS_TEFFL (0x1u << 14) /**< \brief (MCAN_ILS) Tx Event FIFO Full Interrupt Line */ +#define MCAN_ILS_TEFLL (0x1u << 15) /**< \brief (MCAN_ILS) Tx Event FIFO Event Lost Interrupt Line */ +#define MCAN_ILS_TSWL (0x1u << 16) /**< \brief (MCAN_ILS) Timestamp Wraparound Interrupt Line */ +#define MCAN_ILS_MRAFL (0x1u << 17) /**< \brief (MCAN_ILS) Message RAM Access Failure Interrupt Line */ +#define MCAN_ILS_TOOL (0x1u << 18) /**< \brief (MCAN_ILS) Timeout Occurred Interrupt Line */ +#define MCAN_ILS_DRXL (0x1u << 19) /**< \brief (MCAN_ILS) Message stored to Dedicated Receive Buffer Interrupt Line */ +#define MCAN_ILS_BECL (0x1u << 20) /**< \brief (MCAN_ILS) Bit Error Corrected Interrupt Line */ +#define MCAN_ILS_BEUL (0x1u << 21) /**< \brief (MCAN_ILS) Bit Error Uncorrected Interrupt Line */ +#define MCAN_ILS_ELOL (0x1u << 22) /**< \brief (MCAN_ILS) Error Logging Overflow Interrupt Line */ +#define MCAN_ILS_EPL (0x1u << 23) /**< \brief (MCAN_ILS) Error Passive Interrupt Line */ +#define MCAN_ILS_EWL (0x1u << 24) /**< \brief (MCAN_ILS) Warning Status Interrupt Line */ +#define MCAN_ILS_BOL (0x1u << 25) /**< \brief (MCAN_ILS) Bus_Off Status Interrupt Line */ +#define MCAN_ILS_WDIL (0x1u << 26) /**< \brief (MCAN_ILS) Watchdog Interrupt Line */ +#define MCAN_ILS_PEAL (0x1u << 27) /**< \brief (MCAN_ILS) Protocol Error in Arbitration Phase Line */ +#define MCAN_ILS_PEDL (0x1u << 28) /**< \brief (MCAN_ILS) Protocol Error in Data Phase Line */ +#define MCAN_ILS_ARAL (0x1u << 29) /**< \brief (MCAN_ILS) Access to Reserved Address Line */ +/* -------- MCAN_ILE : (MCAN Offset: 0x5C) Interrupt Line Enable Register -------- */ +#define MCAN_ILE_EINT0 (0x1u << 0) /**< \brief (MCAN_ILE) Enable Interrupt Line 0 */ +#define MCAN_ILE_EINT1 (0x1u << 1) /**< \brief (MCAN_ILE) Enable Interrupt Line 1 */ +/* -------- MCAN_GFC : (MCAN Offset: 0x80) Global Filter Configuration Register -------- */ +#define MCAN_GFC_RRFE (0x1u << 0) /**< \brief (MCAN_GFC) Reject Remote Frames Extended */ +#define MCAN_GFC_RRFE_FILTER (0x0u << 0) /**< \brief (MCAN_GFC) Filter remote frames with 29-bit extended IDs. */ +#define MCAN_GFC_RRFE_REJECT (0x1u << 0) /**< \brief (MCAN_GFC) Reject all remote frames with 29-bit extended IDs. */ +#define MCAN_GFC_RRFS (0x1u << 1) /**< \brief (MCAN_GFC) Reject Remote Frames Standard */ +#define MCAN_GFC_RRFS_FILTER (0x0u << 1) /**< \brief (MCAN_GFC) Filter remote frames with 11-bit standard IDs. */ +#define MCAN_GFC_RRFS_REJECT (0x1u << 1) /**< \brief (MCAN_GFC) Reject all remote frames with 11-bit standard IDs. */ +#define MCAN_GFC_ANFE_Pos 2 +#define MCAN_GFC_ANFE_Msk (0x3u << MCAN_GFC_ANFE_Pos) /**< \brief (MCAN_GFC) Accept Non-matching Frames Extended */ +#define MCAN_GFC_ANFE(value) ((MCAN_GFC_ANFE_Msk & ((value) << MCAN_GFC_ANFE_Pos))) +#define MCAN_GFC_ANFE_RX_FIFO_0 (0x0u << 2) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 0 */ +#define MCAN_GFC_ANFE_RX_FIFO_1 (0x1u << 2) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 1 */ +#define MCAN_GFC_ANFS_Pos 4 +#define MCAN_GFC_ANFS_Msk (0x3u << MCAN_GFC_ANFS_Pos) /**< \brief (MCAN_GFC) Accept Non-matching Frames Standard */ +#define MCAN_GFC_ANFS(value) ((MCAN_GFC_ANFS_Msk & ((value) << MCAN_GFC_ANFS_Pos))) +#define MCAN_GFC_ANFS_RX_FIFO_0 (0x0u << 4) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 0 */ +#define MCAN_GFC_ANFS_RX_FIFO_1 (0x1u << 4) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 1 */ +/* -------- MCAN_SIDFC : (MCAN Offset: 0x84) Standard ID Filter Configuration Register -------- */ +#define MCAN_SIDFC_FLSSA_Pos 2 +#define MCAN_SIDFC_FLSSA_Msk (0x3fffu << MCAN_SIDFC_FLSSA_Pos) /**< \brief (MCAN_SIDFC) Filter List Standard Start Address */ +#define MCAN_SIDFC_FLSSA(value) ((MCAN_SIDFC_FLSSA_Msk & ((value) << MCAN_SIDFC_FLSSA_Pos))) +#define MCAN_SIDFC_LSS_Pos 16 +#define MCAN_SIDFC_LSS_Msk (0xffu << MCAN_SIDFC_LSS_Pos) /**< \brief (MCAN_SIDFC) List Size Standard */ +#define MCAN_SIDFC_LSS(value) ((MCAN_SIDFC_LSS_Msk & ((value) << MCAN_SIDFC_LSS_Pos))) +/* -------- MCAN_XIDFC : (MCAN Offset: 0x88) Extended ID Filter Configuration Register -------- */ +#define MCAN_XIDFC_FLESA_Pos 2 +#define MCAN_XIDFC_FLESA_Msk (0x3fffu << MCAN_XIDFC_FLESA_Pos) /**< \brief (MCAN_XIDFC) Filter List Extended Start Address */ +#define MCAN_XIDFC_FLESA(value) ((MCAN_XIDFC_FLESA_Msk & ((value) << MCAN_XIDFC_FLESA_Pos))) +#define MCAN_XIDFC_LSE_Pos 16 +#define MCAN_XIDFC_LSE_Msk (0x7fu << MCAN_XIDFC_LSE_Pos) /**< \brief (MCAN_XIDFC) List Size Extended */ +#define MCAN_XIDFC_LSE(value) ((MCAN_XIDFC_LSE_Msk & ((value) << MCAN_XIDFC_LSE_Pos))) +/* -------- MCAN_XIDAM : (MCAN Offset: 0x90) Extended ID AND Mask Register -------- */ +#define MCAN_XIDAM_EIDM_Pos 0 +#define MCAN_XIDAM_EIDM_Msk (0x1fffffffu << MCAN_XIDAM_EIDM_Pos) /**< \brief (MCAN_XIDAM) Extended ID Mask */ +#define MCAN_XIDAM_EIDM(value) ((MCAN_XIDAM_EIDM_Msk & ((value) << MCAN_XIDAM_EIDM_Pos))) +/* -------- MCAN_HPMS : (MCAN Offset: 0x94) High Priority Message Status Register -------- */ +#define MCAN_HPMS_BIDX_Pos 0 +#define MCAN_HPMS_BIDX_Msk (0x3fu << MCAN_HPMS_BIDX_Pos) /**< \brief (MCAN_HPMS) Buffer Index */ +#define MCAN_HPMS_MSI_Pos 6 +#define MCAN_HPMS_MSI_Msk (0x3u << MCAN_HPMS_MSI_Pos) /**< \brief (MCAN_HPMS) Message Storage Indicator */ +#define MCAN_HPMS_MSI_NO_FIFO_SEL (0x0u << 6) /**< \brief (MCAN_HPMS) No FIFO selected. */ +#define MCAN_HPMS_MSI_LOST (0x1u << 6) /**< \brief (MCAN_HPMS) FIFO message. */ +#define MCAN_HPMS_MSI_FIFO_0 (0x2u << 6) /**< \brief (MCAN_HPMS) Message stored in FIFO 0. */ +#define MCAN_HPMS_MSI_FIFO_1 (0x3u << 6) /**< \brief (MCAN_HPMS) Message stored in FIFO 1. */ +#define MCAN_HPMS_FIDX_Pos 8 +#define MCAN_HPMS_FIDX_Msk (0x7fu << MCAN_HPMS_FIDX_Pos) /**< \brief (MCAN_HPMS) Filter Index */ +#define MCAN_HPMS_FLST (0x1u << 15) /**< \brief (MCAN_HPMS) Filter List */ +/* -------- MCAN_NDAT1 : (MCAN Offset: 0x98) New Data 1 Register -------- */ +#define MCAN_NDAT1_ND0 (0x1u << 0) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND1 (0x1u << 1) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND2 (0x1u << 2) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND3 (0x1u << 3) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND4 (0x1u << 4) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND5 (0x1u << 5) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND6 (0x1u << 6) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND7 (0x1u << 7) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND8 (0x1u << 8) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND9 (0x1u << 9) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND10 (0x1u << 10) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND11 (0x1u << 11) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND12 (0x1u << 12) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND13 (0x1u << 13) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND14 (0x1u << 14) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND15 (0x1u << 15) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND16 (0x1u << 16) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND17 (0x1u << 17) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND18 (0x1u << 18) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND19 (0x1u << 19) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND20 (0x1u << 20) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND21 (0x1u << 21) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND22 (0x1u << 22) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND23 (0x1u << 23) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND24 (0x1u << 24) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND25 (0x1u << 25) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND26 (0x1u << 26) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND27 (0x1u << 27) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND28 (0x1u << 28) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND29 (0x1u << 29) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND30 (0x1u << 30) /**< \brief (MCAN_NDAT1) New Data */ +#define MCAN_NDAT1_ND31 (0x1u << 31) /**< \brief (MCAN_NDAT1) New Data */ +/* -------- MCAN_NDAT2 : (MCAN Offset: 0x9C) New Data 2 Register -------- */ +#define MCAN_NDAT2_ND32 (0x1u << 0) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND33 (0x1u << 1) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND34 (0x1u << 2) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND35 (0x1u << 3) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND36 (0x1u << 4) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND37 (0x1u << 5) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND38 (0x1u << 6) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND39 (0x1u << 7) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND40 (0x1u << 8) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND41 (0x1u << 9) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND42 (0x1u << 10) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND43 (0x1u << 11) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND44 (0x1u << 12) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND45 (0x1u << 13) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND46 (0x1u << 14) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND47 (0x1u << 15) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND48 (0x1u << 16) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND49 (0x1u << 17) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND50 (0x1u << 18) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND51 (0x1u << 19) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND52 (0x1u << 20) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND53 (0x1u << 21) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND54 (0x1u << 22) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND55 (0x1u << 23) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND56 (0x1u << 24) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND57 (0x1u << 25) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND58 (0x1u << 26) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND59 (0x1u << 27) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND60 (0x1u << 28) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND61 (0x1u << 29) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND62 (0x1u << 30) /**< \brief (MCAN_NDAT2) New Data */ +#define MCAN_NDAT2_ND63 (0x1u << 31) /**< \brief (MCAN_NDAT2) New Data */ +/* -------- MCAN_RXF0C : (MCAN Offset: 0xA0) Receive FIFO 0 Configuration Register -------- */ +#define MCAN_RXF0C_F0SA_Pos 2 +#define MCAN_RXF0C_F0SA_Msk (0x3fffu << MCAN_RXF0C_F0SA_Pos) /**< \brief (MCAN_RXF0C) Receive FIFO 0 Start Address */ +#define MCAN_RXF0C_F0SA(value) ((MCAN_RXF0C_F0SA_Msk & ((value) << MCAN_RXF0C_F0SA_Pos))) +#define MCAN_RXF0C_F0S_Pos 16 +#define MCAN_RXF0C_F0S_Msk (0x7fu << MCAN_RXF0C_F0S_Pos) /**< \brief (MCAN_RXF0C) Receive FIFO 0 Start Address */ +#define MCAN_RXF0C_F0S(value) ((MCAN_RXF0C_F0S_Msk & ((value) << MCAN_RXF0C_F0S_Pos))) +#define MCAN_RXF0C_F0WM_Pos 24 +#define MCAN_RXF0C_F0WM_Msk (0x7fu << MCAN_RXF0C_F0WM_Pos) /**< \brief (MCAN_RXF0C) Receive FIFO 0 Watermark */ +#define MCAN_RXF0C_F0WM(value) ((MCAN_RXF0C_F0WM_Msk & ((value) << MCAN_RXF0C_F0WM_Pos))) +#define MCAN_RXF0C_F0OM (0x1u << 31) /**< \brief (MCAN_RXF0C) FIFO 0 Operation Mode */ +/* -------- MCAN_RXF0S : (MCAN Offset: 0xA4) Receive FIFO 0 Status Register -------- */ +#define MCAN_RXF0S_F0FL_Pos 0 +#define MCAN_RXF0S_F0FL_Msk (0x7fu << MCAN_RXF0S_F0FL_Pos) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Fill Level */ +#define MCAN_RXF0S_F0GI_Pos 8 +#define MCAN_RXF0S_F0GI_Msk (0x3fu << MCAN_RXF0S_F0GI_Pos) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Get Index */ +#define MCAN_RXF0S_F0PI_Pos 16 +#define MCAN_RXF0S_F0PI_Msk (0x3fu << MCAN_RXF0S_F0PI_Pos) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Put Index */ +#define MCAN_RXF0S_F0F (0x1u << 24) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Fill Level */ +#define MCAN_RXF0S_RF0L (0x1u << 25) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Message Lost */ +/* -------- MCAN_RXF0A : (MCAN Offset: 0xA8) Receive FIFO 0 Acknowledge Register -------- */ +#define MCAN_RXF0A_F0AI_Pos 0 +#define MCAN_RXF0A_F0AI_Msk (0x3fu << MCAN_RXF0A_F0AI_Pos) /**< \brief (MCAN_RXF0A) Receive FIFO 0 Acknowledge Index */ +#define MCAN_RXF0A_F0AI(value) ((MCAN_RXF0A_F0AI_Msk & ((value) << MCAN_RXF0A_F0AI_Pos))) +/* -------- MCAN_RXBC : (MCAN Offset: 0xAC) Receive Rx Buffer Configuration Register -------- */ +#define MCAN_RXBC_RBSA_Pos 2 +#define MCAN_RXBC_RBSA_Msk (0x3fffu << MCAN_RXBC_RBSA_Pos) /**< \brief (MCAN_RXBC) Receive Buffer Start Address */ +#define MCAN_RXBC_RBSA(value) ((MCAN_RXBC_RBSA_Msk & ((value) << MCAN_RXBC_RBSA_Pos))) +/* -------- MCAN_RXF1C : (MCAN Offset: 0xB0) Receive FIFO 1 Configuration Register -------- */ +#define MCAN_RXF1C_F1SA_Pos 2 +#define MCAN_RXF1C_F1SA_Msk (0x3fffu << MCAN_RXF1C_F1SA_Pos) /**< \brief (MCAN_RXF1C) Receive FIFO 1 Start Address */ +#define MCAN_RXF1C_F1SA(value) ((MCAN_RXF1C_F1SA_Msk & ((value) << MCAN_RXF1C_F1SA_Pos))) +#define MCAN_RXF1C_F1S_Pos 16 +#define MCAN_RXF1C_F1S_Msk (0x7fu << MCAN_RXF1C_F1S_Pos) /**< \brief (MCAN_RXF1C) Receive FIFO 1 Start Address */ +#define MCAN_RXF1C_F1S(value) ((MCAN_RXF1C_F1S_Msk & ((value) << MCAN_RXF1C_F1S_Pos))) +#define MCAN_RXF1C_F1WM_Pos 24 +#define MCAN_RXF1C_F1WM_Msk (0x7fu << MCAN_RXF1C_F1WM_Pos) /**< \brief (MCAN_RXF1C) Receive FIFO 1 Watermark */ +#define MCAN_RXF1C_F1WM(value) ((MCAN_RXF1C_F1WM_Msk & ((value) << MCAN_RXF1C_F1WM_Pos))) +#define MCAN_RXF1C_F1OM (0x1u << 31) /**< \brief (MCAN_RXF1C) FIFO 1 Operation Mode */ +/* -------- MCAN_RXF1S : (MCAN Offset: 0xB4) Receive FIFO 1 Status Register -------- */ +#define MCAN_RXF1S_F1FL_Pos 0 +#define MCAN_RXF1S_F1FL_Msk (0x7fu << MCAN_RXF1S_F1FL_Pos) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Fill Level */ +#define MCAN_RXF1S_F1GI_Pos 8 +#define MCAN_RXF1S_F1GI_Msk (0x3fu << MCAN_RXF1S_F1GI_Pos) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Get Index */ +#define MCAN_RXF1S_F1PI_Pos 16 +#define MCAN_RXF1S_F1PI_Msk (0x3fu << MCAN_RXF1S_F1PI_Pos) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Put Index */ +#define MCAN_RXF1S_F1F (0x1u << 24) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Fill Level */ +#define MCAN_RXF1S_RF1L (0x1u << 25) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Message Lost */ +#define MCAN_RXF1S_DMS_Pos 30 +#define MCAN_RXF1S_DMS_Msk (0x3u << MCAN_RXF1S_DMS_Pos) /**< \brief (MCAN_RXF1S) Debug Message Status */ +#define MCAN_RXF1S_DMS_IDLE (0x0u << 30) /**< \brief (MCAN_RXF1S) Idle state, wait for reception of debug messages, DMA request is cleared. */ +#define MCAN_RXF1S_DMS_MSG_A (0x1u << 30) /**< \brief (MCAN_RXF1S) Debug message A received. */ +#define MCAN_RXF1S_DMS_MSG_AB (0x2u << 30) /**< \brief (MCAN_RXF1S) Debug messages A, B received. */ +#define MCAN_RXF1S_DMS_MSG_ABC (0x3u << 30) /**< \brief (MCAN_RXF1S) Debug messages A, B, C received, DMA request is set. */ +/* -------- MCAN_RXF1A : (MCAN Offset: 0xB8) Receive FIFO 1 Acknowledge Register -------- */ +#define MCAN_RXF1A_F1AI_Pos 0 +#define MCAN_RXF1A_F1AI_Msk (0x3fu << MCAN_RXF1A_F1AI_Pos) /**< \brief (MCAN_RXF1A) Receive FIFO 1 Acknowledge Index */ +#define MCAN_RXF1A_F1AI(value) ((MCAN_RXF1A_F1AI_Msk & ((value) << MCAN_RXF1A_F1AI_Pos))) +/* -------- MCAN_RXESC : (MCAN Offset: 0xBC) Receive Buffer / FIFO Element Size Configuration Register -------- */ +#define MCAN_RXESC_F0DS_Pos 0 +#define MCAN_RXESC_F0DS_Msk (0x7u << MCAN_RXESC_F0DS_Pos) /**< \brief (MCAN_RXESC) Receive FIFO 0 Data Field Size */ +#define MCAN_RXESC_F0DS(value) ((MCAN_RXESC_F0DS_Msk & ((value) << MCAN_RXESC_F0DS_Pos))) +#define MCAN_RXESC_F0DS_8_BYTE (0x0u << 0) /**< \brief (MCAN_RXESC) 8-byte data field */ +#define MCAN_RXESC_F0DS_12_BYTE (0x1u << 0) /**< \brief (MCAN_RXESC) 12-byte data field */ +#define MCAN_RXESC_F0DS_16_BYTE (0x2u << 0) /**< \brief (MCAN_RXESC) 16-byte data field */ +#define MCAN_RXESC_F0DS_20_BYTE (0x3u << 0) /**< \brief (MCAN_RXESC) 20-byte data field */ +#define MCAN_RXESC_F0DS_24_BYTE (0x4u << 0) /**< \brief (MCAN_RXESC) 24-byte data field */ +#define MCAN_RXESC_F0DS_32_BYTE (0x5u << 0) /**< \brief (MCAN_RXESC) 32-byte data field */ +#define MCAN_RXESC_F0DS_48_BYTE (0x6u << 0) /**< \brief (MCAN_RXESC) 48-byte data field */ +#define MCAN_RXESC_F0DS_64_BYTE (0x7u << 0) /**< \brief (MCAN_RXESC) 64-byte data field */ +#define MCAN_RXESC_F1DS_Pos 4 +#define MCAN_RXESC_F1DS_Msk (0x7u << MCAN_RXESC_F1DS_Pos) /**< \brief (MCAN_RXESC) Receive FIFO 1 Data Field Size */ +#define MCAN_RXESC_F1DS(value) ((MCAN_RXESC_F1DS_Msk & ((value) << MCAN_RXESC_F1DS_Pos))) +#define MCAN_RXESC_F1DS_8_BYTE (0x0u << 4) /**< \brief (MCAN_RXESC) 8-byte data field */ +#define MCAN_RXESC_F1DS_12_BYTE (0x1u << 4) /**< \brief (MCAN_RXESC) 12-byte data field */ +#define MCAN_RXESC_F1DS_16_BYTE (0x2u << 4) /**< \brief (MCAN_RXESC) 16-byte data field */ +#define MCAN_RXESC_F1DS_20_BYTE (0x3u << 4) /**< \brief (MCAN_RXESC) 20-byte data field */ +#define MCAN_RXESC_F1DS_24_BYTE (0x4u << 4) /**< \brief (MCAN_RXESC) 24-byte data field */ +#define MCAN_RXESC_F1DS_32_BYTE (0x5u << 4) /**< \brief (MCAN_RXESC) 32-byte data field */ +#define MCAN_RXESC_F1DS_48_BYTE (0x6u << 4) /**< \brief (MCAN_RXESC) 48-byte data field */ +#define MCAN_RXESC_F1DS_64_BYTE (0x7u << 4) /**< \brief (MCAN_RXESC) 64-byte data field */ +#define MCAN_RXESC_RBDS_Pos 8 +#define MCAN_RXESC_RBDS_Msk (0x7u << MCAN_RXESC_RBDS_Pos) /**< \brief (MCAN_RXESC) Receive Buffer Data Field Size */ +#define MCAN_RXESC_RBDS(value) ((MCAN_RXESC_RBDS_Msk & ((value) << MCAN_RXESC_RBDS_Pos))) +#define MCAN_RXESC_RBDS_8_BYTE (0x0u << 8) /**< \brief (MCAN_RXESC) 8-byte data field */ +#define MCAN_RXESC_RBDS_12_BYTE (0x1u << 8) /**< \brief (MCAN_RXESC) 12-byte data field */ +#define MCAN_RXESC_RBDS_16_BYTE (0x2u << 8) /**< \brief (MCAN_RXESC) 16-byte data field */ +#define MCAN_RXESC_RBDS_20_BYTE (0x3u << 8) /**< \brief (MCAN_RXESC) 20-byte data field */ +#define MCAN_RXESC_RBDS_24_BYTE (0x4u << 8) /**< \brief (MCAN_RXESC) 24-byte data field */ +#define MCAN_RXESC_RBDS_32_BYTE (0x5u << 8) /**< \brief (MCAN_RXESC) 32-byte data field */ +#define MCAN_RXESC_RBDS_48_BYTE (0x6u << 8) /**< \brief (MCAN_RXESC) 48-byte data field */ +#define MCAN_RXESC_RBDS_64_BYTE (0x7u << 8) /**< \brief (MCAN_RXESC) 64-byte data field */ +/* -------- MCAN_TXBC : (MCAN Offset: 0xC0) Transmit Buffer Configuration Register -------- */ +#define MCAN_TXBC_TBSA_Pos 2 +#define MCAN_TXBC_TBSA_Msk (0x3fffu << MCAN_TXBC_TBSA_Pos) /**< \brief (MCAN_TXBC) Tx Buffers Start Address */ +#define MCAN_TXBC_TBSA(value) ((MCAN_TXBC_TBSA_Msk & ((value) << MCAN_TXBC_TBSA_Pos))) +#define MCAN_TXBC_NDTB_Pos 16 +#define MCAN_TXBC_NDTB_Msk (0x3fu << MCAN_TXBC_NDTB_Pos) /**< \brief (MCAN_TXBC) Number of Dedicated Transmit Buffers */ +#define MCAN_TXBC_NDTB(value) ((MCAN_TXBC_NDTB_Msk & ((value) << MCAN_TXBC_NDTB_Pos))) +#define MCAN_TXBC_TFQS_Pos 24 +#define MCAN_TXBC_TFQS_Msk (0x3fu << MCAN_TXBC_TFQS_Pos) /**< \brief (MCAN_TXBC) Transmit FIFO/Queue Size */ +#define MCAN_TXBC_TFQS(value) ((MCAN_TXBC_TFQS_Msk & ((value) << MCAN_TXBC_TFQS_Pos))) +#define MCAN_TXBC_TFQM (0x1u << 30) /**< \brief (MCAN_TXBC) Tx FIFO/Queue Mode */ +/* -------- MCAN_TXFQS : (MCAN Offset: 0xC4) Transmit FIFO/Queue Status Register -------- */ +#define MCAN_TXFQS_TFFL_Pos 0 +#define MCAN_TXFQS_TFFL_Msk (0x3fu << MCAN_TXFQS_TFFL_Pos) /**< \brief (MCAN_TXFQS) Tx FIFO Free Level */ +#define MCAN_TXFQS_TFGI_Pos 8 +#define MCAN_TXFQS_TFGI_Msk (0x1fu << MCAN_TXFQS_TFGI_Pos) /**< \brief (MCAN_TXFQS) Tx FIFO Get Index */ +#define MCAN_TXFQS_TFQPI_Pos 16 +#define MCAN_TXFQS_TFQPI_Msk (0x1fu << MCAN_TXFQS_TFQPI_Pos) /**< \brief (MCAN_TXFQS) Tx FIFO/Queue Put Index */ +#define MCAN_TXFQS_TFQF (0x1u << 21) /**< \brief (MCAN_TXFQS) Tx FIFO/Queue Full */ +/* -------- MCAN_TXESC : (MCAN Offset: 0xC8) Transmit Buffer Element Size Configuration Register -------- */ +#define MCAN_TXESC_TBDS_Pos 0 +#define MCAN_TXESC_TBDS_Msk (0x7u << MCAN_TXESC_TBDS_Pos) /**< \brief (MCAN_TXESC) Tx Buffer Data Field Size */ +#define MCAN_TXESC_TBDS(value) ((MCAN_TXESC_TBDS_Msk & ((value) << MCAN_TXESC_TBDS_Pos))) +#define MCAN_TXESC_TBDS_8_BYTE (0x0u << 0) /**< \brief (MCAN_TXESC) 8-byte data field */ +#define MCAN_TXESC_TBDS_12_BYTE (0x1u << 0) /**< \brief (MCAN_TXESC) 12-byte data field */ +#define MCAN_TXESC_TBDS_16_BYTE (0x2u << 0) /**< \brief (MCAN_TXESC) 16-byte data field */ +#define MCAN_TXESC_TBDS_20_BYTE (0x3u << 0) /**< \brief (MCAN_TXESC) 20-byte data field */ +#define MCAN_TXESC_TBDS_24_BYTE (0x4u << 0) /**< \brief (MCAN_TXESC) 24-byte data field */ +#define MCAN_TXESC_TBDS_32_BYTE (0x5u << 0) /**< \brief (MCAN_TXESC) 32-byte data field */ +#define MCAN_TXESC_TBDS_48_BYTE (0x6u << 0) /**< \brief (MCAN_TXESC) 48-byte data field */ +#define MCAN_TXESC_TBDS_64_BYTE (0x7u << 0) /**< \brief (MCAN_TXESC) 64-byte data field */ +/* -------- MCAN_TXBRP : (MCAN Offset: 0xCC) Transmit Buffer Request Pending Register -------- */ +#define MCAN_TXBRP_TRP0 (0x1u << 0) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 0 */ +#define MCAN_TXBRP_TRP1 (0x1u << 1) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 1 */ +#define MCAN_TXBRP_TRP2 (0x1u << 2) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 2 */ +#define MCAN_TXBRP_TRP3 (0x1u << 3) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 3 */ +#define MCAN_TXBRP_TRP4 (0x1u << 4) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 4 */ +#define MCAN_TXBRP_TRP5 (0x1u << 5) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 5 */ +#define MCAN_TXBRP_TRP6 (0x1u << 6) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 6 */ +#define MCAN_TXBRP_TRP7 (0x1u << 7) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 7 */ +#define MCAN_TXBRP_TRP8 (0x1u << 8) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 8 */ +#define MCAN_TXBRP_TRP9 (0x1u << 9) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 9 */ +#define MCAN_TXBRP_TRP10 (0x1u << 10) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 10 */ +#define MCAN_TXBRP_TRP11 (0x1u << 11) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 11 */ +#define MCAN_TXBRP_TRP12 (0x1u << 12) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 12 */ +#define MCAN_TXBRP_TRP13 (0x1u << 13) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 13 */ +#define MCAN_TXBRP_TRP14 (0x1u << 14) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 14 */ +#define MCAN_TXBRP_TRP15 (0x1u << 15) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 15 */ +#define MCAN_TXBRP_TRP16 (0x1u << 16) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 16 */ +#define MCAN_TXBRP_TRP17 (0x1u << 17) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 17 */ +#define MCAN_TXBRP_TRP18 (0x1u << 18) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 18 */ +#define MCAN_TXBRP_TRP19 (0x1u << 19) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 19 */ +#define MCAN_TXBRP_TRP20 (0x1u << 20) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 20 */ +#define MCAN_TXBRP_TRP21 (0x1u << 21) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 21 */ +#define MCAN_TXBRP_TRP22 (0x1u << 22) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 22 */ +#define MCAN_TXBRP_TRP23 (0x1u << 23) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 23 */ +#define MCAN_TXBRP_TRP24 (0x1u << 24) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 24 */ +#define MCAN_TXBRP_TRP25 (0x1u << 25) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 25 */ +#define MCAN_TXBRP_TRP26 (0x1u << 26) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 26 */ +#define MCAN_TXBRP_TRP27 (0x1u << 27) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 27 */ +#define MCAN_TXBRP_TRP28 (0x1u << 28) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 28 */ +#define MCAN_TXBRP_TRP29 (0x1u << 29) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 29 */ +#define MCAN_TXBRP_TRP30 (0x1u << 30) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 30 */ +#define MCAN_TXBRP_TRP31 (0x1u << 31) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 31 */ +/* -------- MCAN_TXBAR : (MCAN Offset: 0xD0) Transmit Buffer Add Request Register -------- */ +#define MCAN_TXBAR_AR0 (0x1u << 0) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 0 */ +#define MCAN_TXBAR_AR1 (0x1u << 1) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 1 */ +#define MCAN_TXBAR_AR2 (0x1u << 2) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 2 */ +#define MCAN_TXBAR_AR3 (0x1u << 3) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 3 */ +#define MCAN_TXBAR_AR4 (0x1u << 4) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 4 */ +#define MCAN_TXBAR_AR5 (0x1u << 5) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 5 */ +#define MCAN_TXBAR_AR6 (0x1u << 6) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 6 */ +#define MCAN_TXBAR_AR7 (0x1u << 7) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 7 */ +#define MCAN_TXBAR_AR8 (0x1u << 8) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 8 */ +#define MCAN_TXBAR_AR9 (0x1u << 9) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 9 */ +#define MCAN_TXBAR_AR10 (0x1u << 10) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 10 */ +#define MCAN_TXBAR_AR11 (0x1u << 11) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 11 */ +#define MCAN_TXBAR_AR12 (0x1u << 12) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 12 */ +#define MCAN_TXBAR_AR13 (0x1u << 13) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 13 */ +#define MCAN_TXBAR_AR14 (0x1u << 14) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 14 */ +#define MCAN_TXBAR_AR15 (0x1u << 15) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 15 */ +#define MCAN_TXBAR_AR16 (0x1u << 16) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 16 */ +#define MCAN_TXBAR_AR17 (0x1u << 17) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 17 */ +#define MCAN_TXBAR_AR18 (0x1u << 18) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 18 */ +#define MCAN_TXBAR_AR19 (0x1u << 19) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 19 */ +#define MCAN_TXBAR_AR20 (0x1u << 20) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 20 */ +#define MCAN_TXBAR_AR21 (0x1u << 21) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 21 */ +#define MCAN_TXBAR_AR22 (0x1u << 22) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 22 */ +#define MCAN_TXBAR_AR23 (0x1u << 23) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 23 */ +#define MCAN_TXBAR_AR24 (0x1u << 24) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 24 */ +#define MCAN_TXBAR_AR25 (0x1u << 25) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 25 */ +#define MCAN_TXBAR_AR26 (0x1u << 26) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 26 */ +#define MCAN_TXBAR_AR27 (0x1u << 27) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 27 */ +#define MCAN_TXBAR_AR28 (0x1u << 28) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 28 */ +#define MCAN_TXBAR_AR29 (0x1u << 29) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 29 */ +#define MCAN_TXBAR_AR30 (0x1u << 30) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 30 */ +#define MCAN_TXBAR_AR31 (0x1u << 31) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 31 */ +/* -------- MCAN_TXBCR : (MCAN Offset: 0xD4) Transmit Buffer Cancellation Request Register -------- */ +#define MCAN_TXBCR_CR0 (0x1u << 0) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 0 */ +#define MCAN_TXBCR_CR1 (0x1u << 1) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 1 */ +#define MCAN_TXBCR_CR2 (0x1u << 2) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 2 */ +#define MCAN_TXBCR_CR3 (0x1u << 3) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 3 */ +#define MCAN_TXBCR_CR4 (0x1u << 4) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 4 */ +#define MCAN_TXBCR_CR5 (0x1u << 5) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 5 */ +#define MCAN_TXBCR_CR6 (0x1u << 6) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 6 */ +#define MCAN_TXBCR_CR7 (0x1u << 7) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 7 */ +#define MCAN_TXBCR_CR8 (0x1u << 8) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 8 */ +#define MCAN_TXBCR_CR9 (0x1u << 9) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 9 */ +#define MCAN_TXBCR_CR10 (0x1u << 10) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 10 */ +#define MCAN_TXBCR_CR11 (0x1u << 11) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 11 */ +#define MCAN_TXBCR_CR12 (0x1u << 12) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 12 */ +#define MCAN_TXBCR_CR13 (0x1u << 13) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 13 */ +#define MCAN_TXBCR_CR14 (0x1u << 14) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 14 */ +#define MCAN_TXBCR_CR15 (0x1u << 15) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 15 */ +#define MCAN_TXBCR_CR16 (0x1u << 16) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 16 */ +#define MCAN_TXBCR_CR17 (0x1u << 17) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 17 */ +#define MCAN_TXBCR_CR18 (0x1u << 18) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 18 */ +#define MCAN_TXBCR_CR19 (0x1u << 19) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 19 */ +#define MCAN_TXBCR_CR20 (0x1u << 20) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 20 */ +#define MCAN_TXBCR_CR21 (0x1u << 21) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 21 */ +#define MCAN_TXBCR_CR22 (0x1u << 22) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 22 */ +#define MCAN_TXBCR_CR23 (0x1u << 23) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 23 */ +#define MCAN_TXBCR_CR24 (0x1u << 24) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 24 */ +#define MCAN_TXBCR_CR25 (0x1u << 25) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 25 */ +#define MCAN_TXBCR_CR26 (0x1u << 26) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 26 */ +#define MCAN_TXBCR_CR27 (0x1u << 27) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 27 */ +#define MCAN_TXBCR_CR28 (0x1u << 28) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 28 */ +#define MCAN_TXBCR_CR29 (0x1u << 29) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 29 */ +#define MCAN_TXBCR_CR30 (0x1u << 30) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 30 */ +#define MCAN_TXBCR_CR31 (0x1u << 31) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 31 */ +/* -------- MCAN_TXBTO : (MCAN Offset: 0xD8) Transmit Buffer Transmission Occurred Register -------- */ +#define MCAN_TXBTO_TO0 (0x1u << 0) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 0 */ +#define MCAN_TXBTO_TO1 (0x1u << 1) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 1 */ +#define MCAN_TXBTO_TO2 (0x1u << 2) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 2 */ +#define MCAN_TXBTO_TO3 (0x1u << 3) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 3 */ +#define MCAN_TXBTO_TO4 (0x1u << 4) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 4 */ +#define MCAN_TXBTO_TO5 (0x1u << 5) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 5 */ +#define MCAN_TXBTO_TO6 (0x1u << 6) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 6 */ +#define MCAN_TXBTO_TO7 (0x1u << 7) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 7 */ +#define MCAN_TXBTO_TO8 (0x1u << 8) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 8 */ +#define MCAN_TXBTO_TO9 (0x1u << 9) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 9 */ +#define MCAN_TXBTO_TO10 (0x1u << 10) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 10 */ +#define MCAN_TXBTO_TO11 (0x1u << 11) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 11 */ +#define MCAN_TXBTO_TO12 (0x1u << 12) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 12 */ +#define MCAN_TXBTO_TO13 (0x1u << 13) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 13 */ +#define MCAN_TXBTO_TO14 (0x1u << 14) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 14 */ +#define MCAN_TXBTO_TO15 (0x1u << 15) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 15 */ +#define MCAN_TXBTO_TO16 (0x1u << 16) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 16 */ +#define MCAN_TXBTO_TO17 (0x1u << 17) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 17 */ +#define MCAN_TXBTO_TO18 (0x1u << 18) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 18 */ +#define MCAN_TXBTO_TO19 (0x1u << 19) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 19 */ +#define MCAN_TXBTO_TO20 (0x1u << 20) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 20 */ +#define MCAN_TXBTO_TO21 (0x1u << 21) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 21 */ +#define MCAN_TXBTO_TO22 (0x1u << 22) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 22 */ +#define MCAN_TXBTO_TO23 (0x1u << 23) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 23 */ +#define MCAN_TXBTO_TO24 (0x1u << 24) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 24 */ +#define MCAN_TXBTO_TO25 (0x1u << 25) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 25 */ +#define MCAN_TXBTO_TO26 (0x1u << 26) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 26 */ +#define MCAN_TXBTO_TO27 (0x1u << 27) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 27 */ +#define MCAN_TXBTO_TO28 (0x1u << 28) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 28 */ +#define MCAN_TXBTO_TO29 (0x1u << 29) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 29 */ +#define MCAN_TXBTO_TO30 (0x1u << 30) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 30 */ +#define MCAN_TXBTO_TO31 (0x1u << 31) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 31 */ +/* -------- MCAN_TXBCF : (MCAN Offset: 0xDC) Transmit Buffer Cancellation Finished Register -------- */ +#define MCAN_TXBCF_CF0 (0x1u << 0) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 0 */ +#define MCAN_TXBCF_CF1 (0x1u << 1) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 1 */ +#define MCAN_TXBCF_CF2 (0x1u << 2) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 2 */ +#define MCAN_TXBCF_CF3 (0x1u << 3) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 3 */ +#define MCAN_TXBCF_CF4 (0x1u << 4) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 4 */ +#define MCAN_TXBCF_CF5 (0x1u << 5) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 5 */ +#define MCAN_TXBCF_CF6 (0x1u << 6) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 6 */ +#define MCAN_TXBCF_CF7 (0x1u << 7) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 7 */ +#define MCAN_TXBCF_CF8 (0x1u << 8) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 8 */ +#define MCAN_TXBCF_CF9 (0x1u << 9) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 9 */ +#define MCAN_TXBCF_CF10 (0x1u << 10) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 10 */ +#define MCAN_TXBCF_CF11 (0x1u << 11) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 11 */ +#define MCAN_TXBCF_CF12 (0x1u << 12) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 12 */ +#define MCAN_TXBCF_CF13 (0x1u << 13) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 13 */ +#define MCAN_TXBCF_CF14 (0x1u << 14) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 14 */ +#define MCAN_TXBCF_CF15 (0x1u << 15) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 15 */ +#define MCAN_TXBCF_CF16 (0x1u << 16) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 16 */ +#define MCAN_TXBCF_CF17 (0x1u << 17) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 17 */ +#define MCAN_TXBCF_CF18 (0x1u << 18) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 18 */ +#define MCAN_TXBCF_CF19 (0x1u << 19) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 19 */ +#define MCAN_TXBCF_CF20 (0x1u << 20) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 20 */ +#define MCAN_TXBCF_CF21 (0x1u << 21) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 21 */ +#define MCAN_TXBCF_CF22 (0x1u << 22) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 22 */ +#define MCAN_TXBCF_CF23 (0x1u << 23) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 23 */ +#define MCAN_TXBCF_CF24 (0x1u << 24) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 24 */ +#define MCAN_TXBCF_CF25 (0x1u << 25) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 25 */ +#define MCAN_TXBCF_CF26 (0x1u << 26) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 26 */ +#define MCAN_TXBCF_CF27 (0x1u << 27) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 27 */ +#define MCAN_TXBCF_CF28 (0x1u << 28) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 28 */ +#define MCAN_TXBCF_CF29 (0x1u << 29) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 29 */ +#define MCAN_TXBCF_CF30 (0x1u << 30) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 30 */ +#define MCAN_TXBCF_CF31 (0x1u << 31) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 31 */ +/* -------- MCAN_TXBTIE : (MCAN Offset: 0xE0) Transmit Buffer Transmission Interrupt Enable Register -------- */ +#define MCAN_TXBTIE_TIE0 (0x1u << 0) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 0 */ +#define MCAN_TXBTIE_TIE1 (0x1u << 1) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 1 */ +#define MCAN_TXBTIE_TIE2 (0x1u << 2) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 2 */ +#define MCAN_TXBTIE_TIE3 (0x1u << 3) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 3 */ +#define MCAN_TXBTIE_TIE4 (0x1u << 4) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 4 */ +#define MCAN_TXBTIE_TIE5 (0x1u << 5) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 5 */ +#define MCAN_TXBTIE_TIE6 (0x1u << 6) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 6 */ +#define MCAN_TXBTIE_TIE7 (0x1u << 7) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 7 */ +#define MCAN_TXBTIE_TIE8 (0x1u << 8) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 8 */ +#define MCAN_TXBTIE_TIE9 (0x1u << 9) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 9 */ +#define MCAN_TXBTIE_TIE10 (0x1u << 10) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 10 */ +#define MCAN_TXBTIE_TIE11 (0x1u << 11) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 11 */ +#define MCAN_TXBTIE_TIE12 (0x1u << 12) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 12 */ +#define MCAN_TXBTIE_TIE13 (0x1u << 13) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 13 */ +#define MCAN_TXBTIE_TIE14 (0x1u << 14) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 14 */ +#define MCAN_TXBTIE_TIE15 (0x1u << 15) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 15 */ +#define MCAN_TXBTIE_TIE16 (0x1u << 16) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 16 */ +#define MCAN_TXBTIE_TIE17 (0x1u << 17) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 17 */ +#define MCAN_TXBTIE_TIE18 (0x1u << 18) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 18 */ +#define MCAN_TXBTIE_TIE19 (0x1u << 19) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 19 */ +#define MCAN_TXBTIE_TIE20 (0x1u << 20) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 20 */ +#define MCAN_TXBTIE_TIE21 (0x1u << 21) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 21 */ +#define MCAN_TXBTIE_TIE22 (0x1u << 22) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 22 */ +#define MCAN_TXBTIE_TIE23 (0x1u << 23) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 23 */ +#define MCAN_TXBTIE_TIE24 (0x1u << 24) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 24 */ +#define MCAN_TXBTIE_TIE25 (0x1u << 25) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 25 */ +#define MCAN_TXBTIE_TIE26 (0x1u << 26) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 26 */ +#define MCAN_TXBTIE_TIE27 (0x1u << 27) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 27 */ +#define MCAN_TXBTIE_TIE28 (0x1u << 28) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 28 */ +#define MCAN_TXBTIE_TIE29 (0x1u << 29) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 29 */ +#define MCAN_TXBTIE_TIE30 (0x1u << 30) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 30 */ +#define MCAN_TXBTIE_TIE31 (0x1u << 31) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 31 */ +/* -------- MCAN_TXBCIE : (MCAN Offset: 0xE4) Transmit Buffer Cancellation Finished Interrupt Enable Register -------- */ +#define MCAN_TXBCIE_CFIE0 (0x1u << 0) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 0 */ +#define MCAN_TXBCIE_CFIE1 (0x1u << 1) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 1 */ +#define MCAN_TXBCIE_CFIE2 (0x1u << 2) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 2 */ +#define MCAN_TXBCIE_CFIE3 (0x1u << 3) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 3 */ +#define MCAN_TXBCIE_CFIE4 (0x1u << 4) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 4 */ +#define MCAN_TXBCIE_CFIE5 (0x1u << 5) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 5 */ +#define MCAN_TXBCIE_CFIE6 (0x1u << 6) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 6 */ +#define MCAN_TXBCIE_CFIE7 (0x1u << 7) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 7 */ +#define MCAN_TXBCIE_CFIE8 (0x1u << 8) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 8 */ +#define MCAN_TXBCIE_CFIE9 (0x1u << 9) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 9 */ +#define MCAN_TXBCIE_CFIE10 (0x1u << 10) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 10 */ +#define MCAN_TXBCIE_CFIE11 (0x1u << 11) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 11 */ +#define MCAN_TXBCIE_CFIE12 (0x1u << 12) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 12 */ +#define MCAN_TXBCIE_CFIE13 (0x1u << 13) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 13 */ +#define MCAN_TXBCIE_CFIE14 (0x1u << 14) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 14 */ +#define MCAN_TXBCIE_CFIE15 (0x1u << 15) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 15 */ +#define MCAN_TXBCIE_CFIE16 (0x1u << 16) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 16 */ +#define MCAN_TXBCIE_CFIE17 (0x1u << 17) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 17 */ +#define MCAN_TXBCIE_CFIE18 (0x1u << 18) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 18 */ +#define MCAN_TXBCIE_CFIE19 (0x1u << 19) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 19 */ +#define MCAN_TXBCIE_CFIE20 (0x1u << 20) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 20 */ +#define MCAN_TXBCIE_CFIE21 (0x1u << 21) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 21 */ +#define MCAN_TXBCIE_CFIE22 (0x1u << 22) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 22 */ +#define MCAN_TXBCIE_CFIE23 (0x1u << 23) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 23 */ +#define MCAN_TXBCIE_CFIE24 (0x1u << 24) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 24 */ +#define MCAN_TXBCIE_CFIE25 (0x1u << 25) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 25 */ +#define MCAN_TXBCIE_CFIE26 (0x1u << 26) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 26 */ +#define MCAN_TXBCIE_CFIE27 (0x1u << 27) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 27 */ +#define MCAN_TXBCIE_CFIE28 (0x1u << 28) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 28 */ +#define MCAN_TXBCIE_CFIE29 (0x1u << 29) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 29 */ +#define MCAN_TXBCIE_CFIE30 (0x1u << 30) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 30 */ +#define MCAN_TXBCIE_CFIE31 (0x1u << 31) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 31 */ +/* -------- MCAN_TXEFC : (MCAN Offset: 0xF0) Transmit Event FIFO Configuration Register -------- */ +#define MCAN_TXEFC_EFSA_Pos 2 +#define MCAN_TXEFC_EFSA_Msk (0x3fffu << MCAN_TXEFC_EFSA_Pos) /**< \brief (MCAN_TXEFC) Event FIFO Start Address */ +#define MCAN_TXEFC_EFSA(value) ((MCAN_TXEFC_EFSA_Msk & ((value) << MCAN_TXEFC_EFSA_Pos))) +#define MCAN_TXEFC_EFS_Pos 16 +#define MCAN_TXEFC_EFS_Msk (0x3fu << MCAN_TXEFC_EFS_Pos) /**< \brief (MCAN_TXEFC) Event FIFO Size */ +#define MCAN_TXEFC_EFS(value) ((MCAN_TXEFC_EFS_Msk & ((value) << MCAN_TXEFC_EFS_Pos))) +#define MCAN_TXEFC_EFWM_Pos 24 +#define MCAN_TXEFC_EFWM_Msk (0x3fu << MCAN_TXEFC_EFWM_Pos) /**< \brief (MCAN_TXEFC) Event FIFO Watermark */ +#define MCAN_TXEFC_EFWM(value) ((MCAN_TXEFC_EFWM_Msk & ((value) << MCAN_TXEFC_EFWM_Pos))) +/* -------- MCAN_TXEFS : (MCAN Offset: 0xF4) Transmit Event FIFO Status Register -------- */ +#define MCAN_TXEFS_EFFL_Pos 0 +#define MCAN_TXEFS_EFFL_Msk (0x3fu << MCAN_TXEFS_EFFL_Pos) /**< \brief (MCAN_TXEFS) Event FIFO Fill Level */ +#define MCAN_TXEFS_EFGI_Pos 8 +#define MCAN_TXEFS_EFGI_Msk (0x1fu << MCAN_TXEFS_EFGI_Pos) /**< \brief (MCAN_TXEFS) Event FIFO Get Index */ +#define MCAN_TXEFS_EFPI_Pos 16 +#define MCAN_TXEFS_EFPI_Msk (0x1fu << MCAN_TXEFS_EFPI_Pos) /**< \brief (MCAN_TXEFS) Event FIFO Put Index */ +#define MCAN_TXEFS_EFF (0x1u << 24) /**< \brief (MCAN_TXEFS) Event FIFO Full */ +#define MCAN_TXEFS_TEFL (0x1u << 25) /**< \brief (MCAN_TXEFS) Tx Event FIFO Element Lost */ +/* -------- MCAN_TXEFA : (MCAN Offset: 0xF8) Transmit Event FIFO Acknowledge Register -------- */ +#define MCAN_TXEFA_EFAI_Pos 0 +#define MCAN_TXEFA_EFAI_Msk (0x1fu << MCAN_TXEFA_EFAI_Pos) /**< \brief (MCAN_TXEFA) Event FIFO Acknowledge Index */ +#define MCAN_TXEFA_EFAI(value) ((MCAN_TXEFA_EFAI_Msk & ((value) << MCAN_TXEFA_EFAI_Pos))) +/* -------- MCAN Message RAM : Standard Message ID Rx Filter Element -------- */ +#define MCAN_RAM_FILT_STD_SIZE (1u) /**< \brief Size of the 11-bit Message ID Rx Filter Element, in words */ +#define MCAN_RAM_FILT_SFID2_Pos 0 +#define MCAN_RAM_FILT_SFID2_Msk (0x7ffu << MCAN_RAM_FILT_SFID2_Pos) /**< \brief (S0) Standard Filter ID 2 */ +#define MCAN_RAM_FILT_SFID2(value) ((MCAN_RAM_FILT_SFID2_Msk & ((value) << MCAN_RAM_FILT_SFID2_Pos))) +#define MCAN_RAM_FILT_SFID2_BUF_IDX_Pos 0 +#define MCAN_RAM_FILT_SFID2_BUF_IDX_Msk (0x3fu << MCAN_RAM_FILT_SFID2_BUF_IDX_Pos) /**< \brief (S0) Index of Rx Buffer for storage of a matching message. */ +#define MCAN_RAM_FILT_SFID2_BUF_IDX(value) ((MCAN_RAM_FILT_SFID2_BUF_IDX_Msk & ((value) << MCAN_RAM_FILT_SFID2_BUF_IDX_Pos))) +#define MCAN_RAM_FILT_SFID2_FE0 (0x1u << 6) /**< \brief (S0) Generate a pulse at m_can_fe0 filter event pin in case the filter matches. */ +#define MCAN_RAM_FILT_SFID2_FE1 (0x1u << 7) /**< \brief (S0) Generate a pulse at m_can_fe1 filter event pin in case the filter matches. */ +#define MCAN_RAM_FILT_SFID2_FE2 (0x1u << 8) /**< \brief (S0) Generate a pulse at m_can_fe2 filter event pin in case the filter matches. */ +#define MCAN_RAM_FILT_SFID2_BUF (0x0u << 9) /**< \brief (S0) Store message in a Rx buffer. */ +#define MCAN_RAM_FILT_SFID2_DBG_A (0x1u << 9) /**< \brief (S0) Debug Message A. */ +#define MCAN_RAM_FILT_SFID2_DBG_B (0x2u << 9) /**< \brief (S0) Debug Message B. */ +#define MCAN_RAM_FILT_SFID2_DBG_C (0x3u << 9) /**< \brief (S0) Debug Message C. */ +#define MCAN_RAM_FILT_SFID1_Pos 16 +#define MCAN_RAM_FILT_SFID1_Msk (0x7ffu << MCAN_RAM_FILT_SFID1_Pos) /**< \brief (S0) Standard Filter ID 1 */ +#define MCAN_RAM_FILT_SFID1(value) ((MCAN_RAM_FILT_SFID1_Msk & ((value) << MCAN_RAM_FILT_SFID1_Pos))) +#define MCAN_RAM_FILT_SFEC_Pos 27 +#define MCAN_RAM_FILT_SFEC_Msk (0x7u << MCAN_RAM_FILT_SFEC_Pos) /**< \brief (S0) Standard Filter Element Configuration */ +#define MCAN_RAM_FILT_SFEC(value) ((MCAN_RAM_FILT_SFEC_Msk & ((value) << MCAN_RAM_FILT_SFEC_Pos))) +#define MCAN_RAM_FILT_SFEC_DIS (0x0u << 27) /**< \brief (S0) Disable filter element. */ +#define MCAN_RAM_FILT_SFEC_FIFO0 (0x1u << 27) /**< \brief (S0) Store in Rx FIFO 0 if filter matches. */ +#define MCAN_RAM_FILT_SFEC_FIFO1 (0x2u << 27) /**< \brief (S0) Store in Rx FIFO 1 if filter matches. */ +#define MCAN_RAM_FILT_SFEC_INV (0x3u << 27) /**< \brief (S0) Reject ID if filter matches. */ +#define MCAN_RAM_FILT_SFEC_PTY (0x4u << 27) /**< \brief (S0) Set priority if filter matches. */ +#define MCAN_RAM_FILT_SFEC_PTY_FIFO0 (0x5u << 27) /**< \brief (S0) Set priority and store in FIFO 0 if filter matches. */ +#define MCAN_RAM_FILT_SFEC_PTY_FIFO1 (0x6u << 27) /**< \brief (S0) Set priority and store in FIFO 1 if filter matches. */ +#define MCAN_RAM_FILT_SFEC_BUF (0x7u << 27) /**< \brief (S0) Store into Rx Buffer or as debug message. */ +#define MCAN_RAM_FILT_SFT_Pos 30 +#define MCAN_RAM_FILT_SFT_Msk (0x3u << MCAN_RAM_FILT_SFT_Pos) /**< \brief (S0) Standard Filter Type */ +#define MCAN_RAM_FILT_SFT(value) ((MCAN_RAM_FILT_SFT_Msk & ((value) << MCAN_RAM_FILT_SFT_Pos))) +#define MCAN_RAM_FILT_SFT_RANGE (0x0u << 30) /**< \brief (S0) Range filter from SF1ID to SF2ID. */ +#define MCAN_RAM_FILT_SFT_DUAL_ID (0x1u << 30) /**< \brief (S0) Dual ID filter for SF1ID or SF2ID. */ +#define MCAN_RAM_FILT_SFT_CLASSIC (0x2u << 30) /**< \brief (S0) Classic filter: SF1ID = filter, SF2ID = mask. */ +/* -------- MCAN Message RAM : Extended Message ID Rx Filter Element : F0 Word -------- */ +#define MCAN_RAM_FILT_EXT_SIZE (2u) /**< \brief Size of the 29-bit Message ID Rx Filter Element, in words */ +#define MCAN_RAM_FILT_EFID1_Pos 0 +#define MCAN_RAM_FILT_EFID1_Msk (0x1fffffffu << MCAN_RAM_FILT_EFID1_Pos) /**< \brief (F0) Standard Filter ID 1 */ +#define MCAN_RAM_FILT_EFID1(value) ((MCAN_RAM_FILT_EFID1_Msk & ((value) << MCAN_RAM_FILT_EFID1_Pos))) +#define MCAN_RAM_FILT_EFEC_Pos 29 +#define MCAN_RAM_FILT_EFEC_Msk (0x7u << MCAN_RAM_FILT_EFEC_Pos) /**< \brief (F0) Extended Filter Element Configuration */ +#define MCAN_RAM_FILT_EFEC(value) ((MCAN_RAM_FILT_EFEC_Msk & ((value) << MCAN_RAM_FILT_EFEC_Pos))) +#define MCAN_RAM_FILT_EFEC_DIS (0x0u << 29) /**< \brief (F0) Disable filter element. */ +#define MCAN_RAM_FILT_EFEC_FIFO0 (0x1u << 29) /**< \brief (F0) Store in Rx FIFO 0 if filter matches. */ +#define MCAN_RAM_FILT_EFEC_FIFO1 (0x2u << 29) /**< \brief (F0) Store in Rx FIFO 1 if filter matches. */ +#define MCAN_RAM_FILT_EFEC_INV (0x3u << 29) /**< \brief (F0) Reject ID if filter matches. */ +#define MCAN_RAM_FILT_EFEC_PTY (0x4u << 29) /**< \brief (F0) Set priority if filter matches. */ +#define MCAN_RAM_FILT_EFEC_PTY_FIFO0 (0x5u << 29) /**< \brief (F0) Set priority and store in FIFO 0 if filter matches. */ +#define MCAN_RAM_FILT_EFEC_PTY_FIFO1 (0x6u << 29) /**< \brief (F0) Set priority and store in FIFO 1 if filter matches. */ +#define MCAN_RAM_FILT_EFEC_BUF (0x7u << 29) /**< \brief (F0) Store into Rx Buffer or as debug message. */ +/* -------- MCAN Message RAM : Extended Message ID Rx Filter Element : F1 Word -------- */ +#define MCAN_RAM_FILT_EFID2_Pos 0 +#define MCAN_RAM_FILT_EFID2_Msk (0x1fffffffu << MCAN_RAM_FILT_EFID2_Pos) /**< \brief (F1) Standard Filter ID 2 */ +#define MCAN_RAM_FILT_EFID2(value) ((MCAN_RAM_FILT_EFID2_Msk & ((value) << MCAN_RAM_FILT_EFID2_Pos))) +#define MCAN_RAM_FILT_EFID2_BUF_IDX_Pos 0 +#define MCAN_RAM_FILT_EFID2_BUF_IDX_Msk (0x3fu << MCAN_RAM_FILT_EFID2_BUF_IDX_Pos) /**< \brief (F1) Index of Rx Buffer for storage of a matching message. */ +#define MCAN_RAM_FILT_EFID2_BUF_IDX(value) ((MCAN_RAM_FILT_EFID2_BUF_IDX_Msk & ((value) << MCAN_RAM_FILT_EFID2_BUF_IDX_Pos))) +#define MCAN_RAM_FILT_EFID2_FE0 (0x1u << 6) /**< \brief (F1) Generate a pulse at m_can_fe0 filter event pin in case the filter matches. */ +#define MCAN_RAM_FILT_EFID2_FE1 (0x1u << 7) /**< \brief (F1) Generate a pulse at m_can_fe1 filter event pin in case the filter matches. */ +#define MCAN_RAM_FILT_EFID2_FE2 (0x1u << 8) /**< \brief (F1) Generate a pulse at m_can_fe2 filter event pin in case the filter matches. */ +#define MCAN_RAM_FILT_EFID2_BUF (0x0u << 9) /**< \brief (F1) Store message in a Rx buffer. */ +#define MCAN_RAM_FILT_EFID2_DBG_A (0x1u << 9) /**< \brief (F1) Debug Message A. */ +#define MCAN_RAM_FILT_EFID2_DBG_B (0x2u << 9) /**< \brief (F1) Debug Message B. */ +#define MCAN_RAM_FILT_EFID2_DBG_C (0x3u << 9) /**< \brief (F1) Debug Message C. */ +#define MCAN_RAM_FILT_EFT_Pos 30 +#define MCAN_RAM_FILT_EFT_Msk (0x3u << MCAN_RAM_FILT_EFT_Pos) /**< \brief (F1) Extended Filter Type */ +#define MCAN_RAM_FILT_EFT(value) ((MCAN_RAM_FILT_EFT_Msk & ((value) << MCAN_RAM_FILT_EFT_Pos))) +#define MCAN_RAM_FILT_EFT_RANGE_EIDM (0x0u << 30) /**< \brief (F1) Range filter from EF1ID to EF2ID (Extended ID Mask applied). */ +#define MCAN_RAM_FILT_EFT_DUAL_ID (0x1u << 30) /**< \brief (F1) Dual ID filter for EF1ID or EF2ID. */ +#define MCAN_RAM_FILT_EFT_CLASSIC (0x2u << 30) /**< \brief (F1) Classic filter: EF1ID = filter, EF2ID = mask. */ +#define MCAN_RAM_FILT_EFT_RANGE (0x3u << 30) /**< \brief (F1) Range filter from EF1ID to EF2ID, Extended ID Mask not applied. */ +/* -------- MCAN Message RAM : Tx/Rx Buffer Element : T0/R0 Heading Word -------- */ +#define MCAN_RAM_BUF_HDR_SIZE (2u) /**< \brief Size of the header in Rx and Tx Buffer Elements, in words */ +#define MCAN_RAM_BUF_ID_XTD_Pos 0 +#define MCAN_RAM_BUF_ID_XTD_Msk (0x1fffffffu << MCAN_RAM_BUF_ID_XTD_Pos) /**< \brief (T0, R0) Extended (29-bit) Message identifier */ +#define MCAN_RAM_BUF_ID_XTD(value) ((MCAN_RAM_BUF_ID_XTD_Msk & ((value) << MCAN_RAM_BUF_ID_XTD_Pos))) +#define MCAN_RAM_BUF_ID_STD_Pos 18 +#define MCAN_RAM_BUF_ID_STD_Msk (0x7ffu << MCAN_RAM_BUF_ID_STD_Pos) /**< \brief (T0, R0) Standard (11-bit) Message identifier */ +#define MCAN_RAM_BUF_ID_STD(value) ((MCAN_RAM_BUF_ID_STD_Msk & ((value) << MCAN_RAM_BUF_ID_STD_Pos))) +#define MCAN_RAM_BUF_RTR (0x1u << 29) /**< \brief (T0, R0) Remote Transmission Request */ +#define MCAN_RAM_BUF_XTD (0x1u << 30) /**< \brief (T0, R0) Flag that signals an extended Message identifier */ +#define MCAN_RAM_BUF_ESI (0x1u << 31) /**< \brief (T0, R0) Error State Indicator */ +/* -------- MCAN Message RAM : Tx/Rx Buffer Element : T1/R1 Heading Word -------- */ +#define MCAN_RAM_BUF_RXTS_Pos 0 +#define MCAN_RAM_BUF_RXTS_Msk (0xffffu << MCAN_RAM_BUF_RXTS_Pos) /**< \brief (R1) Rx Timestamp */ +#define MCAN_RAM_BUF_DLC_Pos 16 +#define MCAN_RAM_BUF_DLC_Msk (0xfu << MCAN_RAM_BUF_DLC_Pos) /**< \brief (T1, R1) Data Length Code */ +#define MCAN_RAM_BUF_DLC(value) ((MCAN_RAM_BUF_DLC_Msk & ((value) << MCAN_RAM_BUF_DLC_Pos))) +#define MCAN_RAM_BUF_BRS (0x1u << 20) /**< \brief (T1, R1) Flag that signals a frame transmitted with bit rate switching */ +#define MCAN_RAM_BUF_FDF (0x1u << 21) /**< \brief (T1, R1) Flag that signals a frame in CAN FD format */ +#define MCAN_RAM_BUF_EFC (0x1u << 23) /**< \brief (T1) Event FIFO Control */ +#define MCAN_RAM_BUF_FIDX_Pos 24 +#define MCAN_RAM_BUF_FIDX_Msk (0x7fu << MCAN_RAM_BUF_FIDX_Pos) /**< \brief (R1) Filter Index */ +#define MCAN_RAM_BUF_MM_Pos 24 +#define MCAN_RAM_BUF_MM_Msk (0xffu << MCAN_RAM_BUF_MM_Pos) /**< \brief (T1) Message Marker */ +#define MCAN_RAM_BUF_MM(value) ((MCAN_RAM_BUF_MM_Msk & ((value) << MCAN_RAM_BUF_MM_Pos))) +#define MCAN_RAM_BUF_ANMF (0x1u << 31) /**< \brief (R1) Flag that signals a received frame accepted without matching any Rx Filter Element */ +/* -------- MCAN Message RAM : Tx Event Element -------- */ +#define MCAN_RAM_TX_EVT_SIZE (2u) /**< \brief Size of the Tx Event Element, in words */ + +/*@}*/ + + +#endif /* _SAMA5D2_MCAN_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mpddrc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mpddrc.h new file mode 100644 index 000000000..09c304c65 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_mpddrc.h @@ -0,0 +1,855 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_MPDDRC_COMPONENT_ +#define _SAMA5D2_MPDDRC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR AHB Multi-port DDR-SDRAM Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_MPDDRC AHB Multi-port DDR-SDRAM Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Mpddrc hardware registers */ +typedef struct { + __IO uint32_t MPDDRC_MR; /**< \brief (Mpddrc Offset: 0x00) MPDDRC Mode Register */ + __IO uint32_t MPDDRC_RTR; /**< \brief (Mpddrc Offset: 0x04) MPDDRC Refresh Timer Register */ + __IO uint32_t MPDDRC_CR; /**< \brief (Mpddrc Offset: 0x08) MPDDRC Configuration Register */ + __IO uint32_t MPDDRC_TPR0; /**< \brief (Mpddrc Offset: 0x0C) MPDDRC Timing Parameter 0 Register */ + __IO uint32_t MPDDRC_TPR1; /**< \brief (Mpddrc Offset: 0x10) MPDDRC Timing Parameter 1 Register */ + __IO uint32_t MPDDRC_TPR2; /**< \brief (Mpddrc Offset: 0x14) MPDDRC Timing Parameter 2 Register */ + __I uint32_t Reserved1[1]; + __IO uint32_t MPDDRC_LPR; /**< \brief (Mpddrc Offset: 0x1C) MPDDRC Low-power Register */ + __IO uint32_t MPDDRC_MD; /**< \brief (Mpddrc Offset: 0x20) MPDDRC Memory Device Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t MPDDRC_LPDDR23_LPR; /**< \brief (Mpddrc Offset: 0x28) MPDDRC LPDDR2-LPDDR3 Low-power Register */ + __IO uint32_t MPDDRC_LPDDR23_CAL_MR4; /**< \brief (Mpddrc Offset: 0x2C) MPDDRC LPDDR2-LPDDR3 Calibration and MR4 Register */ + __IO uint32_t MPDDRC_LPDDR23_TIM_CAL; /**< \brief (Mpddrc Offset: 0x30) MPDDRC LPDDR2-LPDDR3 Timing Calibration Register */ + __IO uint32_t MPDDRC_IO_CALIBR; /**< \brief (Mpddrc Offset: 0x34) MPDDRC IO Calibration */ + __IO uint32_t MPDDRC_OCMS; /**< \brief (Mpddrc Offset: 0x38) MPDDRC OCMS Register */ + __O uint32_t MPDDRC_OCMS_KEY1; /**< \brief (Mpddrc Offset: 0x3C) MPDDRC OCMS KEY1 Register */ + __O uint32_t MPDDRC_OCMS_KEY2; /**< \brief (Mpddrc Offset: 0x40) MPDDRC OCMS KEY2 Register */ + __IO uint32_t MPDDRC_CONF_ARBITER; /**< \brief (Mpddrc Offset: 0x44) MPDDRC Configuration Arbiter Register */ + __IO uint32_t MPDDRC_TIMEOUT; /**< \brief (Mpddrc Offset: 0x48) MPDDRC Time-out Port 0/1/2/3 Register */ + __IO uint32_t MPDDRC_REQ_PORT_0123; /**< \brief (Mpddrc Offset: 0x4C) MPDDRC Request Port 0/1/2/3 Register */ + __IO uint32_t MPDDRC_REQ_PORT_4567; /**< \brief (Mpddrc Offset: 0x50) MPDDRC Request Port 4/5/6/7 Register */ + __I uint32_t MPDDRC_BDW_PORT_0123; /**< \brief (Mpddrc Offset: 0x54) MPDDRC Bandwidth Port 0/1/2/3 Register */ + __I uint32_t MPDDRC_BDW_PORT_4567; /**< \brief (Mpddrc Offset: 0x58) MPDDRC Bandwidth Port 4/5/6/7 Register */ + __IO uint32_t MPDDRC_RD_DATA_PATH; /**< \brief (Mpddrc Offset: 0x5C) MPDDRC Read Datapath Register */ + __IO uint32_t MPDDRC_MCFGR; /**< \brief (Mpddrc Offset: 0x60) MPDDRC Monitor Configuration */ + __IO uint32_t MPDDRC_MADDR0; /**< \brief (Mpddrc Offset: 0x64) MPDDRC Monitor Address High/Low port 0 */ + __IO uint32_t MPDDRC_MADDR1; /**< \brief (Mpddrc Offset: 0x68) MPDDRC Monitor Address High/Low port 1 */ + __IO uint32_t MPDDRC_MADDR2; /**< \brief (Mpddrc Offset: 0x6C) MPDDRC Monitor Address High/Low port 2 */ + __IO uint32_t MPDDRC_MADDR3; /**< \brief (Mpddrc Offset: 0x70) MPDDRC Monitor Address High/Low port 3 */ + __IO uint32_t MPDDRC_MADDR4; /**< \brief (Mpddrc Offset: 0x74) MPDDRC Monitor Address High/Low port 4 */ + __IO uint32_t MPDDRC_MADDR5; /**< \brief (Mpddrc Offset: 0x78) MPDDRC Monitor Address High/Low port 5 */ + __IO uint32_t MPDDRC_MADDR6; /**< \brief (Mpddrc Offset: 0x7C) MPDDRC Monitor Address High/Low port 6 */ + __IO uint32_t MPDDRC_MADDR7; /**< \brief (Mpddrc Offset: 0x80) MPDDRC Monitor Address High/Low port 7 */ + __I uint32_t MPDDRC_MINFO0; /**< \brief (Mpddrc Offset: 0x84) MPDDRC Monitor Information port 0 */ + __I uint32_t MPDDRC_MINFO1; /**< \brief (Mpddrc Offset: 0x88) MPDDRC Monitor Information port 1 */ + __I uint32_t MPDDRC_MINFO2; /**< \brief (Mpddrc Offset: 0x8C) MPDDRC Monitor Information port 2 */ + __I uint32_t MPDDRC_MINFO3; /**< \brief (Mpddrc Offset: 0x90) MPDDRC Monitor Information port 3 */ + __I uint32_t MPDDRC_MINFO4; /**< \brief (Mpddrc Offset: 0x94) MPDDRC Monitor Information port 4 */ + __I uint32_t MPDDRC_MINFO5; /**< \brief (Mpddrc Offset: 0x98) MPDDRC Monitor Information port 5 */ + __I uint32_t MPDDRC_MINFO6; /**< \brief (Mpddrc Offset: 0x9C) MPDDRC Monitor Information port 6 */ + __I uint32_t MPDDRC_MINFO7; /**< \brief (Mpddrc Offset: 0xA0) MPDDRC Monitor Information port 7 */ + __I uint32_t Reserved3[16]; + __IO uint32_t MPDDRC_WPMR; /**< \brief (Mpddrc Offset: 0xE4) MPDDRC Write Protection Mode Register */ + __I uint32_t MPDDRC_WPSR; /**< \brief (Mpddrc Offset: 0xE8) MPDDRC Write Protection Status Register */ + __I uint32_t Reserved4[4]; + __I uint32_t MPDDRC_VERSION; /**< \brief (Mpddrc Offset: 0xFC) MPDDRC Version Register */ + __IO uint32_t MPDDRC_DLL_OS; /**< \brief (Mpddrc Offset: 0x100) MPDDRC DLL Offset Selection Register */ + __IO uint32_t MPDDRC_DLL_MAO; /**< \brief (Mpddrc Offset: 0x104) MPDDRC DLL MASTER Offset Register */ + __IO uint32_t MPDDRC_DLL_SO0; /**< \brief (Mpddrc Offset: 0x108) MPDDRC DLL SLAVE Offset 0 Register */ + __IO uint32_t MPDDRC_DLL_SO1; /**< \brief (Mpddrc Offset: 0x10C) MPDDRC DLL SLAVE Offset 1 Register */ + __IO uint32_t MPDDRC_DLL_WRO; /**< \brief (Mpddrc Offset: 0x110) MPDDRC DLL CLKWR Offset Register */ + __IO uint32_t MPDDRC_DLL_ADO; /**< \brief (Mpddrc Offset: 0x114) MPDDRC DLL CLKAD Offset Register */ + __I uint32_t MPDDRC_DLL_SM[4]; /**< \brief (Mpddrc Offset: 0x118) MPDDRC DLL Status MASTER0 Register */ + __I uint32_t MPDDRC_DLL_SSL[8]; /**< \brief (Mpddrc Offset: 0x128) MPDDRC DLL Status SLAVE0 Register */ + __I uint32_t MPDDRC_DLL_SWR[4]; /**< \brief (Mpddrc Offset: 0x148) MPDDRC DLL Status CLKWR0 Register */ + __I uint32_t MPDDRC_DLL_SAD; /**< \brief (Mpddrc Offset: 0x158) MPDDRC DLL Status CLKAD Register */ +} Mpddrc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- MPDDRC_MR : (MPDDRC Offset: 0x00) MPDDRC Mode Register -------- */ +#define MPDDRC_MR_MODE_Pos 0 +#define MPDDRC_MR_MODE_Msk (0x7u << MPDDRC_MR_MODE_Pos) /**< \brief (MPDDRC_MR) MPDDRC Command Mode */ +#define MPDDRC_MR_MODE(value) ((MPDDRC_MR_MODE_Msk & ((value) << MPDDRC_MR_MODE_Pos))) +#define MPDDRC_MR_MODE_NORMAL_CMD (0x0u << 0) /**< \brief (MPDDRC_MR) Normal Mode. Any access to the MPDDRC is decoded normally. To activate this mode, the command must be followed by a write to the DDR-SDRAM. */ +#define MPDDRC_MR_MODE_NOP_CMD (0x1u << 0) /**< \brief (MPDDRC_MR) The MPDDRC issues a NOP command when the DDR-SDRAM device is accessed regardless of the cycle. To activate this mode, the command must be followed by a write to the DDR-SDRAM. */ +#define MPDDRC_MR_MODE_PRCGALL_CMD (0x2u << 0) /**< \brief (MPDDRC_MR) The MPDDRC issues the All Banks Precharge command when the DDR-SDRAM device is accessed regardless of the cycle. To activate this mode, the command must be followed by a write to the SDRAM. */ +#define MPDDRC_MR_MODE_LMR_CMD (0x3u << 0) /**< \brief (MPDDRC_MR) The MPDDRC issues a Load Mode Register command when the DDR-SDRAM device is accessed regardless of the cycle. To activate this mode, the command must be followed by a write to the DDR-SDRAM. */ +#define MPDDRC_MR_MODE_RFSH_CMD (0x4u << 0) /**< \brief (MPDDRC_MR) The MPDDRC issues an Auto-Refresh command when the DDR-SDRAM device is accessed regardless of the cycle. Previously, an All Banks Precharge command must be issued. To activate this mode, the command must be followed by a write to the DDR-SDRAM. */ +#define MPDDRC_MR_MODE_EXT_LMR_CMD (0x5u << 0) /**< \brief (MPDDRC_MR) The MPDDRC issues an Extended Load Mode Register command when the SDRAM device is accessed regardless of the cycle. To activate this mode, the command must be followed by a write to the DDR-SDRAM. The write in the DDR-SDRAM must be done in the appropriate bank. */ +#define MPDDRC_MR_MODE_DEEP_CALIB_MD (0x6u << 0) /**< \brief (MPDDRC_MR) Deep Power mode: Access to Deep Power-down modeCalibration command: to calibrate RTT and RON values for the Process Voltage Temperature (PVT) (DDR3-SDRAM device) */ +#define MPDDRC_MR_MODE_LPDDR2_LPDDR3_CMD (0x7u << 0) /**< \brief (MPDDRC_MR) The MPDDRC issues an LPDDR2/LPDDR3 Mode Register command when the device is accessed regardless of the cycle. To activate this mode, the Mode Register command must be followed by a write to the low-power DDR2-SDRAM or to the low-power DDR3-SDRAM. */ +#define MPDDRC_MR_DAI (0x1u << 4) /**< \brief (MPDDRC_MR) Device Auto-Initialization Status */ +#define MPDDRC_MR_DAI_DAI_COMPLETE (0x0u << 4) /**< \brief (MPDDRC_MR) DAI complete */ +#define MPDDRC_MR_DAI_DAI_IN_PROGESSS (0x1u << 4) /**< \brief (MPDDRC_MR) DAI still in progress */ +#define MPDDRC_MR_MRS_Pos 8 +#define MPDDRC_MR_MRS_Msk (0xffu << MPDDRC_MR_MRS_Pos) /**< \brief (MPDDRC_MR) Mode Register Select LPDDR2/LPDDR3 */ +#define MPDDRC_MR_MRS(value) ((MPDDRC_MR_MRS_Msk & ((value) << MPDDRC_MR_MRS_Pos))) +/* -------- MPDDRC_RTR : (MPDDRC Offset: 0x04) MPDDRC Refresh Timer Register -------- */ +#define MPDDRC_RTR_COUNT_Pos 0 +#define MPDDRC_RTR_COUNT_Msk (0xfffu << MPDDRC_RTR_COUNT_Pos) /**< \brief (MPDDRC_RTR) MPDDRC Refresh Timer Count */ +#define MPDDRC_RTR_COUNT(value) ((MPDDRC_RTR_COUNT_Msk & ((value) << MPDDRC_RTR_COUNT_Pos))) +#define MPDDRC_RTR_ADJ_REF (0x1u << 16) /**< \brief (MPDDRC_RTR) Adjust Refresh Rate */ +#define MPDDRC_RTR_REF_PB (0x1u << 17) /**< \brief (MPDDRC_RTR) Refresh Per Bank */ +#define MPDDRC_RTR_MR4_VALUE_Pos 20 +#define MPDDRC_RTR_MR4_VALUE_Msk (0x7u << MPDDRC_RTR_MR4_VALUE_Pos) /**< \brief (MPDDRC_RTR) Content of MR4 Register */ +#define MPDDRC_RTR_MR4_VALUE(value) ((MPDDRC_RTR_MR4_VALUE_Msk & ((value) << MPDDRC_RTR_MR4_VALUE_Pos))) +/* -------- MPDDRC_CR : (MPDDRC Offset: 0x08) MPDDRC Configuration Register -------- */ +#define MPDDRC_CR_NC_Pos 0 +#define MPDDRC_CR_NC_Msk (0x3u << MPDDRC_CR_NC_Pos) /**< \brief (MPDDRC_CR) Number of Column Bits */ +#define MPDDRC_CR_NC(value) ((MPDDRC_CR_NC_Msk & ((value) << MPDDRC_CR_NC_Pos))) +#define MPDDRC_CR_NC_DDR9_MDDR8_COL_BITS (0x0u << 0) /**< \brief (MPDDRC_CR) 9 bits for DDR, 8-bit for low-power DDR1-SDRAM */ +#define MPDDRC_CR_NC_10_COL_BITS (0x1u << 0) /**< \brief (MPDDRC_CR) 10 bits for DDR, 9-bit for low-power DDR1-SDRAM */ +#define MPDDRC_CR_NC_DDR11_MDDR10_COL_BITS (0x2u << 0) /**< \brief (MPDDRC_CR) 11 bits for DDR, 10-bit for low-power DDR1-SDRAM */ +#define MPDDRC_CR_NC_DDR12_MDDR11_COL_BITS (0x3u << 0) /**< \brief (MPDDRC_CR) 12 bits for DDR, 11-bit for low-power DDR1-SDRAM */ +#define MPDDRC_CR_NR_Pos 2 +#define MPDDRC_CR_NR_Msk (0x3u << MPDDRC_CR_NR_Pos) /**< \brief (MPDDRC_CR) Number of Row Bits */ +#define MPDDRC_CR_NR(value) ((MPDDRC_CR_NR_Msk & ((value) << MPDDRC_CR_NR_Pos))) +#define MPDDRC_CR_NR_11_ROW_BITS (0x0u << 2) /**< \brief (MPDDRC_CR) 11 bits to define the row number, up to 2048 rows */ +#define MPDDRC_CR_NR_12_ROW_BITS (0x1u << 2) /**< \brief (MPDDRC_CR) 12 bits to define the row number, up to 4096 rows */ +#define MPDDRC_CR_NR_13_ROW_BITS (0x2u << 2) /**< \brief (MPDDRC_CR) 13 bits to define the row number, up to 8192 rows */ +#define MPDDRC_CR_NR_14_ROW_BITS (0x3u << 2) /**< \brief (MPDDRC_CR) 14 bits to define the row number, up to 16384 rows */ +#define MPDDRC_CR_CAS_Pos 4 +#define MPDDRC_CR_CAS_Msk (0x7u << MPDDRC_CR_CAS_Pos) /**< \brief (MPDDRC_CR) CAS Latency */ +#define MPDDRC_CR_CAS(value) ((MPDDRC_CR_CAS_Msk & ((value) << MPDDRC_CR_CAS_Pos))) +#define MPDDRC_CR_CAS_DDR_CAS2 (0x2u << 4) /**< \brief (MPDDRC_CR) LPDDR1 CAS Latency 2 */ +#define MPDDRC_CR_CAS_DDR_CAS3 (0x3u << 4) /**< \brief (MPDDRC_CR) LPDDR3/DDR2/LPDDR2/LPDDR1 CAS Latency 3 */ +#define MPDDRC_CR_CAS_DDR_CAS5 (0x5u << 4) /**< \brief (MPDDRC_CR) DDR3 CAS Latency 5 */ +#define MPDDRC_CR_CAS_DDR_CAS6 (0x6u << 4) /**< \brief (MPDDRC_CR) DDR3LPDDR3 CAS Latency 6 */ +#define MPDDRC_CR_DLL (0x1u << 7) /**< \brief (MPDDRC_CR) Reset DLL */ +#define MPDDRC_CR_DLL_RESET_DISABLED (0x0u << 7) /**< \brief (MPDDRC_CR) Disable DLL reset */ +#define MPDDRC_CR_DLL_RESET_ENABLED (0x1u << 7) /**< \brief (MPDDRC_CR) Enable DLL reset */ +#define MPDDRC_CR_DIC_DS (0x1u << 8) /**< \brief (MPDDRC_CR) Output Driver Impedance Control (Drive Strength) */ +#define MPDDRC_CR_DIC_DS_DDR2_NORMALSTRENGTH_DDR3_RZQ6 (0x0u << 8) /**< \brief (MPDDRC_CR) Normal driver strength (DDR2) - RZQ/6 (40 [NOM], DDR3) */ +#define MPDDRC_CR_DIC_DS_DDR2_WEAKSTRENGTH_DDR3_RZQ7 (0x1u << 8) /**< \brief (MPDDRC_CR) Weak driver strength (DDR2) - RZQ/7 (34 [NOM], DDR3) */ +#define MPDDRC_CR_DIS_DLL (0x1u << 9) /**< \brief (MPDDRC_CR) DISABLE DLL */ +#define MPDDRC_CR_ZQ_Pos 10 +#define MPDDRC_CR_ZQ_Msk (0x3u << MPDDRC_CR_ZQ_Pos) /**< \brief (MPDDRC_CR) ZQ Calibration */ +#define MPDDRC_CR_ZQ(value) ((MPDDRC_CR_ZQ_Msk & ((value) << MPDDRC_CR_ZQ_Pos))) +#define MPDDRC_CR_ZQ_INIT (0x0u << 10) /**< \brief (MPDDRC_CR) Calibration command after initialization */ +#define MPDDRC_CR_ZQ_LONG (0x1u << 10) /**< \brief (MPDDRC_CR) Long calibration */ +#define MPDDRC_CR_ZQ_SHORT (0x2u << 10) /**< \brief (MPDDRC_CR) Short calibration */ +#define MPDDRC_CR_ZQ_RESET (0x3u << 10) /**< \brief (MPDDRC_CR) ZQ Reset */ +#define MPDDRC_CR_OCD_Pos 12 +#define MPDDRC_CR_OCD_Msk (0x7u << MPDDRC_CR_OCD_Pos) /**< \brief (MPDDRC_CR) Off-chip Driver */ +#define MPDDRC_CR_OCD(value) ((MPDDRC_CR_OCD_Msk & ((value) << MPDDRC_CR_OCD_Pos))) +#define MPDDRC_CR_OCD_DDR2_EXITCALIB (0x0u << 12) /**< \brief (MPDDRC_CR) Exit from OCD Calibration mode and maintain settings */ +#define MPDDRC_CR_OCD_DDR2_DEFAULT_CALIB (0x7u << 12) /**< \brief (MPDDRC_CR) OCD calibration default */ +#define MPDDRC_CR_DQMS (0x1u << 16) /**< \brief (MPDDRC_CR) Mask Data is Shared */ +#define MPDDRC_CR_DQMS_NOT_SHARED (0x0u << 16) /**< \brief (MPDDRC_CR) DQM is not shared with another controller */ +#define MPDDRC_CR_DQMS_SHARED (0x1u << 16) /**< \brief (MPDDRC_CR) DQM is shared with another controller */ +#define MPDDRC_CR_ENRDM (0x1u << 17) /**< \brief (MPDDRC_CR) Enable Read Measure */ +#define MPDDRC_CR_ENRDM_OFF (0x0u << 17) /**< \brief (MPDDRC_CR) DQS/DDR_DATA phase error correction is disabled */ +#define MPDDRC_CR_ENRDM_ON (0x1u << 17) /**< \brief (MPDDRC_CR) DQS/DDR_DATA phase error correction is enabled */ +#define MPDDRC_CR_LC_LPDDR1 (0x1u << 19) /**< \brief (MPDDRC_CR) Low-cost Low-power DDR1 */ +#define MPDDRC_CR_LC_LPDDR1_NOT_2_BANKS (0x0u << 19) /**< \brief (MPDDRC_CR) Any type of memory devices except of low cost, low density Low Power DDR1. */ +#define MPDDRC_CR_LC_LPDDR1_2_BANKS_LPDDR1 (0x1u << 19) /**< \brief (MPDDRC_CR) Low-cost and low-density low-power DDR1. These devices have a density of 32 Mbits and are organized as two internal banks. To use this feature, the user has to define the type of memory and the data bus width (see Section 8.8 "MPDDRC Memory Device Register").The 16-bit memory device is organized as 2 banks, 9 columns and 11 rows.The 32-bit memory device is organized as 2 banks, 8 columns and 11 rows.It is impossible to use two 16-bit memory devices (2 x 32 Mbits) for creating one 32-bit memory device (64 Mbits). In this case, it is recommended to use one 32-bit memory device which embeds four internal banks. */ +#define MPDDRC_CR_NB (0x1u << 20) /**< \brief (MPDDRC_CR) Number of Banks */ +#define MPDDRC_CR_NB_4_BANKS (0x0u << 20) /**< \brief (MPDDRC_CR) 4-bank memory devices */ +#define MPDDRC_CR_NB_8_BANKS (0x1u << 20) /**< \brief (MPDDRC_CR) 8 banks. Only possible when using the DDR2-SDRAM and low-power DDR2-SDRAM and DDR3-SDRAM and low-power DDR3-SDRAM devices. */ +#define MPDDRC_CR_NDQS (0x1u << 21) /**< \brief (MPDDRC_CR) Not DQS */ +#define MPDDRC_CR_NDQS_ENABLED (0x0u << 21) /**< \brief (MPDDRC_CR) Not DQS is enabled */ +#define MPDDRC_CR_NDQS_DISABLED (0x1u << 21) /**< \brief (MPDDRC_CR) Not DQS is disabled */ +#define MPDDRC_CR_DECOD (0x1u << 22) /**< \brief (MPDDRC_CR) Type of Decoding */ +#define MPDDRC_CR_DECOD_SEQUENTIAL (0x0u << 22) /**< \brief (MPDDRC_CR) Method for address mapping where banks alternate at each last DDR-SDRAM page of the current bank. */ +#define MPDDRC_CR_DECOD_INTERLEAVED (0x1u << 22) /**< \brief (MPDDRC_CR) Method for address mapping where banks alternate at each SDRAM end page of the current bank. */ +#define MPDDRC_CR_UNAL (0x1u << 23) /**< \brief (MPDDRC_CR) Support Unaligned Access */ +#define MPDDRC_CR_UNAL_UNSUPPORTED (0x0u << 23) /**< \brief (MPDDRC_CR) Unaligned access is not supported. */ +#define MPDDRC_CR_UNAL_SUPPORTED (0x1u << 23) /**< \brief (MPDDRC_CR) Unaligned access is supported. */ +/* -------- MPDDRC_TPR0 : (MPDDRC Offset: 0x0C) MPDDRC Timing Parameter 0 Register -------- */ +#define MPDDRC_TPR0_TRAS_Pos 0 +#define MPDDRC_TPR0_TRAS_Msk (0xfu << MPDDRC_TPR0_TRAS_Pos) /**< \brief (MPDDRC_TPR0) Active to Precharge Delay */ +#define MPDDRC_TPR0_TRAS(value) ((MPDDRC_TPR0_TRAS_Msk & ((value) << MPDDRC_TPR0_TRAS_Pos))) +#define MPDDRC_TPR0_TRCD_Pos 4 +#define MPDDRC_TPR0_TRCD_Msk (0xfu << MPDDRC_TPR0_TRCD_Pos) /**< \brief (MPDDRC_TPR0) Row to Column Delay */ +#define MPDDRC_TPR0_TRCD(value) ((MPDDRC_TPR0_TRCD_Msk & ((value) << MPDDRC_TPR0_TRCD_Pos))) +#define MPDDRC_TPR0_TWR_Pos 8 +#define MPDDRC_TPR0_TWR_Msk (0xfu << MPDDRC_TPR0_TWR_Pos) /**< \brief (MPDDRC_TPR0) Write Recovery Delay */ +#define MPDDRC_TPR0_TWR(value) ((MPDDRC_TPR0_TWR_Msk & ((value) << MPDDRC_TPR0_TWR_Pos))) +#define MPDDRC_TPR0_TRC_Pos 12 +#define MPDDRC_TPR0_TRC_Msk (0xfu << MPDDRC_TPR0_TRC_Pos) /**< \brief (MPDDRC_TPR0) Row Cycle Delay */ +#define MPDDRC_TPR0_TRC(value) ((MPDDRC_TPR0_TRC_Msk & ((value) << MPDDRC_TPR0_TRC_Pos))) +#define MPDDRC_TPR0_TRP_Pos 16 +#define MPDDRC_TPR0_TRP_Msk (0xfu << MPDDRC_TPR0_TRP_Pos) /**< \brief (MPDDRC_TPR0) Row Precharge Delay */ +#define MPDDRC_TPR0_TRP(value) ((MPDDRC_TPR0_TRP_Msk & ((value) << MPDDRC_TPR0_TRP_Pos))) +#define MPDDRC_TPR0_TRRD_Pos 20 +#define MPDDRC_TPR0_TRRD_Msk (0xfu << MPDDRC_TPR0_TRRD_Pos) /**< \brief (MPDDRC_TPR0) Active BankA to Active BankB */ +#define MPDDRC_TPR0_TRRD(value) ((MPDDRC_TPR0_TRRD_Msk & ((value) << MPDDRC_TPR0_TRRD_Pos))) +#define MPDDRC_TPR0_TWTR_Pos 24 +#define MPDDRC_TPR0_TWTR_Msk (0xfu << MPDDRC_TPR0_TWTR_Pos) /**< \brief (MPDDRC_TPR0) Internal Write to Read Delay */ +#define MPDDRC_TPR0_TWTR(value) ((MPDDRC_TPR0_TWTR_Msk & ((value) << MPDDRC_TPR0_TWTR_Pos))) +#define MPDDRC_TPR0_TMRD_Pos 28 +#define MPDDRC_TPR0_TMRD_Msk (0xfu << MPDDRC_TPR0_TMRD_Pos) /**< \brief (MPDDRC_TPR0) Load Mode Register Command to Activate or Refresh Command */ +#define MPDDRC_TPR0_TMRD(value) ((MPDDRC_TPR0_TMRD_Msk & ((value) << MPDDRC_TPR0_TMRD_Pos))) +/* -------- MPDDRC_TPR1 : (MPDDRC Offset: 0x10) MPDDRC Timing Parameter 1 Register -------- */ +#define MPDDRC_TPR1_TRFC_Pos 0 +#define MPDDRC_TPR1_TRFC_Msk (0x7fu << MPDDRC_TPR1_TRFC_Pos) /**< \brief (MPDDRC_TPR1) Row Cycle Delay */ +#define MPDDRC_TPR1_TRFC(value) ((MPDDRC_TPR1_TRFC_Msk & ((value) << MPDDRC_TPR1_TRFC_Pos))) +#define MPDDRC_TPR1_TXSNR_Pos 8 +#define MPDDRC_TPR1_TXSNR_Msk (0xffu << MPDDRC_TPR1_TXSNR_Pos) /**< \brief (MPDDRC_TPR1) Exit Self-refresh Delay to Non-Read Command */ +#define MPDDRC_TPR1_TXSNR(value) ((MPDDRC_TPR1_TXSNR_Msk & ((value) << MPDDRC_TPR1_TXSNR_Pos))) +#define MPDDRC_TPR1_TXSRD_Pos 16 +#define MPDDRC_TPR1_TXSRD_Msk (0xffu << MPDDRC_TPR1_TXSRD_Pos) /**< \brief (MPDDRC_TPR1) Exit Self-refresh Delay to Read Command */ +#define MPDDRC_TPR1_TXSRD(value) ((MPDDRC_TPR1_TXSRD_Msk & ((value) << MPDDRC_TPR1_TXSRD_Pos))) +#define MPDDRC_TPR1_TXP_Pos 24 +#define MPDDRC_TPR1_TXP_Msk (0xfu << MPDDRC_TPR1_TXP_Pos) /**< \brief (MPDDRC_TPR1) Exit Power-down Delay to First Command */ +#define MPDDRC_TPR1_TXP(value) ((MPDDRC_TPR1_TXP_Msk & ((value) << MPDDRC_TPR1_TXP_Pos))) +/* -------- MPDDRC_TPR2 : (MPDDRC Offset: 0x14) MPDDRC Timing Parameter 2 Register -------- */ +#define MPDDRC_TPR2_TXARD_Pos 0 +#define MPDDRC_TPR2_TXARD_Msk (0xfu << MPDDRC_TPR2_TXARD_Pos) /**< \brief (MPDDRC_TPR2) Exit Active Power Down Delay to Read Command in Mode "Fast Exit" */ +#define MPDDRC_TPR2_TXARD(value) ((MPDDRC_TPR2_TXARD_Msk & ((value) << MPDDRC_TPR2_TXARD_Pos))) +#define MPDDRC_TPR2_TXARDS_Pos 4 +#define MPDDRC_TPR2_TXARDS_Msk (0xfu << MPDDRC_TPR2_TXARDS_Pos) /**< \brief (MPDDRC_TPR2) Exit Active Power Down Delay to Read Command in Mode "Slow Exit" */ +#define MPDDRC_TPR2_TXARDS(value) ((MPDDRC_TPR2_TXARDS_Msk & ((value) << MPDDRC_TPR2_TXARDS_Pos))) +#define MPDDRC_TPR2_TRPA_Pos 8 +#define MPDDRC_TPR2_TRPA_Msk (0xfu << MPDDRC_TPR2_TRPA_Pos) /**< \brief (MPDDRC_TPR2) Row Precharge All Delay */ +#define MPDDRC_TPR2_TRPA(value) ((MPDDRC_TPR2_TRPA_Msk & ((value) << MPDDRC_TPR2_TRPA_Pos))) +#define MPDDRC_TPR2_TRTP_Pos 12 +#define MPDDRC_TPR2_TRTP_Msk (0x7u << MPDDRC_TPR2_TRTP_Pos) /**< \brief (MPDDRC_TPR2) Read to Precharge */ +#define MPDDRC_TPR2_TRTP(value) ((MPDDRC_TPR2_TRTP_Msk & ((value) << MPDDRC_TPR2_TRTP_Pos))) +#define MPDDRC_TPR2_TFAW_Pos 16 +#define MPDDRC_TPR2_TFAW_Msk (0xfu << MPDDRC_TPR2_TFAW_Pos) /**< \brief (MPDDRC_TPR2) Four Active Windows */ +#define MPDDRC_TPR2_TFAW(value) ((MPDDRC_TPR2_TFAW_Msk & ((value) << MPDDRC_TPR2_TFAW_Pos))) +/* -------- MPDDRC_LPR : (MPDDRC Offset: 0x1C) MPDDRC Low-power Register -------- */ +#define MPDDRC_LPR_LPCB_Pos 0 +#define MPDDRC_LPR_LPCB_Msk (0x3u << MPDDRC_LPR_LPCB_Pos) /**< \brief (MPDDRC_LPR) Low-power Command Bit */ +#define MPDDRC_LPR_LPCB(value) ((MPDDRC_LPR_LPCB_Msk & ((value) << MPDDRC_LPR_LPCB_Pos))) +#define MPDDRC_LPR_LPCB_NOLOWPOWER (0x0u << 0) /**< \brief (MPDDRC_LPR) Low-power feature is inhibited. No Power-down, Self-refresh and Deep-power modes are issued to the DDR-SDRAM device. */ +#define MPDDRC_LPR_LPCB_SELFREFRESH (0x1u << 0) /**< \brief (MPDDRC_LPR) The MPDDRC issues a self-refresh command to the DDR-SDRAM device, the clock(s) is/are deactivated and the CKE signal is set low. The DDR-SDRAM device leaves the Self-refresh mode when accessed and reenters it after the access. */ +#define MPDDRC_LPR_LPCB_POWERDOWN (0x2u << 0) /**< \brief (MPDDRC_LPR) The MPDDRC issues a Power-down command to the DDR-SDRAM device after each access, the CKE signal is set low. The DDR-SDRAM device leaves the Power-down mode when accessed and reenters it after the access. */ +#define MPDDRC_LPR_LPCB_DEEPPOWERDOWN (0x3u << 0) /**< \brief (MPDDRC_LPR) The MPDDRC issues a Deep Power-down command to the low-power DDR-SDRAM device. */ +#define MPDDRC_LPR_CLK_FR (0x1u << 2) /**< \brief (MPDDRC_LPR) Clock Frozen Command Bit */ +#define MPDDRC_LPR_CLK_FR_DISABLED (0x0u << 2) /**< \brief (MPDDRC_LPR) Clock(s) is/are not frozen. */ +#define MPDDRC_LPR_CLK_FR_ENABLED (0x1u << 2) /**< \brief (MPDDRC_LPR) Clock(s) is/are frozen. */ +#define MPDDRC_LPR_LPDDR2_LPDDR3_PWOFF (0x1u << 3) /**< \brief (MPDDRC_LPR) LPDDR2 - LPDDR3 Power Off Bit */ +#define MPDDRC_LPR_LPDDR2_LPDDR3_PWOFF_DISABLED (0x0u << 3) /**< \brief (MPDDRC_LPR) No power-off sequence applied to LPDDR2/LPDDR3. */ +#define MPDDRC_LPR_LPDDR2_LPDDR3_PWOFF_ENABLED (0x1u << 3) /**< \brief (MPDDRC_LPR) A power-off sequence is applied to the LPDDR2/LPDDR3 device. CKE is forced low. */ +#define MPDDRC_LPR_PASR_Pos 4 +#define MPDDRC_LPR_PASR_Msk (0x7u << MPDDRC_LPR_PASR_Pos) /**< \brief (MPDDRC_LPR) Partial Array Self-refresh */ +#define MPDDRC_LPR_PASR(value) ((MPDDRC_LPR_PASR_Msk & ((value) << MPDDRC_LPR_PASR_Pos))) +#define MPDDRC_LPR_DS_Pos 8 +#define MPDDRC_LPR_DS_Msk (0x7u << MPDDRC_LPR_DS_Pos) /**< \brief (MPDDRC_LPR) Drive Strength */ +#define MPDDRC_LPR_DS(value) ((MPDDRC_LPR_DS_Msk & ((value) << MPDDRC_LPR_DS_Pos))) +#define MPDDRC_LPR_TIMEOUT_Pos 12 +#define MPDDRC_LPR_TIMEOUT_Msk (0x3u << MPDDRC_LPR_TIMEOUT_Pos) /**< \brief (MPDDRC_LPR) Time Between Last Transfer and Low-Power Mode */ +#define MPDDRC_LPR_TIMEOUT(value) ((MPDDRC_LPR_TIMEOUT_Msk & ((value) << MPDDRC_LPR_TIMEOUT_Pos))) +#define MPDDRC_LPR_TIMEOUT_NONE (0x0u << 12) /**< \brief (MPDDRC_LPR) SDRAM Low-power mode is activated immediately after the end of the last transfer. */ +#define MPDDRC_LPR_TIMEOUT_DELAY_64_CLK (0x1u << 12) /**< \brief (MPDDRC_LPR) SDRAM Low-power mode is activated 64 clock cycles after the end of the last transfer. */ +#define MPDDRC_LPR_TIMEOUT_DELAY_128_CLK (0x2u << 12) /**< \brief (MPDDRC_LPR) SDRAM Low-power mode is activated 128 clock cycles after the end of the last transfer. */ +#define MPDDRC_LPR_APDE (0x1u << 16) /**< \brief (MPDDRC_LPR) Active Power Down Exit Time */ +#define MPDDRC_LPR_APDE_DDR2_FAST_EXIT (0x0u << 16) /**< \brief (MPDDRC_LPR) Fast Exit from Power Down. DDR2-SDRAM and DDR3-SDRAM devices only. */ +#define MPDDRC_LPR_APDE_DDR2_SLOW_EXIT (0x1u << 16) /**< \brief (MPDDRC_LPR) Slow Exit from Power Down. DDR2-SDRAM and DDR3-SDRAM devices only. */ +#define MPDDRC_LPR_UPD_MR_Pos 20 +#define MPDDRC_LPR_UPD_MR_Msk (0x3u << MPDDRC_LPR_UPD_MR_Pos) /**< \brief (MPDDRC_LPR) Update Load Mode Register and Extended Mode Register */ +#define MPDDRC_LPR_UPD_MR(value) ((MPDDRC_LPR_UPD_MR_Msk & ((value) << MPDDRC_LPR_UPD_MR_Pos))) +#define MPDDRC_LPR_UPD_MR_NO_UPDATE (0x0u << 20) /**< \brief (MPDDRC_LPR) Update of Load Mode and Extended Mode registers is disabled. */ +#define MPDDRC_LPR_UPD_MR_UPDATE_SHAREDBUS (0x1u << 20) /**< \brief (MPDDRC_LPR) MPDDRC shares an external bus. Automatic update is done during a refresh command and a pending read or write access in the SDRAM device. */ +#define MPDDRC_LPR_UPD_MR_UPDATE_NOSHAREDBUS (0x2u << 20) /**< \brief (MPDDRC_LPR) MPDDRC does not share an external bus. Automatic update is done before entering Self-refresh mode. */ +#define MPDDRC_LPR_CHG_FRQ (0x1u << 24) /**< \brief (MPDDRC_LPR) Change Clock Frequency During Self-refresh Mode */ +#define MPDDRC_LPR_SELF_DONE (0x1u << 25) /**< \brief (MPDDRC_LPR) Self-refresh is done */ +/* -------- MPDDRC_MD : (MPDDRC Offset: 0x20) MPDDRC Memory Device Register -------- */ +#define MPDDRC_MD_MD_Pos 0 +#define MPDDRC_MD_MD_Msk (0x7u << MPDDRC_MD_MD_Pos) /**< \brief (MPDDRC_MD) Memory Device */ +#define MPDDRC_MD_MD(value) ((MPDDRC_MD_MD_Msk & ((value) << MPDDRC_MD_MD_Pos))) +#define MPDDRC_MD_MD_LPDDR_SDRAM (0x3u << 0) /**< \brief (MPDDRC_MD) Low-power DDR1-SDRAM */ +#define MPDDRC_MD_MD_DDR3_SDRAM (0x4u << 0) /**< \brief (MPDDRC_MD) DDR3-SDRAM */ +#define MPDDRC_MD_MD_LPDDR3_SDRAM (0x5u << 0) /**< \brief (MPDDRC_MD) Low-power DDR3-SDRAM */ +#define MPDDRC_MD_MD_DDR2_SDRAM (0x6u << 0) /**< \brief (MPDDRC_MD) DDR2-SDRAM */ +#define MPDDRC_MD_MD_LPDDR2_SDRAM (0x7u << 0) /**< \brief (MPDDRC_MD) Low-power DDR2-SDRAM */ +#define MPDDRC_MD_DBW (0x1u << 4) /**< \brief (MPDDRC_MD) Data Bus Width */ +#define MPDDRC_MD_DBW_DBW_32_BITS (0x0u << 4) /**< \brief (MPDDRC_MD) Data bus width is 32 bits */ +#define MPDDRC_MD_DBW_DBW_16_BITS (0x1u << 4) /**< \brief (MPDDRC_MD) Data bus width is 16 bits. */ +#define MPDDRC_MD_WL (0x1u << 5) /**< \brief (MPDDRC_MD) Write Latency */ +#define MPDDRC_MD_WL_WL_SETA (0x0u << 5) /**< \brief (MPDDRC_MD) Write Latency Set A */ +#define MPDDRC_MD_WL_WL_SETB (0x1u << 5) /**< \brief (MPDDRC_MD) Write Latency Set B */ +#define MPDDRC_MD_RL3 (0x1u << 6) /**< \brief (MPDDRC_MD) Read Latency 3 Option Support */ +#define MPDDRC_MD_RL3_RL3_SUPPORT (0x0u << 6) /**< \brief (MPDDRC_MD) Read latency of 3 is supported */ +#define MPDDRC_MD_RL3_RL3_NOT_SUPPORTED (0x1u << 6) /**< \brief (MPDDRC_MD) Read latency 0f 3 is not supported */ +#define MPDDRC_MD_MANU_ID_Pos 8 +#define MPDDRC_MD_MANU_ID_Msk (0xffu << MPDDRC_MD_MANU_ID_Pos) /**< \brief (MPDDRC_MD) Manufacturer Identification */ +#define MPDDRC_MD_MANU_ID(value) ((MPDDRC_MD_MANU_ID_Msk & ((value) << MPDDRC_MD_MANU_ID_Pos))) +#define MPDDRC_MD_REV_ID_Pos 16 +#define MPDDRC_MD_REV_ID_Msk (0xffu << MPDDRC_MD_REV_ID_Pos) /**< \brief (MPDDRC_MD) Revision Identification */ +#define MPDDRC_MD_REV_ID(value) ((MPDDRC_MD_REV_ID_Msk & ((value) << MPDDRC_MD_REV_ID_Pos))) +#define MPDDRC_MD_TYPE_Pos 24 +#define MPDDRC_MD_TYPE_Msk (0x3u << MPDDRC_MD_TYPE_Pos) /**< \brief (MPDDRC_MD) DRAM Architecture */ +#define MPDDRC_MD_TYPE(value) ((MPDDRC_MD_TYPE_Msk & ((value) << MPDDRC_MD_TYPE_Pos))) +#define MPDDRC_MD_TYPE_S4_SDRAM (0x0u << 24) /**< \brief (MPDDRC_MD) 4n prefetch architecture */ +#define MPDDRC_MD_TYPE_S2_SDRAM (0x1u << 24) /**< \brief (MPDDRC_MD) 2n prefetch architecture */ +#define MPDDRC_MD_TYPE_NVM (0x2u << 24) /**< \brief (MPDDRC_MD) Non-volatile device */ +#define MPDDRC_MD_TYPE_S8_SDRAM (0x3u << 24) /**< \brief (MPDDRC_MD) 8n prefetch architecture */ +#define MPDDRC_MD_DENSITY_Pos 26 +#define MPDDRC_MD_DENSITY_Msk (0xfu << MPDDRC_MD_DENSITY_Pos) /**< \brief (MPDDRC_MD) Density of Memory */ +#define MPDDRC_MD_DENSITY(value) ((MPDDRC_MD_DENSITY_Msk & ((value) << MPDDRC_MD_DENSITY_Pos))) +#define MPDDRC_MD_DENSITY_DENSITY_64MBITS (0x0u << 26) /**< \brief (MPDDRC_MD) The device density is 64 Mbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_128MBITS (0x1u << 26) /**< \brief (MPDDRC_MD) The device density is 128 Mbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_256MBITS (0x2u << 26) /**< \brief (MPDDRC_MD) The device density is 256 Mbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_512MBITS (0x3u << 26) /**< \brief (MPDDRC_MD) The device density is 512 Mbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_1GBITS (0x4u << 26) /**< \brief (MPDDRC_MD) The device density is 1 Gbit. */ +#define MPDDRC_MD_DENSITY_DENSITY_2GBITS (0x5u << 26) /**< \brief (MPDDRC_MD) The device density is 2 Gbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_4GBITS (0x6u << 26) /**< \brief (MPDDRC_MD) The device density is 4 Gbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_8GBITS (0x7u << 26) /**< \brief (MPDDRC_MD) The device density is 8 Gbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_16GBITS (0x8u << 26) /**< \brief (MPDDRC_MD) The device density is 16 Gbits. */ +#define MPDDRC_MD_DENSITY_DENSITY_32GBITS (0x9u << 26) /**< \brief (MPDDRC_MD) The device density is 32 Gbits. */ +#define MPDDRC_MD_IO_WIDTH_Pos 30 +#define MPDDRC_MD_IO_WIDTH_Msk (0x3u << MPDDRC_MD_IO_WIDTH_Pos) /**< \brief (MPDDRC_MD) Width of Memory */ +#define MPDDRC_MD_IO_WIDTH(value) ((MPDDRC_MD_IO_WIDTH_Msk & ((value) << MPDDRC_MD_IO_WIDTH_Pos))) +#define MPDDRC_MD_IO_WIDTH_WIDTH_32 (0x0u << 30) /**< \brief (MPDDRC_MD) The data bus width is 32 bits. */ +#define MPDDRC_MD_IO_WIDTH_WIDTH_16 (0x1u << 30) /**< \brief (MPDDRC_MD) The data bus width is 16 bits. */ +#define MPDDRC_MD_IO_WIDTH_WIDTH_8 (0x2u << 30) /**< \brief (MPDDRC_MD) The data bus width is 8 bits. */ +#define MPDDRC_MD_IO_WIDTH_NOT_USED (0x3u << 30) /**< \brief (MPDDRC_MD) - */ +/* -------- MPDDRC_LPDDR23_LPR : (MPDDRC Offset: 0x28) MPDDRC LPDDR2-LPDDR3 Low-power Register -------- */ +#define MPDDRC_LPDDR23_LPR_BK_MASK_PASR_Pos 0 +#define MPDDRC_LPDDR23_LPR_BK_MASK_PASR_Msk (0xffu << MPDDRC_LPDDR23_LPR_BK_MASK_PASR_Pos) /**< \brief (MPDDRC_LPDDR23_LPR) Bank Mask Bit/PASR */ +#define MPDDRC_LPDDR23_LPR_BK_MASK_PASR(value) ((MPDDRC_LPDDR23_LPR_BK_MASK_PASR_Msk & ((value) << MPDDRC_LPDDR23_LPR_BK_MASK_PASR_Pos))) +#define MPDDRC_LPDDR23_LPR_SEG_MASK_Pos 8 +#define MPDDRC_LPDDR23_LPR_SEG_MASK_Msk (0xffffu << MPDDRC_LPDDR23_LPR_SEG_MASK_Pos) /**< \brief (MPDDRC_LPDDR23_LPR) Segment Mask Bit */ +#define MPDDRC_LPDDR23_LPR_SEG_MASK(value) ((MPDDRC_LPDDR23_LPR_SEG_MASK_Msk & ((value) << MPDDRC_LPDDR23_LPR_SEG_MASK_Pos))) +#define MPDDRC_LPDDR23_LPR_DS_Pos 24 +#define MPDDRC_LPDDR23_LPR_DS_Msk (0xfu << MPDDRC_LPDDR23_LPR_DS_Pos) /**< \brief (MPDDRC_LPDDR23_LPR) Drive Strength */ +#define MPDDRC_LPDDR23_LPR_DS(value) ((MPDDRC_LPDDR23_LPR_DS_Msk & ((value) << MPDDRC_LPDDR23_LPR_DS_Pos))) +/* -------- MPDDRC_LPDDR23_CAL_MR4 : (MPDDRC Offset: 0x2C) MPDDRC LPDDR2-LPDDR3 Calibration and MR4 Register -------- */ +#define MPDDRC_LPDDR23_CAL_MR4_COUNT_CAL_Pos 0 +#define MPDDRC_LPDDR23_CAL_MR4_COUNT_CAL_Msk (0xffffu << MPDDRC_LPDDR23_CAL_MR4_COUNT_CAL_Pos) /**< \brief (MPDDRC_LPDDR23_CAL_MR4) LPDDR2 and LPDDR3 Calibration Timer Count */ +#define MPDDRC_LPDDR23_CAL_MR4_COUNT_CAL(value) ((MPDDRC_LPDDR23_CAL_MR4_COUNT_CAL_Msk & ((value) << MPDDRC_LPDDR23_CAL_MR4_COUNT_CAL_Pos))) +#define MPDDRC_LPDDR23_CAL_MR4_MR4_READ_Pos 16 +#define MPDDRC_LPDDR23_CAL_MR4_MR4_READ_Msk (0xffffu << MPDDRC_LPDDR23_CAL_MR4_MR4_READ_Pos) /**< \brief (MPDDRC_LPDDR23_CAL_MR4) Mode Register 4 Read Interval */ +#define MPDDRC_LPDDR23_CAL_MR4_MR4_READ(value) ((MPDDRC_LPDDR23_CAL_MR4_MR4_READ_Msk & ((value) << MPDDRC_LPDDR23_CAL_MR4_MR4_READ_Pos))) +/* -------- MPDDRC_LPDDR23_TIM_CAL : (MPDDRC Offset: 0x30) MPDDRC LPDDR2-LPDDR3 Timing Calibration Register -------- */ +#define MPDDRC_LPDDR23_TIM_CAL_ZQCS_Pos 0 +#define MPDDRC_LPDDR23_TIM_CAL_ZQCS_Msk (0xffu << MPDDRC_LPDDR23_TIM_CAL_ZQCS_Pos) /**< \brief (MPDDRC_LPDDR23_TIM_CAL) ZQ Calibration Short */ +#define MPDDRC_LPDDR23_TIM_CAL_ZQCS(value) ((MPDDRC_LPDDR23_TIM_CAL_ZQCS_Msk & ((value) << MPDDRC_LPDDR23_TIM_CAL_ZQCS_Pos))) +#define MPDDRC_LPDDR23_TIM_CAL_RZQI_Pos 16 +#define MPDDRC_LPDDR23_TIM_CAL_RZQI_Msk (0x3u << MPDDRC_LPDDR23_TIM_CAL_RZQI_Pos) /**< \brief (MPDDRC_LPDDR23_TIM_CAL) Built-in Self-Test for RZQ Information */ +#define MPDDRC_LPDDR23_TIM_CAL_RZQI(value) ((MPDDRC_LPDDR23_TIM_CAL_RZQI_Msk & ((value) << MPDDRC_LPDDR23_TIM_CAL_RZQI_Pos))) +#define MPDDRC_LPDDR23_TIM_CAL_RZQI_RZQ_NOT_SUPPORTED (0x0u << 16) /**< \brief (MPDDRC_LPDDR23_TIM_CAL) RZQ self test not supported */ +#define MPDDRC_LPDDR23_TIM_CAL_RZQI_ZQ_VDDCA_FLOAT (0x1u << 16) /**< \brief (MPDDRC_LPDDR23_TIM_CAL) The ZQ pin can be connected to VDDCA or left floating. */ +#define MPDDRC_LPDDR23_TIM_CAL_RZQI_ZQ_SHORTED_GROUND (0x2u << 16) /**< \brief (MPDDRC_LPDDR23_TIM_CAL) The ZQ pin can be shorted to ground. */ +#define MPDDRC_LPDDR23_TIM_CAL_RZQI_ZQ_SELF_TEST_OK (0x3u << 16) /**< \brief (MPDDRC_LPDDR23_TIM_CAL) ZQ pin self test complete; no error condition detected */ +/* -------- MPDDRC_IO_CALIBR : (MPDDRC Offset: 0x34) MPDDRC IO Calibration -------- */ +#define MPDDRC_IO_CALIBR_RDIV_Pos 0 +#define MPDDRC_IO_CALIBR_RDIV_Msk (0x7u << MPDDRC_IO_CALIBR_RDIV_Pos) /**< \brief (MPDDRC_IO_CALIBR) Resistor Divider, Output Driver Impedance */ +#define MPDDRC_IO_CALIBR_RDIV(value) ((MPDDRC_IO_CALIBR_RDIV_Msk & ((value) << MPDDRC_IO_CALIBR_RDIV_Pos))) +#define MPDDRC_IO_CALIBR_RDIV_RZQ_34 (0x1u << 0) /**< \brief (MPDDRC_IO_CALIBR) LP-DDR2 serial impedance line = 34.3 ohms,DDR2/LP-DDR1 serial impedance line: Not applicable */ +#define MPDDRC_IO_CALIBR_RDIV_RZQ_40_RZQ_38_RZQ_37_RZQ_35 (0x2u << 0) /**< \brief (MPDDRC_IO_CALIBR) LP-DDR2 serial impedance line = 40 ohms,LP-DDR3 serial impedance line = 38 ohms,DDR3 serial impedance line = 37 ohms,DDR2/LP-DDR1 serial impedance line = 35 ohms */ +#define MPDDRC_IO_CALIBR_RDIV_RZQ_48_RZQ_46_RZQ_44_RZQ_43 (0x3u << 0) /**< \brief (MPDDRC_IO_CALIBR) LP-DDR2 serial impedance line = 48 ohms,LP-DDR3 serial impedance line = 46 ohms,DDR3 serial impedance line = 44 ohms,DDR2/LP-DDR1 serial impedance line = 43 ohms */ +#define MPDDRC_IO_CALIBR_RDIV_RZQ_60 (0x4u << 0) /**< \brief (MPDDRC_IO_CALIBR) LP-DDR2 serial impedance line = 60 ohms,LP-DDR3 serial impedance line = 57 ohms,DDR3 serial impedance line = 55 ohms,DDR2/LP-DDR1 serial impedance line = 52 ohms */ +#define MPDDRC_IO_CALIBR_RDIV_RZQ_80_RZQ_77_RZQ_73_RZQ_70 (0x6u << 0) /**< \brief (MPDDRC_IO_CALIBR) LP-DDR2 serial impedance line = 80 ohms,LP-DDR3 serial impedance line = 77 ohms,DDR3 serial impedance line = 73 ohms,DDR2/LP-DDR1 serial impedance line = 70 ohms */ +#define MPDDRC_IO_CALIBR_RDIV_RZQ_120_RZQ_115_RZQ_110_RZQ_105 (0x7u << 0) /**< \brief (MPDDRC_IO_CALIBR) LP-DDR2 serial impedance line = 120 ohms,LP-DDR3 serial impedance line = 115 ohms,DDR3 serial impedance line = 110 ohms,DDR2/LP-DDR1 serial impedance line = 105 ohms */ +#define MPDDRC_IO_CALIBR_EN_CALIB (0x1u << 4) /**< \brief (MPDDRC_IO_CALIBR) Enable Calibration */ +#define MPDDRC_IO_CALIBR_EN_CALIB_DISABLE_CALIBRATION (0x0u << 4) /**< \brief (MPDDRC_IO_CALIBR) Calibration is disabled. */ +#define MPDDRC_IO_CALIBR_EN_CALIB_ENABLE_CALIBRATION (0x1u << 4) /**< \brief (MPDDRC_IO_CALIBR) Calibration is enabled. */ +#define MPDDRC_IO_CALIBR_TZQIO_Pos 8 +#define MPDDRC_IO_CALIBR_TZQIO_Msk (0x7fu << MPDDRC_IO_CALIBR_TZQIO_Pos) /**< \brief (MPDDRC_IO_CALIBR) IO Calibration */ +#define MPDDRC_IO_CALIBR_TZQIO(value) ((MPDDRC_IO_CALIBR_TZQIO_Msk & ((value) << MPDDRC_IO_CALIBR_TZQIO_Pos))) +#define MPDDRC_IO_CALIBR_CALCODEP_Pos 16 +#define MPDDRC_IO_CALIBR_CALCODEP_Msk (0xfu << MPDDRC_IO_CALIBR_CALCODEP_Pos) /**< \brief (MPDDRC_IO_CALIBR) Number of Transistor P */ +#define MPDDRC_IO_CALIBR_CALCODEP(value) ((MPDDRC_IO_CALIBR_CALCODEP_Msk & ((value) << MPDDRC_IO_CALIBR_CALCODEP_Pos))) +#define MPDDRC_IO_CALIBR_CALCODEN_Pos 20 +#define MPDDRC_IO_CALIBR_CALCODEN_Msk (0xfu << MPDDRC_IO_CALIBR_CALCODEN_Pos) /**< \brief (MPDDRC_IO_CALIBR) Number of Transistor N */ +#define MPDDRC_IO_CALIBR_CALCODEN(value) ((MPDDRC_IO_CALIBR_CALCODEN_Msk & ((value) << MPDDRC_IO_CALIBR_CALCODEN_Pos))) +/* -------- MPDDRC_OCMS : (MPDDRC Offset: 0x38) MPDDRC OCMS Register -------- */ +#define MPDDRC_OCMS_SCR_EN (0x1u << 0) /**< \brief (MPDDRC_OCMS) Scrambling Enable */ +/* -------- MPDDRC_OCMS_KEY1 : (MPDDRC Offset: 0x3C) MPDDRC OCMS KEY1 Register -------- */ +#define MPDDRC_OCMS_KEY1_KEY1_Pos 0 +#define MPDDRC_OCMS_KEY1_KEY1_Msk (0xffffffffu << MPDDRC_OCMS_KEY1_KEY1_Pos) /**< \brief (MPDDRC_OCMS_KEY1) Off-chip Memory Scrambling (OCMS) Key Part 1 */ +#define MPDDRC_OCMS_KEY1_KEY1(value) ((MPDDRC_OCMS_KEY1_KEY1_Msk & ((value) << MPDDRC_OCMS_KEY1_KEY1_Pos))) +/* -------- MPDDRC_OCMS_KEY2 : (MPDDRC Offset: 0x40) MPDDRC OCMS KEY2 Register -------- */ +#define MPDDRC_OCMS_KEY2_KEY2_Pos 0 +#define MPDDRC_OCMS_KEY2_KEY2_Msk (0xffffffffu << MPDDRC_OCMS_KEY2_KEY2_Pos) /**< \brief (MPDDRC_OCMS_KEY2) Off-chip Memory Scrambling (OCMS) Key Part 2 */ +#define MPDDRC_OCMS_KEY2_KEY2(value) ((MPDDRC_OCMS_KEY2_KEY2_Msk & ((value) << MPDDRC_OCMS_KEY2_KEY2_Pos))) +/* -------- MPDDRC_CONF_ARBITER : (MPDDRC Offset: 0x44) MPDDRC Configuration Arbiter Register -------- */ +#define MPDDRC_CONF_ARBITER_ARB_Pos 0 +#define MPDDRC_CONF_ARBITER_ARB_Msk (0x3u << MPDDRC_CONF_ARBITER_ARB_Pos) /**< \brief (MPDDRC_CONF_ARBITER) Type of Arbitration */ +#define MPDDRC_CONF_ARBITER_ARB(value) ((MPDDRC_CONF_ARBITER_ARB_Msk & ((value) << MPDDRC_CONF_ARBITER_ARB_Pos))) +#define MPDDRC_CONF_ARBITER_ARB_ROUND (0x0u << 0) /**< \brief (MPDDRC_CONF_ARBITER) Round Robin */ +#define MPDDRC_CONF_ARBITER_ARB_NB_REQUEST (0x1u << 0) /**< \brief (MPDDRC_CONF_ARBITER) Request Policy */ +#define MPDDRC_CONF_ARBITER_ARB_BANDWIDTH (0x2u << 0) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth Policy */ +#define MPDDRC_CONF_ARBITER_BDW_MAX_CUR (0x1u << 3) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth Max or Current */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P0 (0x1u << 8) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P1 (0x1u << 9) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P2 (0x1u << 10) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P3 (0x1u << 11) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P4 (0x1u << 12) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P5 (0x1u << 13) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P6 (0x1u << 14) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_RQ_WD_P7 (0x1u << 15) /**< \brief (MPDDRC_CONF_ARBITER) Request or Word from Port X */ +#define MPDDRC_CONF_ARBITER_MA_PR_P0 (0x1u << 16) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P1 (0x1u << 17) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P2 (0x1u << 18) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P3 (0x1u << 19) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P4 (0x1u << 20) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P5 (0x1u << 21) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P6 (0x1u << 22) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_MA_PR_P7 (0x1u << 23) /**< \brief (MPDDRC_CONF_ARBITER) Master or Software Provide Information */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P0 (0x1u << 24) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P1 (0x1u << 25) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P2 (0x1u << 26) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P3 (0x1u << 27) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P4 (0x1u << 28) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P5 (0x1u << 29) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P6 (0x1u << 30) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +#define MPDDRC_CONF_ARBITER_BDW_BURST_P7 (0x1u << 31) /**< \brief (MPDDRC_CONF_ARBITER) Bandwidth is Reached or Bandwidth and Current Burst Access is Ended on port X */ +/* -------- MPDDRC_TIMEOUT : (MPDDRC Offset: 0x48) MPDDRC Time-out Port 0/1/2/3 Register -------- */ +#define MPDDRC_TIMEOUT_TIMEOUT_P0_Pos 0 +#define MPDDRC_TIMEOUT_TIMEOUT_P0_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P0_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P0(value) ((MPDDRC_TIMEOUT_TIMEOUT_P0_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P0_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P1_Pos 4 +#define MPDDRC_TIMEOUT_TIMEOUT_P1_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P1_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P1(value) ((MPDDRC_TIMEOUT_TIMEOUT_P1_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P1_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P2_Pos 8 +#define MPDDRC_TIMEOUT_TIMEOUT_P2_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P2_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P2(value) ((MPDDRC_TIMEOUT_TIMEOUT_P2_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P2_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P3_Pos 12 +#define MPDDRC_TIMEOUT_TIMEOUT_P3_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P3_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P3(value) ((MPDDRC_TIMEOUT_TIMEOUT_P3_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P3_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P4_Pos 16 +#define MPDDRC_TIMEOUT_TIMEOUT_P4_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P4_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P4(value) ((MPDDRC_TIMEOUT_TIMEOUT_P4_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P4_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P5_Pos 20 +#define MPDDRC_TIMEOUT_TIMEOUT_P5_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P5_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P5(value) ((MPDDRC_TIMEOUT_TIMEOUT_P5_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P5_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P6_Pos 24 +#define MPDDRC_TIMEOUT_TIMEOUT_P6_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P6_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P6(value) ((MPDDRC_TIMEOUT_TIMEOUT_P6_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P6_Pos))) +#define MPDDRC_TIMEOUT_TIMEOUT_P7_Pos 28 +#define MPDDRC_TIMEOUT_TIMEOUT_P7_Msk (0xfu << MPDDRC_TIMEOUT_TIMEOUT_P7_Pos) /**< \brief (MPDDRC_TIMEOUT) Time-out for Ports 0, 1, 2, 3, 4, 5, 6 and 7 */ +#define MPDDRC_TIMEOUT_TIMEOUT_P7(value) ((MPDDRC_TIMEOUT_TIMEOUT_P7_Msk & ((value) << MPDDRC_TIMEOUT_TIMEOUT_P7_Pos))) +/* -------- MPDDRC_REQ_PORT_0123 : (MPDDRC Offset: 0x4C) MPDDRC Request Port 0/1/2/3 Register -------- */ +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P0_Pos 0 +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P0_Msk (0xffu << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P0_Pos) /**< \brief (MPDDRC_REQ_PORT_0123) Number of Requests, Number of Words or Bandwidth Allocation from Port 0-1-2-3 */ +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P0(value) ((MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P0_Msk & ((value) << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P0_Pos))) +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P1_Pos 8 +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P1_Msk (0xffu << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P1_Pos) /**< \brief (MPDDRC_REQ_PORT_0123) Number of Requests, Number of Words or Bandwidth Allocation from Port 0-1-2-3 */ +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P1(value) ((MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P1_Msk & ((value) << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P1_Pos))) +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P2_Pos 16 +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P2_Msk (0xffu << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P2_Pos) /**< \brief (MPDDRC_REQ_PORT_0123) Number of Requests, Number of Words or Bandwidth Allocation from Port 0-1-2-3 */ +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P2(value) ((MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P2_Msk & ((value) << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P2_Pos))) +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P3_Pos 24 +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P3_Msk (0xffu << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P3_Pos) /**< \brief (MPDDRC_REQ_PORT_0123) Number of Requests, Number of Words or Bandwidth Allocation from Port 0-1-2-3 */ +#define MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P3(value) ((MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P3_Msk & ((value) << MPDDRC_REQ_PORT_0123_NRQ_NWD_BDW_P3_Pos))) +/* -------- MPDDRC_REQ_PORT_4567 : (MPDDRC Offset: 0x50) MPDDRC Request Port 4/5/6/7 Register -------- */ +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P4_Pos 0 +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P4_Msk (0xffu << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P4_Pos) /**< \brief (MPDDRC_REQ_PORT_4567) Number of Requests, Number of Words or Bandwidth allocation from port 4-5-6-7 */ +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P4(value) ((MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P4_Msk & ((value) << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P4_Pos))) +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P5_Pos 8 +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P5_Msk (0xffu << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P5_Pos) /**< \brief (MPDDRC_REQ_PORT_4567) Number of Requests, Number of Words or Bandwidth allocation from port 4-5-6-7 */ +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P5(value) ((MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P5_Msk & ((value) << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P5_Pos))) +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P6_Pos 16 +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P6_Msk (0xffu << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P6_Pos) /**< \brief (MPDDRC_REQ_PORT_4567) Number of Requests, Number of Words or Bandwidth allocation from port 4-5-6-7 */ +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P6(value) ((MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P6_Msk & ((value) << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P6_Pos))) +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P7_Pos 24 +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P7_Msk (0xffu << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P7_Pos) /**< \brief (MPDDRC_REQ_PORT_4567) Number of Requests, Number of Words or Bandwidth allocation from port 4-5-6-7 */ +#define MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P7(value) ((MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P7_Msk & ((value) << MPDDRC_REQ_PORT_4567_NRQ_NWD_BDW_P7_Pos))) +/* -------- MPDDRC_BDW_PORT_0123 : (MPDDRC Offset: 0x54) MPDDRC Bandwidth Port 0/1/2/3 Register -------- */ +#define MPDDRC_BDW_PORT_0123_BDW_P0_Pos 0 +#define MPDDRC_BDW_PORT_0123_BDW_P0_Msk (0x7fu << MPDDRC_BDW_PORT_0123_BDW_P0_Pos) /**< \brief (MPDDRC_BDW_PORT_0123) Current/Maximum Bandwidth from Port 0-1-2-3 */ +#define MPDDRC_BDW_PORT_0123_BDW_P1_Pos 8 +#define MPDDRC_BDW_PORT_0123_BDW_P1_Msk (0x7fu << MPDDRC_BDW_PORT_0123_BDW_P1_Pos) /**< \brief (MPDDRC_BDW_PORT_0123) Current/Maximum Bandwidth from Port 0-1-2-3 */ +#define MPDDRC_BDW_PORT_0123_BDW_P2_Pos 16 +#define MPDDRC_BDW_PORT_0123_BDW_P2_Msk (0x7fu << MPDDRC_BDW_PORT_0123_BDW_P2_Pos) /**< \brief (MPDDRC_BDW_PORT_0123) Current/Maximum Bandwidth from Port 0-1-2-3 */ +#define MPDDRC_BDW_PORT_0123_BDW_P3_Pos 24 +#define MPDDRC_BDW_PORT_0123_BDW_P3_Msk (0x7fu << MPDDRC_BDW_PORT_0123_BDW_P3_Pos) /**< \brief (MPDDRC_BDW_PORT_0123) Current/Maximum Bandwidth from Port 0-1-2-3 */ +/* -------- MPDDRC_BDW_PORT_4567 : (MPDDRC Offset: 0x58) MPDDRC Bandwidth Port 4/5/6/7 Register -------- */ +#define MPDDRC_BDW_PORT_4567_BDW_P4_Pos 0 +#define MPDDRC_BDW_PORT_4567_BDW_P4_Msk (0x7fu << MPDDRC_BDW_PORT_4567_BDW_P4_Pos) /**< \brief (MPDDRC_BDW_PORT_4567) Current/Maximum Bandwidth from Port 4-5-6-7 */ +#define MPDDRC_BDW_PORT_4567_BDW_P5_Pos 8 +#define MPDDRC_BDW_PORT_4567_BDW_P5_Msk (0x7fu << MPDDRC_BDW_PORT_4567_BDW_P5_Pos) /**< \brief (MPDDRC_BDW_PORT_4567) Current/Maximum Bandwidth from Port 4-5-6-7 */ +#define MPDDRC_BDW_PORT_4567_BDW_P6_Pos 16 +#define MPDDRC_BDW_PORT_4567_BDW_P6_Msk (0x7fu << MPDDRC_BDW_PORT_4567_BDW_P6_Pos) /**< \brief (MPDDRC_BDW_PORT_4567) Current/Maximum Bandwidth from Port 4-5-6-7 */ +#define MPDDRC_BDW_PORT_4567_BDW_P7_Pos 24 +#define MPDDRC_BDW_PORT_4567_BDW_P7_Msk (0x7fu << MPDDRC_BDW_PORT_4567_BDW_P7_Pos) /**< \brief (MPDDRC_BDW_PORT_4567) Current/Maximum Bandwidth from Port 4-5-6-7 */ +/* -------- MPDDRC_RD_DATA_PATH : (MPDDRC Offset: 0x5C) MPDDRC Read Datapath Register -------- */ +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_Pos 0 +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_Msk (0x3u << MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_Pos) /**< \brief (MPDDRC_RD_DATA_PATH) Shift Sampling Point of Data */ +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING(value) ((MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_Msk & ((value) << MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_Pos))) +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_NO_SHIFT (0x0u << 0) /**< \brief (MPDDRC_RD_DATA_PATH) Initial sampling point. */ +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_SHIFT_ONE_CYCLE (0x1u << 0) /**< \brief (MPDDRC_RD_DATA_PATH) Sampling point is shifted by one cycle. */ +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_SHIFT_TWO_CYCLES (0x2u << 0) /**< \brief (MPDDRC_RD_DATA_PATH) Sampling point is shifted by two cycles. */ +#define MPDDRC_RD_DATA_PATH_SHIFT_SAMPLING_SHIFT_THREE_CYCLES (0x3u << 0) /**< \brief (MPDDRC_RD_DATA_PATH) Sampling point is shifted by three cycles, unique for LPDDR2 and DDR3 and LPDDR3.Not applicable for DDR2 and LPDDR1 devices. */ +/* -------- MPDDRC_MCFGR : (MPDDRC Offset: 0x60) MPDDRC Monitor Configuration -------- */ +#define MPDDRC_MCFGR_EN_MONI (0x1u << 0) /**< \brief (MPDDRC_MCFGR) Enable Monitor */ +#define MPDDRC_MCFGR_SOFT_RESET (0x1u << 1) /**< \brief (MPDDRC_MCFGR) Soft Reset */ +#define MPDDRC_MCFGR_RUN (0x1u << 4) /**< \brief (MPDDRC_MCFGR) Control Monitor */ +#define MPDDRC_MCFGR_READ_WRITE_Pos 8 +#define MPDDRC_MCFGR_READ_WRITE_Msk (0x3u << MPDDRC_MCFGR_READ_WRITE_Pos) /**< \brief (MPDDRC_MCFGR) Read/Write Access */ +#define MPDDRC_MCFGR_READ_WRITE(value) ((MPDDRC_MCFGR_READ_WRITE_Msk & ((value) << MPDDRC_MCFGR_READ_WRITE_Pos))) +#define MPDDRC_MCFGR_READ_WRITE_TRIG_RD_WR (0x0u << 8) /**< \brief (MPDDRC_MCFGR) Read and Write accesses are triggered. */ +#define MPDDRC_MCFGR_READ_WRITE_TRIG_WR (0x1u << 8) /**< \brief (MPDDRC_MCFGR) Only Write accesses are triggered. */ +#define MPDDRC_MCFGR_READ_WRITE_TRIG_RD (0x2u << 8) /**< \brief (MPDDRC_MCFGR) Only Read accesses are triggered. */ +#define MPDDRC_MCFGR_REFR_CALIB (0x1u << 10) /**< \brief (MPDDRC_MCFGR) Refresh Calibration */ +#define MPDDRC_MCFGR_INFO_Pos 11 +#define MPDDRC_MCFGR_INFO_Msk (0x3u << MPDDRC_MCFGR_INFO_Pos) /**< \brief (MPDDRC_MCFGR) Information Type */ +#define MPDDRC_MCFGR_INFO(value) ((MPDDRC_MCFGR_INFO_Msk & ((value) << MPDDRC_MCFGR_INFO_Pos))) +#define MPDDRC_MCFGR_INFO_MAX_WAIT (0x0u << 11) /**< \brief (MPDDRC_MCFGR) Information concerning the transfer with the longest waiting time */ +#define MPDDRC_MCFGR_INFO_NB_TRANSFERS (0x1u << 11) /**< \brief (MPDDRC_MCFGR) Number of transfers on the port */ +#define MPDDRC_MCFGR_INFO_TOTAL_LATENCY (0x2u << 11) /**< \brief (MPDDRC_MCFGR) Total latency on the port */ +/* -------- MPDDRC_MADDR0 : (MPDDRC Offset: 0x64) MPDDRC Monitor Address High/Low port 0 -------- */ +#define MPDDRC_MADDR0_ADDR_LOW_PORT0_Pos 0 +#define MPDDRC_MADDR0_ADDR_LOW_PORT0_Msk (0xffffu << MPDDRC_MADDR0_ADDR_LOW_PORT0_Pos) /**< \brief (MPDDRC_MADDR0) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR0_ADDR_LOW_PORT0(value) ((MPDDRC_MADDR0_ADDR_LOW_PORT0_Msk & ((value) << MPDDRC_MADDR0_ADDR_LOW_PORT0_Pos))) +#define MPDDRC_MADDR0_ADDR_HIGH_PORT0_Pos 16 +#define MPDDRC_MADDR0_ADDR_HIGH_PORT0_Msk (0xffffu << MPDDRC_MADDR0_ADDR_HIGH_PORT0_Pos) /**< \brief (MPDDRC_MADDR0) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR0_ADDR_HIGH_PORT0(value) ((MPDDRC_MADDR0_ADDR_HIGH_PORT0_Msk & ((value) << MPDDRC_MADDR0_ADDR_HIGH_PORT0_Pos))) +/* -------- MPDDRC_MADDR1 : (MPDDRC Offset: 0x68) MPDDRC Monitor Address High/Low port 1 -------- */ +#define MPDDRC_MADDR1_ADDR_LOW_PORT1_Pos 0 +#define MPDDRC_MADDR1_ADDR_LOW_PORT1_Msk (0xffffu << MPDDRC_MADDR1_ADDR_LOW_PORT1_Pos) /**< \brief (MPDDRC_MADDR1) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR1_ADDR_LOW_PORT1(value) ((MPDDRC_MADDR1_ADDR_LOW_PORT1_Msk & ((value) << MPDDRC_MADDR1_ADDR_LOW_PORT1_Pos))) +#define MPDDRC_MADDR1_ADDR_HIGH_PORT1_Pos 16 +#define MPDDRC_MADDR1_ADDR_HIGH_PORT1_Msk (0xffffu << MPDDRC_MADDR1_ADDR_HIGH_PORT1_Pos) /**< \brief (MPDDRC_MADDR1) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR1_ADDR_HIGH_PORT1(value) ((MPDDRC_MADDR1_ADDR_HIGH_PORT1_Msk & ((value) << MPDDRC_MADDR1_ADDR_HIGH_PORT1_Pos))) +/* -------- MPDDRC_MADDR2 : (MPDDRC Offset: 0x6C) MPDDRC Monitor Address High/Low port 2 -------- */ +#define MPDDRC_MADDR2_ADDR_LOW_PORT2_Pos 0 +#define MPDDRC_MADDR2_ADDR_LOW_PORT2_Msk (0xffffu << MPDDRC_MADDR2_ADDR_LOW_PORT2_Pos) /**< \brief (MPDDRC_MADDR2) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR2_ADDR_LOW_PORT2(value) ((MPDDRC_MADDR2_ADDR_LOW_PORT2_Msk & ((value) << MPDDRC_MADDR2_ADDR_LOW_PORT2_Pos))) +#define MPDDRC_MADDR2_ADDR_HIGH_PORT2_Pos 16 +#define MPDDRC_MADDR2_ADDR_HIGH_PORT2_Msk (0xffffu << MPDDRC_MADDR2_ADDR_HIGH_PORT2_Pos) /**< \brief (MPDDRC_MADDR2) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR2_ADDR_HIGH_PORT2(value) ((MPDDRC_MADDR2_ADDR_HIGH_PORT2_Msk & ((value) << MPDDRC_MADDR2_ADDR_HIGH_PORT2_Pos))) +/* -------- MPDDRC_MADDR3 : (MPDDRC Offset: 0x70) MPDDRC Monitor Address High/Low port 3 -------- */ +#define MPDDRC_MADDR3_ADDR_LOW_PORT3_Pos 0 +#define MPDDRC_MADDR3_ADDR_LOW_PORT3_Msk (0xffffu << MPDDRC_MADDR3_ADDR_LOW_PORT3_Pos) /**< \brief (MPDDRC_MADDR3) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR3_ADDR_LOW_PORT3(value) ((MPDDRC_MADDR3_ADDR_LOW_PORT3_Msk & ((value) << MPDDRC_MADDR3_ADDR_LOW_PORT3_Pos))) +#define MPDDRC_MADDR3_ADDR_HIGH_PORT3_Pos 16 +#define MPDDRC_MADDR3_ADDR_HIGH_PORT3_Msk (0xffffu << MPDDRC_MADDR3_ADDR_HIGH_PORT3_Pos) /**< \brief (MPDDRC_MADDR3) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR3_ADDR_HIGH_PORT3(value) ((MPDDRC_MADDR3_ADDR_HIGH_PORT3_Msk & ((value) << MPDDRC_MADDR3_ADDR_HIGH_PORT3_Pos))) +/* -------- MPDDRC_MADDR4 : (MPDDRC Offset: 0x74) MPDDRC Monitor Address High/Low port 4 -------- */ +#define MPDDRC_MADDR4_ADDR_LOW_PORT4_Pos 0 +#define MPDDRC_MADDR4_ADDR_LOW_PORT4_Msk (0xffffu << MPDDRC_MADDR4_ADDR_LOW_PORT4_Pos) /**< \brief (MPDDRC_MADDR4) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR4_ADDR_LOW_PORT4(value) ((MPDDRC_MADDR4_ADDR_LOW_PORT4_Msk & ((value) << MPDDRC_MADDR4_ADDR_LOW_PORT4_Pos))) +#define MPDDRC_MADDR4_ADDR_HIGH_PORT4_Pos 16 +#define MPDDRC_MADDR4_ADDR_HIGH_PORT4_Msk (0xffffu << MPDDRC_MADDR4_ADDR_HIGH_PORT4_Pos) /**< \brief (MPDDRC_MADDR4) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR4_ADDR_HIGH_PORT4(value) ((MPDDRC_MADDR4_ADDR_HIGH_PORT4_Msk & ((value) << MPDDRC_MADDR4_ADDR_HIGH_PORT4_Pos))) +/* -------- MPDDRC_MADDR5 : (MPDDRC Offset: 0x78) MPDDRC Monitor Address High/Low port 5 -------- */ +#define MPDDRC_MADDR5_ADDR_LOW_PORT5_Pos 0 +#define MPDDRC_MADDR5_ADDR_LOW_PORT5_Msk (0xffffu << MPDDRC_MADDR5_ADDR_LOW_PORT5_Pos) /**< \brief (MPDDRC_MADDR5) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR5_ADDR_LOW_PORT5(value) ((MPDDRC_MADDR5_ADDR_LOW_PORT5_Msk & ((value) << MPDDRC_MADDR5_ADDR_LOW_PORT5_Pos))) +#define MPDDRC_MADDR5_ADDR_HIGH_PORT5_Pos 16 +#define MPDDRC_MADDR5_ADDR_HIGH_PORT5_Msk (0xffffu << MPDDRC_MADDR5_ADDR_HIGH_PORT5_Pos) /**< \brief (MPDDRC_MADDR5) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR5_ADDR_HIGH_PORT5(value) ((MPDDRC_MADDR5_ADDR_HIGH_PORT5_Msk & ((value) << MPDDRC_MADDR5_ADDR_HIGH_PORT5_Pos))) +/* -------- MPDDRC_MADDR6 : (MPDDRC Offset: 0x7C) MPDDRC Monitor Address High/Low port 6 -------- */ +#define MPDDRC_MADDR6_ADDR_LOW_PORT6_Pos 0 +#define MPDDRC_MADDR6_ADDR_LOW_PORT6_Msk (0xffffu << MPDDRC_MADDR6_ADDR_LOW_PORT6_Pos) /**< \brief (MPDDRC_MADDR6) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR6_ADDR_LOW_PORT6(value) ((MPDDRC_MADDR6_ADDR_LOW_PORT6_Msk & ((value) << MPDDRC_MADDR6_ADDR_LOW_PORT6_Pos))) +#define MPDDRC_MADDR6_ADDR_HIGH_PORT6_Pos 16 +#define MPDDRC_MADDR6_ADDR_HIGH_PORT6_Msk (0xffffu << MPDDRC_MADDR6_ADDR_HIGH_PORT6_Pos) /**< \brief (MPDDRC_MADDR6) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR6_ADDR_HIGH_PORT6(value) ((MPDDRC_MADDR6_ADDR_HIGH_PORT6_Msk & ((value) << MPDDRC_MADDR6_ADDR_HIGH_PORT6_Pos))) +/* -------- MPDDRC_MADDR7 : (MPDDRC Offset: 0x80) MPDDRC Monitor Address High/Low port 7 -------- */ +#define MPDDRC_MADDR7_ADDR_LOW_PORT7_Pos 0 +#define MPDDRC_MADDR7_ADDR_LOW_PORT7_Msk (0xffffu << MPDDRC_MADDR7_ADDR_LOW_PORT7_Pos) /**< \brief (MPDDRC_MADDR7) Address Low on Port x [x =0..7] */ +#define MPDDRC_MADDR7_ADDR_LOW_PORT7(value) ((MPDDRC_MADDR7_ADDR_LOW_PORT7_Msk & ((value) << MPDDRC_MADDR7_ADDR_LOW_PORT7_Pos))) +#define MPDDRC_MADDR7_ADDR_HIGH_PORT7_Pos 16 +#define MPDDRC_MADDR7_ADDR_HIGH_PORT7_Msk (0xffffu << MPDDRC_MADDR7_ADDR_HIGH_PORT7_Pos) /**< \brief (MPDDRC_MADDR7) Address High on Port x [x =0..7] */ +#define MPDDRC_MADDR7_ADDR_HIGH_PORT7(value) ((MPDDRC_MADDR7_ADDR_HIGH_PORT7_Msk & ((value) << MPDDRC_MADDR7_ADDR_HIGH_PORT7_Pos))) +/* -------- MPDDRC_MINFO0 : (MPDDRC Offset: 0x84) MPDDRC Monitor Information port 0 -------- */ +#define MPDDRC_MINFO0_MAX_PORT0_WAITING_Pos 0 +#define MPDDRC_MINFO0_MAX_PORT0_WAITING_Msk (0xffffu << MPDDRC_MINFO0_MAX_PORT0_WAITING_Pos) /**< \brief (MPDDRC_MINFO0) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO0_BURST_Pos 16 +#define MPDDRC_MINFO0_BURST_Msk (0x7u << MPDDRC_MINFO0_BURST_Pos) /**< \brief (MPDDRC_MINFO0) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO0_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO0) Single transfer */ +#define MPDDRC_MINFO0_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO0) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO0_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO0) 4-beat wrapping burst */ +#define MPDDRC_MINFO0_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO0) 4-beat incrementing burst */ +#define MPDDRC_MINFO0_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO0) 8-beat wrapping burst */ +#define MPDDRC_MINFO0_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO0) 8-beat incrementing burst */ +#define MPDDRC_MINFO0_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO0) 16-beat wrapping burst */ +#define MPDDRC_MINFO0_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO0) 16-beat incrementing burst */ +#define MPDDRC_MINFO0_SIZE_Pos 20 +#define MPDDRC_MINFO0_SIZE_Msk (0x7u << MPDDRC_MINFO0_SIZE_Pos) /**< \brief (MPDDRC_MINFO0) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO0_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO0) Byte transfer */ +#define MPDDRC_MINFO0_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO0) Halfword transfer */ +#define MPDDRC_MINFO0_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO0) Word transfer */ +#define MPDDRC_MINFO0_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO0) Dword transfer */ +#define MPDDRC_MINFO0_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO0) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO0_P0_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO0_P0_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO0_P0_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO0) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO0_P0_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO0_P0_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO0_P0_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO0) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO1 : (MPDDRC Offset: 0x88) MPDDRC Monitor Information port 1 -------- */ +#define MPDDRC_MINFO1_MAX_PORT1_WAITING_Pos 0 +#define MPDDRC_MINFO1_MAX_PORT1_WAITING_Msk (0xffffu << MPDDRC_MINFO1_MAX_PORT1_WAITING_Pos) /**< \brief (MPDDRC_MINFO1) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO1_BURST_Pos 16 +#define MPDDRC_MINFO1_BURST_Msk (0x7u << MPDDRC_MINFO1_BURST_Pos) /**< \brief (MPDDRC_MINFO1) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO1_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO1) Single transfer */ +#define MPDDRC_MINFO1_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO1) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO1_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO1) 4-beat wrapping burst */ +#define MPDDRC_MINFO1_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO1) 4-beat incrementing burst */ +#define MPDDRC_MINFO1_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO1) 8-beat wrapping burst */ +#define MPDDRC_MINFO1_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO1) 8-beat incrementing burst */ +#define MPDDRC_MINFO1_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO1) 16-beat wrapping burst */ +#define MPDDRC_MINFO1_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO1) 16-beat incrementing burst */ +#define MPDDRC_MINFO1_SIZE_Pos 20 +#define MPDDRC_MINFO1_SIZE_Msk (0x7u << MPDDRC_MINFO1_SIZE_Pos) /**< \brief (MPDDRC_MINFO1) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO1_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO1) Byte transfer */ +#define MPDDRC_MINFO1_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO1) Halfword transfer */ +#define MPDDRC_MINFO1_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO1) Word transfer */ +#define MPDDRC_MINFO1_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO1) Dword transfer */ +#define MPDDRC_MINFO1_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO1) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO1_P1_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO1_P1_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO1_P1_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO1) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO1_P1_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO1_P1_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO1_P1_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO1) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO2 : (MPDDRC Offset: 0x8C) MPDDRC Monitor Information port 2 -------- */ +#define MPDDRC_MINFO2_MAX_PORT2_WAITING_Pos 0 +#define MPDDRC_MINFO2_MAX_PORT2_WAITING_Msk (0xffffu << MPDDRC_MINFO2_MAX_PORT2_WAITING_Pos) /**< \brief (MPDDRC_MINFO2) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO2_BURST_Pos 16 +#define MPDDRC_MINFO2_BURST_Msk (0x7u << MPDDRC_MINFO2_BURST_Pos) /**< \brief (MPDDRC_MINFO2) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO2_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO2) Single transfer */ +#define MPDDRC_MINFO2_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO2) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO2_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO2) 4-beat wrapping burst */ +#define MPDDRC_MINFO2_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO2) 4-beat incrementing burst */ +#define MPDDRC_MINFO2_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO2) 8-beat wrapping burst */ +#define MPDDRC_MINFO2_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO2) 8-beat incrementing burst */ +#define MPDDRC_MINFO2_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO2) 16-beat wrapping burst */ +#define MPDDRC_MINFO2_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO2) 16-beat incrementing burst */ +#define MPDDRC_MINFO2_SIZE_Pos 20 +#define MPDDRC_MINFO2_SIZE_Msk (0x7u << MPDDRC_MINFO2_SIZE_Pos) /**< \brief (MPDDRC_MINFO2) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO2_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO2) Byte transfer */ +#define MPDDRC_MINFO2_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO2) Halfword transfer */ +#define MPDDRC_MINFO2_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO2) Word transfer */ +#define MPDDRC_MINFO2_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO2) Dword transfer */ +#define MPDDRC_MINFO2_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO2) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO2_P2_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO2_P2_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO2_P2_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO2) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO2_P2_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO2_P2_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO2_P2_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO2) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO3 : (MPDDRC Offset: 0x90) MPDDRC Monitor Information port 3 -------- */ +#define MPDDRC_MINFO3_MAX_PORT3_WAITING_Pos 0 +#define MPDDRC_MINFO3_MAX_PORT3_WAITING_Msk (0xffffu << MPDDRC_MINFO3_MAX_PORT3_WAITING_Pos) /**< \brief (MPDDRC_MINFO3) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO3_BURST_Pos 16 +#define MPDDRC_MINFO3_BURST_Msk (0x7u << MPDDRC_MINFO3_BURST_Pos) /**< \brief (MPDDRC_MINFO3) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO3_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO3) Single transfer */ +#define MPDDRC_MINFO3_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO3) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO3_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO3) 4-beat wrapping burst */ +#define MPDDRC_MINFO3_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO3) 4-beat incrementing burst */ +#define MPDDRC_MINFO3_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO3) 8-beat wrapping burst */ +#define MPDDRC_MINFO3_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO3) 8-beat incrementing burst */ +#define MPDDRC_MINFO3_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO3) 16-beat wrapping burst */ +#define MPDDRC_MINFO3_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO3) 16-beat incrementing burst */ +#define MPDDRC_MINFO3_SIZE_Pos 20 +#define MPDDRC_MINFO3_SIZE_Msk (0x7u << MPDDRC_MINFO3_SIZE_Pos) /**< \brief (MPDDRC_MINFO3) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO3_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO3) Byte transfer */ +#define MPDDRC_MINFO3_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO3) Halfword transfer */ +#define MPDDRC_MINFO3_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO3) Word transfer */ +#define MPDDRC_MINFO3_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO3) Dword transfer */ +#define MPDDRC_MINFO3_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO3) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO3_P3_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO3_P3_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO3_P3_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO3) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO3_P3_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO3_P3_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO3_P3_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO3) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO4 : (MPDDRC Offset: 0x94) MPDDRC Monitor Information port 4 -------- */ +#define MPDDRC_MINFO4_MAX_PORT4_WAITING_Pos 0 +#define MPDDRC_MINFO4_MAX_PORT4_WAITING_Msk (0xffffu << MPDDRC_MINFO4_MAX_PORT4_WAITING_Pos) /**< \brief (MPDDRC_MINFO4) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO4_BURST_Pos 16 +#define MPDDRC_MINFO4_BURST_Msk (0x7u << MPDDRC_MINFO4_BURST_Pos) /**< \brief (MPDDRC_MINFO4) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO4_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO4) Single transfer */ +#define MPDDRC_MINFO4_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO4) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO4_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO4) 4-beat wrapping burst */ +#define MPDDRC_MINFO4_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO4) 4-beat incrementing burst */ +#define MPDDRC_MINFO4_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO4) 8-beat wrapping burst */ +#define MPDDRC_MINFO4_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO4) 8-beat incrementing burst */ +#define MPDDRC_MINFO4_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO4) 16-beat wrapping burst */ +#define MPDDRC_MINFO4_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO4) 16-beat incrementing burst */ +#define MPDDRC_MINFO4_SIZE_Pos 20 +#define MPDDRC_MINFO4_SIZE_Msk (0x7u << MPDDRC_MINFO4_SIZE_Pos) /**< \brief (MPDDRC_MINFO4) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO4_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO4) Byte transfer */ +#define MPDDRC_MINFO4_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO4) Halfword transfer */ +#define MPDDRC_MINFO4_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO4) Word transfer */ +#define MPDDRC_MINFO4_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO4) Dword transfer */ +#define MPDDRC_MINFO4_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO4) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO4_P4_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO4_P4_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO4_P4_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO4) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO4_P4_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO4_P4_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO4_P4_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO4) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO5 : (MPDDRC Offset: 0x98) MPDDRC Monitor Information port 5 -------- */ +#define MPDDRC_MINFO5_MAX_PORT5_WAITING_Pos 0 +#define MPDDRC_MINFO5_MAX_PORT5_WAITING_Msk (0xffffu << MPDDRC_MINFO5_MAX_PORT5_WAITING_Pos) /**< \brief (MPDDRC_MINFO5) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO5_BURST_Pos 16 +#define MPDDRC_MINFO5_BURST_Msk (0x7u << MPDDRC_MINFO5_BURST_Pos) /**< \brief (MPDDRC_MINFO5) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO5_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO5) Single transfer */ +#define MPDDRC_MINFO5_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO5) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO5_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO5) 4-beat wrapping burst */ +#define MPDDRC_MINFO5_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO5) 4-beat incrementing burst */ +#define MPDDRC_MINFO5_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO5) 8-beat wrapping burst */ +#define MPDDRC_MINFO5_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO5) 8-beat incrementing burst */ +#define MPDDRC_MINFO5_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO5) 16-beat wrapping burst */ +#define MPDDRC_MINFO5_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO5) 16-beat incrementing burst */ +#define MPDDRC_MINFO5_SIZE_Pos 20 +#define MPDDRC_MINFO5_SIZE_Msk (0x7u << MPDDRC_MINFO5_SIZE_Pos) /**< \brief (MPDDRC_MINFO5) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO5_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO5) Byte transfer */ +#define MPDDRC_MINFO5_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO5) Halfword transfer */ +#define MPDDRC_MINFO5_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO5) Word transfer */ +#define MPDDRC_MINFO5_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO5) Dword transfer */ +#define MPDDRC_MINFO5_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO5) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO5_P5_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO5_P5_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO5_P5_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO5) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO5_P5_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO5_P5_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO5_P5_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO5) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO6 : (MPDDRC Offset: 0x9C) MPDDRC Monitor Information port 6 -------- */ +#define MPDDRC_MINFO6_MAX_PORT6_WAITING_Pos 0 +#define MPDDRC_MINFO6_MAX_PORT6_WAITING_Msk (0xffffu << MPDDRC_MINFO6_MAX_PORT6_WAITING_Pos) /**< \brief (MPDDRC_MINFO6) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO6_BURST_Pos 16 +#define MPDDRC_MINFO6_BURST_Msk (0x7u << MPDDRC_MINFO6_BURST_Pos) /**< \brief (MPDDRC_MINFO6) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO6_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO6) Single transfer */ +#define MPDDRC_MINFO6_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO6) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO6_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO6) 4-beat wrapping burst */ +#define MPDDRC_MINFO6_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO6) 4-beat incrementing burst */ +#define MPDDRC_MINFO6_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO6) 8-beat wrapping burst */ +#define MPDDRC_MINFO6_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO6) 8-beat incrementing burst */ +#define MPDDRC_MINFO6_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO6) 16-beat wrapping burst */ +#define MPDDRC_MINFO6_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO6) 16-beat incrementing burst */ +#define MPDDRC_MINFO6_SIZE_Pos 20 +#define MPDDRC_MINFO6_SIZE_Msk (0x7u << MPDDRC_MINFO6_SIZE_Pos) /**< \brief (MPDDRC_MINFO6) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO6_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO6) Byte transfer */ +#define MPDDRC_MINFO6_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO6) Halfword transfer */ +#define MPDDRC_MINFO6_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO6) Word transfer */ +#define MPDDRC_MINFO6_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO6) Dword transfer */ +#define MPDDRC_MINFO6_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO6) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO6_P6_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO6_P6_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO6_P6_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO6) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO6_P6_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO6_P6_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO6_P6_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO6) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_MINFO7 : (MPDDRC Offset: 0xA0) MPDDRC Monitor Information port 7 -------- */ +#define MPDDRC_MINFO7_MAX_PORT7_WAITING_Pos 0 +#define MPDDRC_MINFO7_MAX_PORT7_WAITING_Msk (0xffffu << MPDDRC_MINFO7_MAX_PORT7_WAITING_Pos) /**< \brief (MPDDRC_MINFO7) Address High on Port x [x =0..7] */ +#define MPDDRC_MINFO7_BURST_Pos 16 +#define MPDDRC_MINFO7_BURST_Msk (0x7u << MPDDRC_MINFO7_BURST_Pos) /**< \brief (MPDDRC_MINFO7) Type of Burst on Port x [x =0..7] */ +#define MPDDRC_MINFO7_BURST_SINGLE (0x0u << 16) /**< \brief (MPDDRC_MINFO7) Single transfer */ +#define MPDDRC_MINFO7_BURST_INCR (0x1u << 16) /**< \brief (MPDDRC_MINFO7) Incrementing burst of unspecified length */ +#define MPDDRC_MINFO7_BURST_WRAP4 (0x2u << 16) /**< \brief (MPDDRC_MINFO7) 4-beat wrapping burst */ +#define MPDDRC_MINFO7_BURST_INCR4 (0x3u << 16) /**< \brief (MPDDRC_MINFO7) 4-beat incrementing burst */ +#define MPDDRC_MINFO7_BURST_WRAP8 (0x4u << 16) /**< \brief (MPDDRC_MINFO7) 8-beat wrapping burst */ +#define MPDDRC_MINFO7_BURST_INCR8 (0x5u << 16) /**< \brief (MPDDRC_MINFO7) 8-beat incrementing burst */ +#define MPDDRC_MINFO7_BURST_WRAP16 (0x6u << 16) /**< \brief (MPDDRC_MINFO7) 16-beat wrapping burst */ +#define MPDDRC_MINFO7_BURST_INCR16 (0x7u << 16) /**< \brief (MPDDRC_MINFO7) 16-beat incrementing burst */ +#define MPDDRC_MINFO7_SIZE_Pos 20 +#define MPDDRC_MINFO7_SIZE_Msk (0x7u << MPDDRC_MINFO7_SIZE_Pos) /**< \brief (MPDDRC_MINFO7) Transfer Size on Port x [x =0..7] */ +#define MPDDRC_MINFO7_SIZE_8BITS (0x0u << 20) /**< \brief (MPDDRC_MINFO7) Byte transfer */ +#define MPDDRC_MINFO7_SIZE_16BITS (0x1u << 20) /**< \brief (MPDDRC_MINFO7) Halfword transfer */ +#define MPDDRC_MINFO7_SIZE_32BITS (0x2u << 20) /**< \brief (MPDDRC_MINFO7) Word transfer */ +#define MPDDRC_MINFO7_SIZE_64BITS (0x3u << 20) /**< \brief (MPDDRC_MINFO7) Dword transfer */ +#define MPDDRC_MINFO7_READ_WRITE (0x1u << 24) /**< \brief (MPDDRC_MINFO7) Read or Write Access on Port x [x =0..7] */ +#define MPDDRC_MINFO7_P7_NB_TRANSFERS_Pos 0 +#define MPDDRC_MINFO7_P7_NB_TRANSFERS_Msk (0xffffffffu << MPDDRC_MINFO7_P7_NB_TRANSFERS_Pos) /**< \brief (MPDDRC_MINFO7) Number of Transfers on Port x [x =0..7] */ +#define MPDDRC_MINFO7_P7_TOTAL_LATENCY_Pos 0 +#define MPDDRC_MINFO7_P7_TOTAL_LATENCY_Msk (0xffffffffu << MPDDRC_MINFO7_P7_TOTAL_LATENCY_Pos) /**< \brief (MPDDRC_MINFO7) Total Latency on Port x [x =0..7] */ +/* -------- MPDDRC_WPMR : (MPDDRC Offset: 0xE4) MPDDRC Write Protection Mode Register -------- */ +#define MPDDRC_WPMR_WPEN (0x1u << 0) /**< \brief (MPDDRC_WPMR) Write Protection Enable */ +#define MPDDRC_WPMR_WPKEY_Pos 8 +#define MPDDRC_WPMR_WPKEY_Msk (0xffffffu << MPDDRC_WPMR_WPKEY_Pos) /**< \brief (MPDDRC_WPMR) Write Protection Key */ +#define MPDDRC_WPMR_WPKEY(value) ((MPDDRC_WPMR_WPKEY_Msk & ((value) << MPDDRC_WPMR_WPKEY_Pos))) +#define MPDDRC_WPMR_WPKEY_PASSWD (0x444452u << 8) /**< \brief (MPDDRC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- MPDDRC_WPSR : (MPDDRC Offset: 0xE8) MPDDRC Write Protection Status Register -------- */ +#define MPDDRC_WPSR_WPVS (0x1u << 0) /**< \brief (MPDDRC_WPSR) Write Protection Enable */ +#define MPDDRC_WPSR_WPVSRC_Pos 8 +#define MPDDRC_WPSR_WPVSRC_Msk (0xffffu << MPDDRC_WPSR_WPVSRC_Pos) /**< \brief (MPDDRC_WPSR) Write Protection Violation Source */ +/* -------- MPDDRC_VERSION : (MPDDRC Offset: 0xFC) MPDDRC Version Register -------- */ +#define MPDDRC_VERSION_VERSION_Pos 0 +#define MPDDRC_VERSION_VERSION_Msk (0xffffu << MPDDRC_VERSION_VERSION_Pos) /**< \brief (MPDDRC_VERSION) Version of the Hardware Module */ +#define MPDDRC_VERSION_MFN_Pos 16 +#define MPDDRC_VERSION_MFN_Msk (0xfu << MPDDRC_VERSION_MFN_Pos) /**< \brief (MPDDRC_VERSION) Metal Fix Number */ +/* -------- MPDDRC_DLL_OS : (MPDDRC Offset: 0x100) MPDDRC DLL Offset Selection Register -------- */ +#define MPDDRC_DLL_OS_SELOFF (0x1u << 0) /**< \brief (MPDDRC_DLL_OS) Offset Selection */ +/* -------- MPDDRC_DLL_MAO : (MPDDRC Offset: 0x104) MPDDRC DLL MASTER Offset Register -------- */ +#define MPDDRC_DLL_MAO_MAOFF_Pos 0 +#define MPDDRC_DLL_MAO_MAOFF_Msk (0xffu << MPDDRC_DLL_MAO_MAOFF_Pos) /**< \brief (MPDDRC_DLL_MAO) Master Delay Line Offset */ +#define MPDDRC_DLL_MAO_MAOFF(value) ((MPDDRC_DLL_MAO_MAOFF_Msk & ((value) << MPDDRC_DLL_MAO_MAOFF_Pos))) +/* -------- MPDDRC_DLL_SO0 : (MPDDRC Offset: 0x108) MPDDRC DLL SLAVE Offset 0 Register -------- */ +#define MPDDRC_DLL_SO0_S0OFF_Pos 0 +#define MPDDRC_DLL_SO0_S0OFF_Msk (0xffu << MPDDRC_DLL_SO0_S0OFF_Pos) /**< \brief (MPDDRC_DLL_SO0) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO0_S0OFF(value) ((MPDDRC_DLL_SO0_S0OFF_Msk & ((value) << MPDDRC_DLL_SO0_S0OFF_Pos))) +#define MPDDRC_DLL_SO0_S1OFF_Pos 8 +#define MPDDRC_DLL_SO0_S1OFF_Msk (0xffu << MPDDRC_DLL_SO0_S1OFF_Pos) /**< \brief (MPDDRC_DLL_SO0) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO0_S1OFF(value) ((MPDDRC_DLL_SO0_S1OFF_Msk & ((value) << MPDDRC_DLL_SO0_S1OFF_Pos))) +#define MPDDRC_DLL_SO0_S2OFF_Pos 16 +#define MPDDRC_DLL_SO0_S2OFF_Msk (0xffu << MPDDRC_DLL_SO0_S2OFF_Pos) /**< \brief (MPDDRC_DLL_SO0) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO0_S2OFF(value) ((MPDDRC_DLL_SO0_S2OFF_Msk & ((value) << MPDDRC_DLL_SO0_S2OFF_Pos))) +#define MPDDRC_DLL_SO0_S3OFF_Pos 24 +#define MPDDRC_DLL_SO0_S3OFF_Msk (0xffu << MPDDRC_DLL_SO0_S3OFF_Pos) /**< \brief (MPDDRC_DLL_SO0) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO0_S3OFF(value) ((MPDDRC_DLL_SO0_S3OFF_Msk & ((value) << MPDDRC_DLL_SO0_S3OFF_Pos))) +/* -------- MPDDRC_DLL_SO1 : (MPDDRC Offset: 0x10C) MPDDRC DLL SLAVE Offset 1 Register -------- */ +#define MPDDRC_DLL_SO1_S4OFF_Pos 0 +#define MPDDRC_DLL_SO1_S4OFF_Msk (0xffu << MPDDRC_DLL_SO1_S4OFF_Pos) /**< \brief (MPDDRC_DLL_SO1) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO1_S4OFF(value) ((MPDDRC_DLL_SO1_S4OFF_Msk & ((value) << MPDDRC_DLL_SO1_S4OFF_Pos))) +#define MPDDRC_DLL_SO1_S5OFF_Pos 8 +#define MPDDRC_DLL_SO1_S5OFF_Msk (0xffu << MPDDRC_DLL_SO1_S5OFF_Pos) /**< \brief (MPDDRC_DLL_SO1) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO1_S5OFF(value) ((MPDDRC_DLL_SO1_S5OFF_Msk & ((value) << MPDDRC_DLL_SO1_S5OFF_Pos))) +#define MPDDRC_DLL_SO1_S6OFF_Pos 16 +#define MPDDRC_DLL_SO1_S6OFF_Msk (0xffu << MPDDRC_DLL_SO1_S6OFF_Pos) /**< \brief (MPDDRC_DLL_SO1) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO1_S6OFF(value) ((MPDDRC_DLL_SO1_S6OFF_Msk & ((value) << MPDDRC_DLL_SO1_S6OFF_Pos))) +#define MPDDRC_DLL_SO1_S7OFF_Pos 24 +#define MPDDRC_DLL_SO1_S7OFF_Msk (0xffu << MPDDRC_DLL_SO1_S7OFF_Pos) /**< \brief (MPDDRC_DLL_SO1) SLAVEx Delay Line Offset */ +#define MPDDRC_DLL_SO1_S7OFF(value) ((MPDDRC_DLL_SO1_S7OFF_Msk & ((value) << MPDDRC_DLL_SO1_S7OFF_Pos))) +/* -------- MPDDRC_DLL_WRO : (MPDDRC Offset: 0x110) MPDDRC DLL CLKWR Offset Register -------- */ +#define MPDDRC_DLL_WRO_WR0OFF_Pos 0 +#define MPDDRC_DLL_WRO_WR0OFF_Msk (0xffu << MPDDRC_DLL_WRO_WR0OFF_Pos) /**< \brief (MPDDRC_DLL_WRO) CLKWRx Delay Line Offset */ +#define MPDDRC_DLL_WRO_WR0OFF(value) ((MPDDRC_DLL_WRO_WR0OFF_Msk & ((value) << MPDDRC_DLL_WRO_WR0OFF_Pos))) +#define MPDDRC_DLL_WRO_WR1OFF_Pos 8 +#define MPDDRC_DLL_WRO_WR1OFF_Msk (0xffu << MPDDRC_DLL_WRO_WR1OFF_Pos) /**< \brief (MPDDRC_DLL_WRO) CLKWRx Delay Line Offset */ +#define MPDDRC_DLL_WRO_WR1OFF(value) ((MPDDRC_DLL_WRO_WR1OFF_Msk & ((value) << MPDDRC_DLL_WRO_WR1OFF_Pos))) +#define MPDDRC_DLL_WRO_WR2OFF_Pos 16 +#define MPDDRC_DLL_WRO_WR2OFF_Msk (0xffu << MPDDRC_DLL_WRO_WR2OFF_Pos) /**< \brief (MPDDRC_DLL_WRO) CLKWRx Delay Line Offset */ +#define MPDDRC_DLL_WRO_WR2OFF(value) ((MPDDRC_DLL_WRO_WR2OFF_Msk & ((value) << MPDDRC_DLL_WRO_WR2OFF_Pos))) +#define MPDDRC_DLL_WRO_WR3OFF_Pos 24 +#define MPDDRC_DLL_WRO_WR3OFF_Msk (0xffu << MPDDRC_DLL_WRO_WR3OFF_Pos) /**< \brief (MPDDRC_DLL_WRO) CLKWRx Delay Line Offset */ +#define MPDDRC_DLL_WRO_WR3OFF(value) ((MPDDRC_DLL_WRO_WR3OFF_Msk & ((value) << MPDDRC_DLL_WRO_WR3OFF_Pos))) +/* -------- MPDDRC_DLL_ADO : (MPDDRC Offset: 0x114) MPDDRC DLL CLKAD Offset Register -------- */ +#define MPDDRC_DLL_ADO_ADOFF_Pos 0 +#define MPDDRC_DLL_ADO_ADOFF_Msk (0xffu << MPDDRC_DLL_ADO_ADOFF_Pos) /**< \brief (MPDDRC_DLL_ADO) CLKAD Delay Line Offset */ +#define MPDDRC_DLL_ADO_ADOFF(value) ((MPDDRC_DLL_ADO_ADOFF_Msk & ((value) << MPDDRC_DLL_ADO_ADOFF_Pos))) +/* -------- MPDDRC_DLL_SM[4] : (MPDDRC Offset: 0x118) MPDDRC DLL Status MASTER0 Register -------- */ +#define MPDDRC_DLL_SM_MDINC (0x1u << 0) /**< \brief (MPDDRC_DLL_SM[4]) MASTERx Delay Increment */ +#define MPDDRC_DLL_SM_MDDEC (0x1u << 1) /**< \brief (MPDDRC_DLL_SM[4]) MASTERx Delay Decrement */ +#define MPDDRC_DLL_SM_MDOVF (0x1u << 2) /**< \brief (MPDDRC_DLL_SM[4]) MASTERx Delay Overflow Flag */ +#define MPDDRC_DLL_SM_MDLVAL_Pos 8 +#define MPDDRC_DLL_SM_MDLVAL_Msk (0xffu << MPDDRC_DLL_SM_MDLVAL_Pos) /**< \brief (MPDDRC_DLL_SM[4]) MASTERx Delay Lock Value */ +#define MPDDRC_DLL_SM_MDCNT_Pos 20 +#define MPDDRC_DLL_SM_MDCNT_Msk (0xffu << MPDDRC_DLL_SM_MDCNT_Pos) /**< \brief (MPDDRC_DLL_SM[4]) MASTERx Delay Counter Value */ +/* -------- MPDDRC_DLL_SSL[8] : (MPDDRC Offset: 0x128) MPDDRC DLL Status SLAVE0 Register -------- */ +#define MPDDRC_DLL_SSL_SDCOVF (0x1u << 0) /**< \brief (MPDDRC_DLL_SSL[8]) SLAVEx Delay Correction Overflow Flag */ +#define MPDDRC_DLL_SSL_SDCUDF (0x1u << 1) /**< \brief (MPDDRC_DLL_SSL[8]) SLAVEx Delay Correction Underflow Flag */ +#define MPDDRC_DLL_SSL_SDERF (0x1u << 2) /**< \brief (MPDDRC_DLL_SSL[8]) SLAVEx Delay Correction Error Flag */ +#define MPDDRC_DLL_SSL_SDCNT_Pos 8 +#define MPDDRC_DLL_SSL_SDCNT_Msk (0xffu << MPDDRC_DLL_SSL_SDCNT_Pos) /**< \brief (MPDDRC_DLL_SSL[8]) SLAVEx Delay Counter Value */ +#define MPDDRC_DLL_SSL_SDCVAL_Pos 20 +#define MPDDRC_DLL_SSL_SDCVAL_Msk (0xffu << MPDDRC_DLL_SSL_SDCVAL_Pos) /**< \brief (MPDDRC_DLL_SSL[8]) SLAVEx Delay Correction Value */ +/* -------- MPDDRC_DLL_SWR[4] : (MPDDRC Offset: 0x148) MPDDRC DLL Status CLKWR0 Register -------- */ +#define MPDDRC_DLL_SWR_WRDCNT_Pos 0 +#define MPDDRC_DLL_SWR_WRDCNT_Msk (0xffu << MPDDRC_DLL_SWR_WRDCNT_Pos) /**< \brief (MPDDRC_DLL_SWR[4]) CLKWRx Delay Counter Value */ +/* -------- MPDDRC_DLL_SAD : (MPDDRC Offset: 0x158) MPDDRC DLL Status CLKAD Register -------- */ +#define MPDDRC_DLL_SAD_ADDCNT_Pos 0 +#define MPDDRC_DLL_SAD_ADDCNT_Msk (0xffu << MPDDRC_DLL_SAD_ADDCNT_Pos) /**< \brief (MPDDRC_DLL_SAD) CLKAD Delay Counter Value */ + +/*@}*/ + + +#endif /* _SAMA5D2_MPDDRC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pdmic.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pdmic.h new file mode 100644 index 000000000..954ca8bb4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pdmic.h @@ -0,0 +1,125 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_PDMIC_COMPONENT_ +#define _SAMA5D2_PDMIC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Pulse Density Modulation Interface Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_PDMIC Pulse Density Modulation Interface Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Pdmic hardware registers */ +typedef struct { + __IO uint32_t PDMIC_CR; /**< \brief (Pdmic Offset: 0x00) Control Register */ + __IO uint32_t PDMIC_MR; /**< \brief (Pdmic Offset: 0x04) Mode Register */ + __I uint32_t Reserved1[3]; + __I uint32_t PDMIC_CDR; /**< \brief (Pdmic Offset: 0x14) Converted Data Register */ + __O uint32_t PDMIC_IER; /**< \brief (Pdmic Offset: 0x18) Interrupt Enable Register */ + __O uint32_t PDMIC_IDR; /**< \brief (Pdmic Offset: 0x1C) Interrupt Disable Register */ + __I uint32_t PDMIC_IMR; /**< \brief (Pdmic Offset: 0x20) Interrupt Mask Register */ + __I uint32_t PDMIC_ISR; /**< \brief (Pdmic Offset: 0x24) Interrupt Status Register */ + __I uint32_t Reserved2[12]; + __IO uint32_t PDMIC_DSPR0; /**< \brief (Pdmic Offset: 0x58) DSP Configuration Register 0 */ + __IO uint32_t PDMIC_DSPR1; /**< \brief (Pdmic Offset: 0x5C) DSP Configuration Register 1 */ + __I uint32_t Reserved3[33]; + __IO uint32_t PDMIC_WPMR; /**< \brief (Pdmic Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t PDMIC_WPSR; /**< \brief (Pdmic Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved4[4]; + __I uint32_t PDMIC_VERSION; /**< \brief (Pdmic Offset: 0xFC) Version Register */ +} Pdmic; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- PDMIC_CR : (PDMIC Offset: 0x00) Control Register -------- */ +#define PDMIC_CR_SWRST (0x1u << 0) /**< \brief (PDMIC_CR) Software Reset */ +#define PDMIC_CR_ENPDM (0x1u << 4) /**< \brief (PDMIC_CR) Enable PDM */ +/* -------- PDMIC_MR : (PDMIC Offset: 0x04) Mode Register -------- */ +#define PDMIC_MR_PRESCAL_Pos 8 +#define PDMIC_MR_PRESCAL_Msk (0x7fu << PDMIC_MR_PRESCAL_Pos) /**< \brief (PDMIC_MR) Prescaler Rate Selection */ +#define PDMIC_MR_PRESCAL(value) ((PDMIC_MR_PRESCAL_Msk & ((value) << PDMIC_MR_PRESCAL_Pos))) +/* -------- PDMIC_CDR : (PDMIC Offset: 0x14) Converted Data Register -------- */ +#define PDMIC_CDR_DATA_Pos 0 +#define PDMIC_CDR_DATA_Msk (0xffffffffu << PDMIC_CDR_DATA_Pos) /**< \brief (PDMIC_CDR) Data Converted */ +/* -------- PDMIC_IER : (PDMIC Offset: 0x18) Interrupt Enable Register -------- */ +#define PDMIC_IER_DRDY (0x1u << 24) /**< \brief (PDMIC_IER) Data Ready Interrupt Enable */ +#define PDMIC_IER_OVRE (0x1u << 25) /**< \brief (PDMIC_IER) Overrun Error Interrupt Enable */ +/* -------- PDMIC_IDR : (PDMIC Offset: 0x1C) Interrupt Disable Register -------- */ +#define PDMIC_IDR_DRDY (0x1u << 24) /**< \brief (PDMIC_IDR) Data Ready Interrupt Disable */ +#define PDMIC_IDR_OVRE (0x1u << 25) /**< \brief (PDMIC_IDR) General Overrun Error Interrupt Disable */ +/* -------- PDMIC_IMR : (PDMIC Offset: 0x20) Interrupt Mask Register -------- */ +#define PDMIC_IMR_DRDY (0x1u << 24) /**< \brief (PDMIC_IMR) Data Ready Interrupt Mask */ +#define PDMIC_IMR_OVRE (0x1u << 25) /**< \brief (PDMIC_IMR) General Overrun Error Interrupt Mask */ +/* -------- PDMIC_ISR : (PDMIC Offset: 0x24) Interrupt Status Register -------- */ +#define PDMIC_ISR_FIFOCNT_Pos 16 +#define PDMIC_ISR_FIFOCNT_Msk (0xffu << PDMIC_ISR_FIFOCNT_Pos) /**< \brief (PDMIC_ISR) FIFO Count */ +#define PDMIC_ISR_DRDY (0x1u << 24) /**< \brief (PDMIC_ISR) Data Ready (cleared by reading PDMIC_CDR) */ +#define PDMIC_ISR_OVRE (0x1u << 25) /**< \brief (PDMIC_ISR) Overrun Error (cleared on read) */ +/* -------- PDMIC_DSPR0 : (PDMIC Offset: 0x58) DSP Configuration Register 0 -------- */ +#define PDMIC_DSPR0_HPFBYP (0x1u << 1) /**< \brief (PDMIC_DSPR0) High-Pass Filter Bypass */ +#define PDMIC_DSPR0_SINBYP (0x1u << 2) /**< \brief (PDMIC_DSPR0) SINCC Filter Bypass */ +#define PDMIC_DSPR0_SIZE (0x1u << 3) /**< \brief (PDMIC_DSPR0) Data Size */ +#define PDMIC_DSPR0_OSR_Pos 4 +#define PDMIC_DSPR0_OSR_Msk (0x7u << PDMIC_DSPR0_OSR_Pos) /**< \brief (PDMIC_DSPR0) Oversampling Ratio */ +#define PDMIC_DSPR0_OSR(value) ((PDMIC_DSPR0_OSR_Msk & ((value) << PDMIC_DSPR0_OSR_Pos))) +#define PDMIC_DSPR0_OSR_128 (0x0u << 4) /**< \brief (PDMIC_DSPR0) Oversampling ratio is 128 */ +#define PDMIC_DSPR0_OSR_64 (0x1u << 4) /**< \brief (PDMIC_DSPR0) Oversampling ratio is 64 */ +#define PDMIC_DSPR0_SCALE_Pos 8 +#define PDMIC_DSPR0_SCALE_Msk (0xfu << PDMIC_DSPR0_SCALE_Pos) /**< \brief (PDMIC_DSPR0) Data Scale */ +#define PDMIC_DSPR0_SCALE(value) ((PDMIC_DSPR0_SCALE_Msk & ((value) << PDMIC_DSPR0_SCALE_Pos))) +#define PDMIC_DSPR0_SHIFT_Pos 12 +#define PDMIC_DSPR0_SHIFT_Msk (0xfu << PDMIC_DSPR0_SHIFT_Pos) /**< \brief (PDMIC_DSPR0) Data Shift */ +#define PDMIC_DSPR0_SHIFT(value) ((PDMIC_DSPR0_SHIFT_Msk & ((value) << PDMIC_DSPR0_SHIFT_Pos))) +/* -------- PDMIC_DSPR1 : (PDMIC Offset: 0x5C) DSP Configuration Register 1 -------- */ +#define PDMIC_DSPR1_DGAIN_Pos 0 +#define PDMIC_DSPR1_DGAIN_Msk (0x7fffu << PDMIC_DSPR1_DGAIN_Pos) /**< \brief (PDMIC_DSPR1) Gain Correction */ +#define PDMIC_DSPR1_DGAIN(value) ((PDMIC_DSPR1_DGAIN_Msk & ((value) << PDMIC_DSPR1_DGAIN_Pos))) +#define PDMIC_DSPR1_OFFSET_Pos 16 +#define PDMIC_DSPR1_OFFSET_Msk (0xffffu << PDMIC_DSPR1_OFFSET_Pos) /**< \brief (PDMIC_DSPR1) Offset Correction */ +#define PDMIC_DSPR1_OFFSET(value) ((PDMIC_DSPR1_OFFSET_Msk & ((value) << PDMIC_DSPR1_OFFSET_Pos))) +/* -------- PDMIC_WPMR : (PDMIC Offset: 0xE4) Write Protection Mode Register -------- */ +#define PDMIC_WPMR_WPEN (0x1u << 0) /**< \brief (PDMIC_WPMR) Write Protection Enable */ +#define PDMIC_WPMR_WPKEY_Pos 8 +#define PDMIC_WPMR_WPKEY_Msk (0xffffffu << PDMIC_WPMR_WPKEY_Pos) /**< \brief (PDMIC_WPMR) Write Protection Key */ +#define PDMIC_WPMR_WPKEY(value) ((PDMIC_WPMR_WPKEY_Msk & ((value) << PDMIC_WPMR_WPKEY_Pos))) +#define PDMIC_WPMR_WPKEY_PASSWD (0x414443u << 8) /**< \brief (PDMIC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- PDMIC_WPSR : (PDMIC Offset: 0xE8) Write Protection Status Register -------- */ +#define PDMIC_WPSR_WPVS (0x1u << 0) /**< \brief (PDMIC_WPSR) Write Protection Violation Status */ +#define PDMIC_WPSR_WPVSRC_Pos 8 +#define PDMIC_WPSR_WPVSRC_Msk (0xffffu << PDMIC_WPSR_WPVSRC_Pos) /**< \brief (PDMIC_WPSR) Write Protection Violation Source */ +/* -------- PDMIC_VERSION : (PDMIC Offset: 0xFC) Version Register -------- */ +#define PDMIC_VERSION_VERSION_Pos 0 +#define PDMIC_VERSION_VERSION_Msk (0xfffu << PDMIC_VERSION_VERSION_Pos) /**< \brief (PDMIC_VERSION) Version of the Hardware Module */ +#define PDMIC_VERSION_MFN_Pos 16 +#define PDMIC_VERSION_MFN_Msk (0x7u << PDMIC_VERSION_MFN_Pos) /**< \brief (PDMIC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_PDMIC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pio.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pio.h new file mode 100644 index 000000000..77dc0d0cc --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pio.h @@ -0,0 +1,1161 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_PIO_COMPONENT_ +#define _SAMA5D2_PIO_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Parallel Input/Output Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_PIO Parallel Input/Output Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief PioIo_group hardware registers */ +typedef struct { + __IO uint32_t PIO_MSKR; /**< \brief (PioIo_group Offset: 0x0) PIO Mask Register */ + __IO uint32_t PIO_CFGR; /**< \brief (PioIo_group Offset: 0x4) PIO Configuration Register */ + __I uint32_t PIO_PDSR; /**< \brief (PioIo_group Offset: 0x8) PIO Pin Data Status Register */ + __I uint32_t PIO_LOCKSR; /**< \brief (PioIo_group Offset: 0xC) PIO Lock Status Register */ + __O uint32_t PIO_SODR; /**< \brief (PioIo_group Offset: 0x10) PIO Set Output Data Register */ + __O uint32_t PIO_CODR; /**< \brief (PioIo_group Offset: 0x14) PIO Clear Output Data Register */ + __IO uint32_t PIO_ODSR; /**< \brief (PioIo_group Offset: 0x18) PIO Output Data Status Register */ + __I uint32_t Reserved1[1]; + __O uint32_t PIO_IER; /**< \brief (PioIo_group Offset: 0x20) PIO Interrupt Enable Register */ + __O uint32_t PIO_IDR; /**< \brief (PioIo_group Offset: 0x24) PIO Interrupt Disable Register */ + __I uint32_t PIO_IMR; /**< \brief (PioIo_group Offset: 0x28) PIO Interrupt Mask Register */ + __I uint32_t PIO_ISR; /**< \brief (PioIo_group Offset: 0x2C) PIO Interrupt Status Register */ + __I uint32_t Reserved2[3]; + __O uint32_t PIO_IOFR; /**< \brief (PioIo_group Offset: 0x3C) PIO I/O Freeze Register */ +} PioIo_group; +/** \brief PioPio_ hardware registers */ +typedef struct { + __IO uint32_t S_PIO_MSKR; /**< \brief (PioPio_ Offset: 0x0) Secure PIO Mask Register */ + __IO uint32_t S_PIO_CFGR; /**< \brief (PioPio_ Offset: 0x4) Secure PIO Configuration Register */ + __I uint32_t S_PIO_PDSR; /**< \brief (PioPio_ Offset: 0x8) Secure PIO Pin Data Status Register */ + __I uint32_t S_PIO_LOCKSR; /**< \brief (PioPio_ Offset: 0xC) Secure PIO Lock Status Register */ + __O uint32_t S_PIO_SODR; /**< \brief (PioPio_ Offset: 0x10) Secure PIO Set Output Data Register */ + __O uint32_t S_PIO_CODR; /**< \brief (PioPio_ Offset: 0x14) Secure PIO Clear Output Data Register */ + __IO uint32_t S_PIO_ODSR; /**< \brief (PioPio_ Offset: 0x18) Secure PIO Output Data Status Register */ + __I uint32_t Reserved3[1]; + __O uint32_t S_PIO_IER; /**< \brief (PioPio_ Offset: 0x20) Secure PIO Interrupt Enable Register */ + __O uint32_t S_PIO_IDR; /**< \brief (PioPio_ Offset: 0x24) Secure PIO Interrupt Disable Register */ + __I uint32_t S_PIO_IMR; /**< \brief (PioPio_ Offset: 0x28) Secure PIO Interrupt Mask Register */ + __I uint32_t S_PIO_ISR; /**< \brief (PioPio_ Offset: 0x2C) Secure PIO Interrupt Status Register */ + __O uint32_t S_PIO_SIONR; /**< \brief (PioPio_ Offset: 0x30) Secure PIO Set I/O Non-Secure Register */ + __O uint32_t S_PIO_SIOSR; /**< \brief (PioPio_ Offset: 0x34) Secure PIO Set I/O Secure Register */ + __I uint32_t S_PIO_IOSSR; /**< \brief (PioPio_ Offset: 0x38) Secure PIO I/O Security Status Register */ + __O uint32_t S_PIO_IOFR; /**< \brief (PioPio_ Offset: 0x3C) Secure PIO I/O Freeze Register */ +} PioPio_; +/** \brief Pio hardware registers */ +#define PIOIO_GROUP_NUMBER 4 +#define PIOPIO__NUMBER 4 +typedef struct { + PioIo_group PIO_IO_GROUP[PIOIO_GROUP_NUMBER]; /**< \brief (Pio Offset: 0x0) io_group = 0 .. 3 */ + __I uint32_t Reserved1[312]; + __IO uint32_t PIO_WPMR; /**< \brief (Pio Offset: 0x5E0) PIO Write Protection Mode Register */ + __I uint32_t PIO_WPSR; /**< \brief (Pio Offset: 0x5E4) PIO Write Protection Status Register */ + __I uint32_t Reserved2[5]; + __I uint32_t PIO_VERSION; /**< \brief (Pio Offset: 0x5FC) Version Register */ + __I uint32_t Reserved3[640]; + PioPio_ PIO_PIO_[PIOPIO__NUMBER]; /**< \brief (Pio Offset: 0x1000) io_group = 0 .. 3 */ + __I uint32_t Reserved4[256]; + __IO uint32_t S_PIO_SCDR; /**< \brief (Pio Offset: 0x1500) Secure PIO Slow Clock Divider Debouncing Register */ + __I uint32_t Reserved5[55]; + __IO uint32_t S_PIO_WPMR; /**< \brief (Pio Offset: 0x15E0) Secure PIO Write Protection Mode Register */ + __I uint32_t S_PIO_WPSR; /**< \brief (Pio Offset: 0x15E4) Secure PIO Write Protection Status Register */ +} Pio; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- PIO_MSKR : (PIO Offset: N/A) PIO Mask Register -------- */ +#define PIO_MSKR_MSK0 (0x1u << 0) /**< \brief (PIO_MSKR) PIO Line 0 Mask */ +#define PIO_MSKR_MSK0_DISABLED (0x0u << 0) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK0_ENABLED (0x1u << 0) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK1 (0x1u << 1) /**< \brief (PIO_MSKR) PIO Line 1 Mask */ +#define PIO_MSKR_MSK1_DISABLED (0x0u << 1) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK1_ENABLED (0x1u << 1) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK2 (0x1u << 2) /**< \brief (PIO_MSKR) PIO Line 2 Mask */ +#define PIO_MSKR_MSK2_DISABLED (0x0u << 2) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK2_ENABLED (0x1u << 2) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK3 (0x1u << 3) /**< \brief (PIO_MSKR) PIO Line 3 Mask */ +#define PIO_MSKR_MSK3_DISABLED (0x0u << 3) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK3_ENABLED (0x1u << 3) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK4 (0x1u << 4) /**< \brief (PIO_MSKR) PIO Line 4 Mask */ +#define PIO_MSKR_MSK4_DISABLED (0x0u << 4) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK4_ENABLED (0x1u << 4) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK5 (0x1u << 5) /**< \brief (PIO_MSKR) PIO Line 5 Mask */ +#define PIO_MSKR_MSK5_DISABLED (0x0u << 5) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK5_ENABLED (0x1u << 5) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK6 (0x1u << 6) /**< \brief (PIO_MSKR) PIO Line 6 Mask */ +#define PIO_MSKR_MSK6_DISABLED (0x0u << 6) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK6_ENABLED (0x1u << 6) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK7 (0x1u << 7) /**< \brief (PIO_MSKR) PIO Line 7 Mask */ +#define PIO_MSKR_MSK7_DISABLED (0x0u << 7) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK7_ENABLED (0x1u << 7) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK8 (0x1u << 8) /**< \brief (PIO_MSKR) PIO Line 8 Mask */ +#define PIO_MSKR_MSK8_DISABLED (0x0u << 8) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK8_ENABLED (0x1u << 8) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK9 (0x1u << 9) /**< \brief (PIO_MSKR) PIO Line 9 Mask */ +#define PIO_MSKR_MSK9_DISABLED (0x0u << 9) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK9_ENABLED (0x1u << 9) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK10 (0x1u << 10) /**< \brief (PIO_MSKR) PIO Line 10 Mask */ +#define PIO_MSKR_MSK10_DISABLED (0x0u << 10) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK10_ENABLED (0x1u << 10) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK11 (0x1u << 11) /**< \brief (PIO_MSKR) PIO Line 11 Mask */ +#define PIO_MSKR_MSK11_DISABLED (0x0u << 11) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK11_ENABLED (0x1u << 11) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK12 (0x1u << 12) /**< \brief (PIO_MSKR) PIO Line 12 Mask */ +#define PIO_MSKR_MSK12_DISABLED (0x0u << 12) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK12_ENABLED (0x1u << 12) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK13 (0x1u << 13) /**< \brief (PIO_MSKR) PIO Line 13 Mask */ +#define PIO_MSKR_MSK13_DISABLED (0x0u << 13) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK13_ENABLED (0x1u << 13) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK14 (0x1u << 14) /**< \brief (PIO_MSKR) PIO Line 14 Mask */ +#define PIO_MSKR_MSK14_DISABLED (0x0u << 14) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK14_ENABLED (0x1u << 14) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK15 (0x1u << 15) /**< \brief (PIO_MSKR) PIO Line 15 Mask */ +#define PIO_MSKR_MSK15_DISABLED (0x0u << 15) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK15_ENABLED (0x1u << 15) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK16 (0x1u << 16) /**< \brief (PIO_MSKR) PIO Line 16 Mask */ +#define PIO_MSKR_MSK16_DISABLED (0x0u << 16) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK16_ENABLED (0x1u << 16) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK17 (0x1u << 17) /**< \brief (PIO_MSKR) PIO Line 17 Mask */ +#define PIO_MSKR_MSK17_DISABLED (0x0u << 17) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK17_ENABLED (0x1u << 17) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK18 (0x1u << 18) /**< \brief (PIO_MSKR) PIO Line 18 Mask */ +#define PIO_MSKR_MSK18_DISABLED (0x0u << 18) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK18_ENABLED (0x1u << 18) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK19 (0x1u << 19) /**< \brief (PIO_MSKR) PIO Line 19 Mask */ +#define PIO_MSKR_MSK19_DISABLED (0x0u << 19) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK19_ENABLED (0x1u << 19) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK20 (0x1u << 20) /**< \brief (PIO_MSKR) PIO Line 20 Mask */ +#define PIO_MSKR_MSK20_DISABLED (0x0u << 20) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK20_ENABLED (0x1u << 20) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK21 (0x1u << 21) /**< \brief (PIO_MSKR) PIO Line 21 Mask */ +#define PIO_MSKR_MSK21_DISABLED (0x0u << 21) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK21_ENABLED (0x1u << 21) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK22 (0x1u << 22) /**< \brief (PIO_MSKR) PIO Line 22 Mask */ +#define PIO_MSKR_MSK22_DISABLED (0x0u << 22) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK22_ENABLED (0x1u << 22) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK23 (0x1u << 23) /**< \brief (PIO_MSKR) PIO Line 23 Mask */ +#define PIO_MSKR_MSK23_DISABLED (0x0u << 23) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK23_ENABLED (0x1u << 23) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK24 (0x1u << 24) /**< \brief (PIO_MSKR) PIO Line 24 Mask */ +#define PIO_MSKR_MSK24_DISABLED (0x0u << 24) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK24_ENABLED (0x1u << 24) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK25 (0x1u << 25) /**< \brief (PIO_MSKR) PIO Line 25 Mask */ +#define PIO_MSKR_MSK25_DISABLED (0x0u << 25) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK25_ENABLED (0x1u << 25) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK26 (0x1u << 26) /**< \brief (PIO_MSKR) PIO Line 26 Mask */ +#define PIO_MSKR_MSK26_DISABLED (0x0u << 26) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK26_ENABLED (0x1u << 26) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK27 (0x1u << 27) /**< \brief (PIO_MSKR) PIO Line 27 Mask */ +#define PIO_MSKR_MSK27_DISABLED (0x0u << 27) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK27_ENABLED (0x1u << 27) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK28 (0x1u << 28) /**< \brief (PIO_MSKR) PIO Line 28 Mask */ +#define PIO_MSKR_MSK28_DISABLED (0x0u << 28) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK28_ENABLED (0x1u << 28) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK29 (0x1u << 29) /**< \brief (PIO_MSKR) PIO Line 29 Mask */ +#define PIO_MSKR_MSK29_DISABLED (0x0u << 29) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK29_ENABLED (0x1u << 29) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK30 (0x1u << 30) /**< \brief (PIO_MSKR) PIO Line 30 Mask */ +#define PIO_MSKR_MSK30_DISABLED (0x0u << 30) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK30_ENABLED (0x1u << 30) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK31 (0x1u << 31) /**< \brief (PIO_MSKR) PIO Line 31 Mask */ +#define PIO_MSKR_MSK31_DISABLED (0x0u << 31) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define PIO_MSKR_MSK31_ENABLED (0x1u << 31) /**< \brief (PIO_MSKR) Writing the PIO_CFGRx, PIO_ODSRx or PIO_IOFRx updates the corresponding I/O line configuration. */ +/* -------- PIO_CFGR : (PIO Offset: N/A) PIO Configuration Register -------- */ +#define PIO_CFGR_FUNC_Pos 0 +#define PIO_CFGR_FUNC_Msk (0x7u << PIO_CFGR_FUNC_Pos) /**< \brief (PIO_CFGR) I/O Line Function */ +#define PIO_CFGR_FUNC(value) ((PIO_CFGR_FUNC_Msk & ((value) << PIO_CFGR_FUNC_Pos))) +#define PIO_CFGR_FUNC_GPIO (0x0u << 0) /**< \brief (PIO_CFGR) Select the PIO mode for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_A (0x1u << 0) /**< \brief (PIO_CFGR) Select the peripheral A for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_B (0x2u << 0) /**< \brief (PIO_CFGR) Select the peripheral B for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_C (0x3u << 0) /**< \brief (PIO_CFGR) Select the peripheral C for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_D (0x4u << 0) /**< \brief (PIO_CFGR) Select the peripheral D for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_E (0x5u << 0) /**< \brief (PIO_CFGR) Select the peripheral E for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_F (0x6u << 0) /**< \brief (PIO_CFGR) Select the peripheral F for the selected I/O lines. */ +#define PIO_CFGR_FUNC_PERIPH_G (0x7u << 0) /**< \brief (PIO_CFGR) Select the peripheral G for the selected I/O lines. */ +#define PIO_CFGR_DIR (0x1u << 8) /**< \brief (PIO_CFGR) Direction */ +#define PIO_CFGR_DIR_INPUT (0x0u << 8) /**< \brief (PIO_CFGR) The selected I/O lines are pure inputs. */ +#define PIO_CFGR_DIR_OUTPUT (0x1u << 8) /**< \brief (PIO_CFGR) The selected I/O lines are enabled in output. */ +#define PIO_CFGR_PUEN (0x1u << 9) /**< \brief (PIO_CFGR) Pull-Up Enable */ +#define PIO_CFGR_PUEN_DISABLED (0x0u << 9) /**< \brief (PIO_CFGR) Pull-Up is disabled for the selected I/O lines. */ +#define PIO_CFGR_PUEN_ENABLED (0x1u << 9) /**< \brief (PIO_CFGR) Pull-Up is enabled for the selected I/O lines. */ +#define PIO_CFGR_PDEN (0x1u << 10) /**< \brief (PIO_CFGR) Pull-Down Enable */ +#define PIO_CFGR_PDEN_DISABLED (0x0u << 10) /**< \brief (PIO_CFGR) Pull-Down is disabled for the selected I/O lines. */ +#define PIO_CFGR_PDEN_ENABLED (0x1u << 10) /**< \brief (PIO_CFGR) Pull-Down is enabled for the selected I/O lines only if PUEN is 0(1). */ +#define PIO_CFGR_IFEN (0x1u << 12) /**< \brief (PIO_CFGR) Input Filter Enable */ +#define PIO_CFGR_IFEN_DISABLED (0x0u << 12) /**< \brief (PIO_CFGR) The input filter is disabled for the selected I/O lines. */ +#define PIO_CFGR_IFEN_ENABLED (0x1u << 12) /**< \brief (PIO_CFGR) The input filter is enabled for the selected I/O lines. */ +#define PIO_CFGR_IFSCEN (0x1u << 13) /**< \brief (PIO_CFGR) Input Filter Slow Clock Enable */ +#define PIO_CFGR_IFSCEN_DISABLED (0x0u << 13) /**< \brief (PIO_CFGR) The glitch filter is able to filter glitches with a duration < tmck/2 for the selected I/O lines. */ +#define PIO_CFGR_IFSCEN_ENABLED (0x1u << 13) /**< \brief (PIO_CFGR) The debouncing filter is able to filter pulses with a duration < tdiv_slck/2 for the selected I/O lines. */ +#define PIO_CFGR_OPD (0x1u << 14) /**< \brief (PIO_CFGR) Open-Drain */ +#define PIO_CFGR_OPD_DISABLED (0x0u << 14) /**< \brief (PIO_CFGR) The open-drain is disabled for the selected I/O lines. I/O lines are driven at high- and low-level. */ +#define PIO_CFGR_OPD_ENABLED (0x1u << 14) /**< \brief (PIO_CFGR) The open-drain is enabled for the selected I/O lines. I/O lines are driven at low-level only. */ +#define PIO_CFGR_SCHMITT (0x1u << 15) /**< \brief (PIO_CFGR) Schmitt Trigger */ +#define PIO_CFGR_SCHMITT_ENABLED (0x0u << 15) /**< \brief (PIO_CFGR) Schmitt trigger is enabled for the selected I/O lines. */ +#define PIO_CFGR_SCHMITT_DISABLED (0x1u << 15) /**< \brief (PIO_CFGR) Schmitt trigger is disabled for the selected I/O lines. */ +#define PIO_CFGR_DRVSTR_Pos 16 +#define PIO_CFGR_DRVSTR_Msk (0x3u << PIO_CFGR_DRVSTR_Pos) /**< \brief (PIO_CFGR) Drive Strength */ +#define PIO_CFGR_DRVSTR(value) ((PIO_CFGR_DRVSTR_Msk & ((value) << PIO_CFGR_DRVSTR_Pos))) +#define PIO_CFGR_DRVSTR_LO (0x0u << 16) /**< \brief (PIO_CFGR) Low drive */ +#define PIO_CFGR_DRVSTR_ME (0x2u << 16) /**< \brief (PIO_CFGR) Medium drive */ +#define PIO_CFGR_DRVSTR_HI (0x3u << 16) /**< \brief (PIO_CFGR) High drive */ +#define PIO_CFGR_EVTSEL_Pos 24 +#define PIO_CFGR_EVTSEL_Msk (0x7u << PIO_CFGR_EVTSEL_Pos) /**< \brief (PIO_CFGR) Event Selection */ +#define PIO_CFGR_EVTSEL(value) ((PIO_CFGR_EVTSEL_Msk & ((value) << PIO_CFGR_EVTSEL_Pos))) +#define PIO_CFGR_EVTSEL_FALLING (0x0u << 24) /**< \brief (PIO_CFGR) Event detection on input falling edge */ +#define PIO_CFGR_EVTSEL_RISING (0x1u << 24) /**< \brief (PIO_CFGR) Event detection on input rising edge */ +#define PIO_CFGR_EVTSEL_BOTH (0x2u << 24) /**< \brief (PIO_CFGR) Event detection on input both edge */ +#define PIO_CFGR_EVTSEL_LOW (0x3u << 24) /**< \brief (PIO_CFGR) Event detection on low level input */ +#define PIO_CFGR_EVTSEL_HIGH (0x4u << 24) /**< \brief (PIO_CFGR) Event detection on high level input */ +#define PIO_CFGR_PCFS (0x1u << 29) /**< \brief (PIO_CFGR) Physical Configuration Freeze Status */ +#define PIO_CFGR_PCFS_NOT_FROZEN (0x0u << 29) /**< \brief (PIO_CFGR) The fields are not frozen and can be written for this I/O line. */ +#define PIO_CFGR_PCFS_FROZEN (0x1u << 29) /**< \brief (PIO_CFGR) The fields are frozen and can not be written for this I/O line. Only a hardware reset can release these fields. */ +#define PIO_CFGR_ICFS (0x1u << 30) /**< \brief (PIO_CFGR) Interrupt Configuration Freeze Status */ +#define PIO_CFGR_ICFS_NOT_FROZEN (0x0u << 30) /**< \brief (PIO_CFGR) The fields are not frozen and can be written for this I/O line. */ +#define PIO_CFGR_ICFS_FROZEN (0x1u << 30) /**< \brief (PIO_CFGR) The fields are frozen and can not be written for this I/O line. Only a hardware reset can release these fields. */ +/* -------- PIO_PDSR : (PIO Offset: N/A) PIO Pin Data Status Register -------- */ +#define PIO_PDSR_P0 (0x1u << 0) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P1 (0x1u << 1) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P2 (0x1u << 2) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P3 (0x1u << 3) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P4 (0x1u << 4) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P5 (0x1u << 5) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P6 (0x1u << 6) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P7 (0x1u << 7) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P8 (0x1u << 8) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P9 (0x1u << 9) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P10 (0x1u << 10) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P11 (0x1u << 11) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P12 (0x1u << 12) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P13 (0x1u << 13) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P14 (0x1u << 14) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P15 (0x1u << 15) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P16 (0x1u << 16) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P17 (0x1u << 17) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P18 (0x1u << 18) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P19 (0x1u << 19) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P20 (0x1u << 20) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P21 (0x1u << 21) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P22 (0x1u << 22) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P23 (0x1u << 23) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P24 (0x1u << 24) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P25 (0x1u << 25) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P26 (0x1u << 26) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P27 (0x1u << 27) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P28 (0x1u << 28) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P29 (0x1u << 29) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P30 (0x1u << 30) /**< \brief (PIO_PDSR) Input Data Status */ +#define PIO_PDSR_P31 (0x1u << 31) /**< \brief (PIO_PDSR) Input Data Status */ +/* -------- PIO_LOCKSR : (PIO Offset: N/A) PIO Lock Status Register -------- */ +#define PIO_LOCKSR_P0 (0x1u << 0) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P1 (0x1u << 1) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P2 (0x1u << 2) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P3 (0x1u << 3) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P4 (0x1u << 4) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P5 (0x1u << 5) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P6 (0x1u << 6) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P7 (0x1u << 7) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P8 (0x1u << 8) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P9 (0x1u << 9) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P10 (0x1u << 10) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P11 (0x1u << 11) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P12 (0x1u << 12) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P13 (0x1u << 13) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P14 (0x1u << 14) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P15 (0x1u << 15) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P16 (0x1u << 16) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P17 (0x1u << 17) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P18 (0x1u << 18) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P19 (0x1u << 19) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P20 (0x1u << 20) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P21 (0x1u << 21) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P22 (0x1u << 22) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P23 (0x1u << 23) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P24 (0x1u << 24) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P25 (0x1u << 25) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P26 (0x1u << 26) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P27 (0x1u << 27) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P28 (0x1u << 28) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P29 (0x1u << 29) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P30 (0x1u << 30) /**< \brief (PIO_LOCKSR) Lock Status */ +#define PIO_LOCKSR_P31 (0x1u << 31) /**< \brief (PIO_LOCKSR) Lock Status */ +/* -------- PIO_SODR : (PIO Offset: N/A) PIO Set Output Data Register -------- */ +#define PIO_SODR_P0 (0x1u << 0) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P1 (0x1u << 1) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P2 (0x1u << 2) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P3 (0x1u << 3) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P4 (0x1u << 4) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P5 (0x1u << 5) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P6 (0x1u << 6) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P7 (0x1u << 7) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P8 (0x1u << 8) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P9 (0x1u << 9) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P10 (0x1u << 10) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P11 (0x1u << 11) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P12 (0x1u << 12) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P13 (0x1u << 13) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P14 (0x1u << 14) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P15 (0x1u << 15) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P16 (0x1u << 16) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P17 (0x1u << 17) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P18 (0x1u << 18) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P19 (0x1u << 19) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P20 (0x1u << 20) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P21 (0x1u << 21) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P22 (0x1u << 22) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P23 (0x1u << 23) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P24 (0x1u << 24) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P25 (0x1u << 25) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P26 (0x1u << 26) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P27 (0x1u << 27) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P28 (0x1u << 28) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P29 (0x1u << 29) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P30 (0x1u << 30) /**< \brief (PIO_SODR) Set Output Data */ +#define PIO_SODR_P31 (0x1u << 31) /**< \brief (PIO_SODR) Set Output Data */ +/* -------- PIO_CODR : (PIO Offset: N/A) PIO Clear Output Data Register -------- */ +#define PIO_CODR_P0 (0x1u << 0) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P1 (0x1u << 1) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P2 (0x1u << 2) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P3 (0x1u << 3) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P4 (0x1u << 4) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P5 (0x1u << 5) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P6 (0x1u << 6) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P7 (0x1u << 7) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P8 (0x1u << 8) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P9 (0x1u << 9) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P10 (0x1u << 10) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P11 (0x1u << 11) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P12 (0x1u << 12) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P13 (0x1u << 13) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P14 (0x1u << 14) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P15 (0x1u << 15) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P16 (0x1u << 16) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P17 (0x1u << 17) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P18 (0x1u << 18) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P19 (0x1u << 19) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P20 (0x1u << 20) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P21 (0x1u << 21) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P22 (0x1u << 22) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P23 (0x1u << 23) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P24 (0x1u << 24) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P25 (0x1u << 25) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P26 (0x1u << 26) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P27 (0x1u << 27) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P28 (0x1u << 28) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P29 (0x1u << 29) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P30 (0x1u << 30) /**< \brief (PIO_CODR) Clear Output Data */ +#define PIO_CODR_P31 (0x1u << 31) /**< \brief (PIO_CODR) Clear Output Data */ +/* -------- PIO_ODSR : (PIO Offset: N/A) PIO Output Data Status Register -------- */ +#define PIO_ODSR_P0 (0x1u << 0) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P1 (0x1u << 1) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P2 (0x1u << 2) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P3 (0x1u << 3) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P4 (0x1u << 4) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P5 (0x1u << 5) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P6 (0x1u << 6) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P7 (0x1u << 7) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P8 (0x1u << 8) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P9 (0x1u << 9) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P10 (0x1u << 10) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P11 (0x1u << 11) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P12 (0x1u << 12) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P13 (0x1u << 13) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P14 (0x1u << 14) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P15 (0x1u << 15) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P16 (0x1u << 16) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P17 (0x1u << 17) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P18 (0x1u << 18) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P19 (0x1u << 19) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P20 (0x1u << 20) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P21 (0x1u << 21) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P22 (0x1u << 22) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P23 (0x1u << 23) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P24 (0x1u << 24) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P25 (0x1u << 25) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P26 (0x1u << 26) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P27 (0x1u << 27) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P28 (0x1u << 28) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P29 (0x1u << 29) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P30 (0x1u << 30) /**< \brief (PIO_ODSR) Output Data Status */ +#define PIO_ODSR_P31 (0x1u << 31) /**< \brief (PIO_ODSR) Output Data Status */ +/* -------- PIO_IER : (PIO Offset: N/A) PIO Interrupt Enable Register -------- */ +#define PIO_IER_P0 (0x1u << 0) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P1 (0x1u << 1) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P2 (0x1u << 2) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P3 (0x1u << 3) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P4 (0x1u << 4) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P5 (0x1u << 5) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P6 (0x1u << 6) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P7 (0x1u << 7) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P8 (0x1u << 8) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P9 (0x1u << 9) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P10 (0x1u << 10) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P11 (0x1u << 11) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P12 (0x1u << 12) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P13 (0x1u << 13) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P14 (0x1u << 14) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P15 (0x1u << 15) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P16 (0x1u << 16) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P17 (0x1u << 17) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P18 (0x1u << 18) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P19 (0x1u << 19) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P20 (0x1u << 20) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P21 (0x1u << 21) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P22 (0x1u << 22) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P23 (0x1u << 23) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P24 (0x1u << 24) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P25 (0x1u << 25) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P26 (0x1u << 26) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P27 (0x1u << 27) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P28 (0x1u << 28) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P29 (0x1u << 29) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P30 (0x1u << 30) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +#define PIO_IER_P31 (0x1u << 31) /**< \brief (PIO_IER) Input Change Interrupt Enable */ +/* -------- PIO_IDR : (PIO Offset: N/A) PIO Interrupt Disable Register -------- */ +#define PIO_IDR_P0 (0x1u << 0) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P1 (0x1u << 1) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P2 (0x1u << 2) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P3 (0x1u << 3) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P4 (0x1u << 4) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P5 (0x1u << 5) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P6 (0x1u << 6) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P7 (0x1u << 7) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P8 (0x1u << 8) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P9 (0x1u << 9) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P10 (0x1u << 10) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P11 (0x1u << 11) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P12 (0x1u << 12) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P13 (0x1u << 13) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P14 (0x1u << 14) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P15 (0x1u << 15) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P16 (0x1u << 16) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P17 (0x1u << 17) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P18 (0x1u << 18) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P19 (0x1u << 19) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P20 (0x1u << 20) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P21 (0x1u << 21) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P22 (0x1u << 22) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P23 (0x1u << 23) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P24 (0x1u << 24) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P25 (0x1u << 25) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P26 (0x1u << 26) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P27 (0x1u << 27) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P28 (0x1u << 28) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P29 (0x1u << 29) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P30 (0x1u << 30) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +#define PIO_IDR_P31 (0x1u << 31) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ +/* -------- PIO_IMR : (PIO Offset: N/A) PIO Interrupt Mask Register -------- */ +#define PIO_IMR_P0 (0x1u << 0) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P1 (0x1u << 1) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P2 (0x1u << 2) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P3 (0x1u << 3) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P4 (0x1u << 4) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P5 (0x1u << 5) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P6 (0x1u << 6) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P7 (0x1u << 7) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P8 (0x1u << 8) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P9 (0x1u << 9) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P10 (0x1u << 10) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P11 (0x1u << 11) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P12 (0x1u << 12) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P13 (0x1u << 13) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P14 (0x1u << 14) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P15 (0x1u << 15) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P16 (0x1u << 16) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P17 (0x1u << 17) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P18 (0x1u << 18) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P19 (0x1u << 19) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P20 (0x1u << 20) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P21 (0x1u << 21) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P22 (0x1u << 22) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P23 (0x1u << 23) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P24 (0x1u << 24) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P25 (0x1u << 25) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P26 (0x1u << 26) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P27 (0x1u << 27) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P28 (0x1u << 28) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P29 (0x1u << 29) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P30 (0x1u << 30) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +#define PIO_IMR_P31 (0x1u << 31) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ +/* -------- PIO_ISR : (PIO Offset: N/A) PIO Interrupt Status Register -------- */ +#define PIO_ISR_P0 (0x1u << 0) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P1 (0x1u << 1) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P2 (0x1u << 2) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P3 (0x1u << 3) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P4 (0x1u << 4) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P5 (0x1u << 5) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P6 (0x1u << 6) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P7 (0x1u << 7) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P8 (0x1u << 8) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P9 (0x1u << 9) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P10 (0x1u << 10) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P11 (0x1u << 11) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P12 (0x1u << 12) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P13 (0x1u << 13) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P14 (0x1u << 14) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P15 (0x1u << 15) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P16 (0x1u << 16) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P17 (0x1u << 17) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P18 (0x1u << 18) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P19 (0x1u << 19) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P20 (0x1u << 20) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P21 (0x1u << 21) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P22 (0x1u << 22) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P23 (0x1u << 23) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P24 (0x1u << 24) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P25 (0x1u << 25) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P26 (0x1u << 26) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P27 (0x1u << 27) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P28 (0x1u << 28) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P29 (0x1u << 29) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P30 (0x1u << 30) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +#define PIO_ISR_P31 (0x1u << 31) /**< \brief (PIO_ISR) Input Change Interrupt Status */ +/* -------- PIO_IOFR : (PIO Offset: N/A) PIO I/O Freeze Register -------- */ +#define PIO_IOFR_FPHY (0x1u << 0) /**< \brief (PIO_IOFR) Freeze Physical Configuration */ +#define PIO_IOFR_FINT (0x1u << 1) /**< \brief (PIO_IOFR) Freeze Interrupt Configuration */ +#define PIO_IOFR_FRZKEY_Pos 8 +#define PIO_IOFR_FRZKEY_Msk (0xffffffu << PIO_IOFR_FRZKEY_Pos) /**< \brief (PIO_IOFR) Freeze Key */ +#define PIO_IOFR_FRZKEY(value) ((PIO_IOFR_FRZKEY_Msk & ((value) << PIO_IOFR_FRZKEY_Pos))) +#define PIO_IOFR_FRZKEY_PASSWD (0x494F46u << 8) /**< \brief (PIO_IOFR) Writing any other value in this field aborts the write operation of the WPEN bit. */ +/* -------- PIO_WPMR : (PIO Offset: 0x5E0) PIO Write Protection Mode Register -------- */ +#define PIO_WPMR_WPEN (0x1u << 0) /**< \brief (PIO_WPMR) Write Protection Enable */ +#define PIO_WPMR_WPKEY_Pos 8 +#define PIO_WPMR_WPKEY_Msk (0xffffffu << PIO_WPMR_WPKEY_Pos) /**< \brief (PIO_WPMR) Write Protection Key */ +#define PIO_WPMR_WPKEY(value) ((PIO_WPMR_WPKEY_Msk & ((value) << PIO_WPMR_WPKEY_Pos))) +#define PIO_WPMR_WPKEY_PASSWD (0x50494Fu << 8) /**< \brief (PIO_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ +/* -------- PIO_WPSR : (PIO Offset: 0x5E4) PIO Write Protection Status Register -------- */ +#define PIO_WPSR_WPVS (0x1u << 0) /**< \brief (PIO_WPSR) Write Protection Violation Status */ +#define PIO_WPSR_WPVSRC_Pos 8 +#define PIO_WPSR_WPVSRC_Msk (0xffffu << PIO_WPSR_WPVSRC_Pos) /**< \brief (PIO_WPSR) Write Protection Violation Source */ +/* -------- PIO_VERSION : (PIO Offset: 0x5FC) Version Register -------- */ +#define PIO_VERSION_VERSION_Pos 0 +#define PIO_VERSION_VERSION_Msk (0xfffu << PIO_VERSION_VERSION_Pos) /**< \brief (PIO_VERSION) Hardware Module Version */ +#define PIO_VERSION_MFN_Pos 16 +#define PIO_VERSION_MFN_Msk (0x7u << PIO_VERSION_MFN_Pos) /**< \brief (PIO_VERSION) Metal Fix Number */ +/* -------- S_PIO_MSKR : (PIO Offset: N/A) Secure PIO Mask Register -------- */ +#define S_PIO_MSKR_MSK0 (0x1u << 0) /**< \brief (S_PIO_MSKR) PIO Line 0 Mask */ +#define S_PIO_MSKR_MSK0_DISABLED (0x0u << 0) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK0_ENABLED (0x1u << 0) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK1 (0x1u << 1) /**< \brief (S_PIO_MSKR) PIO Line 1 Mask */ +#define S_PIO_MSKR_MSK1_DISABLED (0x0u << 1) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK1_ENABLED (0x1u << 1) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK2 (0x1u << 2) /**< \brief (S_PIO_MSKR) PIO Line 2 Mask */ +#define S_PIO_MSKR_MSK2_DISABLED (0x0u << 2) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK2_ENABLED (0x1u << 2) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK3 (0x1u << 3) /**< \brief (S_PIO_MSKR) PIO Line 3 Mask */ +#define S_PIO_MSKR_MSK3_DISABLED (0x0u << 3) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK3_ENABLED (0x1u << 3) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK4 (0x1u << 4) /**< \brief (S_PIO_MSKR) PIO Line 4 Mask */ +#define S_PIO_MSKR_MSK4_DISABLED (0x0u << 4) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK4_ENABLED (0x1u << 4) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK5 (0x1u << 5) /**< \brief (S_PIO_MSKR) PIO Line 5 Mask */ +#define S_PIO_MSKR_MSK5_DISABLED (0x0u << 5) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK5_ENABLED (0x1u << 5) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK6 (0x1u << 6) /**< \brief (S_PIO_MSKR) PIO Line 6 Mask */ +#define S_PIO_MSKR_MSK6_DISABLED (0x0u << 6) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK6_ENABLED (0x1u << 6) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK7 (0x1u << 7) /**< \brief (S_PIO_MSKR) PIO Line 7 Mask */ +#define S_PIO_MSKR_MSK7_DISABLED (0x0u << 7) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK7_ENABLED (0x1u << 7) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK8 (0x1u << 8) /**< \brief (S_PIO_MSKR) PIO Line 8 Mask */ +#define S_PIO_MSKR_MSK8_DISABLED (0x0u << 8) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK8_ENABLED (0x1u << 8) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK9 (0x1u << 9) /**< \brief (S_PIO_MSKR) PIO Line 9 Mask */ +#define S_PIO_MSKR_MSK9_DISABLED (0x0u << 9) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK9_ENABLED (0x1u << 9) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK10 (0x1u << 10) /**< \brief (S_PIO_MSKR) PIO Line 10 Mask */ +#define S_PIO_MSKR_MSK10_DISABLED (0x0u << 10) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK10_ENABLED (0x1u << 10) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK11 (0x1u << 11) /**< \brief (S_PIO_MSKR) PIO Line 11 Mask */ +#define S_PIO_MSKR_MSK11_DISABLED (0x0u << 11) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK11_ENABLED (0x1u << 11) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK12 (0x1u << 12) /**< \brief (S_PIO_MSKR) PIO Line 12 Mask */ +#define S_PIO_MSKR_MSK12_DISABLED (0x0u << 12) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK12_ENABLED (0x1u << 12) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK13 (0x1u << 13) /**< \brief (S_PIO_MSKR) PIO Line 13 Mask */ +#define S_PIO_MSKR_MSK13_DISABLED (0x0u << 13) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK13_ENABLED (0x1u << 13) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK14 (0x1u << 14) /**< \brief (S_PIO_MSKR) PIO Line 14 Mask */ +#define S_PIO_MSKR_MSK14_DISABLED (0x0u << 14) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK14_ENABLED (0x1u << 14) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK15 (0x1u << 15) /**< \brief (S_PIO_MSKR) PIO Line 15 Mask */ +#define S_PIO_MSKR_MSK15_DISABLED (0x0u << 15) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK15_ENABLED (0x1u << 15) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK16 (0x1u << 16) /**< \brief (S_PIO_MSKR) PIO Line 16 Mask */ +#define S_PIO_MSKR_MSK16_DISABLED (0x0u << 16) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK16_ENABLED (0x1u << 16) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK17 (0x1u << 17) /**< \brief (S_PIO_MSKR) PIO Line 17 Mask */ +#define S_PIO_MSKR_MSK17_DISABLED (0x0u << 17) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK17_ENABLED (0x1u << 17) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK18 (0x1u << 18) /**< \brief (S_PIO_MSKR) PIO Line 18 Mask */ +#define S_PIO_MSKR_MSK18_DISABLED (0x0u << 18) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK18_ENABLED (0x1u << 18) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK19 (0x1u << 19) /**< \brief (S_PIO_MSKR) PIO Line 19 Mask */ +#define S_PIO_MSKR_MSK19_DISABLED (0x0u << 19) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK19_ENABLED (0x1u << 19) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK20 (0x1u << 20) /**< \brief (S_PIO_MSKR) PIO Line 20 Mask */ +#define S_PIO_MSKR_MSK20_DISABLED (0x0u << 20) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK20_ENABLED (0x1u << 20) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK21 (0x1u << 21) /**< \brief (S_PIO_MSKR) PIO Line 21 Mask */ +#define S_PIO_MSKR_MSK21_DISABLED (0x0u << 21) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK21_ENABLED (0x1u << 21) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK22 (0x1u << 22) /**< \brief (S_PIO_MSKR) PIO Line 22 Mask */ +#define S_PIO_MSKR_MSK22_DISABLED (0x0u << 22) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK22_ENABLED (0x1u << 22) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK23 (0x1u << 23) /**< \brief (S_PIO_MSKR) PIO Line 23 Mask */ +#define S_PIO_MSKR_MSK23_DISABLED (0x0u << 23) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK23_ENABLED (0x1u << 23) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK24 (0x1u << 24) /**< \brief (S_PIO_MSKR) PIO Line 24 Mask */ +#define S_PIO_MSKR_MSK24_DISABLED (0x0u << 24) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK24_ENABLED (0x1u << 24) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK25 (0x1u << 25) /**< \brief (S_PIO_MSKR) PIO Line 25 Mask */ +#define S_PIO_MSKR_MSK25_DISABLED (0x0u << 25) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK25_ENABLED (0x1u << 25) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK26 (0x1u << 26) /**< \brief (S_PIO_MSKR) PIO Line 26 Mask */ +#define S_PIO_MSKR_MSK26_DISABLED (0x0u << 26) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK26_ENABLED (0x1u << 26) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK27 (0x1u << 27) /**< \brief (S_PIO_MSKR) PIO Line 27 Mask */ +#define S_PIO_MSKR_MSK27_DISABLED (0x0u << 27) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK27_ENABLED (0x1u << 27) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK28 (0x1u << 28) /**< \brief (S_PIO_MSKR) PIO Line 28 Mask */ +#define S_PIO_MSKR_MSK28_DISABLED (0x0u << 28) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK28_ENABLED (0x1u << 28) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK29 (0x1u << 29) /**< \brief (S_PIO_MSKR) PIO Line 29 Mask */ +#define S_PIO_MSKR_MSK29_DISABLED (0x0u << 29) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK29_ENABLED (0x1u << 29) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK30 (0x1u << 30) /**< \brief (S_PIO_MSKR) PIO Line 30 Mask */ +#define S_PIO_MSKR_MSK30_DISABLED (0x0u << 30) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK30_ENABLED (0x1u << 30) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK31 (0x1u << 31) /**< \brief (S_PIO_MSKR) PIO Line 31 Mask */ +#define S_PIO_MSKR_MSK31_DISABLED (0x0u << 31) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRx does not affect the corresponding I/O line configuration. */ +#define S_PIO_MSKR_MSK31_ENABLED (0x1u << 31) /**< \brief (S_PIO_MSKR) Writing the S_PIO_CFGRx, S_PIO_ODSRx or S_PIO_IOFRX updates the corresponding I/O line configuration. */ +/* -------- S_PIO_CFGR : (PIO Offset: N/A) Secure PIO Configuration Register -------- */ +#define S_PIO_CFGR_FUNC_Pos 0 +#define S_PIO_CFGR_FUNC_Msk (0x7u << S_PIO_CFGR_FUNC_Pos) /**< \brief (S_PIO_CFGR) I/O Line Function */ +#define S_PIO_CFGR_FUNC(value) ((S_PIO_CFGR_FUNC_Msk & ((value) << S_PIO_CFGR_FUNC_Pos))) +#define S_PIO_CFGR_FUNC_GPIO (0x0u << 0) /**< \brief (S_PIO_CFGR) Select the PIO mode for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_A (0x1u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral A for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_B (0x2u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral B for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_C (0x3u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral C for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_D (0x4u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral D for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_E (0x5u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral E for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_F (0x6u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral F for the selected I/O lines. */ +#define S_PIO_CFGR_FUNC_PERIPH_G (0x7u << 0) /**< \brief (S_PIO_CFGR) Select the peripheral G for the selected I/O lines. */ +#define S_PIO_CFGR_DIR (0x1u << 8) /**< \brief (S_PIO_CFGR) Direction */ +#define S_PIO_CFGR_DIR_INPUT (0x0u << 8) /**< \brief (S_PIO_CFGR) The selected I/O lines are pure inputs. */ +#define S_PIO_CFGR_DIR_OUTPUT (0x1u << 8) /**< \brief (S_PIO_CFGR) The selected I/O lines are enabled in output. */ +#define S_PIO_CFGR_PUEN (0x1u << 9) /**< \brief (S_PIO_CFGR) Pull-Up Enable */ +#define S_PIO_CFGR_PUEN_DISABLED (0x0u << 9) /**< \brief (S_PIO_CFGR) Pull-Up is disabled for the selected I/O lines. */ +#define S_PIO_CFGR_PUEN_ENABLED (0x1u << 9) /**< \brief (S_PIO_CFGR) Pull-Up is enabled for the selected I/O lines. */ +#define S_PIO_CFGR_PDEN (0x1u << 10) /**< \brief (S_PIO_CFGR) Pull-Down Enable */ +#define S_PIO_CFGR_PDEN_DISABLED (0x0u << 10) /**< \brief (S_PIO_CFGR) Pull-Down is disabled for the selected I/O lines. */ +#define S_PIO_CFGR_PDEN_ENABLED (0x1u << 10) /**< \brief (S_PIO_CFGR) Pull-Down is enabled for the selected I/O lines only if PUEN is 0(1). */ +#define S_PIO_CFGR_IFEN (0x1u << 12) /**< \brief (S_PIO_CFGR) Input Filter Enable */ +#define S_PIO_CFGR_IFEN_DISABLED (0x0u << 12) /**< \brief (S_PIO_CFGR) The input filter is disabled for the selected I/O lines. */ +#define S_PIO_CFGR_IFEN_ENABLED (0x1u << 12) /**< \brief (S_PIO_CFGR) The input filter is enabled for the selected I/O lines. */ +#define S_PIO_CFGR_IFSCEN (0x1u << 13) /**< \brief (S_PIO_CFGR) Input Filter Slow Clock Enable */ +#define S_PIO_CFGR_OPD (0x1u << 14) /**< \brief (S_PIO_CFGR) Open-Drain */ +#define S_PIO_CFGR_OPD_DISABLED (0x0u << 14) /**< \brief (S_PIO_CFGR) The open-drain is disabled for the selected I/O lines. I/O lines are driven at high- and low-level. */ +#define S_PIO_CFGR_OPD_ENABLED (0x1u << 14) /**< \brief (S_PIO_CFGR) The open-drain is enabled for the selected I/O lines. I/O lines are driven at low-level only. */ +#define S_PIO_CFGR_SCHMITT (0x1u << 15) /**< \brief (S_PIO_CFGR) Schmitt Trigger */ +#define S_PIO_CFGR_SCHMITT_ENABLED (0x0u << 15) /**< \brief (S_PIO_CFGR) Schmitt trigger is enabled for the selected I/O lines. */ +#define S_PIO_CFGR_SCHMITT_DISABLED (0x1u << 15) /**< \brief (S_PIO_CFGR) Schmitt trigger is disabled for the selected I/O lines. */ +#define S_PIO_CFGR_DRVSTR_Pos 16 +#define S_PIO_CFGR_DRVSTR_Msk (0x3u << S_PIO_CFGR_DRVSTR_Pos) /**< \brief (S_PIO_CFGR) */ +#define S_PIO_CFGR_DRVSTR(value) ((S_PIO_CFGR_DRVSTR_Msk & ((value) << S_PIO_CFGR_DRVSTR_Pos))) +#define S_PIO_CFGR_EVTSEL_Pos 24 +#define S_PIO_CFGR_EVTSEL_Msk (0x7u << S_PIO_CFGR_EVTSEL_Pos) /**< \brief (S_PIO_CFGR) Event Selection */ +#define S_PIO_CFGR_EVTSEL(value) ((S_PIO_CFGR_EVTSEL_Msk & ((value) << S_PIO_CFGR_EVTSEL_Pos))) +#define S_PIO_CFGR_EVTSEL_FALLING (0x0u << 24) /**< \brief (S_PIO_CFGR) Event detection on input falling edge */ +#define S_PIO_CFGR_EVTSEL_RISING (0x1u << 24) /**< \brief (S_PIO_CFGR) Event detection on input rising edge */ +#define S_PIO_CFGR_EVTSEL_BOTH (0x2u << 24) /**< \brief (S_PIO_CFGR) Event detection on input both edge */ +#define S_PIO_CFGR_EVTSEL_LOW (0x3u << 24) /**< \brief (S_PIO_CFGR) Event detection on low level input */ +#define S_PIO_CFGR_EVTSEL_HIGH (0x4u << 24) /**< \brief (S_PIO_CFGR) Event detection on high level input */ +#define S_PIO_CFGR_PCFS (0x1u << 29) /**< \brief (S_PIO_CFGR) Physical Configuration Freeze Status */ +#define S_PIO_CFGR_PCFS_NOT_FROZEN (0x0u << 29) /**< \brief (S_PIO_CFGR) The fields are not frozen and can be written for this I/O line. */ +#define S_PIO_CFGR_PCFS_FROZEN (0x1u << 29) /**< \brief (S_PIO_CFGR) The fields are frozen and can not be written for this I/O line. Only a hardware reset can release these fields. */ +#define S_PIO_CFGR_ICFS (0x1u << 30) /**< \brief (S_PIO_CFGR) Interrupt Configuration Freeze Status */ +#define S_PIO_CFGR_ICFS_NOT_FROZEN (0x0u << 30) /**< \brief (S_PIO_CFGR) The fields are not frozen and can be written for this I/O line. */ +#define S_PIO_CFGR_ICFS_FROZEN (0x1u << 30) /**< \brief (S_PIO_CFGR) The fields are frozen and can not be written for this I/O line. Only a hardware reset can release these fields. */ +/* -------- S_PIO_PDSR : (PIO Offset: N/A) Secure PIO Pin Data Status Register -------- */ +#define S_PIO_PDSR_P0 (0x1u << 0) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P1 (0x1u << 1) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P2 (0x1u << 2) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P3 (0x1u << 3) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P4 (0x1u << 4) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P5 (0x1u << 5) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P6 (0x1u << 6) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P7 (0x1u << 7) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P8 (0x1u << 8) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P9 (0x1u << 9) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P10 (0x1u << 10) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P11 (0x1u << 11) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P12 (0x1u << 12) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P13 (0x1u << 13) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P14 (0x1u << 14) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P15 (0x1u << 15) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P16 (0x1u << 16) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P17 (0x1u << 17) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P18 (0x1u << 18) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P19 (0x1u << 19) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P20 (0x1u << 20) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P21 (0x1u << 21) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P22 (0x1u << 22) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P23 (0x1u << 23) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P24 (0x1u << 24) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P25 (0x1u << 25) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P26 (0x1u << 26) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P27 (0x1u << 27) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P28 (0x1u << 28) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P29 (0x1u << 29) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P30 (0x1u << 30) /**< \brief (S_PIO_PDSR) Input Data Status */ +#define S_PIO_PDSR_P31 (0x1u << 31) /**< \brief (S_PIO_PDSR) Input Data Status */ +/* -------- S_PIO_SODR : (PIO Offset: N/A) Secure PIO Set Output Data Register -------- */ +#define S_PIO_SODR_P0 (0x1u << 0) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P1 (0x1u << 1) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P2 (0x1u << 2) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P3 (0x1u << 3) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P4 (0x1u << 4) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P5 (0x1u << 5) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P6 (0x1u << 6) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P7 (0x1u << 7) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P8 (0x1u << 8) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P9 (0x1u << 9) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P10 (0x1u << 10) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P11 (0x1u << 11) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P12 (0x1u << 12) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P13 (0x1u << 13) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P14 (0x1u << 14) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P15 (0x1u << 15) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P16 (0x1u << 16) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P17 (0x1u << 17) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P18 (0x1u << 18) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P19 (0x1u << 19) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P20 (0x1u << 20) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P21 (0x1u << 21) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P22 (0x1u << 22) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P23 (0x1u << 23) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P24 (0x1u << 24) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P25 (0x1u << 25) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P26 (0x1u << 26) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P27 (0x1u << 27) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P28 (0x1u << 28) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P29 (0x1u << 29) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P30 (0x1u << 30) /**< \brief (S_PIO_SODR) Set Output Data */ +#define S_PIO_SODR_P31 (0x1u << 31) /**< \brief (S_PIO_SODR) Set Output Data */ +/* -------- S_PIO_CODR : (PIO Offset: N/A) Secure PIO Clear Output Data Register -------- */ +#define S_PIO_CODR_P0 (0x1u << 0) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P1 (0x1u << 1) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P2 (0x1u << 2) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P3 (0x1u << 3) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P4 (0x1u << 4) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P5 (0x1u << 5) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P6 (0x1u << 6) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P7 (0x1u << 7) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P8 (0x1u << 8) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P9 (0x1u << 9) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P10 (0x1u << 10) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P11 (0x1u << 11) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P12 (0x1u << 12) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P13 (0x1u << 13) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P14 (0x1u << 14) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P15 (0x1u << 15) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P16 (0x1u << 16) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P17 (0x1u << 17) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P18 (0x1u << 18) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P19 (0x1u << 19) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P20 (0x1u << 20) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P21 (0x1u << 21) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P22 (0x1u << 22) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P23 (0x1u << 23) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P24 (0x1u << 24) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P25 (0x1u << 25) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P26 (0x1u << 26) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P27 (0x1u << 27) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P28 (0x1u << 28) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P29 (0x1u << 29) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P30 (0x1u << 30) /**< \brief (S_PIO_CODR) Clear Output Data */ +#define S_PIO_CODR_P31 (0x1u << 31) /**< \brief (S_PIO_CODR) Clear Output Data */ +/* -------- S_PIO_ODSR : (PIO Offset: N/A) Secure PIO Output Data Status Register -------- */ +#define S_PIO_ODSR_P0 (0x1u << 0) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P1 (0x1u << 1) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P2 (0x1u << 2) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P3 (0x1u << 3) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P4 (0x1u << 4) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P5 (0x1u << 5) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P6 (0x1u << 6) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P7 (0x1u << 7) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P8 (0x1u << 8) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P9 (0x1u << 9) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P10 (0x1u << 10) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P11 (0x1u << 11) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P12 (0x1u << 12) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P13 (0x1u << 13) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P14 (0x1u << 14) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P15 (0x1u << 15) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P16 (0x1u << 16) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P17 (0x1u << 17) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P18 (0x1u << 18) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P19 (0x1u << 19) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P20 (0x1u << 20) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P21 (0x1u << 21) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P22 (0x1u << 22) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P23 (0x1u << 23) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P24 (0x1u << 24) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P25 (0x1u << 25) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P26 (0x1u << 26) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P27 (0x1u << 27) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P28 (0x1u << 28) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P29 (0x1u << 29) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P30 (0x1u << 30) /**< \brief (S_PIO_ODSR) Output Data Status */ +#define S_PIO_ODSR_P31 (0x1u << 31) /**< \brief (S_PIO_ODSR) Output Data Status */ +/* -------- S_PIO_IER : (PIO Offset: N/A) Secure PIO Interrupt Enable Register -------- */ +#define S_PIO_IER_P0 (0x1u << 0) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P1 (0x1u << 1) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P2 (0x1u << 2) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P3 (0x1u << 3) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P4 (0x1u << 4) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P5 (0x1u << 5) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P6 (0x1u << 6) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P7 (0x1u << 7) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P8 (0x1u << 8) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P9 (0x1u << 9) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P10 (0x1u << 10) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P11 (0x1u << 11) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P12 (0x1u << 12) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P13 (0x1u << 13) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P14 (0x1u << 14) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P15 (0x1u << 15) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P16 (0x1u << 16) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P17 (0x1u << 17) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P18 (0x1u << 18) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P19 (0x1u << 19) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P20 (0x1u << 20) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P21 (0x1u << 21) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P22 (0x1u << 22) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P23 (0x1u << 23) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P24 (0x1u << 24) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P25 (0x1u << 25) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P26 (0x1u << 26) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P27 (0x1u << 27) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P28 (0x1u << 28) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P29 (0x1u << 29) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P30 (0x1u << 30) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +#define S_PIO_IER_P31 (0x1u << 31) /**< \brief (S_PIO_IER) Input Change Interrupt Enable */ +/* -------- S_PIO_IDR : (PIO Offset: N/A) Secure PIO Interrupt Disable Register -------- */ +#define S_PIO_IDR_P0 (0x1u << 0) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P1 (0x1u << 1) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P2 (0x1u << 2) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P3 (0x1u << 3) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P4 (0x1u << 4) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P5 (0x1u << 5) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P6 (0x1u << 6) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P7 (0x1u << 7) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P8 (0x1u << 8) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P9 (0x1u << 9) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P10 (0x1u << 10) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P11 (0x1u << 11) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P12 (0x1u << 12) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P13 (0x1u << 13) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P14 (0x1u << 14) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P15 (0x1u << 15) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P16 (0x1u << 16) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P17 (0x1u << 17) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P18 (0x1u << 18) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P19 (0x1u << 19) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P20 (0x1u << 20) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P21 (0x1u << 21) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P22 (0x1u << 22) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P23 (0x1u << 23) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P24 (0x1u << 24) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P25 (0x1u << 25) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P26 (0x1u << 26) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P27 (0x1u << 27) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P28 (0x1u << 28) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P29 (0x1u << 29) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P30 (0x1u << 30) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +#define S_PIO_IDR_P31 (0x1u << 31) /**< \brief (S_PIO_IDR) Input Change Interrupt Disable */ +/* -------- S_PIO_IMR : (PIO Offset: N/A) Secure PIO Interrupt Mask Register -------- */ +#define S_PIO_IMR_P0 (0x1u << 0) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P1 (0x1u << 1) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P2 (0x1u << 2) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P3 (0x1u << 3) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P4 (0x1u << 4) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P5 (0x1u << 5) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P6 (0x1u << 6) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P7 (0x1u << 7) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P8 (0x1u << 8) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P9 (0x1u << 9) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P10 (0x1u << 10) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P11 (0x1u << 11) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P12 (0x1u << 12) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P13 (0x1u << 13) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P14 (0x1u << 14) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P15 (0x1u << 15) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P16 (0x1u << 16) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P17 (0x1u << 17) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P18 (0x1u << 18) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P19 (0x1u << 19) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P20 (0x1u << 20) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P21 (0x1u << 21) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P22 (0x1u << 22) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P23 (0x1u << 23) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P24 (0x1u << 24) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P25 (0x1u << 25) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P26 (0x1u << 26) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P27 (0x1u << 27) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P28 (0x1u << 28) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P29 (0x1u << 29) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P30 (0x1u << 30) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +#define S_PIO_IMR_P31 (0x1u << 31) /**< \brief (S_PIO_IMR) Input Change Interrupt Mask */ +/* -------- S_PIO_ISR : (PIO Offset: N/A) Secure PIO Interrupt Status Register -------- */ +#define S_PIO_ISR_P0 (0x1u << 0) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P1 (0x1u << 1) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P2 (0x1u << 2) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P3 (0x1u << 3) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P4 (0x1u << 4) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P5 (0x1u << 5) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P6 (0x1u << 6) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P7 (0x1u << 7) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P8 (0x1u << 8) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P9 (0x1u << 9) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P10 (0x1u << 10) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P11 (0x1u << 11) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P12 (0x1u << 12) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P13 (0x1u << 13) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P14 (0x1u << 14) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P15 (0x1u << 15) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P16 (0x1u << 16) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P17 (0x1u << 17) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P18 (0x1u << 18) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P19 (0x1u << 19) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P20 (0x1u << 20) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P21 (0x1u << 21) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P22 (0x1u << 22) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P23 (0x1u << 23) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P24 (0x1u << 24) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P25 (0x1u << 25) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P26 (0x1u << 26) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P27 (0x1u << 27) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P28 (0x1u << 28) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P29 (0x1u << 29) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P30 (0x1u << 30) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +#define S_PIO_ISR_P31 (0x1u << 31) /**< \brief (S_PIO_ISR) Input Change Interrupt Status */ +/* -------- S_PIO_SIONR : (PIO Offset: N/A) Secure PIO Set I/O Non-Secure Register -------- */ +#define S_PIO_SIONR_P0 (0x1u << 0) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P1 (0x1u << 1) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P2 (0x1u << 2) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P3 (0x1u << 3) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P4 (0x1u << 4) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P5 (0x1u << 5) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P6 (0x1u << 6) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P7 (0x1u << 7) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P8 (0x1u << 8) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P9 (0x1u << 9) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P10 (0x1u << 10) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P11 (0x1u << 11) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P12 (0x1u << 12) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P13 (0x1u << 13) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P14 (0x1u << 14) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P15 (0x1u << 15) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P16 (0x1u << 16) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P17 (0x1u << 17) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P18 (0x1u << 18) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P19 (0x1u << 19) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P20 (0x1u << 20) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P21 (0x1u << 21) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P22 (0x1u << 22) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P23 (0x1u << 23) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P24 (0x1u << 24) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P25 (0x1u << 25) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P26 (0x1u << 26) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P27 (0x1u << 27) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P28 (0x1u << 28) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P29 (0x1u << 29) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P30 (0x1u << 30) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +#define S_PIO_SIONR_P31 (0x1u << 31) /**< \brief (S_PIO_SIONR) Set I/O Non-Secure */ +/* -------- S_PIO_SIOSR : (PIO Offset: N/A) Secure PIO Set I/O Secure Register -------- */ +#define S_PIO_SIOSR_P0 (0x1u << 0) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P1 (0x1u << 1) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P2 (0x1u << 2) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P3 (0x1u << 3) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P4 (0x1u << 4) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P5 (0x1u << 5) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P6 (0x1u << 6) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P7 (0x1u << 7) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P8 (0x1u << 8) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P9 (0x1u << 9) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P10 (0x1u << 10) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P11 (0x1u << 11) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P12 (0x1u << 12) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P13 (0x1u << 13) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P14 (0x1u << 14) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P15 (0x1u << 15) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P16 (0x1u << 16) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P17 (0x1u << 17) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P18 (0x1u << 18) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P19 (0x1u << 19) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P20 (0x1u << 20) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P21 (0x1u << 21) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P22 (0x1u << 22) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P23 (0x1u << 23) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P24 (0x1u << 24) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P25 (0x1u << 25) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P26 (0x1u << 26) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P27 (0x1u << 27) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P28 (0x1u << 28) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P29 (0x1u << 29) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P30 (0x1u << 30) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +#define S_PIO_SIOSR_P31 (0x1u << 31) /**< \brief (S_PIO_SIOSR) Set I/O Secure */ +/* -------- S_PIO_IOSSR : (PIO Offset: N/A) Secure PIO I/O Security Status Register -------- */ +#define S_PIO_IOSSR_P0 (0x1u << 0) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P0_SECURE (0x0u << 0) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P0_NON_SECURE (0x1u << 0) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P1 (0x1u << 1) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P1_SECURE (0x0u << 1) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P1_NON_SECURE (0x1u << 1) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P2 (0x1u << 2) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P2_SECURE (0x0u << 2) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P2_NON_SECURE (0x1u << 2) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P3 (0x1u << 3) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P3_SECURE (0x0u << 3) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P3_NON_SECURE (0x1u << 3) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P4 (0x1u << 4) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P4_SECURE (0x0u << 4) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P4_NON_SECURE (0x1u << 4) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P5 (0x1u << 5) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P5_SECURE (0x0u << 5) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P5_NON_SECURE (0x1u << 5) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P6 (0x1u << 6) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P6_SECURE (0x0u << 6) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P6_NON_SECURE (0x1u << 6) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P7 (0x1u << 7) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P7_SECURE (0x0u << 7) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P7_NON_SECURE (0x1u << 7) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P8 (0x1u << 8) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P8_SECURE (0x0u << 8) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P8_NON_SECURE (0x1u << 8) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P9 (0x1u << 9) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P9_SECURE (0x0u << 9) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P9_NON_SECURE (0x1u << 9) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P10 (0x1u << 10) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P10_SECURE (0x0u << 10) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P10_NON_SECURE (0x1u << 10) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P11 (0x1u << 11) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P11_SECURE (0x0u << 11) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P11_NON_SECURE (0x1u << 11) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P12 (0x1u << 12) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P12_SECURE (0x0u << 12) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P12_NON_SECURE (0x1u << 12) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P13 (0x1u << 13) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P13_SECURE (0x0u << 13) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P13_NON_SECURE (0x1u << 13) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P14 (0x1u << 14) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P14_SECURE (0x0u << 14) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P14_NON_SECURE (0x1u << 14) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P15 (0x1u << 15) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P15_SECURE (0x0u << 15) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P15_NON_SECURE (0x1u << 15) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P16 (0x1u << 16) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P16_SECURE (0x0u << 16) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P16_NON_SECURE (0x1u << 16) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P17 (0x1u << 17) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P17_SECURE (0x0u << 17) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P17_NON_SECURE (0x1u << 17) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P18 (0x1u << 18) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P18_SECURE (0x0u << 18) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P18_NON_SECURE (0x1u << 18) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P19 (0x1u << 19) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P19_SECURE (0x0u << 19) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P19_NON_SECURE (0x1u << 19) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P20 (0x1u << 20) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P20_SECURE (0x0u << 20) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P20_NON_SECURE (0x1u << 20) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P21 (0x1u << 21) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P21_SECURE (0x0u << 21) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P21_NON_SECURE (0x1u << 21) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P22 (0x1u << 22) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P22_SECURE (0x0u << 22) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P22_NON_SECURE (0x1u << 22) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P23 (0x1u << 23) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P23_SECURE (0x0u << 23) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P23_NON_SECURE (0x1u << 23) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P24 (0x1u << 24) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P24_SECURE (0x0u << 24) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P24_NON_SECURE (0x1u << 24) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P25 (0x1u << 25) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P25_SECURE (0x0u << 25) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P25_NON_SECURE (0x1u << 25) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P26 (0x1u << 26) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P26_SECURE (0x0u << 26) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P26_NON_SECURE (0x1u << 26) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P27 (0x1u << 27) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P27_SECURE (0x0u << 27) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P27_NON_SECURE (0x1u << 27) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P28 (0x1u << 28) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P28_SECURE (0x0u << 28) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P28_NON_SECURE (0x1u << 28) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P29 (0x1u << 29) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P29_SECURE (0x0u << 29) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P29_NON_SECURE (0x1u << 29) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P30 (0x1u << 30) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P30_SECURE (0x0u << 30) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P30_NON_SECURE (0x1u << 30) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +#define S_PIO_IOSSR_P31 (0x1u << 31) /**< \brief (S_PIO_IOSSR) I/O Security Status */ +#define S_PIO_IOSSR_P31_SECURE (0x0u << 31) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Secure mode. */ +#define S_PIO_IOSSR_P31_NON_SECURE (0x1u << 31) /**< \brief (S_PIO_IOSSR) The I/O line of the I/O group x is in Non-Secure mode. */ +/* -------- S_PIO_IOFR : (PIO Offset: N/A) Secure PIO I/O Freeze Register -------- */ +#define S_PIO_IOFR_FPHY (0x1u << 0) /**< \brief (S_PIO_IOFR) Freeze Physical Configuration */ +#define S_PIO_IOFR_FINT (0x1u << 1) /**< \brief (S_PIO_IOFR) Freeze Interrupt Configuration */ +#define S_PIO_IOFR_FRZKEY_Pos 8 +#define S_PIO_IOFR_FRZKEY_Msk (0xffffffu << S_PIO_IOFR_FRZKEY_Pos) /**< \brief (S_PIO_IOFR) Freeze Key */ +#define S_PIO_IOFR_FRZKEY(value) ((S_PIO_IOFR_FRZKEY_Msk & ((value) << S_PIO_IOFR_FRZKEY_Pos))) +#define S_PIO_IOFR_FRZKEY_PASSWD (0x494F46u << 8) /**< \brief (S_PIO_IOFR) Writing any other value in this field aborts the write operation of the WPEN bit. */ +/* -------- S_PIO_SCDR : (PIO Offset: 0x1500) Secure PIO Slow Clock Divider Debouncing Register -------- */ +#define S_PIO_SCDR_DIV_Pos 0 +#define S_PIO_SCDR_DIV_Msk (0x3fffu << S_PIO_SCDR_DIV_Pos) /**< \brief (S_PIO_SCDR) Slow Clock Divider Selection for Debouncing */ +#define S_PIO_SCDR_DIV(value) ((S_PIO_SCDR_DIV_Msk & ((value) << S_PIO_SCDR_DIV_Pos))) +/* -------- S_PIO_WPMR : (PIO Offset: 0x15E0) Secure PIO Write Protection Mode Register -------- */ +#define S_PIO_WPMR_WPEN (0x1u << 0) /**< \brief (S_PIO_WPMR) Write Protection Enable */ +#define S_PIO_WPMR_WPKEY_Pos 8 +#define S_PIO_WPMR_WPKEY_Msk (0xffffffu << S_PIO_WPMR_WPKEY_Pos) /**< \brief (S_PIO_WPMR) Write Protection Key */ +#define S_PIO_WPMR_WPKEY(value) ((S_PIO_WPMR_WPKEY_Msk & ((value) << S_PIO_WPMR_WPKEY_Pos))) +#define S_PIO_WPMR_WPKEY_PASSWD (0x50494Fu << 8) /**< \brief (S_PIO_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ +/* -------- S_PIO_WPSR : (PIO Offset: 0x15E4) Secure PIO Write Protection Status Register -------- */ +#define S_PIO_WPSR_WPVS (0x1u << 0) /**< \brief (S_PIO_WPSR) Write Protection Violation Status */ +#define S_PIO_WPSR_WPVSRC_Pos 8 +#define S_PIO_WPSR_WPVSRC_Msk (0xffffu << S_PIO_WPSR_WPVSRC_Pos) /**< \brief (S_PIO_WPSR) Write Protection Violation Source */ + +/*@}*/ + + +#endif /* _SAMA5D2_PIO_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pit.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pit.h new file mode 100644 index 000000000..bfa88c4c6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pit.h @@ -0,0 +1,70 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_PIT_COMPONENT_ +#define _SAMA5D2_PIT_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Periodic Interval Timer */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_PIT Periodic Interval Timer */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Pit hardware registers */ +typedef struct { + __IO uint32_t PIT_MR; /**< \brief (Pit Offset: 0x00) Mode Register */ + __I uint32_t PIT_SR; /**< \brief (Pit Offset: 0x04) Status Register */ + __I uint32_t PIT_PIVR; /**< \brief (Pit Offset: 0x08) Periodic Interval Value Register */ + __I uint32_t PIT_PIIR; /**< \brief (Pit Offset: 0x0C) Periodic Interval Image Register */ +} Pit; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- PIT_MR : (PIT Offset: 0x00) Mode Register -------- */ +#define PIT_MR_PIV_Pos 0 +#define PIT_MR_PIV_Msk (0xfffffu << PIT_MR_PIV_Pos) /**< \brief (PIT_MR) Periodic Interval Value */ +#define PIT_MR_PIV(value) ((PIT_MR_PIV_Msk & ((value) << PIT_MR_PIV_Pos))) +#define PIT_MR_PITEN (0x1u << 24) /**< \brief (PIT_MR) Period Interval Timer Enabled */ +#define PIT_MR_PITIEN (0x1u << 25) /**< \brief (PIT_MR) Periodic Interval Timer Interrupt Enable */ +/* -------- PIT_SR : (PIT Offset: 0x04) Status Register -------- */ +#define PIT_SR_PITS (0x1u << 0) /**< \brief (PIT_SR) Periodic Interval Timer Status */ +/* -------- PIT_PIVR : (PIT Offset: 0x08) Periodic Interval Value Register -------- */ +#define PIT_PIVR_CPIV_Pos 0 +#define PIT_PIVR_CPIV_Msk (0xfffffu << PIT_PIVR_CPIV_Pos) /**< \brief (PIT_PIVR) Current Periodic Interval Value */ +#define PIT_PIVR_PICNT_Pos 20 +#define PIT_PIVR_PICNT_Msk (0xfffu << PIT_PIVR_PICNT_Pos) /**< \brief (PIT_PIVR) Periodic Interval Counter */ +/* -------- PIT_PIIR : (PIT Offset: 0x0C) Periodic Interval Image Register -------- */ +#define PIT_PIIR_CPIV_Pos 0 +#define PIT_PIIR_CPIV_Msk (0xfffffu << PIT_PIIR_CPIV_Pos) /**< \brief (PIT_PIIR) Current Periodic Interval Value */ +#define PIT_PIIR_PICNT_Pos 20 +#define PIT_PIIR_PICNT_Msk (0xfffu << PIT_PIIR_PICNT_Pos) /**< \brief (PIT_PIIR) Periodic Interval Counter */ + +/*@}*/ + + +#endif /* _SAMA5D2_PIT_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pmc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pmc.h new file mode 100644 index 000000000..aae8160fe --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pmc.h @@ -0,0 +1,577 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_PMC_COMPONENT_ +#define _SAMA5D2_PMC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Power Management Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_PMC Power Management Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Pmc hardware registers */ +typedef struct { + __O uint32_t PMC_SCER; /**< \brief (Pmc Offset: 0x0000) System Clock Enable Register */ + __O uint32_t PMC_SCDR; /**< \brief (Pmc Offset: 0x0004) System Clock Disable Register */ + __I uint32_t PMC_SCSR; /**< \brief (Pmc Offset: 0x0008) System Clock Status Register */ + __I uint32_t Reserved1[1]; + __O uint32_t PMC_PCER0; /**< \brief (Pmc Offset: 0x0010) Peripheral Clock Enable Register 0 */ + __O uint32_t PMC_PCDR0; /**< \brief (Pmc Offset: 0x0014) Peripheral Clock Disable Register 0 */ + __I uint32_t PMC_PCSR0; /**< \brief (Pmc Offset: 0x0018) Peripheral Clock Status Register 0 */ + __IO uint32_t CKGR_UCKR; /**< \brief (Pmc Offset: 0x001C) UTMI Clock Register */ + __IO uint32_t CKGR_MOR; /**< \brief (Pmc Offset: 0x0020) Main Oscillator Register */ + __IO uint32_t CKGR_MCFR; /**< \brief (Pmc Offset: 0x0024) Main Clock Frequency Register */ + __IO uint32_t CKGR_PLLAR; /**< \brief (Pmc Offset: 0x0028) PLLA Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t PMC_MCKR; /**< \brief (Pmc Offset: 0x0030) Master Clock Register */ + __I uint32_t Reserved3[1]; + __IO uint32_t PMC_USB; /**< \brief (Pmc Offset: 0x0038) USB Clock Register */ + __I uint32_t Reserved4[1]; + __IO uint32_t PMC_PCK[3]; /**< \brief (Pmc Offset: 0x0040) Programmable Clock 0 Register */ + __I uint32_t Reserved5[5]; + __O uint32_t PMC_IER; /**< \brief (Pmc Offset: 0x0060) Interrupt Enable Register */ + __O uint32_t PMC_IDR; /**< \brief (Pmc Offset: 0x0064) Interrupt Disable Register */ + __I uint32_t PMC_SR; /**< \brief (Pmc Offset: 0x0068) Status Register */ + __I uint32_t PMC_IMR; /**< \brief (Pmc Offset: 0x006C) Interrupt Mask Register */ + __IO uint32_t PMC_FSMR; /**< \brief (Pmc Offset: 0x0070) PMC Fast Startup Mode Register */ + __IO uint32_t PMC_FSPR; /**< \brief (Pmc Offset: 0x0074) PMC Fast Startup Polarity Register */ + __O uint32_t PMC_FOCR; /**< \brief (Pmc Offset: 0x0078) Fault Output Clear Register */ + __I uint32_t Reserved6[1]; + __IO uint32_t PMC_PLLICPR; /**< \brief (Pmc Offset: 0x0080) PLL Charge Pump Current Register */ + __I uint32_t Reserved7[24]; + __IO uint32_t PMC_WPMR; /**< \brief (Pmc Offset: 0x00E4) Write ProtectIon Mode Register */ + __I uint32_t PMC_WPSR; /**< \brief (Pmc Offset: 0x00E8) Write Protection Status Register */ + __I uint32_t Reserved8[4]; + __I uint32_t PMC_VERSION; /**< \brief (Pmc Offset: 0x00FC) Version Register */ + __O uint32_t PMC_PCER1; /**< \brief (Pmc Offset: 0x0100) Peripheral Clock Enable Register 1 */ + __O uint32_t PMC_PCDR1; /**< \brief (Pmc Offset: 0x0104) Peripheral Clock Disable Register 1 */ + __I uint32_t PMC_PCSR1; /**< \brief (Pmc Offset: 0x0108) Peripheral Clock Status Register 1 */ + __IO uint32_t PMC_PCR; /**< \brief (Pmc Offset: 0x010C) Peripheral Control Register */ + __IO uint32_t PMC_OCR; /**< \brief (Pmc Offset: 0x0110) Oscillator Calibration Register */ + __I uint32_t Reserved9[12]; + __I uint32_t PMC_SLPWK_AIPR; /**< \brief (Pmc Offset: 0x0144) SleepWalking Activity In Progress Register */ + __IO uint32_t PMC_SLPWKCR; /**< \brief (Pmc Offset: 0x0148) SleepWalking Control Register */ + __IO uint32_t PMC_AUDIO_PLL0; /**< \brief (Pmc Offset: 0x014C) Audio PLL Register 0 */ + __IO uint32_t PMC_AUDIO_PLL1; /**< \brief (Pmc Offset: 0x0150) Audio PLL Register 1 */ +} Pmc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- PMC_SCER : (PMC Offset: 0x0000) System Clock Enable Register -------- */ +#define PMC_SCER_DDRCK (0x1u << 2) /**< \brief (PMC_SCER) DDR Clock Enable */ +#define PMC_SCER_LCDCK (0x1u << 3) /**< \brief (PMC_SCER) LCD2x Clock Enable */ +#define PMC_SCER_UHP (0x1u << 6) /**< \brief (PMC_SCER) USB Host OHCI Clocks Enable */ +#define PMC_SCER_UDP (0x1u << 7) /**< \brief (PMC_SCER) USB Device Clock Enable */ +#define PMC_SCER_PCK0 (0x1u << 8) /**< \brief (PMC_SCER) Programmable Clock 0 Output Enable */ +#define PMC_SCER_PCK1 (0x1u << 9) /**< \brief (PMC_SCER) Programmable Clock 1 Output Enable */ +#define PMC_SCER_PCK2 (0x1u << 10) /**< \brief (PMC_SCER) Programmable Clock 2 Output Enable */ +#define PMC_SCER_ISCCK (0x1u << 18) /**< \brief (PMC_SCER) ISC Clock Enable */ +/* -------- PMC_SCDR : (PMC Offset: 0x0004) System Clock Disable Register -------- */ +#define PMC_SCDR_PCK (0x1u << 0) /**< \brief (PMC_SCDR) Processor Clock Disable */ +#define PMC_SCDR_DDRCK (0x1u << 2) /**< \brief (PMC_SCDR) DDR Clock Disable */ +#define PMC_SCDR_LCDCK (0x1u << 3) /**< \brief (PMC_SCDR) LCD2x Clock Disable */ +#define PMC_SCDR_UHP (0x1u << 6) /**< \brief (PMC_SCDR) USB Host OHCI Clock Disable */ +#define PMC_SCDR_UDP (0x1u << 7) /**< \brief (PMC_SCDR) USB Device Clock Enable */ +#define PMC_SCDR_PCK0 (0x1u << 8) /**< \brief (PMC_SCDR) Programmable Clock 0 Output Disable */ +#define PMC_SCDR_PCK1 (0x1u << 9) /**< \brief (PMC_SCDR) Programmable Clock 1 Output Disable */ +#define PMC_SCDR_PCK2 (0x1u << 10) /**< \brief (PMC_SCDR) Programmable Clock 2 Output Disable */ +#define PMC_SCDR_ISCCK (0x1u << 18) /**< \brief (PMC_SCDR) ISC Clock Disable */ +/* -------- PMC_SCSR : (PMC Offset: 0x0008) System Clock Status Register -------- */ +#define PMC_SCSR_PCK (0x1u << 0) /**< \brief (PMC_SCSR) Processor Clock Status */ +#define PMC_SCSR_DDRCK (0x1u << 2) /**< \brief (PMC_SCSR) DDR Clock Status */ +#define PMC_SCSR_LCDCK (0x1u << 3) /**< \brief (PMC_SCSR) LCD2x Clock Status */ +#define PMC_SCSR_UHP (0x1u << 6) /**< \brief (PMC_SCSR) USB Host Port Clock Status */ +#define PMC_SCSR_UDP (0x1u << 7) /**< \brief (PMC_SCSR) USB Device Port Clock Status */ +#define PMC_SCSR_PCK0 (0x1u << 8) /**< \brief (PMC_SCSR) Programmable Clock 0 Output Status */ +#define PMC_SCSR_PCK1 (0x1u << 9) /**< \brief (PMC_SCSR) Programmable Clock 1 Output Status */ +#define PMC_SCSR_PCK2 (0x1u << 10) /**< \brief (PMC_SCSR) Programmable Clock 2 Output Status */ +#define PMC_SCSR_ISCCK (0x1u << 18) /**< \brief (PMC_SCSR) ISC Clock Status */ +/* -------- PMC_PCER0 : (PMC Offset: 0x0010) Peripheral Clock Enable Register 0 -------- */ +#define PMC_PCER0_PID2 (0x1u << 2) /**< \brief (PMC_PCER0) Peripheral Clock 2 Enable */ +#define PMC_PCER0_PID3 (0x1u << 3) /**< \brief (PMC_PCER0) Peripheral Clock 3 Enable */ +#define PMC_PCER0_PID4 (0x1u << 4) /**< \brief (PMC_PCER0) Peripheral Clock 4 Enable */ +#define PMC_PCER0_PID5 (0x1u << 5) /**< \brief (PMC_PCER0) Peripheral Clock 5 Enable */ +#define PMC_PCER0_PID6 (0x1u << 6) /**< \brief (PMC_PCER0) Peripheral Clock 6 Enable */ +#define PMC_PCER0_PID7 (0x1u << 7) /**< \brief (PMC_PCER0) Peripheral Clock 7 Enable */ +#define PMC_PCER0_PID8 (0x1u << 8) /**< \brief (PMC_PCER0) Peripheral Clock 8 Enable */ +#define PMC_PCER0_PID9 (0x1u << 9) /**< \brief (PMC_PCER0) Peripheral Clock 9 Enable */ +#define PMC_PCER0_PID10 (0x1u << 10) /**< \brief (PMC_PCER0) Peripheral Clock 10 Enable */ +#define PMC_PCER0_PID11 (0x1u << 11) /**< \brief (PMC_PCER0) Peripheral Clock 11 Enable */ +#define PMC_PCER0_PID12 (0x1u << 12) /**< \brief (PMC_PCER0) Peripheral Clock 12 Enable */ +#define PMC_PCER0_PID13 (0x1u << 13) /**< \brief (PMC_PCER0) Peripheral Clock 13 Enable */ +#define PMC_PCER0_PID14 (0x1u << 14) /**< \brief (PMC_PCER0) Peripheral Clock 14 Enable */ +#define PMC_PCER0_PID15 (0x1u << 15) /**< \brief (PMC_PCER0) Peripheral Clock 15 Enable */ +#define PMC_PCER0_PID16 (0x1u << 16) /**< \brief (PMC_PCER0) Peripheral Clock 16 Enable */ +#define PMC_PCER0_PID17 (0x1u << 17) /**< \brief (PMC_PCER0) Peripheral Clock 17 Enable */ +#define PMC_PCER0_PID18 (0x1u << 18) /**< \brief (PMC_PCER0) Peripheral Clock 18 Enable */ +#define PMC_PCER0_PID19 (0x1u << 19) /**< \brief (PMC_PCER0) Peripheral Clock 19 Enable */ +#define PMC_PCER0_PID20 (0x1u << 20) /**< \brief (PMC_PCER0) Peripheral Clock 20 Enable */ +#define PMC_PCER0_PID21 (0x1u << 21) /**< \brief (PMC_PCER0) Peripheral Clock 21 Enable */ +#define PMC_PCER0_PID22 (0x1u << 22) /**< \brief (PMC_PCER0) Peripheral Clock 22 Enable */ +#define PMC_PCER0_PID23 (0x1u << 23) /**< \brief (PMC_PCER0) Peripheral Clock 23 Enable */ +#define PMC_PCER0_PID24 (0x1u << 24) /**< \brief (PMC_PCER0) Peripheral Clock 24 Enable */ +#define PMC_PCER0_PID25 (0x1u << 25) /**< \brief (PMC_PCER0) Peripheral Clock 25 Enable */ +#define PMC_PCER0_PID26 (0x1u << 26) /**< \brief (PMC_PCER0) Peripheral Clock 26 Enable */ +#define PMC_PCER0_PID27 (0x1u << 27) /**< \brief (PMC_PCER0) Peripheral Clock 27 Enable */ +#define PMC_PCER0_PID28 (0x1u << 28) /**< \brief (PMC_PCER0) Peripheral Clock 28 Enable */ +#define PMC_PCER0_PID29 (0x1u << 29) /**< \brief (PMC_PCER0) Peripheral Clock 29 Enable */ +#define PMC_PCER0_PID30 (0x1u << 30) /**< \brief (PMC_PCER0) Peripheral Clock 30 Enable */ +#define PMC_PCER0_PID31 (0x1u << 31) /**< \brief (PMC_PCER0) Peripheral Clock 31 Enable */ +/* -------- PMC_PCDR0 : (PMC Offset: 0x0014) Peripheral Clock Disable Register 0 -------- */ +#define PMC_PCDR0_PID2 (0x1u << 2) /**< \brief (PMC_PCDR0) Peripheral Clock 2 Disable */ +#define PMC_PCDR0_PID3 (0x1u << 3) /**< \brief (PMC_PCDR0) Peripheral Clock 3 Disable */ +#define PMC_PCDR0_PID4 (0x1u << 4) /**< \brief (PMC_PCDR0) Peripheral Clock 4 Disable */ +#define PMC_PCDR0_PID5 (0x1u << 5) /**< \brief (PMC_PCDR0) Peripheral Clock 5 Disable */ +#define PMC_PCDR0_PID6 (0x1u << 6) /**< \brief (PMC_PCDR0) Peripheral Clock 6 Disable */ +#define PMC_PCDR0_PID7 (0x1u << 7) /**< \brief (PMC_PCDR0) Peripheral Clock 7 Disable */ +#define PMC_PCDR0_PID8 (0x1u << 8) /**< \brief (PMC_PCDR0) Peripheral Clock 8 Disable */ +#define PMC_PCDR0_PID9 (0x1u << 9) /**< \brief (PMC_PCDR0) Peripheral Clock 9 Disable */ +#define PMC_PCDR0_PID10 (0x1u << 10) /**< \brief (PMC_PCDR0) Peripheral Clock 10 Disable */ +#define PMC_PCDR0_PID11 (0x1u << 11) /**< \brief (PMC_PCDR0) Peripheral Clock 11 Disable */ +#define PMC_PCDR0_PID12 (0x1u << 12) /**< \brief (PMC_PCDR0) Peripheral Clock 12 Disable */ +#define PMC_PCDR0_PID13 (0x1u << 13) /**< \brief (PMC_PCDR0) Peripheral Clock 13 Disable */ +#define PMC_PCDR0_PID14 (0x1u << 14) /**< \brief (PMC_PCDR0) Peripheral Clock 14 Disable */ +#define PMC_PCDR0_PID15 (0x1u << 15) /**< \brief (PMC_PCDR0) Peripheral Clock 15 Disable */ +#define PMC_PCDR0_PID16 (0x1u << 16) /**< \brief (PMC_PCDR0) Peripheral Clock 16 Disable */ +#define PMC_PCDR0_PID17 (0x1u << 17) /**< \brief (PMC_PCDR0) Peripheral Clock 17 Disable */ +#define PMC_PCDR0_PID18 (0x1u << 18) /**< \brief (PMC_PCDR0) Peripheral Clock 18 Disable */ +#define PMC_PCDR0_PID19 (0x1u << 19) /**< \brief (PMC_PCDR0) Peripheral Clock 19 Disable */ +#define PMC_PCDR0_PID20 (0x1u << 20) /**< \brief (PMC_PCDR0) Peripheral Clock 20 Disable */ +#define PMC_PCDR0_PID21 (0x1u << 21) /**< \brief (PMC_PCDR0) Peripheral Clock 21 Disable */ +#define PMC_PCDR0_PID22 (0x1u << 22) /**< \brief (PMC_PCDR0) Peripheral Clock 22 Disable */ +#define PMC_PCDR0_PID23 (0x1u << 23) /**< \brief (PMC_PCDR0) Peripheral Clock 23 Disable */ +#define PMC_PCDR0_PID24 (0x1u << 24) /**< \brief (PMC_PCDR0) Peripheral Clock 24 Disable */ +#define PMC_PCDR0_PID25 (0x1u << 25) /**< \brief (PMC_PCDR0) Peripheral Clock 25 Disable */ +#define PMC_PCDR0_PID26 (0x1u << 26) /**< \brief (PMC_PCDR0) Peripheral Clock 26 Disable */ +#define PMC_PCDR0_PID27 (0x1u << 27) /**< \brief (PMC_PCDR0) Peripheral Clock 27 Disable */ +#define PMC_PCDR0_PID28 (0x1u << 28) /**< \brief (PMC_PCDR0) Peripheral Clock 28 Disable */ +#define PMC_PCDR0_PID29 (0x1u << 29) /**< \brief (PMC_PCDR0) Peripheral Clock 29 Disable */ +#define PMC_PCDR0_PID30 (0x1u << 30) /**< \brief (PMC_PCDR0) Peripheral Clock 30 Disable */ +#define PMC_PCDR0_PID31 (0x1u << 31) /**< \brief (PMC_PCDR0) Peripheral Clock 31 Disable */ +/* -------- PMC_PCSR0 : (PMC Offset: 0x0018) Peripheral Clock Status Register 0 -------- */ +#define PMC_PCSR0_PID2 (0x1u << 2) /**< \brief (PMC_PCSR0) Peripheral Clock 2 Status */ +#define PMC_PCSR0_PID3 (0x1u << 3) /**< \brief (PMC_PCSR0) Peripheral Clock 3 Status */ +#define PMC_PCSR0_PID4 (0x1u << 4) /**< \brief (PMC_PCSR0) Peripheral Clock 4 Status */ +#define PMC_PCSR0_PID5 (0x1u << 5) /**< \brief (PMC_PCSR0) Peripheral Clock 5 Status */ +#define PMC_PCSR0_PID6 (0x1u << 6) /**< \brief (PMC_PCSR0) Peripheral Clock 6 Status */ +#define PMC_PCSR0_PID7 (0x1u << 7) /**< \brief (PMC_PCSR0) Peripheral Clock 7 Status */ +#define PMC_PCSR0_PID8 (0x1u << 8) /**< \brief (PMC_PCSR0) Peripheral Clock 8 Status */ +#define PMC_PCSR0_PID9 (0x1u << 9) /**< \brief (PMC_PCSR0) Peripheral Clock 9 Status */ +#define PMC_PCSR0_PID10 (0x1u << 10) /**< \brief (PMC_PCSR0) Peripheral Clock 10 Status */ +#define PMC_PCSR0_PID11 (0x1u << 11) /**< \brief (PMC_PCSR0) Peripheral Clock 11 Status */ +#define PMC_PCSR0_PID12 (0x1u << 12) /**< \brief (PMC_PCSR0) Peripheral Clock 12 Status */ +#define PMC_PCSR0_PID13 (0x1u << 13) /**< \brief (PMC_PCSR0) Peripheral Clock 13 Status */ +#define PMC_PCSR0_PID14 (0x1u << 14) /**< \brief (PMC_PCSR0) Peripheral Clock 14 Status */ +#define PMC_PCSR0_PID15 (0x1u << 15) /**< \brief (PMC_PCSR0) Peripheral Clock 15 Status */ +#define PMC_PCSR0_PID16 (0x1u << 16) /**< \brief (PMC_PCSR0) Peripheral Clock 16 Status */ +#define PMC_PCSR0_PID17 (0x1u << 17) /**< \brief (PMC_PCSR0) Peripheral Clock 17 Status */ +#define PMC_PCSR0_PID18 (0x1u << 18) /**< \brief (PMC_PCSR0) Peripheral Clock 18 Status */ +#define PMC_PCSR0_PID19 (0x1u << 19) /**< \brief (PMC_PCSR0) Peripheral Clock 19 Status */ +#define PMC_PCSR0_PID20 (0x1u << 20) /**< \brief (PMC_PCSR0) Peripheral Clock 20 Status */ +#define PMC_PCSR0_PID21 (0x1u << 21) /**< \brief (PMC_PCSR0) Peripheral Clock 21 Status */ +#define PMC_PCSR0_PID22 (0x1u << 22) /**< \brief (PMC_PCSR0) Peripheral Clock 22 Status */ +#define PMC_PCSR0_PID23 (0x1u << 23) /**< \brief (PMC_PCSR0) Peripheral Clock 23 Status */ +#define PMC_PCSR0_PID24 (0x1u << 24) /**< \brief (PMC_PCSR0) Peripheral Clock 24 Status */ +#define PMC_PCSR0_PID25 (0x1u << 25) /**< \brief (PMC_PCSR0) Peripheral Clock 25 Status */ +#define PMC_PCSR0_PID26 (0x1u << 26) /**< \brief (PMC_PCSR0) Peripheral Clock 26 Status */ +#define PMC_PCSR0_PID27 (0x1u << 27) /**< \brief (PMC_PCSR0) Peripheral Clock 27 Status */ +#define PMC_PCSR0_PID28 (0x1u << 28) /**< \brief (PMC_PCSR0) Peripheral Clock 28 Status */ +#define PMC_PCSR0_PID29 (0x1u << 29) /**< \brief (PMC_PCSR0) Peripheral Clock 29 Status */ +#define PMC_PCSR0_PID30 (0x1u << 30) /**< \brief (PMC_PCSR0) Peripheral Clock 30 Status */ +#define PMC_PCSR0_PID31 (0x1u << 31) /**< \brief (PMC_PCSR0) Peripheral Clock 31 Status */ +/* -------- CKGR_UCKR : (PMC Offset: 0x001C) UTMI Clock Register -------- */ +#define CKGR_UCKR_UPLLEN (0x1u << 16) /**< \brief (CKGR_UCKR) UTMI PLL Enable */ +#define CKGR_UCKR_UPLLCOUNT_Pos 20 +#define CKGR_UCKR_UPLLCOUNT_Msk (0xfu << CKGR_UCKR_UPLLCOUNT_Pos) /**< \brief (CKGR_UCKR) UTMI PLL Start-up Time */ +#define CKGR_UCKR_UPLLCOUNT(value) ((CKGR_UCKR_UPLLCOUNT_Msk & ((value) << CKGR_UCKR_UPLLCOUNT_Pos))) +#define CKGR_UCKR_BIASEN (0x1u << 24) /**< \brief (CKGR_UCKR) UTMI BIAS Enable */ +#define CKGR_UCKR_BIASCOUNT_Pos 28 +#define CKGR_UCKR_BIASCOUNT_Msk (0xfu << CKGR_UCKR_BIASCOUNT_Pos) /**< \brief (CKGR_UCKR) UTMI BIAS Start-up Time */ +#define CKGR_UCKR_BIASCOUNT(value) ((CKGR_UCKR_BIASCOUNT_Msk & ((value) << CKGR_UCKR_BIASCOUNT_Pos))) +/* -------- CKGR_MOR : (PMC Offset: 0x0020) Main Oscillator Register -------- */ +#define CKGR_MOR_MOSCXTEN (0x1u << 0) /**< \brief (CKGR_MOR) 8 to 24MHz Crystal Oscillator Enable */ +#define CKGR_MOR_MOSCXTBY (0x1u << 1) /**< \brief (CKGR_MOR) 8 to 24MHz Crystal Oscillator Bypass */ +#define CKGR_MOR_MOSCRCEN (0x1u << 3) /**< \brief (CKGR_MOR) 12 MHz RC Oscillator Enable */ +#define CKGR_MOR_MOSCXTST_Pos 8 +#define CKGR_MOR_MOSCXTST_Msk (0xffu << CKGR_MOR_MOSCXTST_Pos) /**< \brief (CKGR_MOR) 8 to 24MHz Crystal Oscillator Startup Time */ +#define CKGR_MOR_MOSCXTST(value) ((CKGR_MOR_MOSCXTST_Msk & ((value) << CKGR_MOR_MOSCXTST_Pos))) +#define CKGR_MOR_KEY_Pos 16 +#define CKGR_MOR_KEY_Msk (0xffu << CKGR_MOR_KEY_Pos) /**< \brief (CKGR_MOR) Password */ +#define CKGR_MOR_KEY(value) ((CKGR_MOR_KEY_Msk & ((value) << CKGR_MOR_KEY_Pos))) +#define CKGR_MOR_KEY_PASSWD (0x37u << 16) /**< \brief (CKGR_MOR) Writing any other value in this field aborts the write operation. */ +#define CKGR_MOR_MOSCSEL (0x1u << 24) /**< \brief (CKGR_MOR) Main Clock Oscillator Selection */ +#define CKGR_MOR_CFDEN (0x1u << 25) /**< \brief (CKGR_MOR) Clock Failure Detector Enable */ +/* -------- CKGR_MCFR : (PMC Offset: 0x0024) Main Clock Frequency Register -------- */ +#define CKGR_MCFR_MAINF_Pos 0 +#define CKGR_MCFR_MAINF_Msk (0xffffu << CKGR_MCFR_MAINF_Pos) /**< \brief (CKGR_MCFR) Main Clock Frequency */ +#define CKGR_MCFR_MAINF(value) ((CKGR_MCFR_MAINF_Msk & ((value) << CKGR_MCFR_MAINF_Pos))) +#define CKGR_MCFR_MAINFRDY (0x1u << 16) /**< \brief (CKGR_MCFR) Main Clock Frequency Measure Ready */ +#define CKGR_MCFR_RCMEAS (0x1u << 20) /**< \brief (CKGR_MCFR) RC Oscillator Frequency Measure (write-only) */ +#define CKGR_MCFR_CCSS (0x1u << 24) /**< \brief (CKGR_MCFR) Counter Clock Source Selection */ +/* -------- CKGR_PLLAR : (PMC Offset: 0x0028) PLLA Register -------- */ +#define CKGR_PLLAR_DIVA_Pos 0 +#define CKGR_PLLAR_DIVA_Msk (0xffu << CKGR_PLLAR_DIVA_Pos) /**< \brief (CKGR_PLLAR) Divider A */ +#define CKGR_PLLAR_DIVA(value) ((CKGR_PLLAR_DIVA_Msk & ((value) << CKGR_PLLAR_DIVA_Pos))) +#define CKGR_PLLAR_DIVA_0 (0x0u << 0) /**< \brief (CKGR_PLLAR) Divider output is 0 */ +#define CKGR_PLLAR_DIVA_BYPASS (0x1u << 0) /**< \brief (CKGR_PLLAR) Divider is bypassed */ +#define CKGR_PLLAR_PLLACOUNT_Pos 8 +#define CKGR_PLLAR_PLLACOUNT_Msk (0x3fu << CKGR_PLLAR_PLLACOUNT_Pos) /**< \brief (CKGR_PLLAR) PLLA Counter */ +#define CKGR_PLLAR_PLLACOUNT(value) ((CKGR_PLLAR_PLLACOUNT_Msk & ((value) << CKGR_PLLAR_PLLACOUNT_Pos))) +#define CKGR_PLLAR_OUTA_Pos 14 +#define CKGR_PLLAR_OUTA_Msk (0xfu << CKGR_PLLAR_OUTA_Pos) /**< \brief (CKGR_PLLAR) PLLA Clock Frequency Range */ +#define CKGR_PLLAR_OUTA(value) ((CKGR_PLLAR_OUTA_Msk & ((value) << CKGR_PLLAR_OUTA_Pos))) +#define CKGR_PLLAR_MULA_Pos 18 +#define CKGR_PLLAR_MULA_Msk (0x7fu << CKGR_PLLAR_MULA_Pos) /**< \brief (CKGR_PLLAR) PLLA Multiplier */ +#define CKGR_PLLAR_MULA(value) ((CKGR_PLLAR_MULA_Msk & ((value) << CKGR_PLLAR_MULA_Pos))) +#define CKGR_PLLAR_ONE (0x1u << 29) /**< \brief (CKGR_PLLAR) Must Be Set to 1 */ +/* -------- PMC_MCKR : (PMC Offset: 0x0030) Master Clock Register -------- */ +#define PMC_MCKR_CSS_Pos 0 +#define PMC_MCKR_CSS_Msk (0x3u << PMC_MCKR_CSS_Pos) /**< \brief (PMC_MCKR) Master/Processor Clock Source Selection */ +#define PMC_MCKR_CSS(value) ((PMC_MCKR_CSS_Msk & ((value) << PMC_MCKR_CSS_Pos))) +#define PMC_MCKR_CSS_SLOW_CLK (0x0u << 0) /**< \brief (PMC_MCKR) Slow clock is selected */ +#define PMC_MCKR_CSS_MAIN_CLK (0x1u << 0) /**< \brief (PMC_MCKR) Main clock is selected */ +#define PMC_MCKR_CSS_PLLA_CLK (0x2u << 0) /**< \brief (PMC_MCKR) PLLACK is selected */ +#define PMC_MCKR_CSS_UPLL_CLK (0x3u << 0) /**< \brief (PMC_MCKR) UPLL Clock is selected */ +#define PMC_MCKR_PRES_Pos 4 +#define PMC_MCKR_PRES_Msk (0x7u << PMC_MCKR_PRES_Pos) /**< \brief (PMC_MCKR) Master/Processor Clock Prescaler */ +#define PMC_MCKR_PRES(value) ((PMC_MCKR_PRES_Msk & ((value) << PMC_MCKR_PRES_Pos))) +#define PMC_MCKR_PRES_CLOCK (0x0u << 4) /**< \brief (PMC_MCKR) Selected clock */ +#define PMC_MCKR_PRES_CLOCK_DIV2 (0x1u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 2 */ +#define PMC_MCKR_PRES_CLOCK_DIV4 (0x2u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 4 */ +#define PMC_MCKR_PRES_CLOCK_DIV8 (0x3u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 8 */ +#define PMC_MCKR_PRES_CLOCK_DIV16 (0x4u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 16 */ +#define PMC_MCKR_PRES_CLOCK_DIV32 (0x5u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 32 */ +#define PMC_MCKR_PRES_CLOCK_DIV64 (0x6u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 64 */ +#define PMC_MCKR_MDIV_Pos 8 +#define PMC_MCKR_MDIV_Msk (0x3u << PMC_MCKR_MDIV_Pos) /**< \brief (PMC_MCKR) Master Clock Division */ +#define PMC_MCKR_MDIV(value) ((PMC_MCKR_MDIV_Msk & ((value) << PMC_MCKR_MDIV_Pos))) +#define PMC_MCKR_MDIV_EQ_PCK (0x0u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 1. WARNING: SysClk DDR and DDRCK are not available. */ +#define PMC_MCKR_MDIV_PCK_DIV2 (0x1u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 2. SysClk DDR is equal to 2 x MCK. DDRCK is equal to MCK. */ +#define PMC_MCKR_MDIV_PCK_DIV4 (0x2u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 4. SysClk DDR is equal to 2 x MCK. DDRCK is equal to MCK. */ +#define PMC_MCKR_MDIV_PCK_DIV3 (0x3u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 3. SysClk DDR is equal to 2 x MCK. DDRCK is equal to MCK. */ +#define PMC_MCKR_PLLADIV2 (0x1u << 12) /**< \brief (PMC_MCKR) PLLA Divisor by 2 */ +#define PMC_MCKR_H32MXDIV (0x1u << 24) /**< \brief (PMC_MCKR) AHB 32-bit Matrix Divisor */ +#define PMC_MCKR_H32MXDIV_H32MXDIV1 (0x0u << 24) /**< \brief (PMC_MCKR) The AHB 32-bit Matrix frequency is equal to the AHB 64-bit Matrix frequency. It is possible only if the AHB 64-bit Matrix frequency does not exceed 90 MHz. */ +#define PMC_MCKR_H32MXDIV_H32MXDIV2 (0x1u << 24) /**< \brief (PMC_MCKR) The AHB 32-bit Matrix frequency is equal to the AHB 64-bit Matrix frequency divided by 2. */ +/* -------- PMC_USB : (PMC Offset: 0x0038) USB Clock Register -------- */ +#define PMC_USB_USBS (0x1u << 0) /**< \brief (PMC_USB) USB OHCI Input Clock Selection */ +#define PMC_USB_USBDIV_Pos 8 +#define PMC_USB_USBDIV_Msk (0xfu << PMC_USB_USBDIV_Pos) /**< \brief (PMC_USB) Divider for USB OHCI Clock */ +#define PMC_USB_USBDIV(value) ((PMC_USB_USBDIV_Msk & ((value) << PMC_USB_USBDIV_Pos))) +/* -------- PMC_PCK[3] : (PMC Offset: 0x0040) Programmable Clock 0 Register -------- */ +#define PMC_PCK_CSS_Pos 0 +#define PMC_PCK_CSS_Msk (0x7u << PMC_PCK_CSS_Pos) /**< \brief (PMC_PCK[3]) Master Clock Source Selection */ +#define PMC_PCK_CSS(value) ((PMC_PCK_CSS_Msk & ((value) << PMC_PCK_CSS_Pos))) +#define PMC_PCK_CSS_SLOW_CLK (0x0u << 0) /**< \brief (PMC_PCK[3]) Slow clock is selected */ +#define PMC_PCK_CSS_MAIN_CLK (0x1u << 0) /**< \brief (PMC_PCK[3]) Main clock is selected */ +#define PMC_PCK_CSS_PLLA_CLK (0x2u << 0) /**< \brief (PMC_PCK[3]) PLLACK is selected */ +#define PMC_PCK_CSS_UPLL_CLK (0x3u << 0) /**< \brief (PMC_PCK[3]) UPLL Clock is selected */ +#define PMC_PCK_CSS_MCK_CLK (0x4u << 0) /**< \brief (PMC_PCK[3]) Master Clock is selected */ +#define PMC_PCK_CSS_AUDIO_CLK (0x5u << 0) /**< \brief (PMC_PCK[3]) Audio PLL clock is selected */ +#define PMC_PCK_PRES_Pos 4 +#define PMC_PCK_PRES_Msk (0xffu << PMC_PCK_PRES_Pos) /**< \brief (PMC_PCK[3]) Programmable Clock Prescaler */ +#define PMC_PCK_PRES(value) ((PMC_PCK_PRES_Msk & ((value) << PMC_PCK_PRES_Pos))) +/* -------- PMC_IER : (PMC Offset: 0x0060) Interrupt Enable Register -------- */ +#define PMC_IER_MOSCXTS (0x1u << 0) /**< \brief (PMC_IER) 8 to 24MHz Crystal Oscillator Status Interrupt Enable */ +#define PMC_IER_LOCKA (0x1u << 1) /**< \brief (PMC_IER) PLLA Lock Interrupt Enable */ +#define PMC_IER_MCKRDY (0x1u << 3) /**< \brief (PMC_IER) Master Clock Ready Interrupt Enable */ +#define PMC_IER_LOCKU (0x1u << 6) /**< \brief (PMC_IER) UTMI PLL Lock Interrupt Enable */ +#define PMC_IER_PCKRDY0 (0x1u << 8) /**< \brief (PMC_IER) Programmable Clock Ready 0 Interrupt Enable */ +#define PMC_IER_PCKRDY1 (0x1u << 9) /**< \brief (PMC_IER) Programmable Clock Ready 1 Interrupt Enable */ +#define PMC_IER_PCKRDY2 (0x1u << 10) /**< \brief (PMC_IER) Programmable Clock Ready 2 Interrupt Enable */ +#define PMC_IER_MOSCSELS (0x1u << 16) /**< \brief (PMC_IER) Main Clock Source Oscillator Selection Status Interrupt Enable */ +#define PMC_IER_CFDEV (0x1u << 18) /**< \brief (PMC_IER) Clock Failure Detector Event Interrupt Enable */ +/* -------- PMC_IDR : (PMC Offset: 0x0064) Interrupt Disable Register -------- */ +#define PMC_IDR_MOSCXTS (0x1u << 0) /**< \brief (PMC_IDR) 8 to 24MHz Crystal Oscillator Status Interrupt Disable */ +#define PMC_IDR_LOCKA (0x1u << 1) /**< \brief (PMC_IDR) PLLA Lock Interrupt Disable */ +#define PMC_IDR_MCKRDY (0x1u << 3) /**< \brief (PMC_IDR) Master Clock Ready Interrupt Disable */ +#define PMC_IDR_LOCKU (0x1u << 6) /**< \brief (PMC_IDR) UTMI PLL Lock Interrupt Enable */ +#define PMC_IDR_PCKRDY0 (0x1u << 8) /**< \brief (PMC_IDR) Programmable Clock Ready 0 Interrupt Disable */ +#define PMC_IDR_PCKRDY1 (0x1u << 9) /**< \brief (PMC_IDR) Programmable Clock Ready 1 Interrupt Disable */ +#define PMC_IDR_PCKRDY2 (0x1u << 10) /**< \brief (PMC_IDR) Programmable Clock Ready 2 Interrupt Disable */ +#define PMC_IDR_MOSCSELS (0x1u << 16) /**< \brief (PMC_IDR) Main Oscillator Clock Source Selection Status Interrupt Disable */ +#define PMC_IDR_CFDEV (0x1u << 18) /**< \brief (PMC_IDR) Clock Failure Detector Event Interrupt Disable */ +/* -------- PMC_SR : (PMC Offset: 0x0068) Status Register -------- */ +#define PMC_SR_MOSCXTS (0x1u << 0) /**< \brief (PMC_SR) 8 to 24MHz Crystal Oscillator Status */ +#define PMC_SR_LOCKA (0x1u << 1) /**< \brief (PMC_SR) PLLA Lock Status */ +#define PMC_SR_MCKRDY (0x1u << 3) /**< \brief (PMC_SR) Master Clock Status */ +#define PMC_SR_LOCKU (0x1u << 6) /**< \brief (PMC_SR) UPLL Clock Status */ +#define PMC_SR_OSCSELS (0x1u << 7) /**< \brief (PMC_SR) Slow Clock Oscillator Selection */ +#define PMC_SR_PCKRDY0 (0x1u << 8) /**< \brief (PMC_SR) Programmable Clock Ready Status */ +#define PMC_SR_PCKRDY1 (0x1u << 9) /**< \brief (PMC_SR) Programmable Clock Ready Status */ +#define PMC_SR_PCKRDY2 (0x1u << 10) /**< \brief (PMC_SR) Programmable Clock Ready Status */ +#define PMC_SR_MOSCSELS (0x1u << 16) /**< \brief (PMC_SR) Main Oscillator Selection Status */ +#define PMC_SR_MOSCRCS (0x1u << 17) /**< \brief (PMC_SR) 12 MHz RC Oscillator Status */ +#define PMC_SR_CFDEV (0x1u << 18) /**< \brief (PMC_SR) Clock Failure Detector Event */ +#define PMC_SR_CFDS (0x1u << 19) /**< \brief (PMC_SR) Clock Failure Detector Status */ +#define PMC_SR_FOS (0x1u << 20) /**< \brief (PMC_SR) Clock Failure Detector Fault Output Status */ +#define PMC_SR_GCKRDY (0x1u << 24) /**< \brief (PMC_SR) Generated Clocks Status */ +/* -------- PMC_IMR : (PMC Offset: 0x006C) Interrupt Mask Register -------- */ +#define PMC_IMR_MOSCXTS (0x1u << 0) /**< \brief (PMC_IMR) 8 to 24MHz Crystal Oscillator Status Interrupt Mask */ +#define PMC_IMR_LOCKA (0x1u << 1) /**< \brief (PMC_IMR) PLLA Lock Interrupt Mask */ +#define PMC_IMR_MCKRDY (0x1u << 3) /**< \brief (PMC_IMR) Master Clock Ready Interrupt Mask */ +#define PMC_IMR_PCKRDY0 (0x1u << 8) /**< \brief (PMC_IMR) Programmable Clock Ready 0 Interrupt Mask */ +#define PMC_IMR_PCKRDY1 (0x1u << 9) /**< \brief (PMC_IMR) Programmable Clock Ready 1 Interrupt Mask */ +#define PMC_IMR_PCKRDY2 (0x1u << 10) /**< \brief (PMC_IMR) Programmable Clock Ready 2 Interrupt Mask */ +#define PMC_IMR_MOSCSELS (0x1u << 16) /**< \brief (PMC_IMR) Main Oscillator Clock Source Selection Status Interrupt Mask */ +#define PMC_IMR_CFDEV (0x1u << 18) /**< \brief (PMC_IMR) Clock Failure Detector Event Interrupt Mask */ +/* -------- PMC_FSMR : (PMC Offset: 0x0070) PMC Fast Startup Mode Register -------- */ +#define PMC_FSMR_FSTT0 (0x1u << 0) /**< \brief (PMC_FSMR) Fast Startup Input Enable 0 */ +#define PMC_FSMR_FSTT1 (0x1u << 1) /**< \brief (PMC_FSMR) Fast Startup Input Enable 1 */ +#define PMC_FSMR_FSTT2 (0x1u << 2) /**< \brief (PMC_FSMR) Fast Startup Input Enable 2 */ +#define PMC_FSMR_FSTT3 (0x1u << 3) /**< \brief (PMC_FSMR) Fast Startup Input Enable 3 */ +#define PMC_FSMR_FSTT4 (0x1u << 4) /**< \brief (PMC_FSMR) Fast Startup Input Enable 4 */ +#define PMC_FSMR_FSTT5 (0x1u << 5) /**< \brief (PMC_FSMR) Fast Startup Input Enable 5 */ +#define PMC_FSMR_FSTT6 (0x1u << 6) /**< \brief (PMC_FSMR) Fast Startup Input Enable 6 */ +#define PMC_FSMR_FSTT7 (0x1u << 7) /**< \brief (PMC_FSMR) Fast Startup Input Enable 7 */ +#define PMC_FSMR_FSTT8 (0x1u << 8) /**< \brief (PMC_FSMR) Fast Startup Input Enable 8 */ +#define PMC_FSMR_FSTT9 (0x1u << 9) /**< \brief (PMC_FSMR) Fast Startup Input Enable 9 */ +#define PMC_FSMR_FSTT10 (0x1u << 10) /**< \brief (PMC_FSMR) Fast Startup Input Enable 10 */ +#define PMC_FSMR_FSTT11 (0x1u << 11) /**< \brief (PMC_FSMR) Fast Startup Input Enable 11 */ +#define PMC_FSMR_FSTT12 (0x1u << 12) /**< \brief (PMC_FSMR) Fast Startup Input Enable 12 */ +#define PMC_FSMR_FSTT13 (0x1u << 13) /**< \brief (PMC_FSMR) Fast Startup Input Enable 13 */ +#define PMC_FSMR_FSTT14 (0x1u << 14) /**< \brief (PMC_FSMR) Fast Startup Input Enable 14 */ +#define PMC_FSMR_FSTT15 (0x1u << 15) /**< \brief (PMC_FSMR) Fast Startup Input Enable 15 */ +#define PMC_FSMR_RTCAL (0x1u << 17) /**< \brief (PMC_FSMR) RTC Alarm Enable */ +#define PMC_FSMR_USBAL (0x1u << 18) /**< \brief (PMC_FSMR) USB Alarm Enable */ +#define PMC_FSMR_LPM (0x1u << 20) /**< \brief (PMC_FSMR) Low-power Mode */ +#define PMC_FSMR_RXLPAL (0x1u << 24) /**< \brief (PMC_FSMR) Lower-power Receiver Alarm */ +#define PMC_FSMR_ACCAL (0x1u << 25) /**< \brief (PMC_FSMR) Analog Comparator Controller Alarm */ +/* -------- PMC_FSPR : (PMC Offset: 0x0074) PMC Fast Startup Polarity Register -------- */ +#define PMC_FSPR_FSTP0 (0x1u << 0) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP1 (0x1u << 1) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP2 (0x1u << 2) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP3 (0x1u << 3) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP4 (0x1u << 4) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP5 (0x1u << 5) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP6 (0x1u << 6) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP7 (0x1u << 7) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP8 (0x1u << 8) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP9 (0x1u << 9) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP10 (0x1u << 10) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP11 (0x1u << 11) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP12 (0x1u << 12) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP13 (0x1u << 13) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP14 (0x1u << 14) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +#define PMC_FSPR_FSTP15 (0x1u << 15) /**< \brief (PMC_FSPR) Fast Startup Input Polarityx */ +/* -------- PMC_FOCR : (PMC Offset: 0x0078) Fault Output Clear Register -------- */ +#define PMC_FOCR_FOCLR (0x1u << 0) /**< \brief (PMC_FOCR) Fault Output Clear */ +/* -------- PMC_PLLICPR : (PMC Offset: 0x0080) PLL Charge Pump Current Register -------- */ +#define PMC_PLLICPR_ICP_PLLA_Pos 0 +#define PMC_PLLICPR_ICP_PLLA_Msk (0x3u << PMC_PLLICPR_ICP_PLLA_Pos) /**< \brief (PMC_PLLICPR) Must Be Written to Zero */ +#define PMC_PLLICPR_ICP_PLLA(value) ((PMC_PLLICPR_ICP_PLLA_Msk & ((value) << PMC_PLLICPR_ICP_PLLA_Pos))) +#define PMC_PLLICPR_IPLL_PLLA_Pos 8 +#define PMC_PLLICPR_IPLL_PLLA_Msk (0x7u << PMC_PLLICPR_IPLL_PLLA_Pos) /**< \brief (PMC_PLLICPR) Engineering Configuration PLLA */ +#define PMC_PLLICPR_IPLL_PLLA(value) ((PMC_PLLICPR_IPLL_PLLA_Msk & ((value) << PMC_PLLICPR_IPLL_PLLA_Pos))) +#define PMC_PLLICPR_ICP_PLLU_Pos 16 +#define PMC_PLLICPR_ICP_PLLU_Msk (0x3u << PMC_PLLICPR_ICP_PLLU_Pos) /**< \brief (PMC_PLLICPR) Charge Pump Current PLL UTMI */ +#define PMC_PLLICPR_ICP_PLLU(value) ((PMC_PLLICPR_ICP_PLLU_Msk & ((value) << PMC_PLLICPR_ICP_PLLU_Pos))) +#define PMC_PLLICPR_IVCO_PLLU_Pos 24 +#define PMC_PLLICPR_IVCO_PLLU_Msk (0x3u << PMC_PLLICPR_IVCO_PLLU_Pos) /**< \brief (PMC_PLLICPR) Voltage Control Output Current PLL UTMI */ +#define PMC_PLLICPR_IVCO_PLLU(value) ((PMC_PLLICPR_IVCO_PLLU_Msk & ((value) << PMC_PLLICPR_IVCO_PLLU_Pos))) +/* -------- PMC_WPMR : (PMC Offset: 0x00E4) Write ProtectIon Mode Register -------- */ +#define PMC_WPMR_WPEN (0x1u << 0) /**< \brief (PMC_WPMR) Write Protection Enable */ +#define PMC_WPMR_WPKEY_Pos 8 +#define PMC_WPMR_WPKEY_Msk (0xffffffu << PMC_WPMR_WPKEY_Pos) /**< \brief (PMC_WPMR) Write Protection Key */ +#define PMC_WPMR_WPKEY(value) ((PMC_WPMR_WPKEY_Msk & ((value) << PMC_WPMR_WPKEY_Pos))) +#define PMC_WPMR_WPKEY_PASSWD (0x504D43u << 8) /**< \brief (PMC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- PMC_WPSR : (PMC Offset: 0x00E8) Write Protection Status Register -------- */ +#define PMC_WPSR_WPVS (0x1u << 0) /**< \brief (PMC_WPSR) Write Protection Violation Status */ +#define PMC_WPSR_WPVSRC_Pos 8 +#define PMC_WPSR_WPVSRC_Msk (0xffffu << PMC_WPSR_WPVSRC_Pos) /**< \brief (PMC_WPSR) Write Protection Violation Source */ +/* -------- PMC_VERSION : (PMC Offset: 0x00FC) Version Register -------- */ +#define PMC_VERSION_VERSION_Pos 0 +#define PMC_VERSION_VERSION_Msk (0xfffu << PMC_VERSION_VERSION_Pos) /**< \brief (PMC_VERSION) Version of the Hardware Module */ +#define PMC_VERSION_MFN_Pos 16 +#define PMC_VERSION_MFN_Msk (0x7u << PMC_VERSION_MFN_Pos) /**< \brief (PMC_VERSION) Metal Fix Number */ +/* -------- PMC_PCER1 : (PMC Offset: 0x0100) Peripheral Clock Enable Register 1 -------- */ +#define PMC_PCER1_PID32 (0x1u << 0) /**< \brief (PMC_PCER1) Peripheral Clock 32 Enable */ +#define PMC_PCER1_PID33 (0x1u << 1) /**< \brief (PMC_PCER1) Peripheral Clock 33 Enable */ +#define PMC_PCER1_PID34 (0x1u << 2) /**< \brief (PMC_PCER1) Peripheral Clock 34 Enable */ +#define PMC_PCER1_PID35 (0x1u << 3) /**< \brief (PMC_PCER1) Peripheral Clock 35 Enable */ +#define PMC_PCER1_PID36 (0x1u << 4) /**< \brief (PMC_PCER1) Peripheral Clock 36 Enable */ +#define PMC_PCER1_PID37 (0x1u << 5) /**< \brief (PMC_PCER1) Peripheral Clock 37 Enable */ +#define PMC_PCER1_PID38 (0x1u << 6) /**< \brief (PMC_PCER1) Peripheral Clock 38 Enable */ +#define PMC_PCER1_PID39 (0x1u << 7) /**< \brief (PMC_PCER1) Peripheral Clock 39 Enable */ +#define PMC_PCER1_PID40 (0x1u << 8) /**< \brief (PMC_PCER1) Peripheral Clock 40 Enable */ +#define PMC_PCER1_PID41 (0x1u << 9) /**< \brief (PMC_PCER1) Peripheral Clock 41 Enable */ +#define PMC_PCER1_PID42 (0x1u << 10) /**< \brief (PMC_PCER1) Peripheral Clock 42 Enable */ +#define PMC_PCER1_PID43 (0x1u << 11) /**< \brief (PMC_PCER1) Peripheral Clock 43 Enable */ +#define PMC_PCER1_PID44 (0x1u << 12) /**< \brief (PMC_PCER1) Peripheral Clock 44 Enable */ +#define PMC_PCER1_PID45 (0x1u << 13) /**< \brief (PMC_PCER1) Peripheral Clock 45 Enable */ +#define PMC_PCER1_PID46 (0x1u << 14) /**< \brief (PMC_PCER1) Peripheral Clock 46 Enable */ +#define PMC_PCER1_PID47 (0x1u << 15) /**< \brief (PMC_PCER1) Peripheral Clock 47 Enable */ +#define PMC_PCER1_PID48 (0x1u << 16) /**< \brief (PMC_PCER1) Peripheral Clock 48 Enable */ +#define PMC_PCER1_PID49 (0x1u << 17) /**< \brief (PMC_PCER1) Peripheral Clock 49 Enable */ +#define PMC_PCER1_PID50 (0x1u << 18) /**< \brief (PMC_PCER1) Peripheral Clock 50 Enable */ +#define PMC_PCER1_PID51 (0x1u << 19) /**< \brief (PMC_PCER1) Peripheral Clock 51 Enable */ +#define PMC_PCER1_PID52 (0x1u << 20) /**< \brief (PMC_PCER1) Peripheral Clock 52 Enable */ +#define PMC_PCER1_PID53 (0x1u << 21) /**< \brief (PMC_PCER1) Peripheral Clock 53 Enable */ +#define PMC_PCER1_PID54 (0x1u << 22) /**< \brief (PMC_PCER1) Peripheral Clock 54 Enable */ +#define PMC_PCER1_PID55 (0x1u << 23) /**< \brief (PMC_PCER1) Peripheral Clock 55 Enable */ +#define PMC_PCER1_PID56 (0x1u << 24) /**< \brief (PMC_PCER1) Peripheral Clock 56 Enable */ +#define PMC_PCER1_PID57 (0x1u << 25) /**< \brief (PMC_PCER1) Peripheral Clock 57 Enable */ +#define PMC_PCER1_PID58 (0x1u << 26) /**< \brief (PMC_PCER1) Peripheral Clock 58 Enable */ +#define PMC_PCER1_PID59 (0x1u << 27) /**< \brief (PMC_PCER1) Peripheral Clock 59 Enable */ +#define PMC_PCER1_PID60 (0x1u << 28) /**< \brief (PMC_PCER1) Peripheral Clock 60 Enable */ +#define PMC_PCER1_PID61 (0x1u << 29) /**< \brief (PMC_PCER1) Peripheral Clock 61 Enable */ +#define PMC_PCER1_PID62 (0x1u << 30) /**< \brief (PMC_PCER1) Peripheral Clock 62 Enable */ +#define PMC_PCER1_PID63 (0x1u << 31) /**< \brief (PMC_PCER1) Peripheral Clock 63 Enable */ +/* -------- PMC_PCDR1 : (PMC Offset: 0x0104) Peripheral Clock Disable Register 1 -------- */ +#define PMC_PCDR1_PID32 (0x1u << 0) /**< \brief (PMC_PCDR1) Peripheral Clock 32 Disable */ +#define PMC_PCDR1_PID33 (0x1u << 1) /**< \brief (PMC_PCDR1) Peripheral Clock 33 Disable */ +#define PMC_PCDR1_PID34 (0x1u << 2) /**< \brief (PMC_PCDR1) Peripheral Clock 34 Disable */ +#define PMC_PCDR1_PID35 (0x1u << 3) /**< \brief (PMC_PCDR1) Peripheral Clock 35 Disable */ +#define PMC_PCDR1_PID36 (0x1u << 4) /**< \brief (PMC_PCDR1) Peripheral Clock 36 Disable */ +#define PMC_PCDR1_PID37 (0x1u << 5) /**< \brief (PMC_PCDR1) Peripheral Clock 37 Disable */ +#define PMC_PCDR1_PID38 (0x1u << 6) /**< \brief (PMC_PCDR1) Peripheral Clock 38 Disable */ +#define PMC_PCDR1_PID39 (0x1u << 7) /**< \brief (PMC_PCDR1) Peripheral Clock 39 Disable */ +#define PMC_PCDR1_PID40 (0x1u << 8) /**< \brief (PMC_PCDR1) Peripheral Clock 40 Disable */ +#define PMC_PCDR1_PID41 (0x1u << 9) /**< \brief (PMC_PCDR1) Peripheral Clock 41 Disable */ +#define PMC_PCDR1_PID42 (0x1u << 10) /**< \brief (PMC_PCDR1) Peripheral Clock 42 Disable */ +#define PMC_PCDR1_PID43 (0x1u << 11) /**< \brief (PMC_PCDR1) Peripheral Clock 43 Disable */ +#define PMC_PCDR1_PID44 (0x1u << 12) /**< \brief (PMC_PCDR1) Peripheral Clock 44 Disable */ +#define PMC_PCDR1_PID45 (0x1u << 13) /**< \brief (PMC_PCDR1) Peripheral Clock 45 Disable */ +#define PMC_PCDR1_PID46 (0x1u << 14) /**< \brief (PMC_PCDR1) Peripheral Clock 46 Disable */ +#define PMC_PCDR1_PID47 (0x1u << 15) /**< \brief (PMC_PCDR1) Peripheral Clock 47 Disable */ +#define PMC_PCDR1_PID48 (0x1u << 16) /**< \brief (PMC_PCDR1) Peripheral Clock 48 Disable */ +#define PMC_PCDR1_PID49 (0x1u << 17) /**< \brief (PMC_PCDR1) Peripheral Clock 49 Disable */ +#define PMC_PCDR1_PID50 (0x1u << 18) /**< \brief (PMC_PCDR1) Peripheral Clock 50 Disable */ +#define PMC_PCDR1_PID51 (0x1u << 19) /**< \brief (PMC_PCDR1) Peripheral Clock 51 Disable */ +#define PMC_PCDR1_PID52 (0x1u << 20) /**< \brief (PMC_PCDR1) Peripheral Clock 52 Disable */ +#define PMC_PCDR1_PID53 (0x1u << 21) /**< \brief (PMC_PCDR1) Peripheral Clock 53 Disable */ +#define PMC_PCDR1_PID54 (0x1u << 22) /**< \brief (PMC_PCDR1) Peripheral Clock 54 Disable */ +#define PMC_PCDR1_PID55 (0x1u << 23) /**< \brief (PMC_PCDR1) Peripheral Clock 55 Disable */ +#define PMC_PCDR1_PID56 (0x1u << 24) /**< \brief (PMC_PCDR1) Peripheral Clock 56 Disable */ +#define PMC_PCDR1_PID57 (0x1u << 25) /**< \brief (PMC_PCDR1) Peripheral Clock 57 Disable */ +#define PMC_PCDR1_PID58 (0x1u << 26) /**< \brief (PMC_PCDR1) Peripheral Clock 58 Disable */ +#define PMC_PCDR1_PID59 (0x1u << 27) /**< \brief (PMC_PCDR1) Peripheral Clock 59 Disable */ +#define PMC_PCDR1_PID60 (0x1u << 28) /**< \brief (PMC_PCDR1) Peripheral Clock 60 Disable */ +#define PMC_PCDR1_PID61 (0x1u << 29) /**< \brief (PMC_PCDR1) Peripheral Clock 61 Disable */ +#define PMC_PCDR1_PID62 (0x1u << 30) /**< \brief (PMC_PCDR1) Peripheral Clock 62 Disable */ +#define PMC_PCDR1_PID63 (0x1u << 31) /**< \brief (PMC_PCDR1) Peripheral Clock 63 Disable */ +/* -------- PMC_PCSR1 : (PMC Offset: 0x0108) Peripheral Clock Status Register 1 -------- */ +#define PMC_PCSR1_PID32 (0x1u << 0) /**< \brief (PMC_PCSR1) Peripheral Clock 32 Status */ +#define PMC_PCSR1_PID33 (0x1u << 1) /**< \brief (PMC_PCSR1) Peripheral Clock 33 Status */ +#define PMC_PCSR1_PID34 (0x1u << 2) /**< \brief (PMC_PCSR1) Peripheral Clock 34 Status */ +#define PMC_PCSR1_PID35 (0x1u << 3) /**< \brief (PMC_PCSR1) Peripheral Clock 35 Status */ +#define PMC_PCSR1_PID36 (0x1u << 4) /**< \brief (PMC_PCSR1) Peripheral Clock 36 Status */ +#define PMC_PCSR1_PID37 (0x1u << 5) /**< \brief (PMC_PCSR1) Peripheral Clock 37 Status */ +#define PMC_PCSR1_PID38 (0x1u << 6) /**< \brief (PMC_PCSR1) Peripheral Clock 38 Status */ +#define PMC_PCSR1_PID39 (0x1u << 7) /**< \brief (PMC_PCSR1) Peripheral Clock 39 Status */ +#define PMC_PCSR1_PID40 (0x1u << 8) /**< \brief (PMC_PCSR1) Peripheral Clock 40 Status */ +#define PMC_PCSR1_PID41 (0x1u << 9) /**< \brief (PMC_PCSR1) Peripheral Clock 41 Status */ +#define PMC_PCSR1_PID42 (0x1u << 10) /**< \brief (PMC_PCSR1) Peripheral Clock 42 Status */ +#define PMC_PCSR1_PID43 (0x1u << 11) /**< \brief (PMC_PCSR1) Peripheral Clock 43 Status */ +#define PMC_PCSR1_PID44 (0x1u << 12) /**< \brief (PMC_PCSR1) Peripheral Clock 44 Status */ +#define PMC_PCSR1_PID45 (0x1u << 13) /**< \brief (PMC_PCSR1) Peripheral Clock 45 Status */ +#define PMC_PCSR1_PID46 (0x1u << 14) /**< \brief (PMC_PCSR1) Peripheral Clock 46 Status */ +#define PMC_PCSR1_PID47 (0x1u << 15) /**< \brief (PMC_PCSR1) Peripheral Clock 47 Status */ +#define PMC_PCSR1_PID48 (0x1u << 16) /**< \brief (PMC_PCSR1) Peripheral Clock 48 Status */ +#define PMC_PCSR1_PID49 (0x1u << 17) /**< \brief (PMC_PCSR1) Peripheral Clock 49 Status */ +#define PMC_PCSR1_PID50 (0x1u << 18) /**< \brief (PMC_PCSR1) Peripheral Clock 50 Status */ +#define PMC_PCSR1_PID51 (0x1u << 19) /**< \brief (PMC_PCSR1) Peripheral Clock 51 Status */ +#define PMC_PCSR1_PID52 (0x1u << 20) /**< \brief (PMC_PCSR1) Peripheral Clock 52 Status */ +#define PMC_PCSR1_PID53 (0x1u << 21) /**< \brief (PMC_PCSR1) Peripheral Clock 53 Status */ +#define PMC_PCSR1_PID54 (0x1u << 22) /**< \brief (PMC_PCSR1) Peripheral Clock 54 Status */ +#define PMC_PCSR1_PID55 (0x1u << 23) /**< \brief (PMC_PCSR1) Peripheral Clock 55 Status */ +#define PMC_PCSR1_PID56 (0x1u << 24) /**< \brief (PMC_PCSR1) Peripheral Clock 56 Status */ +#define PMC_PCSR1_PID57 (0x1u << 25) /**< \brief (PMC_PCSR1) Peripheral Clock 57 Status */ +#define PMC_PCSR1_PID58 (0x1u << 26) /**< \brief (PMC_PCSR1) Peripheral Clock 58 Status */ +#define PMC_PCSR1_PID59 (0x1u << 27) /**< \brief (PMC_PCSR1) Peripheral Clock 59 Status */ +#define PMC_PCSR1_PID60 (0x1u << 28) /**< \brief (PMC_PCSR1) Peripheral Clock 60 Status */ +#define PMC_PCSR1_PID61 (0x1u << 29) /**< \brief (PMC_PCSR1) Peripheral Clock 61 Status */ +#define PMC_PCSR1_PID62 (0x1u << 30) /**< \brief (PMC_PCSR1) Peripheral Clock 62 Status */ +#define PMC_PCSR1_PID63 (0x1u << 31) /**< \brief (PMC_PCSR1) Peripheral Clock 63 Status */ +/* -------- PMC_PCR : (PMC Offset: 0x010C) Peripheral Control Register -------- */ +#define PMC_PCR_PID_Pos 0 +#define PMC_PCR_PID_Msk (0x7fu << PMC_PCR_PID_Pos) /**< \brief (PMC_PCR) Peripheral ID */ +#define PMC_PCR_PID(value) ((PMC_PCR_PID_Msk & ((value) << PMC_PCR_PID_Pos))) +#define PMC_PCR_GCKCSS_Pos 8 +#define PMC_PCR_GCKCSS_Msk (0x7u << PMC_PCR_GCKCSS_Pos) /**< \brief (PMC_PCR) GCK Clock Source Selection */ +#define PMC_PCR_GCKCSS(value) ((PMC_PCR_GCKCSS_Msk & ((value) << PMC_PCR_GCKCSS_Pos))) +#define PMC_PCR_GCKCSS_SLOW_CLK (0x0u << 8) /**< \brief (PMC_PCR) Slow clock is selected */ +#define PMC_PCR_GCKCSS_MAIN_CLK (0x1u << 8) /**< \brief (PMC_PCR) Main clock is selected */ +#define PMC_PCR_GCKCSS_PLLA_CLK (0x2u << 8) /**< \brief (PMC_PCR) PLLACK is selected */ +#define PMC_PCR_GCKCSS_UPLL_CLK (0x3u << 8) /**< \brief (PMC_PCR) UPLL Clock is selected */ +#define PMC_PCR_GCKCSS_MCK_CLK (0x4u << 8) /**< \brief (PMC_PCR) Master Clock is selected */ +#define PMC_PCR_GCKCSS_AUDIO_CLK (0x5u << 8) /**< \brief (PMC_PCR) Audio PLL clock is selected */ +#define PMC_PCR_CMD (0x1u << 12) /**< \brief (PMC_PCR) Command */ +#define PMC_PCR_DIV_Pos 16 +#define PMC_PCR_DIV_Msk (0x3u << PMC_PCR_DIV_Pos) /**< \brief (PMC_PCR) Divisor Value */ +#define PMC_PCR_DIV(value) ((PMC_PCR_DIV_Msk & ((value) << PMC_PCR_DIV_Pos))) +#define PMC_PCR_DIV_PERIPH_DIV_MCK (0x0u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK */ +#define PMC_PCR_DIV_PERIPH_DIV2_MCK (0x1u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK/2 */ +#define PMC_PCR_DIV_PERIPH_DIV4_MCK (0x2u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK/4 */ +#define PMC_PCR_DIV_PERIPH_DIV8_MCK (0x3u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK/8 */ +#define PMC_PCR_GCKDIV_Pos 20 +#define PMC_PCR_GCKDIV_Msk (0xffu << PMC_PCR_GCKDIV_Pos) /**< \brief (PMC_PCR) Generated Clock Division Ratio */ +#define PMC_PCR_GCKDIV(value) ((PMC_PCR_GCKDIV_Msk & ((value) << PMC_PCR_GCKDIV_Pos))) +#define PMC_PCR_EN (0x1u << 28) /**< \brief (PMC_PCR) Enable */ +#define PMC_PCR_GCKEN (0x1u << 29) /**< \brief (PMC_PCR) GCK Enable */ +/* -------- PMC_OCR : (PMC Offset: 0x0110) Oscillator Calibration Register -------- */ +#define PMC_OCR_CAL_Pos 0 +#define PMC_OCR_CAL_Msk (0x7fu << PMC_OCR_CAL_Pos) /**< \brief (PMC_OCR) 12 MHz RC Oscillator Calibration Bits */ +#define PMC_OCR_CAL(value) ((PMC_OCR_CAL_Msk & ((value) << PMC_OCR_CAL_Pos))) +#define PMC_OCR_SEL (0x1u << 7) /**< \brief (PMC_OCR) Selection of RC Oscillator Calibration Bits */ +/* -------- PMC_SLPWK_AIPR : (PMC Offset: 0x0144) SleepWalking Activity In Progress Register -------- */ +#define PMC_SLPWK_AIPR_AIP (0x1u << 0) /**< \brief (PMC_SLPWK_AIPR) Activity In Progress */ +/* -------- PMC_SLPWKCR : (PMC Offset: 0x0148) SleepWalking Control Register -------- */ +#define PMC_SLPWKCR_PID_Pos 0 +#define PMC_SLPWKCR_PID_Msk (0x7fu << PMC_SLPWKCR_PID_Pos) /**< \brief (PMC_SLPWKCR) Peripheral ID */ +#define PMC_SLPWKCR_PID(value) ((PMC_SLPWKCR_PID_Msk & ((value) << PMC_SLPWKCR_PID_Pos))) +#define PMC_SLPWKCR_CMD (0x1u << 12) /**< \brief (PMC_SLPWKCR) Command */ +#define PMC_SLPWKCR_ASR (0x1u << 16) /**< \brief (PMC_SLPWKCR) Activity Status Register */ +#define PMC_SLPWKCR_SLPWKSR (0x1u << 28) /**< \brief (PMC_SLPWKCR) SleepWalking Status Register */ +/* -------- PMC_AUDIO_PLL0 : (PMC Offset: 0x014C) Audio PLL Register 0 -------- */ +#define PMC_AUDIO_PLL0_PLLEN (0x1u << 0) /**< \brief (PMC_AUDIO_PLL0) PLL Enable */ +#define PMC_AUDIO_PLL0_PADEN (0x1u << 1) /**< \brief (PMC_AUDIO_PLL0) Pad Clock Enable */ +#define PMC_AUDIO_PLL0_PMCEN (0x1u << 2) /**< \brief (PMC_AUDIO_PLL0) PMC Clock Enable */ +#define PMC_AUDIO_PLL0_RESETN (0x1u << 3) /**< \brief (PMC_AUDIO_PLL0) Audio PLL Reset */ +#define PMC_AUDIO_PLL0_ND_Pos 8 +#define PMC_AUDIO_PLL0_ND_Msk (0x7fu << PMC_AUDIO_PLL0_ND_Pos) /**< \brief (PMC_AUDIO_PLL0) Loop Divider Ratio */ +#define PMC_AUDIO_PLL0_ND(value) ((PMC_AUDIO_PLL0_ND_Msk & ((value) << PMC_AUDIO_PLL0_ND_Pos))) +#define PMC_AUDIO_PLL0_QDPMC_Pos 16 +#define PMC_AUDIO_PLL0_QDPMC_Msk (0x7fu << PMC_AUDIO_PLL0_QDPMC_Pos) /**< \brief (PMC_AUDIO_PLL0) Output Divider Ratio for PMC Clock */ +#define PMC_AUDIO_PLL0_QDPMC(value) ((PMC_AUDIO_PLL0_QDPMC_Msk & ((value) << PMC_AUDIO_PLL0_QDPMC_Pos))) +/* -------- PMC_AUDIO_PLL1 : (PMC Offset: 0x0150) Audio PLL Register 1 -------- */ +#define PMC_AUDIO_PLL1_FRACR_Pos 0 +#define PMC_AUDIO_PLL1_FRACR_Msk (0x3fffffu << PMC_AUDIO_PLL1_FRACR_Pos) /**< \brief (PMC_AUDIO_PLL1) Fractional Loop Divider Setting */ +#define PMC_AUDIO_PLL1_FRACR(value) ((PMC_AUDIO_PLL1_FRACR_Msk & ((value) << PMC_AUDIO_PLL1_FRACR_Pos))) +#define PMC_AUDIO_PLL1_DIV_Pos 24 +#define PMC_AUDIO_PLL1_DIV_Msk (0x3u << PMC_AUDIO_PLL1_DIV_Pos) /**< \brief (PMC_AUDIO_PLL1) Divider Value */ +#define PMC_AUDIO_PLL1_DIV(value) ((PMC_AUDIO_PLL1_DIV_Msk & ((value) << PMC_AUDIO_PLL1_DIV_Pos))) +#define PMC_AUDIO_PLL1_QDAUDIO_Pos 26 +#define PMC_AUDIO_PLL1_QDAUDIO_Msk (0x1fu << PMC_AUDIO_PLL1_QDAUDIO_Pos) /**< \brief (PMC_AUDIO_PLL1) Output Divider Ratio for Pad Clock */ +#define PMC_AUDIO_PLL1_QDAUDIO(value) ((PMC_AUDIO_PLL1_QDAUDIO_Msk & ((value) << PMC_AUDIO_PLL1_QDAUDIO_Pos))) + +/*@}*/ + + +#endif /* _SAMA5D2_PMC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pwm.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pwm.h new file mode 100644 index 000000000..b3f69f0a2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_pwm.h @@ -0,0 +1,651 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_PWM_COMPONENT_ +#define _SAMA5D2_PWM_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_PWM Pulse Width Modulation Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief PwmCh_num hardware registers */ +typedef struct { + __IO uint32_t PWM_CMR; /**< \brief (PwmCh_num Offset: 0x0) PWM Channel Mode Register */ + __IO uint32_t PWM_CDTY; /**< \brief (PwmCh_num Offset: 0x4) PWM Channel Duty Cycle Register */ + __O uint32_t PWM_CDTYUPD; /**< \brief (PwmCh_num Offset: 0x8) PWM Channel Duty Cycle Update Register */ + __IO uint32_t PWM_CPRD; /**< \brief (PwmCh_num Offset: 0xC) PWM Channel Period Register */ + __O uint32_t PWM_CPRDUPD; /**< \brief (PwmCh_num Offset: 0x10) PWM Channel Period Update Register */ + __I uint32_t PWM_CCNT; /**< \brief (PwmCh_num Offset: 0x14) PWM Channel Counter Register */ + __IO uint32_t PWM_DT; /**< \brief (PwmCh_num Offset: 0x18) PWM Channel Dead Time Register */ + __O uint32_t PWM_DTUPD; /**< \brief (PwmCh_num Offset: 0x1C) PWM Channel Dead Time Update Register */ +} PwmCh_num; +/** \brief PwmCmp hardware registers */ +typedef struct { + __IO uint32_t PWM_CMPV; /**< \brief (PwmCmp Offset: 0x0) PWM Comparison 0 Value Register */ + __O uint32_t PWM_CMPVUPD; /**< \brief (PwmCmp Offset: 0x4) PWM Comparison 0 Value Update Register */ + __IO uint32_t PWM_CMPM; /**< \brief (PwmCmp Offset: 0x8) PWM Comparison 0 Mode Register */ + __O uint32_t PWM_CMPMUPD; /**< \brief (PwmCmp Offset: 0xC) PWM Comparison 0 Mode Update Register */ +} PwmCmp; +/** \brief Pwm hardware registers */ +#define PWMCMP_NUMBER 8 +#define PWMCH_NUM_NUMBER 4 +typedef struct { + __IO uint32_t PWM_CLK; /**< \brief (Pwm Offset: 0x00) PWM Clock Register */ + __O uint32_t PWM_ENA; /**< \brief (Pwm Offset: 0x04) PWM Enable Register */ + __O uint32_t PWM_DIS; /**< \brief (Pwm Offset: 0x08) PWM Disable Register */ + __I uint32_t PWM_SR; /**< \brief (Pwm Offset: 0x0C) PWM Status Register */ + __O uint32_t PWM_IER1; /**< \brief (Pwm Offset: 0x10) PWM Interrupt Enable Register 1 */ + __O uint32_t PWM_IDR1; /**< \brief (Pwm Offset: 0x14) PWM Interrupt Disable Register 1 */ + __I uint32_t PWM_IMR1; /**< \brief (Pwm Offset: 0x18) PWM Interrupt Mask Register 1 */ + __I uint32_t PWM_ISR1; /**< \brief (Pwm Offset: 0x1C) PWM Interrupt Status Register 1 */ + __IO uint32_t PWM_SCM; /**< \brief (Pwm Offset: 0x20) PWM Sync Channels Mode Register */ + __O uint32_t PWM_DMAR; /**< \brief (Pwm Offset: 0x24) PWM DMA Register */ + __IO uint32_t PWM_SCUC; /**< \brief (Pwm Offset: 0x28) PWM Sync Channels Update Control Register */ + __IO uint32_t PWM_SCUP; /**< \brief (Pwm Offset: 0x2C) PWM Sync Channels Update Period Register */ + __O uint32_t PWM_SCUPUPD; /**< \brief (Pwm Offset: 0x30) PWM Sync Channels Update Period Update Register */ + __O uint32_t PWM_IER2; /**< \brief (Pwm Offset: 0x34) PWM Interrupt Enable Register 2 */ + __O uint32_t PWM_IDR2; /**< \brief (Pwm Offset: 0x38) PWM Interrupt Disable Register 2 */ + __I uint32_t PWM_IMR2; /**< \brief (Pwm Offset: 0x3C) PWM Interrupt Mask Register 2 */ + __I uint32_t PWM_ISR2; /**< \brief (Pwm Offset: 0x40) PWM Interrupt Status Register 2 */ + __IO uint32_t PWM_OOV; /**< \brief (Pwm Offset: 0x44) PWM Output Override Value Register */ + __IO uint32_t PWM_OS; /**< \brief (Pwm Offset: 0x48) PWM Output Selection Register */ + __O uint32_t PWM_OSS; /**< \brief (Pwm Offset: 0x4C) PWM Output Selection Set Register */ + __O uint32_t PWM_OSC; /**< \brief (Pwm Offset: 0x50) PWM Output Selection Clear Register */ + __O uint32_t PWM_OSSUPD; /**< \brief (Pwm Offset: 0x54) PWM Output Selection Set Update Register */ + __O uint32_t PWM_OSCUPD; /**< \brief (Pwm Offset: 0x58) PWM Output Selection Clear Update Register */ + __IO uint32_t PWM_FMR; /**< \brief (Pwm Offset: 0x5C) PWM Fault Mode Register */ + __I uint32_t PWM_FSR; /**< \brief (Pwm Offset: 0x60) PWM Fault Status Register */ + __O uint32_t PWM_FCR; /**< \brief (Pwm Offset: 0x64) PWM Fault Clear Register */ + __IO uint32_t PWM_FPV1; /**< \brief (Pwm Offset: 0x68) PWM Fault Protection Value Register 1 */ + __IO uint32_t PWM_FPE; /**< \brief (Pwm Offset: 0x6C) PWM Fault Protection Enable Register */ + __I uint32_t Reserved1[3]; + __IO uint32_t PWM_ELMR[2]; /**< \brief (Pwm Offset: 0x7C) PWM Event Line 0 Mode Register */ + __I uint32_t Reserved2[7]; + __IO uint32_t PWM_SSPR; /**< \brief (Pwm Offset: 0xA0) PWM Spread Spectrum Register */ + __O uint32_t PWM_SSPUP; /**< \brief (Pwm Offset: 0xA4) PWM Spread Spectrum Update Register */ + __I uint32_t Reserved3[2]; + __IO uint32_t PWM_SMMR; /**< \brief (Pwm Offset: 0xB0) PWM Stepper Motor Mode Register */ + __I uint32_t Reserved4[3]; + __IO uint32_t PWM_FPV2; /**< \brief (Pwm Offset: 0xC0) PWM Fault Protection Value 2 Register */ + __I uint32_t Reserved5[8]; + __O uint32_t PWM_WPCR; /**< \brief (Pwm Offset: 0xE4) PWM Write Protection Control Register */ + __I uint32_t PWM_WPSR; /**< \brief (Pwm Offset: 0xE8) PWM Write Protection Status Register */ + __I uint32_t Reserved6[4]; + __I uint32_t PWM_VERSION; /**< \brief (Pwm Offset: 0xFC) Version Register */ + __I uint32_t Reserved7[12]; + PwmCmp PWM_CMP[PWMCMP_NUMBER]; /**< \brief (Pwm Offset: 0x130) 0 .. 7 */ + __I uint32_t Reserved8[20]; + PwmCh_num PWM_CH_NUM[PWMCH_NUM_NUMBER]; /**< \brief (Pwm Offset: 0x200) ch_num = 0 .. 3 */ + __I uint32_t Reserved9[96]; + __O uint32_t PWM_CMUPD0; /**< \brief (Pwm Offset: 0x400) PWM Channel Mode Update Register (ch_num = 0) */ + __I uint32_t Reserved10[7]; + __O uint32_t PWM_CMUPD1; /**< \brief (Pwm Offset: 0x420) PWM Channel Mode Update Register (ch_num = 1) */ + __I uint32_t Reserved11[2]; + __IO uint32_t PWM_ETRG1; /**< \brief (Pwm Offset: 0x42C) PWM External Trigger Register (trg_num = 1) */ + __IO uint32_t PWM_LEBR1; /**< \brief (Pwm Offset: 0x430) PWM Leading-Edge Blanking Register (trg_num = 1) */ + __I uint32_t Reserved12[3]; + __O uint32_t PWM_CMUPD2; /**< \brief (Pwm Offset: 0x440) PWM Channel Mode Update Register (ch_num = 2) */ + __I uint32_t Reserved13[2]; + __IO uint32_t PWM_ETRG2; /**< \brief (Pwm Offset: 0x44C) PWM External Trigger Register (trg_num = 2) */ + __IO uint32_t PWM_LEBR2; /**< \brief (Pwm Offset: 0x450) PWM Leading-Edge Blanking Register (trg_num = 2) */ + __I uint32_t Reserved14[3]; + __O uint32_t PWM_CMUPD3; /**< \brief (Pwm Offset: 0x460) PWM Channel Mode Update Register (ch_num = 3) */ +} Pwm; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- PWM_CLK : (PWM Offset: 0x00) PWM Clock Register -------- */ +#define PWM_CLK_DIVA_Pos 0 +#define PWM_CLK_DIVA_Msk (0xffu << PWM_CLK_DIVA_Pos) /**< \brief (PWM_CLK) CLKA Divide Factor */ +#define PWM_CLK_DIVA(value) ((PWM_CLK_DIVA_Msk & ((value) << PWM_CLK_DIVA_Pos))) +#define PWM_CLK_DIVA_CLKA_POFF (0x0u << 0) /**< \brief (PWM_CLK) CLKA clock is turned off */ +#define PWM_CLK_DIVA_PREA (0x1u << 0) /**< \brief (PWM_CLK) CLKA clock is clock selected by PREA */ +#define PWM_CLK_PREA_Pos 8 +#define PWM_CLK_PREA_Msk (0xfu << PWM_CLK_PREA_Pos) /**< \brief (PWM_CLK) CLKA Source Clock Selection */ +#define PWM_CLK_PREA(value) ((PWM_CLK_PREA_Msk & ((value) << PWM_CLK_PREA_Pos))) +#define PWM_CLK_PREA_CLK (0x0u << 8) /**< \brief (PWM_CLK) Peripheral clock */ +#define PWM_CLK_PREA_CLK_DIV2 (0x1u << 8) /**< \brief (PWM_CLK) Peripheral clock/2 */ +#define PWM_CLK_PREA_CLK_DIV4 (0x2u << 8) /**< \brief (PWM_CLK) Peripheral clock/4 */ +#define PWM_CLK_PREA_CLK_DIV8 (0x3u << 8) /**< \brief (PWM_CLK) Peripheral clock/8 */ +#define PWM_CLK_PREA_CLK_DIV16 (0x4u << 8) /**< \brief (PWM_CLK) Peripheral clock/16 */ +#define PWM_CLK_PREA_CLK_DIV32 (0x5u << 8) /**< \brief (PWM_CLK) Peripheral clock/32 */ +#define PWM_CLK_PREA_CLK_DIV64 (0x6u << 8) /**< \brief (PWM_CLK) Peripheral clock/64 */ +#define PWM_CLK_PREA_CLK_DIV128 (0x7u << 8) /**< \brief (PWM_CLK) Peripheral clock/128 */ +#define PWM_CLK_PREA_CLK_DIV256 (0x8u << 8) /**< \brief (PWM_CLK) Peripheral clock/256 */ +#define PWM_CLK_PREA_CLK_DIV512 (0x9u << 8) /**< \brief (PWM_CLK) Peripheral clock/512 */ +#define PWM_CLK_PREA_CLK_DIV1024 (0xAu << 8) /**< \brief (PWM_CLK) Peripheral clock/1024 */ +#define PWM_CLK_DIVB_Pos 16 +#define PWM_CLK_DIVB_Msk (0xffu << PWM_CLK_DIVB_Pos) /**< \brief (PWM_CLK) CLKB Divide Factor */ +#define PWM_CLK_DIVB(value) ((PWM_CLK_DIVB_Msk & ((value) << PWM_CLK_DIVB_Pos))) +#define PWM_CLK_DIVB_CLKB_POFF (0x0u << 16) /**< \brief (PWM_CLK) CLKB clock is turned off */ +#define PWM_CLK_DIVB_PREB (0x1u << 16) /**< \brief (PWM_CLK) CLKB clock is clock selected by PREB */ +#define PWM_CLK_PREB_Pos 24 +#define PWM_CLK_PREB_Msk (0xfu << PWM_CLK_PREB_Pos) /**< \brief (PWM_CLK) CLKB Source Clock Selection */ +#define PWM_CLK_PREB(value) ((PWM_CLK_PREB_Msk & ((value) << PWM_CLK_PREB_Pos))) +#define PWM_CLK_PREB_CLK (0x0u << 24) /**< \brief (PWM_CLK) Peripheral clock */ +#define PWM_CLK_PREB_CLK_DIV2 (0x1u << 24) /**< \brief (PWM_CLK) Peripheral clock/2 */ +#define PWM_CLK_PREB_CLK_DIV4 (0x2u << 24) /**< \brief (PWM_CLK) Peripheral clock/4 */ +#define PWM_CLK_PREB_CLK_DIV8 (0x3u << 24) /**< \brief (PWM_CLK) Peripheral clock/8 */ +#define PWM_CLK_PREB_CLK_DIV16 (0x4u << 24) /**< \brief (PWM_CLK) Peripheral clock/16 */ +#define PWM_CLK_PREB_CLK_DIV32 (0x5u << 24) /**< \brief (PWM_CLK) Peripheral clock/32 */ +#define PWM_CLK_PREB_CLK_DIV64 (0x6u << 24) /**< \brief (PWM_CLK) Peripheral clock/64 */ +#define PWM_CLK_PREB_CLK_DIV128 (0x7u << 24) /**< \brief (PWM_CLK) Peripheral clock/128 */ +#define PWM_CLK_PREB_CLK_DIV256 (0x8u << 24) /**< \brief (PWM_CLK) Peripheral clock/256 */ +#define PWM_CLK_PREB_CLK_DIV512 (0x9u << 24) /**< \brief (PWM_CLK) Peripheral clock/512 */ +#define PWM_CLK_PREB_CLK_DIV1024 (0xAu << 24) /**< \brief (PWM_CLK) Peripheral clock/1024 */ +/* -------- PWM_ENA : (PWM Offset: 0x04) PWM Enable Register -------- */ +#define PWM_ENA_CHID0 (0x1u << 0) /**< \brief (PWM_ENA) Channel ID */ +#define PWM_ENA_CHID1 (0x1u << 1) /**< \brief (PWM_ENA) Channel ID */ +#define PWM_ENA_CHID2 (0x1u << 2) /**< \brief (PWM_ENA) Channel ID */ +#define PWM_ENA_CHID3 (0x1u << 3) /**< \brief (PWM_ENA) Channel ID */ +/* -------- PWM_DIS : (PWM Offset: 0x08) PWM Disable Register -------- */ +#define PWM_DIS_CHID0 (0x1u << 0) /**< \brief (PWM_DIS) Channel ID */ +#define PWM_DIS_CHID1 (0x1u << 1) /**< \brief (PWM_DIS) Channel ID */ +#define PWM_DIS_CHID2 (0x1u << 2) /**< \brief (PWM_DIS) Channel ID */ +#define PWM_DIS_CHID3 (0x1u << 3) /**< \brief (PWM_DIS) Channel ID */ +/* -------- PWM_SR : (PWM Offset: 0x0C) PWM Status Register -------- */ +#define PWM_SR_CHID0 (0x1u << 0) /**< \brief (PWM_SR) Channel ID */ +#define PWM_SR_CHID1 (0x1u << 1) /**< \brief (PWM_SR) Channel ID */ +#define PWM_SR_CHID2 (0x1u << 2) /**< \brief (PWM_SR) Channel ID */ +#define PWM_SR_CHID3 (0x1u << 3) /**< \brief (PWM_SR) Channel ID */ +/* -------- PWM_IER1 : (PWM Offset: 0x10) PWM Interrupt Enable Register 1 -------- */ +#define PWM_IER1_CHID0 (0x1u << 0) /**< \brief (PWM_IER1) Counter Event on Channel 0 Interrupt Enable */ +#define PWM_IER1_CHID1 (0x1u << 1) /**< \brief (PWM_IER1) Counter Event on Channel 1 Interrupt Enable */ +#define PWM_IER1_CHID2 (0x1u << 2) /**< \brief (PWM_IER1) Counter Event on Channel 2 Interrupt Enable */ +#define PWM_IER1_CHID3 (0x1u << 3) /**< \brief (PWM_IER1) Counter Event on Channel 3 Interrupt Enable */ +#define PWM_IER1_FCHID0 (0x1u << 16) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 0 Interrupt Enable */ +#define PWM_IER1_FCHID1 (0x1u << 17) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 1 Interrupt Enable */ +#define PWM_IER1_FCHID2 (0x1u << 18) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 2 Interrupt Enable */ +#define PWM_IER1_FCHID3 (0x1u << 19) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 3 Interrupt Enable */ +/* -------- PWM_IDR1 : (PWM Offset: 0x14) PWM Interrupt Disable Register 1 -------- */ +#define PWM_IDR1_CHID0 (0x1u << 0) /**< \brief (PWM_IDR1) Counter Event on Channel 0 Interrupt Disable */ +#define PWM_IDR1_CHID1 (0x1u << 1) /**< \brief (PWM_IDR1) Counter Event on Channel 1 Interrupt Disable */ +#define PWM_IDR1_CHID2 (0x1u << 2) /**< \brief (PWM_IDR1) Counter Event on Channel 2 Interrupt Disable */ +#define PWM_IDR1_CHID3 (0x1u << 3) /**< \brief (PWM_IDR1) Counter Event on Channel 3 Interrupt Disable */ +#define PWM_IDR1_FCHID0 (0x1u << 16) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 0 Interrupt Disable */ +#define PWM_IDR1_FCHID1 (0x1u << 17) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 1 Interrupt Disable */ +#define PWM_IDR1_FCHID2 (0x1u << 18) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 2 Interrupt Disable */ +#define PWM_IDR1_FCHID3 (0x1u << 19) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 3 Interrupt Disable */ +/* -------- PWM_IMR1 : (PWM Offset: 0x18) PWM Interrupt Mask Register 1 -------- */ +#define PWM_IMR1_CHID0 (0x1u << 0) /**< \brief (PWM_IMR1) Counter Event on Channel 0 Interrupt Mask */ +#define PWM_IMR1_CHID1 (0x1u << 1) /**< \brief (PWM_IMR1) Counter Event on Channel 1 Interrupt Mask */ +#define PWM_IMR1_CHID2 (0x1u << 2) /**< \brief (PWM_IMR1) Counter Event on Channel 2 Interrupt Mask */ +#define PWM_IMR1_CHID3 (0x1u << 3) /**< \brief (PWM_IMR1) Counter Event on Channel 3 Interrupt Mask */ +#define PWM_IMR1_FCHID0 (0x1u << 16) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 0 Interrupt Mask */ +#define PWM_IMR1_FCHID1 (0x1u << 17) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 1 Interrupt Mask */ +#define PWM_IMR1_FCHID2 (0x1u << 18) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 2 Interrupt Mask */ +#define PWM_IMR1_FCHID3 (0x1u << 19) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 3 Interrupt Mask */ +/* -------- PWM_ISR1 : (PWM Offset: 0x1C) PWM Interrupt Status Register 1 -------- */ +#define PWM_ISR1_CHID0 (0x1u << 0) /**< \brief (PWM_ISR1) Counter Event on Channel 0 */ +#define PWM_ISR1_CHID1 (0x1u << 1) /**< \brief (PWM_ISR1) Counter Event on Channel 1 */ +#define PWM_ISR1_CHID2 (0x1u << 2) /**< \brief (PWM_ISR1) Counter Event on Channel 2 */ +#define PWM_ISR1_CHID3 (0x1u << 3) /**< \brief (PWM_ISR1) Counter Event on Channel 3 */ +#define PWM_ISR1_FCHID0 (0x1u << 16) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 0 */ +#define PWM_ISR1_FCHID1 (0x1u << 17) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 1 */ +#define PWM_ISR1_FCHID2 (0x1u << 18) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 2 */ +#define PWM_ISR1_FCHID3 (0x1u << 19) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 3 */ +/* -------- PWM_SCM : (PWM Offset: 0x20) PWM Sync Channels Mode Register -------- */ +#define PWM_SCM_SYNC0 (0x1u << 0) /**< \brief (PWM_SCM) Synchronous Channel 0 */ +#define PWM_SCM_SYNC1 (0x1u << 1) /**< \brief (PWM_SCM) Synchronous Channel 1 */ +#define PWM_SCM_SYNC2 (0x1u << 2) /**< \brief (PWM_SCM) Synchronous Channel 2 */ +#define PWM_SCM_SYNC3 (0x1u << 3) /**< \brief (PWM_SCM) Synchronous Channel 3 */ +#define PWM_SCM_UPDM_Pos 16 +#define PWM_SCM_UPDM_Msk (0x3u << PWM_SCM_UPDM_Pos) /**< \brief (PWM_SCM) Synchronous Channels Update Mode */ +#define PWM_SCM_UPDM(value) ((PWM_SCM_UPDM_Msk & ((value) << PWM_SCM_UPDM_Pos))) +#define PWM_SCM_UPDM_MODE0 (0x0u << 16) /**< \brief (PWM_SCM) Manual write of double buffer registers and manual update of synchronous channels */ +#define PWM_SCM_UPDM_MODE1 (0x1u << 16) /**< \brief (PWM_SCM) Manual write of double buffer registers and automatic update of synchronous channels */ +#define PWM_SCM_UPDM_MODE2 (0x2u << 16) /**< \brief (PWM_SCM) Automatic write of duty-cycle update registers by the DMA Controller and automatic update of synchronous channels */ +#define PWM_SCM_PTRM (0x1u << 20) /**< \brief (PWM_SCM) DMA Controller Transfer Request Mode */ +#define PWM_SCM_PTRCS_Pos 21 +#define PWM_SCM_PTRCS_Msk (0x7u << PWM_SCM_PTRCS_Pos) /**< \brief (PWM_SCM) DMA Controller Transfer Request Comparison Selection */ +#define PWM_SCM_PTRCS(value) ((PWM_SCM_PTRCS_Msk & ((value) << PWM_SCM_PTRCS_Pos))) +/* -------- PWM_DMAR : (PWM Offset: 0x24) PWM DMA Register -------- */ +#define PWM_DMAR_DMADUTY_Pos 0 +#define PWM_DMAR_DMADUTY_Msk (0xffffffu << PWM_DMAR_DMADUTY_Pos) /**< \brief (PWM_DMAR) Duty-Cycle Holding Register for DMA Access */ +#define PWM_DMAR_DMADUTY(value) ((PWM_DMAR_DMADUTY_Msk & ((value) << PWM_DMAR_DMADUTY_Pos))) +/* -------- PWM_SCUC : (PWM Offset: 0x28) PWM Sync Channels Update Control Register -------- */ +#define PWM_SCUC_UPDULOCK (0x1u << 0) /**< \brief (PWM_SCUC) Synchronous Channels Update Unlock */ +/* -------- PWM_SCUP : (PWM Offset: 0x2C) PWM Sync Channels Update Period Register -------- */ +#define PWM_SCUP_UPR_Pos 0 +#define PWM_SCUP_UPR_Msk (0xfu << PWM_SCUP_UPR_Pos) /**< \brief (PWM_SCUP) Update Period */ +#define PWM_SCUP_UPR(value) ((PWM_SCUP_UPR_Msk & ((value) << PWM_SCUP_UPR_Pos))) +#define PWM_SCUP_UPRCNT_Pos 4 +#define PWM_SCUP_UPRCNT_Msk (0xfu << PWM_SCUP_UPRCNT_Pos) /**< \brief (PWM_SCUP) Update Period Counter */ +#define PWM_SCUP_UPRCNT(value) ((PWM_SCUP_UPRCNT_Msk & ((value) << PWM_SCUP_UPRCNT_Pos))) +/* -------- PWM_SCUPUPD : (PWM Offset: 0x30) PWM Sync Channels Update Period Update Register -------- */ +#define PWM_SCUPUPD_UPRUPD_Pos 0 +#define PWM_SCUPUPD_UPRUPD_Msk (0xfu << PWM_SCUPUPD_UPRUPD_Pos) /**< \brief (PWM_SCUPUPD) Update Period Update */ +#define PWM_SCUPUPD_UPRUPD(value) ((PWM_SCUPUPD_UPRUPD_Msk & ((value) << PWM_SCUPUPD_UPRUPD_Pos))) +/* -------- PWM_IER2 : (PWM Offset: 0x34) PWM Interrupt Enable Register 2 -------- */ +#define PWM_IER2_WRDY (0x1u << 0) /**< \brief (PWM_IER2) Write Ready for Synchronous Channels Update Interrupt Enable */ +#define PWM_IER2_UNRE (0x1u << 3) /**< \brief (PWM_IER2) Synchronous Channels Update Underrun Error Interrupt Enable */ +#define PWM_IER2_CMPM0 (0x1u << 8) /**< \brief (PWM_IER2) Comparison 0 Match Interrupt Enable */ +#define PWM_IER2_CMPM1 (0x1u << 9) /**< \brief (PWM_IER2) Comparison 1 Match Interrupt Enable */ +#define PWM_IER2_CMPM2 (0x1u << 10) /**< \brief (PWM_IER2) Comparison 2 Match Interrupt Enable */ +#define PWM_IER2_CMPM3 (0x1u << 11) /**< \brief (PWM_IER2) Comparison 3 Match Interrupt Enable */ +#define PWM_IER2_CMPM4 (0x1u << 12) /**< \brief (PWM_IER2) Comparison 4 Match Interrupt Enable */ +#define PWM_IER2_CMPM5 (0x1u << 13) /**< \brief (PWM_IER2) Comparison 5 Match Interrupt Enable */ +#define PWM_IER2_CMPM6 (0x1u << 14) /**< \brief (PWM_IER2) Comparison 6 Match Interrupt Enable */ +#define PWM_IER2_CMPM7 (0x1u << 15) /**< \brief (PWM_IER2) Comparison 7 Match Interrupt Enable */ +#define PWM_IER2_CMPU0 (0x1u << 16) /**< \brief (PWM_IER2) Comparison 0 Update Interrupt Enable */ +#define PWM_IER2_CMPU1 (0x1u << 17) /**< \brief (PWM_IER2) Comparison 1 Update Interrupt Enable */ +#define PWM_IER2_CMPU2 (0x1u << 18) /**< \brief (PWM_IER2) Comparison 2 Update Interrupt Enable */ +#define PWM_IER2_CMPU3 (0x1u << 19) /**< \brief (PWM_IER2) Comparison 3 Update Interrupt Enable */ +#define PWM_IER2_CMPU4 (0x1u << 20) /**< \brief (PWM_IER2) Comparison 4 Update Interrupt Enable */ +#define PWM_IER2_CMPU5 (0x1u << 21) /**< \brief (PWM_IER2) Comparison 5 Update Interrupt Enable */ +#define PWM_IER2_CMPU6 (0x1u << 22) /**< \brief (PWM_IER2) Comparison 6 Update Interrupt Enable */ +#define PWM_IER2_CMPU7 (0x1u << 23) /**< \brief (PWM_IER2) Comparison 7 Update Interrupt Enable */ +/* -------- PWM_IDR2 : (PWM Offset: 0x38) PWM Interrupt Disable Register 2 -------- */ +#define PWM_IDR2_WRDY (0x1u << 0) /**< \brief (PWM_IDR2) Write Ready for Synchronous Channels Update Interrupt Disable */ +#define PWM_IDR2_UNRE (0x1u << 3) /**< \brief (PWM_IDR2) Synchronous Channels Update Underrun Error Interrupt Disable */ +#define PWM_IDR2_CMPM0 (0x1u << 8) /**< \brief (PWM_IDR2) Comparison 0 Match Interrupt Disable */ +#define PWM_IDR2_CMPM1 (0x1u << 9) /**< \brief (PWM_IDR2) Comparison 1 Match Interrupt Disable */ +#define PWM_IDR2_CMPM2 (0x1u << 10) /**< \brief (PWM_IDR2) Comparison 2 Match Interrupt Disable */ +#define PWM_IDR2_CMPM3 (0x1u << 11) /**< \brief (PWM_IDR2) Comparison 3 Match Interrupt Disable */ +#define PWM_IDR2_CMPM4 (0x1u << 12) /**< \brief (PWM_IDR2) Comparison 4 Match Interrupt Disable */ +#define PWM_IDR2_CMPM5 (0x1u << 13) /**< \brief (PWM_IDR2) Comparison 5 Match Interrupt Disable */ +#define PWM_IDR2_CMPM6 (0x1u << 14) /**< \brief (PWM_IDR2) Comparison 6 Match Interrupt Disable */ +#define PWM_IDR2_CMPM7 (0x1u << 15) /**< \brief (PWM_IDR2) Comparison 7 Match Interrupt Disable */ +#define PWM_IDR2_CMPU0 (0x1u << 16) /**< \brief (PWM_IDR2) Comparison 0 Update Interrupt Disable */ +#define PWM_IDR2_CMPU1 (0x1u << 17) /**< \brief (PWM_IDR2) Comparison 1 Update Interrupt Disable */ +#define PWM_IDR2_CMPU2 (0x1u << 18) /**< \brief (PWM_IDR2) Comparison 2 Update Interrupt Disable */ +#define PWM_IDR2_CMPU3 (0x1u << 19) /**< \brief (PWM_IDR2) Comparison 3 Update Interrupt Disable */ +#define PWM_IDR2_CMPU4 (0x1u << 20) /**< \brief (PWM_IDR2) Comparison 4 Update Interrupt Disable */ +#define PWM_IDR2_CMPU5 (0x1u << 21) /**< \brief (PWM_IDR2) Comparison 5 Update Interrupt Disable */ +#define PWM_IDR2_CMPU6 (0x1u << 22) /**< \brief (PWM_IDR2) Comparison 6 Update Interrupt Disable */ +#define PWM_IDR2_CMPU7 (0x1u << 23) /**< \brief (PWM_IDR2) Comparison 7 Update Interrupt Disable */ +/* -------- PWM_IMR2 : (PWM Offset: 0x3C) PWM Interrupt Mask Register 2 -------- */ +#define PWM_IMR2_WRDY (0x1u << 0) /**< \brief (PWM_IMR2) Write Ready for Synchronous Channels Update Interrupt Mask */ +#define PWM_IMR2_UNRE (0x1u << 3) /**< \brief (PWM_IMR2) Synchronous Channels Update Underrun Error Interrupt Mask */ +#define PWM_IMR2_CMPM0 (0x1u << 8) /**< \brief (PWM_IMR2) Comparison 0 Match Interrupt Mask */ +#define PWM_IMR2_CMPM1 (0x1u << 9) /**< \brief (PWM_IMR2) Comparison 1 Match Interrupt Mask */ +#define PWM_IMR2_CMPM2 (0x1u << 10) /**< \brief (PWM_IMR2) Comparison 2 Match Interrupt Mask */ +#define PWM_IMR2_CMPM3 (0x1u << 11) /**< \brief (PWM_IMR2) Comparison 3 Match Interrupt Mask */ +#define PWM_IMR2_CMPM4 (0x1u << 12) /**< \brief (PWM_IMR2) Comparison 4 Match Interrupt Mask */ +#define PWM_IMR2_CMPM5 (0x1u << 13) /**< \brief (PWM_IMR2) Comparison 5 Match Interrupt Mask */ +#define PWM_IMR2_CMPM6 (0x1u << 14) /**< \brief (PWM_IMR2) Comparison 6 Match Interrupt Mask */ +#define PWM_IMR2_CMPM7 (0x1u << 15) /**< \brief (PWM_IMR2) Comparison 7 Match Interrupt Mask */ +#define PWM_IMR2_CMPU0 (0x1u << 16) /**< \brief (PWM_IMR2) Comparison 0 Update Interrupt Mask */ +#define PWM_IMR2_CMPU1 (0x1u << 17) /**< \brief (PWM_IMR2) Comparison 1 Update Interrupt Mask */ +#define PWM_IMR2_CMPU2 (0x1u << 18) /**< \brief (PWM_IMR2) Comparison 2 Update Interrupt Mask */ +#define PWM_IMR2_CMPU3 (0x1u << 19) /**< \brief (PWM_IMR2) Comparison 3 Update Interrupt Mask */ +#define PWM_IMR2_CMPU4 (0x1u << 20) /**< \brief (PWM_IMR2) Comparison 4 Update Interrupt Mask */ +#define PWM_IMR2_CMPU5 (0x1u << 21) /**< \brief (PWM_IMR2) Comparison 5 Update Interrupt Mask */ +#define PWM_IMR2_CMPU6 (0x1u << 22) /**< \brief (PWM_IMR2) Comparison 6 Update Interrupt Mask */ +#define PWM_IMR2_CMPU7 (0x1u << 23) /**< \brief (PWM_IMR2) Comparison 7 Update Interrupt Mask */ +/* -------- PWM_ISR2 : (PWM Offset: 0x40) PWM Interrupt Status Register 2 -------- */ +#define PWM_ISR2_WRDY (0x1u << 0) /**< \brief (PWM_ISR2) Write Ready for Synchronous Channels Update */ +#define PWM_ISR2_UNRE (0x1u << 3) /**< \brief (PWM_ISR2) Synchronous Channels Update Underrun Error */ +#define PWM_ISR2_CMPM0 (0x1u << 8) /**< \brief (PWM_ISR2) Comparison 0 Match */ +#define PWM_ISR2_CMPM1 (0x1u << 9) /**< \brief (PWM_ISR2) Comparison 1 Match */ +#define PWM_ISR2_CMPM2 (0x1u << 10) /**< \brief (PWM_ISR2) Comparison 2 Match */ +#define PWM_ISR2_CMPM3 (0x1u << 11) /**< \brief (PWM_ISR2) Comparison 3 Match */ +#define PWM_ISR2_CMPM4 (0x1u << 12) /**< \brief (PWM_ISR2) Comparison 4 Match */ +#define PWM_ISR2_CMPM5 (0x1u << 13) /**< \brief (PWM_ISR2) Comparison 5 Match */ +#define PWM_ISR2_CMPM6 (0x1u << 14) /**< \brief (PWM_ISR2) Comparison 6 Match */ +#define PWM_ISR2_CMPM7 (0x1u << 15) /**< \brief (PWM_ISR2) Comparison 7 Match */ +#define PWM_ISR2_CMPU0 (0x1u << 16) /**< \brief (PWM_ISR2) Comparison 0 Update */ +#define PWM_ISR2_CMPU1 (0x1u << 17) /**< \brief (PWM_ISR2) Comparison 1 Update */ +#define PWM_ISR2_CMPU2 (0x1u << 18) /**< \brief (PWM_ISR2) Comparison 2 Update */ +#define PWM_ISR2_CMPU3 (0x1u << 19) /**< \brief (PWM_ISR2) Comparison 3 Update */ +#define PWM_ISR2_CMPU4 (0x1u << 20) /**< \brief (PWM_ISR2) Comparison 4 Update */ +#define PWM_ISR2_CMPU5 (0x1u << 21) /**< \brief (PWM_ISR2) Comparison 5 Update */ +#define PWM_ISR2_CMPU6 (0x1u << 22) /**< \brief (PWM_ISR2) Comparison 6 Update */ +#define PWM_ISR2_CMPU7 (0x1u << 23) /**< \brief (PWM_ISR2) Comparison 7 Update */ +/* -------- PWM_OOV : (PWM Offset: 0x44) PWM Output Override Value Register -------- */ +#define PWM_OOV_OOVH0 (0x1u << 0) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 0 */ +#define PWM_OOV_OOVH1 (0x1u << 1) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 1 */ +#define PWM_OOV_OOVH2 (0x1u << 2) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 2 */ +#define PWM_OOV_OOVH3 (0x1u << 3) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 3 */ +#define PWM_OOV_OOVL0 (0x1u << 16) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 0 */ +#define PWM_OOV_OOVL1 (0x1u << 17) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 1 */ +#define PWM_OOV_OOVL2 (0x1u << 18) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 2 */ +#define PWM_OOV_OOVL3 (0x1u << 19) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 3 */ +/* -------- PWM_OS : (PWM Offset: 0x48) PWM Output Selection Register -------- */ +#define PWM_OS_OSH0 (0x1u << 0) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 0 */ +#define PWM_OS_OSH1 (0x1u << 1) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 1 */ +#define PWM_OS_OSH2 (0x1u << 2) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 2 */ +#define PWM_OS_OSH3 (0x1u << 3) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 3 */ +#define PWM_OS_OSL0 (0x1u << 16) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 0 */ +#define PWM_OS_OSL1 (0x1u << 17) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 1 */ +#define PWM_OS_OSL2 (0x1u << 18) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 2 */ +#define PWM_OS_OSL3 (0x1u << 19) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 3 */ +/* -------- PWM_OSS : (PWM Offset: 0x4C) PWM Output Selection Set Register -------- */ +#define PWM_OSS_OSSH0 (0x1u << 0) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 0 */ +#define PWM_OSS_OSSH1 (0x1u << 1) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 1 */ +#define PWM_OSS_OSSH2 (0x1u << 2) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 2 */ +#define PWM_OSS_OSSH3 (0x1u << 3) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 3 */ +#define PWM_OSS_OSSL0 (0x1u << 16) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 0 */ +#define PWM_OSS_OSSL1 (0x1u << 17) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 1 */ +#define PWM_OSS_OSSL2 (0x1u << 18) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 2 */ +#define PWM_OSS_OSSL3 (0x1u << 19) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 3 */ +/* -------- PWM_OSC : (PWM Offset: 0x50) PWM Output Selection Clear Register -------- */ +#define PWM_OSC_OSCH0 (0x1u << 0) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 0 */ +#define PWM_OSC_OSCH1 (0x1u << 1) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 1 */ +#define PWM_OSC_OSCH2 (0x1u << 2) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 2 */ +#define PWM_OSC_OSCH3 (0x1u << 3) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 3 */ +#define PWM_OSC_OSCL0 (0x1u << 16) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 0 */ +#define PWM_OSC_OSCL1 (0x1u << 17) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 1 */ +#define PWM_OSC_OSCL2 (0x1u << 18) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 2 */ +#define PWM_OSC_OSCL3 (0x1u << 19) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 3 */ +/* -------- PWM_OSSUPD : (PWM Offset: 0x54) PWM Output Selection Set Update Register -------- */ +#define PWM_OSSUPD_OSSUPH0 (0x1u << 0) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 0 */ +#define PWM_OSSUPD_OSSUPH1 (0x1u << 1) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 1 */ +#define PWM_OSSUPD_OSSUPH2 (0x1u << 2) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 2 */ +#define PWM_OSSUPD_OSSUPH3 (0x1u << 3) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 3 */ +#define PWM_OSSUPD_OSSUPL0 (0x1u << 16) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 0 */ +#define PWM_OSSUPD_OSSUPL1 (0x1u << 17) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 1 */ +#define PWM_OSSUPD_OSSUPL2 (0x1u << 18) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 2 */ +#define PWM_OSSUPD_OSSUPL3 (0x1u << 19) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 3 */ +/* -------- PWM_OSCUPD : (PWM Offset: 0x58) PWM Output Selection Clear Update Register -------- */ +#define PWM_OSCUPD_OSCUPH0 (0x1u << 0) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 0 */ +#define PWM_OSCUPD_OSCUPH1 (0x1u << 1) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 1 */ +#define PWM_OSCUPD_OSCUPH2 (0x1u << 2) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 2 */ +#define PWM_OSCUPD_OSCUPH3 (0x1u << 3) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 3 */ +#define PWM_OSCUPD_OSCUPL0 (0x1u << 16) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 0 */ +#define PWM_OSCUPD_OSCUPL1 (0x1u << 17) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 1 */ +#define PWM_OSCUPD_OSCUPL2 (0x1u << 18) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 2 */ +#define PWM_OSCUPD_OSCUPL3 (0x1u << 19) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 3 */ +/* -------- PWM_FMR : (PWM Offset: 0x5C) PWM Fault Mode Register -------- */ +#define PWM_FMR_FPOL_Pos 0 +#define PWM_FMR_FPOL_Msk (0xffu << PWM_FMR_FPOL_Pos) /**< \brief (PWM_FMR) Fault Polarity */ +#define PWM_FMR_FPOL(value) ((PWM_FMR_FPOL_Msk & ((value) << PWM_FMR_FPOL_Pos))) +#define PWM_FMR_FMOD_Pos 8 +#define PWM_FMR_FMOD_Msk (0xffu << PWM_FMR_FMOD_Pos) /**< \brief (PWM_FMR) Fault Activation Mode */ +#define PWM_FMR_FMOD(value) ((PWM_FMR_FMOD_Msk & ((value) << PWM_FMR_FMOD_Pos))) +#define PWM_FMR_FFIL_Pos 16 +#define PWM_FMR_FFIL_Msk (0xffu << PWM_FMR_FFIL_Pos) /**< \brief (PWM_FMR) Fault Filtering */ +#define PWM_FMR_FFIL(value) ((PWM_FMR_FFIL_Msk & ((value) << PWM_FMR_FFIL_Pos))) +/* -------- PWM_FSR : (PWM Offset: 0x60) PWM Fault Status Register -------- */ +#define PWM_FSR_FIV_Pos 0 +#define PWM_FSR_FIV_Msk (0xffu << PWM_FSR_FIV_Pos) /**< \brief (PWM_FSR) Fault Input Value */ +#define PWM_FSR_FS_Pos 8 +#define PWM_FSR_FS_Msk (0xffu << PWM_FSR_FS_Pos) /**< \brief (PWM_FSR) Fault Status */ +/* -------- PWM_FCR : (PWM Offset: 0x64) PWM Fault Clear Register -------- */ +#define PWM_FCR_FCLR_Pos 0 +#define PWM_FCR_FCLR_Msk (0xffu << PWM_FCR_FCLR_Pos) /**< \brief (PWM_FCR) Fault Clear */ +#define PWM_FCR_FCLR(value) ((PWM_FCR_FCLR_Msk & ((value) << PWM_FCR_FCLR_Pos))) +/* -------- PWM_FPV1 : (PWM Offset: 0x68) PWM Fault Protection Value Register 1 -------- */ +#define PWM_FPV1_FPVH0 (0x1u << 0) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 0 */ +#define PWM_FPV1_FPVH1 (0x1u << 1) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 1 */ +#define PWM_FPV1_FPVH2 (0x1u << 2) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 2 */ +#define PWM_FPV1_FPVH3 (0x1u << 3) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 3 */ +#define PWM_FPV1_FPVL0 (0x1u << 16) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 0 */ +#define PWM_FPV1_FPVL1 (0x1u << 17) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 1 */ +#define PWM_FPV1_FPVL2 (0x1u << 18) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 2 */ +#define PWM_FPV1_FPVL3 (0x1u << 19) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 3 */ +/* -------- PWM_FPE : (PWM Offset: 0x6C) PWM Fault Protection Enable Register -------- */ +#define PWM_FPE_FPE0_Pos 0 +#define PWM_FPE_FPE0_Msk (0xffu << PWM_FPE_FPE0_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 0 */ +#define PWM_FPE_FPE0(value) ((PWM_FPE_FPE0_Msk & ((value) << PWM_FPE_FPE0_Pos))) +#define PWM_FPE_FPE1_Pos 8 +#define PWM_FPE_FPE1_Msk (0xffu << PWM_FPE_FPE1_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 1 */ +#define PWM_FPE_FPE1(value) ((PWM_FPE_FPE1_Msk & ((value) << PWM_FPE_FPE1_Pos))) +#define PWM_FPE_FPE2_Pos 16 +#define PWM_FPE_FPE2_Msk (0xffu << PWM_FPE_FPE2_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 2 */ +#define PWM_FPE_FPE2(value) ((PWM_FPE_FPE2_Msk & ((value) << PWM_FPE_FPE2_Pos))) +#define PWM_FPE_FPE3_Pos 24 +#define PWM_FPE_FPE3_Msk (0xffu << PWM_FPE_FPE3_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 3 */ +#define PWM_FPE_FPE3(value) ((PWM_FPE_FPE3_Msk & ((value) << PWM_FPE_FPE3_Pos))) +/* -------- PWM_ELMR[2] : (PWM Offset: 0x7C) PWM Event Line 0 Mode Register -------- */ +#define PWM_ELMR_CSEL0 (0x1u << 0) /**< \brief (PWM_ELMR[2]) Comparison 0 Selection */ +#define PWM_ELMR_CSEL1 (0x1u << 1) /**< \brief (PWM_ELMR[2]) Comparison 1 Selection */ +#define PWM_ELMR_CSEL2 (0x1u << 2) /**< \brief (PWM_ELMR[2]) Comparison 2 Selection */ +#define PWM_ELMR_CSEL3 (0x1u << 3) /**< \brief (PWM_ELMR[2]) Comparison 3 Selection */ +#define PWM_ELMR_CSEL4 (0x1u << 4) /**< \brief (PWM_ELMR[2]) Comparison 4 Selection */ +#define PWM_ELMR_CSEL5 (0x1u << 5) /**< \brief (PWM_ELMR[2]) Comparison 5 Selection */ +#define PWM_ELMR_CSEL6 (0x1u << 6) /**< \brief (PWM_ELMR[2]) Comparison 6 Selection */ +#define PWM_ELMR_CSEL7 (0x1u << 7) /**< \brief (PWM_ELMR[2]) Comparison 7 Selection */ +/* -------- PWM_SSPR : (PWM Offset: 0xA0) PWM Spread Spectrum Register -------- */ +#define PWM_SSPR_SPRD_Pos 0 +#define PWM_SSPR_SPRD_Msk (0xffffffu << PWM_SSPR_SPRD_Pos) /**< \brief (PWM_SSPR) Spread Spectrum Limit Value */ +#define PWM_SSPR_SPRD(value) ((PWM_SSPR_SPRD_Msk & ((value) << PWM_SSPR_SPRD_Pos))) +#define PWM_SSPR_SPRDM (0x1u << 24) /**< \brief (PWM_SSPR) Spread Spectrum Counter Mode */ +/* -------- PWM_SSPUP : (PWM Offset: 0xA4) PWM Spread Spectrum Update Register -------- */ +#define PWM_SSPUP_SPRDUP_Pos 0 +#define PWM_SSPUP_SPRDUP_Msk (0xffffffu << PWM_SSPUP_SPRDUP_Pos) /**< \brief (PWM_SSPUP) Spread Spectrum Limit Value Update */ +#define PWM_SSPUP_SPRDUP(value) ((PWM_SSPUP_SPRDUP_Msk & ((value) << PWM_SSPUP_SPRDUP_Pos))) +/* -------- PWM_SMMR : (PWM Offset: 0xB0) PWM Stepper Motor Mode Register -------- */ +#define PWM_SMMR_GCEN0 (0x1u << 0) /**< \brief (PWM_SMMR) Gray Count ENable */ +#define PWM_SMMR_GCEN1 (0x1u << 1) /**< \brief (PWM_SMMR) Gray Count ENable */ +#define PWM_SMMR_DOWN0 (0x1u << 16) /**< \brief (PWM_SMMR) DOWN Count */ +#define PWM_SMMR_DOWN1 (0x1u << 17) /**< \brief (PWM_SMMR) DOWN Count */ +/* -------- PWM_FPV2 : (PWM Offset: 0xC0) PWM Fault Protection Value 2 Register -------- */ +#define PWM_FPV2_FPZH0 (0x1u << 0) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 0 */ +#define PWM_FPV2_FPZH1 (0x1u << 1) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 1 */ +#define PWM_FPV2_FPZH2 (0x1u << 2) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 2 */ +#define PWM_FPV2_FPZH3 (0x1u << 3) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 3 */ +#define PWM_FPV2_FPZL0 (0x1u << 16) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 0 */ +#define PWM_FPV2_FPZL1 (0x1u << 17) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 1 */ +#define PWM_FPV2_FPZL2 (0x1u << 18) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 2 */ +#define PWM_FPV2_FPZL3 (0x1u << 19) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 3 */ +/* -------- PWM_WPCR : (PWM Offset: 0xE4) PWM Write Protection Control Register -------- */ +#define PWM_WPCR_WPCMD_Pos 0 +#define PWM_WPCR_WPCMD_Msk (0x3u << PWM_WPCR_WPCMD_Pos) /**< \brief (PWM_WPCR) Write Protection Command */ +#define PWM_WPCR_WPCMD(value) ((PWM_WPCR_WPCMD_Msk & ((value) << PWM_WPCR_WPCMD_Pos))) +#define PWM_WPCR_WPCMD_DISABLE_SW_PROT (0x0u << 0) /**< \brief (PWM_WPCR) Disables the software write protection of the register groups of which the bit WPRGx is at '1'. */ +#define PWM_WPCR_WPCMD_ENABLE_SW_PROT (0x1u << 0) /**< \brief (PWM_WPCR) Enables the software write protection of the register groups of which the bit WPRGx is at '1'. */ +#define PWM_WPCR_WPCMD_ENABLE_HW_PROT (0x2u << 0) /**< \brief (PWM_WPCR) Enables the hardware write protection of the register groups of which the bit WPRGx is at '1'. Only a hardware reset of the PWM controller can disable the hardware write protection. Moreover, to meet security requirements, the PIO lines associated with the PWM can not be configured through the PIO interface. */ +#define PWM_WPCR_WPRG0 (0x1u << 2) /**< \brief (PWM_WPCR) Write Protection Register Group 0 */ +#define PWM_WPCR_WPRG1 (0x1u << 3) /**< \brief (PWM_WPCR) Write Protection Register Group 1 */ +#define PWM_WPCR_WPRG2 (0x1u << 4) /**< \brief (PWM_WPCR) Write Protection Register Group 2 */ +#define PWM_WPCR_WPRG3 (0x1u << 5) /**< \brief (PWM_WPCR) Write Protection Register Group 3 */ +#define PWM_WPCR_WPRG4 (0x1u << 6) /**< \brief (PWM_WPCR) Write Protection Register Group 4 */ +#define PWM_WPCR_WPRG5 (0x1u << 7) /**< \brief (PWM_WPCR) Write Protection Register Group 5 */ +#define PWM_WPCR_WPKEY_Pos 8 +#define PWM_WPCR_WPKEY_Msk (0xffffffu << PWM_WPCR_WPKEY_Pos) /**< \brief (PWM_WPCR) Write Protection Key */ +#define PWM_WPCR_WPKEY(value) ((PWM_WPCR_WPKEY_Msk & ((value) << PWM_WPCR_WPKEY_Pos))) +#define PWM_WPCR_WPKEY_PASSWD (0x50574Du << 8) /**< \brief (PWM_WPCR) Writing any other value in this field aborts the write operation of the WPCMD field.Always reads as 0 */ +/* -------- PWM_WPSR : (PWM Offset: 0xE8) PWM Write Protection Status Register -------- */ +#define PWM_WPSR_WPSWS0 (0x1u << 0) /**< \brief (PWM_WPSR) Write Protect SW Status */ +#define PWM_WPSR_WPSWS1 (0x1u << 1) /**< \brief (PWM_WPSR) Write Protect SW Status */ +#define PWM_WPSR_WPSWS2 (0x1u << 2) /**< \brief (PWM_WPSR) Write Protect SW Status */ +#define PWM_WPSR_WPSWS3 (0x1u << 3) /**< \brief (PWM_WPSR) Write Protect SW Status */ +#define PWM_WPSR_WPSWS4 (0x1u << 4) /**< \brief (PWM_WPSR) Write Protect SW Status */ +#define PWM_WPSR_WPSWS5 (0x1u << 5) /**< \brief (PWM_WPSR) Write Protect SW Status */ +#define PWM_WPSR_WPVS (0x1u << 7) /**< \brief (PWM_WPSR) Write Protect Violation Status */ +#define PWM_WPSR_WPHWS0 (0x1u << 8) /**< \brief (PWM_WPSR) Write Protect HW Status */ +#define PWM_WPSR_WPHWS1 (0x1u << 9) /**< \brief (PWM_WPSR) Write Protect HW Status */ +#define PWM_WPSR_WPHWS2 (0x1u << 10) /**< \brief (PWM_WPSR) Write Protect HW Status */ +#define PWM_WPSR_WPHWS3 (0x1u << 11) /**< \brief (PWM_WPSR) Write Protect HW Status */ +#define PWM_WPSR_WPHWS4 (0x1u << 12) /**< \brief (PWM_WPSR) Write Protect HW Status */ +#define PWM_WPSR_WPHWS5 (0x1u << 13) /**< \brief (PWM_WPSR) Write Protect HW Status */ +#define PWM_WPSR_WPVSRC_Pos 16 +#define PWM_WPSR_WPVSRC_Msk (0xffffu << PWM_WPSR_WPVSRC_Pos) /**< \brief (PWM_WPSR) Write Protect Violation Source */ +/* -------- PWM_VERSION : (PWM Offset: 0xFC) Version Register -------- */ +#define PWM_VERSION_VERSION_Pos 0 +#define PWM_VERSION_VERSION_Msk (0xfffu << PWM_VERSION_VERSION_Pos) /**< \brief (PWM_VERSION) Version of the Hardware Module */ +#define PWM_VERSION_MFN_Pos 16 +#define PWM_VERSION_MFN_Msk (0x7u << PWM_VERSION_MFN_Pos) /**< \brief (PWM_VERSION) Metal Fix Number */ +/* -------- PWM_CMPV : (PWM Offset: N/A) PWM Comparison 0 Value Register -------- */ +#define PWM_CMPV_CV_Pos 0 +#define PWM_CMPV_CV_Msk (0xffffffu << PWM_CMPV_CV_Pos) /**< \brief (PWM_CMPV) Comparison x Value */ +#define PWM_CMPV_CV(value) ((PWM_CMPV_CV_Msk & ((value) << PWM_CMPV_CV_Pos))) +#define PWM_CMPV_CVM (0x1u << 24) /**< \brief (PWM_CMPV) Comparison x Value Mode */ +/* -------- PWM_CMPVUPD : (PWM Offset: N/A) PWM Comparison 0 Value Update Register -------- */ +#define PWM_CMPVUPD_CVUPD_Pos 0 +#define PWM_CMPVUPD_CVUPD_Msk (0xffffffu << PWM_CMPVUPD_CVUPD_Pos) /**< \brief (PWM_CMPVUPD) Comparison x Value Update */ +#define PWM_CMPVUPD_CVUPD(value) ((PWM_CMPVUPD_CVUPD_Msk & ((value) << PWM_CMPVUPD_CVUPD_Pos))) +#define PWM_CMPVUPD_CVMUPD (0x1u << 24) /**< \brief (PWM_CMPVUPD) Comparison x Value Mode Update */ +/* -------- PWM_CMPM : (PWM Offset: N/A) PWM Comparison 0 Mode Register -------- */ +#define PWM_CMPM_CEN (0x1u << 0) /**< \brief (PWM_CMPM) Comparison x Enable */ +#define PWM_CMPM_CTR_Pos 4 +#define PWM_CMPM_CTR_Msk (0xfu << PWM_CMPM_CTR_Pos) /**< \brief (PWM_CMPM) Comparison x Trigger */ +#define PWM_CMPM_CTR(value) ((PWM_CMPM_CTR_Msk & ((value) << PWM_CMPM_CTR_Pos))) +#define PWM_CMPM_CPR_Pos 8 +#define PWM_CMPM_CPR_Msk (0xfu << PWM_CMPM_CPR_Pos) /**< \brief (PWM_CMPM) Comparison x Period */ +#define PWM_CMPM_CPR(value) ((PWM_CMPM_CPR_Msk & ((value) << PWM_CMPM_CPR_Pos))) +#define PWM_CMPM_CPRCNT_Pos 12 +#define PWM_CMPM_CPRCNT_Msk (0xfu << PWM_CMPM_CPRCNT_Pos) /**< \brief (PWM_CMPM) Comparison x Period Counter */ +#define PWM_CMPM_CPRCNT(value) ((PWM_CMPM_CPRCNT_Msk & ((value) << PWM_CMPM_CPRCNT_Pos))) +#define PWM_CMPM_CUPR_Pos 16 +#define PWM_CMPM_CUPR_Msk (0xfu << PWM_CMPM_CUPR_Pos) /**< \brief (PWM_CMPM) Comparison x Update Period */ +#define PWM_CMPM_CUPR(value) ((PWM_CMPM_CUPR_Msk & ((value) << PWM_CMPM_CUPR_Pos))) +#define PWM_CMPM_CUPRCNT_Pos 20 +#define PWM_CMPM_CUPRCNT_Msk (0xfu << PWM_CMPM_CUPRCNT_Pos) /**< \brief (PWM_CMPM) Comparison x Update Period Counter */ +#define PWM_CMPM_CUPRCNT(value) ((PWM_CMPM_CUPRCNT_Msk & ((value) << PWM_CMPM_CUPRCNT_Pos))) +/* -------- PWM_CMPMUPD : (PWM Offset: N/A) PWM Comparison 0 Mode Update Register -------- */ +#define PWM_CMPMUPD_CENUPD (0x1u << 0) /**< \brief (PWM_CMPMUPD) Comparison x Enable Update */ +#define PWM_CMPMUPD_CTRUPD_Pos 4 +#define PWM_CMPMUPD_CTRUPD_Msk (0xfu << PWM_CMPMUPD_CTRUPD_Pos) /**< \brief (PWM_CMPMUPD) Comparison x Trigger Update */ +#define PWM_CMPMUPD_CTRUPD(value) ((PWM_CMPMUPD_CTRUPD_Msk & ((value) << PWM_CMPMUPD_CTRUPD_Pos))) +#define PWM_CMPMUPD_CPRUPD_Pos 8 +#define PWM_CMPMUPD_CPRUPD_Msk (0xfu << PWM_CMPMUPD_CPRUPD_Pos) /**< \brief (PWM_CMPMUPD) Comparison x Period Update */ +#define PWM_CMPMUPD_CPRUPD(value) ((PWM_CMPMUPD_CPRUPD_Msk & ((value) << PWM_CMPMUPD_CPRUPD_Pos))) +#define PWM_CMPMUPD_CUPRUPD_Pos 16 +#define PWM_CMPMUPD_CUPRUPD_Msk (0xfu << PWM_CMPMUPD_CUPRUPD_Pos) /**< \brief (PWM_CMPMUPD) Comparison x Update Period Update */ +#define PWM_CMPMUPD_CUPRUPD(value) ((PWM_CMPMUPD_CUPRUPD_Msk & ((value) << PWM_CMPMUPD_CUPRUPD_Pos))) +/* -------- PWM_CMR : (PWM Offset: N/A) PWM Channel Mode Register -------- */ +#define PWM_CMR_CPRE_Pos 0 +#define PWM_CMR_CPRE_Msk (0xfu << PWM_CMR_CPRE_Pos) /**< \brief (PWM_CMR) Channel Pre-scaler */ +#define PWM_CMR_CPRE(value) ((PWM_CMR_CPRE_Msk & ((value) << PWM_CMR_CPRE_Pos))) +#define PWM_CMR_CPRE_MCK (0x0u << 0) /**< \brief (PWM_CMR) Peripheral clock */ +#define PWM_CMR_CPRE_MCK_DIV_2 (0x1u << 0) /**< \brief (PWM_CMR) Peripheral clock/2 */ +#define PWM_CMR_CPRE_MCK_DIV_4 (0x2u << 0) /**< \brief (PWM_CMR) Peripheral clock/4 */ +#define PWM_CMR_CPRE_MCK_DIV_8 (0x3u << 0) /**< \brief (PWM_CMR) Peripheral clock/8 */ +#define PWM_CMR_CPRE_MCK_DIV_16 (0x4u << 0) /**< \brief (PWM_CMR) Peripheral clock/16 */ +#define PWM_CMR_CPRE_MCK_DIV_32 (0x5u << 0) /**< \brief (PWM_CMR) Peripheral clock/32 */ +#define PWM_CMR_CPRE_MCK_DIV_64 (0x6u << 0) /**< \brief (PWM_CMR) Peripheral clock/64 */ +#define PWM_CMR_CPRE_MCK_DIV_128 (0x7u << 0) /**< \brief (PWM_CMR) Peripheral clock/128 */ +#define PWM_CMR_CPRE_MCK_DIV_256 (0x8u << 0) /**< \brief (PWM_CMR) Peripheral clock/256 */ +#define PWM_CMR_CPRE_MCK_DIV_512 (0x9u << 0) /**< \brief (PWM_CMR) Peripheral clock/512 */ +#define PWM_CMR_CPRE_MCK_DIV_1024 (0xAu << 0) /**< \brief (PWM_CMR) Peripheral clock/1024 */ +#define PWM_CMR_CPRE_CLKA (0xBu << 0) /**< \brief (PWM_CMR) Clock A */ +#define PWM_CMR_CPRE_CLKB (0xCu << 0) /**< \brief (PWM_CMR) Clock B */ +#define PWM_CMR_CALG (0x1u << 8) /**< \brief (PWM_CMR) Channel Alignment */ +#define PWM_CMR_CPOL (0x1u << 9) /**< \brief (PWM_CMR) Channel Polarity */ +#define PWM_CMR_CES (0x1u << 10) /**< \brief (PWM_CMR) Counter Event Selection */ +#define PWM_CMR_UPDS (0x1u << 11) /**< \brief (PWM_CMR) Update Selection */ +#define PWM_CMR_DPOLI (0x1u << 12) /**< \brief (PWM_CMR) Disabled Polarity Inverted */ +#define PWM_CMR_TCTS (0x1u << 13) /**< \brief (PWM_CMR) Timer Counter Trigger Selection */ +#define PWM_CMR_DTE (0x1u << 16) /**< \brief (PWM_CMR) Dead-Time Generator Enable */ +#define PWM_CMR_DTHI (0x1u << 17) /**< \brief (PWM_CMR) Dead-Time PWMHx Output Inverted */ +#define PWM_CMR_DTLI (0x1u << 18) /**< \brief (PWM_CMR) Dead-Time PWMLx Output Inverted */ +#define PWM_CMR_PPM (0x1u << 19) /**< \brief (PWM_CMR) Push-Pull Mode */ +/* -------- PWM_CDTY : (PWM Offset: N/A) PWM Channel Duty Cycle Register -------- */ +#define PWM_CDTY_CDTY_Pos 0 +#define PWM_CDTY_CDTY_Msk (0xffffffu << PWM_CDTY_CDTY_Pos) /**< \brief (PWM_CDTY) Channel Duty-Cycle */ +#define PWM_CDTY_CDTY(value) ((PWM_CDTY_CDTY_Msk & ((value) << PWM_CDTY_CDTY_Pos))) +/* -------- PWM_CDTYUPD : (PWM Offset: N/A) PWM Channel Duty Cycle Update Register -------- */ +#define PWM_CDTYUPD_CDTYUPD_Pos 0 +#define PWM_CDTYUPD_CDTYUPD_Msk (0xffffffu << PWM_CDTYUPD_CDTYUPD_Pos) /**< \brief (PWM_CDTYUPD) Channel Duty-Cycle Update */ +#define PWM_CDTYUPD_CDTYUPD(value) ((PWM_CDTYUPD_CDTYUPD_Msk & ((value) << PWM_CDTYUPD_CDTYUPD_Pos))) +/* -------- PWM_CPRD : (PWM Offset: N/A) PWM Channel Period Register -------- */ +#define PWM_CPRD_CPRD_Pos 0 +#define PWM_CPRD_CPRD_Msk (0xffffffu << PWM_CPRD_CPRD_Pos) /**< \brief (PWM_CPRD) Channel Period */ +#define PWM_CPRD_CPRD(value) ((PWM_CPRD_CPRD_Msk & ((value) << PWM_CPRD_CPRD_Pos))) +/* -------- PWM_CPRDUPD : (PWM Offset: N/A) PWM Channel Period Update Register -------- */ +#define PWM_CPRDUPD_CPRDUPD_Pos 0 +#define PWM_CPRDUPD_CPRDUPD_Msk (0xffffffu << PWM_CPRDUPD_CPRDUPD_Pos) /**< \brief (PWM_CPRDUPD) Channel Period Update */ +#define PWM_CPRDUPD_CPRDUPD(value) ((PWM_CPRDUPD_CPRDUPD_Msk & ((value) << PWM_CPRDUPD_CPRDUPD_Pos))) +/* -------- PWM_CCNT : (PWM Offset: N/A) PWM Channel Counter Register -------- */ +#define PWM_CCNT_CNT_Pos 0 +#define PWM_CCNT_CNT_Msk (0xffffffu << PWM_CCNT_CNT_Pos) /**< \brief (PWM_CCNT) Channel Counter Register */ +/* -------- PWM_DT : (PWM Offset: N/A) PWM Channel Dead Time Register -------- */ +#define PWM_DT_DTH_Pos 0 +#define PWM_DT_DTH_Msk (0xffffu << PWM_DT_DTH_Pos) /**< \brief (PWM_DT) Dead-Time Value for PWMHx Output */ +#define PWM_DT_DTH(value) ((PWM_DT_DTH_Msk & ((value) << PWM_DT_DTH_Pos))) +#define PWM_DT_DTL_Pos 16 +#define PWM_DT_DTL_Msk (0xffffu << PWM_DT_DTL_Pos) /**< \brief (PWM_DT) Dead-Time Value for PWMLx Output */ +#define PWM_DT_DTL(value) ((PWM_DT_DTL_Msk & ((value) << PWM_DT_DTL_Pos))) +/* -------- PWM_DTUPD : (PWM Offset: N/A) PWM Channel Dead Time Update Register -------- */ +#define PWM_DTUPD_DTHUPD_Pos 0 +#define PWM_DTUPD_DTHUPD_Msk (0xffffu << PWM_DTUPD_DTHUPD_Pos) /**< \brief (PWM_DTUPD) Dead-Time Value Update for PWMHx Output */ +#define PWM_DTUPD_DTHUPD(value) ((PWM_DTUPD_DTHUPD_Msk & ((value) << PWM_DTUPD_DTHUPD_Pos))) +#define PWM_DTUPD_DTLUPD_Pos 16 +#define PWM_DTUPD_DTLUPD_Msk (0xffffu << PWM_DTUPD_DTLUPD_Pos) /**< \brief (PWM_DTUPD) Dead-Time Value Update for PWMLx Output */ +#define PWM_DTUPD_DTLUPD(value) ((PWM_DTUPD_DTLUPD_Msk & ((value) << PWM_DTUPD_DTLUPD_Pos))) +/* -------- PWM_CMUPD0 : (PWM Offset: 0x400) PWM Channel Mode Update Register (ch_num = 0) -------- */ +#define PWM_CMUPD0_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD0) Channel Polarity Update */ +#define PWM_CMUPD0_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD0) Channel Polarity Inversion Update */ +/* -------- PWM_CMUPD1 : (PWM Offset: 0x420) PWM Channel Mode Update Register (ch_num = 1) -------- */ +#define PWM_CMUPD1_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD1) Channel Polarity Update */ +#define PWM_CMUPD1_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD1) Channel Polarity Inversion Update */ +/* -------- PWM_ETRG1 : (PWM Offset: 0x42C) PWM External Trigger Register (trg_num = 1) -------- */ +#define PWM_ETRG1_MAXCNT_Pos 0 +#define PWM_ETRG1_MAXCNT_Msk (0xffffffu << PWM_ETRG1_MAXCNT_Pos) /**< \brief (PWM_ETRG1) Maximum Counter value */ +#define PWM_ETRG1_MAXCNT(value) ((PWM_ETRG1_MAXCNT_Msk & ((value) << PWM_ETRG1_MAXCNT_Pos))) +#define PWM_ETRG1_TRGMODE_Pos 24 +#define PWM_ETRG1_TRGMODE_Msk (0x3u << PWM_ETRG1_TRGMODE_Pos) /**< \brief (PWM_ETRG1) External Trigger Mode */ +#define PWM_ETRG1_TRGMODE(value) ((PWM_ETRG1_TRGMODE_Msk & ((value) << PWM_ETRG1_TRGMODE_Pos))) +#define PWM_ETRG1_TRGMODE_OFF (0x0u << 24) /**< \brief (PWM_ETRG1) External trigger is not enabled. */ +#define PWM_ETRG1_TRGMODE_MODE1 (0x1u << 24) /**< \brief (PWM_ETRG1) External PWM Reset Mode */ +#define PWM_ETRG1_TRGMODE_MODE2 (0x2u << 24) /**< \brief (PWM_ETRG1) External PWM Start Mode */ +#define PWM_ETRG1_TRGMODE_MODE3 (0x3u << 24) /**< \brief (PWM_ETRG1) Cycle-by-cycle Duty Mode */ +#define PWM_ETRG1_TRGEDGE (0x1u << 28) /**< \brief (PWM_ETRG1) Edge Selection */ +#define PWM_ETRG1_TRGEDGE_FALLING_ZERO (0x0u << 28) /**< \brief (PWM_ETRG1) TRGMODE = 1: TRGINx event detection on falling edge.TRGMODE = 2, 3: TRGINx active level is 0 */ +#define PWM_ETRG1_TRGEDGE_RISING_ONE (0x1u << 28) /**< \brief (PWM_ETRG1) TRGMODE = 1: TRGINx event detection on rising edge.TRGMODE = 2, 3: TRGINx active level is 1 */ +#define PWM_ETRG1_TRGFILT (0x1u << 29) /**< \brief (PWM_ETRG1) Filtered input */ +#define PWM_ETRG1_TRGSRC (0x1u << 30) /**< \brief (PWM_ETRG1) Trigger Source */ +#define PWM_ETRG1_RFEN (0x1u << 31) /**< \brief (PWM_ETRG1) Recoverable Fault Enable */ +/* -------- PWM_LEBR1 : (PWM Offset: 0x430) PWM Leading-Edge Blanking Register (trg_num = 1) -------- */ +#define PWM_LEBR1_LEBDELAY_Pos 0 +#define PWM_LEBR1_LEBDELAY_Msk (0x7fu << PWM_LEBR1_LEBDELAY_Pos) /**< \brief (PWM_LEBR1) Leading-Edge Blanking Delay for TRGINx */ +#define PWM_LEBR1_LEBDELAY(value) ((PWM_LEBR1_LEBDELAY_Msk & ((value) << PWM_LEBR1_LEBDELAY_Pos))) +#define PWM_LEBR1_PWMLFEN (0x1u << 16) /**< \brief (PWM_LEBR1) PWML Falling Edge Enable */ +#define PWM_LEBR1_PWMLREN (0x1u << 17) /**< \brief (PWM_LEBR1) PWML Rising Edge Enable */ +#define PWM_LEBR1_PWMHFEN (0x1u << 18) /**< \brief (PWM_LEBR1) PWMH Falling Edge Enable */ +#define PWM_LEBR1_PWMHREN (0x1u << 19) /**< \brief (PWM_LEBR1) PWMH Rising Edge Enable */ +/* -------- PWM_CMUPD2 : (PWM Offset: 0x440) PWM Channel Mode Update Register (ch_num = 2) -------- */ +#define PWM_CMUPD2_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD2) Channel Polarity Update */ +#define PWM_CMUPD2_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD2) Channel Polarity Inversion Update */ +/* -------- PWM_ETRG2 : (PWM Offset: 0x44C) PWM External Trigger Register (trg_num = 2) -------- */ +#define PWM_ETRG2_MAXCNT_Pos 0 +#define PWM_ETRG2_MAXCNT_Msk (0xffffffu << PWM_ETRG2_MAXCNT_Pos) /**< \brief (PWM_ETRG2) Maximum Counter value */ +#define PWM_ETRG2_MAXCNT(value) ((PWM_ETRG2_MAXCNT_Msk & ((value) << PWM_ETRG2_MAXCNT_Pos))) +#define PWM_ETRG2_TRGMODE_Pos 24 +#define PWM_ETRG2_TRGMODE_Msk (0x3u << PWM_ETRG2_TRGMODE_Pos) /**< \brief (PWM_ETRG2) External Trigger Mode */ +#define PWM_ETRG2_TRGMODE(value) ((PWM_ETRG2_TRGMODE_Msk & ((value) << PWM_ETRG2_TRGMODE_Pos))) +#define PWM_ETRG2_TRGMODE_OFF (0x0u << 24) /**< \brief (PWM_ETRG2) External trigger is not enabled. */ +#define PWM_ETRG2_TRGMODE_MODE1 (0x1u << 24) /**< \brief (PWM_ETRG2) External PWM Reset Mode */ +#define PWM_ETRG2_TRGMODE_MODE2 (0x2u << 24) /**< \brief (PWM_ETRG2) External PWM Start Mode */ +#define PWM_ETRG2_TRGMODE_MODE3 (0x3u << 24) /**< \brief (PWM_ETRG2) Cycle-by-cycle Duty Mode */ +#define PWM_ETRG2_TRGEDGE (0x1u << 28) /**< \brief (PWM_ETRG2) Edge Selection */ +#define PWM_ETRG2_TRGEDGE_FALLING_ZERO (0x0u << 28) /**< \brief (PWM_ETRG2) TRGMODE = 1: TRGINx event detection on falling edge.TRGMODE = 2, 3: TRGINx active level is 0 */ +#define PWM_ETRG2_TRGEDGE_RISING_ONE (0x1u << 28) /**< \brief (PWM_ETRG2) TRGMODE = 1: TRGINx event detection on rising edge.TRGMODE = 2, 3: TRGINx active level is 1 */ +#define PWM_ETRG2_TRGFILT (0x1u << 29) /**< \brief (PWM_ETRG2) Filtered input */ +#define PWM_ETRG2_TRGSRC (0x1u << 30) /**< \brief (PWM_ETRG2) Trigger Source */ +#define PWM_ETRG2_RFEN (0x1u << 31) /**< \brief (PWM_ETRG2) Recoverable Fault Enable */ +/* -------- PWM_LEBR2 : (PWM Offset: 0x450) PWM Leading-Edge Blanking Register (trg_num = 2) -------- */ +#define PWM_LEBR2_LEBDELAY_Pos 0 +#define PWM_LEBR2_LEBDELAY_Msk (0x7fu << PWM_LEBR2_LEBDELAY_Pos) /**< \brief (PWM_LEBR2) Leading-Edge Blanking Delay for TRGINx */ +#define PWM_LEBR2_LEBDELAY(value) ((PWM_LEBR2_LEBDELAY_Msk & ((value) << PWM_LEBR2_LEBDELAY_Pos))) +#define PWM_LEBR2_PWMLFEN (0x1u << 16) /**< \brief (PWM_LEBR2) PWML Falling Edge Enable */ +#define PWM_LEBR2_PWMLREN (0x1u << 17) /**< \brief (PWM_LEBR2) PWML Rising Edge Enable */ +#define PWM_LEBR2_PWMHFEN (0x1u << 18) /**< \brief (PWM_LEBR2) PWMH Falling Edge Enable */ +#define PWM_LEBR2_PWMHREN (0x1u << 19) /**< \brief (PWM_LEBR2) PWMH Rising Edge Enable */ +/* -------- PWM_CMUPD3 : (PWM Offset: 0x460) PWM Channel Mode Update Register (ch_num = 3) -------- */ +#define PWM_CMUPD3_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD3) Channel Polarity Update */ +#define PWM_CMUPD3_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD3) Channel Polarity Inversion Update */ + +/*@}*/ + + +#endif /* _SAMA5D2_PWM_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_qspi.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_qspi.h new file mode 100644 index 000000000..49bc5fb6c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_qspi.h @@ -0,0 +1,224 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_QSPI_COMPONENT_ +#define _SAMA5D2_QSPI_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Quad Serial Peripheral Interface */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_QSPI Quad Serial Peripheral Interface */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Qspi hardware registers */ +typedef struct { + __O uint32_t QSPI_CR; /**< \brief (Qspi Offset: 0x00) Control Register */ + __IO uint32_t QSPI_MR; /**< \brief (Qspi Offset: 0x04) Mode Register */ + __I uint32_t QSPI_RDR; /**< \brief (Qspi Offset: 0x08) Receive Data Register */ + __O uint32_t QSPI_TDR; /**< \brief (Qspi Offset: 0x0C) Transmit Data Register */ + __I uint32_t QSPI_SR; /**< \brief (Qspi Offset: 0x10) Status Register */ + __O uint32_t QSPI_IER; /**< \brief (Qspi Offset: 0x14) Interrupt Enable Register */ + __O uint32_t QSPI_IDR; /**< \brief (Qspi Offset: 0x18) Interrupt Disable Register */ + __I uint32_t QSPI_IMR; /**< \brief (Qspi Offset: 0x1C) Interrupt Mask Register */ + __IO uint32_t QSPI_SCR; /**< \brief (Qspi Offset: 0x20) Serial Clock Register */ + __I uint32_t Reserved1[3]; + __IO uint32_t QSPI_IAR; /**< \brief (Qspi Offset: 0x30) Instruction Address Register */ + __IO uint32_t QSPI_ICR; /**< \brief (Qspi Offset: 0x34) Instruction Code Register */ + __IO uint32_t QSPI_IFR; /**< \brief (Qspi Offset: 0x38) Instruction Frame Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t QSPI_SMR; /**< \brief (Qspi Offset: 0x40) Scrambling Mode Register */ + __O uint32_t QSPI_SKR; /**< \brief (Qspi Offset: 0x44) Scrambling Key Register */ + __I uint32_t Reserved3[39]; + __IO uint32_t QSPI_WPMR; /**< \brief (Qspi Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t QSPI_WPSR; /**< \brief (Qspi Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved4[4]; + __I uint32_t QSPI_VERSION; /**< \brief (Qspi Offset: 0x00FC) Version Register */ +} Qspi; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- QSPI_CR : (QSPI Offset: 0x00) Control Register -------- */ +#define QSPI_CR_QSPIEN (0x1u << 0) /**< \brief (QSPI_CR) QSPI Enable */ +#define QSPI_CR_QSPIDIS (0x1u << 1) /**< \brief (QSPI_CR) QSPI Disable */ +#define QSPI_CR_SWRST (0x1u << 7) /**< \brief (QSPI_CR) QSPI Software Reset */ +#define QSPI_CR_LASTXFER (0x1u << 24) /**< \brief (QSPI_CR) Last Transfer */ +/* -------- QSPI_MR : (QSPI Offset: 0x04) Mode Register -------- */ +#define QSPI_MR_SMM (0x1u << 0) /**< \brief (QSPI_MR) Serial Memory Mode */ +#define QSPI_MR_SMM_SPI (0x0u << 0) /**< \brief (QSPI_MR) The QSPI is in SPI mode. */ +#define QSPI_MR_SMM_MEMORY (0x1u << 0) /**< \brief (QSPI_MR) The QSPI is in Serial Memory mode. */ +#define QSPI_MR_LLB (0x1u << 1) /**< \brief (QSPI_MR) Local Loopback Enable */ +#define QSPI_MR_LLB_DISABLED (0x0u << 1) /**< \brief (QSPI_MR) Local loopback path disabled. */ +#define QSPI_MR_LLB_ENABLED (0x1u << 1) /**< \brief (QSPI_MR) Local loopback path enabled. */ +#define QSPI_MR_WDRBT (0x1u << 2) /**< \brief (QSPI_MR) Wait Data Read Before Transfer */ +#define QSPI_MR_WDRBT_DISABLED (0x0u << 2) /**< \brief (QSPI_MR) No effect. In SPI mode, a transfer can be initiated whatever the state of the QSPI_RDR is. */ +#define QSPI_MR_WDRBT_ENABLED (0x1u << 2) /**< \brief (QSPI_MR) In SPI mode, a transfer can start only if the QSPI_RDR is empty, i.e., does not contain any unread data. This mode prevents overrun error in reception. */ +#define QSPI_MR_SMRM (0x1u << 3) /**< \brief (QSPI_MR) Serial Memory Register Mode */ +#define QSPI_MR_CSMODE_Pos 4 +#define QSPI_MR_CSMODE_Msk (0x3u << QSPI_MR_CSMODE_Pos) /**< \brief (QSPI_MR) Chip Select Mode */ +#define QSPI_MR_CSMODE(value) ((QSPI_MR_CSMODE_Msk & ((value) << QSPI_MR_CSMODE_Pos))) +#define QSPI_MR_CSMODE_NOT_RELOADED (0x0u << 4) /**< \brief (QSPI_MR) The chip select is deasserted if QSPI_TDR.TD has not been reloaded before the end of the current transfer. */ +#define QSPI_MR_CSMODE_LASTXFER (0x1u << 4) /**< \brief (QSPI_MR) The chip select is deasserted when the bit LASTXFER is written at 1 and the character written in QSPI_TDR.TD has been transferred. */ +#define QSPI_MR_CSMODE_SYSTEMATICALLY (0x2u << 4) /**< \brief (QSPI_MR) The chip select is deasserted systematically after each transfer. */ +#define QSPI_MR_NBBITS_Pos 8 +#define QSPI_MR_NBBITS_Msk (0xfu << QSPI_MR_NBBITS_Pos) /**< \brief (QSPI_MR) Number Of Bits Per Transfer */ +#define QSPI_MR_NBBITS(value) ((QSPI_MR_NBBITS_Msk & ((value) << QSPI_MR_NBBITS_Pos))) +#define QSPI_MR_NBBITS_8_BIT (0x0u << 8) /**< \brief (QSPI_MR) 8 bits for transfer */ +#define QSPI_MR_NBBITS_16_BIT (0x8u << 8) /**< \brief (QSPI_MR) 16 bits for transfer */ +#define QSPI_MR_DLYBCT_Pos 16 +#define QSPI_MR_DLYBCT_Msk (0xffu << QSPI_MR_DLYBCT_Pos) /**< \brief (QSPI_MR) Delay Between Consecutive Transfers */ +#define QSPI_MR_DLYBCT(value) ((QSPI_MR_DLYBCT_Msk & ((value) << QSPI_MR_DLYBCT_Pos))) +#define QSPI_MR_DLYCS_Pos 24 +#define QSPI_MR_DLYCS_Msk (0xffu << QSPI_MR_DLYCS_Pos) /**< \brief (QSPI_MR) Minimum Inactive QCS Delay */ +#define QSPI_MR_DLYCS(value) ((QSPI_MR_DLYCS_Msk & ((value) << QSPI_MR_DLYCS_Pos))) +/* -------- QSPI_RDR : (QSPI Offset: 0x08) Receive Data Register -------- */ +#define QSPI_RDR_RD_Pos 0 +#define QSPI_RDR_RD_Msk (0xffffu << QSPI_RDR_RD_Pos) /**< \brief (QSPI_RDR) Receive Data */ +/* -------- QSPI_TDR : (QSPI Offset: 0x0C) Transmit Data Register -------- */ +#define QSPI_TDR_TD_Pos 0 +#define QSPI_TDR_TD_Msk (0xffffu << QSPI_TDR_TD_Pos) /**< \brief (QSPI_TDR) Transmit Data */ +#define QSPI_TDR_TD(value) ((QSPI_TDR_TD_Msk & ((value) << QSPI_TDR_TD_Pos))) +/* -------- QSPI_SR : (QSPI Offset: 0x10) Status Register -------- */ +#define QSPI_SR_RDRF (0x1u << 0) /**< \brief (QSPI_SR) Receive Data Register Full */ +#define QSPI_SR_TDRE (0x1u << 1) /**< \brief (QSPI_SR) Transmit Data Register Empty */ +#define QSPI_SR_TXEMPTY (0x1u << 2) /**< \brief (QSPI_SR) Transmission Registers Empty */ +#define QSPI_SR_OVRES (0x1u << 3) /**< \brief (QSPI_SR) Overrun Error Status */ +#define QSPI_SR_CSR (0x1u << 8) /**< \brief (QSPI_SR) Chip Select Rise */ +#define QSPI_SR_CSS (0x1u << 9) /**< \brief (QSPI_SR) Chip Select Status */ +#define QSPI_SR_INSTRE (0x1u << 10) /**< \brief (QSPI_SR) Instruction End Status */ +#define QSPI_SR_QSPIENS (0x1u << 24) /**< \brief (QSPI_SR) QSPI Enable Status */ +/* -------- QSPI_IER : (QSPI Offset: 0x14) Interrupt Enable Register -------- */ +#define QSPI_IER_RDRF (0x1u << 0) /**< \brief (QSPI_IER) Receive Data Register Full Interrupt Enable */ +#define QSPI_IER_TDRE (0x1u << 1) /**< \brief (QSPI_IER) Transmit Data Register Empty Interrupt Enable */ +#define QSPI_IER_TXEMPTY (0x1u << 2) /**< \brief (QSPI_IER) Transmission Registers Empty Enable */ +#define QSPI_IER_OVRES (0x1u << 3) /**< \brief (QSPI_IER) Overrun Error Interrupt Enable */ +#define QSPI_IER_CSR (0x1u << 8) /**< \brief (QSPI_IER) Chip Select Rise Interrupt Enable */ +#define QSPI_IER_CSS (0x1u << 9) /**< \brief (QSPI_IER) Chip Select Status Interrupt Enable */ +#define QSPI_IER_INSTRE (0x1u << 10) /**< \brief (QSPI_IER) Instruction End Interrupt Enable */ +/* -------- QSPI_IDR : (QSPI Offset: 0x18) Interrupt Disable Register -------- */ +#define QSPI_IDR_RDRF (0x1u << 0) /**< \brief (QSPI_IDR) Receive Data Register Full Interrupt Disable */ +#define QSPI_IDR_TDRE (0x1u << 1) /**< \brief (QSPI_IDR) Transmit Data Register Empty Interrupt Disable */ +#define QSPI_IDR_TXEMPTY (0x1u << 2) /**< \brief (QSPI_IDR) Transmission Registers Empty Disable */ +#define QSPI_IDR_OVRES (0x1u << 3) /**< \brief (QSPI_IDR) Overrun Error Interrupt Disable */ +#define QSPI_IDR_CSR (0x1u << 8) /**< \brief (QSPI_IDR) Chip Select Rise Interrupt Disable */ +#define QSPI_IDR_CSS (0x1u << 9) /**< \brief (QSPI_IDR) Chip Select Status Interrupt Disable */ +#define QSPI_IDR_INSTRE (0x1u << 10) /**< \brief (QSPI_IDR) Instruction End Interrupt Disable */ +/* -------- QSPI_IMR : (QSPI Offset: 0x1C) Interrupt Mask Register -------- */ +#define QSPI_IMR_RDRF (0x1u << 0) /**< \brief (QSPI_IMR) Receive Data Register Full Interrupt Mask */ +#define QSPI_IMR_TDRE (0x1u << 1) /**< \brief (QSPI_IMR) Transmit Data Register Empty Interrupt Mask */ +#define QSPI_IMR_TXEMPTY (0x1u << 2) /**< \brief (QSPI_IMR) Transmission Registers Empty Mask */ +#define QSPI_IMR_OVRES (0x1u << 3) /**< \brief (QSPI_IMR) Overrun Error Interrupt Mask */ +#define QSPI_IMR_CSR (0x1u << 8) /**< \brief (QSPI_IMR) Chip Select Rise Interrupt Mask */ +#define QSPI_IMR_CSS (0x1u << 9) /**< \brief (QSPI_IMR) Chip Select Status Interrupt Mask */ +#define QSPI_IMR_INSTRE (0x1u << 10) /**< \brief (QSPI_IMR) Instruction End Interrupt Mask */ +/* -------- QSPI_SCR : (QSPI Offset: 0x20) Serial Clock Register -------- */ +#define QSPI_SCR_CPOL (0x1u << 0) /**< \brief (QSPI_SCR) Clock Polarity */ +#define QSPI_SCR_CPHA (0x1u << 1) /**< \brief (QSPI_SCR) Clock Phase */ +#define QSPI_SCR_SCBR_Pos 8 +#define QSPI_SCR_SCBR_Msk (0xffu << QSPI_SCR_SCBR_Pos) /**< \brief (QSPI_SCR) Serial Clock Baud Rate */ +#define QSPI_SCR_SCBR(value) ((QSPI_SCR_SCBR_Msk & ((value) << QSPI_SCR_SCBR_Pos))) +#define QSPI_SCR_DLYBS_Pos 16 +#define QSPI_SCR_DLYBS_Msk (0xffu << QSPI_SCR_DLYBS_Pos) /**< \brief (QSPI_SCR) Delay Before QSCK */ +#define QSPI_SCR_DLYBS(value) ((QSPI_SCR_DLYBS_Msk & ((value) << QSPI_SCR_DLYBS_Pos))) +/* -------- QSPI_IAR : (QSPI Offset: 0x30) Instruction Address Register -------- */ +#define QSPI_IAR_ADDR_Pos 0 +#define QSPI_IAR_ADDR_Msk (0xffffffffu << QSPI_IAR_ADDR_Pos) /**< \brief (QSPI_IAR) Address */ +#define QSPI_IAR_ADDR(value) ((QSPI_IAR_ADDR_Msk & ((value) << QSPI_IAR_ADDR_Pos))) +/* -------- QSPI_ICR : (QSPI Offset: 0x34) Instruction Code Register -------- */ +#define QSPI_ICR_INST_Pos 0 +#define QSPI_ICR_INST_Msk (0xffu << QSPI_ICR_INST_Pos) /**< \brief (QSPI_ICR) Instruction Code */ +#define QSPI_ICR_INST(value) ((QSPI_ICR_INST_Msk & ((value) << QSPI_ICR_INST_Pos))) +#define QSPI_ICR_OPT_Pos 16 +#define QSPI_ICR_OPT_Msk (0xffu << QSPI_ICR_OPT_Pos) /**< \brief (QSPI_ICR) Option Code */ +#define QSPI_ICR_OPT(value) ((QSPI_ICR_OPT_Msk & ((value) << QSPI_ICR_OPT_Pos))) +/* -------- QSPI_IFR : (QSPI Offset: 0x38) Instruction Frame Register -------- */ +#define QSPI_IFR_WIDTH_Pos 0 +#define QSPI_IFR_WIDTH_Msk (0x7u << QSPI_IFR_WIDTH_Pos) /**< \brief (QSPI_IFR) Width of Instruction Code, Address, Option Code and Data */ +#define QSPI_IFR_WIDTH(value) ((QSPI_IFR_WIDTH_Msk & ((value) << QSPI_IFR_WIDTH_Pos))) +#define QSPI_IFR_WIDTH_SINGLE_BIT_SPI (0x0u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Single-bit SPI / Data: Single-bit SPI */ +#define QSPI_IFR_WIDTH_DUAL_OUTPUT (0x1u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Single-bit SPI / Data: Dual SPI */ +#define QSPI_IFR_WIDTH_QUAD_OUTPUT (0x2u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Single-bit SPI / Data: Quad SPI */ +#define QSPI_IFR_WIDTH_DUAL_IO (0x3u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Dual SPI / Data: Dual SPI */ +#define QSPI_IFR_WIDTH_QUAD_IO (0x4u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Quad SPI / Data: Quad SPI */ +#define QSPI_IFR_WIDTH_DUAL_CMD (0x5u << 0) /**< \brief (QSPI_IFR) Instruction: Dual SPI / Address-Option: Dual SPI / Data: Dual SPI */ +#define QSPI_IFR_WIDTH_QUAD_CMD (0x6u << 0) /**< \brief (QSPI_IFR) Instruction: Quad SPI / Address-Option: Quad SPI / Data: Quad SPI */ +#define QSPI_IFR_INSTEN (0x1u << 4) /**< \brief (QSPI_IFR) Instruction Enable */ +#define QSPI_IFR_ADDREN (0x1u << 5) /**< \brief (QSPI_IFR) Address Enable */ +#define QSPI_IFR_OPTEN (0x1u << 6) /**< \brief (QSPI_IFR) Option Enable */ +#define QSPI_IFR_DATAEN (0x1u << 7) /**< \brief (QSPI_IFR) Data Enable */ +#define QSPI_IFR_OPTL_Pos 8 +#define QSPI_IFR_OPTL_Msk (0x3u << QSPI_IFR_OPTL_Pos) /**< \brief (QSPI_IFR) Option Code Length */ +#define QSPI_IFR_OPTL(value) ((QSPI_IFR_OPTL_Msk & ((value) << QSPI_IFR_OPTL_Pos))) +#define QSPI_IFR_OPTL_OPTION_1BIT (0x0u << 8) /**< \brief (QSPI_IFR) The option code is 1 bit long. */ +#define QSPI_IFR_OPTL_OPTION_2BIT (0x1u << 8) /**< \brief (QSPI_IFR) The option code is 2 bits long. */ +#define QSPI_IFR_OPTL_OPTION_4BIT (0x2u << 8) /**< \brief (QSPI_IFR) The option code is 4 bits long. */ +#define QSPI_IFR_OPTL_OPTION_8BIT (0x3u << 8) /**< \brief (QSPI_IFR) The option code is 8 bits long. */ +#define QSPI_IFR_ADDRL (0x1u << 10) /**< \brief (QSPI_IFR) Address Length */ +#define QSPI_IFR_ADDRL_24_BIT (0x0u << 10) /**< \brief (QSPI_IFR) The address is 24 bits long. */ +#define QSPI_IFR_ADDRL_32_BIT (0x1u << 10) /**< \brief (QSPI_IFR) The address is 32 bits long. */ +#define QSPI_IFR_TFRTYP_Pos 12 +#define QSPI_IFR_TFRTYP_Msk (0x3u << QSPI_IFR_TFRTYP_Pos) /**< \brief (QSPI_IFR) Data Transfer Type */ +#define QSPI_IFR_TFRTYP(value) ((QSPI_IFR_TFRTYP_Msk & ((value) << QSPI_IFR_TFRTYP_Pos))) +#define QSPI_IFR_TFRTYP_TRSFR_READ (0x0u << 12) /**< \brief (QSPI_IFR) Read transfer from the serial memory.Scrambling is not performed.Read at random location (fetch) in the serial Flash memory is not possible. */ +#define QSPI_IFR_TFRTYP_TRSFR_READ_MEMORY (0x1u << 12) /**< \brief (QSPI_IFR) Read data transfer from the serial memory.If enabled, scrambling is performed.Read at random location (fetch) in the serial Flash memory is possible. */ +#define QSPI_IFR_TFRTYP_TRSFR_WRITE (0x2u << 12) /**< \brief (QSPI_IFR) Write transfer into the serial memory.Scrambling is not performed. */ +#define QSPI_IFR_TFRTYP_TRSFR_WRITE_MEMORY (0x3u << 12) /**< \brief (QSPI_IFR) Write data transfer into the serial memory.If enabled, scrambling is performed. */ +#define QSPI_IFR_CRM (0x1u << 14) /**< \brief (QSPI_IFR) Continuous Read Mode */ +#define QSPI_IFR_CRM_DISABLED (0x0u << 14) /**< \brief (QSPI_IFR) The Continuous Read mode is disabled. */ +#define QSPI_IFR_CRM_ENABLED (0x1u << 14) /**< \brief (QSPI_IFR) The Continuous Read mode is enabled. */ +#define QSPI_IFR_NBDUM_Pos 16 +#define QSPI_IFR_NBDUM_Msk (0x1fu << QSPI_IFR_NBDUM_Pos) /**< \brief (QSPI_IFR) Number Of Dummy Cycles */ +#define QSPI_IFR_NBDUM(value) ((QSPI_IFR_NBDUM_Msk & ((value) << QSPI_IFR_NBDUM_Pos))) +/* -------- QSPI_SMR : (QSPI Offset: 0x40) Scrambling Mode Register -------- */ +#define QSPI_SMR_SCREN (0x1u << 0) /**< \brief (QSPI_SMR) Scrambling/Unscrambling Enable */ +#define QSPI_SMR_SCREN_DISABLED (0x0u << 0) /**< \brief (QSPI_SMR) The scrambling/unscrambling is disabled. */ +#define QSPI_SMR_SCREN_ENABLED (0x1u << 0) /**< \brief (QSPI_SMR) The scrambling/unscrambling is enabled. */ +#define QSPI_SMR_RVDIS (0x1u << 1) /**< \brief (QSPI_SMR) Scrambling/Unscrambling Random Value Disable */ +/* -------- QSPI_SKR : (QSPI Offset: 0x44) Scrambling Key Register -------- */ +#define QSPI_SKR_USRK_Pos 0 +#define QSPI_SKR_USRK_Msk (0xffffffffu << QSPI_SKR_USRK_Pos) /**< \brief (QSPI_SKR) Scrambling User Key */ +#define QSPI_SKR_USRK(value) ((QSPI_SKR_USRK_Msk & ((value) << QSPI_SKR_USRK_Pos))) +/* -------- QSPI_WPMR : (QSPI Offset: 0xE4) Write Protection Mode Register -------- */ +#define QSPI_WPMR_WPEN (0x1u << 0) /**< \brief (QSPI_WPMR) Write Protection Enable */ +#define QSPI_WPMR_WPKEY_Pos 8 +#define QSPI_WPMR_WPKEY_Msk (0xffffffu << QSPI_WPMR_WPKEY_Pos) /**< \brief (QSPI_WPMR) Write Protection Key */ +#define QSPI_WPMR_WPKEY(value) ((QSPI_WPMR_WPKEY_Msk & ((value) << QSPI_WPMR_WPKEY_Pos))) +#define QSPI_WPMR_WPKEY_PASSWD (0x515350u << 8) /**< \brief (QSPI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ +/* -------- QSPI_WPSR : (QSPI Offset: 0xE8) Write Protection Status Register -------- */ +#define QSPI_WPSR_WPVS (0x1u << 0) /**< \brief (QSPI_WPSR) Write Protection Violation Status */ +#define QSPI_WPSR_WPVSRC_Pos 8 +#define QSPI_WPSR_WPVSRC_Msk (0xffu << QSPI_WPSR_WPVSRC_Pos) /**< \brief (QSPI_WPSR) Write Protection Violation Source */ +/* -------- QSPI_VERSION : (QSPI Offset: 0x00FC) Version Register -------- */ +#define QSPI_VERSION_VERSION_Pos 0 +#define QSPI_VERSION_VERSION_Msk (0xfffu << QSPI_VERSION_VERSION_Pos) /**< \brief (QSPI_VERSION) Hardware Module Version */ +#define QSPI_VERSION_MFN_Pos 16 +#define QSPI_VERSION_MFN_Msk (0x7u << QSPI_VERSION_MFN_Pos) /**< \brief (QSPI_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_QSPI_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rstc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rstc.h new file mode 100644 index 000000000..946b3aaab --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rstc.h @@ -0,0 +1,76 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_RSTC_COMPONENT_ +#define _SAMA5D2_RSTC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Reset Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_RSTC Reset Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Rstc hardware registers */ +typedef struct { + __O uint32_t RSTC_CR; /**< \brief (Rstc Offset: 0x00) Control Register */ + __I uint32_t RSTC_SR; /**< \brief (Rstc Offset: 0x04) Status Register */ + __IO uint32_t RSTC_MR; /**< \brief (Rstc Offset: 0x08) Mode Register */ +} Rstc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- RSTC_CR : (RSTC Offset: 0x00) Control Register -------- */ +#define RSTC_CR_PROCRST (0x1u << 0) /**< \brief (RSTC_CR) Processor Reset */ +#define RSTC_CR_PERRST (0x1u << 2) /**< \brief (RSTC_CR) Peripheral Reset */ +#define RSTC_CR_KEY_Pos 24 +#define RSTC_CR_KEY_Msk (0xffu << RSTC_CR_KEY_Pos) /**< \brief (RSTC_CR) Write Access Password */ +#define RSTC_CR_KEY(value) ((RSTC_CR_KEY_Msk & ((value) << RSTC_CR_KEY_Pos))) +#define RSTC_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (RSTC_CR) Writing any other value in this field aborts the write operation.Always reads as 0. */ +/* -------- RSTC_SR : (RSTC Offset: 0x04) Status Register -------- */ +#define RSTC_SR_URSTS (0x1u << 0) /**< \brief (RSTC_SR) User Reset Status */ +#define RSTC_SR_RSTTYP_Pos 8 +#define RSTC_SR_RSTTYP_Msk (0x7u << RSTC_SR_RSTTYP_Pos) /**< \brief (RSTC_SR) Reset Type */ +#define RSTC_SR_RSTTYP_GENERAL_RST (0x0u << 8) /**< \brief (RSTC_SR) Both VDDCORE and VDDBU rising */ +#define RSTC_SR_RSTTYP_WKUP_RST (0x1u << 8) /**< \brief (RSTC_SR) VDDCORE rising */ +#define RSTC_SR_RSTTYP_WDT_RST (0x2u << 8) /**< \brief (RSTC_SR) Watchdog fault occurred */ +#define RSTC_SR_RSTTYP_SOFT_RST (0x3u << 8) /**< \brief (RSTC_SR) Processor reset required by the software */ +#define RSTC_SR_RSTTYP_USER_RST (0x4u << 8) /**< \brief (RSTC_SR) NRST pin detected low */ +#define RSTC_SR_NRSTL (0x1u << 16) /**< \brief (RSTC_SR) NRST Pin Level */ +#define RSTC_SR_SRCMP (0x1u << 17) /**< \brief (RSTC_SR) Software Reset Command in Progress */ +/* -------- RSTC_MR : (RSTC Offset: 0x08) Mode Register -------- */ +#define RSTC_MR_URSTEN (0x1u << 0) /**< \brief (RSTC_MR) User Reset Enable */ +#define RSTC_MR_URSTIEN (0x1u << 4) /**< \brief (RSTC_MR) User Reset Interrupt Enable */ +#define RSTC_MR_KEY_Pos 24 +#define RSTC_MR_KEY_Msk (0xffu << RSTC_MR_KEY_Pos) /**< \brief (RSTC_MR) Write Access Password */ +#define RSTC_MR_KEY(value) ((RSTC_MR_KEY_Msk & ((value) << RSTC_MR_KEY_Pos))) +#define RSTC_MR_KEY_PASSWD (0xA5u << 24) /**< \brief (RSTC_MR) Writing any other value in this field aborts the write operation.Always reads as 0. */ + +/*@}*/ + + +#endif /* _SAMA5D2_RSTC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rtc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rtc.h new file mode 100644 index 000000000..14d69b292 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rtc.h @@ -0,0 +1,290 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_RTC_COMPONENT_ +#define _SAMA5D2_RTC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Real-time Clock */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_RTC Real-time Clock */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief RtcTs hardware registers */ +typedef struct { + __I uint32_t RTC_TSTR; /**< \brief (RtcTs Offset: 0x0) TimeStamp Time Register 0 */ + __I uint32_t RTC_TSDR; /**< \brief (RtcTs Offset: 0x4) TimeStamp Date Register 0 */ + __I uint32_t RTC_TSSR; /**< \brief (RtcTs Offset: 0x8) TimeStamp Source Register 0 */ +} RtcTs; +/** \brief Rtc hardware registers */ +#define RTCTS_NUMBER 2 +typedef struct { + __IO uint32_t RTC_CR; /**< \brief (Rtc Offset: 0x00) Control Register */ + __IO uint32_t RTC_MR; /**< \brief (Rtc Offset: 0x04) Mode Register */ + __IO uint32_t RTC_TIMR; /**< \brief (Rtc Offset: 0x08) Time Register */ + __IO uint32_t RTC_CALR; /**< \brief (Rtc Offset: 0x0C) Calendar Register */ + __IO uint32_t RTC_TIMALR; /**< \brief (Rtc Offset: 0x10) Time Alarm Register */ + __IO uint32_t RTC_CALALR; /**< \brief (Rtc Offset: 0x14) Calendar Alarm Register */ + __I uint32_t RTC_SR; /**< \brief (Rtc Offset: 0x18) Status Register */ + __O uint32_t RTC_SCCR; /**< \brief (Rtc Offset: 0x1C) Status Clear Command Register */ + __O uint32_t RTC_IER; /**< \brief (Rtc Offset: 0x20) Interrupt Enable Register */ + __O uint32_t RTC_IDR; /**< \brief (Rtc Offset: 0x24) Interrupt Disable Register */ + __I uint32_t RTC_IMR; /**< \brief (Rtc Offset: 0x28) Interrupt Mask Register */ + __I uint32_t RTC_VER; /**< \brief (Rtc Offset: 0x2C) Valid Entry Register */ + __I uint32_t Reserved1[32]; + RtcTs RTC_TS[RTCTS_NUMBER]; /**< \brief (Rtc Offset: 0xB0) 0 .. 1 */ + __I uint32_t Reserved2[2]; + __I uint32_t RTC_MSR; /**< \brief (Rtc Offset: 0xD0) Milliseconds Register */ + __I uint32_t Reserved3[4]; + __IO uint32_t RTC_WPMR; /**< \brief (Rtc Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t Reserved4[5]; + __I uint32_t RTC_VERSION; /**< \brief (Rtc Offset: 0xFC) Version Register */ +} Rtc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- RTC_CR : (RTC Offset: 0x00) Control Register -------- */ +#define RTC_CR_UPDTIM (0x1u << 0) /**< \brief (RTC_CR) Update Request Time Register */ +#define RTC_CR_UPDCAL (0x1u << 1) /**< \brief (RTC_CR) Update Request Calendar Register */ +#define RTC_CR_TIMEVSEL_Pos 8 +#define RTC_CR_TIMEVSEL_Msk (0x3u << RTC_CR_TIMEVSEL_Pos) /**< \brief (RTC_CR) Time Event Selection */ +#define RTC_CR_TIMEVSEL(value) ((RTC_CR_TIMEVSEL_Msk & ((value) << RTC_CR_TIMEVSEL_Pos))) +#define RTC_CR_TIMEVSEL_MINUTE (0x0u << 8) /**< \brief (RTC_CR) Minute change */ +#define RTC_CR_TIMEVSEL_HOUR (0x1u << 8) /**< \brief (RTC_CR) Hour change */ +#define RTC_CR_TIMEVSEL_MIDNIGHT (0x2u << 8) /**< \brief (RTC_CR) Every day at midnight */ +#define RTC_CR_TIMEVSEL_NOON (0x3u << 8) /**< \brief (RTC_CR) Every day at noon */ +#define RTC_CR_CALEVSEL_Pos 16 +#define RTC_CR_CALEVSEL_Msk (0x3u << RTC_CR_CALEVSEL_Pos) /**< \brief (RTC_CR) Calendar Event Selection */ +#define RTC_CR_CALEVSEL(value) ((RTC_CR_CALEVSEL_Msk & ((value) << RTC_CR_CALEVSEL_Pos))) +#define RTC_CR_CALEVSEL_WEEK (0x0u << 16) /**< \brief (RTC_CR) Week change (every Monday at time 00:00:00) */ +#define RTC_CR_CALEVSEL_MONTH (0x1u << 16) /**< \brief (RTC_CR) Month change (every 01 of each month at time 00:00:00) */ +#define RTC_CR_CALEVSEL_YEAR (0x2u << 16) /**< \brief (RTC_CR) Year change (every January 1 at time 00:00:00) */ +/* -------- RTC_MR : (RTC Offset: 0x04) Mode Register -------- */ +#define RTC_MR_HRMOD (0x1u << 0) /**< \brief (RTC_MR) 12-/24-hour Mode */ +#define RTC_MR_PERSIAN (0x1u << 1) /**< \brief (RTC_MR) PERSIAN Calendar */ +#define RTC_MR_UTC (0x1u << 2) /**< \brief (RTC_MR) UTC Time Format */ +#define RTC_MR_NEGPPM (0x1u << 4) /**< \brief (RTC_MR) NEGative PPM Correction */ +#define RTC_MR_CORRECTION_Pos 8 +#define RTC_MR_CORRECTION_Msk (0x7fu << RTC_MR_CORRECTION_Pos) /**< \brief (RTC_MR) Slow Clock Correction */ +#define RTC_MR_CORRECTION(value) ((RTC_MR_CORRECTION_Msk & ((value) << RTC_MR_CORRECTION_Pos))) +#define RTC_MR_HIGHPPM (0x1u << 15) /**< \brief (RTC_MR) HIGH PPM Correction */ +#define RTC_MR_OUT0_Pos 16 +#define RTC_MR_OUT0_Msk (0x7u << RTC_MR_OUT0_Pos) /**< \brief (RTC_MR) All ADC Channel Trigger Event Source Selection */ +#define RTC_MR_OUT0(value) ((RTC_MR_OUT0_Msk & ((value) << RTC_MR_OUT0_Pos))) +#define RTC_MR_OUT0_NO_WAVE (0x0u << 16) /**< \brief (RTC_MR) No waveform, stuck at '0' */ +#define RTC_MR_OUT0_FREQ1HZ (0x1u << 16) /**< \brief (RTC_MR) 1 Hz square wave */ +#define RTC_MR_OUT0_FREQ32HZ (0x2u << 16) /**< \brief (RTC_MR) 32 Hz square wave */ +#define RTC_MR_OUT0_FREQ64HZ (0x3u << 16) /**< \brief (RTC_MR) 64 Hz square wave */ +#define RTC_MR_OUT0_FREQ512HZ (0x4u << 16) /**< \brief (RTC_MR) 512 Hz square wave */ +#define RTC_MR_OUT0_ALARM_FLAG (0x6u << 16) /**< \brief (RTC_MR) Output is a copy of the alarm flag */ +#define RTC_MR_OUT1_Pos 20 +#define RTC_MR_OUT1_Msk (0x7u << RTC_MR_OUT1_Pos) /**< \brief (RTC_MR) ADC Last Channel Trigger Event Source Selection */ +#define RTC_MR_OUT1(value) ((RTC_MR_OUT1_Msk & ((value) << RTC_MR_OUT1_Pos))) +#define RTC_MR_OUT1_NO_WAVE (0x0u << 20) /**< \brief (RTC_MR) No waveform, stuck at '0' */ +#define RTC_MR_OUT1_FREQ1HZ (0x1u << 20) /**< \brief (RTC_MR) 1 Hz square wave */ +#define RTC_MR_OUT1_FREQ32HZ (0x2u << 20) /**< \brief (RTC_MR) 32 Hz square wave */ +#define RTC_MR_OUT1_FREQ64HZ (0x3u << 20) /**< \brief (RTC_MR) 64 Hz square wave */ +#define RTC_MR_OUT1_FREQ512HZ (0x4u << 20) /**< \brief (RTC_MR) 512 Hz square wave */ +#define RTC_MR_OUT1_ALARM_FLAG (0x6u << 20) /**< \brief (RTC_MR) Output is a copy of the alarm flag */ +/* -------- RTC_TIMR : (RTC Offset: 0x08) Time Register -------- */ +#define RTC_TIMR_SEC_Pos 0 +#define RTC_TIMR_SEC_Msk (0x7fu << RTC_TIMR_SEC_Pos) /**< \brief (RTC_TIMR) Current Second */ +#define RTC_TIMR_SEC(value) ((RTC_TIMR_SEC_Msk & ((value) << RTC_TIMR_SEC_Pos))) +#define RTC_TIMR_MIN_Pos 8 +#define RTC_TIMR_MIN_Msk (0x7fu << RTC_TIMR_MIN_Pos) /**< \brief (RTC_TIMR) Current Minute */ +#define RTC_TIMR_MIN(value) ((RTC_TIMR_MIN_Msk & ((value) << RTC_TIMR_MIN_Pos))) +#define RTC_TIMR_HOUR_Pos 16 +#define RTC_TIMR_HOUR_Msk (0x3fu << RTC_TIMR_HOUR_Pos) /**< \brief (RTC_TIMR) Current Hour */ +#define RTC_TIMR_HOUR(value) ((RTC_TIMR_HOUR_Msk & ((value) << RTC_TIMR_HOUR_Pos))) +#define RTC_TIMR_AMPM (0x1u << 22) /**< \brief (RTC_TIMR) Ante Meridiem Post Meridiem Indicator */ +#define RTC_TIMR_UTC_TIME_Pos 0 +#define RTC_TIMR_UTC_TIME_Msk (0xffffffffu << RTC_TIMR_UTC_TIME_Pos) /**< \brief (RTC_TIMR) Current UTC Time */ +#define RTC_TIMR_UTC_TIME(value) ((RTC_TIMR_UTC_TIME_Msk & ((value) << RTC_TIMR_UTC_TIME_Pos))) +/* -------- RTC_CALR : (RTC Offset: 0x0C) Calendar Register -------- */ +#define RTC_CALR_CENT_Pos 0 +#define RTC_CALR_CENT_Msk (0x7fu << RTC_CALR_CENT_Pos) /**< \brief (RTC_CALR) Current Century */ +#define RTC_CALR_CENT(value) ((RTC_CALR_CENT_Msk & ((value) << RTC_CALR_CENT_Pos))) +#define RTC_CALR_YEAR_Pos 8 +#define RTC_CALR_YEAR_Msk (0xffu << RTC_CALR_YEAR_Pos) /**< \brief (RTC_CALR) Current Year */ +#define RTC_CALR_YEAR(value) ((RTC_CALR_YEAR_Msk & ((value) << RTC_CALR_YEAR_Pos))) +#define RTC_CALR_MONTH_Pos 16 +#define RTC_CALR_MONTH_Msk (0x1fu << RTC_CALR_MONTH_Pos) /**< \brief (RTC_CALR) Current Month */ +#define RTC_CALR_MONTH(value) ((RTC_CALR_MONTH_Msk & ((value) << RTC_CALR_MONTH_Pos))) +#define RTC_CALR_DAY_Pos 21 +#define RTC_CALR_DAY_Msk (0x7u << RTC_CALR_DAY_Pos) /**< \brief (RTC_CALR) Current Day in Current Week */ +#define RTC_CALR_DAY(value) ((RTC_CALR_DAY_Msk & ((value) << RTC_CALR_DAY_Pos))) +#define RTC_CALR_DATE_Pos 24 +#define RTC_CALR_DATE_Msk (0x3fu << RTC_CALR_DATE_Pos) /**< \brief (RTC_CALR) Current Day in Current Month */ +#define RTC_CALR_DATE(value) ((RTC_CALR_DATE_Msk & ((value) << RTC_CALR_DATE_Pos))) +/* -------- RTC_TIMALR : (RTC Offset: 0x10) Time Alarm Register -------- */ +#define RTC_TIMALR_SEC_Pos 0 +#define RTC_TIMALR_SEC_Msk (0x7fu << RTC_TIMALR_SEC_Pos) /**< \brief (RTC_TIMALR) Second Alarm */ +#define RTC_TIMALR_SEC(value) ((RTC_TIMALR_SEC_Msk & ((value) << RTC_TIMALR_SEC_Pos))) +#define RTC_TIMALR_SECEN (0x1u << 7) /**< \brief (RTC_TIMALR) Second Alarm Enable */ +#define RTC_TIMALR_MIN_Pos 8 +#define RTC_TIMALR_MIN_Msk (0x7fu << RTC_TIMALR_MIN_Pos) /**< \brief (RTC_TIMALR) Minute Alarm */ +#define RTC_TIMALR_MIN(value) ((RTC_TIMALR_MIN_Msk & ((value) << RTC_TIMALR_MIN_Pos))) +#define RTC_TIMALR_MINEN (0x1u << 15) /**< \brief (RTC_TIMALR) Minute Alarm Enable */ +#define RTC_TIMALR_HOUR_Pos 16 +#define RTC_TIMALR_HOUR_Msk (0x3fu << RTC_TIMALR_HOUR_Pos) /**< \brief (RTC_TIMALR) Hour Alarm */ +#define RTC_TIMALR_HOUR(value) ((RTC_TIMALR_HOUR_Msk & ((value) << RTC_TIMALR_HOUR_Pos))) +#define RTC_TIMALR_AMPM (0x1u << 22) /**< \brief (RTC_TIMALR) AM/PM Indicator */ +#define RTC_TIMALR_HOUREN (0x1u << 23) /**< \brief (RTC_TIMALR) Hour Alarm Enable */ +#define RTC_TIMALR_UTC_TIME_Pos 0 +#define RTC_TIMALR_UTC_TIME_Msk (0xffffffffu << RTC_TIMALR_UTC_TIME_Pos) /**< \brief (RTC_TIMALR) UTC_TIME Alarm */ +#define RTC_TIMALR_UTC_TIME(value) ((RTC_TIMALR_UTC_TIME_Msk & ((value) << RTC_TIMALR_UTC_TIME_Pos))) +/* -------- RTC_CALALR : (RTC Offset: 0x14) Calendar Alarm Register -------- */ +#define RTC_CALALR_MONTH_Pos 16 +#define RTC_CALALR_MONTH_Msk (0x1fu << RTC_CALALR_MONTH_Pos) /**< \brief (RTC_CALALR) Month Alarm */ +#define RTC_CALALR_MONTH(value) ((RTC_CALALR_MONTH_Msk & ((value) << RTC_CALALR_MONTH_Pos))) +#define RTC_CALALR_MTHEN (0x1u << 23) /**< \brief (RTC_CALALR) Month Alarm Enable */ +#define RTC_CALALR_DATE_Pos 24 +#define RTC_CALALR_DATE_Msk (0x3fu << RTC_CALALR_DATE_Pos) /**< \brief (RTC_CALALR) Date Alarm */ +#define RTC_CALALR_DATE(value) ((RTC_CALALR_DATE_Msk & ((value) << RTC_CALALR_DATE_Pos))) +#define RTC_CALALR_DATEEN (0x1u << 31) /**< \brief (RTC_CALALR) Date Alarm Enable */ +#define RTC_CALALR_UTCEN (0x1u << 0) /**< \brief (RTC_CALALR) UTC Alarm Enable */ +/* -------- RTC_SR : (RTC Offset: 0x18) Status Register -------- */ +#define RTC_SR_ACKUPD (0x1u << 0) /**< \brief (RTC_SR) Acknowledge for Update */ +#define RTC_SR_ACKUPD_FREERUN (0x0u << 0) /**< \brief (RTC_SR) Time and calendar registers cannot be updated. */ +#define RTC_SR_ACKUPD_UPDATE (0x1u << 0) /**< \brief (RTC_SR) Time and calendar registers can be updated. */ +#define RTC_SR_ALARM (0x1u << 1) /**< \brief (RTC_SR) Alarm Flag */ +#define RTC_SR_ALARM_NO_ALARMEVENT (0x0u << 1) /**< \brief (RTC_SR) No alarm matching condition occurred. */ +#define RTC_SR_ALARM_ALARMEVENT (0x1u << 1) /**< \brief (RTC_SR) An alarm matching condition has occurred. */ +#define RTC_SR_SEC (0x1u << 2) /**< \brief (RTC_SR) Second Event */ +#define RTC_SR_SEC_NO_SECEVENT (0x0u << 2) /**< \brief (RTC_SR) No second event has occurred since the last clear. */ +#define RTC_SR_SEC_SECEVENT (0x1u << 2) /**< \brief (RTC_SR) At least one second event has occurred since the last clear. */ +#define RTC_SR_TIMEV (0x1u << 3) /**< \brief (RTC_SR) Time Event */ +#define RTC_SR_TIMEV_NO_TIMEVENT (0x0u << 3) /**< \brief (RTC_SR) No time event has occurred since the last clear. */ +#define RTC_SR_TIMEV_TIMEVENT (0x1u << 3) /**< \brief (RTC_SR) At least one time event has occurred since the last clear. */ +#define RTC_SR_CALEV (0x1u << 4) /**< \brief (RTC_SR) Calendar Event */ +#define RTC_SR_CALEV_NO_CALEVENT (0x0u << 4) /**< \brief (RTC_SR) No calendar event has occurred since the last clear. */ +#define RTC_SR_CALEV_CALEVENT (0x1u << 4) /**< \brief (RTC_SR) At least one calendar event has occurred since the last clear. */ +#define RTC_SR_TDERR (0x1u << 5) /**< \brief (RTC_SR) Time and/or Date Free Running Error */ +#define RTC_SR_TDERR_CORRECT (0x0u << 5) /**< \brief (RTC_SR) The internal free running counters are carrying valid values since the last read of the Status Register (RTC_SR). */ +#define RTC_SR_TDERR_ERR_TIMEDATE (0x1u << 5) /**< \brief (RTC_SR) The internal free running counters have been corrupted (invalid date or time, non-BCD values) since the last read and/or they are still invalid. */ +/* -------- RTC_SCCR : (RTC Offset: 0x1C) Status Clear Command Register -------- */ +#define RTC_SCCR_ACKCLR (0x1u << 0) /**< \brief (RTC_SCCR) Acknowledge Clear */ +#define RTC_SCCR_ALRCLR (0x1u << 1) /**< \brief (RTC_SCCR) Alarm Clear */ +#define RTC_SCCR_SECCLR (0x1u << 2) /**< \brief (RTC_SCCR) Second Clear */ +#define RTC_SCCR_TIMCLR (0x1u << 3) /**< \brief (RTC_SCCR) Time Clear */ +#define RTC_SCCR_CALCLR (0x1u << 4) /**< \brief (RTC_SCCR) Calendar Clear */ +#define RTC_SCCR_TDERRCLR (0x1u << 5) /**< \brief (RTC_SCCR) Time and/or Date Free Running Error Clear */ +/* -------- RTC_IER : (RTC Offset: 0x20) Interrupt Enable Register -------- */ +#define RTC_IER_ACKEN (0x1u << 0) /**< \brief (RTC_IER) Acknowledge Update Interrupt Enable */ +#define RTC_IER_ALREN (0x1u << 1) /**< \brief (RTC_IER) Alarm Interrupt Enable */ +#define RTC_IER_SECEN (0x1u << 2) /**< \brief (RTC_IER) Second Event Interrupt Enable */ +#define RTC_IER_TIMEN (0x1u << 3) /**< \brief (RTC_IER) Time Event Interrupt Enable */ +#define RTC_IER_CALEN (0x1u << 4) /**< \brief (RTC_IER) Calendar Event Interrupt Enable */ +#define RTC_IER_TDERREN (0x1u << 5) /**< \brief (RTC_IER) Time and/or Date Error Interrupt Enable */ +/* -------- RTC_IDR : (RTC Offset: 0x24) Interrupt Disable Register -------- */ +#define RTC_IDR_ACKDIS (0x1u << 0) /**< \brief (RTC_IDR) Acknowledge Update Interrupt Disable */ +#define RTC_IDR_ALRDIS (0x1u << 1) /**< \brief (RTC_IDR) Alarm Interrupt Disable */ +#define RTC_IDR_SECDIS (0x1u << 2) /**< \brief (RTC_IDR) Second Event Interrupt Disable */ +#define RTC_IDR_TIMDIS (0x1u << 3) /**< \brief (RTC_IDR) Time Event Interrupt Disable */ +#define RTC_IDR_CALDIS (0x1u << 4) /**< \brief (RTC_IDR) Calendar Event Interrupt Disable */ +#define RTC_IDR_TDERRDIS (0x1u << 5) /**< \brief (RTC_IDR) Time and/or Date Error Interrupt Disable */ +/* -------- RTC_IMR : (RTC Offset: 0x28) Interrupt Mask Register -------- */ +#define RTC_IMR_ACK (0x1u << 0) /**< \brief (RTC_IMR) Acknowledge Update Interrupt Mask */ +#define RTC_IMR_ALR (0x1u << 1) /**< \brief (RTC_IMR) Alarm Interrupt Mask */ +#define RTC_IMR_SEC (0x1u << 2) /**< \brief (RTC_IMR) Second Event Interrupt Mask */ +#define RTC_IMR_TIM (0x1u << 3) /**< \brief (RTC_IMR) Time Event Interrupt Mask */ +#define RTC_IMR_CAL (0x1u << 4) /**< \brief (RTC_IMR) Calendar Event Interrupt Mask */ +#define RTC_IMR_TDERR (0x1u << 5) /**< \brief (RTC_IMR) Time and/or Date Error Mask */ +/* -------- RTC_VER : (RTC Offset: 0x2C) Valid Entry Register -------- */ +#define RTC_VER_NVTIM (0x1u << 0) /**< \brief (RTC_VER) Non-valid Time */ +#define RTC_VER_NVCAL (0x1u << 1) /**< \brief (RTC_VER) Non-valid Calendar */ +#define RTC_VER_NVTIMALR (0x1u << 2) /**< \brief (RTC_VER) Non-valid Time Alarm */ +#define RTC_VER_NVCALALR (0x1u << 3) /**< \brief (RTC_VER) Non-valid Calendar Alarm */ +/* -------- RTC_TSTR : (RTC Offset: N/A) TimeStamp Time Register 0 -------- */ +#define RTC_TSTR_SEC_Pos 0 +#define RTC_TSTR_SEC_Msk (0x7fu << RTC_TSTR_SEC_Pos) /**< \brief (RTC_TSTR) Seconds of the Tamper */ +#define RTC_TSTR_MIN_Pos 8 +#define RTC_TSTR_MIN_Msk (0x7fu << RTC_TSTR_MIN_Pos) /**< \brief (RTC_TSTR) Minutes of the Tamper */ +#define RTC_TSTR_HOUR_Pos 16 +#define RTC_TSTR_HOUR_Msk (0x3fu << RTC_TSTR_HOUR_Pos) /**< \brief (RTC_TSTR) Hours of the Tamper */ +#define RTC_TSTR_AMPM (0x1u << 22) /**< \brief (RTC_TSTR) AM/PM Indicator of the Tamper */ +#define RTC_TSTR_TEVCNT_Pos 24 +#define RTC_TSTR_TEVCNT_Msk (0xfu << RTC_TSTR_TEVCNT_Pos) /**< \brief (RTC_TSTR) Tamper Events Counter */ +#define RTC_TSTR_BACKUP (0x1u << 31) /**< \brief (RTC_TSTR) System Mode of the Tamper */ +/* -------- RTC_TSDR : (RTC Offset: N/A) TimeStamp Date Register 0 -------- */ +#define RTC_TSDR_CENT_Pos 0 +#define RTC_TSDR_CENT_Msk (0x7fu << RTC_TSDR_CENT_Pos) /**< \brief (RTC_TSDR) Century of the Tamper */ +#define RTC_TSDR_YEAR_Pos 8 +#define RTC_TSDR_YEAR_Msk (0xffu << RTC_TSDR_YEAR_Pos) /**< \brief (RTC_TSDR) Year of the Tamper */ +#define RTC_TSDR_MONTH_Pos 16 +#define RTC_TSDR_MONTH_Msk (0x1fu << RTC_TSDR_MONTH_Pos) /**< \brief (RTC_TSDR) Month of the Tamper */ +#define RTC_TSDR_DAY_Pos 21 +#define RTC_TSDR_DAY_Msk (0x7u << RTC_TSDR_DAY_Pos) /**< \brief (RTC_TSDR) Day of the Tamper */ +#define RTC_TSDR_DATE_Pos 24 +#define RTC_TSDR_DATE_Msk (0x3fu << RTC_TSDR_DATE_Pos) /**< \brief (RTC_TSDR) Date of the Tamper */ +#define RTC_TSDR_UTC_TIME_Pos 0 +#define RTC_TSDR_UTC_TIME_Msk (0xffffffffu << RTC_TSDR_UTC_TIME_Pos) /**< \brief (RTC_TSDR) Time of the Tamper (UTC format) */ +/* -------- RTC_TSSR : (RTC Offset: N/A) TimeStamp Source Register 0 -------- */ +#define RTC_TSSR_SHLDM (0x1u << 0) /**< \brief (RTC_TSSR) Shield Monitor */ +#define RTC_TSSR_DBLFM (0x1u << 1) /**< \brief (RTC_TSSR) Double Frequency Monitor */ +#define RTC_TSSR_TST (0x1u << 2) /**< \brief (RTC_TSSR) Test Pin Monitor */ +#define RTC_TSSR_JTAG (0x1u << 3) /**< \brief (RTC_TSSR) JTAG Pins Monitor */ +#define RTC_TSSR_REGUL (0x1u << 4) /**< \brief (RTC_TSSR) Core Regulator Disconnection Monitor */ +#define RTC_TSSR_MCKM (0x1u << 5) /**< \brief (RTC_TSSR) Master Clock Monitor */ +#define RTC_TSSR_TPML (0x1u << 6) /**< \brief (RTC_TSSR) Low Temperature Monitor */ +#define RTC_TSSR_TPMH (0x1u << 7) /**< \brief (RTC_TSSR) High Temperature Monitor */ +#define RTC_TSSR_VDDRL (0x1u << 8) /**< \brief (RTC_TSSR) Low VDDDDR Voltage Monitor */ +#define RTC_TSSR_VDDRH (0x1u << 9) /**< \brief (RTC_TSSR) High VDDDDR Voltage Monitor */ +#define RTC_TSSR_VDDBUL (0x1u << 10) /**< \brief (RTC_TSSR) Low VDDBU Voltage Monitor */ +#define RTC_TSSR_VDDBUH (0x1u << 11) /**< \brief (RTC_TSSR) High VDDBU Voltage Monitor */ +#define RTC_TSSR_VDDCOREL (0x1u << 12) /**< \brief (RTC_TSSR) Low VDDCORE Voltage Monitor */ +#define RTC_TSSR_VDDCOREH (0x1u << 13) /**< \brief (RTC_TSSR) High VDDCORE Voltage Monitor */ +#define RTC_TSSR_VDDIOL (0x1u << 14) /**< \brief (RTC_TSSR) Low VDDIO Voltage Monitor */ +#define RTC_TSSR_VDDIOH (0x1u << 15) /**< \brief (RTC_TSSR) High VDDIO Voltage Monitor */ +#define RTC_TSSR_DET0 (0x1u << 16) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET1 (0x1u << 17) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET2 (0x1u << 18) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET3 (0x1u << 19) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET4 (0x1u << 20) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET5 (0x1u << 21) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET6 (0x1u << 22) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +#define RTC_TSSR_DET7 (0x1u << 23) /**< \brief (RTC_TSSR) PIOBU Intrusion Detector */ +/* -------- RTC_MSR : (RTC Offset: 0xD0) Milliseconds Register -------- */ +#define RTC_MSR_MS_Pos 0 +#define RTC_MSR_MS_Msk (0x3ffu << RTC_MSR_MS_Pos) /**< \brief (RTC_MSR) Number of 1/1024 seconds elapsed within 1 second */ +/* -------- RTC_WPMR : (RTC Offset: 0xE4) Write Protection Mode Register -------- */ +#define RTC_WPMR_WPEN (0x1u << 0) /**< \brief (RTC_WPMR) Write Protection Enable */ +#define RTC_WPMR_WPKEY_Pos 8 +#define RTC_WPMR_WPKEY_Msk (0xffffffu << RTC_WPMR_WPKEY_Pos) /**< \brief (RTC_WPMR) Write Protection Key */ +#define RTC_WPMR_WPKEY(value) ((RTC_WPMR_WPKEY_Msk & ((value) << RTC_WPMR_WPKEY_Pos))) +#define RTC_WPMR_WPKEY_PASSWD (0x525443u << 8) /**< \brief (RTC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- RTC_VERSION : (RTC Offset: 0xFC) Version Register -------- */ +#define RTC_VERSION_VERSION_Pos 0 +#define RTC_VERSION_VERSION_Msk (0xfffu << RTC_VERSION_VERSION_Pos) /**< \brief (RTC_VERSION) Version of the Hardware Module */ +#define RTC_VERSION_MFN_Pos 16 +#define RTC_VERSION_MFN_Msk (0x7u << RTC_VERSION_MFN_Pos) /**< \brief (RTC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_RTC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rxlp.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rxlp.h new file mode 100644 index 000000000..63956e4aa --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_rxlp.h @@ -0,0 +1,100 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_RXLP_COMPONENT_ +#define _SAMA5D2_RXLP_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Low Power Asynchronous Receiver */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_RXLP Low Power Asynchronous Receiver */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Rxlp hardware registers */ +typedef struct { + __O uint32_t RXLP_CR; /**< \brief (Rxlp Offset: 0x0000) Control Register */ + __IO uint32_t RXLP_MR; /**< \brief (Rxlp Offset: 0x0004) Mode Register */ + __I uint32_t Reserved1[4]; + __I uint32_t RXLP_RHR; /**< \brief (Rxlp Offset: 0x0018) Receive Holding Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t RXLP_BRGR; /**< \brief (Rxlp Offset: 0x0020) Baud Rate Generator Register */ + __IO uint32_t RXLP_CMPR; /**< \brief (Rxlp Offset: 0x0024) Comparison Register */ + __I uint32_t Reserved3[47]; + __IO uint32_t RXLP_WPMR; /**< \brief (Rxlp Offset: 0x00E4) Write Protection Mode Register */ + __I uint32_t Reserved4[5]; + __I uint32_t RXLP_VERSION; /**< \brief (Rxlp Offset: 0x00FC) Version Register */ +} Rxlp; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- RXLP_CR : (RXLP Offset: 0x0000) Control Register -------- */ +#define RXLP_CR_RSTRX (0x1u << 2) /**< \brief (RXLP_CR) Reset Receiver */ +#define RXLP_CR_RXEN (0x1u << 4) /**< \brief (RXLP_CR) Receiver Enable */ +#define RXLP_CR_RXDIS (0x1u << 5) /**< \brief (RXLP_CR) Receiver Disable */ +/* -------- RXLP_MR : (RXLP Offset: 0x0004) Mode Register -------- */ +#define RXLP_MR_FILTER (0x1u << 4) /**< \brief (RXLP_MR) Receiver Digital Filter */ +#define RXLP_MR_FILTER_DISABLED (0x0u << 4) /**< \brief (RXLP_MR) RXLP does not filter the receive line. */ +#define RXLP_MR_FILTER_ENABLED (0x1u << 4) /**< \brief (RXLP_MR) RXLP filters the receive line using a three-sample filter (16x-bit clock) (2 over 3 majority). */ +#define RXLP_MR_PAR_Pos 9 +#define RXLP_MR_PAR_Msk (0x7u << RXLP_MR_PAR_Pos) /**< \brief (RXLP_MR) Parity Type */ +#define RXLP_MR_PAR(value) ((RXLP_MR_PAR_Msk & ((value) << RXLP_MR_PAR_Pos))) +#define RXLP_MR_PAR_EVEN (0x0u << 9) /**< \brief (RXLP_MR) Even Parity */ +#define RXLP_MR_PAR_ODD (0x1u << 9) /**< \brief (RXLP_MR) Odd Parity */ +#define RXLP_MR_PAR_SPACE (0x2u << 9) /**< \brief (RXLP_MR) Parity forced to 0 */ +#define RXLP_MR_PAR_MARK (0x3u << 9) /**< \brief (RXLP_MR) Parity forced to 1 */ +#define RXLP_MR_PAR_NO (0x4u << 9) /**< \brief (RXLP_MR) No parity */ +/* -------- RXLP_RHR : (RXLP Offset: 0x0018) Receive Holding Register -------- */ +#define RXLP_RHR_RXCHR_Pos 0 +#define RXLP_RHR_RXCHR_Msk (0xffu << RXLP_RHR_RXCHR_Pos) /**< \brief (RXLP_RHR) Received Character */ +/* -------- RXLP_BRGR : (RXLP Offset: 0x0020) Baud Rate Generator Register -------- */ +#define RXLP_BRGR_CD_Pos 0 +#define RXLP_BRGR_CD_Msk (0x3u << RXLP_BRGR_CD_Pos) /**< \brief (RXLP_BRGR) Clock Divisor */ +#define RXLP_BRGR_CD(value) ((RXLP_BRGR_CD_Msk & ((value) << RXLP_BRGR_CD_Pos))) +/* -------- RXLP_CMPR : (RXLP Offset: 0x0024) Comparison Register -------- */ +#define RXLP_CMPR_VAL1_Pos 0 +#define RXLP_CMPR_VAL1_Msk (0xffu << RXLP_CMPR_VAL1_Pos) /**< \brief (RXLP_CMPR) First Comparison Value for Received Character */ +#define RXLP_CMPR_VAL1(value) ((RXLP_CMPR_VAL1_Msk & ((value) << RXLP_CMPR_VAL1_Pos))) +#define RXLP_CMPR_VAL2_Pos 16 +#define RXLP_CMPR_VAL2_Msk (0xffu << RXLP_CMPR_VAL2_Pos) /**< \brief (RXLP_CMPR) Second Comparison Value for Received Character */ +#define RXLP_CMPR_VAL2(value) ((RXLP_CMPR_VAL2_Msk & ((value) << RXLP_CMPR_VAL2_Pos))) +/* -------- RXLP_WPMR : (RXLP Offset: 0x00E4) Write Protection Mode Register -------- */ +#define RXLP_WPMR_WPEN (0x1u << 0) /**< \brief (RXLP_WPMR) Write Protection Enable */ +#define RXLP_WPMR_WPKEY_Pos 8 +#define RXLP_WPMR_WPKEY_Msk (0xffffffu << RXLP_WPMR_WPKEY_Pos) /**< \brief (RXLP_WPMR) Write Protection Key */ +#define RXLP_WPMR_WPKEY(value) ((RXLP_WPMR_WPKEY_Msk & ((value) << RXLP_WPMR_WPKEY_Pos))) +#define RXLP_WPMR_WPKEY_PASSWD (0x52584Cu << 8) /**< \brief (RXLP_WPMR) Writing any other value in this field aborts the write operation.Always reads as 0. */ +/* -------- RXLP_VERSION : (RXLP Offset: 0x00FC) Version Register -------- */ +#define RXLP_VERSION_VERSION_Pos 0 +#define RXLP_VERSION_VERSION_Msk (0xfffu << RXLP_VERSION_VERSION_Pos) /**< \brief (RXLP_VERSION) Hardware Module Version */ +#define RXLP_VERSION_MFN_Pos 16 +#define RXLP_VERSION_MFN_Msk (0x7u << RXLP_VERSION_MFN_Pos) /**< \brief (RXLP_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_RXLP_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sckc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sckc.h new file mode 100644 index 000000000..265487fe5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sckc.h @@ -0,0 +1,53 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SCKC_COMPONENT_ +#define _SAMA5D2_SCKC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Slow Clock Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SCKC Slow Clock Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Sckc hardware registers */ +typedef struct { + __IO uint32_t SCKC_CR; /**< \brief (Sckc Offset: 0x0) Slow Clock Controller Configuration Register */ +} Sckc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SCKC_CR : (SCKC Offset: 0x0) Slow Clock Controller Configuration Register -------- */ +#define SCKC_CR_OSCSEL (0x1u << 3) /**< \brief (SCKC_CR) Slow Clock Selector */ +#define SCKC_CR_OSCSEL_RC (0x0u << 3) /**< \brief (SCKC_CR) Slow clock is the embedded 64 kHz (typical) RC oscillator. */ +#define SCKC_CR_OSCSEL_XTAL (0x1u << 3) /**< \brief (SCKC_CR) Slow clock is the 32.768 kHz crystal oscillator. */ + +/*@}*/ + + +#endif /* _SAMA5D2_SCKC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sdmmc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sdmmc.h new file mode 100644 index 000000000..fbf746cea --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sdmmc.h @@ -0,0 +1,522 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SDMMC_COMPONENT_ +#define _SAMA5D2_SDMMC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Secure Digital MultiMedia Card Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SDMMC Secure Digital MultiMedia Card Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief SDMMC hardware registers */ +typedef struct { + __IO uint32_t SDMMC_SSAR; /**< \brief (SDMMC Offset: 0x000) SDMA System Address - Argument 2 Register */ + __IO uint16_t SDMMC_BSR; /**< \brief (SDMMC Offset: 0x004) Block Size Register */ + __IO uint16_t SDMMC_BCR; /**< \brief (SDMMC Offset: 0x006) Block Count Register */ + __IO uint32_t SDMMC_ARG1R; /**< \brief (SDMMC Offset: 0x008) Argument 1 Register */ + __IO uint16_t SDMMC_TMR; /**< \brief (SDMMC Offset: 0x00C) Transfer Mode Register */ + __IO uint16_t SDMMC_CR; /**< \brief (SDMMC Offset: 0x00E) Command Register */ + __I uint32_t SDMMC_RR[4]; /**< \brief (SDMMC Offset: 0x010) Response Register */ + __IO uint32_t SDMMC_BDPR; /**< \brief (SDMMC Offset: 0x020) Buffer Data Port Register */ + __I uint32_t SDMMC_PSR; /**< \brief (SDMMC Offset: 0x024) Present State Register */ + __IO uint8_t SDMMC_HC1R; /**< \brief (SDMMC Offset: 0x028) Host Control 1 Register */ + __IO uint8_t SDMMC_PCR; /**< \brief (SDMMC Offset: 0x029) Power Control Register */ + __IO uint8_t SDMMC_BGCR; /**< \brief (SDMMC Offset: 0x02A) Block Gap Control Register */ + __IO uint8_t SDMMC_WCR; /**< \brief (SDMMC Offset: 0x02B) Wakeup Control Register */ + __IO uint16_t SDMMC_CCR; /**< \brief (SDMMC Offset: 0x02C) Clock Control Register */ + __IO uint8_t SDMMC_TCR; /**< \brief (SDMMC Offset: 0x02E) Timeout Control Register */ + __IO uint8_t SDMMC_SRR; /**< \brief (SDMMC Offset: 0x02F) Software Reset Register */ + __IO uint16_t SDMMC_NISTR; /**< \brief (SDMMC Offset: 0x030) Normal Interrupt Status Register */ + __IO uint16_t SDMMC_EISTR; /**< \brief (SDMMC Offset: 0x032) Error Interrupt Status Register */ + __IO uint16_t SDMMC_NISTER; /**< \brief (SDMMC Offset: 0x034) Normal Interrupt Status Enable Register */ + __IO uint16_t SDMMC_EISTER; /**< \brief (SDMMC Offset: 0x036) Error Interrupt Status Enable Register */ + __IO uint16_t SDMMC_NISIER; /**< \brief (SDMMC Offset: 0x038) Normal Interrupt Signal Enable Register */ + __IO uint16_t SDMMC_EISIER; /**< \brief (SDMMC Offset: 0x03A) Error Interrupt Signal Enable Register */ + __I uint16_t SDMMC_ACESR; /**< \brief (SDMMC Offset: 0x03C) Auto CMD Error Status Register */ + __IO uint16_t SDMMC_HC2R; /**< \brief (SDMMC Offset: 0x03E) Host Control 2 Register */ + __IO uint32_t SDMMC_CA0R; /**< \brief (SDMMC Offset: 0x040) Capabilities Register */ + __IO uint32_t SDMMC_CA1R; /**< \brief (SDMMC Offset: 0x044) Capabilities Register */ + __IO uint32_t SDMMC_MCCAR; /**< \brief (SDMMC Offset: 0x048) Maximum Current Capabilities Register */ + __I uint32_t SDMMC_RSVD1; /**< \brief (SDMMC Offset: 0x04C) Reserved */ + __O uint16_t SDMMC_FERACES; /**< \brief (SDMMC Offset: 0x050) Force Event Register for Auto CMD Error Status */ + __O uint16_t SDMMC_FEREIS; /**< \brief (SDMMC Offset: 0x052) Force Event Register for Error Interrupt Status */ + __I uint8_t SDMMC_AESR; /**< \brief (SDMMC Offset: 0x054) ADMA Error Status Register */ + __I uint8_t SDMMC_RSVD2[3]; /**< \brief (SDMMC Offset: 0x055 - 0x57) Reserved */ + __IO uint32_t SDMMC_ASA0R; /**< \brief (SDMMC Offset: 0x058) ADMA System Address Register */ + __I uint32_t SDMMC_RSVD3[1]; /**< \brief (SDMMC Offset: 0x05C) Reserved */ + __IO uint16_t SDMMC_PVR[8]; /**< \brief (SDMMC Offset: 0x060) Preset Value Register */ + __I uint32_t SDMMC_RSVD4[35]; /**< \brief (SDMMC Offset: 0x070 - 0xF8) Reserved */ + __I uint16_t SDMMC_SISR; /**< \brief (SDMMC Offset: 0x0FC) Slot Interrupt Status Register */ + __I uint16_t SDMMC_HCVR; /**< \brief (SDMMC Offset: 0x0FE) Host Controller Version Register */ + + __I uint32_t SDMMC_RSVD5[64]; /**< \brief (SDMMC Offset: 0x100 - 0x1FC) Reserved */ + + __I uint32_t SDMMC_APSR; /**< \brief (SDMMC Offset: 0x200) Additionnal Present State Register */ + __IO uint8_t SDMMC_MC1R; /**< \brief (SDMMC Offset: 0x204) MMC Control 1 Register */ + __O uint8_t SDMMC_MC2R; /**< \brief (SDMMC Offset: 0x205) MMC Control 2 Register */ + __I uint8_t SDMMC_RSVD6[2]; /**< \brief (SDMMC Offset: 0x206 - 0x207) Reserved */ + __IO uint32_t SDMMC_ACR; /**< \brief (SDMMC Offset: 0x208) AHB Control Register */ + __IO uint32_t SDMMC_CC2R; /**< \brief (SDMMC Offset: 0x20C) Clock Control 2 Register */ + __IO uint8_t SDMMC_RTC1R; /**< \brief (SDMMC Offset: 0x210) Retuning Timer Control 1 Register */ + __O uint8_t SDMMC_RTC2R; /**< \brief (SDMMC Offset: 0x211) Retuning Timer Control 2 Register */ + __I uint8_t SDMMC_RSVD7[2]; /**< \brief (SDMMC Offset: 0x212 - 0x213) Reserved */ + __IO uint32_t SDMMC_RTCVR; /**< \brief (SDMMC Offset: 0x214) Retuning Timer Counter Value Register */ + __IO uint8_t SDMMC_RTISTER; /**< \brief (SDMMC Offset: 0x218) Retuning Timer Interrupt Status Enable Register */ + __IO uint8_t SDMMC_RTISIER; /**< \brief (SDMMC Offset: 0x219) Retuning Timer Interrupt Signal Enable Register */ + __I uint8_t SDMMC_RSVD11[2]; /**< \brief (SDMMC Offset: 0x21A - 0x21B) Reserved */ + __IO uint8_t SDMMC_RTISTR; /**< \brief (SDMMC Offset: 0x21C) Retuning Timer Interrupt Status Register */ + __I uint8_t SDMMC_RTSSR; /**< \brief (SDMMC Offset: 0x21D) Retuning Timer Status Slots Register */ + __I uint8_t SDMMC_RSVD12[2]; /**< \brief (SDMMC Offset: 0x21E - 0x21F) Reserved */ + __IO uint32_t SDMMC_TUNCR; /**< \brief (SDMMC Offset: 0x220) Tuning Control Register */ + __I uint32_t SDMMC_RSVD8[3]; /**< \brief (SDMMC Offset: 0x224 - 0x22C) Reserved */ + __IO uint32_t SDMMC_CACR; /**< \brief (SDMMC Offset: 0x230) Capabilities Control Register */ + __I uint32_t SDMMC_RSVD9[3]; /**< \brief (SDMMC Offset: 0x234 - 0x23C) Reserved */ + __IO uint32_t SDMMC_CALCR; /**< \brief (SDMMC Offset: 0x240) Calibration Control Register */ + __I uint32_t SDMMC_RSVD10[47]; /**< \brief (SDMMC Offset: 0x244 - 0x2FC) Reserved */ +} Sdmmc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- SDMMC_SSAR (SDMMC Offset: 0x000) SDMA System Address - Argument 2 Register */ +#define SDMMC_SSAR_ADDR_Pos 0 +#define SDMMC_SSAR_ADDR_Msk (0xFFFFFFFFu << SDMMC_SSAR_ADDR_Pos) +#define SDMMC_SSAR_ADDR(value) ((SDMMC_SSAR_ADDR_Msk & ((value) << SDMMC_SSAR_ADDR_Pos))) +#define SDMMC_SSAR_ARG2_Pos 0 +#define SDMMC_SSAR_ARG2_Msk (0xFFFFFFFFu << SDMMC_SSAR_ARG2_Pos) +#define SDMMC_SSAR_ARG2(value) ((SDMMC_SSAR_ARG2_Msk & ((value) << SDMMC_SSAR_ARG2_Pos))) +/* -------- SDMMC_BSR (SDMMC Offset: 0x004) Block Size Register */ +#define SDMMC_BSR_BLKSIZE_Pos 0 +#define SDMMC_BSR_BLKSIZE_Msk (0xFFFu << SDMMC_BSR_BLKSIZE_Pos) +#define SDMMC_BSR_BLKSIZE(value) ((SDMMC_BSR_BLKSIZE_Msk & ((value) << SDMMC_BSR_BLKSIZE_Pos))) +#define SDMMC_BSR_BOUNDARY_Pos 12 +#define SDMMC_BSR_BOUNDARY_Msk (0x7u << SDMMC_BSR_BOUNDARY_Pos) +#define SDMMC_BSR_BOUNDARY(value) ((SDMMC_BSR_BOUNDARY_Msk & ((value) << SDMMC_BSR_BOUNDARY_Pos))) +/* -------- SDMMC_BCR (SDMMC Offset: 0x006) Block Count Register */ +#define SDMMC_BCR_BLKCNT_Pos 0 +#define SDMMC_BCR_BLKCNT_Msk (0xFFFFu << SDMMC_BCR_BLKCNT_Pos) +#define SDMMC_BCR_BLKCNT(value) ((SDMMC_BCR_BLKCNT_Msk & ((value) << SDMMC_BCR_BLKCNT_Pos))) +/* -------- SDMMC_ARG1R (SDMMC Offset: 0x008) Argument 1 Register */ +#define SDMMC_ARG1R_ARG1_Pos 0 +#define SDMMC_ARG1R_ARG1_Msk (0xFFFFFFFFu << SDMMC_ARG1R_ARG1_Pos) +#define SDMMC_ARG1R_ARG1(value) ((SDMMC_ARG1R_ARG1_Msk & ((value) << SDMMC_ARG1R_ARG1_Pos))) +/* -------- SDMMC_TMR (SDMMC Offset: 0x00C) Transfer Mode Register */ +#define SDMMC_TMR_DMAEN (0x1u << 0) +#define SDMMC_TMR_BCEN (0x1u << 1) +#define SDMMC_TMR_ACMDEN_Pos 2 +#define SDMMC_TMR_ACMDEN_Msk (0x3u << SDMMC_TMR_ACMDEN_Pos) +#define SDMMC_TMR_ACMDEN_DIS (0x0u << 2) +#define SDMMC_TMR_ACMDEN_ACMD12 (0x1u << 2) +#define SDMMC_TMR_ACMDEN_ACMD23 (0x2u << 2) +#define SDMMC_TMR_DTDSEL (0x1u << 4) +#define SDMMC_TMR_DTDSEL_WR (0x0u << 4) +#define SDMMC_TMR_DTDSEL_RD (0x1u << 4) +#define SDMMC_TMR_MSBSEL (0x1u << 5) +/* -------- SDMMC_CR (SDMMC Offset: 0x00E) Command Register */ +#define SDMMC_CR_RESPTYP_Pos 0 +#define SDMMC_CR_RESPTYP_Msk (0x3u << SDMMC_CR_RESPTYP_Pos) +#define SDMMC_CR_RESPTYP_NORESP (0x0u << 0) +#define SDMMC_CR_RESPTYP_RL136 (0x1u << 0) +#define SDMMC_CR_RESPTYP_RL48 (0x2u << 0) +#define SDMMC_CR_RESPTYP_RL48BUSY (0x3u << 0) +#define SDMMC_CR_CMDCCEN (0x1u << 3) +#define SDMMC_CR_CMDICEN (0x1u << 4) +#define SDMMC_CR_DPSEL (0x1u << 5) +#define SDMMC_CR_CMDTYP_Pos 6 +#define SDMMC_CR_CMDTYP_Msk (0x3u << SDMMC_CR_CMDTYP_Pos) +#define SDMMC_CR_CMDTYP_NORMAL (0x0u << 6) +#define SDMMC_CR_CMDTYP_SUSPEND (0x1u << 6) +#define SDMMC_CR_CMDTYP_RESUME (0x2u << 6) +#define SDMMC_CR_CMDTYP_ABORT (0x3u << 6) +#define SDMMC_CR_CMDIDX_Pos 8 +#define SDMMC_CR_CMDIDX_Msk (0x3F << SDMMC_CR_CMDIDX_Pos) +#define SDMMC_CR_CMDIDX(value) ((SDMMC_CR_CMDIDX_Msk & ((value) << SDMMC_CR_CMDIDX_Pos))) +/* -------- SDMMC_RR[4] (SDMMC Offset: 0x010) Response Register */ +#define SDMMC_RR_CMDRESP_Pos 0 +#define SDMMC_RR_CMDRESP_Msk (0xFFFFFFFFu << SDMMC_RR_CMDRESP_Pos) +/* -------- SDMMC_BDPR Buffer Data Port Register */ +#define SDMMC_BDPR_BUFDATA_Pos 0 +#define SDMMC_BDPR_BUFDATA_Msk (0xFFFFFFFFu << SDMMC_BDPR_BUFDATA_Pos) +#define SDMMC_BDPR_BUFDATA(value) ((SDMMC_BDPR_BUFDATA_Msk & ((value) << SDMMC_BDPR_BUFDATA_Pos))) +/* -------- SDMMC_PSR (SDMMC Offset: 0x024) Present State Register */ +#define SDMMC_PSR_CMDINHC (0x1u << 0) +#define SDMMC_PSR_CMDINHD (0x1u << 1) +#define SDMMC_PSR_DLACT (0x1u << 2) +#define SDMMC_PSR_RTREQ (0x1u << 3) +#define SDMMC_PSR_WTACT (0x1u << 8) +#define SDMMC_PSR_RTACT (0x1u << 9) +#define SDMMC_PSR_BUFWREN (0x1u << 10) +#define SDMMC_PSR_BUFRDEN (0x1u << 11) +#define SDMMC_PSR_CARDINS (0x1u << 16) +#define SDMMC_PSR_CARDSS (0x1u << 17) +#define SDMMC_PSR_CARDDPL (0x1u << 18) +#define SDMMC_PSR_WRPPL (0x1u << 19) +#define SDMMC_PSR_DATLL_Pos 20 +#define SDMMC_PSR_DATLL_Msk (0xFu << SDMMC_PSR_DATLL_Pos) +#define SDMMC_PSR_CMDLL (0x1u << 24) +/* -------- SDMMC_HC1R (SDMMC Offset: 0x028) Host Control 1 Register */ +#define SDMMC_HC1R_LEDCTRL (0x1u << 0) +#define SDMMC_HC1R_DW (0x1u << 1) +#define SDMMC_HC1R_HSEN (0x1u << 2) +#define SDMMC_HC1R_DMASEL_Pos 3 +#define SDMMC_HC1R_DMASEL_Msk (0x3u << SDMMC_HC1R_DMASEL_Pos) +#define SDMMC_HC1R_DMASEL_SDMA (0x0u << 3) +#define SDMMC_HC1R_DMASEL_ADMA32 (0x2u << 3) +#define SDMMC_HC1R_DMASEL_ADMA64 (0x3u << 3) +#define SDMMC_HC1R_EXTDW (0x1u << 5) +#define SDMMC_HC1R_CARDDTL (0x1u << 6) +#define SDMMC_HC1R_CARDDSSEL (0x1u << 7) +/* -------- SDMMC_PCR (SDMMC Offset: 0x029) Power Control Register */ +#define SDMMC_PCR_SDBPWR (0x1u << 0) +#define SDMMC_PCR_SDBVSEL_Pos 1 +#define SDMMC_PCR_SDBVSEL_Msk (0x7u << SDMMC_PCR_SDBVSEL_Pos) +#define SDMMC_PCR_SDBVSEL(value) ((SDMMC_PCR_SDBVSEL_Msk & ((value) << SDMMC_PCR_SDBVSEL_Pos))) +/* -------- SDMMC_BGCR (SDMMC Offset: 0x02A) Block Gap Control Register */ +#define SDMMC_BGCR_STPBGR (0x1u << 0) +#define SDMMC_BGCR_CONTR (0x1u << 1) +#define SDMMC_BGCR_RWCTRL (0x1u << 2) +#define SDMMC_BGCR_INTBG (0x1u << 3) +/* -------- SDMMC_WCR (SDMMC Offset: 0x02B) Wakeup Control Register */ +#define SDMMC_WCR_WKENCINT (0x1u << 0) +#define SDMMC_WCR_WKENCINS (0x1u << 1) +#define SDMMC_WCR_WKENCREM (0x1u << 2) +/* -------- SDMMC_CCR (SDMMC Offset: 0x02C) Clock Control Register */ +#define SDMMC_CCR_INTCLKEN (0x1u << 0) +#define SDMMC_CCR_INTCLKS (0x1u << 1) +#define SDMMC_CCR_SDCLKEN (0x1u << 2) +#define SDMMC_CCR_CLKGSEL (0x1u << 5) +#define SDMMC_CCR_USDCLKFSEL_Pos 6 +#define SDMMC_CCR_USDCLKFSEL_Msk (0x3u << SDMMC_CCR_USDCLKFSEL_Pos) +#define SDMMC_CCR_USDCLKFSEL(value) ((SDMMC_CCR_USDCLKFSEL_Msk & ((value) << SDMMC_CCR_USDCLKFSEL_Pos))) +#define SDMMC_CCR_SDCLKFSEL_Pos 8 +#define SDMMC_CCR_SDCLKFSEL_Msk (0xFFu << SDMMC_CCR_SDCLKFSEL_Pos) +#define SDMMC_CCR_SDCLKFSEL(value) ((SDMMC_CCR_SDCLKFSEL_Msk & ((value) << SDMMC_CCR_SDCLKFSEL_Pos))) +/* -------- SDMMC_TCR (SDMMC Offset: 0x02E) Timeout Control Register */ +#define SDMMC_TCR_DTCVAL_Pos 0 +#define SDMMC_TCR_DTCVAL_Msk (0xFu << SDMMC_TCR_DTCVAL_Pos) +#define SDMMC_TCR_DTCVAL(value) ((SDMMC_TCR_DTCVAL_Msk & ((value) << SDMMC_TCR_DTCVAL_Pos))) +/* -------- SDMMC_SRR (SDMMC Offset: 0x02F) Software Reset Register */ +#define SDMMC_SRR_SWRSTALL (0x1u << 0) +#define SDMMC_SRR_SWRSTCMD (0x1u << 1) +#define SDMMC_SRR_SWRSTDAT (0x1u << 2) +/* -------- SDMMC_NISTR (SDMMC Offset: 0x030) Normal Interrupt Status Register */ +#define SDMMC_NISTR_CMDC (0x1u << 0) +#define SDMMC_NISTR_TRFC (0x1u << 1) +#define SDMMC_NISTR_BLKGE (0x1u << 2) +#define SDMMC_NISTR_DMAINT (0x1u << 3) +#define SDMMC_NISTR_BWRRDY (0x1u << 4) +#define SDMMC_NISTR_BRDRDY (0x1u << 5) +#define SDMMC_NISTR_CINS (0x1u << 6) +#define SDMMC_NISTR_CREM (0x1u << 7) +#define SDMMC_NISTR_CINT (0x1u << 8) +#define SDMMC_NISTR_INTA (0x1u << 9) +#define SDMMC_NISTR_INTB (0x1u << 10) +#define SDMMC_NISTR_INTC (0x1u << 11) +#define SDMMC_NISTR_RTEVT (0x1u << 12) +#define SDMMC_NISTR_BOOTAR (0x1u << 14) +#define SDMMC_NISTR_ERRINT (0x1u << 15) +/* -------- SDMMC_EISTR (SDMMC Offset: 0x032) Error Interrupt Status Register */ +#define SDMMC_EISTR_CMDTEO (0x1u << 0) +#define SDMMC_EISTR_CMDCRC (0x1u << 1) +#define SDMMC_EISTR_CMDEND (0x1u << 2) +#define SDMMC_EISTR_CMDIDX (0x1u << 3) +#define SDMMC_EISTR_DATTEO (0x1u << 4) +#define SDMMC_EISTR_DATCRC (0x1u << 5) +#define SDMMC_EISTR_DATEND (0x1u << 6) +#define SDMMC_EISTR_CURLIM (0x1u << 7) +#define SDMMC_EISTR_ACMD (0x1u << 8) +#define SDMMC_EISTR_ADMA (0x1u << 9) +#define SDMMC_EISTR_TUNING (0x1u << 10) +#define SDMMC_EISTR_BOOTAE (0x1u << 12) +/* -------- SDMMC_NISTER (SDMMC Offset: 0x034) Normal Interrupt Status Enable Register */ +#define SDMMC_NISTER_CMDC (0x1u << 0) +#define SDMMC_NISTER_TRFC (0x1u << 1) +#define SDMMC_NISTER_BLKGE (0x1u << 2) +#define SDMMC_NISTER_DMAINT (0x1u << 3) +#define SDMMC_NISTER_BWRRDY (0x1u << 4) +#define SDMMC_NISTER_BRDRDY (0x1u << 5) +#define SDMMC_NISTER_CINS (0x1u << 6) +#define SDMMC_NISTER_CREM (0x1u << 7) +#define SDMMC_NISTER_CINT (0x1u << 8) +#define SDMMC_NISTER_INTA (0x1u << 9) +#define SDMMC_NISTER_INTB (0x1u << 10) +#define SDMMC_NISTER_INTC (0x1u << 11) +#define SDMMC_NISTER_RTEVT (0x1u << 12) +#define SDMMC_NISTER_BOOTAR (0x1u << 14) +/* -------- SDMMC_EISTER (SDMMC Offset: 0x036) Error Interrupt Status Enable Register */ +#define SDMMC_EISTER_CMDTEO (0x1u << 0) +#define SDMMC_EISTER_CMDCRC (0x1u << 1) +#define SDMMC_EISTER_CMDEND (0x1u << 2) +#define SDMMC_EISTER_CMDIDX (0x1u << 3) +#define SDMMC_EISTER_DATTEO (0x1u << 4) +#define SDMMC_EISTER_DATCRC (0x1u << 5) +#define SDMMC_EISTER_DATEND (0x1u << 6) +#define SDMMC_EISTER_CURLIM (0x1u << 7) +#define SDMMC_EISTER_ACMD (0x1u << 8) +#define SDMMC_EISTER_ADMA (0x1u << 9) +#define SDMMC_EISTER_TUNING (0x1u << 10) +#define SDMMC_EISTER_BOOTAE (0x1u << 12) +/* -------- SDMMC_NISIER (SDMMC Offset: 0x038) Normal Interrupt Signal Enable Register */ +#define SDMMC_NISIER_CMDC (0x1u << 0) +#define SDMMC_NISIER_TRFC (0x1u << 1) +#define SDMMC_NISIER_BLKGE (0x1u << 2) +#define SDMMC_NISIER_DMAINT (0x1u << 3) +#define SDMMC_NISIER_BWRRDY (0x1u << 4) +#define SDMMC_NISIER_BRDRDY (0x1u << 5) +#define SDMMC_NISIER_CINS (0x1u << 6) +#define SDMMC_NISIER_CREM (0x1u << 7) +#define SDMMC_NISIER_CINT (0x1u << 8) +#define SDMMC_NISIER_INTA (0x1u << 9) +#define SDMMC_NISIER_INTB (0x1u << 10) +#define SDMMC_NISIER_INTC (0x1u << 11) +#define SDMMC_NISIER_RTEVT (0x1u << 12) +#define SDMMC_NISIER_BOOTAR (0x1u << 14) +/* -------- SDMMC_EISIER (SDMMC Offset: 0x03A) Error Interrupt Signal Enable Register */ +#define SDMMC_EISIER_CMDTEO (0x1u << 0) +#define SDMMC_EISIER_CMDCRC (0x1u << 1) +#define SDMMC_EISIER_CMDEND (0x1u << 2) +#define SDMMC_EISIER_CMDIDX (0x1u << 3) +#define SDMMC_EISIER_DATTEO (0x1u << 4) +#define SDMMC_EISIER_DATCRC (0x1u << 5) +#define SDMMC_EISIER_DATEND (0x1u << 6) +#define SDMMC_EISIER_CURLIM (0x1u << 7) +#define SDMMC_EISIER_ACMD (0x1u << 8) +#define SDMMC_EISIER_ADMA (0x1u << 9) +#define SDMMC_EISIER_TUNING (0x1u << 10) +#define SDMMC_EISIER_BOOTAE (0x1u << 12) +/* -------- SDMMC_ACESR (SDMMC Offset: 0x03C) Auto CMD Error Status Register */ +#define SDMMC_ACESR_ACMD12NE (0x1u << 0) +#define SDMMC_ACESR_ACMDTEO (0x1u << 1) +#define SDMMC_ACESR_ACMDCRC (0x1u << 2) +#define SDMMC_ACESR_ACMDEND (0x1u << 3) +#define SDMMC_ACESR_ACMDIDX (0x1u << 4) +#define SDMMC_ACESR_CMDNI (0x1u << 7) +/* -------- SDMMC_HC2R (SDMMC Offset: 0x03E) Host Control 2 Register */ +#define SDMMC_HC2R_UHSMS_Pos 0 +#define SDMMC_HC2R_UHSMS_Msk (0x7u << SDMMC_HC2R_UHSMS_Pos) +#define SDMMC_HC2R_UHSMS_SDR12 (0x0u << 0) +#define SDMMC_HC2R_UHSMS_SDR25 (0x1u << 0) +#define SDMMC_HC2R_UHSMS_SDR50 (0x2u << 0) +#define SDMMC_HC2R_UHSMS_SDR104 (0x3u << 0) +#define SDMMC_HC2R_UHSMS_DDR50 (0x4u << 0) +#define SDMMC_HC2R_VS18EN (0x1u << 3) +#define SDMMC_HC2R_DRVSEL_Pos 4 +#define SDMMC_HC2R_DRVSEL_Msk (0x3u << SDMMC_HC2R_DRVSEL_Pos) +#define SDMMC_HC2R_DRVSEL_TYPEB (0x0u << 4) +#define SDMMC_HC2R_DRVSEL_TYPEA (0x1u << 4) +#define SDMMC_HC2R_DRVSEL_TYPEC (0x2u << 4) +#define SDMMC_HC2R_DRVSEL_TYPED (0x3u << 4) +#define SDMMC_HC2R_EXTUN (0x1u << 6) +#define SDMMC_HC2R_SCLKSEL (0x1u << 7) +#define SDMMC_HC2R_ASINTEN (0x1u << 14) +#define SDMMC_HC2R_PVALEN (0x1u << 15) +/* -------- SDMMC_CA0R (SDMMC Offset: 0x040) Capabilities Register */ +#define SDMMC_CA0R_TEOCLKF_Pos 0 +#define SDMMC_CA0R_TEOCLKF_Msk (0x3Fu << SDMMC_CA0R_TEOCLKF_Pos) +#define SDMMC_CA0R_TEOCLKF(value) ((SDMMC_CA0R_TEOCLKF_Msk & ((value) << SDMMC_CA0R_TEOCLKF_Pos))) +#define SDMMC_CA0R_TEOCLKU (0x1u << 7) +#define SDMMC_CA0R_BASECLKF_Pos 8 +#define SDMMC_CA0R_BASECLKF_Msk (0xFFu << SDMMC_CA0R_BASECLKF_Pos) +#define SDMMC_CA0R_BASECLKF(value) ((SDMMC_CA0R_BASECLKF_Msk & ((value) << SDMMC_CA0R_BASECLKF_Pos))) +#define SDMMC_CA0R_MAXBLKL_Pos 16 +#define SDMMC_CA0R_MAXBLKL_Msk (0x3u << SDMMC_CA0R_MAXBLKL_Pos) +#define SDMMC_CA0R_MAXBLKL(value) ((SDMMC_CA0R_MAXBLKL_Msk & ((value) << SDMMC_CA0R_MAXBLKL_Pos))) +#define SDMMC_CA0R_ED8SUP (0x1u << 18) +#define SDMMC_CA0R_ADMA2SUP (0x1u << 19) +#define SDMMC_CA0R_HSSUP (0x1u << 21) +#define SDMMC_CA0R_SDMASUP (0x1u << 22) +#define SDMMC_CA0R_SRSUP (0x1u << 23) +#define SDMMC_CA0R_V33VSUP (0x1u << 24) +#define SDMMC_CA0R_V30VSUP (0x1u << 25) +#define SDMMC_CA0R_V18VSUP (0x1u << 26) +#define SDMMC_CA0R_SB64SUP (0x1u << 28) +#define SDMMC_CA0R_ASINTSUP (0x1u << 29) +#define SDMMC_CA0R_SLTYPE_Pos 30 +#define SDMMC_CA0R_SLTYPE_Msk (0x3u << SDMMC_CA0R_SLTYPE_Pos) +#define SDMMC_CA0R_SLTYPE_REMOVABLECARD (0x0u << 30) +#define SDMMC_CA0R_SLTYPE_EMBEDDED (0x1u << 30) +#define SDMMC_CA0R_SLTYPE_SHAREDBUS (0x2u << 30) +/* -------- SDMMC_CA1R (SDMMC Offset: 0x044) Capabilities Register */ +#define SDMMC_CA1R_SDR50SUP (0x1u << 0) +#define SDMMC_CA1R_SDR104SUP (0x1u << 1) +#define SDMMC_CA1R_DDR50SUP (0x1u << 2) +#define SDMMC_CA1R_DRVASUP (0x1u << 4) +#define SDMMC_CA1R_DRVCSUP (0x1u << 5) +#define SDMMC_CA1R_DRVDSUP (0x1u << 6) +#define SDMMC_CA1R_TCNTRT_Pos 8 +#define SDMMC_CA1R_TCNTRT_Msk (0xFu << SDMMC_CA1R_TCNTRT_Pos) +#define SDMMC_CA1R_TSDR50 (0x1u << 13) +#define SDMMC_CA1R_RTMOD_Pos 14 +#define SDMMC_CA1R_RTMOD_Msk (0x3u << SDMMC_CA1R_RTMOD_Pos) +#define SDMMC_CA1R_RTMOD_MODE1 (0x0u << 14) +#define SDMMC_CA1R_RTMOD_MODE2 (0x1u << 14) +#define SDMMC_CA1R_RTMOD_MODE3 (0x2u << 14) +#define SDMMC_CA1R_CLKMULT_Pos 16 +#define SDMMC_CA1R_CLKMULT_Msk (0xFFu << SDMMC_CA1R_CLKMULT_Pos) +/* -------- SDMMC_MCCAR (SDMMC Offset: 0x048) Maximum Current Capabilities Register */ +#define SDMMC_MCCAR_MAXCUR33V_Pos 0 +#define SDMMC_MCCAR_MAXCUR33V_Msk (0xFFu << SDMMC_MCCAR_MAXCUR33V_Pos) +#define SDMMC_MCCAR_MAXCUR30V_Pos 8 +#define SDMMC_MCCAR_MAXCUR30V_Msk (0xFFu << SDMMC_MCCAR_MAXCUR30V_Pos) +#define SDMMC_MCCAR_MAXCUR18V_Pos 16 +#define SDMMC_MCCAR_MAXCUR18V_Msk (0xFFu << SDMMC_MCCAR_MAXCUR18V_Pos) +/* -------- SDMMC_FERACES (SDMMC Offset: 0x050) Force Event Register for Auto CMD Error Status */ +#define SDMMC_FERACES_ACMD12NE (0x1u << 0) +#define SDMMC_FERACES_ACMDTEO (0x1u << 1) +#define SDMMC_FERACES_ACMDCRC (0x1u << 2) +#define SDMMC_FERACES_ACMDEND (0x1u << 3) +#define SDMMC_FERACES_ACMDIDX (0x1u << 4) +#define SDMMC_FERACES_CMDNI (0x1u << 7) +/* -------- SDMMC_FEREIS (SDMMC Offset: 0x052) Force Event Register for Error Interrupt Status */ +#define SDMMC_FEREIS_CMDTEO (0x1u << 0) +#define SDMMC_FEREIS_CMDCRC (0x1u << 1) +#define SDMMC_FEREIS_CMDEND (0x1u << 2) +#define SDMMC_FEREIS_CMDIDX (0x1u << 3) +#define SDMMC_FEREIS_DATTEO (0x1u << 4) +#define SDMMC_FEREIS_DATCRC (0x1u << 5) +#define SDMMC_FEREIS_DATEND (0x1u << 6) +#define SDMMC_FEREIS_CURLIM (0x1u << 7) +#define SDMMC_FEREIS_ACMD (0x1u << 8) +#define SDMMC_FEREIS_ADMA (0x1u << 9) +/* -------- SDMMC_AESR (SDMMC Offset: 0x054) ADMA Error Status Register */ +#define SDMMC_AESR_ERRST_Pos 0 +#define SDMMC_AESR_ERRST_Msk (0x3u << SDMMC_AESR_ERRST_Pos) +#define SDMMC_AESR_ERRST_STOP (0x0u << 0) +#define SDMMC_AESR_ERRST_FDS (0x1u << 0) +#define SDMMC_AESR_ERRST_TFR (0x3u << 0) +#define SDMMC_AESR_LMIS (0x1u << 2) +/* -------- SDMMC_ASA0R (SDMMC Offset: 0x058) ADMA System Address Register */ +#define SDMMC_ASA0R_ADMASA_Pos 0 +#define SDMMC_ASA0R_ADMASA_Msk (0xFFFFFFFFu << SDMMC_ASA0R_ADMASA_Pos) +#define SDMMC_ASA0R_ADMASA(value) ((SDMMC_ASA0R_ADMASA_Msk & ((value) << SDMMC_ASA0R_ADMASA_Pos))) +/* -------- SDMMC_PVR[8] (SDMMC Offset: 0x060) Preset Value Register */ +#define SDMMC_PVR_SDCLKFSEL_Pos 0 +#define SDMMC_PVR_SDCLKFSEL_Msk (0x3FFu << SDMMC_PVR_SDCLKFSEL_Pos) +#define SDMMC_PVR_SDCLKFSEL(value) ((SDMMC_PVR_SDCLKFSEL_Msk & ((value) << SDMMC_PVR_SDCLKFSEL_Pos))) +#define SDMMC_PVR_CLKGSEL (0x1u << 10) +#define SDMMC_PVR_DRVSEL_Pos 14 +#define SDMMC_PVR_DRVSEL_Msk (0x3u << SDMMC_PVR_DRVSEL_Pos) +#define SDMMC_PVR_DRVSEL(value) ((SDMMC_PVR_DRVSEL_Msk & ((value) << SDMMC_PVR_DRVSEL_Pos))) +/* -------- SDMMC_SISR (SDMMC Offset: 0x0FC) Slot Interrupt Status Register */ +#define SDMMC_SISR_INTSSL_Pos 0 +#define SDMMC_SISR_INTSSL_Msk (0xFFu << SDMMC_SISR_INTSIGSLOT_Pos) +/* -------- SDMMC_HCVR (SDMMC Offset: 0x0FE) Host Controller Version Register */ +#define SDMMC_HCVR_SVER_Pos 0 +#define SDMMC_HCVR_SVER_Msk (0xFFu << SDMMC_HCVR_SVER_Pos) +#define SDMMC_HCVR_VVER_Pos 8 +#define SDMMC_HCVR_VVER_Msk (0xFFu << SDMMC_HCVR_VVER_Pos) +/* -------- SDMMC_APSR (SDMMC Offset: 0x200) Additionnal Present State Register */ +#define SDMMC_APSR_HDATLL_Pos 0 +#define SDMMC_APSR_HDATLL_Msk (0xFu << SDMMC_APSR_HDATLL_Pos) +/* -------- SDMMC_MC1R (SDMMC Offset: 0x204) MMC Control 1 Register */ +#define SDMMC_MC1R_CMDTYP_Pos 0 +#define SDMMC_MC1R_CMDTYP_Msk (0x3u << SDMMC_MC1R_CMDTYP_Pos) +#define SDMMC_MC1R_CMDTYP_NORMAL (0x0u << 0) +#define SDMMC_MC1R_CMDTYP_WAITIRQ (0x1u << 0) +#define SDMMC_MC1R_CMDTYP_STREAM (0x2u << 0) +#define SDMMC_MC1R_CMDTYP_BOOT (0x3u << 0) +#define SDMMC_MC1R_DDR (0x1u << 3) +#define SDMMC_MC1R_OPD (0x1u << 4) +#define SDMMC_MC1R_BOOTA (0x1u << 5) +#define SDMMC_MC1R_RSTN (0x1u << 6) +#define SDMMC_MC1R_FCD (0x1u << 7) +/* -------- SDMMC_MC2R (SDMMC Offset: 0x205) MMC Control 2 Register */ +#define SDMMC_MC2R_SRESP (0x1u << 0) +#define SDMMC_MC2R_ABOOT (0x1u << 1) +/* -------- SDMMC_ACR (SDMMC Offset: 0x208) AHB Control Register */ +#define SDMMC_ACR_BMAX_Pos 0 +#define SDMMC_ACR_BMAX_Msk (0x3u << SDMMC_ACR_BMAX_Pos) +#define SDMMC_ACR_BMAX_INCR16 (0x0u << 0) +#define SDMMC_ACR_BMAX_INCR8 (0x1u << 0) +#define SDMMC_ACR_BMAX_INCR4 (0x2u << 0) +#define SDMMC_ACR_BMAX_SINGLE (0x3u << 0) +#define SDMMC_ACR_HNBRDIS (0x1u << 4) +#define SDMMC_ACR_B1KBDIS (0x1u << 5) +/* -------- SDMMC_CC2R (SDMMC Offset: 0x20C) Clock Control 2 Register */ +#define SDMMC_CC2R_FSDCLKD (0x1u << 0) +/* -------- SDMMC_RTC1R (SDMMC Offset: 0x210) Retuning Timer Control 1 Register */ +#define SDMMC_RTC1R_TMREN (0x1u << 0) +/* -------- SDMMC_RTC2R (SDMMC Offset: 0x211) Retuning Timer Control 2 Register */ +#define SDMMC_RTC2R_RLD (0x1u << 0) +/* -------- SDMMC_RTCVR (SDMMC Offset: 0x214) Retuning Timer Counter Value Register */ +#define SDMMC_RTCVR_TCVAL_Pos 0 +#define SDMMC_RTCVR_TCVAL_Msk (0xFu << SDMMC_RTCVR_TCVAL_Pos) +#define SDMMC_RTCVR_TCVAL(value) ((SDMMC_RTCVR_TCVAL_Msk & ((value) << SDMMC_RTCVR_TCVAL_Pos))) +/* -------- SDMMC_RTISTER (SDMMC Offset: 0x218) Retuning Timer Interrupt Status Enable Register */ +#define SDMMC_RTISTER_TEVT (0x1u << 0) +/* -------- SDMMC_RTISIER (SDMMC Offset: 0x219) Retuning Timer Interrupt Signal Enable Register */ +#define SDMMC_RTISIER_TEVT (0x1u << 0) +/* -------- SDMMC_RTISTR (SDMMC Offset: 0x21C) Retuning Timer Interrupt Status Register */ +#define SDMMC_RTISTR_TEVT (0x1u << 0) +/* -------- SDMMC_RTSSR (SDMMC Offset: 0x21D) Retuning Timer Status Slots Register */ +#define SDMMC_RTSSR_TEVTSLOT (0x1u << 0) +/* -------- SDMMC_TUNCR (SDMMC Offset: 0x220) Tuning Control Register */ +#define SDMMC_TUNCR_SMPLPT (0x1u << 0) +/* -------- SDMMC_CACR (SDMMC Offset: 0x230) Capabilities Control Register */ +#define SDMMC_CACR_CAPWREN (0x1u << 0) +#define SDMMC_CACR_KEY_Pos 8 +#define SDMMC_CACR_KEY_Msk (0xFFu << SDMMC_CACR_KEY_Pos) +#define SDMMC_CACR_KEY(value) ((SDMMC_CACR_KEY_Msk & ((value) << SDMMC_CACR_KEY_Pos))) +/* -------- SDMMC_CALCR (SDMMC Offset: 0x240) Calibration Control Register */ +#define SDMMC_CALCR_EN (0x1u << 0) +#define SDMMC_CALCR_ALWYSON (0x1u << 4) +#define SDMMC_CALCR_TUNDIS (0x1u << 5) +#define SDMMC_CALCR_CNTVAL_Pos 8 +#define SDMMC_CALCR_CNTVAL_Msk (0xFFu << SDMMC_CALCR_CNTVAL_Pos) +#define SDMMC_CALCR_CNTVAL(value) ((SDMMC_CALCR_CNTVAL_Msk & ((value) << SDMMC_CALCR_CNTVAL_Pos))) +#define SDMMC_CALCR_CALN_Pos 16 +#define SDMMC_CALCR_CALN_Msk (0xFu << SDMMC_CALCR_CALN_Pos) +#define SDMMC_CALCR_CALP_Pos 24 +#define SDMMC_CALCR_CALP_Msk (0xFu << SDMMC_CALCR_CALP_Pos) +/* -------- SDMMC Descriptor Table for Advanced DMA 2 as pointed by SDMMC_ASA0R */ +#define SDMMC_DMADL_SIZE (2u) /**< \brief Size of a Descriptor Line in the ADMA2 Descriptor Table, in words */ +#define SDMMC_DMADL_TRAN_LEN_MIN (1u) /**< \brief Minimum data length per ADMA2 Descriptor Line, in bytes */ +#define SDMMC_DMADL_TRAN_LEN_MAX (65536ul) /**< \brief Maximum data length per ADMA2 Descriptor Line, in bytes */ +/* -------- SDMMC_DMADL[0] (Descriptor Line Offset: 0x0) ADMA2 Descriptor Line */ +#define SDMMC_DMA0DL_ATTR_VALID (0x1u << 0) +#define SDMMC_DMA0DL_ATTR_END (0x1u << 1) +#define SDMMC_DMA0DL_ATTR_INT (0x1u << 2) +#define SDMMC_DMA0DL_ATTR_ACT_Pos 4 +#define SDMMC_DMA0DL_ATTR_ACT_Msk (0x3u << SDMMC_DMA0DL_ATTR_ACT_Pos) +#define SDMMC_DMA0DL_ATTR_ACT_NOP (0x0u << 4) +#define SDMMC_DMA0DL_ATTR_ACT_TRAN (0x2u << 4) +#define SDMMC_DMA0DL_ATTR_ACT_LINK (0x3u << 4) +#define SDMMC_DMA0DL_LEN_Pos 16 +#define SDMMC_DMA0DL_LEN_Msk (0xFFFFu << SDMMC_DMA0DL_LEN_Pos) +#define SDMMC_DMA0DL_LEN_MAX (0x0u << 16) +#define SDMMC_DMA0DL_LEN(value) ((SDMMC_DMA0DL_LEN_Msk & ((value) << SDMMC_DMA0DL_LEN_Pos))) +/* -------- SDMMC_DMADL[1] (Descriptor Line Offset: 0x4) ADMA2 Descriptor Line */ +#define SDMMC_DMA1DL_ADDR_Pos 0 +#define SDMMC_DMA1DL_ADDR_Msk (0xFFFFFFFFu << SDMMC_DMA1DL_ADDR_Pos) +#define SDMMC_DMA1DL_ADDR(value) ((SDMMC_DMA1DL_ADDR_Msk & ((value) << SDMMC_DMA1DL_ADDR_Pos))) + +/*@}*/ + +#endif /* _SAMA5D2_SDMMC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfc.h new file mode 100644 index 000000000..c4614c303 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfc.h @@ -0,0 +1,98 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SFC_COMPONENT_ +#define _SAMA5D2_SFC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Secure Fuse Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SFC Secure Fuse Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Sfc hardware registers */ +typedef struct { + __O uint32_t SFC_KR; /**< \brief (Sfc Offset: 0x00) SFC Key Register */ + __IO uint32_t SFC_MR; /**< \brief (Sfc Offset: 0X04) SFC Mode Register */ + __I uint32_t Reserved1[2]; + __IO uint32_t SFC_IER; /**< \brief (Sfc Offset: 0x10) SFC Interrupt Enable Register */ + __IO uint32_t SFC_IDR; /**< \brief (Sfc Offset: 0x14) SFC Interrupt Disable Register */ + __I uint32_t SFC_IMR; /**< \brief (Sfc Offset: 0x18) SFC Interrupt Mask Register */ + __I uint32_t SFC_SR; /**< \brief (Sfc Offset: 0x1C) SFC Status Register */ + __IO uint32_t SFC_DR[24]; /**< \brief (Sfc Offset: 0x20) SFC Data Register */ + __I uint32_t Reserved2[31]; + __I uint32_t SFC_VERSION; /**< \brief (Sfc Offset: 0xFC) Version Register */ +} Sfc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SFC_KR : (SFC Offset: 0x00) SFC Key Register -------- */ +#define SFC_KR_KEY_Pos 0 +#define SFC_KR_KEY_Msk (0xffu << SFC_KR_KEY_Pos) /**< \brief (SFC_KR) Key Code */ +#define SFC_KR_KEY(value) ((SFC_KR_KEY_Msk & ((value) << SFC_KR_KEY_Pos))) +/* -------- SFC_MR : (SFC Offset: 0X04) SFC Mode Register -------- */ +#define SFC_MR_MSK (0x1u << 0) /**< \brief (SFC_MR) Mask Data Registers */ +#define SFC_MR_SASEL (0x1u << 4) /**< \brief (SFC_MR) Sense Amplifier Selection */ +/* -------- SFC_IER : (SFC Offset: 0x10) SFC Interrupt Enable Register -------- */ +#define SFC_IER_PGMC (0x1u << 0) /**< \brief (SFC_IER) Programming Sequence Completed Interrupt Enable */ +#define SFC_IER_PGMF (0x1u << 1) /**< \brief (SFC_IER) Programming Sequence Failed Interrupt Enable */ +#define SFC_IER_LCHECK (0x1u << 4) /**< \brief (SFC_IER) Live Integrity Check Error Interrupt Enable */ +#define SFC_IER_APLE (0x1u << 16) /**< \brief (SFC_IER) Atmel Programming Lock Error Interrupt Enable */ +#define SFC_IER_ACE (0x1u << 17) /**< \brief (SFC_IER) Atmel Check Error Interrupt Enable */ +/* -------- SFC_IDR : (SFC Offset: 0x14) SFC Interrupt Disable Register -------- */ +#define SFC_IDR_PGMC (0x1u << 0) /**< \brief (SFC_IDR) Programming Sequence Completed Interrupt Disable */ +#define SFC_IDR_PGMF (0x1u << 1) /**< \brief (SFC_IDR) Programming Sequence Failed Interrupt Disable */ +#define SFC_IDR_LCHECK (0x1u << 4) /**< \brief (SFC_IDR) Live Integrity Check Error Interrupt Disable */ +#define SFC_IDR_APLE (0x1u << 16) /**< \brief (SFC_IDR) Atmel Programming Lock Error Interrupt Disable */ +#define SFC_IDR_ACE (0x1u << 17) /**< \brief (SFC_IDR) Atmel Check Error Interrupt Disable */ +/* -------- SFC_IMR : (SFC Offset: 0x18) SFC Interrupt Mask Register -------- */ +#define SFC_IMR_PGMC (0x1u << 0) /**< \brief (SFC_IMR) Programming Sequence Completed Interrupt Mask */ +#define SFC_IMR_PGMF (0x1u << 1) /**< \brief (SFC_IMR) Programming Sequence Failed Interrupt Mask */ +#define SFC_IMR_LCHECK (0x1u << 4) /**< \brief (SFC_IMR) Live Integrity Checking Error Interrupt Mask */ +#define SFC_IMR_APLE (0x1u << 16) /**< \brief (SFC_IMR) Atmel Programming Lock Error Interrupt Mask */ +#define SFC_IMR_ACE (0x1u << 17) /**< \brief (SFC_IMR) Atmel Check Error Interrupt Mask */ +/* -------- SFC_SR : (SFC Offset: 0x1C) SFC Status Register -------- */ +#define SFC_SR_PGMC (0x1u << 0) /**< \brief (SFC_SR) Programming Sequence Completed (cleared on read) */ +#define SFC_SR_PGMF (0x1u << 1) /**< \brief (SFC_SR) Programming Sequence Failed (cleared on read) */ +#define SFC_SR_LCHECK (0x1u << 4) /**< \brief (SFC_SR) Live Integrity Checking Error (cleared on read) */ +#define SFC_SR_APLE (0x1u << 16) /**< \brief (SFC_SR) Atmel Programming Lock Error (cleared on read) */ +#define SFC_SR_ACE (0x1u << 17) /**< \brief (SFC_SR) Atmel Check Error (cleared on read) */ +/* -------- SFC_DR[24] : (SFC Offset: 0x20) SFC Data Register -------- */ +#define SFC_DR_DATA_Pos 0 +#define SFC_DR_DATA_Msk (0xffffffffu << SFC_DR_DATA_Pos) /**< \brief (SFC_DR[24]) Fuse Data */ +#define SFC_DR_DATA(value) ((SFC_DR_DATA_Msk & ((value) << SFC_DR_DATA_Pos))) +/* -------- SFC_VERSION : (SFC Offset: 0xFC) Version Register -------- */ +#define SFC_VERSION_VERSION_Pos 0 +#define SFC_VERSION_VERSION_Msk (0xfffu << SFC_VERSION_VERSION_Pos) /**< \brief (SFC_VERSION) Hardware Module Version */ +#define SFC_VERSION_MFN_Pos 16 +#define SFC_VERSION_MFN_Msk (0x7u << SFC_VERSION_MFN_Pos) /**< \brief (SFC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_SFC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfr.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfr.h new file mode 100644 index 000000000..abc8b976f --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfr.h @@ -0,0 +1,195 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SFR_COMPONENT_ +#define _SAMA5D2_SFR_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Special Function Registers */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SFR Special Function Registers */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Sfr hardware registers */ +typedef struct { + __I uint32_t Reserved0[1]; + __IO uint32_t SFR_DDRCFG; /**< \brief (Sfr Offset: 0x04) DDR Configuration Register */ + __I uint32_t Reserved1[2]; + __IO uint32_t SFR_OHCIICR; /**< \brief (Sfr Offset: 0x10) OHCI Interrupt Configuration Register */ + __I uint32_t SFR_OHCIISR; /**< \brief (Sfr Offset: 0x14) OHCI Interrupt Status Register */ + __I uint32_t Reserved2[4]; + __IO uint32_t SFR_SECURE; /**< \brief (Sfr Offset: 0x28) Security Configuration Register */ + __I uint32_t Reserved3[1]; + __IO uint32_t SFR_UTMICKTRIM; /**< \brief (Sfr Offset: 0x30) UTMI Clock Trimming Register */ + __IO uint32_t SFR_UTMIHSTRIM; /**< \brief (Sfr Offset: 0x34) UTMI High Speed Trimming Register */ + __IO uint32_t SFR_UTMIFSTRIM; /**< \brief (Sfr Offset: 0x38) UTMI Full Speed Trimming Register */ + __IO uint32_t SFR_UTMISWAP; /**< \brief (Sfr Offset: 0x3C) UTMI DP/DM Pin Swapping Register */ + __IO uint32_t SFR_EBICFG; /**< \brief (Sfr Offset: 0x40) EBI Configuration Register */ + __I uint32_t Reserved4[1]; + __IO uint32_t SFR_CAN; /**< \brief (Sfr Offset: 0x48) CAN Memories Address-based Register */ + __I uint32_t SFR_SN0; /**< \brief (Sfr Offset: 0x4C) Serial Number 0 Register */ + __I uint32_t SFR_SN1; /**< \brief (Sfr Offset: 0x50) Serial Number 1 Register */ + __IO uint32_t SFR_AICREDIR; /**< \brief (Sfr Offset: 0x54) AIC interrupt Redirection Register */ + __IO uint32_t SFR_L2CC_HRAMC; /**< \brief (Sfr Offset: 0x58) L2CC_HRAMC1 */ + __I uint32_t Reserved5[13]; + __IO uint32_t SFR_I2SCLKSEL; /**< \brief (Sfr Offset: 0x90) I2SC Register */ + __IO uint32_t QSPICLK_REG; /**< \brief (Sfr Offset: 0x94) QSPI Clock Pad Supply Select Register */ +} Sfr; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SFR_DDRCFG : (SFR Offset: 0x04) DDR Configuration Register -------- */ +#define SFR_DDRCFG_FDQIEN (0x1u << 16) /**< \brief (SFR_DDRCFG) Force DDR_DQ Input Buffer Always On */ +#define SFR_DDRCFG_FDQSIEN (0x1u << 17) /**< \brief (SFR_DDRCFG) Force DDR_DQS Input Buffer Always On */ +/* -------- SFR_OHCIICR : (SFR Offset: 0x10) OHCI Interrupt Configuration Register -------- */ +#define SFR_OHCIICR_RES0 (0x1u << 0) /**< \brief (SFR_OHCIICR) USB PORTx RESET */ +#define SFR_OHCIICR_RES1 (0x1u << 1) /**< \brief (SFR_OHCIICR) USB PORTx RESET */ +#define SFR_OHCIICR_RES2 (0x1u << 2) /**< \brief (SFR_OHCIICR) USB PORTx RESET */ +#define SFR_OHCIICR_ARIE (0x1u << 4) /**< \brief (SFR_OHCIICR) OHCI Asynchronous Resume Interrupt Enable */ +#define SFR_OHCIICR_APPSTART (0x1u << 5) /**< \brief (SFR_OHCIICR) Reserved */ +#define SFR_OHCIICR_SUSPEND_A (0x1u << 8) /**< \brief (SFR_OHCIICR) USB PORT A */ +#define SFR_OHCIICR_SUSPEND_B (0x1u << 9) /**< \brief (SFR_OHCIICR) USB PORT B */ +#define SFR_OHCIICR_SUSPEND_C (0x1u << 10) /**< \brief (SFR_OHCIICR) USB PORT C */ +#define SFR_OHCIICR_UDPPUDIS (0x1u << 23) /**< \brief (SFR_OHCIICR) USB DEVICE PULL-UP DISABLE */ +#define SFR_OHCIICR_HSIC_SEL (0x1u << 27) /**< \brief (SFR_OHCIICR) Reserved */ +/* -------- SFR_OHCIISR : (SFR Offset: 0x14) OHCI Interrupt Status Register -------- */ +#define SFR_OHCIISR_RIS0 (0x1u << 0) /**< \brief (SFR_OHCIISR) OHCI Resume Interrupt Status Port 0 */ +#define SFR_OHCIISR_RIS1 (0x1u << 1) /**< \brief (SFR_OHCIISR) OHCI Resume Interrupt Status Port 1 */ +#define SFR_OHCIISR_RIS2 (0x1u << 2) /**< \brief (SFR_OHCIISR) OHCI Resume Interrupt Status Port 2 */ +/* -------- SFR_SECURE : (SFR Offset: 0x28) Security Configuration Register -------- */ +#define SFR_SECURE_ROM (0x1u << 0) /**< \brief (SFR_SECURE) Disable Access to ROM Code */ +#define SFR_SECURE_FUSE (0x1u << 8) /**< \brief (SFR_SECURE) Disable Access to Fuse Controller */ +/* -------- SFR_UTMICKTRIM : (SFR Offset: 0x30) UTMI Clock Trimming Register -------- */ +#define SFR_UTMICKTRIM_FREQ_Pos 0 +#define SFR_UTMICKTRIM_FREQ_Msk (0x3u << SFR_UTMICKTRIM_FREQ_Pos) /**< \brief (SFR_UTMICKTRIM) UTMI Reference Clock Frequency */ +#define SFR_UTMICKTRIM_FREQ(value) ((SFR_UTMICKTRIM_FREQ_Msk & ((value) << SFR_UTMICKTRIM_FREQ_Pos))) +#define SFR_UTMICKTRIM_FREQ_12 (0x0u << 0) /**< \brief (SFR_UTMICKTRIM) 12 MHz reference clock */ +#define SFR_UTMICKTRIM_FREQ_16 (0x1u << 0) /**< \brief (SFR_UTMICKTRIM) 16 MHz reference clock */ +#define SFR_UTMICKTRIM_FREQ_24 (0x2u << 0) /**< \brief (SFR_UTMICKTRIM) 24 MHz reference clock */ +#define SFR_UTMICKTRIM_VBG_Pos 16 +#define SFR_UTMICKTRIM_VBG_Msk (0xfu << SFR_UTMICKTRIM_VBG_Pos) /**< \brief (SFR_UTMICKTRIM) UTMI Band Gap Voltage Trimming */ +#define SFR_UTMICKTRIM_VBG(value) ((SFR_UTMICKTRIM_VBG_Msk & ((value) << SFR_UTMICKTRIM_VBG_Pos))) +/* -------- SFR_UTMIHSTRIM : (SFR Offset: 0x34) UTMI High Speed Trimming Register -------- */ +#define SFR_UTMIHSTRIM_SQUELCH_Pos 0 +#define SFR_UTMIHSTRIM_SQUELCH_Msk (0x7u << SFR_UTMIHSTRIM_SQUELCH_Pos) /**< \brief (SFR_UTMIHSTRIM) UTMI HS SQUELCH Voltage Trimming */ +#define SFR_UTMIHSTRIM_SQUELCH(value) ((SFR_UTMIHSTRIM_SQUELCH_Msk & ((value) << SFR_UTMIHSTRIM_SQUELCH_Pos))) +#define SFR_UTMIHSTRIM_DISC_Pos 4 +#define SFR_UTMIHSTRIM_DISC_Msk (0x7u << SFR_UTMIHSTRIM_DISC_Pos) /**< \brief (SFR_UTMIHSTRIM) UTMI Disconnect Voltage Trimming */ +#define SFR_UTMIHSTRIM_DISC(value) ((SFR_UTMIHSTRIM_DISC_Msk & ((value) << SFR_UTMIHSTRIM_DISC_Pos))) +#define SFR_UTMIHSTRIM_SLOPE0_Pos 8 +#define SFR_UTMIHSTRIM_SLOPE0_Msk (0x7u << SFR_UTMIHSTRIM_SLOPE0_Pos) /**< \brief (SFR_UTMIHSTRIM) UTMI HS PORTx Transceiver Slope Trimming */ +#define SFR_UTMIHSTRIM_SLOPE0(value) ((SFR_UTMIHSTRIM_SLOPE0_Msk & ((value) << SFR_UTMIHSTRIM_SLOPE0_Pos))) +#define SFR_UTMIHSTRIM_SLOPE1_Pos 12 +#define SFR_UTMIHSTRIM_SLOPE1_Msk (0x7u << SFR_UTMIHSTRIM_SLOPE1_Pos) /**< \brief (SFR_UTMIHSTRIM) UTMI HS PORTx Transceiver Slope Trimming */ +#define SFR_UTMIHSTRIM_SLOPE1(value) ((SFR_UTMIHSTRIM_SLOPE1_Msk & ((value) << SFR_UTMIHSTRIM_SLOPE1_Pos))) +#define SFR_UTMIHSTRIM_SLOPE2_Pos 16 +#define SFR_UTMIHSTRIM_SLOPE2_Msk (0x7u << SFR_UTMIHSTRIM_SLOPE2_Pos) /**< \brief (SFR_UTMIHSTRIM) UTMI HS PORTx Transceiver Slope Trimming */ +#define SFR_UTMIHSTRIM_SLOPE2(value) ((SFR_UTMIHSTRIM_SLOPE2_Msk & ((value) << SFR_UTMIHSTRIM_SLOPE2_Pos))) +/* -------- SFR_UTMIFSTRIM : (SFR Offset: 0x38) UTMI Full Speed Trimming Register -------- */ +#define SFR_UTMIFSTRIM_RISE_Pos 0 +#define SFR_UTMIFSTRIM_RISE_Msk (0x7u << SFR_UTMIFSTRIM_RISE_Pos) /**< \brief (SFR_UTMIFSTRIM) FS Transceiver Output Rising Slope Trimming */ +#define SFR_UTMIFSTRIM_RISE(value) ((SFR_UTMIFSTRIM_RISE_Msk & ((value) << SFR_UTMIFSTRIM_RISE_Pos))) +#define SFR_UTMIFSTRIM_FALL_Pos 4 +#define SFR_UTMIFSTRIM_FALL_Msk (0x7u << SFR_UTMIFSTRIM_FALL_Pos) /**< \brief (SFR_UTMIFSTRIM) FS Transceiver Output Falling Slope Trimming */ +#define SFR_UTMIFSTRIM_FALL(value) ((SFR_UTMIFSTRIM_FALL_Msk & ((value) << SFR_UTMIFSTRIM_FALL_Pos))) +#define SFR_UTMIFSTRIM_XCVR_Pos 8 +#define SFR_UTMIFSTRIM_XCVR_Msk (0x3u << SFR_UTMIFSTRIM_XCVR_Pos) /**< \brief (SFR_UTMIFSTRIM) FS Transceiver Crossover Voltage Trimming */ +#define SFR_UTMIFSTRIM_XCVR(value) ((SFR_UTMIFSTRIM_XCVR_Msk & ((value) << SFR_UTMIFSTRIM_XCVR_Pos))) +#define SFR_UTMIFSTRIM_ZN_Pos 16 +#define SFR_UTMIFSTRIM_ZN_Msk (0x7u << SFR_UTMIFSTRIM_ZN_Pos) /**< \brief (SFR_UTMIFSTRIM) FS Transceiver NMOS Impedance Trimming */ +#define SFR_UTMIFSTRIM_ZN(value) ((SFR_UTMIFSTRIM_ZN_Msk & ((value) << SFR_UTMIFSTRIM_ZN_Pos))) +#define SFR_UTMIFSTRIM_ZP_Pos 20 +#define SFR_UTMIFSTRIM_ZP_Msk (0x7u << SFR_UTMIFSTRIM_ZP_Pos) /**< \brief (SFR_UTMIFSTRIM) FS Transceiver PMOS Impedance Trimming */ +#define SFR_UTMIFSTRIM_ZP(value) ((SFR_UTMIFSTRIM_ZP_Msk & ((value) << SFR_UTMIFSTRIM_ZP_Pos))) +/* -------- SFR_UTMISWAP : (SFR Offset: 0x3C) UTMI DP/DM Pin Swapping Register -------- */ +#define SFR_UTMISWAP_PORT0 (0x1u << 0) /**< \brief (SFR_UTMISWAP) PORT 0 DP/DM Pin Swapping */ +#define SFR_UTMISWAP_PORT0_NORMAL (0x0u << 0) /**< \brief (SFR_UTMISWAP) DP/DM normal pinout. */ +#define SFR_UTMISWAP_PORT0_SWAPPED (0x1u << 0) /**< \brief (SFR_UTMISWAP) DP/DM swapped pinout. */ +#define SFR_UTMISWAP_PORT1 (0x1u << 1) /**< \brief (SFR_UTMISWAP) PORT 1 DP/DM Pin Swapping */ +#define SFR_UTMISWAP_PORT1_NORMAL (0x0u << 1) /**< \brief (SFR_UTMISWAP) DP/DM normal pinout. */ +#define SFR_UTMISWAP_PORT1_SWAPPED (0x1u << 1) /**< \brief (SFR_UTMISWAP) DP/DM swapped pinout. */ +#define SFR_UTMISWAP_PORT2 (0x1u << 2) /**< \brief (SFR_UTMISWAP) PORT 2 DP/DM Pin Swapping */ +#define SFR_UTMISWAP_PORT2_NORMAL (0x0u << 2) /**< \brief (SFR_UTMISWAP) DP/DM normal pinout. */ +#define SFR_UTMISWAP_PORT2_SWAPPED (0x1u << 2) /**< \brief (SFR_UTMISWAP) DP/DM swapped pinout. */ +/* -------- SFR_EBICFG : (SFR Offset: 0x40) EBI Configuration Register -------- */ +#define SFR_EBICFG_DRIVE0_Pos 0 +#define SFR_EBICFG_DRIVE0_Msk (0x3u << SFR_EBICFG_DRIVE0_Pos) /**< \brief (SFR_EBICFG) EBI Pins Drive Level */ +#define SFR_EBICFG_DRIVE0(value) ((SFR_EBICFG_DRIVE0_Msk & ((value) << SFR_EBICFG_DRIVE0_Pos))) +#define SFR_EBICFG_DRIVE0_LOW (0x0u << 0) /**< \brief (SFR_EBICFG) Low drive level */ +#define SFR_EBICFG_DRIVE0_MEDIUM (0x2u << 0) /**< \brief (SFR_EBICFG) Medium drive level */ +#define SFR_EBICFG_DRIVE0_HIGH (0x3u << 0) /**< \brief (SFR_EBICFG) High drive level */ +#define SFR_EBICFG_PULL0_Pos 2 +#define SFR_EBICFG_PULL0_Msk (0x3u << SFR_EBICFG_PULL0_Pos) /**< \brief (SFR_EBICFG) EBI Pins Pull Value */ +#define SFR_EBICFG_PULL0(value) ((SFR_EBICFG_PULL0_Msk & ((value) << SFR_EBICFG_PULL0_Pos))) +#define SFR_EBICFG_PULL0_UP (0x0u << 2) /**< \brief (SFR_EBICFG) Pull-up */ +#define SFR_EBICFG_PULL0_NONE (0x1u << 2) /**< \brief (SFR_EBICFG) No Pull */ +#define SFR_EBICFG_PULL0_DOWN (0x3u << 2) /**< \brief (SFR_EBICFG) Pull-down */ +#define SFR_EBICFG_SCH0 (0x1u << 4) /**< \brief (SFR_EBICFG) EBI Pins Schmitt Trigger */ +#define SFR_EBICFG_DRIVE1_Pos 8 +#define SFR_EBICFG_DRIVE1_Msk (0x3u << SFR_EBICFG_DRIVE1_Pos) /**< \brief (SFR_EBICFG) EBI Pins Drive Level */ +#define SFR_EBICFG_DRIVE1(value) ((SFR_EBICFG_DRIVE1_Msk & ((value) << SFR_EBICFG_DRIVE1_Pos))) +#define SFR_EBICFG_DRIVE1_LOW (0x0u << 8) /**< \brief (SFR_EBICFG) Low drive level */ +#define SFR_EBICFG_DRIVE1_MEDIUM (0x2u << 8) /**< \brief (SFR_EBICFG) Medium drive level */ +#define SFR_EBICFG_DRIVE1_HIGH (0x3u << 8) /**< \brief (SFR_EBICFG) High drive level */ +#define SFR_EBICFG_PULL1_Pos 10 +#define SFR_EBICFG_PULL1_Msk (0x3u << SFR_EBICFG_PULL1_Pos) /**< \brief (SFR_EBICFG) EBI Pins Pull Value */ +#define SFR_EBICFG_PULL1(value) ((SFR_EBICFG_PULL1_Msk & ((value) << SFR_EBICFG_PULL1_Pos))) +#define SFR_EBICFG_PULL1_UP (0x0u << 10) /**< \brief (SFR_EBICFG) Pull-up */ +#define SFR_EBICFG_PULL1_NONE (0x1u << 10) /**< \brief (SFR_EBICFG) No Pull */ +#define SFR_EBICFG_PULL1_DOWN (0x3u << 10) /**< \brief (SFR_EBICFG) Pull-down */ +#define SFR_EBICFG_SCH1 (0x1u << 12) /**< \brief (SFR_EBICFG) EBI Pins Schmitt Trigger */ +/* -------- SFR_CAN : (SFR Offset: 0x48) CAN Memories Address-based Register -------- */ +#define SFR_CAN_EXT_MEM_CAN0_ADDR_Pos 0 +#define SFR_CAN_EXT_MEM_CAN0_ADDR_Msk (0xffffu << SFR_CAN_EXT_MEM_CAN0_ADDR_Pos) /**< \brief (SFR_CAN) MSB CAN0 DMA Base Address */ +#define SFR_CAN_EXT_MEM_CAN0_ADDR(value) ((SFR_CAN_EXT_MEM_CAN0_ADDR_Msk & ((value) << SFR_CAN_EXT_MEM_CAN0_ADDR_Pos))) +#define SFR_CAN_EXT_MEM_CAN1_ADDR_Pos 16 +#define SFR_CAN_EXT_MEM_CAN1_ADDR_Msk (0xffffu << SFR_CAN_EXT_MEM_CAN1_ADDR_Pos) /**< \brief (SFR_CAN) MSB CAN1 DMA Base Address */ +#define SFR_CAN_EXT_MEM_CAN1_ADDR(value) ((SFR_CAN_EXT_MEM_CAN1_ADDR_Msk & ((value) << SFR_CAN_EXT_MEM_CAN1_ADDR_Pos))) +/* -------- SFR_SN0 : (SFR Offset: 0x4C) Serial Number 0 Register -------- */ +#define SFR_SN0_SN0_Pos 0 +#define SFR_SN0_SN0_Msk (0xffffffffu << SFR_SN0_SN0_Pos) /**< \brief (SFR_SN0) Serial Number 0 */ +/* -------- SFR_SN1 : (SFR Offset: 0x50) Serial Number 1 Register -------- */ +#define SFR_SN1_SN1_Pos 0 +#define SFR_SN1_SN1_Msk (0xffffffffu << SFR_SN1_SN1_Pos) /**< \brief (SFR_SN1) Serial Number 1 */ +/* -------- SFR_AICREDIR : (SFR Offset: 0x54) AIC interrupt Redirection Register -------- */ +#define SFR_AICREDIR_NSAIC (0x1u << 0) /**< \brief (SFR_AICREDIR) Interrupt redirection to Non-Secure AIC */ +#define SFR_AICREDIR_AICREDIRKEY_Pos 1 +#define SFR_AICREDIR_AICREDIRKEY_Msk (0x7fffffffu << SFR_AICREDIR_AICREDIRKEY_Pos) /**< \brief (SFR_AICREDIR) Unlock Key */ +#define SFR_AICREDIR_AICREDIRKEY(value) ((SFR_AICREDIR_AICREDIRKEY_Msk & ((value) << SFR_AICREDIR_AICREDIRKEY_Pos))) +/* -------- SFR_L2CC_HRAMC : (SFR Offset: 0x58) L2CC_HRAMC1 -------- */ +#define SFR_L2CC_HRAMC_SRAM_SEL (0x1u << 0) /**< \brief (SFR_L2CC_HRAMC) SRAM Selector */ +/* -------- SFR_I2SCLKSEL : (SFR Offset: 0x90) I2SC Register -------- */ +#define SFR_I2SCLKSEL_CLKSEL0 (0x1u << 0) /**< \brief (SFR_I2SCLKSEL) Clock Selection 0 */ +#define SFR_I2SCLKSEL_CLKSEL1 (0x1u << 1) /**< \brief (SFR_I2SCLKSEL) Clock Selection 1 */ +/* -------- QSPICLK_REG : (SFR Offset: 0x94) QSPI Clock Pad Supply Select Register -------- */ +#define QSPICLK_REG_SUP_SEL (0x1u << 0) /**< \brief (QSPICLK_REG) Supply Selection */ + +/*@}*/ + + +#endif /* _SAMA5D2_SFR_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfrbu.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfrbu.h new file mode 100644 index 000000000..e93e1f9d5 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sfrbu.h @@ -0,0 +1,59 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SFRBU_COMPONENT_ +#define _SAMA5D2_SFRBU_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Special Function Registers */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SFRBU Special Function Registers */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Sfrbu hardware registers */ +typedef struct { + __IO uint32_t SFRBU_PSWBUCTRL; /**< \brief (Sfrbu Offset: 0x00) Power Switch BU Control Register */ + __IO uint32_t SFRBU_TSRANGECFG;/**< \brief (Sfrbu Offset: 0x04) TS Range Configuration Register */ + __I uint32_t Reserved1[2]; + __IO uint32_t SFRBU_DDRBUMCR; /**< \brief (Sfrbu Offset: 0x10) DDR BU Mode Control Register */ + __IO uint32_t SFRBU_RXLPPUCR; /**< \brief (Sfrbu Offset: 0x14) RXLP Pull-Up Control Register */ +} Sfrbu; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- SFRBU_DDRBUMCR : (Sfrbu Offset: 0x10) DDR BU Mode Control Register -------- */ +/* This bit is used to isolate the DDR Pads from the CPU domain (VCCCORE). + * It has to be set after enabling the Self-refresh mode on the DDR memory + * and before doing power-down on VCCCORE + */ +#define SFRBU_DDRBUMCR_BUMEN (0x1<<0) /**< \brief (SFRBU_DDRBUMCR) DDR BU Mode Enable */ + +/*@}*/ + +#endif /* _SAMA5D2_SFRBU_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sha.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sha.h new file mode 100644 index 000000000..2bd3eff18 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_sha.h @@ -0,0 +1,147 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SHA_COMPONENT_ +#define _SAMA5D2_SHA_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Secure Hash Algorithm */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SHA Secure Hash Algorithm */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Sha hardware registers */ +typedef struct { + __O uint32_t SHA_CR; /**< \brief (Sha Offset: 0x00) Control Register */ + __IO uint32_t SHA_MR; /**< \brief (Sha Offset: 0x04) Mode Register */ + __I uint32_t Reserved1[2]; + __O uint32_t SHA_IER; /**< \brief (Sha Offset: 0x10) Interrupt Enable Register */ + __O uint32_t SHA_IDR; /**< \brief (Sha Offset: 0x14) Interrupt Disable Register */ + __I uint32_t SHA_IMR; /**< \brief (Sha Offset: 0x18) Interrupt Mask Register */ + __I uint32_t SHA_ISR; /**< \brief (Sha Offset: 0x1C) Interrupt Status Register */ + __IO uint32_t SHA_MSR; /**< \brief (Sha Offset: 0x20) Message Size Register */ + __I uint32_t Reserved2[3]; + __IO uint32_t SHA_BCR; /**< \brief (Sha Offset: 0x30) Bytes Count Register */ + __I uint32_t Reserved3[3]; + __O uint32_t SHA_IDATAR[16]; /**< \brief (Sha Offset: 0x40) Input Data 0 Register */ + __IO uint32_t SHA_IODATAR[16]; /**< \brief (Sha Offset: 0x80) Input/Output Data 0 Register */ + __I uint32_t SHA_VERSION; /**< \brief (Sha Offset: 0xFC) Version Register */ +} Sha; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SHA_CR : (SHA Offset: 0x00) Control Register -------- */ +#define SHA_CR_START (0x1u << 0) /**< \brief (SHA_CR) Start Processing */ +#define SHA_CR_FIRST (0x1u << 4) /**< \brief (SHA_CR) First Block of a Message */ +#define SHA_CR_SWRST (0x1u << 8) /**< \brief (SHA_CR) Software Reset */ +#define SHA_CR_WUIHV (0x1u << 12) /**< \brief (SHA_CR) Write User Initial Hash Values */ +#define SHA_CR_WUIEHV (0x1u << 13) /**< \brief (SHA_CR) Write User Initial or Expected Hash Values */ +/* -------- SHA_MR : (SHA Offset: 0x04) Mode Register -------- */ +#define SHA_MR_SMOD_Pos 0 +#define SHA_MR_SMOD_Msk (0x3u << SHA_MR_SMOD_Pos) /**< \brief (SHA_MR) Start Mode */ +#define SHA_MR_SMOD(value) ((SHA_MR_SMOD_Msk & ((value) << SHA_MR_SMOD_Pos))) +#define SHA_MR_SMOD_MANUAL_START (0x0u << 0) /**< \brief (SHA_MR) Manual Mode */ +#define SHA_MR_SMOD_AUTO_START (0x1u << 0) /**< \brief (SHA_MR) Auto Mode */ +#define SHA_MR_SMOD_IDATAR0_START (0x2u << 0) /**< \brief (SHA_MR) SHA_IDATAR0 access only Auto Mode */ +#define SHA_MR_PROCDLY (0x1u << 4) /**< \brief (SHA_MR) Processing Delay */ +#define SHA_MR_PROCDLY_SHORTEST (0x0u << 4) /**< \brief (SHA_MR) SHA processing runtime is the shortest one */ +#define SHA_MR_PROCDLY_LONGEST (0x1u << 4) /**< \brief (SHA_MR) SHA processing runtime is the longest one (reduces the SHA bandwidth requirement, reduces the system bus overload) */ +#define SHA_MR_UIHV (0x1u << 5) /**< \brief (SHA_MR) User Initial Hash Value Registers */ +#define SHA_MR_UIEHV (0x1u << 6) /**< \brief (SHA_MR) User Initial or Expected Hash Value Registers */ +#define SHA_MR_ALGO_Pos 8 +#define SHA_MR_ALGO_Msk (0xfu << SHA_MR_ALGO_Pos) /**< \brief (SHA_MR) SHA Algorithm */ +#define SHA_MR_ALGO(value) ((SHA_MR_ALGO_Msk & ((value) << SHA_MR_ALGO_Pos))) +#define SHA_MR_ALGO_SHA1 (0x0u << 8) /**< \brief (SHA_MR) SHA1 algorithm processed */ +#define SHA_MR_ALGO_SHA256 (0x1u << 8) /**< \brief (SHA_MR) SHA256 algorithm processed */ +#define SHA_MR_ALGO_SHA384 (0x2u << 8) /**< \brief (SHA_MR) SHA384 algorithm processed */ +#define SHA_MR_ALGO_SHA512 (0x3u << 8) /**< \brief (SHA_MR) SHA512 algorithm processed */ +#define SHA_MR_ALGO_SHA224 (0x4u << 8) /**< \brief (SHA_MR) SHA224 algorithm processed */ +#define SHA_MR_ALGO_HMAC_SHA1 (0x8u << 8) /**< \brief (SHA_MR) HMAC algorithm with SHA1 Hash processed */ +#define SHA_MR_ALGO_HMAC_SHA256 (0x9u << 8) /**< \brief (SHA_MR) HMAC algorithm with SHA256 Hash processed */ +#define SHA_MR_ALGO_HMAC_SHA384 (0xAu << 8) /**< \brief (SHA_MR) HMAC algorithm with SHA384 Hash processed */ +#define SHA_MR_ALGO_HMAC_SHA512 (0xBu << 8) /**< \brief (SHA_MR) HMAC algorithm with SHA512 Hash processed */ +#define SHA_MR_ALGO_HMAC_SHA224 (0xCu << 8) /**< \brief (SHA_MR) HMAC algorithm with SHA224 Hash processed */ +#define SHA_MR_DUALBUFF (0x1u << 16) /**< \brief (SHA_MR) Dual Input Buffer */ +#define SHA_MR_DUALBUFF_INACTIVE (0x0u << 16) /**< \brief (SHA_MR) SHA_IDATARx and SHA_IODATARx cannot be written during processing of previous block. */ +#define SHA_MR_DUALBUFF_ACTIVE (0x1u << 16) /**< \brief (SHA_MR) SHA_IDATARx and SHA_IODATARx can be written during processing of previous block when SMOD value = 2. It speeds up the overall runtime of large files. */ +#define SHA_MR_CHECK_Pos 24 +#define SHA_MR_CHECK_Msk (0x3u << SHA_MR_CHECK_Pos) /**< \brief (SHA_MR) Hash Check */ +#define SHA_MR_CHECK(value) ((SHA_MR_CHECK_Msk & ((value) << SHA_MR_CHECK_Pos))) +#define SHA_MR_CHECK_NO_CHECK (0x0u << 24) /**< \brief (SHA_MR) No check is performed */ +#define SHA_MR_CHECK_CHECK_EHV (0x1u << 24) /**< \brief (SHA_MR) Check is performed with expected hash stored in internal expected hash value registers. */ +#define SHA_MR_CHECK_CHECK_MESSAGE (0x2u << 24) /**< \brief (SHA_MR) Check is performed with expected hash provided after the message. */ +#define SHA_MR_CHKCNT_Pos 28 +#define SHA_MR_CHKCNT_Msk (0xfu << SHA_MR_CHKCNT_Pos) /**< \brief (SHA_MR) Check Counter */ +#define SHA_MR_CHKCNT(value) ((SHA_MR_CHKCNT_Msk & ((value) << SHA_MR_CHKCNT_Pos))) +/* -------- SHA_IER : (SHA Offset: 0x10) Interrupt Enable Register -------- */ +#define SHA_IER_DATRDY (0x1u << 0) /**< \brief (SHA_IER) Data Ready Interrupt Enable */ +#define SHA_IER_URAD (0x1u << 8) /**< \brief (SHA_IER) Unspecified Register Access Detection Interrupt Enable */ +#define SHA_IER_CHECKF (0x1u << 16) /**< \brief (SHA_IER) Check Done Interrupt Enable */ +/* -------- SHA_IDR : (SHA Offset: 0x14) Interrupt Disable Register -------- */ +#define SHA_IDR_DATRDY (0x1u << 0) /**< \brief (SHA_IDR) Data Ready Interrupt Disable */ +#define SHA_IDR_URAD (0x1u << 8) /**< \brief (SHA_IDR) Unspecified Register Access Detection Interrupt Disable */ +#define SHA_IDR_CHECKF (0x1u << 16) /**< \brief (SHA_IDR) Check Done Interrupt Disable */ +/* -------- SHA_IMR : (SHA Offset: 0x18) Interrupt Mask Register -------- */ +#define SHA_IMR_DATRDY (0x1u << 0) /**< \brief (SHA_IMR) Data Ready Interrupt Mask */ +#define SHA_IMR_URAD (0x1u << 8) /**< \brief (SHA_IMR) Unspecified Register Access Detection Interrupt Mask */ +#define SHA_IMR_CHECKF (0x1u << 16) /**< \brief (SHA_IMR) Check Done Interrupt Mask */ +/* -------- SHA_ISR : (SHA Offset: 0x1C) Interrupt Status Register -------- */ +#define SHA_ISR_DATRDY (0x1u << 0) /**< \brief (SHA_ISR) Data Ready (cleared by writing a 1 to bit SWRST or START in SHA_CR, or by reading SHA_IODATARx) */ +#define SHA_ISR_WRDY (0x1u << 4) /**< \brief (SHA_ISR) Input Data Register Write Ready */ +#define SHA_ISR_URAD (0x1u << 8) /**< \brief (SHA_ISR) Unspecified Register Access Detection Status (cleared by writing a 1 to SWRST bit in SHA_CR) */ +#define SHA_ISR_URAT_Pos 12 +#define SHA_ISR_URAT_Msk (0x7u << SHA_ISR_URAT_Pos) /**< \brief (SHA_ISR) Unspecified Register Access Type (cleared by writing a 1 to SWRST bit in SHA_CR) */ +#define SHA_ISR_CHECKF (0x1u << 16) /**< \brief (SHA_ISR) Check Done Status (cleared by writing START or SWRST bits in SHA_CR or by reading SHA_IODATARx) */ +#define SHA_ISR_CHKST_Pos 20 +#define SHA_ISR_CHKST_Msk (0xfu << SHA_ISR_CHKST_Pos) /**< \brief (SHA_ISR) Check Status (cleared by writing START or SWRST bits in SHA_CR or by reading SHA_IODATARx) */ +/* -------- SHA_MSR : (SHA Offset: 0x20) Message Size Register -------- */ +#define SHA_MSR_MSGSIZE_Pos 0 +#define SHA_MSR_MSGSIZE_Msk (0xffffffffu << SHA_MSR_MSGSIZE_Pos) /**< \brief (SHA_MSR) Message Size */ +#define SHA_MSR_MSGSIZE(value) ((SHA_MSR_MSGSIZE_Msk & ((value) << SHA_MSR_MSGSIZE_Pos))) +/* -------- SHA_BCR : (SHA Offset: 0x30) Bytes Count Register -------- */ +#define SHA_BCR_BYTCNT_Pos 0 +#define SHA_BCR_BYTCNT_Msk (0xffffffffu << SHA_BCR_BYTCNT_Pos) /**< \brief (SHA_BCR) Remaining Byte Count Before Auto Padding */ +#define SHA_BCR_BYTCNT(value) ((SHA_BCR_BYTCNT_Msk & ((value) << SHA_BCR_BYTCNT_Pos))) +/* -------- SHA_IDATAR[16] : (SHA Offset: 0x40) Input Data 0 Register -------- */ +#define SHA_IDATAR_IDATA_Pos 0 +#define SHA_IDATAR_IDATA_Msk (0xffffffffu << SHA_IDATAR_IDATA_Pos) /**< \brief (SHA_IDATAR[16]) Input Data */ +#define SHA_IDATAR_IDATA(value) ((SHA_IDATAR_IDATA_Msk & ((value) << SHA_IDATAR_IDATA_Pos))) +/* -------- SHA_IODATAR[16] : (SHA Offset: 0x80) Input/Output Data 0 Register -------- */ +#define SHA_IODATAR_IODATA_Pos 0 +#define SHA_IODATAR_IODATA_Msk (0xffffffffu << SHA_IODATAR_IODATA_Pos) /**< \brief (SHA_IODATAR[16]) Input/Output Data */ +#define SHA_IODATAR_IODATA(value) ((SHA_IODATAR_IODATA_Msk & ((value) << SHA_IODATAR_IODATA_Pos))) +/* -------- SHA_VERSION : (SHA Offset: 0xFC) Version Register -------- */ +#define SHA_VERSION_VERSION_Pos 0 +#define SHA_VERSION_VERSION_Msk (0xfffu << SHA_VERSION_VERSION_Pos) /**< \brief (SHA_VERSION) Version of the Hardware Module */ +#define SHA_VERSION_MFN_Pos 16 +#define SHA_VERSION_MFN_Msk (0x7u << SHA_VERSION_MFN_Pos) /**< \brief (SHA_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_SHA_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_shdwc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_shdwc.h new file mode 100644 index 000000000..b2b0a746c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_shdwc.h @@ -0,0 +1,177 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SHDWC_COMPONENT_ +#define _SAMA5D2_SHDWC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Shutdown Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SHDWC Shutdown Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Shdwc hardware registers */ +typedef struct { + __O uint32_t SHDW_CR; /**< \brief (Shdwc Offset: 0x00) Shutdown Control Register */ + __IO uint32_t SHDW_MR; /**< \brief (Shdwc Offset: 0x04) Shutdown Mode Register */ + __I uint32_t SHDW_SR; /**< \brief (Shdwc Offset: 0x08) Shutdown Status Register */ + __IO uint32_t SHDW_WUIR; /**< \brief (Shdwc Offset: 0x0C) Shutdown Wake-up Inputs Register */ +} Shdwc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SHDW_CR : (SHDWC Offset: 0x00) Shutdown Control Register -------- */ +#define SHDW_CR_SHDW (0x1u << 0) /**< \brief (SHDW_CR) Shutdown Command */ +#define SHDW_CR_KEY_Pos 24 +#define SHDW_CR_KEY_Msk (0xffu << SHDW_CR_KEY_Pos) /**< \brief (SHDW_CR) Password */ +#define SHDW_CR_KEY(value) ((SHDW_CR_KEY_Msk & ((value) << SHDW_CR_KEY_Pos))) +#define SHDW_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (SHDW_CR) Writing any other value in this field aborts the write operation. */ +/* -------- SHDW_MR : (SHDWC Offset: 0x04) Shutdown Mode Register -------- */ +#define SHDW_MR_LPDBCEN0 (0x1u << 0) /**< \brief (SHDW_MR) Low-Power Debouncer Enable WKUP0 */ +#define SHDW_MR_LPDBCEN0_NOT_ENABLE (0x0u << 0) /**< \brief (SHDW_MR) The WKUP0 input pin is not connected to the low-power debouncer. */ +#define SHDW_MR_LPDBCEN0_ENABLE (0x1u << 0) /**< \brief (SHDW_MR) The WKUP0 input pin is connected to the low-power debouncer and can force a system wake-up. */ +#define SHDW_MR_LPDBCEN1 (0x1u << 1) /**< \brief (SHDW_MR) Low-Power Debouncer Enable WKUP1 */ +#define SHDW_MR_LPDBCEN1_NOT_ENABLE (0x0u << 1) /**< \brief (SHDW_MR) The WKUP1 input pin is not connected to the low-power debouncer. */ +#define SHDW_MR_LPDBCEN1_ENABLE (0x1u << 1) /**< \brief (SHDW_MR) The WKUP1 input pin is connected to the low-power debouncer and can force a system wake-up. */ +#define SHDW_MR_LPDBC_Pos 8 +#define SHDW_MR_LPDBC_Msk (0x7u << SHDW_MR_LPDBC_Pos) /**< \brief (SHDW_MR) Low Power Debouncer Period */ +#define SHDW_MR_LPDBC(value) ((SHDW_MR_LPDBC_Msk & ((value) << SHDW_MR_LPDBC_Pos))) +#define SHDW_MR_LPDBC_DISABLE (0x0u << 8) /**< \brief (SHDW_MR) Disable the low-power debouncers */ +#define SHDW_MR_LPDBC_2_RTCOUT0 (0x1u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 2 RTCOUT0 periods */ +#define SHDW_MR_LPDBC_3_RTCOUT0 (0x2u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 3 RTCOUT0 periods */ +#define SHDW_MR_LPDBC_4_RTCOUT0 (0x3u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 4 RTCOUT0 periods */ +#define SHDW_MR_LPDBC_5_RTCOUT0 (0x4u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 5 RTCOUT0 periods */ +#define SHDW_MR_LPDBC_6_RTCOUT0 (0x5u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 6 RTCOUT0 periods */ +#define SHDW_MR_LPDBC_7_RTCOUT0 (0x6u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 7 RTCOUT0 periods */ +#define SHDW_MR_LPDBC_8_RTCOUT0 (0x7u << 8) /**< \brief (SHDW_MR) WKUP0/1 in active state for at least 8 RTCOUT0 periods */ +#define SHDW_MR_RTTWKEN (0x1u << 16) /**< \brief (SHDW_MR) */ +#define SHDW_MR_RTCWKEN (0x1u << 17) /**< \brief (SHDW_MR) Analog Comparator Controller Wake-up Enable */ +#define SHDW_MR_ACCWKEN (0x1u << 18) /**< \brief (SHDW_MR) Analog Comparator Controller Wake-up Enable */ +#define SHDW_MR_RXLPWKEN (0x1u << 19) /**< \brief (SHDW_MR) Debug Unit Wake-up Enable */ +#define SHDW_MR_WKUPDBC_Pos 24 +#define SHDW_MR_WKUPDBC_Msk (0x7u << SHDW_MR_WKUPDBC_Pos) /**< \brief (SHDW_MR) Wake-up Inputs Debouncer Period */ +#define SHDW_MR_WKUPDBC(value) ((SHDW_MR_WKUPDBC_Msk & ((value) << SHDW_MR_WKUPDBC_Pos))) +#define SHDW_MR_WKUPDBC_IMMEDIATE (0x0u << 24) /**< \brief (SHDW_MR) Immediate, no debouncing, detected active at least on one Slow Clock edge */ +#define SHDW_MR_WKUPDBC_3_SLCK (0x1u << 24) /**< \brief (SHDW_MR) WKUPx shall be in its active state for at least 3 SLCK periods */ +#define SHDW_MR_WKUPDBC_32_SLCK (0x2u << 24) /**< \brief (SHDW_MR) WKUPx shall be in its active state for at least 32 SLCK periods */ +#define SHDW_MR_WKUPDBC_512_SLCK (0x3u << 24) /**< \brief (SHDW_MR) WKUPx shall be in its active state for at least 512 SLCK periods */ +#define SHDW_MR_WKUPDBC_4096_SLCK (0x4u << 24) /**< \brief (SHDW_MR) WKUPx shall be in its active state for at least 4,096 SLCK periods */ +#define SHDW_MR_WKUPDBC_32768_SLCK (0x5u << 24) /**< \brief (SHDW_MR) WKUPx shall be in its active state for at least 32,768 SLCK periods */ +/* -------- SHDW_SR : (SHDWC Offset: 0x08) Shutdown Status Register -------- */ +#define SHDW_SR_WKUPS (0x1u << 0) /**< \brief (SHDW_SR) WKUP Wake-up Status */ +#define SHDW_SR_WKUPS_NO (0x0u << 0) /**< \brief (SHDW_SR) No wake-up due to the assertion of the WKUP pins has occurred since the last read of SUPC_SR. */ +#define SHDW_SR_WKUPS_PRESENT (0x1u << 0) /**< \brief (SHDW_SR) At least one wake-up due to the assertion of the WKUP pins has occurred since the last read of SUPC_SR. */ +#define SHDW_SR_ACCWK (0x1u << 6) /**< \brief (SHDW_SR) Analog Comparator Controller Wake-up */ +#define SHDW_SR_RXLPWK (0x1u << 7) /**< \brief (SHDW_SR) Debug Unit Wake-up */ +#define SHDW_SR_WKUPIS0 (0x1u << 16) /**< \brief (SHDW_SR) Wake-up 0 Input Status */ +#define SHDW_SR_WKUPIS0_DISABLE (0x0u << 16) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS0_ENABLE (0x1u << 16) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS1 (0x1u << 17) /**< \brief (SHDW_SR) Wake-up 1 Input Status */ +#define SHDW_SR_WKUPIS1_DISABLE (0x0u << 17) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS1_ENABLE (0x1u << 17) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS2 (0x1u << 18) /**< \brief (SHDW_SR) Wake-up 2 Input Status */ +#define SHDW_SR_WKUPIS2_DISABLE (0x0u << 18) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS2_ENABLE (0x1u << 18) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS3 (0x1u << 19) /**< \brief (SHDW_SR) Wake-up 3 Input Status */ +#define SHDW_SR_WKUPIS3_DISABLE (0x0u << 19) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS3_ENABLE (0x1u << 19) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS4 (0x1u << 20) /**< \brief (SHDW_SR) Wake-up 4 Input Status */ +#define SHDW_SR_WKUPIS4_DISABLE (0x0u << 20) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS4_ENABLE (0x1u << 20) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS5 (0x1u << 21) /**< \brief (SHDW_SR) Wake-up 5 Input Status */ +#define SHDW_SR_WKUPIS5_DISABLE (0x0u << 21) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS5_ENABLE (0x1u << 21) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS6 (0x1u << 22) /**< \brief (SHDW_SR) Wake-up 6 Input Status */ +#define SHDW_SR_WKUPIS6_DISABLE (0x0u << 22) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS6_ENABLE (0x1u << 22) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS7 (0x1u << 23) /**< \brief (SHDW_SR) Wake-up 7 Input Status */ +#define SHDW_SR_WKUPIS7_DISABLE (0x0u << 23) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS7_ENABLE (0x1u << 23) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS8 (0x1u << 24) /**< \brief (SHDW_SR) Wake-up 8 Input Status */ +#define SHDW_SR_WKUPIS8_DISABLE (0x0u << 24) /**< \brief (SHDW_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ +#define SHDW_SR_WKUPIS8_ENABLE (0x1u << 24) /**< \brief (SHDW_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event. */ +/* -------- SHDW_WUIR : (SHDWC Offset: 0x0C) Shutdown Wake-up Inputs Register -------- */ +#define SHDW_WUIR_WKUPEN0 (0x1u << 0) /**< \brief (SHDW_WUIR) Wake-up 0 Input Enable */ +#define SHDW_WUIR_WKUPEN0_DISABLE (0x0u << 0) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN0_ENABLE (0x1u << 0) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN1 (0x1u << 1) /**< \brief (SHDW_WUIR) Wake-up 1 Input Enable */ +#define SHDW_WUIR_WKUPEN1_DISABLE (0x0u << 1) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN1_ENABLE (0x1u << 1) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN2 (0x1u << 2) /**< \brief (SHDW_WUIR) Wake-up 2 Input Enable */ +#define SHDW_WUIR_WKUPEN2_DISABLE (0x0u << 2) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN2_ENABLE (0x1u << 2) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN3 (0x1u << 3) /**< \brief (SHDW_WUIR) Wake-up 3 Input Enable */ +#define SHDW_WUIR_WKUPEN3_DISABLE (0x0u << 3) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN3_ENABLE (0x1u << 3) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN4 (0x1u << 4) /**< \brief (SHDW_WUIR) Wake-up 4 Input Enable */ +#define SHDW_WUIR_WKUPEN4_DISABLE (0x0u << 4) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN4_ENABLE (0x1u << 4) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN5 (0x1u << 5) /**< \brief (SHDW_WUIR) Wake-up 5 Input Enable */ +#define SHDW_WUIR_WKUPEN5_DISABLE (0x0u << 5) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN5_ENABLE (0x1u << 5) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN6 (0x1u << 6) /**< \brief (SHDW_WUIR) Wake-up 6 Input Enable */ +#define SHDW_WUIR_WKUPEN6_DISABLE (0x0u << 6) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN6_ENABLE (0x1u << 6) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN7 (0x1u << 7) /**< \brief (SHDW_WUIR) Wake-up 7 Input Enable */ +#define SHDW_WUIR_WKUPEN7_DISABLE (0x0u << 7) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN7_ENABLE (0x1u << 7) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPEN8 (0x1u << 8) /**< \brief (SHDW_WUIR) Wake-up 8 Input Enable */ +#define SHDW_WUIR_WKUPEN8_DISABLE (0x0u << 8) /**< \brief (SHDW_WUIR) The corresponding wake-up input has no wake-up effect. */ +#define SHDW_WUIR_WKUPEN8_ENABLE (0x1u << 8) /**< \brief (SHDW_WUIR) The corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT0 (0x1u << 16) /**< \brief (SHDW_WUIR) Wake-up 0 Input Type */ +#define SHDW_WUIR_WKUPT0_LOW (0x0u << 16) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT0_HIGH (0x1u << 16) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT1 (0x1u << 17) /**< \brief (SHDW_WUIR) Wake-up 1 Input Type */ +#define SHDW_WUIR_WKUPT1_LOW (0x0u << 17) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT1_HIGH (0x1u << 17) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT2 (0x1u << 18) /**< \brief (SHDW_WUIR) Wake-up 2 Input Type */ +#define SHDW_WUIR_WKUPT2_LOW (0x0u << 18) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT2_HIGH (0x1u << 18) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT3 (0x1u << 19) /**< \brief (SHDW_WUIR) Wake-up 3 Input Type */ +#define SHDW_WUIR_WKUPT3_LOW (0x0u << 19) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT3_HIGH (0x1u << 19) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT4 (0x1u << 20) /**< \brief (SHDW_WUIR) Wake-up 4 Input Type */ +#define SHDW_WUIR_WKUPT4_LOW (0x0u << 20) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT4_HIGH (0x1u << 20) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT5 (0x1u << 21) /**< \brief (SHDW_WUIR) Wake-up 5 Input Type */ +#define SHDW_WUIR_WKUPT5_LOW (0x0u << 21) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT5_HIGH (0x1u << 21) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT6 (0x1u << 22) /**< \brief (SHDW_WUIR) Wake-up 6 Input Type */ +#define SHDW_WUIR_WKUPT6_LOW (0x0u << 22) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT6_HIGH (0x1u << 22) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT7 (0x1u << 23) /**< \brief (SHDW_WUIR) Wake-up 7 Input Type */ +#define SHDW_WUIR_WKUPT7_LOW (0x0u << 23) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT7_HIGH (0x1u << 23) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT8 (0x1u << 24) /**< \brief (SHDW_WUIR) Wake-up 8 Input Type */ +#define SHDW_WUIR_WKUPT8_LOW (0x0u << 24) /**< \brief (SHDW_WUIR) A falling edge followed by a low level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ +#define SHDW_WUIR_WKUPT8_HIGH (0x1u << 24) /**< \brief (SHDW_WUIR) A rising edge followed by a high level, for a period defined by WKUPDBC, on the corresponding wake-up input forces the wake-up of the core power supply. */ + +/*@}*/ + + +#endif /* _SAMA5D2_SHDWC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_smc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_smc.h new file mode 100644 index 000000000..57007ab9c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_smc.h @@ -0,0 +1,743 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SMC_COMPONENT_ +#define _SAMA5D2_SMC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Static Memory Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SMC Static Memory Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief SmcCs_number hardware registers */ +typedef struct { + __IO uint32_t HSMC_SETUP; /**< \brief (SmcCs_number Offset: 0x0) HSMC Setup Register */ + __IO uint32_t HSMC_PULSE; /**< \brief (SmcCs_number Offset: 0x4) HSMC Pulse Register */ + __IO uint32_t HSMC_CYCLE; /**< \brief (SmcCs_number Offset: 0x8) HSMC Cycle Register */ + __IO uint32_t HSMC_TIMINGS; /**< \brief (SmcCs_number Offset: 0xC) HSMC Timings Register */ + __IO uint32_t HSMC_MODE; /**< \brief (SmcCs_number Offset: 0x10) HSMC Mode Register */ +} SmcCs_number; +/** \brief SmcPmecc hardware registers */ +typedef struct { + __I uint32_t HSMC_PMECC[14]; /**< \brief (SmcPmecc Offset: 0x0) PMECC Redundancy x Register */ + __I uint32_t Reserved1[2]; +} SmcPmecc; +/** \brief SmcRem hardware registers */ +typedef struct { + __I uint32_t HSMC_REM0_; /**< \brief (SmcRem Offset: 0x0) PMECC Remainder 0 Register */ + __I uint32_t HSMC_REM1_; /**< \brief (SmcRem Offset: 0x4) PMECC Remainder 1 Register */ + __I uint32_t HSMC_REM2_; /**< \brief (SmcRem Offset: 0x8) PMECC Remainder 2 Register */ + __I uint32_t HSMC_REM3_; /**< \brief (SmcRem Offset: 0xC) PMECC Remainder 3 Register */ + __I uint32_t HSMC_REM4_; /**< \brief (SmcRem Offset: 0x10) PMECC Remainder 4 Register */ + __I uint32_t HSMC_REM5_; /**< \brief (SmcRem Offset: 0x14) PMECC Remainder 5 Register */ + __I uint32_t HSMC_REM6_; /**< \brief (SmcRem Offset: 0x18) PMECC Remainder 6 Register */ + __I uint32_t HSMC_REM7_; /**< \brief (SmcRem Offset: 0x1C) PMECC Remainder 7 Register */ + __I uint32_t HSMC_REM8_; /**< \brief (SmcRem Offset: 0x20) PMECC Remainder 8 Register */ + __I uint32_t HSMC_REM9_; /**< \brief (SmcRem Offset: 0x24) PMECC Remainder 9 Register */ + __I uint32_t HSMC_REM10_; /**< \brief (SmcRem Offset: 0x28) PMECC Remainder 10 Register */ + __I uint32_t HSMC_REM11_; /**< \brief (SmcRem Offset: 0x2C) PMECC Remainder 11 Register */ + __I uint32_t HSMC_REM12_; /**< \brief (SmcRem Offset: 0x30) PMECC Remainder 12 Register */ + __I uint32_t HSMC_REM13_; /**< \brief (SmcRem Offset: 0x34) PMECC Remainder 13 Register */ + __I uint32_t HSMC_REM14_; /**< \brief (SmcRem Offset: 0x38) PMECC Remainder 14 Register */ + __I uint32_t HSMC_REM15_; /**< \brief (SmcRem Offset: 0x3C) PMECC Remainder 15 Register */ +} SmcRem; +/** \brief Smc hardware registers */ +#define SMCPMECC_NUMBER 8 +#define SMCREM_NUMBER 8 +#define SMCCS_NUMBER_NUMBER 4 +typedef struct { + __IO uint32_t HSMC_CFG; /**< \brief (Smc Offset: 0x000) HSMC NFC Configuration Register */ + __O uint32_t HSMC_CTRL; /**< \brief (Smc Offset: 0x004) HSMC NFC Control Register */ + __I uint32_t HSMC_SR; /**< \brief (Smc Offset: 0x008) HSMC NFC Status Register */ + __O uint32_t HSMC_IER; /**< \brief (Smc Offset: 0x00C) HSMC NFC Interrupt Enable Register */ + __O uint32_t HSMC_IDR; /**< \brief (Smc Offset: 0x010) HSMC NFC Interrupt Disable Register */ + __I uint32_t HSMC_IMR; /**< \brief (Smc Offset: 0x014) HSMC NFC Interrupt Mask Register */ + __IO uint32_t HSMC_ADDR; /**< \brief (Smc Offset: 0x018) HSMC NFC Address Cycle Zero Register */ + __IO uint32_t HSMC_BANK; /**< \brief (Smc Offset: 0x01C) HSMC Bank Address Register */ + __I uint32_t Reserved1[20]; + __IO uint32_t HSMC_PMECCFG; /**< \brief (Smc Offset: 0x070) PMECC Configuration Register */ + __IO uint32_t HSMC_PMECCSAREA; /**< \brief (Smc Offset: 0x074) PMECC Spare Area Size Register */ + __IO uint32_t HSMC_PMECCSADDR; /**< \brief (Smc Offset: 0x078) PMECC Start Address Register */ + __IO uint32_t HSMC_PMECCEADDR; /**< \brief (Smc Offset: 0x07C) PMECC End Address Register */ + __I uint32_t Reserved2[1]; + __O uint32_t HSMC_PMECCTRL; /**< \brief (Smc Offset: 0x084) PMECC Control Register */ + __I uint32_t HSMC_PMECCSR; /**< \brief (Smc Offset: 0x088) PMECC Status Register */ + __O uint32_t HSMC_PMECCIER; /**< \brief (Smc Offset: 0x08C) PMECC Interrupt Enable register */ + __O uint32_t HSMC_PMECCIDR; /**< \brief (Smc Offset: 0x090) PMECC Interrupt Disable Register */ + __I uint32_t HSMC_PMECCIMR; /**< \brief (Smc Offset: 0x094) PMECC Interrupt Mask Register */ + __I uint32_t HSMC_PMECCISR; /**< \brief (Smc Offset: 0x098) PMECC Interrupt Status Register */ + __I uint32_t Reserved3[5]; + SmcPmecc SMC_PMECC[SMCPMECC_NUMBER]; /**< \brief (Smc Offset: 0xB0) sec_num = 0 .. 7 */ + SmcRem SMC_REM[SMCREM_NUMBER]; /**< \brief (Smc Offset: 0x2B0) sec_num = 0 .. 7 */ + __I uint32_t Reserved4[20]; + __IO uint32_t HSMC_ELCFG; /**< \brief (Smc Offset: 0x500) PMECC Error Location Configuration Register */ + __I uint32_t HSMC_ELPRIM; /**< \brief (Smc Offset: 0x504) PMECC Error Location Primitive Register */ + __O uint32_t HSMC_ELEN; /**< \brief (Smc Offset: 0x508) PMECC Error Location Enable Register */ + __O uint32_t HSMC_ELDIS; /**< \brief (Smc Offset: 0x50C) PMECC Error Location Disable Register */ + __I uint32_t HSMC_ELSR; /**< \brief (Smc Offset: 0x510) PMECC Error Location Status Register */ + __O uint32_t HSMC_ELIER; /**< \brief (Smc Offset: 0x514) PMECC Error Location Interrupt Enable register */ + __O uint32_t HSMC_ELIDR; /**< \brief (Smc Offset: 0x518) PMECC Error Location Interrupt Disable Register */ + __I uint32_t HSMC_ELIMR; /**< \brief (Smc Offset: 0x51C) PMECC Error Location Interrupt Mask Register */ + __I uint32_t HSMC_ELISR; /**< \brief (Smc Offset: 0x520) PMECC Error Location Interrupt Status Register */ + __I uint32_t Reserved5[1]; + __I uint32_t HSMC_SIGMA0; /**< \brief (Smc Offset: 0x528) PMECC Error Location SIGMA 0 Register */ + __IO uint32_t HSMC_SIGMA1; /**< \brief (Smc Offset: 0x52C) PMECC Error Location SIGMA 1 Register */ + __IO uint32_t HSMC_SIGMA2; /**< \brief (Smc Offset: 0x530) PMECC Error Location SIGMA 2 Register */ + __IO uint32_t HSMC_SIGMA3; /**< \brief (Smc Offset: 0x534) PMECC Error Location SIGMA 3 Register */ + __IO uint32_t HSMC_SIGMA4; /**< \brief (Smc Offset: 0x538) PMECC Error Location SIGMA 4 Register */ + __IO uint32_t HSMC_SIGMA5; /**< \brief (Smc Offset: 0x53C) PMECC Error Location SIGMA 5 Register */ + __IO uint32_t HSMC_SIGMA6; /**< \brief (Smc Offset: 0x540) PMECC Error Location SIGMA 6 Register */ + __IO uint32_t HSMC_SIGMA7; /**< \brief (Smc Offset: 0x544) PMECC Error Location SIGMA 7 Register */ + __IO uint32_t HSMC_SIGMA8; /**< \brief (Smc Offset: 0x548) PMECC Error Location SIGMA 8 Register */ + __IO uint32_t HSMC_SIGMA9; /**< \brief (Smc Offset: 0x54C) PMECC Error Location SIGMA 9 Register */ + __IO uint32_t HSMC_SIGMA10; /**< \brief (Smc Offset: 0x550) PMECC Error Location SIGMA 10 Register */ + __IO uint32_t HSMC_SIGMA11; /**< \brief (Smc Offset: 0x554) PMECC Error Location SIGMA 11 Register */ + __IO uint32_t HSMC_SIGMA12; /**< \brief (Smc Offset: 0x558) PMECC Error Location SIGMA 12 Register */ + __IO uint32_t HSMC_SIGMA13; /**< \brief (Smc Offset: 0x55C) PMECC Error Location SIGMA 13 Register */ + __IO uint32_t HSMC_SIGMA14; /**< \brief (Smc Offset: 0x560) PMECC Error Location SIGMA 14 Register */ + __IO uint32_t HSMC_SIGMA15; /**< \brief (Smc Offset: 0x564) PMECC Error Location SIGMA 15 Register */ + __IO uint32_t HSMC_SIGMA16; /**< \brief (Smc Offset: 0x568) PMECC Error Location SIGMA 16 Register */ + __IO uint32_t HSMC_SIGMA17; /**< \brief (Smc Offset: 0x56C) PMECC Error Location SIGMA 17 Register */ + __IO uint32_t HSMC_SIGMA18; /**< \brief (Smc Offset: 0x570) PMECC Error Location SIGMA 18 Register */ + __IO uint32_t HSMC_SIGMA19; /**< \brief (Smc Offset: 0x574) PMECC Error Location SIGMA 19 Register */ + __IO uint32_t HSMC_SIGMA20; /**< \brief (Smc Offset: 0x578) PMECC Error Location SIGMA 20 Register */ + __IO uint32_t HSMC_SIGMA21; /**< \brief (Smc Offset: 0x57C) PMECC Error Location SIGMA 21 Register */ + __IO uint32_t HSMC_SIGMA22; /**< \brief (Smc Offset: 0x580) PMECC Error Location SIGMA 22 Register */ + __IO uint32_t HSMC_SIGMA23; /**< \brief (Smc Offset: 0x584) PMECC Error Location SIGMA 23 Register */ + __IO uint32_t HSMC_SIGMA24; /**< \brief (Smc Offset: 0x588) PMECC Error Location SIGMA 24 Register */ + __IO uint32_t HSMC_SIGMA25; /**< \brief (Smc Offset: 0x58C) PMECC Error Location SIGMA 25 Register */ + __IO uint32_t HSMC_SIGMA26; /**< \brief (Smc Offset: 0x590) PMECC Error Location SIGMA 26 Register */ + __IO uint32_t HSMC_SIGMA27; /**< \brief (Smc Offset: 0x594) PMECC Error Location SIGMA 27 Register */ + __IO uint32_t HSMC_SIGMA28; /**< \brief (Smc Offset: 0x598) PMECC Error Location SIGMA 28 Register */ + __IO uint32_t HSMC_SIGMA29; /**< \brief (Smc Offset: 0x59C) PMECC Error Location SIGMA 29 Register */ + __IO uint32_t HSMC_SIGMA30; /**< \brief (Smc Offset: 0x5A0) PMECC Error Location SIGMA 30 Register */ + __IO uint32_t HSMC_SIGMA31; /**< \brief (Smc Offset: 0x5A4) PMECC Error Location SIGMA 31 Register */ + __IO uint32_t HSMC_SIGMA32; /**< \brief (Smc Offset: 0x5A8) PMECC Error Location SIGMA 32 Register */ + __I uint32_t HSMC_ERRLOC0; /**< \brief (Smc Offset: 0x5AC) PMECC Error Location 0 Register */ + __I uint32_t HSMC_ERRLOC1; /**< \brief (Smc Offset: 0x5B0) PMECC Error Location 1 Register */ + __I uint32_t HSMC_ERRLOC2; /**< \brief (Smc Offset: 0x5B4) PMECC Error Location 2 Register */ + __I uint32_t HSMC_ERRLOC3; /**< \brief (Smc Offset: 0x5B8) PMECC Error Location 3 Register */ + __I uint32_t HSMC_ERRLOC4; /**< \brief (Smc Offset: 0x5BC) PMECC Error Location 4 Register */ + __I uint32_t HSMC_ERRLOC5; /**< \brief (Smc Offset: 0x5C0) PMECC Error Location 5 Register */ + __I uint32_t HSMC_ERRLOC6; /**< \brief (Smc Offset: 0x5C4) PMECC Error Location 6 Register */ + __I uint32_t HSMC_ERRLOC7; /**< \brief (Smc Offset: 0x5C8) PMECC Error Location 7 Register */ + __I uint32_t HSMC_ERRLOC8; /**< \brief (Smc Offset: 0x5CC) PMECC Error Location 8 Register */ + __I uint32_t HSMC_ERRLOC9; /**< \brief (Smc Offset: 0x5D0) PMECC Error Location 9 Register */ + __I uint32_t HSMC_ERRLOC10; /**< \brief (Smc Offset: 0x5D4) PMECC Error Location 10 Register */ + __I uint32_t HSMC_ERRLOC11; /**< \brief (Smc Offset: 0x5D8) PMECC Error Location 11 Register */ + __I uint32_t HSMC_ERRLOC12; /**< \brief (Smc Offset: 0x5DC) PMECC Error Location 12 Register */ + __I uint32_t HSMC_ERRLOC13; /**< \brief (Smc Offset: 0x5E0) PMECC Error Location 13 Register */ + __I uint32_t HSMC_ERRLOC14; /**< \brief (Smc Offset: 0x5E4) PMECC Error Location 14 Register */ + __I uint32_t HSMC_ERRLOC15; /**< \brief (Smc Offset: 0x5E8) PMECC Error Location 15 Register */ + __I uint32_t HSMC_ERRLOC16; /**< \brief (Smc Offset: 0x5EC) PMECC Error Location 16 Register */ + __I uint32_t HSMC_ERRLOC17; /**< \brief (Smc Offset: 0x5F0) PMECC Error Location 17 Register */ + __I uint32_t HSMC_ERRLOC18; /**< \brief (Smc Offset: 0x5F4) PMECC Error Location 18 Register */ + __I uint32_t HSMC_ERRLOC19; /**< \brief (Smc Offset: 0x5F8) PMECC Error Location 19 Register */ + __I uint32_t HSMC_ERRLOC20; /**< \brief (Smc Offset: 0x5FC) PMECC Error Location 20 Register */ + __I uint32_t HSMC_ERRLOC21; /**< \brief (Smc Offset: 0x600) PMECC Error Location 21 Register */ + __I uint32_t HSMC_ERRLOC22; /**< \brief (Smc Offset: 0x604) PMECC Error Location 22 Register */ + __I uint32_t HSMC_ERRLOC23; /**< \brief (Smc Offset: 0x608) PMECC Error Location 23 Register */ + __I uint32_t HSMC_ERRLOC24; /**< \brief (Smc Offset: 0x60C) PMECC Error Location 24 Register */ + __I uint32_t HSMC_ERRLOC25; /**< \brief (Smc Offset: 0x610) PMECC Error Location 25 Register */ + __I uint32_t HSMC_ERRLOC26; /**< \brief (Smc Offset: 0x614) PMECC Error Location 26 Register */ + __I uint32_t HSMC_ERRLOC27; /**< \brief (Smc Offset: 0x618) PMECC Error Location 27 Register */ + __I uint32_t HSMC_ERRLOC28; /**< \brief (Smc Offset: 0x61C) PMECC Error Location 28 Register */ + __I uint32_t HSMC_ERRLOC29; /**< \brief (Smc Offset: 0x620) PMECC Error Location 29 Register */ + __I uint32_t HSMC_ERRLOC30; /**< \brief (Smc Offset: 0x624) PMECC Error Location 30 Register */ + __I uint32_t HSMC_ERRLOC31; /**< \brief (Smc Offset: 0x628) PMECC Error Location 31 Register */ + __I uint32_t Reserved6[53]; + SmcCs_number SMC_CS_NUMBER[SMCCS_NUMBER_NUMBER]; /**< \brief (Smc Offset: 0x700) CS_number = 0 .. 3 */ + __I uint32_t Reserved7[20]; + __IO uint32_t HSMC_OCMS; /**< \brief (Smc Offset: 0x7A0) HSMC Off Chip Memory Scrambling Register */ + __O uint32_t HSMC_KEY1; /**< \brief (Smc Offset: 0x7A4) HSMC Off Chip Memory Scrambling KEY1 Register */ + __O uint32_t HSMC_KEY2; /**< \brief (Smc Offset: 0x7A8) HSMC Off Chip Memory Scrambling KEY2 Register */ + __I uint32_t Reserved8[14]; + __IO uint32_t HSMC_WPMR; /**< \brief (Smc Offset: 0x7E4) HSMC Write Protection Mode Register */ + __I uint32_t HSMC_WPSR; /**< \brief (Smc Offset: 0x7E8) HSMC Write Protection Status Register */ + __I uint32_t Reserved9[4]; + __I uint32_t HSMC_VERSION; /**< \brief (Smc Offset: 0x7FC) HSMC Version Register */ +} Smc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- HSMC_CFG : (SMC Offset: 0x000) HSMC NFC Configuration Register -------- */ +#define HSMC_CFG_PAGESIZE_Pos 0 +#define HSMC_CFG_PAGESIZE_Msk (0x7u << HSMC_CFG_PAGESIZE_Pos) /**< \brief (HSMC_CFG) Page Size of the NAND Flash Device */ +#define HSMC_CFG_PAGESIZE(value) ((HSMC_CFG_PAGESIZE_Msk & ((value) << HSMC_CFG_PAGESIZE_Pos))) +#define HSMC_CFG_PAGESIZE_PS512 (0x0u << 0) /**< \brief (HSMC_CFG) Main area 512 bytes */ +#define HSMC_CFG_PAGESIZE_PS1024 (0x1u << 0) /**< \brief (HSMC_CFG) Main area 1024 bytes */ +#define HSMC_CFG_PAGESIZE_PS2048 (0x2u << 0) /**< \brief (HSMC_CFG) Main area 2048 bytes */ +#define HSMC_CFG_PAGESIZE_PS4096 (0x3u << 0) /**< \brief (HSMC_CFG) Main area 4096 bytes */ +#define HSMC_CFG_PAGESIZE_PS8192 (0x4u << 0) /**< \brief (HSMC_CFG) Main area 8192 bytes */ +#define HSMC_CFG_WSPARE (0x1u << 8) /**< \brief (HSMC_CFG) Write Spare Area */ +#define HSMC_CFG_RSPARE (0x1u << 9) /**< \brief (HSMC_CFG) Read Spare Area */ +#define HSMC_CFG_EDGECTRL (0x1u << 12) /**< \brief (HSMC_CFG) Rising/Falling Edge Detection Control */ +#define HSMC_CFG_RBEDGE (0x1u << 13) /**< \brief (HSMC_CFG) Ready/Busy Signal Edge Detection */ +#define HSMC_CFG_DTOCYC_Pos 16 +#define HSMC_CFG_DTOCYC_Msk (0xfu << HSMC_CFG_DTOCYC_Pos) /**< \brief (HSMC_CFG) Data Timeout Cycle Number */ +#define HSMC_CFG_DTOCYC(value) ((HSMC_CFG_DTOCYC_Msk & ((value) << HSMC_CFG_DTOCYC_Pos))) +#define HSMC_CFG_DTOMUL_Pos 20 +#define HSMC_CFG_DTOMUL_Msk (0x7u << HSMC_CFG_DTOMUL_Pos) /**< \brief (HSMC_CFG) Data Timeout Multiplier */ +#define HSMC_CFG_DTOMUL(value) ((HSMC_CFG_DTOMUL_Msk & ((value) << HSMC_CFG_DTOMUL_Pos))) +#define HSMC_CFG_DTOMUL_X1 (0x0u << 20) /**< \brief (HSMC_CFG) DTOCYC */ +#define HSMC_CFG_DTOMUL_X16 (0x1u << 20) /**< \brief (HSMC_CFG) DTOCYC x 16 */ +#define HSMC_CFG_DTOMUL_X128 (0x2u << 20) /**< \brief (HSMC_CFG) DTOCYC x 128 */ +#define HSMC_CFG_DTOMUL_X256 (0x3u << 20) /**< \brief (HSMC_CFG) DTOCYC x 256 */ +#define HSMC_CFG_DTOMUL_X1024 (0x4u << 20) /**< \brief (HSMC_CFG) DTOCYC x 1024 */ +#define HSMC_CFG_DTOMUL_X4096 (0x5u << 20) /**< \brief (HSMC_CFG) DTOCYC x 4096 */ +#define HSMC_CFG_DTOMUL_X65536 (0x6u << 20) /**< \brief (HSMC_CFG) DTOCYC x 65536 */ +#define HSMC_CFG_DTOMUL_X1048576 (0x7u << 20) /**< \brief (HSMC_CFG) DTOCYC x 1048576 */ +#define HSMC_CFG_NFCSPARESIZE_Pos 24 +#define HSMC_CFG_NFCSPARESIZE_Msk (0x7fu << HSMC_CFG_NFCSPARESIZE_Pos) /**< \brief (HSMC_CFG) NAND Flash Spare Area Size Retrieved by the Host Controller */ +#define HSMC_CFG_NFCSPARESIZE(value) ((HSMC_CFG_NFCSPARESIZE_Msk & ((value) << HSMC_CFG_NFCSPARESIZE_Pos))) +/* -------- HSMC_CTRL : (SMC Offset: 0x004) HSMC NFC Control Register -------- */ +#define HSMC_CTRL_NFCEN (0x1u << 0) /**< \brief (HSMC_CTRL) NAND Flash Controller Enable */ +#define HSMC_CTRL_NFCDIS (0x1u << 1) /**< \brief (HSMC_CTRL) NAND Flash Controller Disable */ +/* -------- HSMC_SR : (SMC Offset: 0x008) HSMC NFC Status Register -------- */ +#define HSMC_SR_SMCSTS (0x1u << 0) /**< \brief (HSMC_SR) NAND Flash Controller Status (this field cannot be reset) */ +#define HSMC_SR_RB_RISE (0x1u << 4) /**< \brief (HSMC_SR) Selected Ready Busy Rising Edge Detected */ +#define HSMC_SR_RB_FALL (0x1u << 5) /**< \brief (HSMC_SR) Selected Ready Busy Falling Edge Detected */ +#define HSMC_SR_NFCBUSY (0x1u << 8) /**< \brief (HSMC_SR) NFC Busy (this field cannot be reset) */ +#define HSMC_SR_NFCWR (0x1u << 11) /**< \brief (HSMC_SR) NFC Write/Read Operation (this field cannot be reset) */ +#define HSMC_SR_NFCSID_Pos 12 +#define HSMC_SR_NFCSID_Msk (0x7u << HSMC_SR_NFCSID_Pos) /**< \brief (HSMC_SR) NFC Chip Select ID (this field cannot be reset) */ +#define HSMC_SR_XFRDONE (0x1u << 16) /**< \brief (HSMC_SR) NFC Data Transfer Terminated */ +#define HSMC_SR_CMDDONE (0x1u << 17) /**< \brief (HSMC_SR) Command Done */ +#define HSMC_SR_DTOE (0x1u << 20) /**< \brief (HSMC_SR) Data Timeout Error */ +#define HSMC_SR_UNDEF (0x1u << 21) /**< \brief (HSMC_SR) Undefined Area Error */ +#define HSMC_SR_AWB (0x1u << 22) /**< \brief (HSMC_SR) Accessing While Busy */ +#define HSMC_SR_NFCASE (0x1u << 23) /**< \brief (HSMC_SR) NFC Access Size Error */ +#define HSMC_SR_RB_EDGE3 (0x1u << 27) /**< \brief (HSMC_SR) Ready/Busy Line 3 Edge Detected */ +/* -------- HSMC_IER : (SMC Offset: 0x00C) HSMC NFC Interrupt Enable Register -------- */ +#define HSMC_IER_RB_RISE (0x1u << 4) /**< \brief (HSMC_IER) Ready Busy Rising Edge Detection Interrupt Enable */ +#define HSMC_IER_RB_FALL (0x1u << 5) /**< \brief (HSMC_IER) Ready Busy Falling Edge Detection Interrupt Enable */ +#define HSMC_IER_XFRDONE (0x1u << 16) /**< \brief (HSMC_IER) Transfer Done Interrupt Enable */ +#define HSMC_IER_CMDDONE (0x1u << 17) /**< \brief (HSMC_IER) Command Done Interrupt Enable */ +#define HSMC_IER_DTOE (0x1u << 20) /**< \brief (HSMC_IER) Data Timeout Error Interrupt Enable */ +#define HSMC_IER_UNDEF (0x1u << 21) /**< \brief (HSMC_IER) Undefined Area Access Interrupt Enable */ +#define HSMC_IER_AWB (0x1u << 22) /**< \brief (HSMC_IER) Accessing While Busy Interrupt Enable */ +#define HSMC_IER_NFCASE (0x1u << 23) /**< \brief (HSMC_IER) NFC Access Size Error Interrupt Enable */ +#define HSMC_IER_RB_EDGE3 (0x1u << 27) /**< \brief (HSMC_IER) Ready/Busy Line 3 Interrupt Enable */ +/* -------- HSMC_IDR : (SMC Offset: 0x010) HSMC NFC Interrupt Disable Register -------- */ +#define HSMC_IDR_RB_RISE (0x1u << 4) /**< \brief (HSMC_IDR) Ready Busy Rising Edge Detection Interrupt Disable */ +#define HSMC_IDR_RB_FALL (0x1u << 5) /**< \brief (HSMC_IDR) Ready Busy Falling Edge Detection Interrupt Disable */ +#define HSMC_IDR_XFRDONE (0x1u << 16) /**< \brief (HSMC_IDR) Transfer Done Interrupt Disable */ +#define HSMC_IDR_CMDDONE (0x1u << 17) /**< \brief (HSMC_IDR) Command Done Interrupt Disable */ +#define HSMC_IDR_DTOE (0x1u << 20) /**< \brief (HSMC_IDR) Data Timeout Error Interrupt Disable */ +#define HSMC_IDR_UNDEF (0x1u << 21) /**< \brief (HSMC_IDR) Undefined Area Access Interrupt Disable */ +#define HSMC_IDR_AWB (0x1u << 22) /**< \brief (HSMC_IDR) Accessing While Busy Interrupt Disable */ +#define HSMC_IDR_NFCASE (0x1u << 23) /**< \brief (HSMC_IDR) NFC Access Size Error Interrupt Disable */ +#define HSMC_IDR_RB_EDGE3 (0x1u << 27) /**< \brief (HSMC_IDR) Ready/Busy Line 3 Interrupt Disable */ +/* -------- HSMC_IMR : (SMC Offset: 0x014) HSMC NFC Interrupt Mask Register -------- */ +#define HSMC_IMR_RB_RISE (0x1u << 4) /**< \brief (HSMC_IMR) Ready Busy Rising Edge Detection Interrupt Mask */ +#define HSMC_IMR_RB_FALL (0x1u << 5) /**< \brief (HSMC_IMR) Ready Busy Falling Edge Detection Interrupt Mask */ +#define HSMC_IMR_XFRDONE (0x1u << 16) /**< \brief (HSMC_IMR) Transfer Done Interrupt Mask */ +#define HSMC_IMR_CMDDONE (0x1u << 17) /**< \brief (HSMC_IMR) Command Done Interrupt Mask */ +#define HSMC_IMR_DTOE (0x1u << 20) /**< \brief (HSMC_IMR) Data Timeout Error Interrupt Mask */ +#define HSMC_IMR_UNDEF (0x1u << 21) /**< \brief (HSMC_IMR) Undefined Area Access Interrupt Mask5 */ +#define HSMC_IMR_AWB (0x1u << 22) /**< \brief (HSMC_IMR) Accessing While Busy Interrupt Mask */ +#define HSMC_IMR_NFCASE (0x1u << 23) /**< \brief (HSMC_IMR) NFC Access Size Error Interrupt Mask */ +#define HSMC_IMR_RB_EDGE3 (0x1u << 27) /**< \brief (HSMC_IMR) Ready/Busy Line 3 Interrupt Mask */ +/* -------- HSMC_ADDR : (SMC Offset: 0x018) HSMC NFC Address Cycle Zero Register -------- */ +#define HSMC_ADDR_ADDR_CYCLE0_Pos 0 +#define HSMC_ADDR_ADDR_CYCLE0_Msk (0xffu << HSMC_ADDR_ADDR_CYCLE0_Pos) /**< \brief (HSMC_ADDR) NAND Flash Array Address Cycle 0 */ +#define HSMC_ADDR_ADDR_CYCLE0(value) ((HSMC_ADDR_ADDR_CYCLE0_Msk & ((value) << HSMC_ADDR_ADDR_CYCLE0_Pos))) +/* -------- HSMC_BANK : (SMC Offset: 0x01C) HSMC Bank Address Register -------- */ +#define HSMC_BANK_BANK (0x1u << 0) /**< \brief (HSMC_BANK) Bank Identifier */ +/* -------- HSMC_PMECCFG : (SMC Offset: 0x070) PMECC Configuration Register -------- */ +#define HSMC_PMECCFG_BCH_ERR_Pos 0 +#define HSMC_PMECCFG_BCH_ERR_Msk (0x7u << HSMC_PMECCFG_BCH_ERR_Pos) /**< \brief (HSMC_PMECCFG) Error Correcting Capability */ +#define HSMC_PMECCFG_BCH_ERR(value) ((HSMC_PMECCFG_BCH_ERR_Msk & ((value) << HSMC_PMECCFG_BCH_ERR_Pos))) +#define HSMC_PMECCFG_BCH_ERR_BCH_ERR2 (0x0u << 0) /**< \brief (HSMC_PMECCFG) 2 errors */ +#define HSMC_PMECCFG_BCH_ERR_BCH_ERR4 (0x1u << 0) /**< \brief (HSMC_PMECCFG) 4 errors */ +#define HSMC_PMECCFG_BCH_ERR_BCH_ERR8 (0x2u << 0) /**< \brief (HSMC_PMECCFG) 8 errors */ +#define HSMC_PMECCFG_BCH_ERR_BCH_ERR12 (0x3u << 0) /**< \brief (HSMC_PMECCFG) 12 errors */ +#define HSMC_PMECCFG_BCH_ERR_BCH_ERR24 (0x4u << 0) /**< \brief (HSMC_PMECCFG) 24 errors */ +#define HSMC_PMECCFG_BCH_ERR_BCH_ERR32 (0x5u << 0) /**< \brief (HSMC_PMECCFG) 32 errors */ +#define HSMC_PMECCFG_SECTORSZ (0x1u << 4) /**< \brief (HSMC_PMECCFG) Sector Size */ +#define HSMC_PMECCFG_PAGESIZE_Pos 8 +#define HSMC_PMECCFG_PAGESIZE_Msk (0x3u << HSMC_PMECCFG_PAGESIZE_Pos) /**< \brief (HSMC_PMECCFG) Number of Sectors in the Page */ +#define HSMC_PMECCFG_PAGESIZE(value) ((HSMC_PMECCFG_PAGESIZE_Msk & ((value) << HSMC_PMECCFG_PAGESIZE_Pos))) +#define HSMC_PMECCFG_PAGESIZE_PAGESIZE_1SEC (0x0u << 8) /**< \brief (HSMC_PMECCFG) 1 sector for main area (512 or 1024 bytes) */ +#define HSMC_PMECCFG_PAGESIZE_PAGESIZE_2SEC (0x1u << 8) /**< \brief (HSMC_PMECCFG) 2 sectors for main area (1024 or 2048 bytes) */ +#define HSMC_PMECCFG_PAGESIZE_PAGESIZE_4SEC (0x2u << 8) /**< \brief (HSMC_PMECCFG) 4 sectors for main area (2048 or 4096 bytes) */ +#define HSMC_PMECCFG_PAGESIZE_PAGESIZE_8SEC (0x3u << 8) /**< \brief (HSMC_PMECCFG) 8 sectors for main area (4096 or 8192 bytes) */ +#define HSMC_PMECCFG_NANDWR (0x1u << 12) /**< \brief (HSMC_PMECCFG) NAND Write Access */ +#define HSMC_PMECCFG_SPAREEN (0x1u << 16) /**< \brief (HSMC_PMECCFG) Spare Enable */ +#define HSMC_PMECCFG_AUTO (0x1u << 20) /**< \brief (HSMC_PMECCFG) Automatic Mode Enable */ +/* -------- HSMC_PMECCSAREA : (SMC Offset: 0x074) PMECC Spare Area Size Register -------- */ +#define HSMC_PMECCSAREA_SPARESIZE_Pos 0 +#define HSMC_PMECCSAREA_SPARESIZE_Msk (0x1ffu << HSMC_PMECCSAREA_SPARESIZE_Pos) /**< \brief (HSMC_PMECCSAREA) Spare Area Size */ +#define HSMC_PMECCSAREA_SPARESIZE(value) ((HSMC_PMECCSAREA_SPARESIZE_Msk & ((value) << HSMC_PMECCSAREA_SPARESIZE_Pos))) +/* -------- HSMC_PMECCSADDR : (SMC Offset: 0x078) PMECC Start Address Register -------- */ +#define HSMC_PMECCSADDR_STARTADDR_Pos 0 +#define HSMC_PMECCSADDR_STARTADDR_Msk (0x1ffu << HSMC_PMECCSADDR_STARTADDR_Pos) /**< \brief (HSMC_PMECCSADDR) ECC Area Start Address */ +#define HSMC_PMECCSADDR_STARTADDR(value) ((HSMC_PMECCSADDR_STARTADDR_Msk & ((value) << HSMC_PMECCSADDR_STARTADDR_Pos))) +/* -------- HSMC_PMECCEADDR : (SMC Offset: 0x07C) PMECC End Address Register -------- */ +#define HSMC_PMECCEADDR_ENDADDR_Pos 0 +#define HSMC_PMECCEADDR_ENDADDR_Msk (0x1ffu << HSMC_PMECCEADDR_ENDADDR_Pos) /**< \brief (HSMC_PMECCEADDR) ECC Area End Address */ +#define HSMC_PMECCEADDR_ENDADDR(value) ((HSMC_PMECCEADDR_ENDADDR_Msk & ((value) << HSMC_PMECCEADDR_ENDADDR_Pos))) +/* -------- HSMC_PMECCTRL : (SMC Offset: 0x084) PMECC Control Register -------- */ +#define HSMC_PMECCTRL_RST (0x1u << 0) /**< \brief (HSMC_PMECCTRL) Reset the PMECC Module */ +#define HSMC_PMECCTRL_DATA (0x1u << 1) /**< \brief (HSMC_PMECCTRL) Start a Data Phase */ +#define HSMC_PMECCTRL_USER (0x1u << 2) /**< \brief (HSMC_PMECCTRL) Start a User Mode Phase */ +#define HSMC_PMECCTRL_ENABLE (0x1u << 4) /**< \brief (HSMC_PMECCTRL) PMECC Enable */ +#define HSMC_PMECCTRL_DISABLE (0x1u << 5) /**< \brief (HSMC_PMECCTRL) PMECC Enable */ +/* -------- HSMC_PMECCSR : (SMC Offset: 0x088) PMECC Status Register -------- */ +#define HSMC_PMECCSR_BUSY (0x1u << 0) /**< \brief (HSMC_PMECCSR) The kernel of the PMECC is busy */ +#define HSMC_PMECCSR_ENABLE (0x1u << 4) /**< \brief (HSMC_PMECCSR) PMECC Enable bit */ +/* -------- HSMC_PMECCIER : (SMC Offset: 0x08C) PMECC Interrupt Enable register -------- */ +#define HSMC_PMECCIER_ERRIE (0x1u << 0) /**< \brief (HSMC_PMECCIER) Error Interrupt Enable */ +/* -------- HSMC_PMECCIDR : (SMC Offset: 0x090) PMECC Interrupt Disable Register -------- */ +#define HSMC_PMECCIDR_ERRID (0x1u << 0) /**< \brief (HSMC_PMECCIDR) Error Interrupt Disable */ +/* -------- HSMC_PMECCIMR : (SMC Offset: 0x094) PMECC Interrupt Mask Register -------- */ +#define HSMC_PMECCIMR_ERRIM (0x1u << 0) /**< \brief (HSMC_PMECCIMR) Error Interrupt Mask */ +/* -------- HSMC_PMECCISR : (SMC Offset: 0x098) PMECC Interrupt Status Register -------- */ +#define HSMC_PMECCISR_ERRIS_Pos 0 +#define HSMC_PMECCISR_ERRIS_Msk (0xffu << HSMC_PMECCISR_ERRIS_Pos) /**< \brief (HSMC_PMECCISR) Error Interrupt Status Register */ +/* -------- HSMC_PMECC[14] : (SMC Offset: N/A) PMECC Redundancy x Register -------- */ +#define HSMC_PMECC_ECC_Pos 0 +#define HSMC_PMECC_ECC_Msk (0xffffffffu << HSMC_PMECC_ECC_Pos) /**< \brief (HSMC_PMECC[14]) BCH Redundancy */ +/* -------- HSMC_REM0_ : (SMC Offset: N/A) PMECC Remainder 0 Register -------- */ +#define HSMC_REM0__REM2NP1_Pos 0 +#define HSMC_REM0__REM2NP1_Msk (0x3fffu << HSMC_REM0__REM2NP1_Pos) /**< \brief (HSMC_REM0_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM0__REM2NP3_Pos 16 +#define HSMC_REM0__REM2NP3_Msk (0x3fffu << HSMC_REM0__REM2NP3_Pos) /**< \brief (HSMC_REM0_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM1_ : (SMC Offset: N/A) PMECC Remainder 1 Register -------- */ +#define HSMC_REM1__REM2NP1_Pos 0 +#define HSMC_REM1__REM2NP1_Msk (0x3fffu << HSMC_REM1__REM2NP1_Pos) /**< \brief (HSMC_REM1_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM1__REM2NP3_Pos 16 +#define HSMC_REM1__REM2NP3_Msk (0x3fffu << HSMC_REM1__REM2NP3_Pos) /**< \brief (HSMC_REM1_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM2_ : (SMC Offset: N/A) PMECC Remainder 2 Register -------- */ +#define HSMC_REM2__REM2NP1_Pos 0 +#define HSMC_REM2__REM2NP1_Msk (0x3fffu << HSMC_REM2__REM2NP1_Pos) /**< \brief (HSMC_REM2_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM2__REM2NP3_Pos 16 +#define HSMC_REM2__REM2NP3_Msk (0x3fffu << HSMC_REM2__REM2NP3_Pos) /**< \brief (HSMC_REM2_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM3_ : (SMC Offset: N/A) PMECC Remainder 3 Register -------- */ +#define HSMC_REM3__REM2NP1_Pos 0 +#define HSMC_REM3__REM2NP1_Msk (0x3fffu << HSMC_REM3__REM2NP1_Pos) /**< \brief (HSMC_REM3_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM3__REM2NP3_Pos 16 +#define HSMC_REM3__REM2NP3_Msk (0x3fffu << HSMC_REM3__REM2NP3_Pos) /**< \brief (HSMC_REM3_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM4_ : (SMC Offset: N/A) PMECC Remainder 4 Register -------- */ +#define HSMC_REM4__REM2NP1_Pos 0 +#define HSMC_REM4__REM2NP1_Msk (0x3fffu << HSMC_REM4__REM2NP1_Pos) /**< \brief (HSMC_REM4_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM4__REM2NP3_Pos 16 +#define HSMC_REM4__REM2NP3_Msk (0x3fffu << HSMC_REM4__REM2NP3_Pos) /**< \brief (HSMC_REM4_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM5_ : (SMC Offset: N/A) PMECC Remainder 5 Register -------- */ +#define HSMC_REM5__REM2NP1_Pos 0 +#define HSMC_REM5__REM2NP1_Msk (0x3fffu << HSMC_REM5__REM2NP1_Pos) /**< \brief (HSMC_REM5_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM5__REM2NP3_Pos 16 +#define HSMC_REM5__REM2NP3_Msk (0x3fffu << HSMC_REM5__REM2NP3_Pos) /**< \brief (HSMC_REM5_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM6_ : (SMC Offset: N/A) PMECC Remainder 6 Register -------- */ +#define HSMC_REM6__REM2NP1_Pos 0 +#define HSMC_REM6__REM2NP1_Msk (0x3fffu << HSMC_REM6__REM2NP1_Pos) /**< \brief (HSMC_REM6_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM6__REM2NP3_Pos 16 +#define HSMC_REM6__REM2NP3_Msk (0x3fffu << HSMC_REM6__REM2NP3_Pos) /**< \brief (HSMC_REM6_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM7_ : (SMC Offset: N/A) PMECC Remainder 7 Register -------- */ +#define HSMC_REM7__REM2NP1_Pos 0 +#define HSMC_REM7__REM2NP1_Msk (0x3fffu << HSMC_REM7__REM2NP1_Pos) /**< \brief (HSMC_REM7_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM7__REM2NP3_Pos 16 +#define HSMC_REM7__REM2NP3_Msk (0x3fffu << HSMC_REM7__REM2NP3_Pos) /**< \brief (HSMC_REM7_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM8_ : (SMC Offset: N/A) PMECC Remainder 8 Register -------- */ +#define HSMC_REM8__REM2NP1_Pos 0 +#define HSMC_REM8__REM2NP1_Msk (0x3fffu << HSMC_REM8__REM2NP1_Pos) /**< \brief (HSMC_REM8_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM8__REM2NP3_Pos 16 +#define HSMC_REM8__REM2NP3_Msk (0x3fffu << HSMC_REM8__REM2NP3_Pos) /**< \brief (HSMC_REM8_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM9_ : (SMC Offset: N/A) PMECC Remainder 9 Register -------- */ +#define HSMC_REM9__REM2NP1_Pos 0 +#define HSMC_REM9__REM2NP1_Msk (0x3fffu << HSMC_REM9__REM2NP1_Pos) /**< \brief (HSMC_REM9_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM9__REM2NP3_Pos 16 +#define HSMC_REM9__REM2NP3_Msk (0x3fffu << HSMC_REM9__REM2NP3_Pos) /**< \brief (HSMC_REM9_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM10_ : (SMC Offset: N/A) PMECC Remainder 10 Register -------- */ +#define HSMC_REM10__REM2NP1_Pos 0 +#define HSMC_REM10__REM2NP1_Msk (0x3fffu << HSMC_REM10__REM2NP1_Pos) /**< \brief (HSMC_REM10_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM10__REM2NP3_Pos 16 +#define HSMC_REM10__REM2NP3_Msk (0x3fffu << HSMC_REM10__REM2NP3_Pos) /**< \brief (HSMC_REM10_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM11_ : (SMC Offset: N/A) PMECC Remainder 11 Register -------- */ +#define HSMC_REM11__REM2NP1_Pos 0 +#define HSMC_REM11__REM2NP1_Msk (0x3fffu << HSMC_REM11__REM2NP1_Pos) /**< \brief (HSMC_REM11_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM11__REM2NP3_Pos 16 +#define HSMC_REM11__REM2NP3_Msk (0x3fffu << HSMC_REM11__REM2NP3_Pos) /**< \brief (HSMC_REM11_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM12_ : (SMC Offset: N/A) PMECC Remainder 12 Register -------- */ +#define HSMC_REM12__REM2NP1_Pos 0 +#define HSMC_REM12__REM2NP1_Msk (0x3fffu << HSMC_REM12__REM2NP1_Pos) /**< \brief (HSMC_REM12_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM12__REM2NP3_Pos 16 +#define HSMC_REM12__REM2NP3_Msk (0x3fffu << HSMC_REM12__REM2NP3_Pos) /**< \brief (HSMC_REM12_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM13_ : (SMC Offset: N/A) PMECC Remainder 13 Register -------- */ +#define HSMC_REM13__REM2NP1_Pos 0 +#define HSMC_REM13__REM2NP1_Msk (0x3fffu << HSMC_REM13__REM2NP1_Pos) /**< \brief (HSMC_REM13_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM13__REM2NP3_Pos 16 +#define HSMC_REM13__REM2NP3_Msk (0x3fffu << HSMC_REM13__REM2NP3_Pos) /**< \brief (HSMC_REM13_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM14_ : (SMC Offset: N/A) PMECC Remainder 14 Register -------- */ +#define HSMC_REM14__REM2NP1_Pos 0 +#define HSMC_REM14__REM2NP1_Msk (0x3fffu << HSMC_REM14__REM2NP1_Pos) /**< \brief (HSMC_REM14_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM14__REM2NP3_Pos 16 +#define HSMC_REM14__REM2NP3_Msk (0x3fffu << HSMC_REM14__REM2NP3_Pos) /**< \brief (HSMC_REM14_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_REM15_ : (SMC Offset: N/A) PMECC Remainder 15 Register -------- */ +#define HSMC_REM15__REM2NP1_Pos 0 +#define HSMC_REM15__REM2NP1_Msk (0x3fffu << HSMC_REM15__REM2NP1_Pos) /**< \brief (HSMC_REM15_) BCH Remainder 2 * N + 1 */ +#define HSMC_REM15__REM2NP3_Pos 16 +#define HSMC_REM15__REM2NP3_Msk (0x3fffu << HSMC_REM15__REM2NP3_Pos) /**< \brief (HSMC_REM15_) BCH Remainder 2 * N + 3 */ +/* -------- HSMC_ELCFG : (SMC Offset: 0x500) PMECC Error Location Configuration Register -------- */ +#define HSMC_ELCFG_SECTORSZ (0x1u << 0) /**< \brief (HSMC_ELCFG) Sector Size */ +#define HSMC_ELCFG_ERRNUM_Pos 16 +#define HSMC_ELCFG_ERRNUM_Msk (0x1fu << HSMC_ELCFG_ERRNUM_Pos) /**< \brief (HSMC_ELCFG) Number of Errors */ +#define HSMC_ELCFG_ERRNUM(value) ((HSMC_ELCFG_ERRNUM_Msk & ((value) << HSMC_ELCFG_ERRNUM_Pos))) +/* -------- HSMC_ELPRIM : (SMC Offset: 0x504) PMECC Error Location Primitive Register -------- */ +#define HSMC_ELPRIM_PRIMITIV_Pos 0 +#define HSMC_ELPRIM_PRIMITIV_Msk (0xffffu << HSMC_ELPRIM_PRIMITIV_Pos) /**< \brief (HSMC_ELPRIM) Primitive Polynomial */ +/* -------- HSMC_ELEN : (SMC Offset: 0x508) PMECC Error Location Enable Register -------- */ +#define HSMC_ELEN_ENINIT_Pos 0 +#define HSMC_ELEN_ENINIT_Msk (0x3fffu << HSMC_ELEN_ENINIT_Pos) /**< \brief (HSMC_ELEN) Error Location Enable */ +#define HSMC_ELEN_ENINIT(value) ((HSMC_ELEN_ENINIT_Msk & ((value) << HSMC_ELEN_ENINIT_Pos))) +/* -------- HSMC_ELDIS : (SMC Offset: 0x50C) PMECC Error Location Disable Register -------- */ +#define HSMC_ELDIS_DIS (0x1u << 0) /**< \brief (HSMC_ELDIS) Disable Error Location Engine */ +/* -------- HSMC_ELSR : (SMC Offset: 0x510) PMECC Error Location Status Register -------- */ +#define HSMC_ELSR_BUSY (0x1u << 0) /**< \brief (HSMC_ELSR) Error Location Engine Busy */ +/* -------- HSMC_ELIER : (SMC Offset: 0x514) PMECC Error Location Interrupt Enable register -------- */ +#define HSMC_ELIER_DONE (0x1u << 0) /**< \brief (HSMC_ELIER) Computation Terminated Interrupt Enable */ +/* -------- HSMC_ELIDR : (SMC Offset: 0x518) PMECC Error Location Interrupt Disable Register -------- */ +#define HSMC_ELIDR_DONE (0x1u << 0) /**< \brief (HSMC_ELIDR) Computation Terminated Interrupt Disable */ +/* -------- HSMC_ELIMR : (SMC Offset: 0x51C) PMECC Error Location Interrupt Mask Register -------- */ +#define HSMC_ELIMR_DONE (0x1u << 0) /**< \brief (HSMC_ELIMR) Computation Terminated Interrupt Mask */ +/* -------- HSMC_ELISR : (SMC Offset: 0x520) PMECC Error Location Interrupt Status Register -------- */ +#define HSMC_ELISR_DONE (0x1u << 0) /**< \brief (HSMC_ELISR) Computation Terminated Interrupt Status */ +#define HSMC_ELISR_ERR_CNT_Pos 8 +#define HSMC_ELISR_ERR_CNT_Msk (0x3fu << HSMC_ELISR_ERR_CNT_Pos) /**< \brief (HSMC_ELISR) Error Counter value */ +/* -------- HSMC_SIGMA0 : (SMC Offset: 0x528) PMECC Error Location SIGMA 0 Register -------- */ +#define HSMC_SIGMA0_SIGMA0_Pos 0 +#define HSMC_SIGMA0_SIGMA0_Msk (0x3fffu << HSMC_SIGMA0_SIGMA0_Pos) /**< \brief (HSMC_SIGMA0) Coefficient of degree 0 in the SIGMA polynomial */ +/* -------- HSMC_SIGMA1 : (SMC Offset: 0x52C) PMECC Error Location SIGMA 1 Register -------- */ +#define HSMC_SIGMA1_SIGMA1_Pos 0 +#define HSMC_SIGMA1_SIGMA1_Msk (0x3fffu << HSMC_SIGMA1_SIGMA1_Pos) /**< \brief (HSMC_SIGMA1) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA1_SIGMA1(value) ((HSMC_SIGMA1_SIGMA1_Msk & ((value) << HSMC_SIGMA1_SIGMA1_Pos))) +/* -------- HSMC_SIGMA2 : (SMC Offset: 0x530) PMECC Error Location SIGMA 2 Register -------- */ +#define HSMC_SIGMA2_SIGMA2_Pos 0 +#define HSMC_SIGMA2_SIGMA2_Msk (0x3fffu << HSMC_SIGMA2_SIGMA2_Pos) /**< \brief (HSMC_SIGMA2) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA2_SIGMA2(value) ((HSMC_SIGMA2_SIGMA2_Msk & ((value) << HSMC_SIGMA2_SIGMA2_Pos))) +/* -------- HSMC_SIGMA3 : (SMC Offset: 0x534) PMECC Error Location SIGMA 3 Register -------- */ +#define HSMC_SIGMA3_SIGMA3_Pos 0 +#define HSMC_SIGMA3_SIGMA3_Msk (0x3fffu << HSMC_SIGMA3_SIGMA3_Pos) /**< \brief (HSMC_SIGMA3) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA3_SIGMA3(value) ((HSMC_SIGMA3_SIGMA3_Msk & ((value) << HSMC_SIGMA3_SIGMA3_Pos))) +/* -------- HSMC_SIGMA4 : (SMC Offset: 0x538) PMECC Error Location SIGMA 4 Register -------- */ +#define HSMC_SIGMA4_SIGMA4_Pos 0 +#define HSMC_SIGMA4_SIGMA4_Msk (0x3fffu << HSMC_SIGMA4_SIGMA4_Pos) /**< \brief (HSMC_SIGMA4) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA4_SIGMA4(value) ((HSMC_SIGMA4_SIGMA4_Msk & ((value) << HSMC_SIGMA4_SIGMA4_Pos))) +/* -------- HSMC_SIGMA5 : (SMC Offset: 0x53C) PMECC Error Location SIGMA 5 Register -------- */ +#define HSMC_SIGMA5_SIGMA5_Pos 0 +#define HSMC_SIGMA5_SIGMA5_Msk (0x3fffu << HSMC_SIGMA5_SIGMA5_Pos) /**< \brief (HSMC_SIGMA5) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA5_SIGMA5(value) ((HSMC_SIGMA5_SIGMA5_Msk & ((value) << HSMC_SIGMA5_SIGMA5_Pos))) +/* -------- HSMC_SIGMA6 : (SMC Offset: 0x540) PMECC Error Location SIGMA 6 Register -------- */ +#define HSMC_SIGMA6_SIGMA6_Pos 0 +#define HSMC_SIGMA6_SIGMA6_Msk (0x3fffu << HSMC_SIGMA6_SIGMA6_Pos) /**< \brief (HSMC_SIGMA6) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA6_SIGMA6(value) ((HSMC_SIGMA6_SIGMA6_Msk & ((value) << HSMC_SIGMA6_SIGMA6_Pos))) +/* -------- HSMC_SIGMA7 : (SMC Offset: 0x544) PMECC Error Location SIGMA 7 Register -------- */ +#define HSMC_SIGMA7_SIGMA7_Pos 0 +#define HSMC_SIGMA7_SIGMA7_Msk (0x3fffu << HSMC_SIGMA7_SIGMA7_Pos) /**< \brief (HSMC_SIGMA7) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA7_SIGMA7(value) ((HSMC_SIGMA7_SIGMA7_Msk & ((value) << HSMC_SIGMA7_SIGMA7_Pos))) +/* -------- HSMC_SIGMA8 : (SMC Offset: 0x548) PMECC Error Location SIGMA 8 Register -------- */ +#define HSMC_SIGMA8_SIGMA8_Pos 0 +#define HSMC_SIGMA8_SIGMA8_Msk (0x3fffu << HSMC_SIGMA8_SIGMA8_Pos) /**< \brief (HSMC_SIGMA8) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA8_SIGMA8(value) ((HSMC_SIGMA8_SIGMA8_Msk & ((value) << HSMC_SIGMA8_SIGMA8_Pos))) +/* -------- HSMC_SIGMA9 : (SMC Offset: 0x54C) PMECC Error Location SIGMA 9 Register -------- */ +#define HSMC_SIGMA9_SIGMA9_Pos 0 +#define HSMC_SIGMA9_SIGMA9_Msk (0x3fffu << HSMC_SIGMA9_SIGMA9_Pos) /**< \brief (HSMC_SIGMA9) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA9_SIGMA9(value) ((HSMC_SIGMA9_SIGMA9_Msk & ((value) << HSMC_SIGMA9_SIGMA9_Pos))) +/* -------- HSMC_SIGMA10 : (SMC Offset: 0x550) PMECC Error Location SIGMA 10 Register -------- */ +#define HSMC_SIGMA10_SIGMA10_Pos 0 +#define HSMC_SIGMA10_SIGMA10_Msk (0x3fffu << HSMC_SIGMA10_SIGMA10_Pos) /**< \brief (HSMC_SIGMA10) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA10_SIGMA10(value) ((HSMC_SIGMA10_SIGMA10_Msk & ((value) << HSMC_SIGMA10_SIGMA10_Pos))) +/* -------- HSMC_SIGMA11 : (SMC Offset: 0x554) PMECC Error Location SIGMA 11 Register -------- */ +#define HSMC_SIGMA11_SIGMA11_Pos 0 +#define HSMC_SIGMA11_SIGMA11_Msk (0x3fffu << HSMC_SIGMA11_SIGMA11_Pos) /**< \brief (HSMC_SIGMA11) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA11_SIGMA11(value) ((HSMC_SIGMA11_SIGMA11_Msk & ((value) << HSMC_SIGMA11_SIGMA11_Pos))) +/* -------- HSMC_SIGMA12 : (SMC Offset: 0x558) PMECC Error Location SIGMA 12 Register -------- */ +#define HSMC_SIGMA12_SIGMA12_Pos 0 +#define HSMC_SIGMA12_SIGMA12_Msk (0x3fffu << HSMC_SIGMA12_SIGMA12_Pos) /**< \brief (HSMC_SIGMA12) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA12_SIGMA12(value) ((HSMC_SIGMA12_SIGMA12_Msk & ((value) << HSMC_SIGMA12_SIGMA12_Pos))) +/* -------- HSMC_SIGMA13 : (SMC Offset: 0x55C) PMECC Error Location SIGMA 13 Register -------- */ +#define HSMC_SIGMA13_SIGMA13_Pos 0 +#define HSMC_SIGMA13_SIGMA13_Msk (0x3fffu << HSMC_SIGMA13_SIGMA13_Pos) /**< \brief (HSMC_SIGMA13) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA13_SIGMA13(value) ((HSMC_SIGMA13_SIGMA13_Msk & ((value) << HSMC_SIGMA13_SIGMA13_Pos))) +/* -------- HSMC_SIGMA14 : (SMC Offset: 0x560) PMECC Error Location SIGMA 14 Register -------- */ +#define HSMC_SIGMA14_SIGMA14_Pos 0 +#define HSMC_SIGMA14_SIGMA14_Msk (0x3fffu << HSMC_SIGMA14_SIGMA14_Pos) /**< \brief (HSMC_SIGMA14) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA14_SIGMA14(value) ((HSMC_SIGMA14_SIGMA14_Msk & ((value) << HSMC_SIGMA14_SIGMA14_Pos))) +/* -------- HSMC_SIGMA15 : (SMC Offset: 0x564) PMECC Error Location SIGMA 15 Register -------- */ +#define HSMC_SIGMA15_SIGMA15_Pos 0 +#define HSMC_SIGMA15_SIGMA15_Msk (0x3fffu << HSMC_SIGMA15_SIGMA15_Pos) /**< \brief (HSMC_SIGMA15) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA15_SIGMA15(value) ((HSMC_SIGMA15_SIGMA15_Msk & ((value) << HSMC_SIGMA15_SIGMA15_Pos))) +/* -------- HSMC_SIGMA16 : (SMC Offset: 0x568) PMECC Error Location SIGMA 16 Register -------- */ +#define HSMC_SIGMA16_SIGMA16_Pos 0 +#define HSMC_SIGMA16_SIGMA16_Msk (0x3fffu << HSMC_SIGMA16_SIGMA16_Pos) /**< \brief (HSMC_SIGMA16) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA16_SIGMA16(value) ((HSMC_SIGMA16_SIGMA16_Msk & ((value) << HSMC_SIGMA16_SIGMA16_Pos))) +/* -------- HSMC_SIGMA17 : (SMC Offset: 0x56C) PMECC Error Location SIGMA 17 Register -------- */ +#define HSMC_SIGMA17_SIGMA17_Pos 0 +#define HSMC_SIGMA17_SIGMA17_Msk (0x3fffu << HSMC_SIGMA17_SIGMA17_Pos) /**< \brief (HSMC_SIGMA17) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA17_SIGMA17(value) ((HSMC_SIGMA17_SIGMA17_Msk & ((value) << HSMC_SIGMA17_SIGMA17_Pos))) +/* -------- HSMC_SIGMA18 : (SMC Offset: 0x570) PMECC Error Location SIGMA 18 Register -------- */ +#define HSMC_SIGMA18_SIGMA18_Pos 0 +#define HSMC_SIGMA18_SIGMA18_Msk (0x3fffu << HSMC_SIGMA18_SIGMA18_Pos) /**< \brief (HSMC_SIGMA18) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA18_SIGMA18(value) ((HSMC_SIGMA18_SIGMA18_Msk & ((value) << HSMC_SIGMA18_SIGMA18_Pos))) +/* -------- HSMC_SIGMA19 : (SMC Offset: 0x574) PMECC Error Location SIGMA 19 Register -------- */ +#define HSMC_SIGMA19_SIGMA19_Pos 0 +#define HSMC_SIGMA19_SIGMA19_Msk (0x3fffu << HSMC_SIGMA19_SIGMA19_Pos) /**< \brief (HSMC_SIGMA19) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA19_SIGMA19(value) ((HSMC_SIGMA19_SIGMA19_Msk & ((value) << HSMC_SIGMA19_SIGMA19_Pos))) +/* -------- HSMC_SIGMA20 : (SMC Offset: 0x578) PMECC Error Location SIGMA 20 Register -------- */ +#define HSMC_SIGMA20_SIGMA20_Pos 0 +#define HSMC_SIGMA20_SIGMA20_Msk (0x3fffu << HSMC_SIGMA20_SIGMA20_Pos) /**< \brief (HSMC_SIGMA20) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA20_SIGMA20(value) ((HSMC_SIGMA20_SIGMA20_Msk & ((value) << HSMC_SIGMA20_SIGMA20_Pos))) +/* -------- HSMC_SIGMA21 : (SMC Offset: 0x57C) PMECC Error Location SIGMA 21 Register -------- */ +#define HSMC_SIGMA21_SIGMA21_Pos 0 +#define HSMC_SIGMA21_SIGMA21_Msk (0x3fffu << HSMC_SIGMA21_SIGMA21_Pos) /**< \brief (HSMC_SIGMA21) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA21_SIGMA21(value) ((HSMC_SIGMA21_SIGMA21_Msk & ((value) << HSMC_SIGMA21_SIGMA21_Pos))) +/* -------- HSMC_SIGMA22 : (SMC Offset: 0x580) PMECC Error Location SIGMA 22 Register -------- */ +#define HSMC_SIGMA22_SIGMA22_Pos 0 +#define HSMC_SIGMA22_SIGMA22_Msk (0x3fffu << HSMC_SIGMA22_SIGMA22_Pos) /**< \brief (HSMC_SIGMA22) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA22_SIGMA22(value) ((HSMC_SIGMA22_SIGMA22_Msk & ((value) << HSMC_SIGMA22_SIGMA22_Pos))) +/* -------- HSMC_SIGMA23 : (SMC Offset: 0x584) PMECC Error Location SIGMA 23 Register -------- */ +#define HSMC_SIGMA23_SIGMA23_Pos 0 +#define HSMC_SIGMA23_SIGMA23_Msk (0x3fffu << HSMC_SIGMA23_SIGMA23_Pos) /**< \brief (HSMC_SIGMA23) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA23_SIGMA23(value) ((HSMC_SIGMA23_SIGMA23_Msk & ((value) << HSMC_SIGMA23_SIGMA23_Pos))) +/* -------- HSMC_SIGMA24 : (SMC Offset: 0x588) PMECC Error Location SIGMA 24 Register -------- */ +#define HSMC_SIGMA24_SIGMA24_Pos 0 +#define HSMC_SIGMA24_SIGMA24_Msk (0x3fffu << HSMC_SIGMA24_SIGMA24_Pos) /**< \brief (HSMC_SIGMA24) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA24_SIGMA24(value) ((HSMC_SIGMA24_SIGMA24_Msk & ((value) << HSMC_SIGMA24_SIGMA24_Pos))) +/* -------- HSMC_SIGMA25 : (SMC Offset: 0x58C) PMECC Error Location SIGMA 25 Register -------- */ +#define HSMC_SIGMA25_SIGMA25_Pos 0 +#define HSMC_SIGMA25_SIGMA25_Msk (0x3fffu << HSMC_SIGMA25_SIGMA25_Pos) /**< \brief (HSMC_SIGMA25) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA25_SIGMA25(value) ((HSMC_SIGMA25_SIGMA25_Msk & ((value) << HSMC_SIGMA25_SIGMA25_Pos))) +/* -------- HSMC_SIGMA26 : (SMC Offset: 0x590) PMECC Error Location SIGMA 26 Register -------- */ +#define HSMC_SIGMA26_SIGMA26_Pos 0 +#define HSMC_SIGMA26_SIGMA26_Msk (0x3fffu << HSMC_SIGMA26_SIGMA26_Pos) /**< \brief (HSMC_SIGMA26) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA26_SIGMA26(value) ((HSMC_SIGMA26_SIGMA26_Msk & ((value) << HSMC_SIGMA26_SIGMA26_Pos))) +/* -------- HSMC_SIGMA27 : (SMC Offset: 0x594) PMECC Error Location SIGMA 27 Register -------- */ +#define HSMC_SIGMA27_SIGMA27_Pos 0 +#define HSMC_SIGMA27_SIGMA27_Msk (0x3fffu << HSMC_SIGMA27_SIGMA27_Pos) /**< \brief (HSMC_SIGMA27) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA27_SIGMA27(value) ((HSMC_SIGMA27_SIGMA27_Msk & ((value) << HSMC_SIGMA27_SIGMA27_Pos))) +/* -------- HSMC_SIGMA28 : (SMC Offset: 0x598) PMECC Error Location SIGMA 28 Register -------- */ +#define HSMC_SIGMA28_SIGMA28_Pos 0 +#define HSMC_SIGMA28_SIGMA28_Msk (0x3fffu << HSMC_SIGMA28_SIGMA28_Pos) /**< \brief (HSMC_SIGMA28) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA28_SIGMA28(value) ((HSMC_SIGMA28_SIGMA28_Msk & ((value) << HSMC_SIGMA28_SIGMA28_Pos))) +/* -------- HSMC_SIGMA29 : (SMC Offset: 0x59C) PMECC Error Location SIGMA 29 Register -------- */ +#define HSMC_SIGMA29_SIGMA29_Pos 0 +#define HSMC_SIGMA29_SIGMA29_Msk (0x3fffu << HSMC_SIGMA29_SIGMA29_Pos) /**< \brief (HSMC_SIGMA29) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA29_SIGMA29(value) ((HSMC_SIGMA29_SIGMA29_Msk & ((value) << HSMC_SIGMA29_SIGMA29_Pos))) +/* -------- HSMC_SIGMA30 : (SMC Offset: 0x5A0) PMECC Error Location SIGMA 30 Register -------- */ +#define HSMC_SIGMA30_SIGMA30_Pos 0 +#define HSMC_SIGMA30_SIGMA30_Msk (0x3fffu << HSMC_SIGMA30_SIGMA30_Pos) /**< \brief (HSMC_SIGMA30) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA30_SIGMA30(value) ((HSMC_SIGMA30_SIGMA30_Msk & ((value) << HSMC_SIGMA30_SIGMA30_Pos))) +/* -------- HSMC_SIGMA31 : (SMC Offset: 0x5A4) PMECC Error Location SIGMA 31 Register -------- */ +#define HSMC_SIGMA31_SIGMA31_Pos 0 +#define HSMC_SIGMA31_SIGMA31_Msk (0x3fffu << HSMC_SIGMA31_SIGMA31_Pos) /**< \brief (HSMC_SIGMA31) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA31_SIGMA31(value) ((HSMC_SIGMA31_SIGMA31_Msk & ((value) << HSMC_SIGMA31_SIGMA31_Pos))) +/* -------- HSMC_SIGMA32 : (SMC Offset: 0x5A8) PMECC Error Location SIGMA 32 Register -------- */ +#define HSMC_SIGMA32_SIGMA32_Pos 0 +#define HSMC_SIGMA32_SIGMA32_Msk (0x3fffu << HSMC_SIGMA32_SIGMA32_Pos) /**< \brief (HSMC_SIGMA32) Coefficient of degree x in the SIGMA polynomial */ +#define HSMC_SIGMA32_SIGMA32(value) ((HSMC_SIGMA32_SIGMA32_Msk & ((value) << HSMC_SIGMA32_SIGMA32_Pos))) +/* -------- HSMC_ERRLOC0 : (SMC Offset: 0x5AC) PMECC Error Location 0 Register -------- */ +#define HSMC_ERRLOC0_ERRLOCN_Pos 0 +#define HSMC_ERRLOC0_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC0_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC0) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC1 : (SMC Offset: 0x5B0) PMECC Error Location 1 Register -------- */ +#define HSMC_ERRLOC1_ERRLOCN_Pos 0 +#define HSMC_ERRLOC1_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC1_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC1) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC2 : (SMC Offset: 0x5B4) PMECC Error Location 2 Register -------- */ +#define HSMC_ERRLOC2_ERRLOCN_Pos 0 +#define HSMC_ERRLOC2_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC2_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC2) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC3 : (SMC Offset: 0x5B8) PMECC Error Location 3 Register -------- */ +#define HSMC_ERRLOC3_ERRLOCN_Pos 0 +#define HSMC_ERRLOC3_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC3_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC3) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC4 : (SMC Offset: 0x5BC) PMECC Error Location 4 Register -------- */ +#define HSMC_ERRLOC4_ERRLOCN_Pos 0 +#define HSMC_ERRLOC4_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC4_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC4) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC5 : (SMC Offset: 0x5C0) PMECC Error Location 5 Register -------- */ +#define HSMC_ERRLOC5_ERRLOCN_Pos 0 +#define HSMC_ERRLOC5_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC5_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC5) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC6 : (SMC Offset: 0x5C4) PMECC Error Location 6 Register -------- */ +#define HSMC_ERRLOC6_ERRLOCN_Pos 0 +#define HSMC_ERRLOC6_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC6_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC6) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC7 : (SMC Offset: 0x5C8) PMECC Error Location 7 Register -------- */ +#define HSMC_ERRLOC7_ERRLOCN_Pos 0 +#define HSMC_ERRLOC7_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC7_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC7) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC8 : (SMC Offset: 0x5CC) PMECC Error Location 8 Register -------- */ +#define HSMC_ERRLOC8_ERRLOCN_Pos 0 +#define HSMC_ERRLOC8_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC8_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC8) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC9 : (SMC Offset: 0x5D0) PMECC Error Location 9 Register -------- */ +#define HSMC_ERRLOC9_ERRLOCN_Pos 0 +#define HSMC_ERRLOC9_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC9_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC9) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC10 : (SMC Offset: 0x5D4) PMECC Error Location 10 Register -------- */ +#define HSMC_ERRLOC10_ERRLOCN_Pos 0 +#define HSMC_ERRLOC10_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC10_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC10) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC11 : (SMC Offset: 0x5D8) PMECC Error Location 11 Register -------- */ +#define HSMC_ERRLOC11_ERRLOCN_Pos 0 +#define HSMC_ERRLOC11_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC11_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC11) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC12 : (SMC Offset: 0x5DC) PMECC Error Location 12 Register -------- */ +#define HSMC_ERRLOC12_ERRLOCN_Pos 0 +#define HSMC_ERRLOC12_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC12_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC12) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC13 : (SMC Offset: 0x5E0) PMECC Error Location 13 Register -------- */ +#define HSMC_ERRLOC13_ERRLOCN_Pos 0 +#define HSMC_ERRLOC13_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC13_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC13) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC14 : (SMC Offset: 0x5E4) PMECC Error Location 14 Register -------- */ +#define HSMC_ERRLOC14_ERRLOCN_Pos 0 +#define HSMC_ERRLOC14_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC14_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC14) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC15 : (SMC Offset: 0x5E8) PMECC Error Location 15 Register -------- */ +#define HSMC_ERRLOC15_ERRLOCN_Pos 0 +#define HSMC_ERRLOC15_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC15_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC15) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC16 : (SMC Offset: 0x5EC) PMECC Error Location 16 Register -------- */ +#define HSMC_ERRLOC16_ERRLOCN_Pos 0 +#define HSMC_ERRLOC16_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC16_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC16) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC17 : (SMC Offset: 0x5F0) PMECC Error Location 17 Register -------- */ +#define HSMC_ERRLOC17_ERRLOCN_Pos 0 +#define HSMC_ERRLOC17_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC17_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC17) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC18 : (SMC Offset: 0x5F4) PMECC Error Location 18 Register -------- */ +#define HSMC_ERRLOC18_ERRLOCN_Pos 0 +#define HSMC_ERRLOC18_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC18_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC18) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC19 : (SMC Offset: 0x5F8) PMECC Error Location 19 Register -------- */ +#define HSMC_ERRLOC19_ERRLOCN_Pos 0 +#define HSMC_ERRLOC19_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC19_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC19) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC20 : (SMC Offset: 0x5FC) PMECC Error Location 20 Register -------- */ +#define HSMC_ERRLOC20_ERRLOCN_Pos 0 +#define HSMC_ERRLOC20_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC20_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC20) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC21 : (SMC Offset: 0x600) PMECC Error Location 21 Register -------- */ +#define HSMC_ERRLOC21_ERRLOCN_Pos 0 +#define HSMC_ERRLOC21_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC21_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC21) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC22 : (SMC Offset: 0x604) PMECC Error Location 22 Register -------- */ +#define HSMC_ERRLOC22_ERRLOCN_Pos 0 +#define HSMC_ERRLOC22_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC22_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC22) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_ERRLOC23 : (SMC Offset: 0x608) PMECC Error Location 23 Register -------- */ +#define HSMC_ERRLOC23_ERRLOCN_Pos 0 +#define HSMC_ERRLOC23_ERRLOCN_Msk (0x3fffu << HSMC_ERRLOC23_ERRLOCN_Pos) /**< \brief (HSMC_ERRLOC23) Error Position within the Set {sector area, spare area} */ +/* -------- HSMC_SETUP : (SMC Offset: N/A) HSMC Setup Register -------- */ +#define HSMC_SETUP_NWE_SETUP_Pos 0 +#define HSMC_SETUP_NWE_SETUP_Msk (0x3fu << HSMC_SETUP_NWE_SETUP_Pos) /**< \brief (HSMC_SETUP) NWE Setup Length */ +#define HSMC_SETUP_NWE_SETUP(value) ((HSMC_SETUP_NWE_SETUP_Msk & ((value) << HSMC_SETUP_NWE_SETUP_Pos))) +#define HSMC_SETUP_NCS_WR_SETUP_Pos 8 +#define HSMC_SETUP_NCS_WR_SETUP_Msk (0x3fu << HSMC_SETUP_NCS_WR_SETUP_Pos) /**< \brief (HSMC_SETUP) NCS Setup Length in Write Access */ +#define HSMC_SETUP_NCS_WR_SETUP(value) ((HSMC_SETUP_NCS_WR_SETUP_Msk & ((value) << HSMC_SETUP_NCS_WR_SETUP_Pos))) +#define HSMC_SETUP_NRD_SETUP_Pos 16 +#define HSMC_SETUP_NRD_SETUP_Msk (0x3fu << HSMC_SETUP_NRD_SETUP_Pos) /**< \brief (HSMC_SETUP) NRD Setup Length */ +#define HSMC_SETUP_NRD_SETUP(value) ((HSMC_SETUP_NRD_SETUP_Msk & ((value) << HSMC_SETUP_NRD_SETUP_Pos))) +#define HSMC_SETUP_NCS_RD_SETUP_Pos 24 +#define HSMC_SETUP_NCS_RD_SETUP_Msk (0x3fu << HSMC_SETUP_NCS_RD_SETUP_Pos) /**< \brief (HSMC_SETUP) NCS Setup Length in Read Access */ +#define HSMC_SETUP_NCS_RD_SETUP(value) ((HSMC_SETUP_NCS_RD_SETUP_Msk & ((value) << HSMC_SETUP_NCS_RD_SETUP_Pos))) +/* -------- HSMC_PULSE : (SMC Offset: N/A) HSMC Pulse Register -------- */ +#define HSMC_PULSE_NWE_PULSE_Pos 0 +#define HSMC_PULSE_NWE_PULSE_Msk (0x7fu << HSMC_PULSE_NWE_PULSE_Pos) /**< \brief (HSMC_PULSE) NWE Pulse Length */ +#define HSMC_PULSE_NWE_PULSE(value) ((HSMC_PULSE_NWE_PULSE_Msk & ((value) << HSMC_PULSE_NWE_PULSE_Pos))) +#define HSMC_PULSE_NCS_WR_PULSE_Pos 8 +#define HSMC_PULSE_NCS_WR_PULSE_Msk (0x7fu << HSMC_PULSE_NCS_WR_PULSE_Pos) /**< \brief (HSMC_PULSE) NCS Pulse Length in WRITE Access */ +#define HSMC_PULSE_NCS_WR_PULSE(value) ((HSMC_PULSE_NCS_WR_PULSE_Msk & ((value) << HSMC_PULSE_NCS_WR_PULSE_Pos))) +#define HSMC_PULSE_NRD_PULSE_Pos 16 +#define HSMC_PULSE_NRD_PULSE_Msk (0x7fu << HSMC_PULSE_NRD_PULSE_Pos) /**< \brief (HSMC_PULSE) NRD Pulse Length */ +#define HSMC_PULSE_NRD_PULSE(value) ((HSMC_PULSE_NRD_PULSE_Msk & ((value) << HSMC_PULSE_NRD_PULSE_Pos))) +#define HSMC_PULSE_NCS_RD_PULSE_Pos 24 +#define HSMC_PULSE_NCS_RD_PULSE_Msk (0x7fu << HSMC_PULSE_NCS_RD_PULSE_Pos) /**< \brief (HSMC_PULSE) NCS Pulse Length in READ Access */ +#define HSMC_PULSE_NCS_RD_PULSE(value) ((HSMC_PULSE_NCS_RD_PULSE_Msk & ((value) << HSMC_PULSE_NCS_RD_PULSE_Pos))) +/* -------- HSMC_CYCLE : (SMC Offset: N/A) HSMC Cycle Register -------- */ +#define HSMC_CYCLE_NWE_CYCLE_Pos 0 +#define HSMC_CYCLE_NWE_CYCLE_Msk (0x1ffu << HSMC_CYCLE_NWE_CYCLE_Pos) /**< \brief (HSMC_CYCLE) Total Write Cycle Length */ +#define HSMC_CYCLE_NWE_CYCLE(value) ((HSMC_CYCLE_NWE_CYCLE_Msk & ((value) << HSMC_CYCLE_NWE_CYCLE_Pos))) +#define HSMC_CYCLE_NRD_CYCLE_Pos 16 +#define HSMC_CYCLE_NRD_CYCLE_Msk (0x1ffu << HSMC_CYCLE_NRD_CYCLE_Pos) /**< \brief (HSMC_CYCLE) Total Read Cycle Length */ +#define HSMC_CYCLE_NRD_CYCLE(value) ((HSMC_CYCLE_NRD_CYCLE_Msk & ((value) << HSMC_CYCLE_NRD_CYCLE_Pos))) +/* -------- HSMC_TIMINGS : (SMC Offset: N/A) HSMC Timings Register -------- */ +#define HSMC_TIMINGS_TCLR_Pos 0 +#define HSMC_TIMINGS_TCLR_Msk (0xfu << HSMC_TIMINGS_TCLR_Pos) /**< \brief (HSMC_TIMINGS) CLE to REN Low Delay */ +#define HSMC_TIMINGS_TCLR(value) ((HSMC_TIMINGS_TCLR_Msk & ((value) << HSMC_TIMINGS_TCLR_Pos))) +#define HSMC_TIMINGS_TADL_Pos 4 +#define HSMC_TIMINGS_TADL_Msk (0xfu << HSMC_TIMINGS_TADL_Pos) /**< \brief (HSMC_TIMINGS) ALE to Data Start */ +#define HSMC_TIMINGS_TADL(value) ((HSMC_TIMINGS_TADL_Msk & ((value) << HSMC_TIMINGS_TADL_Pos))) +#define HSMC_TIMINGS_TAR_Pos 8 +#define HSMC_TIMINGS_TAR_Msk (0xfu << HSMC_TIMINGS_TAR_Pos) /**< \brief (HSMC_TIMINGS) ALE to REN Low Delay */ +#define HSMC_TIMINGS_TAR(value) ((HSMC_TIMINGS_TAR_Msk & ((value) << HSMC_TIMINGS_TAR_Pos))) +#define HSMC_TIMINGS_OCMS (0x1u << 12) /**< \brief (HSMC_TIMINGS) Off Chip Memory Scrambling Enable */ +#define HSMC_TIMINGS_TRR_Pos 16 +#define HSMC_TIMINGS_TRR_Msk (0xfu << HSMC_TIMINGS_TRR_Pos) /**< \brief (HSMC_TIMINGS) Ready to REN Low Delay */ +#define HSMC_TIMINGS_TRR(value) ((HSMC_TIMINGS_TRR_Msk & ((value) << HSMC_TIMINGS_TRR_Pos))) +#define HSMC_TIMINGS_TWB_Pos 24 +#define HSMC_TIMINGS_TWB_Msk (0xfu << HSMC_TIMINGS_TWB_Pos) /**< \brief (HSMC_TIMINGS) WEN High to REN to Busy */ +#define HSMC_TIMINGS_TWB(value) ((HSMC_TIMINGS_TWB_Msk & ((value) << HSMC_TIMINGS_TWB_Pos))) +#define HSMC_TIMINGS_RBNSEL_Pos 28 +#define HSMC_TIMINGS_RBNSEL_Msk (0x7u << HSMC_TIMINGS_RBNSEL_Pos) /**< \brief (HSMC_TIMINGS) Ready/Busy Line Selection */ +#define HSMC_TIMINGS_RBNSEL(value) ((HSMC_TIMINGS_RBNSEL_Msk & ((value) << HSMC_TIMINGS_RBNSEL_Pos))) +#define HSMC_TIMINGS_NFSEL (0x1u << 31) /**< \brief (HSMC_TIMINGS) NAND Flash Selection */ +/* -------- HSMC_MODE : (SMC Offset: N/A) HSMC Mode Register -------- */ +#define HSMC_MODE_READ_MODE (0x1u << 0) /**< \brief (HSMC_MODE) Selection of the Control Signal for Read Operation */ +#define HSMC_MODE_READ_MODE_NCS_CTRL (0x0u << 0) /**< \brief (HSMC_MODE) The Read operation is controlled by the NCS signal. */ +#define HSMC_MODE_READ_MODE_NRD_CTRL (0x1u << 0) /**< \brief (HSMC_MODE) The Read operation is controlled by the NRD signal. */ +#define HSMC_MODE_WRITE_MODE (0x1u << 1) /**< \brief (HSMC_MODE) Selection of the Control Signal for Write Operation */ +#define HSMC_MODE_WRITE_MODE_NCS_CTRL (0x0u << 1) /**< \brief (HSMC_MODE) The Write operation is controller by the NCS signal. */ +#define HSMC_MODE_WRITE_MODE_NWE_CTRL (0x1u << 1) /**< \brief (HSMC_MODE) The Write operation is controlled by the NWE signal */ +#define HSMC_MODE_EXNW_MODE_Pos 4 +#define HSMC_MODE_EXNW_MODE_Msk (0x3u << HSMC_MODE_EXNW_MODE_Pos) /**< \brief (HSMC_MODE) NWAIT Mode */ +#define HSMC_MODE_EXNW_MODE(value) ((HSMC_MODE_EXNW_MODE_Msk & ((value) << HSMC_MODE_EXNW_MODE_Pos))) +#define HSMC_MODE_EXNW_MODE_DISABLED (0x0u << 4) /**< \brief (HSMC_MODE) Disabled-The NWAIT input signal is ignored on the corresponding Chip Select. */ +#define HSMC_MODE_EXNW_MODE_FROZEN (0x2u << 4) /**< \brief (HSMC_MODE) Frozen Mode-If asserted, the NWAIT signal freezes the current read or write cycle. After deassertion, the read/write cycle is resumed from the point where it was stopped. */ +#define HSMC_MODE_EXNW_MODE_READY (0x3u << 4) /**< \brief (HSMC_MODE) Ready Mode-The NWAIT signal indicates the availability of the external device at the end of the pulse of the controlling read or write signal, to complete the access. If high, the access normally completes. If low, the access is extended until NWAIT returns high. */ +#define HSMC_MODE_BAT (0x1u << 8) /**< \brief (HSMC_MODE) Byte Access Type */ +#define HSMC_MODE_BAT_BYTE_SELECT (0x0u << 8) /**< \brief (HSMC_MODE) Byte select access type:- Write operation is controlled using NCS, NWE, NBS0, NBS1.- Read operation is controlled using NCS, NRD, NBS0, NBS1. */ +#define HSMC_MODE_BAT_BYTE_WRITE (0x1u << 8) /**< \brief (HSMC_MODE) Byte write access type:- Write operation is controlled using NCS, NWR0, NWR1.- Read operation is controlled using NCS and NRD. */ +#define HSMC_MODE_DBW (0x1u << 12) /**< \brief (HSMC_MODE) Data Bus Width */ +#define HSMC_MODE_DBW_BIT_8 (0x0u << 12) /**< \brief (HSMC_MODE) 8-bit bus */ +#define HSMC_MODE_DBW_BIT_16 (0x1u << 12) /**< \brief (HSMC_MODE) 16-bit bus */ +#define HSMC_MODE_TDF_CYCLES_Pos 16 +#define HSMC_MODE_TDF_CYCLES_Msk (0xfu << HSMC_MODE_TDF_CYCLES_Pos) /**< \brief (HSMC_MODE) Data Float Time */ +#define HSMC_MODE_TDF_CYCLES(value) ((HSMC_MODE_TDF_CYCLES_Msk & ((value) << HSMC_MODE_TDF_CYCLES_Pos))) +#define HSMC_MODE_TDF_MODE (0x1u << 20) /**< \brief (HSMC_MODE) TDF Optimization */ +/* -------- HSMC_OCMS : (SMC Offset: 0x7A0) HSMC Off Chip Memory Scrambling Register -------- */ +#define HSMC_OCMS_SMSE (0x1u << 0) /**< \brief (HSMC_OCMS) Static Memory Controller Scrambling Enable */ +#define HSMC_OCMS_SRSE (0x1u << 1) /**< \brief (HSMC_OCMS) NFC Internal SRAM Scrambling Enable */ +/* -------- HSMC_KEY1 : (SMC Offset: 0x7A4) HSMC Off Chip Memory Scrambling KEY1 Register -------- */ +#define HSMC_KEY1_KEY1_Pos 0 +#define HSMC_KEY1_KEY1_Msk (0xffffffffu << HSMC_KEY1_KEY1_Pos) /**< \brief (HSMC_KEY1) Off Chip Memory Scrambling (OCMS) Key Part 1 */ +#define HSMC_KEY1_KEY1(value) ((HSMC_KEY1_KEY1_Msk & ((value) << HSMC_KEY1_KEY1_Pos))) +/* -------- HSMC_KEY2 : (SMC Offset: 0x7A8) HSMC Off Chip Memory Scrambling KEY2 Register -------- */ +#define HSMC_KEY2_KEY2_Pos 0 +#define HSMC_KEY2_KEY2_Msk (0xffffffffu << HSMC_KEY2_KEY2_Pos) /**< \brief (HSMC_KEY2) Off Chip Memory Scrambling (OCMS) Key Part 2 */ +#define HSMC_KEY2_KEY2(value) ((HSMC_KEY2_KEY2_Msk & ((value) << HSMC_KEY2_KEY2_Pos))) +/* -------- HSMC_WPMR : (SMC Offset: 0x7E4) HSMC Write Protection Mode Register -------- */ +#define HSMC_WPMR_WPEN (0x1u << 0) /**< \brief (HSMC_WPMR) Write Protection Enable */ +#define HSMC_WPMR_WPKEY_Pos 8 +#define HSMC_WPMR_WPKEY_Msk (0xffffffu << HSMC_WPMR_WPKEY_Pos) /**< \brief (HSMC_WPMR) Write Protection Key */ +#define HSMC_WPMR_WPKEY(value) ((HSMC_WPMR_WPKEY_Msk & ((value) << HSMC_WPMR_WPKEY_Pos))) +#define HSMC_WPMR_WPKEY_PASSWD (0x534D43u << 8) /**< \brief (HSMC_WPMR) Writing any other value in this field aborts the write operation of bit WPEN.Always reads as 0. */ +/* -------- HSMC_WPSR : (SMC Offset: 0x7E8) HSMC Write Protection Status Register -------- */ +#define HSMC_WPSR_WPVS (0x1u << 0) /**< \brief (HSMC_WPSR) Write Protection Violation Status */ +#define HSMC_WPSR_WPVSRC_Pos 8 +#define HSMC_WPSR_WPVSRC_Msk (0xffffu << HSMC_WPSR_WPVSRC_Pos) /**< \brief (HSMC_WPSR) Write Protection Violation Source */ +/* -------- HSMC_VERSION : (SMC Offset: 0x7FC) HSMC Version Register -------- */ +#define HSMC_VERSION_VERSION_Pos 0 +#define HSMC_VERSION_VERSION_Msk (0xfffu << HSMC_VERSION_VERSION_Pos) /**< \brief (HSMC_VERSION) Hardware Version Number */ +#define HSMC_VERSION_MFN_Pos 16 +#define HSMC_VERSION_MFN_Msk (0x7u << HSMC_VERSION_MFN_Pos) /**< \brief (HSMC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_SMC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_spi.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_spi.h new file mode 100644 index 000000000..b5bf2edf9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_spi.h @@ -0,0 +1,262 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SPI_COMPONENT_ +#define _SAMA5D2_SPI_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Serial Peripheral Interface */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SPI Serial Peripheral Interface */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Spi hardware registers */ +typedef struct { + __O uint32_t SPI_CR; /**< \brief (Spi Offset: 0x00) Control Register */ + __IO uint32_t SPI_MR; /**< \brief (Spi Offset: 0x04) Mode Register */ + __I uint32_t SPI_RDR; /**< \brief (Spi Offset: 0x08) Receive Data Register */ + __O uint32_t SPI_TDR; /**< \brief (Spi Offset: 0x0C) Transmit Data Register */ + __I uint32_t SPI_SR; /**< \brief (Spi Offset: 0x10) Status Register */ + __O uint32_t SPI_IER; /**< \brief (Spi Offset: 0x14) Interrupt Enable Register */ + __O uint32_t SPI_IDR; /**< \brief (Spi Offset: 0x18) Interrupt Disable Register */ + __I uint32_t SPI_IMR; /**< \brief (Spi Offset: 0x1C) Interrupt Mask Register */ + __I uint32_t Reserved1[4]; + __IO uint32_t SPI_CSR[4]; /**< \brief (Spi Offset: 0x30) Chip Select Register */ + __IO uint32_t SPI_FMR; /**< \brief (Spi Offset: 0x40) FIFO Mode Register */ + __I uint32_t SPI_FLR; /**< \brief (Spi Offset: 0x44) FIFO Level Register */ + __I uint32_t SPI_CMPR; /**< \brief (Spi Offset: 0x48) Comparison Register */ + __I uint32_t Reserved2[38]; + __IO uint32_t SPI_WPMR; /**< \brief (Spi Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t SPI_WPSR; /**< \brief (Spi Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved3[4]; + __I uint32_t SPI_VERSION; /**< \brief (Spi Offset: 0xFC) Version Register */ +} Spi; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SPI_CR : (SPI Offset: 0x00) Control Register -------- */ +#define SPI_CR_SPIEN (0x1u << 0) /**< \brief (SPI_CR) SPI Enable */ +#define SPI_CR_SPIDIS (0x1u << 1) /**< \brief (SPI_CR) SPI Disable */ +#define SPI_CR_SWRST (0x1u << 7) /**< \brief (SPI_CR) SPI Software Reset */ +#define SPI_CR_REQCLR (0x1u << 12) /**< \brief (SPI_CR) Request to Clear the Comparison Trigger */ +#define SPI_CR_TXFCLR (0x1u << 16) /**< \brief (SPI_CR) Transmit FIFO Clear */ +#define SPI_CR_RXFCLR (0x1u << 17) /**< \brief (SPI_CR) Receive FIFO Clear */ +#define SPI_CR_LASTXFER (0x1u << 24) /**< \brief (SPI_CR) Last Transfer */ +#define SPI_CR_FIFOEN (0x1u << 30) /**< \brief (SPI_CR) FIFO Enable */ +#define SPI_CR_FIFODIS (0x1u << 31) /**< \brief (SPI_CR) FIFO Disable */ +/* -------- SPI_MR : (SPI Offset: 0x04) Mode Register -------- */ +#define SPI_MR_MSTR (0x1u << 0) /**< \brief (SPI_MR) Master/Slave Mode */ +#define SPI_MR_PS (0x1u << 1) /**< \brief (SPI_MR) Peripheral Select */ +#define SPI_MR_PCSDEC (0x1u << 2) /**< \brief (SPI_MR) Chip Select Decode */ +#define SPI_MR_MODFDIS (0x1u << 4) /**< \brief (SPI_MR) Mode Fault Detection */ +#define SPI_MR_WDRBT (0x1u << 5) /**< \brief (SPI_MR) Wait Data Read Before Transfer */ +#define SPI_MR_LLB (0x1u << 7) /**< \brief (SPI_MR) Local Loopback Enable */ +#define SPI_MR_CMPMODE (0x1u << 12) /**< \brief (SPI_MR) Comparison Mode */ +#define SPI_MR_CMPMODE_FLAG_ONLY (0x0u << 12) /**< \brief (SPI_MR) Any character is received and comparison function drives CMP flag. */ +#define SPI_MR_CMPMODE_START_CONDITION (0x1u << 12) /**< \brief (SPI_MR) Comparison condition must be met to start reception of all incoming characters until REQCLR is set. */ +#define SPI_MR_PCS_Pos 16 +#define SPI_MR_PCS_Msk (0xfu << SPI_MR_PCS_Pos) /**< \brief (SPI_MR) Peripheral Chip Select */ +#define SPI_MR_PCS(value) ((SPI_MR_PCS_Msk & ((value) << SPI_MR_PCS_Pos))) +#define SPI_MR_DLYBCS_Pos 24 +#define SPI_MR_DLYBCS_Msk (0xffu << SPI_MR_DLYBCS_Pos) /**< \brief (SPI_MR) Delay Between Chip Selects */ +#define SPI_MR_DLYBCS(value) ((SPI_MR_DLYBCS_Msk & ((value) << SPI_MR_DLYBCS_Pos))) +/* -------- SPI_RDR : (SPI Offset: 0x08) Receive Data Register -------- */ +#define SPI_RDR_RD_Pos 0 +#define SPI_RDR_RD_Msk (0xffffu << SPI_RDR_RD_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_PCS_Pos 16 +#define SPI_RDR_PCS_Msk (0xfu << SPI_RDR_PCS_Pos) /**< \brief (SPI_RDR) Peripheral Chip Select */ +#define SPI_RDR_RD0_Pos 0 +#define SPI_RDR_RD0_Msk (0xffu << SPI_RDR_RD0_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD1_Pos 8 +#define SPI_RDR_RD1_Msk (0xffu << SPI_RDR_RD1_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD2_Pos 16 +#define SPI_RDR_RD2_Msk (0xffu << SPI_RDR_RD2_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD3_Pos 24 +#define SPI_RDR_RD3_Msk (0xffu << SPI_RDR_RD3_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD0_FIFO_MULTI_DATA_16_Pos 0 +#define SPI_RDR_RD0_FIFO_MULTI_DATA_16_Msk (0xffffu << SPI_RDR_RD0_FIFO_MULTI_DATA_16_Pos) /**< \brief (SPI_RDR) Receive Data */ +#define SPI_RDR_RD1_FIFO_MULTI_DATA_16_Pos 16 +#define SPI_RDR_RD1_FIFO_MULTI_DATA_16_Msk (0xffffu << SPI_RDR_RD1_FIFO_MULTI_DATA_16_Pos) /**< \brief (SPI_RDR) Receive Data */ +/* -------- SPI_TDR : (SPI Offset: 0x0C) Transmit Data Register -------- */ +#define SPI_TDR_TD_Pos 0 +#define SPI_TDR_TD_Msk (0xffffu << SPI_TDR_TD_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD(value) ((SPI_TDR_TD_Msk & ((value) << SPI_TDR_TD_Pos))) +#define SPI_TDR_PCS_Pos 16 +#define SPI_TDR_PCS_Msk (0xfu << SPI_TDR_PCS_Pos) /**< \brief (SPI_TDR) Peripheral Chip Select */ +#define SPI_TDR_PCS(value) ((SPI_TDR_PCS_Msk & ((value) << SPI_TDR_PCS_Pos))) +#define SPI_TDR_LASTXFER (0x1u << 24) /**< \brief (SPI_TDR) Last Transfer */ +#define SPI_TDR_TD0_Pos 0 +#define SPI_TDR_TD0_Msk (0xffffu << SPI_TDR_TD0_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD0(value) ((SPI_TDR_TD0_Msk & ((value) << SPI_TDR_TD0_Pos))) +#define SPI_TDR_TD1_Pos 16 +#define SPI_TDR_TD1_Msk (0xffffu << SPI_TDR_TD1_Pos) /**< \brief (SPI_TDR) Transmit Data */ +#define SPI_TDR_TD1(value) ((SPI_TDR_TD1_Msk & ((value) << SPI_TDR_TD1_Pos))) +/* -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- */ +#define SPI_SR_RDRF (0x1u << 0) /**< \brief (SPI_SR) Receive Data Register Full (cleared by reading SPI_RDR) */ +#define SPI_SR_TDRE (0x1u << 1) /**< \brief (SPI_SR) Transmit Data Register Empty (cleared by writing SPI_TDR) */ +#define SPI_SR_MODF (0x1u << 2) /**< \brief (SPI_SR) Mode Fault Error (cleared on read) */ +#define SPI_SR_OVRES (0x1u << 3) /**< \brief (SPI_SR) Overrun Error Status (cleared on read) */ +#define SPI_SR_NSSR (0x1u << 8) /**< \brief (SPI_SR) NSS Rising (cleared on read) */ +#define SPI_SR_TXEMPTY (0x1u << 9) /**< \brief (SPI_SR) Transmission Registers Empty (cleared by writing SPI_TDR) */ +#define SPI_SR_UNDES (0x1u << 10) /**< \brief (SPI_SR) Underrun Error Status (Slave mode only) (cleared on read) */ +#define SPI_SR_CMP (0x1u << 11) /**< \brief (SPI_SR) Comparison Status (cleared on read) */ +#define SPI_SR_SPIENS (0x1u << 16) /**< \brief (SPI_SR) SPI Enable Status */ +#define SPI_SR_TXFEF (0x1u << 24) /**< \brief (SPI_SR) Transmit FIFO Empty Flag (cleared on read) */ +#define SPI_SR_TXFFF (0x1u << 25) /**< \brief (SPI_SR) Transmit FIFO Full Flag (cleared on read) */ +#define SPI_SR_TXFTHF (0x1u << 26) /**< \brief (SPI_SR) Transmit FIFO Threshold Flag (cleared on read) */ +#define SPI_SR_RXFEF (0x1u << 27) /**< \brief (SPI_SR) Receive FIFO Empty Flag */ +#define SPI_SR_RXFFF (0x1u << 28) /**< \brief (SPI_SR) Receive FIFO Full Flag */ +#define SPI_SR_RXFTHF (0x1u << 29) /**< \brief (SPI_SR) Receive FIFO Threshold Flag */ +#define SPI_SR_TXFPTEF (0x1u << 30) /**< \brief (SPI_SR) Transmit FIFO Pointer Error Flag */ +#define SPI_SR_RXFPTEF (0x1u << 31) /**< \brief (SPI_SR) Receive FIFO Pointer Error Flag */ +/* -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- */ +#define SPI_IER_RDRF (0x1u << 0) /**< \brief (SPI_IER) Receive Data Register Full Interrupt Enable */ +#define SPI_IER_TDRE (0x1u << 1) /**< \brief (SPI_IER) SPI Transmit Data Register Empty Interrupt Enable */ +#define SPI_IER_MODF (0x1u << 2) /**< \brief (SPI_IER) Mode Fault Error Interrupt Enable */ +#define SPI_IER_OVRES (0x1u << 3) /**< \brief (SPI_IER) Overrun Error Interrupt Enable */ +#define SPI_IER_NSSR (0x1u << 8) /**< \brief (SPI_IER) NSS Rising Interrupt Enable */ +#define SPI_IER_TXEMPTY (0x1u << 9) /**< \brief (SPI_IER) Transmission Registers Empty Enable */ +#define SPI_IER_UNDES (0x1u << 10) /**< \brief (SPI_IER) Underrun Error Interrupt Enable */ +#define SPI_IER_CMP (0x1u << 11) /**< \brief (SPI_IER) Comparison Interrupt Enable */ +#define SPI_IER_TXFEF (0x1u << 24) /**< \brief (SPI_IER) TXFEF Interrupt Enable */ +#define SPI_IER_TXFFF (0x1u << 25) /**< \brief (SPI_IER) TXFFF Interrupt Enable */ +#define SPI_IER_TXFTHF (0x1u << 26) /**< \brief (SPI_IER) TXFTHF Interrupt Enable */ +#define SPI_IER_RXFEF (0x1u << 27) /**< \brief (SPI_IER) RXFEF Interrupt Enable */ +#define SPI_IER_RXFFF (0x1u << 28) /**< \brief (SPI_IER) RXFFF Interrupt Enable */ +#define SPI_IER_RXFTHF (0x1u << 29) /**< \brief (SPI_IER) RXFTHF Interrupt Enable */ +#define SPI_IER_TXFPTEF (0x1u << 30) /**< \brief (SPI_IER) TXFPTEF Interrupt Enable */ +#define SPI_IER_RXFPTEF (0x1u << 31) /**< \brief (SPI_IER) RXFPTEF Interrupt Enable */ +/* -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- */ +#define SPI_IDR_RDRF (0x1u << 0) /**< \brief (SPI_IDR) Receive Data Register Full Interrupt Disable */ +#define SPI_IDR_TDRE (0x1u << 1) /**< \brief (SPI_IDR) SPI Transmit Data Register Empty Interrupt Disable */ +#define SPI_IDR_MODF (0x1u << 2) /**< \brief (SPI_IDR) Mode Fault Error Interrupt Disable */ +#define SPI_IDR_OVRES (0x1u << 3) /**< \brief (SPI_IDR) Overrun Error Interrupt Disable */ +#define SPI_IDR_NSSR (0x1u << 8) /**< \brief (SPI_IDR) NSS Rising Interrupt Disable */ +#define SPI_IDR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IDR) Transmission Registers Empty Disable */ +#define SPI_IDR_UNDES (0x1u << 10) /**< \brief (SPI_IDR) Underrun Error Interrupt Disable */ +#define SPI_IDR_CMP (0x1u << 11) /**< \brief (SPI_IDR) Comparison Interrupt Disable */ +#define SPI_IDR_TXFEF (0x1u << 24) /**< \brief (SPI_IDR) TXFEF Interrupt Disable */ +#define SPI_IDR_TXFFF (0x1u << 25) /**< \brief (SPI_IDR) TXFFF Interrupt Disable */ +#define SPI_IDR_TXFTHF (0x1u << 26) /**< \brief (SPI_IDR) TXFTHF Interrupt Disable */ +#define SPI_IDR_RXFEF (0x1u << 27) /**< \brief (SPI_IDR) RXFEF Interrupt Disable */ +#define SPI_IDR_RXFFF (0x1u << 28) /**< \brief (SPI_IDR) RXFFF Interrupt Disable */ +#define SPI_IDR_RXFTHF (0x1u << 29) /**< \brief (SPI_IDR) RXFTHF Interrupt Disable */ +#define SPI_IDR_TXFPTEF (0x1u << 30) /**< \brief (SPI_IDR) TXFPTEF Interrupt Disable */ +#define SPI_IDR_RXFPTEF (0x1u << 31) /**< \brief (SPI_IDR) RXFPTEF Interrupt Disable */ +/* -------- SPI_IMR : (SPI Offset: 0x1C) Interrupt Mask Register -------- */ +#define SPI_IMR_RDRF (0x1u << 0) /**< \brief (SPI_IMR) Receive Data Register Full Interrupt Mask */ +#define SPI_IMR_TDRE (0x1u << 1) /**< \brief (SPI_IMR) SPI Transmit Data Register Empty Interrupt Mask */ +#define SPI_IMR_MODF (0x1u << 2) /**< \brief (SPI_IMR) Mode Fault Error Interrupt Mask */ +#define SPI_IMR_OVRES (0x1u << 3) /**< \brief (SPI_IMR) Overrun Error Interrupt Mask */ +#define SPI_IMR_NSSR (0x1u << 8) /**< \brief (SPI_IMR) NSS Rising Interrupt Mask */ +#define SPI_IMR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IMR) Transmission Registers Empty Mask */ +#define SPI_IMR_UNDES (0x1u << 10) /**< \brief (SPI_IMR) Underrun Error Interrupt Mask */ +#define SPI_IMR_CMP (0x1u << 11) /**< \brief (SPI_IMR) Comparison Interrupt Mask */ +#define SPI_IMR_TXFEF (0x1u << 24) /**< \brief (SPI_IMR) TXFEF Interrupt Mask */ +#define SPI_IMR_TXFFF (0x1u << 25) /**< \brief (SPI_IMR) TXFFF Interrupt Mask */ +#define SPI_IMR_TXFTHF (0x1u << 26) /**< \brief (SPI_IMR) TXFTHF Interrupt Mask */ +#define SPI_IMR_RXFEF (0x1u << 27) /**< \brief (SPI_IMR) RXFEF Interrupt Mask */ +#define SPI_IMR_RXFFF (0x1u << 28) /**< \brief (SPI_IMR) RXFFF Interrupt Mask */ +#define SPI_IMR_RXFTHF (0x1u << 29) /**< \brief (SPI_IMR) RXFTHF Interrupt Mask */ +#define SPI_IMR_TXFPTEF (0x1u << 30) /**< \brief (SPI_IMR) TXFPTEF Interrupt Mask */ +#define SPI_IMR_RXFPTEF (0x1u << 31) /**< \brief (SPI_IMR) RXFPTEF Interrupt Mask */ +/* -------- SPI_CSR[4] : (SPI Offset: 0x30) Chip Select Register -------- */ +#define SPI_CSR_CPOL (0x1u << 0) /**< \brief (SPI_CSR[4]) Clock Polarity */ +#define SPI_CSR_NCPHA (0x1u << 1) /**< \brief (SPI_CSR[4]) Clock Phase */ +#define SPI_CSR_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR[4]) Chip Select Not Active After Transfer (Ignored if CSAAT = 1) */ +#define SPI_CSR_CSAAT (0x1u << 3) /**< \brief (SPI_CSR[4]) Chip Select Active After Transfer */ +#define SPI_CSR_BITS_Pos 4 +#define SPI_CSR_BITS_Msk (0xfu << SPI_CSR_BITS_Pos) /**< \brief (SPI_CSR[4]) Bits Per Transfer */ +#define SPI_CSR_BITS(value) ((SPI_CSR_BITS_Msk & ((value) << SPI_CSR_BITS_Pos))) +#define SPI_CSR_BITS_8_BIT (0x0u << 4) /**< \brief (SPI_CSR[4]) 8 bits for transfer */ +#define SPI_CSR_BITS_9_BIT (0x1u << 4) /**< \brief (SPI_CSR[4]) 9 bits for transfer */ +#define SPI_CSR_BITS_10_BIT (0x2u << 4) /**< \brief (SPI_CSR[4]) 10 bits for transfer */ +#define SPI_CSR_BITS_11_BIT (0x3u << 4) /**< \brief (SPI_CSR[4]) 11 bits for transfer */ +#define SPI_CSR_BITS_12_BIT (0x4u << 4) /**< \brief (SPI_CSR[4]) 12 bits for transfer */ +#define SPI_CSR_BITS_13_BIT (0x5u << 4) /**< \brief (SPI_CSR[4]) 13 bits for transfer */ +#define SPI_CSR_BITS_14_BIT (0x6u << 4) /**< \brief (SPI_CSR[4]) 14 bits for transfer */ +#define SPI_CSR_BITS_15_BIT (0x7u << 4) /**< \brief (SPI_CSR[4]) 15 bits for transfer */ +#define SPI_CSR_BITS_16_BIT (0x8u << 4) /**< \brief (SPI_CSR[4]) 16 bits for transfer */ +#define SPI_CSR_SCBR_Pos 8 +#define SPI_CSR_SCBR_Msk (0xffu << SPI_CSR_SCBR_Pos) /**< \brief (SPI_CSR[4]) Serial Clock Bit Rate */ +#define SPI_CSR_SCBR(value) ((SPI_CSR_SCBR_Msk & ((value) << SPI_CSR_SCBR_Pos))) +#define SPI_CSR_DLYBS_Pos 16 +#define SPI_CSR_DLYBS_Msk (0xffu << SPI_CSR_DLYBS_Pos) /**< \brief (SPI_CSR[4]) Delay Before SPCK */ +#define SPI_CSR_DLYBS(value) ((SPI_CSR_DLYBS_Msk & ((value) << SPI_CSR_DLYBS_Pos))) +#define SPI_CSR_DLYBCT_Pos 24 +#define SPI_CSR_DLYBCT_Msk (0xffu << SPI_CSR_DLYBCT_Pos) /**< \brief (SPI_CSR[4]) Delay Between Consecutive Transfers */ +#define SPI_CSR_DLYBCT(value) ((SPI_CSR_DLYBCT_Msk & ((value) << SPI_CSR_DLYBCT_Pos))) +/* -------- SPI_FMR : (SPI Offset: 0x40) FIFO Mode Register -------- */ +#define SPI_FMR_TXRDYM_Pos 0 +#define SPI_FMR_TXRDYM_Msk (0x3u << SPI_FMR_TXRDYM_Pos) /**< \brief (SPI_FMR) Transmitter Data Register Empty Mode */ +#define SPI_FMR_TXRDYM(value) ((SPI_FMR_TXRDYM_Msk & ((value) << SPI_FMR_TXRDYM_Pos))) +#define SPI_FMR_TXRDYM_ONE_DATA (0x0u << 0) /**< \brief (SPI_FMR) TDRE will be at level '1' when at least one data can be written in the Transmit FIFO. */ +#define SPI_FMR_TXRDYM_TWO_DATA (0x1u << 0) /**< \brief (SPI_FMR) TDRE will be at level '1' when at least two data can be written in the Transmit FIFO. */ +#define SPI_FMR_TXRDYM_FOUR_DATA (0x2u << 0) /**< \brief (SPI_FMR) TDRE will be at level '1' when at least four data can be written in the Transmit FIFO. */ +#define SPI_FMR_RXRDYM_Pos 4 +#define SPI_FMR_RXRDYM_Msk (0x3u << SPI_FMR_RXRDYM_Pos) /**< \brief (SPI_FMR) Receiver Data Register Full Mode */ +#define SPI_FMR_RXRDYM(value) ((SPI_FMR_RXRDYM_Msk & ((value) << SPI_FMR_RXRDYM_Pos))) +#define SPI_FMR_RXRDYM_ONE_DATA (0x0u << 4) /**< \brief (SPI_FMR) RDRF will be at level '1' when at least one unread data is in the Receive FIFO. */ +#define SPI_FMR_RXRDYM_TWO_DATA (0x1u << 4) /**< \brief (SPI_FMR) RDRF will be at level '1' when at least two unread data are in the Receive FIFO. */ +#define SPI_FMR_RXRDYM_FOUR_DATA (0x2u << 4) /**< \brief (SPI_FMR) RDRF will be at level '1' when at least four unread data are in the Receive FIFO. */ +#define SPI_FMR_TXFTHRES_Pos 16 +#define SPI_FMR_TXFTHRES_Msk (0x3fu << SPI_FMR_TXFTHRES_Pos) /**< \brief (SPI_FMR) Transmit FIFO Threshold */ +#define SPI_FMR_TXFTHRES(value) ((SPI_FMR_TXFTHRES_Msk & ((value) << SPI_FMR_TXFTHRES_Pos))) +#define SPI_FMR_RXFTHRES_Pos 24 +#define SPI_FMR_RXFTHRES_Msk (0x3fu << SPI_FMR_RXFTHRES_Pos) /**< \brief (SPI_FMR) Receive FIFO Threshold */ +#define SPI_FMR_RXFTHRES(value) ((SPI_FMR_RXFTHRES_Msk & ((value) << SPI_FMR_RXFTHRES_Pos))) +/* -------- SPI_FLR : (SPI Offset: 0x44) FIFO Level Register -------- */ +#define SPI_FLR_TXFL_Pos 0 +#define SPI_FLR_TXFL_Msk (0x3fu << SPI_FLR_TXFL_Pos) /**< \brief (SPI_FLR) Transmit FIFO Level */ +#define SPI_FLR_RXFL_Pos 16 +#define SPI_FLR_RXFL_Msk (0x3fu << SPI_FLR_RXFL_Pos) /**< \brief (SPI_FLR) Receive FIFO Level */ +/* -------- SPI_CMPR : (SPI Offset: 0x48) Comparison Register -------- */ +#define SPI_CMPR_VAL1_Pos 0 +#define SPI_CMPR_VAL1_Msk (0xffffu << SPI_CMPR_VAL1_Pos) /**< \brief (SPI_CMPR) First Comparison Value for Received Character */ +#define SPI_CMPR_VAL2_Pos 16 +#define SPI_CMPR_VAL2_Msk (0xffffu << SPI_CMPR_VAL2_Pos) /**< \brief (SPI_CMPR) Second Comparison Value for Received Character */ +/* -------- SPI_WPMR : (SPI Offset: 0xE4) Write Protection Mode Register -------- */ +#define SPI_WPMR_WPEN (0x1u << 0) /**< \brief (SPI_WPMR) Write Protection Enable */ +#define SPI_WPMR_WPKEY_Pos 8 +#define SPI_WPMR_WPKEY_Msk (0xffffffu << SPI_WPMR_WPKEY_Pos) /**< \brief (SPI_WPMR) Write Protection Key */ +#define SPI_WPMR_WPKEY(value) ((SPI_WPMR_WPKEY_Msk & ((value) << SPI_WPMR_WPKEY_Pos))) +#define SPI_WPMR_WPKEY_PASSWD (0x535049u << 8) /**< \brief (SPI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- SPI_WPSR : (SPI Offset: 0xE8) Write Protection Status Register -------- */ +#define SPI_WPSR_WPVS (0x1u << 0) /**< \brief (SPI_WPSR) Write Protection Violation Status */ +#define SPI_WPSR_WPVSRC_Pos 8 +#define SPI_WPSR_WPVSRC_Msk (0xffu << SPI_WPSR_WPVSRC_Pos) /**< \brief (SPI_WPSR) Write Protection Violation Source */ +/* -------- SPI_VERSION : (SPI Offset: 0xFC) Version Register -------- */ +#define SPI_VERSION_VERSION_Pos 0 +#define SPI_VERSION_VERSION_Msk (0xfffu << SPI_VERSION_VERSION_Pos) /**< \brief (SPI_VERSION) Version of the Hardware Module */ +#define SPI_VERSION_MFN_Pos 16 +#define SPI_VERSION_MFN_Msk (0x7u << SPI_VERSION_MFN_Pos) /**< \brief (SPI_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_SPI_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_ssc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_ssc.h new file mode 100644 index 000000000..48d69a6d8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_ssc.h @@ -0,0 +1,287 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_SSC_COMPONENT_ +#define _SAMA5D2_SSC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Synchronous Serial Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_SSC Synchronous Serial Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Ssc hardware registers */ +typedef struct { + __O uint32_t SSC_CR; /**< \brief (Ssc Offset: 0x0) Control Register */ + __IO uint32_t SSC_CMR; /**< \brief (Ssc Offset: 0x4) Clock Mode Register */ + __I uint32_t Reserved1[2]; + __IO uint32_t SSC_RCMR; /**< \brief (Ssc Offset: 0x10) Receive Clock Mode Register */ + __IO uint32_t SSC_RFMR; /**< \brief (Ssc Offset: 0x14) Receive Frame Mode Register */ + __IO uint32_t SSC_TCMR; /**< \brief (Ssc Offset: 0x18) Transmit Clock Mode Register */ + __IO uint32_t SSC_TFMR; /**< \brief (Ssc Offset: 0x1C) Transmit Frame Mode Register */ + __I uint32_t SSC_RHR; /**< \brief (Ssc Offset: 0x20) Receive Holding Register */ + __O uint32_t SSC_THR; /**< \brief (Ssc Offset: 0x24) Transmit Holding Register */ + __I uint32_t Reserved2[2]; + __I uint32_t SSC_RSHR; /**< \brief (Ssc Offset: 0x30) Receive Sync. Holding Register */ + __IO uint32_t SSC_TSHR; /**< \brief (Ssc Offset: 0x34) Transmit Sync. Holding Register */ + __IO uint32_t SSC_RC0R; /**< \brief (Ssc Offset: 0x38) Receive Compare 0 Register */ + __IO uint32_t SSC_RC1R; /**< \brief (Ssc Offset: 0x3C) Receive Compare 1 Register */ + __I uint32_t SSC_SR; /**< \brief (Ssc Offset: 0x40) Status Register */ + __O uint32_t SSC_IER; /**< \brief (Ssc Offset: 0x44) Interrupt Enable Register */ + __O uint32_t SSC_IDR; /**< \brief (Ssc Offset: 0x48) Interrupt Disable Register */ + __I uint32_t SSC_IMR; /**< \brief (Ssc Offset: 0x4C) Interrupt Mask Register */ + __I uint32_t Reserved3[37]; + __IO uint32_t SSC_WPMR; /**< \brief (Ssc Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t SSC_WPSR; /**< \brief (Ssc Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved4[4]; + __I uint32_t SSC_VERSION; /**< \brief (Ssc Offset: 0xFC) Version Register */ +} Ssc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- SSC_CR : (SSC Offset: 0x0) Control Register -------- */ +#define SSC_CR_RXEN (0x1u << 0) /**< \brief (SSC_CR) Receive Enable */ +#define SSC_CR_RXDIS (0x1u << 1) /**< \brief (SSC_CR) Receive Disable */ +#define SSC_CR_TXEN (0x1u << 8) /**< \brief (SSC_CR) Transmit Enable */ +#define SSC_CR_TXDIS (0x1u << 9) /**< \brief (SSC_CR) Transmit Disable */ +#define SSC_CR_SWRST (0x1u << 15) /**< \brief (SSC_CR) Software Reset */ +/* -------- SSC_CMR : (SSC Offset: 0x4) Clock Mode Register -------- */ +#define SSC_CMR_DIV_Pos 0 +#define SSC_CMR_DIV_Msk (0xfffu << SSC_CMR_DIV_Pos) /**< \brief (SSC_CMR) Clock Divider */ +#define SSC_CMR_DIV(value) ((SSC_CMR_DIV_Msk & ((value) << SSC_CMR_DIV_Pos))) +/* -------- SSC_RCMR : (SSC Offset: 0x10) Receive Clock Mode Register -------- */ +#define SSC_RCMR_CKS_Pos 0 +#define SSC_RCMR_CKS_Msk (0x3u << SSC_RCMR_CKS_Pos) /**< \brief (SSC_RCMR) Receive Clock Selection */ +#define SSC_RCMR_CKS(value) ((SSC_RCMR_CKS_Msk & ((value) << SSC_RCMR_CKS_Pos))) +#define SSC_RCMR_CKS_MCK (0x0u << 0) /**< \brief (SSC_RCMR) Divided Clock */ +#define SSC_RCMR_CKS_TK (0x1u << 0) /**< \brief (SSC_RCMR) TK Clock signal */ +#define SSC_RCMR_CKS_RK (0x2u << 0) /**< \brief (SSC_RCMR) RK pin */ +#define SSC_RCMR_CKO_Pos 2 +#define SSC_RCMR_CKO_Msk (0x7u << SSC_RCMR_CKO_Pos) /**< \brief (SSC_RCMR) Receive Clock Output Mode Selection */ +#define SSC_RCMR_CKO(value) ((SSC_RCMR_CKO_Msk & ((value) << SSC_RCMR_CKO_Pos))) +#define SSC_RCMR_CKO_NONE (0x0u << 2) /**< \brief (SSC_RCMR) None, RK pin is an input */ +#define SSC_RCMR_CKO_CONTINUOUS (0x1u << 2) /**< \brief (SSC_RCMR) Continuous Receive Clock, RK pin is an output */ +#define SSC_RCMR_CKO_TRANSFER (0x2u << 2) /**< \brief (SSC_RCMR) Receive Clock only during data transfers, RK pin is an output */ +#define SSC_RCMR_CKI (0x1u << 5) /**< \brief (SSC_RCMR) Receive Clock Inversion */ +#define SSC_RCMR_CKG_Pos 6 +#define SSC_RCMR_CKG_Msk (0x3u << SSC_RCMR_CKG_Pos) /**< \brief (SSC_RCMR) Receive Clock Gating Selection */ +#define SSC_RCMR_CKG(value) ((SSC_RCMR_CKG_Msk & ((value) << SSC_RCMR_CKG_Pos))) +#define SSC_RCMR_CKG_CONTINUOUS (0x0u << 6) /**< \brief (SSC_RCMR) None */ +#define SSC_RCMR_CKG_EN_RF_LOW (0x1u << 6) /**< \brief (SSC_RCMR) Receive Clock enabled only if RF Low */ +#define SSC_RCMR_CKG_EN_RF_HIGH (0x2u << 6) /**< \brief (SSC_RCMR) Receive Clock enabled only if RF High */ +#define SSC_RCMR_START_Pos 8 +#define SSC_RCMR_START_Msk (0xfu << SSC_RCMR_START_Pos) /**< \brief (SSC_RCMR) Receive Start Selection */ +#define SSC_RCMR_START(value) ((SSC_RCMR_START_Msk & ((value) << SSC_RCMR_START_Pos))) +#define SSC_RCMR_START_CONTINUOUS (0x0u << 8) /**< \brief (SSC_RCMR) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. */ +#define SSC_RCMR_START_TRANSMIT (0x1u << 8) /**< \brief (SSC_RCMR) Transmit start */ +#define SSC_RCMR_START_RF_LOW (0x2u << 8) /**< \brief (SSC_RCMR) Detection of a low level on RF signal */ +#define SSC_RCMR_START_RF_HIGH (0x3u << 8) /**< \brief (SSC_RCMR) Detection of a high level on RF signal */ +#define SSC_RCMR_START_RF_FALLING (0x4u << 8) /**< \brief (SSC_RCMR) Detection of a falling edge on RF signal */ +#define SSC_RCMR_START_RF_RISING (0x5u << 8) /**< \brief (SSC_RCMR) Detection of a rising edge on RF signal */ +#define SSC_RCMR_START_RF_LEVEL (0x6u << 8) /**< \brief (SSC_RCMR) Detection of any level change on RF signal */ +#define SSC_RCMR_START_RF_EDGE (0x7u << 8) /**< \brief (SSC_RCMR) Detection of any edge on RF signal */ +#define SSC_RCMR_START_CMP_0 (0x8u << 8) /**< \brief (SSC_RCMR) Compare 0 */ +#define SSC_RCMR_STOP (0x1u << 12) /**< \brief (SSC_RCMR) Receive Stop Selection */ +#define SSC_RCMR_STTDLY_Pos 16 +#define SSC_RCMR_STTDLY_Msk (0xffu << SSC_RCMR_STTDLY_Pos) /**< \brief (SSC_RCMR) Receive Start Delay */ +#define SSC_RCMR_STTDLY(value) ((SSC_RCMR_STTDLY_Msk & ((value) << SSC_RCMR_STTDLY_Pos))) +#define SSC_RCMR_PERIOD_Pos 24 +#define SSC_RCMR_PERIOD_Msk (0xffu << SSC_RCMR_PERIOD_Pos) /**< \brief (SSC_RCMR) Receive Period Divider Selection */ +#define SSC_RCMR_PERIOD(value) ((SSC_RCMR_PERIOD_Msk & ((value) << SSC_RCMR_PERIOD_Pos))) +/* -------- SSC_RFMR : (SSC Offset: 0x14) Receive Frame Mode Register -------- */ +#define SSC_RFMR_DATLEN_Pos 0 +#define SSC_RFMR_DATLEN_Msk (0x1fu << SSC_RFMR_DATLEN_Pos) /**< \brief (SSC_RFMR) Data Length */ +#define SSC_RFMR_DATLEN(value) ((SSC_RFMR_DATLEN_Msk & ((value) << SSC_RFMR_DATLEN_Pos))) +#define SSC_RFMR_LOOP (0x1u << 5) /**< \brief (SSC_RFMR) Loop Mode */ +#define SSC_RFMR_MSBF (0x1u << 7) /**< \brief (SSC_RFMR) Most Significant Bit First */ +#define SSC_RFMR_DATNB_Pos 8 +#define SSC_RFMR_DATNB_Msk (0xfu << SSC_RFMR_DATNB_Pos) /**< \brief (SSC_RFMR) Data Number per Frame */ +#define SSC_RFMR_DATNB(value) ((SSC_RFMR_DATNB_Msk & ((value) << SSC_RFMR_DATNB_Pos))) +#define SSC_RFMR_FSLEN_Pos 16 +#define SSC_RFMR_FSLEN_Msk (0xfu << SSC_RFMR_FSLEN_Pos) /**< \brief (SSC_RFMR) Receive Frame Sync Length */ +#define SSC_RFMR_FSLEN(value) ((SSC_RFMR_FSLEN_Msk & ((value) << SSC_RFMR_FSLEN_Pos))) +#define SSC_RFMR_FSOS_Pos 20 +#define SSC_RFMR_FSOS_Msk (0x7u << SSC_RFMR_FSOS_Pos) /**< \brief (SSC_RFMR) Receive Frame Sync Output Selection */ +#define SSC_RFMR_FSOS(value) ((SSC_RFMR_FSOS_Msk & ((value) << SSC_RFMR_FSOS_Pos))) +#define SSC_RFMR_FSOS_NONE (0x0u << 20) /**< \brief (SSC_RFMR) None, RF pin is an input */ +#define SSC_RFMR_FSOS_NEGATIVE (0x1u << 20) /**< \brief (SSC_RFMR) Negative Pulse, RF pin is an output */ +#define SSC_RFMR_FSOS_POSITIVE (0x2u << 20) /**< \brief (SSC_RFMR) Positive Pulse, RF pin is an output */ +#define SSC_RFMR_FSOS_LOW (0x3u << 20) /**< \brief (SSC_RFMR) Driven Low during data transfer, RF pin is an output */ +#define SSC_RFMR_FSOS_HIGH (0x4u << 20) /**< \brief (SSC_RFMR) Driven High during data transfer, RF pin is an output */ +#define SSC_RFMR_FSOS_TOGGLING (0x5u << 20) /**< \brief (SSC_RFMR) Toggling at each start of data transfer, RF pin is an output */ +#define SSC_RFMR_FSEDGE (0x1u << 24) /**< \brief (SSC_RFMR) Frame Sync Edge Detection */ +#define SSC_RFMR_FSEDGE_POSITIVE (0x0u << 24) /**< \brief (SSC_RFMR) Positive Edge Detection */ +#define SSC_RFMR_FSEDGE_NEGATIVE (0x1u << 24) /**< \brief (SSC_RFMR) Negative Edge Detection */ +#define SSC_RFMR_FSLEN_EXT_Pos 28 +#define SSC_RFMR_FSLEN_EXT_Msk (0xfu << SSC_RFMR_FSLEN_EXT_Pos) /**< \brief (SSC_RFMR) FSLEN Field Extension */ +#define SSC_RFMR_FSLEN_EXT(value) ((SSC_RFMR_FSLEN_EXT_Msk & ((value) << SSC_RFMR_FSLEN_EXT_Pos))) +/* -------- SSC_TCMR : (SSC Offset: 0x18) Transmit Clock Mode Register -------- */ +#define SSC_TCMR_CKS_Pos 0 +#define SSC_TCMR_CKS_Msk (0x3u << SSC_TCMR_CKS_Pos) /**< \brief (SSC_TCMR) Transmit Clock Selection */ +#define SSC_TCMR_CKS(value) ((SSC_TCMR_CKS_Msk & ((value) << SSC_TCMR_CKS_Pos))) +#define SSC_TCMR_CKS_MCK (0x0u << 0) /**< \brief (SSC_TCMR) Divided Clock */ +#define SSC_TCMR_CKS_RK (0x1u << 0) /**< \brief (SSC_TCMR) RK Clock signal */ +#define SSC_TCMR_CKS_TK (0x2u << 0) /**< \brief (SSC_TCMR) TK pin */ +#define SSC_TCMR_CKO_Pos 2 +#define SSC_TCMR_CKO_Msk (0x7u << SSC_TCMR_CKO_Pos) /**< \brief (SSC_TCMR) Transmit Clock Output Mode Selection */ +#define SSC_TCMR_CKO(value) ((SSC_TCMR_CKO_Msk & ((value) << SSC_TCMR_CKO_Pos))) +#define SSC_TCMR_CKO_NONE (0x0u << 2) /**< \brief (SSC_TCMR) None, TK pin is an input */ +#define SSC_TCMR_CKO_CONTINUOUS (0x1u << 2) /**< \brief (SSC_TCMR) Continuous Transmit Clock, TK pin is an output */ +#define SSC_TCMR_CKO_TRANSFER (0x2u << 2) /**< \brief (SSC_TCMR) Transmit Clock only during data transfers, TK pin is an output */ +#define SSC_TCMR_CKI (0x1u << 5) /**< \brief (SSC_TCMR) Transmit Clock Inversion */ +#define SSC_TCMR_CKG_Pos 6 +#define SSC_TCMR_CKG_Msk (0x3u << SSC_TCMR_CKG_Pos) /**< \brief (SSC_TCMR) Transmit Clock Gating Selection */ +#define SSC_TCMR_CKG(value) ((SSC_TCMR_CKG_Msk & ((value) << SSC_TCMR_CKG_Pos))) +#define SSC_TCMR_CKG_CONTINUOUS (0x0u << 6) /**< \brief (SSC_TCMR) None */ +#define SSC_TCMR_CKG_EN_TF_LOW (0x1u << 6) /**< \brief (SSC_TCMR) Transmit Clock enabled only if TF Low */ +#define SSC_TCMR_CKG_EN_TF_HIGH (0x2u << 6) /**< \brief (SSC_TCMR) Transmit Clock enabled only if TF High */ +#define SSC_TCMR_START_Pos 8 +#define SSC_TCMR_START_Msk (0xfu << SSC_TCMR_START_Pos) /**< \brief (SSC_TCMR) Transmit Start Selection */ +#define SSC_TCMR_START(value) ((SSC_TCMR_START_Msk & ((value) << SSC_TCMR_START_Pos))) +#define SSC_TCMR_START_CONTINUOUS (0x0u << 8) /**< \brief (SSC_TCMR) Continuous, as soon as a word is written in the SSC_THR (if Transmit is enabled), and immediately after the end of transfer of the previous data */ +#define SSC_TCMR_START_RECEIVE (0x1u << 8) /**< \brief (SSC_TCMR) Receive start */ +#define SSC_TCMR_START_TF_LOW (0x2u << 8) /**< \brief (SSC_TCMR) Detection of a low level on TF signal */ +#define SSC_TCMR_START_TF_HIGH (0x3u << 8) /**< \brief (SSC_TCMR) Detection of a high level on TF signal */ +#define SSC_TCMR_START_TF_FALLING (0x4u << 8) /**< \brief (SSC_TCMR) Detection of a falling edge on TF signal */ +#define SSC_TCMR_START_TF_RISING (0x5u << 8) /**< \brief (SSC_TCMR) Detection of a rising edge on TF signal */ +#define SSC_TCMR_START_TF_LEVEL (0x6u << 8) /**< \brief (SSC_TCMR) Detection of any level change on TF signal */ +#define SSC_TCMR_START_TF_EDGE (0x7u << 8) /**< \brief (SSC_TCMR) Detection of any edge on TF signal */ +#define SSC_TCMR_STTDLY_Pos 16 +#define SSC_TCMR_STTDLY_Msk (0xffu << SSC_TCMR_STTDLY_Pos) /**< \brief (SSC_TCMR) Transmit Start Delay */ +#define SSC_TCMR_STTDLY(value) ((SSC_TCMR_STTDLY_Msk & ((value) << SSC_TCMR_STTDLY_Pos))) +#define SSC_TCMR_PERIOD_Pos 24 +#define SSC_TCMR_PERIOD_Msk (0xffu << SSC_TCMR_PERIOD_Pos) /**< \brief (SSC_TCMR) Transmit Period Divider Selection */ +#define SSC_TCMR_PERIOD(value) ((SSC_TCMR_PERIOD_Msk & ((value) << SSC_TCMR_PERIOD_Pos))) +/* -------- SSC_TFMR : (SSC Offset: 0x1C) Transmit Frame Mode Register -------- */ +#define SSC_TFMR_DATLEN_Pos 0 +#define SSC_TFMR_DATLEN_Msk (0x1fu << SSC_TFMR_DATLEN_Pos) /**< \brief (SSC_TFMR) Data Length */ +#define SSC_TFMR_DATLEN(value) ((SSC_TFMR_DATLEN_Msk & ((value) << SSC_TFMR_DATLEN_Pos))) +#define SSC_TFMR_DATDEF (0x1u << 5) /**< \brief (SSC_TFMR) Data Default Value */ +#define SSC_TFMR_MSBF (0x1u << 7) /**< \brief (SSC_TFMR) Most Significant Bit First */ +#define SSC_TFMR_DATNB_Pos 8 +#define SSC_TFMR_DATNB_Msk (0xfu << SSC_TFMR_DATNB_Pos) /**< \brief (SSC_TFMR) Data Number per Frame */ +#define SSC_TFMR_DATNB(value) ((SSC_TFMR_DATNB_Msk & ((value) << SSC_TFMR_DATNB_Pos))) +#define SSC_TFMR_FSLEN_Pos 16 +#define SSC_TFMR_FSLEN_Msk (0xfu << SSC_TFMR_FSLEN_Pos) /**< \brief (SSC_TFMR) Transmit Frame Sync Length */ +#define SSC_TFMR_FSLEN(value) ((SSC_TFMR_FSLEN_Msk & ((value) << SSC_TFMR_FSLEN_Pos))) +#define SSC_TFMR_FSOS_Pos 20 +#define SSC_TFMR_FSOS_Msk (0x7u << SSC_TFMR_FSOS_Pos) /**< \brief (SSC_TFMR) Transmit Frame Sync Output Selection */ +#define SSC_TFMR_FSOS(value) ((SSC_TFMR_FSOS_Msk & ((value) << SSC_TFMR_FSOS_Pos))) +#define SSC_TFMR_FSOS_NONE (0x0u << 20) /**< \brief (SSC_TFMR) None, TF pin is an input */ +#define SSC_TFMR_FSOS_NEGATIVE (0x1u << 20) /**< \brief (SSC_TFMR) Negative Pulse, TF pin is an output */ +#define SSC_TFMR_FSOS_POSITIVE (0x2u << 20) /**< \brief (SSC_TFMR) Positive Pulse, TF pin is an output */ +#define SSC_TFMR_FSOS_LOW (0x3u << 20) /**< \brief (SSC_TFMR) Driven Low during data transfer */ +#define SSC_TFMR_FSOS_HIGH (0x4u << 20) /**< \brief (SSC_TFMR) Driven High during data transfer */ +#define SSC_TFMR_FSOS_TOGGLING (0x5u << 20) /**< \brief (SSC_TFMR) Toggling at each start of data transfer */ +#define SSC_TFMR_FSDEN (0x1u << 23) /**< \brief (SSC_TFMR) Frame Sync Data Enable */ +#define SSC_TFMR_FSEDGE (0x1u << 24) /**< \brief (SSC_TFMR) Frame Sync Edge Detection */ +#define SSC_TFMR_FSEDGE_POSITIVE (0x0u << 24) /**< \brief (SSC_TFMR) Positive Edge Detection */ +#define SSC_TFMR_FSEDGE_NEGATIVE (0x1u << 24) /**< \brief (SSC_TFMR) Negative Edge Detection */ +#define SSC_TFMR_FSLEN_EXT_Pos 28 +#define SSC_TFMR_FSLEN_EXT_Msk (0xfu << SSC_TFMR_FSLEN_EXT_Pos) /**< \brief (SSC_TFMR) FSLEN Field Extension */ +#define SSC_TFMR_FSLEN_EXT(value) ((SSC_TFMR_FSLEN_EXT_Msk & ((value) << SSC_TFMR_FSLEN_EXT_Pos))) +/* -------- SSC_RHR : (SSC Offset: 0x20) Receive Holding Register -------- */ +#define SSC_RHR_RDAT_Pos 0 +#define SSC_RHR_RDAT_Msk (0xffffffffu << SSC_RHR_RDAT_Pos) /**< \brief (SSC_RHR) Receive Data */ +/* -------- SSC_THR : (SSC Offset: 0x24) Transmit Holding Register -------- */ +#define SSC_THR_TDAT_Pos 0 +#define SSC_THR_TDAT_Msk (0xffffffffu << SSC_THR_TDAT_Pos) /**< \brief (SSC_THR) Transmit Data */ +#define SSC_THR_TDAT(value) ((SSC_THR_TDAT_Msk & ((value) << SSC_THR_TDAT_Pos))) +/* -------- SSC_RSHR : (SSC Offset: 0x30) Receive Sync. Holding Register -------- */ +#define SSC_RSHR_RSDAT_Pos 0 +#define SSC_RSHR_RSDAT_Msk (0xffffu << SSC_RSHR_RSDAT_Pos) /**< \brief (SSC_RSHR) Receive Synchronization Data */ +/* -------- SSC_TSHR : (SSC Offset: 0x34) Transmit Sync. Holding Register -------- */ +#define SSC_TSHR_TSDAT_Pos 0 +#define SSC_TSHR_TSDAT_Msk (0xffffu << SSC_TSHR_TSDAT_Pos) /**< \brief (SSC_TSHR) Transmit Synchronization Data */ +#define SSC_TSHR_TSDAT(value) ((SSC_TSHR_TSDAT_Msk & ((value) << SSC_TSHR_TSDAT_Pos))) +/* -------- SSC_RC0R : (SSC Offset: 0x38) Receive Compare 0 Register -------- */ +#define SSC_RC0R_CP0_Pos 0 +#define SSC_RC0R_CP0_Msk (0xffffu << SSC_RC0R_CP0_Pos) /**< \brief (SSC_RC0R) Receive Compare Data 0 */ +#define SSC_RC0R_CP0(value) ((SSC_RC0R_CP0_Msk & ((value) << SSC_RC0R_CP0_Pos))) +/* -------- SSC_RC1R : (SSC Offset: 0x3C) Receive Compare 1 Register -------- */ +#define SSC_RC1R_CP1_Pos 0 +#define SSC_RC1R_CP1_Msk (0xffffu << SSC_RC1R_CP1_Pos) /**< \brief (SSC_RC1R) Receive Compare Data 1 */ +#define SSC_RC1R_CP1(value) ((SSC_RC1R_CP1_Msk & ((value) << SSC_RC1R_CP1_Pos))) +/* -------- SSC_SR : (SSC Offset: 0x40) Status Register -------- */ +#define SSC_SR_TXRDY (0x1u << 0) /**< \brief (SSC_SR) Transmit Ready */ +#define SSC_SR_TXEMPTY (0x1u << 1) /**< \brief (SSC_SR) Transmit Empty */ +#define SSC_SR_RXRDY (0x1u << 4) /**< \brief (SSC_SR) Receive Ready */ +#define SSC_SR_OVRUN (0x1u << 5) /**< \brief (SSC_SR) Receive Overrun */ +#define SSC_SR_CP0 (0x1u << 8) /**< \brief (SSC_SR) Compare 0 */ +#define SSC_SR_CP1 (0x1u << 9) /**< \brief (SSC_SR) Compare 1 */ +#define SSC_SR_TXSYN (0x1u << 10) /**< \brief (SSC_SR) Transmit Sync */ +#define SSC_SR_RXSYN (0x1u << 11) /**< \brief (SSC_SR) Receive Sync */ +#define SSC_SR_TXEN (0x1u << 16) /**< \brief (SSC_SR) Transmit Enable */ +#define SSC_SR_RXEN (0x1u << 17) /**< \brief (SSC_SR) Receive Enable */ +/* -------- SSC_IER : (SSC Offset: 0x44) Interrupt Enable Register -------- */ +#define SSC_IER_TXRDY (0x1u << 0) /**< \brief (SSC_IER) Transmit Ready Interrupt Enable */ +#define SSC_IER_TXEMPTY (0x1u << 1) /**< \brief (SSC_IER) Transmit Empty Interrupt Enable */ +#define SSC_IER_RXRDY (0x1u << 4) /**< \brief (SSC_IER) Receive Ready Interrupt Enable */ +#define SSC_IER_OVRUN (0x1u << 5) /**< \brief (SSC_IER) Receive Overrun Interrupt Enable */ +#define SSC_IER_CP0 (0x1u << 8) /**< \brief (SSC_IER) Compare 0 Interrupt Enable */ +#define SSC_IER_CP1 (0x1u << 9) /**< \brief (SSC_IER) Compare 1 Interrupt Enable */ +#define SSC_IER_TXSYN (0x1u << 10) /**< \brief (SSC_IER) Tx Sync Interrupt Enable */ +#define SSC_IER_RXSYN (0x1u << 11) /**< \brief (SSC_IER) Rx Sync Interrupt Enable */ +/* -------- SSC_IDR : (SSC Offset: 0x48) Interrupt Disable Register -------- */ +#define SSC_IDR_TXRDY (0x1u << 0) /**< \brief (SSC_IDR) Transmit Ready Interrupt Disable */ +#define SSC_IDR_TXEMPTY (0x1u << 1) /**< \brief (SSC_IDR) Transmit Empty Interrupt Disable */ +#define SSC_IDR_RXRDY (0x1u << 4) /**< \brief (SSC_IDR) Receive Ready Interrupt Disable */ +#define SSC_IDR_OVRUN (0x1u << 5) /**< \brief (SSC_IDR) Receive Overrun Interrupt Disable */ +#define SSC_IDR_CP0 (0x1u << 8) /**< \brief (SSC_IDR) Compare 0 Interrupt Disable */ +#define SSC_IDR_CP1 (0x1u << 9) /**< \brief (SSC_IDR) Compare 1 Interrupt Disable */ +#define SSC_IDR_TXSYN (0x1u << 10) /**< \brief (SSC_IDR) Tx Sync Interrupt Enable */ +#define SSC_IDR_RXSYN (0x1u << 11) /**< \brief (SSC_IDR) Rx Sync Interrupt Enable */ +/* -------- SSC_IMR : (SSC Offset: 0x4C) Interrupt Mask Register -------- */ +#define SSC_IMR_TXRDY (0x1u << 0) /**< \brief (SSC_IMR) Transmit Ready Interrupt Mask */ +#define SSC_IMR_TXEMPTY (0x1u << 1) /**< \brief (SSC_IMR) Transmit Empty Interrupt Mask */ +#define SSC_IMR_RXRDY (0x1u << 4) /**< \brief (SSC_IMR) Receive Ready Interrupt Mask */ +#define SSC_IMR_OVRUN (0x1u << 5) /**< \brief (SSC_IMR) Receive Overrun Interrupt Mask */ +#define SSC_IMR_CP0 (0x1u << 8) /**< \brief (SSC_IMR) Compare 0 Interrupt Mask */ +#define SSC_IMR_CP1 (0x1u << 9) /**< \brief (SSC_IMR) Compare 1 Interrupt Mask */ +#define SSC_IMR_TXSYN (0x1u << 10) /**< \brief (SSC_IMR) Tx Sync Interrupt Mask */ +#define SSC_IMR_RXSYN (0x1u << 11) /**< \brief (SSC_IMR) Rx Sync Interrupt Mask */ +/* -------- SSC_WPMR : (SSC Offset: 0xE4) Write Protection Mode Register -------- */ +#define SSC_WPMR_WPEN (0x1u << 0) /**< \brief (SSC_WPMR) Write Protection Enable */ +#define SSC_WPMR_WPKEY_Pos 8 +#define SSC_WPMR_WPKEY_Msk (0xffffffu << SSC_WPMR_WPKEY_Pos) /**< \brief (SSC_WPMR) Write Protection Key */ +#define SSC_WPMR_WPKEY(value) ((SSC_WPMR_WPKEY_Msk & ((value) << SSC_WPMR_WPKEY_Pos))) +#define SSC_WPMR_WPKEY_PASSWD (0x535343u << 8) /**< \brief (SSC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- SSC_WPSR : (SSC Offset: 0xE8) Write Protection Status Register -------- */ +#define SSC_WPSR_WPVS (0x1u << 0) /**< \brief (SSC_WPSR) Write Protection Violation Status */ +#define SSC_WPSR_WPVSRC_Pos 8 +#define SSC_WPSR_WPVSRC_Msk (0xffffu << SSC_WPSR_WPVSRC_Pos) /**< \brief (SSC_WPSR) Write Protect Violation Source */ +/* -------- SSC_VERSION : (SSC Offset: 0xFC) Version Register -------- */ +#define SSC_VERSION_VERSION_Pos 0 +#define SSC_VERSION_VERSION_Msk (0xffffu << SSC_VERSION_VERSION_Pos) /**< \brief (SSC_VERSION) Version of the Hardware Module */ +#define SSC_VERSION_MFN_Pos 16 +#define SSC_VERSION_MFN_Msk (0x7u << SSC_VERSION_MFN_Pos) /**< \brief (SSC_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_SSC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tc.h new file mode 100644 index 000000000..37ee1240a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tc.h @@ -0,0 +1,360 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_TC_COMPONENT_ +#define _SAMA5D2_TC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Timer Counter */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_TC Timer Counter */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief TcChannel hardware registers */ +typedef struct { + __O uint32_t TC_CCR; /**< \brief (TcChannel Offset: 0x0) Channel Control Register */ + __IO uint32_t TC_CMR; /**< \brief (TcChannel Offset: 0x4) Channel Mode Register */ + __IO uint32_t TC_SMMR; /**< \brief (TcChannel Offset: 0x8) Stepper Motor Mode Register */ + __I uint32_t TC_RAB; /**< \brief (TcChannel Offset: 0xC) Register AB */ + __I uint32_t TC_CV; /**< \brief (TcChannel Offset: 0x10) Counter Value */ + __IO uint32_t TC_RA; /**< \brief (TcChannel Offset: 0x14) Register A */ + __IO uint32_t TC_RB; /**< \brief (TcChannel Offset: 0x18) Register B */ + __IO uint32_t TC_RC; /**< \brief (TcChannel Offset: 0x1C) Register C */ + __I uint32_t TC_SR; /**< \brief (TcChannel Offset: 0x20) Status Register */ + __O uint32_t TC_IER; /**< \brief (TcChannel Offset: 0x24) Interrupt Enable Register */ + __O uint32_t TC_IDR; /**< \brief (TcChannel Offset: 0x28) Interrupt Disable Register */ + __I uint32_t TC_IMR; /**< \brief (TcChannel Offset: 0x2C) Interrupt Mask Register */ + __IO uint32_t TC_EMR; /**< \brief (TcChannel Offset: 0x30) Extended Mode Register */ + __I uint32_t Reserved1[3]; +} TcChannel; +/** \brief Tc hardware registers */ +#define TCCHANNEL_NUMBER 3 +typedef struct { + TcChannel TC_CHANNEL[TCCHANNEL_NUMBER]; /**< \brief (Tc Offset: 0x0) channel = 0 .. 2 */ + __O uint32_t TC_BCR; /**< \brief (Tc Offset: 0xC0) Block Control Register */ + __IO uint32_t TC_BMR; /**< \brief (Tc Offset: 0xC4) Block Mode Register */ + __O uint32_t TC_QIER; /**< \brief (Tc Offset: 0xC8) QDEC Interrupt Enable Register */ + __O uint32_t TC_QIDR; /**< \brief (Tc Offset: 0xCC) QDEC Interrupt Disable Register */ + __I uint32_t TC_QIMR; /**< \brief (Tc Offset: 0xD0) QDEC Interrupt Mask Register */ + __I uint32_t TC_QISR; /**< \brief (Tc Offset: 0xD4) QDEC Interrupt Status Register */ + __IO uint32_t TC_FMR; /**< \brief (Tc Offset: 0xD8) Fault Mode Register */ + __I uint32_t Reserved1[2]; + __IO uint32_t TC_WPMR; /**< \brief (Tc Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t Reserved2[5]; + __I uint32_t TC_VER; /**< \brief (Tc Offset: 0xFC) Version Register */ +} Tc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- TC_CCR : (TC Offset: N/A) Channel Control Register -------- */ +#define TC_CCR_CLKEN (0x1u << 0) /**< \brief (TC_CCR) Counter Clock Enable Command */ +#define TC_CCR_CLKDIS (0x1u << 1) /**< \brief (TC_CCR) Counter Clock Disable Command */ +#define TC_CCR_SWTRG (0x1u << 2) /**< \brief (TC_CCR) Software Trigger Command */ +/* -------- TC_CMR : (TC Offset: N/A) Channel Mode Register -------- */ +#define TC_CMR_TCCLKS_Pos 0 +#define TC_CMR_TCCLKS_Msk (0x7u << TC_CMR_TCCLKS_Pos) /**< \brief (TC_CMR) Clock Selection */ +#define TC_CMR_TCCLKS(value) ((TC_CMR_TCCLKS_Msk & ((value) << TC_CMR_TCCLKS_Pos))) +#define TC_CMR_TCCLKS_TIMER_CLOCK1 (0x0u << 0) /**< \brief (TC_CMR) Clock selected: internal GCLK [TC_ID] clock signal (from PMC) */ +#define TC_CMR_TCCLKS_TIMER_CLOCK2 (0x1u << 0) /**< \brief (TC_CMR) Clock selected: internal div8 clock signal (from PMC) */ +#define TC_CMR_TCCLKS_TIMER_CLOCK3 (0x2u << 0) /**< \brief (TC_CMR) Clock selected: internal div32 clock signal (from PMC) */ +#define TC_CMR_TCCLKS_TIMER_CLOCK4 (0x3u << 0) /**< \brief (TC_CMR) Clock selected: internal div128 clock signal (from PMC) */ +#define TC_CMR_TCCLKS_TIMER_CLOCK5 (0x4u << 0) /**< \brief (TC_CMR) Clock selected: internal slow_clock clock signal (from PMC) */ +#define TC_CMR_TCCLKS_XC0 (0x5u << 0) /**< \brief (TC_CMR) Clock selected: XC0 */ +#define TC_CMR_TCCLKS_XC1 (0x6u << 0) /**< \brief (TC_CMR) Clock selected: XC1 */ +#define TC_CMR_TCCLKS_XC2 (0x7u << 0) /**< \brief (TC_CMR) Clock selected: XC2 */ +#define TC_CMR_CLKI (0x1u << 3) /**< \brief (TC_CMR) Clock Invert */ +#define TC_CMR_BURST_Pos 4 +#define TC_CMR_BURST_Msk (0x3u << TC_CMR_BURST_Pos) /**< \brief (TC_CMR) Burst Signal Selection */ +#define TC_CMR_BURST(value) ((TC_CMR_BURST_Msk & ((value) << TC_CMR_BURST_Pos))) +#define TC_CMR_BURST_NONE (0x0u << 4) /**< \brief (TC_CMR) The clock is not gated by an external signal. */ +#define TC_CMR_BURST_XC0 (0x1u << 4) /**< \brief (TC_CMR) XC0 is ANDed with the selected clock. */ +#define TC_CMR_BURST_XC1 (0x2u << 4) /**< \brief (TC_CMR) XC1 is ANDed with the selected clock. */ +#define TC_CMR_BURST_XC2 (0x3u << 4) /**< \brief (TC_CMR) XC2 is ANDed with the selected clock. */ +#define TC_CMR_LDBSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RB Loading */ +#define TC_CMR_LDBDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RB Loading */ +#define TC_CMR_ETRGEDG_Pos 8 +#define TC_CMR_ETRGEDG_Msk (0x3u << TC_CMR_ETRGEDG_Pos) /**< \brief (TC_CMR) External Trigger Edge Selection */ +#define TC_CMR_ETRGEDG(value) ((TC_CMR_ETRGEDG_Msk & ((value) << TC_CMR_ETRGEDG_Pos))) +#define TC_CMR_ETRGEDG_NONE (0x0u << 8) /**< \brief (TC_CMR) The clock is not gated by an external signal. */ +#define TC_CMR_ETRGEDG_RISING (0x1u << 8) /**< \brief (TC_CMR) Rising edge */ +#define TC_CMR_ETRGEDG_FALLING (0x2u << 8) /**< \brief (TC_CMR) Falling edge */ +#define TC_CMR_ETRGEDG_EDGE (0x3u << 8) /**< \brief (TC_CMR) Each edge */ +#define TC_CMR_ABETRG (0x1u << 10) /**< \brief (TC_CMR) TIOA or TIOB External Trigger Selection */ +#define TC_CMR_CPCTRG (0x1u << 14) /**< \brief (TC_CMR) RC Compare Trigger Enable */ +#define TC_CMR_WAVE (0x1u << 15) /**< \brief (TC_CMR) Waveform Mode */ +#define TC_CMR_LDRA_Pos 16 +#define TC_CMR_LDRA_Msk (0x3u << TC_CMR_LDRA_Pos) /**< \brief (TC_CMR) RA Loading Edge Selection */ +#define TC_CMR_LDRA(value) ((TC_CMR_LDRA_Msk & ((value) << TC_CMR_LDRA_Pos))) +#define TC_CMR_LDRA_NONE (0x0u << 16) /**< \brief (TC_CMR) None */ +#define TC_CMR_LDRA_RISING (0x1u << 16) /**< \brief (TC_CMR) Rising edge of TIOA */ +#define TC_CMR_LDRA_FALLING (0x2u << 16) /**< \brief (TC_CMR) Falling edge of TIOA */ +#define TC_CMR_LDRA_EDGE (0x3u << 16) /**< \brief (TC_CMR) Each edge of TIOA */ +#define TC_CMR_LDRB_Pos 18 +#define TC_CMR_LDRB_Msk (0x3u << TC_CMR_LDRB_Pos) /**< \brief (TC_CMR) RB Loading Edge Selection */ +#define TC_CMR_LDRB(value) ((TC_CMR_LDRB_Msk & ((value) << TC_CMR_LDRB_Pos))) +#define TC_CMR_LDRB_NONE (0x0u << 18) /**< \brief (TC_CMR) None */ +#define TC_CMR_LDRB_RISING (0x1u << 18) /**< \brief (TC_CMR) Rising edge of TIOA */ +#define TC_CMR_LDRB_FALLING (0x2u << 18) /**< \brief (TC_CMR) Falling edge of TIOA */ +#define TC_CMR_LDRB_EDGE (0x3u << 18) /**< \brief (TC_CMR) Each edge of TIOA */ +#define TC_CMR_SBSMPLR_Pos 20 +#define TC_CMR_SBSMPLR_Msk (0x7u << TC_CMR_SBSMPLR_Pos) /**< \brief (TC_CMR) Loading Edge Subsampling Ratio */ +#define TC_CMR_SBSMPLR(value) ((TC_CMR_SBSMPLR_Msk & ((value) << TC_CMR_SBSMPLR_Pos))) +#define TC_CMR_SBSMPLR_ONE (0x0u << 20) /**< \brief (TC_CMR) Load a Capture Register each selected edge */ +#define TC_CMR_SBSMPLR_HALF (0x1u << 20) /**< \brief (TC_CMR) Load a Capture Register every 2 selected edges */ +#define TC_CMR_SBSMPLR_FOURTH (0x2u << 20) /**< \brief (TC_CMR) Load a Capture Register every 4 selected edges */ +#define TC_CMR_SBSMPLR_EIGHTH (0x3u << 20) /**< \brief (TC_CMR) Load a Capture Register every 8 selected edges */ +#define TC_CMR_SBSMPLR_SIXTEENTH (0x4u << 20) /**< \brief (TC_CMR) Load a Capture Register every 16 selected edges */ +#define TC_CMR_CPCSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RC Compare */ +#define TC_CMR_CPCDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RC Compare */ +#define TC_CMR_EEVTEDG_Pos 8 +#define TC_CMR_EEVTEDG_Msk (0x3u << TC_CMR_EEVTEDG_Pos) /**< \brief (TC_CMR) External Event Edge Selection */ +#define TC_CMR_EEVTEDG(value) ((TC_CMR_EEVTEDG_Msk & ((value) << TC_CMR_EEVTEDG_Pos))) +#define TC_CMR_EEVTEDG_NONE (0x0u << 8) /**< \brief (TC_CMR) None */ +#define TC_CMR_EEVTEDG_RISING (0x1u << 8) /**< \brief (TC_CMR) Rising edge */ +#define TC_CMR_EEVTEDG_FALLING (0x2u << 8) /**< \brief (TC_CMR) Falling edge */ +#define TC_CMR_EEVTEDG_EDGE (0x3u << 8) /**< \brief (TC_CMR) Each edge */ +#define TC_CMR_EEVT_Pos 10 +#define TC_CMR_EEVT_Msk (0x3u << TC_CMR_EEVT_Pos) /**< \brief (TC_CMR) External Event Selection */ +#define TC_CMR_EEVT(value) ((TC_CMR_EEVT_Msk & ((value) << TC_CMR_EEVT_Pos))) +#define TC_CMR_EEVT_TIOB (0x0u << 10) /**< \brief (TC_CMR) TIOB */ +#define TC_CMR_EEVT_XC0 (0x1u << 10) /**< \brief (TC_CMR) XC0 */ +#define TC_CMR_EEVT_XC1 (0x2u << 10) /**< \brief (TC_CMR) XC1 */ +#define TC_CMR_EEVT_XC2 (0x3u << 10) /**< \brief (TC_CMR) XC2 */ +#define TC_CMR_ENETRG (0x1u << 12) /**< \brief (TC_CMR) External Event Trigger Enable */ +#define TC_CMR_WAVSEL_Pos 13 +#define TC_CMR_WAVSEL_Msk (0x3u << TC_CMR_WAVSEL_Pos) /**< \brief (TC_CMR) Waveform Selection */ +#define TC_CMR_WAVSEL(value) ((TC_CMR_WAVSEL_Msk & ((value) << TC_CMR_WAVSEL_Pos))) +#define TC_CMR_WAVSEL_UP (0x0u << 13) /**< \brief (TC_CMR) UP mode without automatic trigger on RC Compare */ +#define TC_CMR_WAVSEL_UPDOWN (0x1u << 13) /**< \brief (TC_CMR) UPDOWN mode without automatic trigger on RC Compare */ +#define TC_CMR_WAVSEL_UP_RC (0x2u << 13) /**< \brief (TC_CMR) UP mode with automatic trigger on RC Compare */ +#define TC_CMR_WAVSEL_UPDOWN_RC (0x3u << 13) /**< \brief (TC_CMR) UPDOWN mode with automatic trigger on RC Compare */ +#define TC_CMR_ACPA_Pos 16 +#define TC_CMR_ACPA_Msk (0x3u << TC_CMR_ACPA_Pos) /**< \brief (TC_CMR) RA Compare Effect on TIOA */ +#define TC_CMR_ACPA(value) ((TC_CMR_ACPA_Msk & ((value) << TC_CMR_ACPA_Pos))) +#define TC_CMR_ACPA_NONE (0x0u << 16) /**< \brief (TC_CMR) None */ +#define TC_CMR_ACPA_SET (0x1u << 16) /**< \brief (TC_CMR) Set */ +#define TC_CMR_ACPA_CLEAR (0x2u << 16) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_ACPA_TOGGLE (0x3u << 16) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_ACPC_Pos 18 +#define TC_CMR_ACPC_Msk (0x3u << TC_CMR_ACPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOA */ +#define TC_CMR_ACPC(value) ((TC_CMR_ACPC_Msk & ((value) << TC_CMR_ACPC_Pos))) +#define TC_CMR_ACPC_NONE (0x0u << 18) /**< \brief (TC_CMR) None */ +#define TC_CMR_ACPC_SET (0x1u << 18) /**< \brief (TC_CMR) Set */ +#define TC_CMR_ACPC_CLEAR (0x2u << 18) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_ACPC_TOGGLE (0x3u << 18) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_AEEVT_Pos 20 +#define TC_CMR_AEEVT_Msk (0x3u << TC_CMR_AEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOA */ +#define TC_CMR_AEEVT(value) ((TC_CMR_AEEVT_Msk & ((value) << TC_CMR_AEEVT_Pos))) +#define TC_CMR_AEEVT_NONE (0x0u << 20) /**< \brief (TC_CMR) None */ +#define TC_CMR_AEEVT_SET (0x1u << 20) /**< \brief (TC_CMR) Set */ +#define TC_CMR_AEEVT_CLEAR (0x2u << 20) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_AEEVT_TOGGLE (0x3u << 20) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_ASWTRG_Pos 22 +#define TC_CMR_ASWTRG_Msk (0x3u << TC_CMR_ASWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOA */ +#define TC_CMR_ASWTRG(value) ((TC_CMR_ASWTRG_Msk & ((value) << TC_CMR_ASWTRG_Pos))) +#define TC_CMR_ASWTRG_NONE (0x0u << 22) /**< \brief (TC_CMR) None */ +#define TC_CMR_ASWTRG_SET (0x1u << 22) /**< \brief (TC_CMR) Set */ +#define TC_CMR_ASWTRG_CLEAR (0x2u << 22) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_ASWTRG_TOGGLE (0x3u << 22) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_BCPB_Pos 24 +#define TC_CMR_BCPB_Msk (0x3u << TC_CMR_BCPB_Pos) /**< \brief (TC_CMR) RB Compare Effect on TIOB */ +#define TC_CMR_BCPB(value) ((TC_CMR_BCPB_Msk & ((value) << TC_CMR_BCPB_Pos))) +#define TC_CMR_BCPB_NONE (0x0u << 24) /**< \brief (TC_CMR) None */ +#define TC_CMR_BCPB_SET (0x1u << 24) /**< \brief (TC_CMR) Set */ +#define TC_CMR_BCPB_CLEAR (0x2u << 24) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_BCPB_TOGGLE (0x3u << 24) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_BCPC_Pos 26 +#define TC_CMR_BCPC_Msk (0x3u << TC_CMR_BCPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOB */ +#define TC_CMR_BCPC(value) ((TC_CMR_BCPC_Msk & ((value) << TC_CMR_BCPC_Pos))) +#define TC_CMR_BCPC_NONE (0x0u << 26) /**< \brief (TC_CMR) None */ +#define TC_CMR_BCPC_SET (0x1u << 26) /**< \brief (TC_CMR) Set */ +#define TC_CMR_BCPC_CLEAR (0x2u << 26) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_BCPC_TOGGLE (0x3u << 26) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_BEEVT_Pos 28 +#define TC_CMR_BEEVT_Msk (0x3u << TC_CMR_BEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOB */ +#define TC_CMR_BEEVT(value) ((TC_CMR_BEEVT_Msk & ((value) << TC_CMR_BEEVT_Pos))) +#define TC_CMR_BEEVT_NONE (0x0u << 28) /**< \brief (TC_CMR) None */ +#define TC_CMR_BEEVT_SET (0x1u << 28) /**< \brief (TC_CMR) Set */ +#define TC_CMR_BEEVT_CLEAR (0x2u << 28) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_BEEVT_TOGGLE (0x3u << 28) /**< \brief (TC_CMR) Toggle */ +#define TC_CMR_BSWTRG_Pos 30 +#define TC_CMR_BSWTRG_Msk (0x3u << TC_CMR_BSWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOB */ +#define TC_CMR_BSWTRG(value) ((TC_CMR_BSWTRG_Msk & ((value) << TC_CMR_BSWTRG_Pos))) +#define TC_CMR_BSWTRG_NONE (0x0u << 30) /**< \brief (TC_CMR) None */ +#define TC_CMR_BSWTRG_SET (0x1u << 30) /**< \brief (TC_CMR) Set */ +#define TC_CMR_BSWTRG_CLEAR (0x2u << 30) /**< \brief (TC_CMR) Clear */ +#define TC_CMR_BSWTRG_TOGGLE (0x3u << 30) /**< \brief (TC_CMR) Toggle */ +/* -------- TC_SMMR : (TC Offset: N/A) Stepper Motor Mode Register -------- */ +#define TC_SMMR_GCEN (0x1u << 0) /**< \brief (TC_SMMR) Gray Count Enable */ +#define TC_SMMR_DOWN (0x1u << 1) /**< \brief (TC_SMMR) Down Count */ +/* -------- TC_RAB : (TC Offset: N/A) Register AB -------- */ +#define TC_RAB_RAB_Pos 0 +#define TC_RAB_RAB_Msk (0xffffffffu << TC_RAB_RAB_Pos) /**< \brief (TC_RAB) Register A or Register B */ +/* -------- TC_CV : (TC Offset: N/A) Counter Value -------- */ +#define TC_CV_CV_Pos 0 +#define TC_CV_CV_Msk (0xffffffffu << TC_CV_CV_Pos) /**< \brief (TC_CV) Counter Value */ +/* -------- TC_RA : (TC Offset: N/A) Register A -------- */ +#define TC_RA_RA_Pos 0 +#define TC_RA_RA_Msk (0xffffffffu << TC_RA_RA_Pos) /**< \brief (TC_RA) Register A */ +#define TC_RA_RA(value) ((TC_RA_RA_Msk & ((value) << TC_RA_RA_Pos))) +/* -------- TC_RB : (TC Offset: N/A) Register B -------- */ +#define TC_RB_RB_Pos 0 +#define TC_RB_RB_Msk (0xffffffffu << TC_RB_RB_Pos) /**< \brief (TC_RB) Register B */ +#define TC_RB_RB(value) ((TC_RB_RB_Msk & ((value) << TC_RB_RB_Pos))) +/* -------- TC_RC : (TC Offset: N/A) Register C -------- */ +#define TC_RC_RC_Pos 0 +#define TC_RC_RC_Msk (0xffffffffu << TC_RC_RC_Pos) /**< \brief (TC_RC) Register C */ +#define TC_RC_RC(value) ((TC_RC_RC_Msk & ((value) << TC_RC_RC_Pos))) +/* -------- TC_SR : (TC Offset: N/A) Status Register -------- */ +#define TC_SR_COVFS (0x1u << 0) /**< \brief (TC_SR) Counter Overflow Status (cleared on read) */ +#define TC_SR_LOVRS (0x1u << 1) /**< \brief (TC_SR) Load Overrun Status (cleared on read) */ +#define TC_SR_CPAS (0x1u << 2) /**< \brief (TC_SR) RA Compare Status (cleared on read) */ +#define TC_SR_CPBS (0x1u << 3) /**< \brief (TC_SR) RB Compare Status (cleared on read) */ +#define TC_SR_CPCS (0x1u << 4) /**< \brief (TC_SR) RC Compare Status (cleared on read) */ +#define TC_SR_LDRAS (0x1u << 5) /**< \brief (TC_SR) RA Loading Status (cleared on read) */ +#define TC_SR_LDRBS (0x1u << 6) /**< \brief (TC_SR) RB Loading Status (cleared on read) */ +#define TC_SR_ETRGS (0x1u << 7) /**< \brief (TC_SR) External Trigger Status (cleared on read) */ +#define TC_SR_CLKSTA (0x1u << 16) /**< \brief (TC_SR) Clock Enabling Status */ +#define TC_SR_MTIOA (0x1u << 17) /**< \brief (TC_SR) TIOA Mirror */ +#define TC_SR_MTIOB (0x1u << 18) /**< \brief (TC_SR) TIOB Mirror */ +/* -------- TC_IER : (TC Offset: N/A) Interrupt Enable Register -------- */ +#define TC_IER_COVFS (0x1u << 0) /**< \brief (TC_IER) Counter Overflow */ +#define TC_IER_LOVRS (0x1u << 1) /**< \brief (TC_IER) Load Overrun */ +#define TC_IER_CPAS (0x1u << 2) /**< \brief (TC_IER) RA Compare */ +#define TC_IER_CPBS (0x1u << 3) /**< \brief (TC_IER) RB Compare */ +#define TC_IER_CPCS (0x1u << 4) /**< \brief (TC_IER) RC Compare */ +#define TC_IER_LDRAS (0x1u << 5) /**< \brief (TC_IER) RA Loading */ +#define TC_IER_LDRBS (0x1u << 6) /**< \brief (TC_IER) RB Loading */ +#define TC_IER_ETRGS (0x1u << 7) /**< \brief (TC_IER) External Trigger */ +/* -------- TC_IDR : (TC Offset: N/A) Interrupt Disable Register -------- */ +#define TC_IDR_COVFS (0x1u << 0) /**< \brief (TC_IDR) Counter Overflow */ +#define TC_IDR_LOVRS (0x1u << 1) /**< \brief (TC_IDR) Load Overrun */ +#define TC_IDR_CPAS (0x1u << 2) /**< \brief (TC_IDR) RA Compare */ +#define TC_IDR_CPBS (0x1u << 3) /**< \brief (TC_IDR) RB Compare */ +#define TC_IDR_CPCS (0x1u << 4) /**< \brief (TC_IDR) RC Compare */ +#define TC_IDR_LDRAS (0x1u << 5) /**< \brief (TC_IDR) RA Loading */ +#define TC_IDR_LDRBS (0x1u << 6) /**< \brief (TC_IDR) RB Loading */ +#define TC_IDR_ETRGS (0x1u << 7) /**< \brief (TC_IDR) External Trigger */ +/* -------- TC_IMR : (TC Offset: N/A) Interrupt Mask Register -------- */ +#define TC_IMR_COVFS (0x1u << 0) /**< \brief (TC_IMR) Counter Overflow */ +#define TC_IMR_LOVRS (0x1u << 1) /**< \brief (TC_IMR) Load Overrun */ +#define TC_IMR_CPAS (0x1u << 2) /**< \brief (TC_IMR) RA Compare */ +#define TC_IMR_CPBS (0x1u << 3) /**< \brief (TC_IMR) RB Compare */ +#define TC_IMR_CPCS (0x1u << 4) /**< \brief (TC_IMR) RC Compare */ +#define TC_IMR_LDRAS (0x1u << 5) /**< \brief (TC_IMR) RA Loading */ +#define TC_IMR_LDRBS (0x1u << 6) /**< \brief (TC_IMR) RB Loading */ +#define TC_IMR_ETRGS (0x1u << 7) /**< \brief (TC_IMR) External Trigger */ +/* -------- TC_EMR : (TC Offset: N/A) Extended Mode Register -------- */ +#define TC_EMR_TRIGSRCA_Pos 0 +#define TC_EMR_TRIGSRCA_Msk (0x3u << TC_EMR_TRIGSRCA_Pos) /**< \brief (TC_EMR) Trigger Source for Input A */ +#define TC_EMR_TRIGSRCA(value) ((TC_EMR_TRIGSRCA_Msk & ((value) << TC_EMR_TRIGSRCA_Pos))) +#define TC_EMR_TRIGSRCA_EXTERNAL_TIOAx (0x0u << 0) /**< \brief (TC_EMR) The trigger/capture input A is driven by external pin TIOAx */ +#define TC_EMR_TRIGSRCA_PWMx (0x1u << 0) /**< \brief (TC_EMR) The trigger/capture input A is driven internally by PWMx */ +#define TC_EMR_TRIGSRCB_Pos 4 +#define TC_EMR_TRIGSRCB_Msk (0x3u << TC_EMR_TRIGSRCB_Pos) /**< \brief (TC_EMR) Trigger Source for Input B */ +#define TC_EMR_TRIGSRCB(value) ((TC_EMR_TRIGSRCB_Msk & ((value) << TC_EMR_TRIGSRCB_Pos))) +#define TC_EMR_TRIGSRCB_EXTERNAL_TIOBx (0x0u << 4) /**< \brief (TC_EMR) The trigger/capture input B is driven by external pin TIOBx */ +#define TC_EMR_TRIGSRCB_PWMx (0x1u << 4) /**< \brief (TC_EMR) For TC0 to TC10: The trigger/capture input B is driven internally by the comparator output (see Figure 7-16) of the PWMx.For TC11: The trigger/capture input B is driven internally by the GTSUCOMP singal of the Ethernet MAC (GMAC). */ +#define TC_EMR_NODIVCLK (0x1u << 8) /**< \brief (TC_EMR) No Divided Clock */ +/* -------- TC_BCR : (TC Offset: 0xC0) Block Control Register -------- */ +#define TC_BCR_SYNC (0x1u << 0) /**< \brief (TC_BCR) Synchro Command */ +/* -------- TC_BMR : (TC Offset: 0xC4) Block Mode Register -------- */ +#define TC_BMR_TC0XC0S_Pos 0 +#define TC_BMR_TC0XC0S_Msk (0x3u << TC_BMR_TC0XC0S_Pos) /**< \brief (TC_BMR) External Clock Signal 0 Selection */ +#define TC_BMR_TC0XC0S(value) ((TC_BMR_TC0XC0S_Msk & ((value) << TC_BMR_TC0XC0S_Pos))) +#define TC_BMR_TC0XC0S_TCLK0 (0x0u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TCLK0 */ +#define TC_BMR_TC0XC0S_TIOA1 (0x2u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TIOA1 */ +#define TC_BMR_TC0XC0S_TIOA2 (0x3u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TIOA2 */ +#define TC_BMR_TC1XC1S_Pos 2 +#define TC_BMR_TC1XC1S_Msk (0x3u << TC_BMR_TC1XC1S_Pos) /**< \brief (TC_BMR) External Clock Signal 1 Selection */ +#define TC_BMR_TC1XC1S(value) ((TC_BMR_TC1XC1S_Msk & ((value) << TC_BMR_TC1XC1S_Pos))) +#define TC_BMR_TC1XC1S_TCLK1 (0x0u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TCLK1 */ +#define TC_BMR_TC1XC1S_TIOA0 (0x2u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TIOA0 */ +#define TC_BMR_TC1XC1S_TIOA2 (0x3u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TIOA2 */ +#define TC_BMR_TC2XC2S_Pos 4 +#define TC_BMR_TC2XC2S_Msk (0x3u << TC_BMR_TC2XC2S_Pos) /**< \brief (TC_BMR) External Clock Signal 2 Selection */ +#define TC_BMR_TC2XC2S(value) ((TC_BMR_TC2XC2S_Msk & ((value) << TC_BMR_TC2XC2S_Pos))) +#define TC_BMR_TC2XC2S_TCLK2 (0x0u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TCLK2 */ +#define TC_BMR_TC2XC2S_TIOA0 (0x2u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TIOA0 */ +#define TC_BMR_TC2XC2S_TIOA1 (0x3u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TIOA1 */ +#define TC_BMR_QDEN (0x1u << 8) /**< \brief (TC_BMR) Quadrature Decoder Enabled */ +#define TC_BMR_POSEN (0x1u << 9) /**< \brief (TC_BMR) Position Enabled */ +#define TC_BMR_SPEEDEN (0x1u << 10) /**< \brief (TC_BMR) Speed Enabled */ +#define TC_BMR_QDTRANS (0x1u << 11) /**< \brief (TC_BMR) Quadrature Decoding Transparent */ +#define TC_BMR_EDGPHA (0x1u << 12) /**< \brief (TC_BMR) Edge on PHA Count Mode */ +#define TC_BMR_INVA (0x1u << 13) /**< \brief (TC_BMR) Inverted PHA */ +#define TC_BMR_INVB (0x1u << 14) /**< \brief (TC_BMR) Inverted PHB */ +#define TC_BMR_INVIDX (0x1u << 15) /**< \brief (TC_BMR) Inverted Index */ +#define TC_BMR_SWAP (0x1u << 16) /**< \brief (TC_BMR) Swap PHA and PHB */ +#define TC_BMR_IDXPHB (0x1u << 17) /**< \brief (TC_BMR) Index Pin is PHB Pin */ +#define TC_BMR_AUTOC (0x1u << 18) /**< \brief (TC_BMR) Auto-Correction of missing pulses */ +#define TC_BMR_AUTOC_DISABLED (0x0u << 18) /**< \brief (TC_BMR) The detection and auto-correction function is disabled. */ +#define TC_BMR_AUTOC_ENABLED (0x1u << 18) /**< \brief (TC_BMR) The detection and auto-correction function is enabled. */ +#define TC_BMR_MAXFILT_Pos 20 +#define TC_BMR_MAXFILT_Msk (0x3fu << TC_BMR_MAXFILT_Pos) /**< \brief (TC_BMR) Maximum Filter */ +#define TC_BMR_MAXFILT(value) ((TC_BMR_MAXFILT_Msk & ((value) << TC_BMR_MAXFILT_Pos))) +#define TC_BMR_MAXCMP_Pos 26 +#define TC_BMR_MAXCMP_Msk (0xfu << TC_BMR_MAXCMP_Pos) /**< \brief (TC_BMR) Maximum Consecutive Missing Pulses */ +#define TC_BMR_MAXCMP(value) ((TC_BMR_MAXCMP_Msk & ((value) << TC_BMR_MAXCMP_Pos))) +/* -------- TC_QIER : (TC Offset: 0xC8) QDEC Interrupt Enable Register -------- */ +#define TC_QIER_IDX (0x1u << 0) /**< \brief (TC_QIER) Index */ +#define TC_QIER_DIRCHG (0x1u << 1) /**< \brief (TC_QIER) Direction Change */ +#define TC_QIER_QERR (0x1u << 2) /**< \brief (TC_QIER) Quadrature Error */ +/* -------- TC_QIDR : (TC Offset: 0xCC) QDEC Interrupt Disable Register -------- */ +#define TC_QIDR_IDX (0x1u << 0) /**< \brief (TC_QIDR) Index */ +#define TC_QIDR_DIRCHG (0x1u << 1) /**< \brief (TC_QIDR) Direction Change */ +#define TC_QIDR_QERR (0x1u << 2) /**< \brief (TC_QIDR) Quadrature Error */ +/* -------- TC_QIMR : (TC Offset: 0xD0) QDEC Interrupt Mask Register -------- */ +#define TC_QIMR_IDX (0x1u << 0) /**< \brief (TC_QIMR) Index */ +#define TC_QIMR_DIRCHG (0x1u << 1) /**< \brief (TC_QIMR) Direction Change */ +#define TC_QIMR_QERR (0x1u << 2) /**< \brief (TC_QIMR) Quadrature Error */ +/* -------- TC_QISR : (TC Offset: 0xD4) QDEC Interrupt Status Register -------- */ +#define TC_QISR_IDX (0x1u << 0) /**< \brief (TC_QISR) Index */ +#define TC_QISR_DIRCHG (0x1u << 1) /**< \brief (TC_QISR) Direction Change */ +#define TC_QISR_QERR (0x1u << 2) /**< \brief (TC_QISR) Quadrature Error */ +#define TC_QISR_MPE (0x1u << 3) /**< \brief (TC_QISR) Consecutive Missing Pulse Error */ +#define TC_QISR_DIR (0x1u << 8) /**< \brief (TC_QISR) Direction */ +/* -------- TC_FMR : (TC Offset: 0xD8) Fault Mode Register -------- */ +#define TC_FMR_ENCF0 (0x1u << 0) /**< \brief (TC_FMR) Enable Compare Fault Channel 0 */ +#define TC_FMR_ENCF1 (0x1u << 1) /**< \brief (TC_FMR) Enable Compare Fault Channel 1 */ +/* -------- TC_WPMR : (TC Offset: 0xE4) Write Protection Mode Register -------- */ +#define TC_WPMR_WPEN (0x1u << 0) /**< \brief (TC_WPMR) Write Protection Enable */ +#define TC_WPMR_WPKEY_Pos 8 +#define TC_WPMR_WPKEY_Msk (0xffffffu << TC_WPMR_WPKEY_Pos) /**< \brief (TC_WPMR) Write Protection Key */ +#define TC_WPMR_WPKEY(value) ((TC_WPMR_WPKEY_Msk & ((value) << TC_WPMR_WPKEY_Pos))) +#define TC_WPMR_WPKEY_PASSWD (0x54494Du << 8) /**< \brief (TC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ +/* -------- TC_VER : (TC Offset: 0xFC) Version Register -------- */ +#define TC_VER_VERSION_Pos 0 +#define TC_VER_VERSION_Msk (0xfffu << TC_VER_VERSION_Pos) /**< \brief (TC_VER) Version of the Hardware Module */ +#define TC_VER_MFN_Pos 16 +#define TC_VER_MFN_Msk (0x7u << TC_VER_MFN_Pos) /**< \brief (TC_VER) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_TC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tdes.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tdes.h new file mode 100644 index 000000000..24d709414 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_tdes.h @@ -0,0 +1,175 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_TDES_COMPONENT_ +#define _SAMA5D2_TDES_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Triple Data Encryption Standard */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_TDES Triple Data Encryption Standard */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Tdes hardware registers */ +typedef struct { + __O uint32_t TDES_CR; /**< \brief (Tdes Offset: 0x00) Control Register */ + __IO uint32_t TDES_MR; /**< \brief (Tdes Offset: 0x04) Mode Register */ + __I uint32_t Reserved1[2]; + __O uint32_t TDES_IER; /**< \brief (Tdes Offset: 0x10) Interrupt Enable Register */ + __O uint32_t TDES_IDR; /**< \brief (Tdes Offset: 0x14) Interrupt Disable Register */ + __I uint32_t TDES_IMR; /**< \brief (Tdes Offset: 0x18) Interrupt Mask Register */ + __I uint32_t TDES_ISR; /**< \brief (Tdes Offset: 0x1C) Interrupt Status Register */ + __O uint32_t TDES_KEY1WR[2]; /**< \brief (Tdes Offset: 0x20) Key 1 Word Register */ + __O uint32_t TDES_KEY2WR[2]; /**< \brief (Tdes Offset: 0x28) Key 2 Word Register */ + __O uint32_t TDES_KEY3WR[2]; /**< \brief (Tdes Offset: 0x30) Key 3 Word Register */ + __I uint32_t Reserved2[2]; + __O uint32_t TDES_IDATAR[2]; /**< \brief (Tdes Offset: 0x40) Input Data Register */ + __I uint32_t Reserved3[2]; + __I uint32_t TDES_ODATAR[2]; /**< \brief (Tdes Offset: 0x50) Output Data Register */ + __I uint32_t Reserved4[2]; + __O uint32_t TDES_IVR[2]; /**< \brief (Tdes Offset: 0x60) Initialization Vector Register */ + __I uint32_t Reserved5[2]; + __IO uint32_t TDES_XTEA_RNDR; /**< \brief (Tdes Offset: 0x70) XTEA Rounds Register */ + __I uint32_t Reserved6[34]; + __I uint32_t TDES_VERSION; /**< \brief (Tdes Offset: 0xFC) Version Register */ +} Tdes; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- TDES_CR : (TDES Offset: 0x00) Control Register -------- */ +#define TDES_CR_START (0x1u << 0) /**< \brief (TDES_CR) Start Processing */ +#define TDES_CR_SWRST (0x1u << 8) /**< \brief (TDES_CR) Software Reset */ +#define TDES_CR_LOADSEED (0x1u << 16) /**< \brief (TDES_CR) Load Seed */ +/* -------- TDES_MR : (TDES Offset: 0x04) Mode Register -------- */ +#define TDES_MR_CIPHER (0x1u << 0) /**< \brief (TDES_MR) Processing Mode */ +#define TDES_MR_CIPHER_DECRYPT (0x0u << 0) /**< \brief (TDES_MR) Decrypts data. */ +#define TDES_MR_CIPHER_ENCRYPT (0x1u << 0) /**< \brief (TDES_MR) Encrypts data. */ +#define TDES_MR_TDESMOD_Pos 1 +#define TDES_MR_TDESMOD_Msk (0x3u << TDES_MR_TDESMOD_Pos) /**< \brief (TDES_MR) ALGORITHM Mode */ +#define TDES_MR_TDESMOD(value) ((TDES_MR_TDESMOD_Msk & ((value) << TDES_MR_TDESMOD_Pos))) +#define TDES_MR_TDESMOD_SINGLE_DES (0x0u << 1) /**< \brief (TDES_MR) Single DES processing using TDES_KEY1WRx registers */ +#define TDES_MR_TDESMOD_TRIPLE_DES (0x1u << 1) /**< \brief (TDES_MR) Triple DES processing using TDES_KEY1WRx, TDES_KEY2WRx and TDES_KEY3WRx registers */ +#define TDES_MR_TDESMOD_XTEA (0x2u << 1) /**< \brief (TDES_MR) XTEA processing using TDES_KEY1WRx, TDES_KEY2WRx */ +#define TDES_MR_KEYMOD (0x1u << 4) /**< \brief (TDES_MR) Key Mode */ +#define TDES_MR_SMOD_Pos 8 +#define TDES_MR_SMOD_Msk (0x3u << TDES_MR_SMOD_Pos) /**< \brief (TDES_MR) Start Mode */ +#define TDES_MR_SMOD(value) ((TDES_MR_SMOD_Msk & ((value) << TDES_MR_SMOD_Pos))) +#define TDES_MR_SMOD_MANUAL_START (0x0u << 8) /**< \brief (TDES_MR) Manual Mode */ +#define TDES_MR_SMOD_AUTO_START (0x1u << 8) /**< \brief (TDES_MR) Auto Mode */ +#define TDES_MR_SMOD_IDATAR0_START (0x2u << 8) /**< \brief (TDES_MR) TDES_IDATAR0 access only Auto Mode */ +#define TDES_MR_OPMOD_Pos 12 +#define TDES_MR_OPMOD_Msk (0x3u << TDES_MR_OPMOD_Pos) /**< \brief (TDES_MR) Operation Mode */ +#define TDES_MR_OPMOD(value) ((TDES_MR_OPMOD_Msk & ((value) << TDES_MR_OPMOD_Pos))) +#define TDES_MR_OPMOD_ECB (0x0u << 12) /**< \brief (TDES_MR) Electronic Code Book mode */ +#define TDES_MR_OPMOD_CBC (0x1u << 12) /**< \brief (TDES_MR) Cipher Block Chaining mode */ +#define TDES_MR_OPMOD_OFB (0x2u << 12) /**< \brief (TDES_MR) Output Feedback mode */ +#define TDES_MR_OPMOD_CFB (0x3u << 12) /**< \brief (TDES_MR) Cipher Feedback mode */ +#define TDES_MR_LOD (0x1u << 15) /**< \brief (TDES_MR) Last Output Data Mode */ +#define TDES_MR_CFBS_Pos 16 +#define TDES_MR_CFBS_Msk (0x3u << TDES_MR_CFBS_Pos) /**< \brief (TDES_MR) Cipher Feedback Data Size */ +#define TDES_MR_CFBS(value) ((TDES_MR_CFBS_Msk & ((value) << TDES_MR_CFBS_Pos))) +#define TDES_MR_CFBS_SIZE_64BIT (0x0u << 16) /**< \brief (TDES_MR) 64-bit */ +#define TDES_MR_CFBS_SIZE_32BIT (0x1u << 16) /**< \brief (TDES_MR) 32-bit */ +#define TDES_MR_CFBS_SIZE_16BIT (0x2u << 16) /**< \brief (TDES_MR) 16-bit */ +#define TDES_MR_CFBS_SIZE_8BIT (0x3u << 16) /**< \brief (TDES_MR) 8-bit */ +#define TDES_MR_CKEY_Pos 20 +#define TDES_MR_CKEY_Msk (0xfu << TDES_MR_CKEY_Pos) /**< \brief (TDES_MR) Countermeasure Key */ +#define TDES_MR_CKEY(value) ((TDES_MR_CKEY_Msk & ((value) << TDES_MR_CKEY_Pos))) +#define TDES_MR_CMTYP1 (0x1u << 24) /**< \brief (TDES_MR) Countermeasure Type 1 */ +#define TDES_MR_CMTYP1_NO_PAUSE (0x0u << 24) /**< \brief (TDES_MR) Countermeasure type 1 is disabled */ +#define TDES_MR_CMTYP1_PAUSE (0x1u << 24) /**< \brief (TDES_MR) Countermeasure type 1 is enabled */ +#define TDES_MR_CMTYP2 (0x1u << 25) /**< \brief (TDES_MR) Countermeasure Type 2 */ +#define TDES_MR_CMTYP2_NO_DUMMY (0x0u << 25) /**< \brief (TDES_MR) Countermeasure type 2 is disabled */ +#define TDES_MR_CMTYP2_DUMMY (0x1u << 25) /**< \brief (TDES_MR) Countermeasure type 2 is enabled */ +#define TDES_MR_CMTYP3 (0x1u << 26) /**< \brief (TDES_MR) Countermeasure Type 3 */ +#define TDES_MR_CMTYP3_NO_RESTART (0x0u << 26) /**< \brief (TDES_MR) Countermeasure type 3 is disabled */ +#define TDES_MR_CMTYP3_RESTART (0x1u << 26) /**< \brief (TDES_MR) Countermeasure type 3 is enabled */ +#define TDES_MR_CMTYP4 (0x1u << 27) /**< \brief (TDES_MR) Countermeasure Type 4 */ +#define TDES_MR_CMTYP4_NO_IDLECURRENT (0x0u << 27) /**< \brief (TDES_MR) Countermeasure type 4 is disabled */ +#define TDES_MR_CMTYP4_IDLECURRENT (0x1u << 27) /**< \brief (TDES_MR) Countermeasure type 4 is enabled */ +#define TDES_MR_CMTYP5 (0x1u << 28) /**< \brief (TDES_MR) Countermeasure Type 5 */ +#define TDES_MR_CMTYP5_NO_ADDACCESS (0x0u << 28) /**< \brief (TDES_MR) Countermeasure type 5 is disabled */ +#define TDES_MR_CMTYP5_ADDACCESS (0x1u << 28) /**< \brief (TDES_MR) Countermeasure type 5 is enabled */ +#define TDES_MR_CMTYP6 (0x1u << 29) /**< \brief (TDES_MR) Countermeasure Type 6 */ +#define TDES_MR_CMTYP6_NO_UNIFORM (0x0u << 29) /**< \brief (TDES_MR) Countermeasure type 6 is disabled */ +#define TDES_MR_CMTYP6_UNIFORM (0x1u << 29) /**< \brief (TDES_MR) Countermeasure type 6 is enabled */ +/* -------- TDES_IER : (TDES Offset: 0x10) Interrupt Enable Register -------- */ +#define TDES_IER_DATRDY (0x1u << 0) /**< \brief (TDES_IER) Data Ready Interrupt Enable */ +#define TDES_IER_URAD (0x1u << 8) /**< \brief (TDES_IER) Unspecified Register Access Detection Interrupt Enable */ +/* -------- TDES_IDR : (TDES Offset: 0x14) Interrupt Disable Register -------- */ +#define TDES_IDR_DATRDY (0x1u << 0) /**< \brief (TDES_IDR) Data Ready Interrupt Disable */ +#define TDES_IDR_URAD (0x1u << 8) /**< \brief (TDES_IDR) Unspecified Register Access Detection Interrupt Disable */ +/* -------- TDES_IMR : (TDES Offset: 0x18) Interrupt Mask Register -------- */ +#define TDES_IMR_DATRDY (0x1u << 0) /**< \brief (TDES_IMR) Data Ready Interrupt Mask */ +#define TDES_IMR_URAD (0x1u << 8) /**< \brief (TDES_IMR) Unspecified Register Access Detection Interrupt Mask */ +/* -------- TDES_ISR : (TDES Offset: 0x1C) Interrupt Status Register -------- */ +#define TDES_ISR_DATRDY (0x1u << 0) /**< \brief (TDES_ISR) Data Ready (cleared by setting bit START or bit SWRST in TDES_CR or by reading TDES_ODATARx) */ +#define TDES_ISR_URAD (0x1u << 8) /**< \brief (TDES_ISR) Unspecified Register Access Detection Status (cleared by setting bit TDES_CR.SWRST) */ +#define TDES_ISR_URAT_Pos 12 +#define TDES_ISR_URAT_Msk (0x3u << TDES_ISR_URAT_Pos) /**< \brief (TDES_ISR) Unspecified Register Access (cleared by setting bit TDES_CR.SWRST) */ +#define TDES_ISR_URAT_IDR_WR_PROCESSING (0x0u << 12) /**< \brief (TDES_ISR) Input Data Register written during the data processing when SMOD = 0x2 mode. */ +#define TDES_ISR_URAT_ODR_RD_PROCESSING (0x1u << 12) /**< \brief (TDES_ISR) Output Data Register read during the data processing. */ +#define TDES_ISR_URAT_MR_WR_PROCESSING (0x2u << 12) /**< \brief (TDES_ISR) Mode Register written during the data processing. */ +#define TDES_ISR_URAT_WOR_RD_ACCESS (0x3u << 12) /**< \brief (TDES_ISR) Write-only register read access. */ +/* -------- TDES_KEY1WR[2] : (TDES Offset: 0x20) Key 1 Word Register -------- */ +#define TDES_KEY1WR_KEY1W_Pos 0 +#define TDES_KEY1WR_KEY1W_Msk (0xffffffffu << TDES_KEY1WR_KEY1W_Pos) /**< \brief (TDES_KEY1WR[2]) Key 1 Word */ +#define TDES_KEY1WR_KEY1W(value) ((TDES_KEY1WR_KEY1W_Msk & ((value) << TDES_KEY1WR_KEY1W_Pos))) +/* -------- TDES_KEY2WR[2] : (TDES Offset: 0x28) Key 2 Word Register -------- */ +#define TDES_KEY2WR_KEY2W_Pos 0 +#define TDES_KEY2WR_KEY2W_Msk (0xffffffffu << TDES_KEY2WR_KEY2W_Pos) /**< \brief (TDES_KEY2WR[2]) Key 2 Word */ +#define TDES_KEY2WR_KEY2W(value) ((TDES_KEY2WR_KEY2W_Msk & ((value) << TDES_KEY2WR_KEY2W_Pos))) +/* -------- TDES_KEY3WR[2] : (TDES Offset: 0x30) Key 3 Word Register -------- */ +#define TDES_KEY3WR_KEY3W_Pos 0 +#define TDES_KEY3WR_KEY3W_Msk (0xffffffffu << TDES_KEY3WR_KEY3W_Pos) /**< \brief (TDES_KEY3WR[2]) Key 3 Word */ +#define TDES_KEY3WR_KEY3W(value) ((TDES_KEY3WR_KEY3W_Msk & ((value) << TDES_KEY3WR_KEY3W_Pos))) +/* -------- TDES_IDATAR[2] : (TDES Offset: 0x40) Input Data Register -------- */ +#define TDES_IDATAR_IDATA_Pos 0 +#define TDES_IDATAR_IDATA_Msk (0xffffffffu << TDES_IDATAR_IDATA_Pos) /**< \brief (TDES_IDATAR[2]) Input Data */ +#define TDES_IDATAR_IDATA(value) ((TDES_IDATAR_IDATA_Msk & ((value) << TDES_IDATAR_IDATA_Pos))) +/* -------- TDES_ODATAR[2] : (TDES Offset: 0x50) Output Data Register -------- */ +#define TDES_ODATAR_ODATA_Pos 0 +#define TDES_ODATAR_ODATA_Msk (0xffffffffu << TDES_ODATAR_ODATA_Pos) /**< \brief (TDES_ODATAR[2]) Output Data */ +/* -------- TDES_IVR[2] : (TDES Offset: 0x60) Initialization Vector Register -------- */ +#define TDES_IVR_IV_Pos 0 +#define TDES_IVR_IV_Msk (0xffffffffu << TDES_IVR_IV_Pos) /**< \brief (TDES_IVR[2]) Initialization Vector */ +#define TDES_IVR_IV(value) ((TDES_IVR_IV_Msk & ((value) << TDES_IVR_IV_Pos))) +/* -------- TDES_XTEA_RNDR : (TDES Offset: 0x70) XTEA Rounds Register -------- */ +#define TDES_XTEA_RNDR_XTEA_RNDS_Pos 0 +#define TDES_XTEA_RNDR_XTEA_RNDS_Msk (0x3fu << TDES_XTEA_RNDR_XTEA_RNDS_Pos) /**< \brief (TDES_XTEA_RNDR) Number of Rounds */ +#define TDES_XTEA_RNDR_XTEA_RNDS(value) ((TDES_XTEA_RNDR_XTEA_RNDS_Msk & ((value) << TDES_XTEA_RNDR_XTEA_RNDS_Pos))) +/* -------- TDES_VERSION : (TDES Offset: 0xFC) Version Register -------- */ +#define TDES_VERSION_VERSION_Pos 0 +#define TDES_VERSION_VERSION_Msk (0xfffu << TDES_VERSION_VERSION_Pos) /**< \brief (TDES_VERSION) Version of the Hardware Module */ +#define TDES_VERSION_MFN_Pos 16 +#define TDES_VERSION_MFN_Msk (0x7u << TDES_VERSION_MFN_Pos) /**< \brief (TDES_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_TDES_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_trng.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_trng.h new file mode 100644 index 000000000..2985b7b78 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_trng.h @@ -0,0 +1,80 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_TRNG_COMPONENT_ +#define _SAMA5D2_TRNG_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR True Random Number Generator */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_TRNG True Random Number Generator */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Trng hardware registers */ +typedef struct { + __O uint32_t TRNG_CR; /**< \brief (Trng Offset: 0x00) Control Register */ + __I uint32_t Reserved1[3]; + __O uint32_t TRNG_IER; /**< \brief (Trng Offset: 0x10) Interrupt Enable Register */ + __O uint32_t TRNG_IDR; /**< \brief (Trng Offset: 0x14) Interrupt Disable Register */ + __I uint32_t TRNG_IMR; /**< \brief (Trng Offset: 0x18) Interrupt Mask Register */ + __I uint32_t TRNG_ISR; /**< \brief (Trng Offset: 0x1C) Interrupt Status Register */ + __I uint32_t Reserved2[12]; + __I uint32_t TRNG_ODATA; /**< \brief (Trng Offset: 0x50) Output Data Register */ + __I uint32_t Reserved3[42]; + __I uint32_t TRNG_VERSION; /**< \brief (Trng Offset: 0xFC) Version Register */ +} Trng; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- TRNG_CR : (TRNG Offset: 0x00) Control Register -------- */ +#define TRNG_CR_ENABLE (0x1u << 0) /**< \brief (TRNG_CR) Enables the TRNG to Provide Random Values */ +#define TRNG_CR_KEY_Pos 8 +#define TRNG_CR_KEY_Msk (0xffffffu << TRNG_CR_KEY_Pos) /**< \brief (TRNG_CR) Security Key */ +#define TRNG_CR_KEY(value) ((TRNG_CR_KEY_Msk & ((value) << TRNG_CR_KEY_Pos))) +#define TRNG_CR_KEY_PASSWD (0x524E47u << 8) /**< \brief (TRNG_CR) Writing any other value in this field aborts the write operation. */ +/* -------- TRNG_IER : (TRNG Offset: 0x10) Interrupt Enable Register -------- */ +#define TRNG_IER_DATRDY (0x1u << 0) /**< \brief (TRNG_IER) Data Ready Interrupt Enable */ +/* -------- TRNG_IDR : (TRNG Offset: 0x14) Interrupt Disable Register -------- */ +#define TRNG_IDR_DATRDY (0x1u << 0) /**< \brief (TRNG_IDR) Data Ready Interrupt Disable */ +/* -------- TRNG_IMR : (TRNG Offset: 0x18) Interrupt Mask Register -------- */ +#define TRNG_IMR_DATRDY (0x1u << 0) /**< \brief (TRNG_IMR) Data Ready Interrupt Mask */ +/* -------- TRNG_ISR : (TRNG Offset: 0x1C) Interrupt Status Register -------- */ +#define TRNG_ISR_DATRDY (0x1u << 0) /**< \brief (TRNG_ISR) Data Ready */ +/* -------- TRNG_ODATA : (TRNG Offset: 0x50) Output Data Register -------- */ +#define TRNG_ODATA_ODATA_Pos 0 +#define TRNG_ODATA_ODATA_Msk (0xffffffffu << TRNG_ODATA_ODATA_Pos) /**< \brief (TRNG_ODATA) Output Data */ +/* -------- TRNG_VERSION : (TRNG Offset: 0xFC) Version Register -------- */ +#define TRNG_VERSION_VERSION_Pos 0 +#define TRNG_VERSION_VERSION_Msk (0xfffu << TRNG_VERSION_VERSION_Pos) /**< \brief (TRNG_VERSION) Version of the Hardware Module */ +#define TRNG_VERSION_MFN_Pos 16 +#define TRNG_VERSION_MFN_Msk (0x7u << TRNG_VERSION_MFN_Pos) /**< \brief (TRNG_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_TRNG_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_twihs.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_twihs.h new file mode 100644 index 000000000..7ea4c7cae --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_twihs.h @@ -0,0 +1,373 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_TWIHS_COMPONENT_ +#define _SAMA5D2_TWIHS_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Two-wire Interface High Speed */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_TWIHS Two-wire Interface High Speed */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Twihs hardware registers */ +typedef struct { + __O uint32_t TWIHS_CR; /**< \brief (Twihs Offset: 0x00) Control Register */ + __IO uint32_t TWIHS_MMR; /**< \brief (Twihs Offset: 0x04) Master Mode Register */ + __IO uint32_t TWIHS_SMR; /**< \brief (Twihs Offset: 0x08) Slave Mode Register */ + __IO uint32_t TWIHS_IADR; /**< \brief (Twihs Offset: 0x0C) Internal Address Register */ + __IO uint32_t TWIHS_CWGR; /**< \brief (Twihs Offset: 0x10) Clock Waveform Generator Register */ + __I uint32_t Reserved1[3]; + __I uint32_t TWIHS_SR; /**< \brief (Twihs Offset: 0x20) Status Register */ + __O uint32_t TWIHS_IER; /**< \brief (Twihs Offset: 0x24) Interrupt Enable Register */ + __O uint32_t TWIHS_IDR; /**< \brief (Twihs Offset: 0x28) Interrupt Disable Register */ + __I uint32_t TWIHS_IMR; /**< \brief (Twihs Offset: 0x2C) Interrupt Mask Register */ + __I uint32_t TWIHS_RHR; /**< \brief (Twihs Offset: 0x30) Receive Holding Register */ + __O uint32_t TWIHS_THR; /**< \brief (Twihs Offset: 0x34) Transmit Holding Register */ + __IO uint32_t TWIHS_SMBTR; /**< \brief (Twihs Offset: 0x38) SMBus Timing Register */ + __I uint32_t Reserved2[1]; + __IO uint32_t TWIHS_ACR; /**< \brief (Twihs Offset: 0x40) Alternative Command Register */ + __IO uint32_t TWIHS_FILTR; /**< \brief (Twihs Offset: 0x44) Filter Register */ + __I uint32_t Reserved3[1]; + __IO uint32_t TWIHS_SWMR; /**< \brief (Twihs Offset: 0x4C) SleepWalking Matching Register */ + __IO uint32_t TWIHS_FMR; /**< \brief (Twihs Offset: 0x50) FIFO Mode Register */ + __I uint32_t TWIHS_FLR; /**< \brief (Twihs Offset: 0x54) FIFO Level Register */ + __I uint32_t Reserved4[2]; + __I uint32_t TWIHS_FSR; /**< \brief (Twihs Offset: 0x60) FIFO Status Register */ + __O uint32_t TWIHS_FIER; /**< \brief (Twihs Offset: 0x64) FIFO Interrupt Enable Register */ + __O uint32_t TWIHS_FIDR; /**< \brief (Twihs Offset: 0x68) FIFO Interrupt Disable Register */ + __I uint32_t TWIHS_FIMR; /**< \brief (Twihs Offset: 0x6C) FIFO Interrupt Mask Register */ + __I uint32_t Reserved5[24]; + __I uint32_t TWIHS_DR; /**< \brief (Twihs Offset: 0xD0) Debug Register */ + __I uint32_t Reserved6[4]; + __IO uint32_t TWIHS_WPMR; /**< \brief (Twihs Offset: 0xE4) Write Protection Mode Register */ + __I uint32_t TWIHS_WPSR; /**< \brief (Twihs Offset: 0xE8) Write Protection Status Register */ + __I uint32_t Reserved7[4]; + __I uint32_t TWIHS_VER; /**< \brief (Twihs Offset: 0xFC) Version Register */ +} Twihs; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- TWIHS_CR : (TWIHS Offset: 0x00) Control Register -------- */ +#define TWIHS_CR_START (0x1u << 0) /**< \brief (TWIHS_CR) Send a START Condition */ +#define TWIHS_CR_STOP (0x1u << 1) /**< \brief (TWIHS_CR) Send a STOP Condition */ +#define TWIHS_CR_MSEN (0x1u << 2) /**< \brief (TWIHS_CR) TWIHS Master Mode Enabled */ +#define TWIHS_CR_MSDIS (0x1u << 3) /**< \brief (TWIHS_CR) TWIHS Master Mode Disabled */ +#define TWIHS_CR_SVEN (0x1u << 4) /**< \brief (TWIHS_CR) TWIHS Slave Mode Enabled */ +#define TWIHS_CR_SVDIS (0x1u << 5) /**< \brief (TWIHS_CR) TWIHS Slave Mode Disabled */ +#define TWIHS_CR_QUICK (0x1u << 6) /**< \brief (TWIHS_CR) SMBus Quick Command */ +#define TWIHS_CR_SWRST (0x1u << 7) /**< \brief (TWIHS_CR) Software Reset */ +#define TWIHS_CR_HSEN (0x1u << 8) /**< \brief (TWIHS_CR) TWIHS High-Speed Mode Enabled */ +#define TWIHS_CR_HSDIS (0x1u << 9) /**< \brief (TWIHS_CR) TWIHS High-Speed Mode Disabled */ +#define TWIHS_CR_SMBEN (0x1u << 10) /**< \brief (TWIHS_CR) SMBus Mode Enabled */ +#define TWIHS_CR_SMBDIS (0x1u << 11) /**< \brief (TWIHS_CR) SMBus Mode Disabled */ +#define TWIHS_CR_PECEN (0x1u << 12) /**< \brief (TWIHS_CR) Packet Error Checking Enable */ +#define TWIHS_CR_PECDIS (0x1u << 13) /**< \brief (TWIHS_CR) Packet Error Checking Disable */ +#define TWIHS_CR_PECRQ (0x1u << 14) /**< \brief (TWIHS_CR) PEC Request */ +#define TWIHS_CR_CLEAR (0x1u << 15) /**< \brief (TWIHS_CR) Bus CLEAR Command */ +#define TWIHS_CR_ACMEN (0x1u << 16) /**< \brief (TWIHS_CR) Alternative Command Mode Enable */ +#define TWIHS_CR_ACMDIS (0x1u << 17) /**< \brief (TWIHS_CR) Alternative Command Mode Disable */ +#define TWIHS_CR_THRCLR (0x1u << 24) /**< \brief (TWIHS_CR) Transmit Holding Register Clear */ +#define TWIHS_CR_LOCKCLR (0x1u << 26) /**< \brief (TWIHS_CR) Lock Clear */ +#define TWIHS_CR_FIFOEN (0x1u << 28) /**< \brief (TWIHS_CR) FIFO Enable */ +#define TWIHS_CR_FIFODIS (0x1u << 29) /**< \brief (TWIHS_CR) FIFO Disable */ +/* -------- TWIHS_MMR : (TWIHS Offset: 0x04) Master Mode Register -------- */ +#define TWIHS_MMR_IADRSZ_Pos 8 +#define TWIHS_MMR_IADRSZ_Msk (0x3u << TWIHS_MMR_IADRSZ_Pos) /**< \brief (TWIHS_MMR) Internal Device Address Size */ +#define TWIHS_MMR_IADRSZ(value) ((TWIHS_MMR_IADRSZ_Msk & ((value) << TWIHS_MMR_IADRSZ_Pos))) +#define TWIHS_MMR_IADRSZ_NONE (0x0u << 8) /**< \brief (TWIHS_MMR) No internal device address */ +#define TWIHS_MMR_IADRSZ_1_BYTE (0x1u << 8) /**< \brief (TWIHS_MMR) One-byte internal device address */ +#define TWIHS_MMR_IADRSZ_2_BYTE (0x2u << 8) /**< \brief (TWIHS_MMR) Two-byte internal device address */ +#define TWIHS_MMR_IADRSZ_3_BYTE (0x3u << 8) /**< \brief (TWIHS_MMR) Three-byte internal device address */ +#define TWIHS_MMR_MREAD (0x1u << 12) /**< \brief (TWIHS_MMR) Master Read Direction */ +#define TWIHS_MMR_DADR_Pos 16 +#define TWIHS_MMR_DADR_Msk (0x7fu << TWIHS_MMR_DADR_Pos) /**< \brief (TWIHS_MMR) Device Address */ +#define TWIHS_MMR_DADR(value) ((TWIHS_MMR_DADR_Msk & ((value) << TWIHS_MMR_DADR_Pos))) +/* -------- TWIHS_SMR : (TWIHS Offset: 0x08) Slave Mode Register -------- */ +#define TWIHS_SMR_NACKEN (0x1u << 0) /**< \brief (TWIHS_SMR) Slave Receiver Data Phase NACK enable */ +#define TWIHS_SMR_SMDA (0x1u << 2) /**< \brief (TWIHS_SMR) SMBus Default Address */ +#define TWIHS_SMR_SMHH (0x1u << 3) /**< \brief (TWIHS_SMR) SMBus Host Header */ +#define TWIHS_SMR_SCLWSDIS (0x1u << 6) /**< \brief (TWIHS_SMR) Clock Wait State Disable */ +#define TWIHS_SMR_MASK_Pos 8 +#define TWIHS_SMR_MASK_Msk (0x7fu << TWIHS_SMR_MASK_Pos) /**< \brief (TWIHS_SMR) Slave Address Mask */ +#define TWIHS_SMR_MASK(value) ((TWIHS_SMR_MASK_Msk & ((value) << TWIHS_SMR_MASK_Pos))) +#define TWIHS_SMR_SADR_Pos 16 +#define TWIHS_SMR_SADR_Msk (0x7fu << TWIHS_SMR_SADR_Pos) /**< \brief (TWIHS_SMR) Slave Address */ +#define TWIHS_SMR_SADR(value) ((TWIHS_SMR_SADR_Msk & ((value) << TWIHS_SMR_SADR_Pos))) +#define TWIHS_SMR_SADR1EN (0x1u << 28) /**< \brief (TWIHS_SMR) Slave Address 1 Enable */ +#define TWIHS_SMR_SADR2EN (0x1u << 29) /**< \brief (TWIHS_SMR) Slave Address 2 Enable */ +#define TWIHS_SMR_SADR3EN (0x1u << 30) /**< \brief (TWIHS_SMR) Slave Address 3 Enable */ +#define TWIHS_SMR_DATAMEN (0x1u << 31) /**< \brief (TWIHS_SMR) Data Matching Enable */ +/* -------- TWIHS_IADR : (TWIHS Offset: 0x0C) Internal Address Register -------- */ +#define TWIHS_IADR_IADR_Pos 0 +#define TWIHS_IADR_IADR_Msk (0xffffffu << TWIHS_IADR_IADR_Pos) /**< \brief (TWIHS_IADR) Internal Address */ +#define TWIHS_IADR_IADR(value) ((TWIHS_IADR_IADR_Msk & ((value) << TWIHS_IADR_IADR_Pos))) +/* -------- TWIHS_CWGR : (TWIHS Offset: 0x10) Clock Waveform Generator Register -------- */ +#define TWIHS_CWGR_CLDIV_Pos 0 +#define TWIHS_CWGR_CLDIV_Msk (0xffu << TWIHS_CWGR_CLDIV_Pos) /**< \brief (TWIHS_CWGR) Clock Low Divider */ +#define TWIHS_CWGR_CLDIV(value) ((TWIHS_CWGR_CLDIV_Msk & ((value) << TWIHS_CWGR_CLDIV_Pos))) +#define TWIHS_CWGR_CHDIV_Pos 8 +#define TWIHS_CWGR_CHDIV_Msk (0xffu << TWIHS_CWGR_CHDIV_Pos) /**< \brief (TWIHS_CWGR) Clock High Divider */ +#define TWIHS_CWGR_CHDIV(value) ((TWIHS_CWGR_CHDIV_Msk & ((value) << TWIHS_CWGR_CHDIV_Pos))) +#define TWIHS_CWGR_CKDIV_Pos 16 +#define TWIHS_CWGR_CKDIV_Msk (0x7u << TWIHS_CWGR_CKDIV_Pos) /**< \brief (TWIHS_CWGR) Clock Divider */ +#define TWIHS_CWGR_CKDIV(value) ((TWIHS_CWGR_CKDIV_Msk & ((value) << TWIHS_CWGR_CKDIV_Pos))) +#define TWIHS_CWGR_CKSRC (0x1u << 20) /**< \brief (TWIHS_CWGR) Transfer Rate Clock Source */ +#define TWIHS_CWGR_CKSRC_PERIPH_CK (0x0u << 20) /**< \brief (TWIHS_CWGR) Peripheral clock is used to generate the TWIHS baud rate. */ +#define TWIHS_CWGR_CKSRC_PMC_PCK (0x1u << 20) /**< \brief (TWIHS_CWGR) PMC PCKx is used to generate the TWIHS baud rate. */ +#define TWIHS_CWGR_HOLD_Pos 24 +#define TWIHS_CWGR_HOLD_Msk (0x1fu << TWIHS_CWGR_HOLD_Pos) /**< \brief (TWIHS_CWGR) TWD Hold Time Versus TWCK Falling */ +#define TWIHS_CWGR_HOLD(value) ((TWIHS_CWGR_HOLD_Msk & ((value) << TWIHS_CWGR_HOLD_Pos))) +/* -------- TWIHS_SR : (TWIHS Offset: 0x20) Status Register -------- */ +#define TWIHS_SR_TXCOMP (0x1u << 0) /**< \brief (TWIHS_SR) Transmission Completed (cleared by writing TWIHS_THR) */ +#define TWIHS_SR_RXRDY (0x1u << 1) /**< \brief (TWIHS_SR) Receive Holding Register Ready (cleared by reading TWIHS_RHR) */ +#define TWIHS_SR_TXRDY (0x1u << 2) /**< \brief (TWIHS_SR) Transmit Holding Register Ready (cleared by writing TWIHS_THR) */ +#define TWIHS_SR_SVREAD (0x1u << 3) /**< \brief (TWIHS_SR) Slave Read */ +#define TWIHS_SR_SVACC (0x1u << 4) /**< \brief (TWIHS_SR) Slave Access */ +#define TWIHS_SR_GACC (0x1u << 5) /**< \brief (TWIHS_SR) General Call Access (cleared on read) */ +#define TWIHS_SR_OVRE (0x1u << 6) /**< \brief (TWIHS_SR) Overrun Error (cleared on read) */ +#define TWIHS_SR_UNRE (0x1u << 7) /**< \brief (TWIHS_SR) Underrun Error (cleared on read) */ +#define TWIHS_SR_NACK (0x1u << 8) /**< \brief (TWIHS_SR) Not Acknowledged (cleared on read) */ +#define TWIHS_SR_ARBLST (0x1u << 9) /**< \brief (TWIHS_SR) Arbitration Lost (cleared on read) */ +#define TWIHS_SR_SCLWS (0x1u << 10) /**< \brief (TWIHS_SR) Clock Wait State */ +#define TWIHS_SR_EOSACC (0x1u << 11) /**< \brief (TWIHS_SR) End Of Slave Access (cleared on read) */ +#define TWIHS_SR_MCACK (0x1u << 16) /**< \brief (TWIHS_SR) Master Code Acknowledge (cleared on read) */ +#define TWIHS_SR_TOUT (0x1u << 18) /**< \brief (TWIHS_SR) Timeout Error (cleared on read) */ +#define TWIHS_SR_PECERR (0x1u << 19) /**< \brief (TWIHS_SR) PEC Error (cleared on read) */ +#define TWIHS_SR_SMBDAM (0x1u << 20) /**< \brief (TWIHS_SR) SMBus Default Address Match (cleared on read) */ +#define TWIHS_SR_SMBHHM (0x1u << 21) /**< \brief (TWIHS_SR) SMBus Host Header Address Match (cleared on read) */ +#define TWIHS_SR_LOCK (0x1u << 23) /**< \brief (TWIHS_SR) TWIHS Lock due to Frame Errors (cleared by writing a one to bit LOCKCLR in TWIHS_CR) */ +#define TWIHS_SR_SCL (0x1u << 24) /**< \brief (TWIHS_SR) SCL Line Value */ +#define TWIHS_SR_SDA (0x1u << 25) /**< \brief (TWIHS_SR) SDA Line Value */ +/* -------- TWIHS_IER : (TWIHS Offset: 0x24) Interrupt Enable Register -------- */ +#define TWIHS_IER_TXCOMP (0x1u << 0) /**< \brief (TWIHS_IER) Transmission Completed Interrupt Enable */ +#define TWIHS_IER_RXRDY (0x1u << 1) /**< \brief (TWIHS_IER) Receive Holding Register Ready Interrupt Enable */ +#define TWIHS_IER_TXRDY (0x1u << 2) /**< \brief (TWIHS_IER) Transmit Holding Register Ready Interrupt Enable */ +#define TWIHS_IER_SVACC (0x1u << 4) /**< \brief (TWIHS_IER) Slave Access Interrupt Enable */ +#define TWIHS_IER_GACC (0x1u << 5) /**< \brief (TWIHS_IER) General Call Access Interrupt Enable */ +#define TWIHS_IER_OVRE (0x1u << 6) /**< \brief (TWIHS_IER) Overrun Error Interrupt Enable */ +#define TWIHS_IER_UNRE (0x1u << 7) /**< \brief (TWIHS_IER) Underrun Error Interrupt Enable */ +#define TWIHS_IER_NACK (0x1u << 8) /**< \brief (TWIHS_IER) Not Acknowledge Interrupt Enable */ +#define TWIHS_IER_ARBLST (0x1u << 9) /**< \brief (TWIHS_IER) Arbitration Lost Interrupt Enable */ +#define TWIHS_IER_SCL_WS (0x1u << 10) /**< \brief (TWIHS_IER) Clock Wait State Interrupt Enable */ +#define TWIHS_IER_EOSACC (0x1u << 11) /**< \brief (TWIHS_IER) End Of Slave Access Interrupt Enable */ +#define TWIHS_IER_MCACK (0x1u << 16) /**< \brief (TWIHS_IER) Master Code Acknowledge Interrupt Enable */ +#define TWIHS_IER_TOUT (0x1u << 18) /**< \brief (TWIHS_IER) Timeout Error Interrupt Enable */ +#define TWIHS_IER_PECERR (0x1u << 19) /**< \brief (TWIHS_IER) PEC Error Interrupt Enable */ +#define TWIHS_IER_SMBDAM (0x1u << 20) /**< \brief (TWIHS_IER) SMBus Default Address Match Interrupt Enable */ +#define TWIHS_IER_SMBHHM (0x1u << 21) /**< \brief (TWIHS_IER) SMBus Host Header Address Match Interrupt Enable */ +/* -------- TWIHS_IDR : (TWIHS Offset: 0x28) Interrupt Disable Register -------- */ +#define TWIHS_IDR_TXCOMP (0x1u << 0) /**< \brief (TWIHS_IDR) Transmission Completed Interrupt Disable */ +#define TWIHS_IDR_RXRDY (0x1u << 1) /**< \brief (TWIHS_IDR) Receive Holding Register Ready Interrupt Disable */ +#define TWIHS_IDR_TXRDY (0x1u << 2) /**< \brief (TWIHS_IDR) Transmit Holding Register Ready Interrupt Disable */ +#define TWIHS_IDR_SVACC (0x1u << 4) /**< \brief (TWIHS_IDR) Slave Access Interrupt Disable */ +#define TWIHS_IDR_GACC (0x1u << 5) /**< \brief (TWIHS_IDR) General Call Access Interrupt Disable */ +#define TWIHS_IDR_OVRE (0x1u << 6) /**< \brief (TWIHS_IDR) Overrun Error Interrupt Disable */ +#define TWIHS_IDR_UNRE (0x1u << 7) /**< \brief (TWIHS_IDR) Underrun Error Interrupt Disable */ +#define TWIHS_IDR_NACK (0x1u << 8) /**< \brief (TWIHS_IDR) Not Acknowledge Interrupt Disable */ +#define TWIHS_IDR_ARBLST (0x1u << 9) /**< \brief (TWIHS_IDR) Arbitration Lost Interrupt Disable */ +#define TWIHS_IDR_SCL_WS (0x1u << 10) /**< \brief (TWIHS_IDR) Clock Wait State Interrupt Disable */ +#define TWIHS_IDR_EOSACC (0x1u << 11) /**< \brief (TWIHS_IDR) End Of Slave Access Interrupt Disable */ +#define TWIHS_IDR_MCACK (0x1u << 16) /**< \brief (TWIHS_IDR) Master Code Acknowledge Interrupt Disable */ +#define TWIHS_IDR_TOUT (0x1u << 18) /**< \brief (TWIHS_IDR) Timeout Error Interrupt Disable */ +#define TWIHS_IDR_PECERR (0x1u << 19) /**< \brief (TWIHS_IDR) PEC Error Interrupt Disable */ +#define TWIHS_IDR_SMBDAM (0x1u << 20) /**< \brief (TWIHS_IDR) SMBus Default Address Match Interrupt Disable */ +#define TWIHS_IDR_SMBHHM (0x1u << 21) /**< \brief (TWIHS_IDR) SMBus Host Header Address Match Interrupt Disable */ +/* -------- TWIHS_IMR : (TWIHS Offset: 0x2C) Interrupt Mask Register -------- */ +#define TWIHS_IMR_TXCOMP (0x1u << 0) /**< \brief (TWIHS_IMR) Transmission Completed Interrupt Mask */ +#define TWIHS_IMR_RXRDY (0x1u << 1) /**< \brief (TWIHS_IMR) Receive Holding Register Ready Interrupt Mask */ +#define TWIHS_IMR_TXRDY (0x1u << 2) /**< \brief (TWIHS_IMR) Transmit Holding Register Ready Interrupt Mask */ +#define TWIHS_IMR_SVACC (0x1u << 4) /**< \brief (TWIHS_IMR) Slave Access Interrupt Mask */ +#define TWIHS_IMR_GACC (0x1u << 5) /**< \brief (TWIHS_IMR) General Call Access Interrupt Mask */ +#define TWIHS_IMR_OVRE (0x1u << 6) /**< \brief (TWIHS_IMR) Overrun Error Interrupt Mask */ +#define TWIHS_IMR_UNRE (0x1u << 7) /**< \brief (TWIHS_IMR) Underrun Error Interrupt Mask */ +#define TWIHS_IMR_NACK (0x1u << 8) /**< \brief (TWIHS_IMR) Not Acknowledge Interrupt Mask */ +#define TWIHS_IMR_ARBLST (0x1u << 9) /**< \brief (TWIHS_IMR) Arbitration Lost Interrupt Mask */ +#define TWIHS_IMR_SCL_WS (0x1u << 10) /**< \brief (TWIHS_IMR) Clock Wait State Interrupt Mask */ +#define TWIHS_IMR_EOSACC (0x1u << 11) /**< \brief (TWIHS_IMR) End Of Slave Access Interrupt Mask */ +#define TWIHS_IMR_MCACK (0x1u << 16) /**< \brief (TWIHS_IMR) Master Code Acknowledge Interrupt Mask */ +#define TWIHS_IMR_TOUT (0x1u << 18) /**< \brief (TWIHS_IMR) Timeout Error Interrupt Mask */ +#define TWIHS_IMR_PECERR (0x1u << 19) /**< \brief (TWIHS_IMR) PEC Error Interrupt Mask */ +#define TWIHS_IMR_SMBDAM (0x1u << 20) /**< \brief (TWIHS_IMR) SMBus Default Address Match Interrupt Mask */ +#define TWIHS_IMR_SMBHHM (0x1u << 21) /**< \brief (TWIHS_IMR) SMBus Host Header Address Match Interrupt Mask */ +/* -------- TWIHS_RHR : (TWIHS Offset: 0x30) Receive Holding Register -------- */ +#define TWIHS_RHR_RXDATA_Pos 0 +#define TWIHS_RHR_RXDATA_Msk (0xffu << TWIHS_RHR_RXDATA_Pos) /**< \brief (TWIHS_RHR) Master or Slave Receive Holding Data */ +#define TWIHS_RHR_RXDATA0_Pos 0 +#define TWIHS_RHR_RXDATA0_Msk (0xffu << TWIHS_RHR_RXDATA0_Pos) /**< \brief (TWIHS_RHR) Master or Slave Receive Holding Data 0 */ +#define TWIHS_RHR_RXDATA1_Pos 8 +#define TWIHS_RHR_RXDATA1_Msk (0xffu << TWIHS_RHR_RXDATA1_Pos) /**< \brief (TWIHS_RHR) Master or Slave Receive Holding Data 1 */ +#define TWIHS_RHR_RXDATA2_Pos 16 +#define TWIHS_RHR_RXDATA2_Msk (0xffu << TWIHS_RHR_RXDATA2_Pos) /**< \brief (TWIHS_RHR) Master or Slave Receive Holding Data 2 */ +#define TWIHS_RHR_RXDATA3_Pos 24 +#define TWIHS_RHR_RXDATA3_Msk (0xffu << TWIHS_RHR_RXDATA3_Pos) /**< \brief (TWIHS_RHR) Master or Slave Receive Holding Data 3 */ +/* -------- TWIHS_THR : (TWIHS Offset: 0x34) Transmit Holding Register -------- */ +#define TWIHS_THR_TXDATA_Pos 0 +#define TWIHS_THR_TXDATA_Msk (0xffu << TWIHS_THR_TXDATA_Pos) /**< \brief (TWIHS_THR) Master or Slave Transmit Holding Data */ +#define TWIHS_THR_TXDATA(value) ((TWIHS_THR_TXDATA_Msk & ((value) << TWIHS_THR_TXDATA_Pos))) +#define TWIHS_THR_TXDATA0_Pos 0 +#define TWIHS_THR_TXDATA0_Msk (0xffu << TWIHS_THR_TXDATA0_Pos) /**< \brief (TWIHS_THR) Master or Slave Transmit Holding Data 0 */ +#define TWIHS_THR_TXDATA0(value) ((TWIHS_THR_TXDATA0_Msk & ((value) << TWIHS_THR_TXDATA0_Pos))) +#define TWIHS_THR_TXDATA1_Pos 8 +#define TWIHS_THR_TXDATA1_Msk (0xffu << TWIHS_THR_TXDATA1_Pos) /**< \brief (TWIHS_THR) Master or Slave Transmit Holding Data 1 */ +#define TWIHS_THR_TXDATA1(value) ((TWIHS_THR_TXDATA1_Msk & ((value) << TWIHS_THR_TXDATA1_Pos))) +#define TWIHS_THR_TXDATA2_Pos 16 +#define TWIHS_THR_TXDATA2_Msk (0xffu << TWIHS_THR_TXDATA2_Pos) /**< \brief (TWIHS_THR) Master or Slave Transmit Holding Data 2 */ +#define TWIHS_THR_TXDATA2(value) ((TWIHS_THR_TXDATA2_Msk & ((value) << TWIHS_THR_TXDATA2_Pos))) +#define TWIHS_THR_TXDATA3_Pos 24 +#define TWIHS_THR_TXDATA3_Msk (0xffu << TWIHS_THR_TXDATA3_Pos) /**< \brief (TWIHS_THR) Master or Slave Transmit Holding Data 3 */ +#define TWIHS_THR_TXDATA3(value) ((TWIHS_THR_TXDATA3_Msk & ((value) << TWIHS_THR_TXDATA3_Pos))) +/* -------- TWIHS_SMBTR : (TWIHS Offset: 0x38) SMBus Timing Register -------- */ +#define TWIHS_SMBTR_PRESC_Pos 0 +#define TWIHS_SMBTR_PRESC_Msk (0xfu << TWIHS_SMBTR_PRESC_Pos) /**< \brief (TWIHS_SMBTR) SMBus Clock Prescaler */ +#define TWIHS_SMBTR_PRESC(value) ((TWIHS_SMBTR_PRESC_Msk & ((value) << TWIHS_SMBTR_PRESC_Pos))) +#define TWIHS_SMBTR_TLOWS_Pos 8 +#define TWIHS_SMBTR_TLOWS_Msk (0xffu << TWIHS_SMBTR_TLOWS_Pos) /**< \brief (TWIHS_SMBTR) Slave Clock Stretch Maximum Cycles */ +#define TWIHS_SMBTR_TLOWS(value) ((TWIHS_SMBTR_TLOWS_Msk & ((value) << TWIHS_SMBTR_TLOWS_Pos))) +#define TWIHS_SMBTR_TLOWM_Pos 16 +#define TWIHS_SMBTR_TLOWM_Msk (0xffu << TWIHS_SMBTR_TLOWM_Pos) /**< \brief (TWIHS_SMBTR) Master Clock Stretch Maximum Cycles */ +#define TWIHS_SMBTR_TLOWM(value) ((TWIHS_SMBTR_TLOWM_Msk & ((value) << TWIHS_SMBTR_TLOWM_Pos))) +#define TWIHS_SMBTR_THMAX_Pos 24 +#define TWIHS_SMBTR_THMAX_Msk (0xffu << TWIHS_SMBTR_THMAX_Pos) /**< \brief (TWIHS_SMBTR) Clock High Maximum Cycles */ +#define TWIHS_SMBTR_THMAX(value) ((TWIHS_SMBTR_THMAX_Msk & ((value) << TWIHS_SMBTR_THMAX_Pos))) +/* -------- TWIHS_ACR : (TWIHS Offset: 0x40) Alternative Command Register -------- */ +#define TWIHS_ACR_DATAL_Pos 0 +#define TWIHS_ACR_DATAL_Msk (0xffu << TWIHS_ACR_DATAL_Pos) /**< \brief (TWIHS_ACR) Data Length */ +#define TWIHS_ACR_DATAL(value) ((TWIHS_ACR_DATAL_Msk & ((value) << TWIHS_ACR_DATAL_Pos))) +#define TWIHS_ACR_DIR (0x1u << 8) /**< \brief (TWIHS_ACR) Transfer Direction */ +#define TWIHS_ACR_PEC (0x1u << 9) /**< \brief (TWIHS_ACR) PEC Request (SMBus Mode only) */ +#define TWIHS_ACR_NDATAL_Pos 16 +#define TWIHS_ACR_NDATAL_Msk (0xffu << TWIHS_ACR_NDATAL_Pos) /**< \brief (TWIHS_ACR) Next Data Length */ +#define TWIHS_ACR_NDATAL(value) ((TWIHS_ACR_NDATAL_Msk & ((value) << TWIHS_ACR_NDATAL_Pos))) +#define TWIHS_ACR_NDIR (0x1u << 24) /**< \brief (TWIHS_ACR) Next Transfer Direction */ +#define TWIHS_ACR_NPEC (0x1u << 25) /**< \brief (TWIHS_ACR) Next PEC Request (SMBus Mode only) */ +/* -------- TWIHS_FILTR : (TWIHS Offset: 0x44) Filter Register -------- */ +#define TWIHS_FILTR_FILT (0x1u << 0) /**< \brief (TWIHS_FILTR) RX Digital Filter */ +#define TWIHS_FILTR_PADFEN (0x1u << 1) /**< \brief (TWIHS_FILTR) PAD Filter Enable */ +#define TWIHS_FILTR_PADFCFG (0x1u << 2) /**< \brief (TWIHS_FILTR) PAD Filter Config */ +#define TWIHS_FILTR_THRES_Pos 8 +#define TWIHS_FILTR_THRES_Msk (0x7u << TWIHS_FILTR_THRES_Pos) /**< \brief (TWIHS_FILTR) Digital Filter Threshold */ +#define TWIHS_FILTR_THRES(value) ((TWIHS_FILTR_THRES_Msk & ((value) << TWIHS_FILTR_THRES_Pos))) +/* -------- TWIHS_SWMR : (TWIHS Offset: 0x4C) SleepWalking Matching Register -------- */ +#define TWIHS_SWMR_SADR1_Pos 0 +#define TWIHS_SWMR_SADR1_Msk (0x7fu << TWIHS_SWMR_SADR1_Pos) /**< \brief (TWIHS_SWMR) Slave Address 1 */ +#define TWIHS_SWMR_SADR1(value) ((TWIHS_SWMR_SADR1_Msk & ((value) << TWIHS_SWMR_SADR1_Pos))) +#define TWIHS_SWMR_SADR2_Pos 8 +#define TWIHS_SWMR_SADR2_Msk (0x7fu << TWIHS_SWMR_SADR2_Pos) /**< \brief (TWIHS_SWMR) Slave Address 2 */ +#define TWIHS_SWMR_SADR2(value) ((TWIHS_SWMR_SADR2_Msk & ((value) << TWIHS_SWMR_SADR2_Pos))) +#define TWIHS_SWMR_SADR3_Pos 16 +#define TWIHS_SWMR_SADR3_Msk (0x7fu << TWIHS_SWMR_SADR3_Pos) /**< \brief (TWIHS_SWMR) Slave Address 3 */ +#define TWIHS_SWMR_SADR3(value) ((TWIHS_SWMR_SADR3_Msk & ((value) << TWIHS_SWMR_SADR3_Pos))) +#define TWIHS_SWMR_DATAM_Pos 24 +#define TWIHS_SWMR_DATAM_Msk (0xffu << TWIHS_SWMR_DATAM_Pos) /**< \brief (TWIHS_SWMR) Data Match */ +#define TWIHS_SWMR_DATAM(value) ((TWIHS_SWMR_DATAM_Msk & ((value) << TWIHS_SWMR_DATAM_Pos))) +/* -------- TWIHS_FMR : (TWIHS Offset: 0x50) FIFO Mode Register -------- */ +#define TWIHS_FMR_TXRDYM_Pos 0 +#define TWIHS_FMR_TXRDYM_Msk (0x3u << TWIHS_FMR_TXRDYM_Pos) /**< \brief (TWIHS_FMR) Transmitter Ready Mode */ +#define TWIHS_FMR_TXRDYM(value) ((TWIHS_FMR_TXRDYM_Msk & ((value) << TWIHS_FMR_TXRDYM_Pos))) +#define TWIHS_FMR_TXRDYM_ONE_DATA (0x0u << 0) /**< \brief (TWIHS_FMR) TXRDY will be at level '1' when at least one data can be written in the Transmit FIFO */ +#define TWIHS_FMR_TXRDYM_TWO_DATA (0x1u << 0) /**< \brief (TWIHS_FMR) TXRDY will be at level '1' when at least two data can be written in the Transmit FIFO */ +#define TWIHS_FMR_TXRDYM_FOUR_DATA (0x2u << 0) /**< \brief (TWIHS_FMR) TXRDY will be at level '1' when at least four data can be written in the Transmit FIFO */ +#define TWIHS_FMR_RXRDYM_Pos 4 +#define TWIHS_FMR_RXRDYM_Msk (0x3u << TWIHS_FMR_RXRDYM_Pos) /**< \brief (TWIHS_FMR) Receiver Ready Mode */ +#define TWIHS_FMR_RXRDYM(value) ((TWIHS_FMR_RXRDYM_Msk & ((value) << TWIHS_FMR_RXRDYM_Pos))) +#define TWIHS_FMR_RXRDYM_ONE_DATA (0x0u << 4) /**< \brief (TWIHS_FMR) RXRDY will be at level '1' when at least one unread data is in the Receive FIFO */ +#define TWIHS_FMR_RXRDYM_TWO_DATA (0x1u << 4) /**< \brief (TWIHS_FMR) RXRDY will be at level '1' when at least two unread data are in the Receive FIFO */ +#define TWIHS_FMR_RXRDYM_FOUR_DATA (0x2u << 4) /**< \brief (TWIHS_FMR) RXRDY will be at level '1' when at least four unread data are in the Receive FIFO */ +#define TWIHS_FMR_TXFTHRES_Pos 16 +#define TWIHS_FMR_TXFTHRES_Msk (0x3fu << TWIHS_FMR_TXFTHRES_Pos) /**< \brief (TWIHS_FMR) Transmit FIFO Threshold */ +#define TWIHS_FMR_TXFTHRES(value) ((TWIHS_FMR_TXFTHRES_Msk & ((value) << TWIHS_FMR_TXFTHRES_Pos))) +#define TWIHS_FMR_RXFTHRES_Pos 24 +#define TWIHS_FMR_RXFTHRES_Msk (0x3fu << TWIHS_FMR_RXFTHRES_Pos) /**< \brief (TWIHS_FMR) Receive FIFO Threshold */ +#define TWIHS_FMR_RXFTHRES(value) ((TWIHS_FMR_RXFTHRES_Msk & ((value) << TWIHS_FMR_RXFTHRES_Pos))) +/* -------- TWIHS_FLR : (TWIHS Offset: 0x54) FIFO Level Register -------- */ +#define TWIHS_FLR_TXFL_Pos 0 +#define TWIHS_FLR_TXFL_Msk (0x3fu << TWIHS_FLR_TXFL_Pos) /**< \brief (TWIHS_FLR) Transmit FIFO Level */ +#define TWIHS_FLR_RXFL_Pos 16 +#define TWIHS_FLR_RXFL_Msk (0x3fu << TWIHS_FLR_RXFL_Pos) /**< \brief (TWIHS_FLR) Receive FIFO Level */ +/* -------- TWIHS_FSR : (TWIHS Offset: 0x60) FIFO Status Register -------- */ +#define TWIHS_FSR_TXFEF (0x1u << 0) /**< \brief (TWIHS_FSR) Transmit FIFO Empty Flag (cleared on read) */ +#define TWIHS_FSR_TXFFF (0x1u << 1) /**< \brief (TWIHS_FSR) Transmit FIFO Full Flag (cleared on read) */ +#define TWIHS_FSR_TXFTHF (0x1u << 2) /**< \brief (TWIHS_FSR) Transmit FIFO Threshold Flag (cleared on read) */ +#define TWIHS_FSR_RXFEF (0x1u << 3) /**< \brief (TWIHS_FSR) Receive FIFO Empty Flag */ +#define TWIHS_FSR_RXFFF (0x1u << 4) /**< \brief (TWIHS_FSR) Receive FIFO Full Flag */ +#define TWIHS_FSR_RXFTHF (0x1u << 5) /**< \brief (TWIHS_FSR) Receive FIFO Threshold Flag */ +#define TWIHS_FSR_TXFPTEF (0x1u << 6) /**< \brief (TWIHS_FSR) Transmit FIFO Pointer Error Flag */ +#define TWIHS_FSR_RXFPTEF (0x1u << 7) /**< \brief (TWIHS_FSR) Receive FIFO Pointer Error Flag */ +/* -------- TWIHS_FIER : (TWIHS Offset: 0x64) FIFO Interrupt Enable Register -------- */ +#define TWIHS_FIER_TXFEF (0x1u << 0) /**< \brief (TWIHS_FIER) TXFEF Interrupt Enable */ +#define TWIHS_FIER_TXFFF (0x1u << 1) /**< \brief (TWIHS_FIER) TXFFF Interrupt Enable */ +#define TWIHS_FIER_TXFTHF (0x1u << 2) /**< \brief (TWIHS_FIER) TXFTHF Interrupt Enable */ +#define TWIHS_FIER_RXFEF (0x1u << 3) /**< \brief (TWIHS_FIER) RXFEF Interrupt Enable */ +#define TWIHS_FIER_RXFFF (0x1u << 4) /**< \brief (TWIHS_FIER) RXFFF Interrupt Enable */ +#define TWIHS_FIER_RXFTHF (0x1u << 5) /**< \brief (TWIHS_FIER) RXFTHF Interrupt Enable */ +#define TWIHS_FIER_TXFPTEF (0x1u << 6) /**< \brief (TWIHS_FIER) TXFPTEF Interrupt Enable */ +#define TWIHS_FIER_RXFPTEF (0x1u << 7) /**< \brief (TWIHS_FIER) RXFPTEF Interrupt Enable */ +/* -------- TWIHS_FIDR : (TWIHS Offset: 0x68) FIFO Interrupt Disable Register -------- */ +#define TWIHS_FIDR_TXFEF (0x1u << 0) /**< \brief (TWIHS_FIDR) TXFEF Interrupt Disable */ +#define TWIHS_FIDR_TXFFF (0x1u << 1) /**< \brief (TWIHS_FIDR) TXFFF Interrupt Disable */ +#define TWIHS_FIDR_TXFTHF (0x1u << 2) /**< \brief (TWIHS_FIDR) TXFTHF Interrupt Disable */ +#define TWIHS_FIDR_RXFEF (0x1u << 3) /**< \brief (TWIHS_FIDR) RXFEF Interrupt Disable */ +#define TWIHS_FIDR_RXFFF (0x1u << 4) /**< \brief (TWIHS_FIDR) RXFFF Interrupt Disable */ +#define TWIHS_FIDR_RXFTHF (0x1u << 5) /**< \brief (TWIHS_FIDR) RXFTHF Interrupt Disable */ +#define TWIHS_FIDR_TXFPTEF (0x1u << 6) /**< \brief (TWIHS_FIDR) TXFPTEF Interrupt Disable */ +#define TWIHS_FIDR_RXFPTEF (0x1u << 7) /**< \brief (TWIHS_FIDR) RXFPTEF Interrupt Disable */ +/* -------- TWIHS_FIMR : (TWIHS Offset: 0x6C) FIFO Interrupt Mask Register -------- */ +#define TWIHS_FIMR_TXFEF (0x1u << 0) /**< \brief (TWIHS_FIMR) TXFEF Interrupt Mask */ +#define TWIHS_FIMR_TXFFF (0x1u << 1) /**< \brief (TWIHS_FIMR) TXFFF Interrupt Mask */ +#define TWIHS_FIMR_TXFTHF (0x1u << 2) /**< \brief (TWIHS_FIMR) TXFTHF Interrupt Mask */ +#define TWIHS_FIMR_RXFEF (0x1u << 3) /**< \brief (TWIHS_FIMR) RXFEF Interrupt Mask */ +#define TWIHS_FIMR_RXFFF (0x1u << 4) /**< \brief (TWIHS_FIMR) RXFFF Interrupt Mask */ +#define TWIHS_FIMR_RXFTHF (0x1u << 5) /**< \brief (TWIHS_FIMR) RXFTHF Interrupt Mask */ +#define TWIHS_FIMR_TXFPTEF (0x1u << 6) /**< \brief (TWIHS_FIMR) TXFPTEF Interrupt Mask */ +#define TWIHS_FIMR_RXFPTEF (0x1u << 7) /**< \brief (TWIHS_FIMR) RXFPTEF Interrupt Mask */ +/* -------- TWIHS_DR : (TWIHS Offset: 0xD0) Debug Register -------- */ +#define TWIHS_DR_SWEN (0x1u << 0) /**< \brief (TWIHS_DR) SleepWalking Enable */ +#define TWIHS_DR_CLKRQ (0x1u << 1) /**< \brief (TWIHS_DR) Clock Request */ +#define TWIHS_DR_SWMATCH (0x1u << 2) /**< \brief (TWIHS_DR) SleepWalking Match */ +#define TWIHS_DR_TRP (0x1u << 3) /**< \brief (TWIHS_DR) Transfer Pending */ +/* -------- TWIHS_WPMR : (TWIHS Offset: 0xE4) Write Protection Mode Register -------- */ +#define TWIHS_WPMR_WPEN (0x1u << 0) /**< \brief (TWIHS_WPMR) Write Protection Enable */ +#define TWIHS_WPMR_WPKEY_Pos 8 +#define TWIHS_WPMR_WPKEY_Msk (0xffffffu << TWIHS_WPMR_WPKEY_Pos) /**< \brief (TWIHS_WPMR) Write Protection Key */ +#define TWIHS_WPMR_WPKEY(value) ((TWIHS_WPMR_WPKEY_Msk & ((value) << TWIHS_WPMR_WPKEY_Pos))) +#define TWIHS_WPMR_WPKEY_PASSWD (0x545749u << 8) /**< \brief (TWIHS_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0 */ +/* -------- TWIHS_WPSR : (TWIHS Offset: 0xE8) Write Protection Status Register -------- */ +#define TWIHS_WPSR_WPVS (0x1u << 0) /**< \brief (TWIHS_WPSR) Write Protection Violation Status */ +#define TWIHS_WPSR_WPVSRC_Pos 8 +#define TWIHS_WPSR_WPVSRC_Msk (0xffffffu << TWIHS_WPSR_WPVSRC_Pos) /**< \brief (TWIHS_WPSR) Write Protection Violation Source */ +/* -------- TWIHS_VER : (TWIHS Offset: 0xFC) Version Register -------- */ +#define TWIHS_VER_VERSION_Pos 0 +#define TWIHS_VER_VERSION_Msk (0xfffu << TWIHS_VER_VERSION_Pos) /**< \brief (TWIHS_VER) Version of the Hardware Module */ +#define TWIHS_VER_MFN_Pos 16 +#define TWIHS_VER_MFN_Msk (0x7u << TWIHS_VER_MFN_Pos) /**< \brief (TWIHS_VER) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_TWIHS_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_uart.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_uart.h new file mode 100644 index 000000000..563a86fe2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_uart.h @@ -0,0 +1,173 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_UART_COMPONENT_ +#define _SAMA5D2_UART_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Universal Asynchronous Receiver Transmitter */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_UART Universal Asynchronous Receiver Transmitter */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Uart hardware registers */ +typedef struct { + __O uint32_t UART_CR; /**< \brief (Uart Offset: 0x0000) Control Register */ + __IO uint32_t UART_MR; /**< \brief (Uart Offset: 0x0004) Mode Register */ + __O uint32_t UART_IER; /**< \brief (Uart Offset: 0x0008) Interrupt Enable Register */ + __O uint32_t UART_IDR; /**< \brief (Uart Offset: 0x000C) Interrupt Disable Register */ + __I uint32_t UART_IMR; /**< \brief (Uart Offset: 0x0010) Interrupt Mask Register */ + __I uint32_t UART_SR; /**< \brief (Uart Offset: 0x0014) Status Register */ + __I uint32_t UART_RHR; /**< \brief (Uart Offset: 0x0018) Receive Holding Register */ + __O uint32_t UART_THR; /**< \brief (Uart Offset: 0x001C) Transmit Holding Register */ + __IO uint32_t UART_BRGR; /**< \brief (Uart Offset: 0x0020) Baud Rate Generator Register */ + __IO uint32_t UART_CMPR; /**< \brief (Uart Offset: 0x0024) Comparison Register */ + __IO uint32_t UART_RTOR; /**< \brief (Uart Offset: 0x0028) Receiver Time-out Register */ + __I uint32_t Reserved1[46]; + __IO uint32_t UART_WPMR; /**< \brief (Uart Offset: 0x00E4) Write Protection Mode Register */ + __I uint32_t Reserved2[5]; + __I uint32_t UART_VERSION; /**< \brief (Uart Offset: 0x00FC) Version Register */ +} Uart; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- UART_CR : (UART Offset: 0x0000) Control Register -------- */ +#define UART_CR_RSTRX (0x1u << 2) /**< \brief (UART_CR) Reset Receiver */ +#define UART_CR_RSTTX (0x1u << 3) /**< \brief (UART_CR) Reset Transmitter */ +#define UART_CR_RXEN (0x1u << 4) /**< \brief (UART_CR) Receiver Enable */ +#define UART_CR_RXDIS (0x1u << 5) /**< \brief (UART_CR) Receiver Disable */ +#define UART_CR_TXEN (0x1u << 6) /**< \brief (UART_CR) Transmitter Enable */ +#define UART_CR_TXDIS (0x1u << 7) /**< \brief (UART_CR) Transmitter Disable */ +#define UART_CR_RSTSTA (0x1u << 8) /**< \brief (UART_CR) Reset Status */ +#define UART_CR_RETTO (0x1u << 10) /**< \brief (UART_CR) Rearm Time-out */ +#define UART_CR_STTTO (0x1u << 11) /**< \brief (UART_CR) Start Time-out */ +#define UART_CR_REQCLR (0x1u << 12) /**< \brief (UART_CR) Request Clear */ +#define UART_CR_DBGE (0x1u << 15) /**< \brief (UART_CR) Debug Enable */ +/* -------- UART_MR : (UART Offset: 0x0004) Mode Register -------- */ +#define UART_MR_FILTER (0x1u << 4) /**< \brief (UART_MR) Receiver Digital Filter */ +#define UART_MR_FILTER_DISABLED (0x0u << 4) /**< \brief (UART_MR) UART does not filter the receive line. */ +#define UART_MR_FILTER_ENABLED (0x1u << 4) /**< \brief (UART_MR) UART filters the receive line using a three-sample filter (16x-bit clock) (2 over 3 majority). */ +#define UART_MR_PAR_Pos 9 +#define UART_MR_PAR_Msk (0x7u << UART_MR_PAR_Pos) /**< \brief (UART_MR) Parity Type */ +#define UART_MR_PAR(value) ((UART_MR_PAR_Msk & ((value) << UART_MR_PAR_Pos))) +#define UART_MR_PAR_EVEN (0x0u << 9) /**< \brief (UART_MR) Even Parity */ +#define UART_MR_PAR_ODD (0x1u << 9) /**< \brief (UART_MR) Odd Parity */ +#define UART_MR_PAR_SPACE (0x2u << 9) /**< \brief (UART_MR) Space: parity forced to 0 */ +#define UART_MR_PAR_MARK (0x3u << 9) /**< \brief (UART_MR) Mark: parity forced to 1 */ +#define UART_MR_PAR_NO (0x4u << 9) /**< \brief (UART_MR) No parity */ +#define UART_MR_BRSRCCK (0x1u << 12) /**< \brief (UART_MR) Baud Rate Source Clock */ +#define UART_MR_BRSRCCK_PERIPH_CLK (0x0u << 12) /**< \brief (UART_MR) The baud rate is driven by the peripheral clock */ +#define UART_MR_BRSRCCK_PMC_PCK (0x1u << 12) /**< \brief (UART_MR) The baud rate is driven by a PMC programmable clock PCK (see section Power Management Controller (PMC)). */ +#define UART_MR_CHMODE_Pos 14 +#define UART_MR_CHMODE_Msk (0x3u << UART_MR_CHMODE_Pos) /**< \brief (UART_MR) Channel Mode */ +#define UART_MR_CHMODE(value) ((UART_MR_CHMODE_Msk & ((value) << UART_MR_CHMODE_Pos))) +#define UART_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (UART_MR) Normal mode */ +#define UART_MR_CHMODE_AUTOMATIC (0x1u << 14) /**< \brief (UART_MR) Automatic echo */ +#define UART_MR_CHMODE_LOCAL_LOOPBACK (0x2u << 14) /**< \brief (UART_MR) Local loopback */ +#define UART_MR_CHMODE_REMOTE_LOOPBACK (0x3u << 14) /**< \brief (UART_MR) Remote loopback */ +/* -------- UART_IER : (UART Offset: 0x0008) Interrupt Enable Register -------- */ +#define UART_IER_RXRDY (0x1u << 0) /**< \brief (UART_IER) Enable RXRDY Interrupt */ +#define UART_IER_TXRDY (0x1u << 1) /**< \brief (UART_IER) Enable TXRDY Interrupt */ +#define UART_IER_OVRE (0x1u << 5) /**< \brief (UART_IER) Enable Overrun Error Interrupt */ +#define UART_IER_FRAME (0x1u << 6) /**< \brief (UART_IER) Enable Framing Error Interrupt */ +#define UART_IER_PARE (0x1u << 7) /**< \brief (UART_IER) Enable Parity Error Interrupt */ +#define UART_IER_TIMEOUT (0x1u << 8) /**< \brief (UART_IER) Enable Time-out Interrupt */ +#define UART_IER_TXEMPTY (0x1u << 9) /**< \brief (UART_IER) Enable TXEMPTY Interrupt */ +#define UART_IER_CMP (0x1u << 15) /**< \brief (UART_IER) Enable Comparison Interrupt */ +/* -------- UART_IDR : (UART Offset: 0x000C) Interrupt Disable Register -------- */ +#define UART_IDR_RXRDY (0x1u << 0) /**< \brief (UART_IDR) Disable RXRDY Interrupt */ +#define UART_IDR_TXRDY (0x1u << 1) /**< \brief (UART_IDR) Disable TXRDY Interrupt */ +#define UART_IDR_OVRE (0x1u << 5) /**< \brief (UART_IDR) Disable Overrun Error Interrupt */ +#define UART_IDR_FRAME (0x1u << 6) /**< \brief (UART_IDR) Disable Framing Error Interrupt */ +#define UART_IDR_PARE (0x1u << 7) /**< \brief (UART_IDR) Disable Parity Error Interrupt */ +#define UART_IDR_TIMEOUT (0x1u << 8) /**< \brief (UART_IDR) Disable Time-out Interrupt */ +#define UART_IDR_TXEMPTY (0x1u << 9) /**< \brief (UART_IDR) Disable TXEMPTY Interrupt */ +#define UART_IDR_CMP (0x1u << 15) /**< \brief (UART_IDR) Disable Comparison Interrupt */ +/* -------- UART_IMR : (UART Offset: 0x0010) Interrupt Mask Register -------- */ +#define UART_IMR_RXRDY (0x1u << 0) /**< \brief (UART_IMR) Mask RXRDY Interrupt */ +#define UART_IMR_TXRDY (0x1u << 1) /**< \brief (UART_IMR) Disable TXRDY Interrupt */ +#define UART_IMR_OVRE (0x1u << 5) /**< \brief (UART_IMR) Mask Overrun Error Interrupt */ +#define UART_IMR_FRAME (0x1u << 6) /**< \brief (UART_IMR) Mask Framing Error Interrupt */ +#define UART_IMR_PARE (0x1u << 7) /**< \brief (UART_IMR) Mask Parity Error Interrupt */ +#define UART_IMR_TIMEOUT (0x1u << 8) /**< \brief (UART_IMR) Mask Time-out Interrupt */ +#define UART_IMR_TXEMPTY (0x1u << 9) /**< \brief (UART_IMR) Mask TXEMPTY Interrupt */ +#define UART_IMR_CMP (0x1u << 15) /**< \brief (UART_IMR) Mask Comparison Interrupt */ +/* -------- UART_SR : (UART Offset: 0x0014) Status Register -------- */ +#define UART_SR_RXRDY (0x1u << 0) /**< \brief (UART_SR) Receiver Ready */ +#define UART_SR_TXRDY (0x1u << 1) /**< \brief (UART_SR) Transmitter Ready */ +#define UART_SR_OVRE (0x1u << 5) /**< \brief (UART_SR) Overrun Error */ +#define UART_SR_FRAME (0x1u << 6) /**< \brief (UART_SR) Framing Error */ +#define UART_SR_PARE (0x1u << 7) /**< \brief (UART_SR) Parity Error */ +#define UART_SR_TIMEOUT (0x1u << 8) /**< \brief (UART_SR) Receiver Time-out */ +#define UART_SR_TXEMPTY (0x1u << 9) /**< \brief (UART_SR) Transmitter Empty */ +#define UART_SR_CMP (0x1u << 15) /**< \brief (UART_SR) Comparison Match */ +#define UART_SR_SWES (0x1u << 21) /**< \brief (UART_SR) SleepWalking Enable Status */ +#define UART_SR_CLKREQ (0x1u << 22) /**< \brief (UART_SR) Clock Request */ +#define UART_SR_WKUPREQ (0x1u << 23) /**< \brief (UART_SR) Wake-Up Request */ +/* -------- UART_RHR : (UART Offset: 0x0018) Receive Holding Register -------- */ +#define UART_RHR_RXCHR_Pos 0 +#define UART_RHR_RXCHR_Msk (0xffu << UART_RHR_RXCHR_Pos) /**< \brief (UART_RHR) Received Character */ +/* -------- UART_THR : (UART Offset: 0x001C) Transmit Holding Register -------- */ +#define UART_THR_TXCHR_Pos 0 +#define UART_THR_TXCHR_Msk (0xffu << UART_THR_TXCHR_Pos) /**< \brief (UART_THR) Character to be Transmitted */ +#define UART_THR_TXCHR(value) ((UART_THR_TXCHR_Msk & ((value) << UART_THR_TXCHR_Pos))) +/* -------- UART_BRGR : (UART Offset: 0x0020) Baud Rate Generator Register -------- */ +#define UART_BRGR_CD_Pos 0 +#define UART_BRGR_CD_Msk (0xffffu << UART_BRGR_CD_Pos) /**< \brief (UART_BRGR) Clock Divisor */ +#define UART_BRGR_CD(value) ((UART_BRGR_CD_Msk & ((value) << UART_BRGR_CD_Pos))) +/* -------- UART_CMPR : (UART Offset: 0x0024) Comparison Register -------- */ +#define UART_CMPR_VAL1_Pos 0 +#define UART_CMPR_VAL1_Msk (0xffu << UART_CMPR_VAL1_Pos) /**< \brief (UART_CMPR) First Comparison Value for Received Character */ +#define UART_CMPR_VAL1(value) ((UART_CMPR_VAL1_Msk & ((value) << UART_CMPR_VAL1_Pos))) +#define UART_CMPR_CMPMODE (0x1u << 12) /**< \brief (UART_CMPR) Comparison Mode */ +#define UART_CMPR_CMPMODE_FLAG_ONLY (0x0u << 12) /**< \brief (UART_CMPR) Any character is received and comparison function drives CMP flag. */ +#define UART_CMPR_CMPMODE_START_CONDITION (0x1u << 12) /**< \brief (UART_CMPR) Comparison condition must be met to start reception. */ +#define UART_CMPR_CMPPAR (0x1u << 14) /**< \brief (UART_CMPR) Compare Parity */ +#define UART_CMPR_VAL2_Pos 16 +#define UART_CMPR_VAL2_Msk (0xffu << UART_CMPR_VAL2_Pos) /**< \brief (UART_CMPR) Second Comparison Value for Received Character */ +#define UART_CMPR_VAL2(value) ((UART_CMPR_VAL2_Msk & ((value) << UART_CMPR_VAL2_Pos))) +/* -------- UART_RTOR : (UART Offset: 0x0028) Receiver Time-out Register -------- */ +#define UART_RTOR_TO_Pos 0 +#define UART_RTOR_TO_Msk (0xffu << UART_RTOR_TO_Pos) /**< \brief (UART_RTOR) Time-out Value */ +#define UART_RTOR_TO(value) ((UART_RTOR_TO_Msk & ((value) << UART_RTOR_TO_Pos))) +/* -------- UART_WPMR : (UART Offset: 0x00E4) Write Protection Mode Register -------- */ +#define UART_WPMR_WPEN (0x1u << 0) /**< \brief (UART_WPMR) Write Protection Enable */ +#define UART_WPMR_WPKEY_Pos 8 +#define UART_WPMR_WPKEY_Msk (0xffffffu << UART_WPMR_WPKEY_Pos) /**< \brief (UART_WPMR) Write Protection Key */ +#define UART_WPMR_WPKEY(value) ((UART_WPMR_WPKEY_Msk & ((value) << UART_WPMR_WPKEY_Pos))) +#define UART_WPMR_WPKEY_PASSWD (0x554152u << 8) /**< \brief (UART_WPMR) Writing any other value in this field aborts the write operation.Always reads as 0. */ +/* -------- UART_VERSION : (UART Offset: 0x00FC) Version Register -------- */ +#define UART_VERSION_VERSION_Pos 0 +#define UART_VERSION_VERSION_Msk (0xfffu << UART_VERSION_VERSION_Pos) /**< \brief (UART_VERSION) Hardware Module Version */ +#define UART_VERSION_MFN_Pos 16 +#define UART_VERSION_MFN_Msk (0x7u << UART_VERSION_MFN_Pos) /**< \brief (UART_VERSION) Metal Fix Number */ + +/*@}*/ + + +#endif /* _SAMA5D2_UART_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_udphs.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_udphs.h new file mode 100644 index 000000000..e1875aba7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_udphs.h @@ -0,0 +1,399 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_UDPHS_COMPONENT_ +#define _SAMA5D2_UDPHS_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR USB High Speed Device Port */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_UDPHS USB High Speed Device Port */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief UdphsDma hardware registers */ +typedef struct { + __IO uint32_t UDPHS_DMANXTDSC; /**< \brief (UdphsDma Offset: 0x0) UDPHS DMA Next Descriptor Address Register */ + __IO uint32_t UDPHS_DMAADDRESS; /**< \brief (UdphsDma Offset: 0x4) UDPHS DMA Channel Address Register */ + __IO uint32_t UDPHS_DMACONTROL; /**< \brief (UdphsDma Offset: 0x8) UDPHS DMA Channel Control Register */ + __IO uint32_t UDPHS_DMASTATUS; /**< \brief (UdphsDma Offset: 0xC) UDPHS DMA Channel Status Register */ +} UdphsDma; +/** \brief UdphsEpt hardware registers */ +typedef struct { + __IO uint32_t UDPHS_EPTCFG; /**< \brief (UdphsEpt Offset: 0x0) UDPHS Endpoint Configuration Register */ + __O uint32_t UDPHS_EPTCTLENB; /**< \brief (UdphsEpt Offset: 0x4) UDPHS Endpoint Control Enable Register */ + __O uint32_t UDPHS_EPTCTLDIS; /**< \brief (UdphsEpt Offset: 0x8) UDPHS Endpoint Control Disable Register */ + __I uint32_t UDPHS_EPTCTL; /**< \brief (UdphsEpt Offset: 0xC) UDPHS Endpoint Control Register */ + __I uint32_t Reserved1[1]; + __O uint32_t UDPHS_EPTSETSTA; /**< \brief (UdphsEpt Offset: 0x14) UDPHS Endpoint Set Status Register */ + __O uint32_t UDPHS_EPTCLRSTA; /**< \brief (UdphsEpt Offset: 0x18) UDPHS Endpoint Clear Status Register */ + __I uint32_t UDPHS_EPTSTA; /**< \brief (UdphsEpt Offset: 0x1C) UDPHS Endpoint Status Register */ +} UdphsEpt; +/** \brief Udphs hardware registers */ +#define UDPHSEPT_NUMBER 16 +#define UDPHSDMA_NUMBER 7 +typedef struct { + __IO uint32_t UDPHS_CTRL; /**< \brief (Udphs Offset: 0x00) UDPHS Control Register */ + __I uint32_t UDPHS_FNUM; /**< \brief (Udphs Offset: 0x04) UDPHS Frame Number Register */ + __I uint32_t Reserved1[2]; + __IO uint32_t UDPHS_IEN; /**< \brief (Udphs Offset: 0x10) UDPHS Interrupt Enable Register */ + __I uint32_t UDPHS_INTSTA; /**< \brief (Udphs Offset: 0x14) UDPHS Interrupt Status Register */ + __O uint32_t UDPHS_CLRINT; /**< \brief (Udphs Offset: 0x18) UDPHS Clear Interrupt Register */ + __O uint32_t UDPHS_EPTRST; /**< \brief (Udphs Offset: 0x1C) UDPHS Endpoints Reset Register */ + __I uint32_t Reserved2[44]; + __IO uint32_t UDPHS_TSTSOFCNT; /**< \brief (Udphs Offset: 0xD0) UDPHS Test SOF Counter Register */ + __IO uint32_t UDPHS_TSTCNTA; /**< \brief (Udphs Offset: 0xD4) UDPHS Test A Counter Register */ + __IO uint32_t UDPHS_TSTCNTB; /**< \brief (Udphs Offset: 0xD8) UDPHS Test B Counter Register */ + __IO uint32_t UDPHS_TSTMODEREG; /**< \brief (Udphs Offset: 0xDC) UDPHS Test Mode Register */ + __IO uint32_t UDPHS_TST; /**< \brief (Udphs Offset: 0xE0) UDPHS Test Register */ + __I uint32_t Reserved3[6]; + __I uint32_t UDPHS_VERSION; /**< \brief (Udphs Offset: 0xFC) UDPHS Version Register */ + UdphsEpt UDPHS_EPT[UDPHSEPT_NUMBER]; /**< \brief (Udphs Offset: 0x100) endpoint = 0 .. 15 */ + UdphsDma UDPHS_DMA[UDPHSDMA_NUMBER]; /**< \brief (Udphs Offset: 0x300) channel = 0 .. 6 */ +} Udphs; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- UDPHS_CTRL : (UDPHS Offset: 0x00) UDPHS Control Register -------- */ +#define UDPHS_CTRL_DEV_ADDR_Pos 0 +#define UDPHS_CTRL_DEV_ADDR_Msk (0x7fu << UDPHS_CTRL_DEV_ADDR_Pos) /**< \brief (UDPHS_CTRL) UDPHS Address (cleared upon USB reset) */ +#define UDPHS_CTRL_DEV_ADDR(value) ((UDPHS_CTRL_DEV_ADDR_Msk & ((value) << UDPHS_CTRL_DEV_ADDR_Pos))) +#define UDPHS_CTRL_FADDR_EN (0x1u << 7) /**< \brief (UDPHS_CTRL) Function Address Enable (cleared upon USB reset) */ +#define UDPHS_CTRL_EN_UDPHS (0x1u << 8) /**< \brief (UDPHS_CTRL) UDPHS Enable */ +#define UDPHS_CTRL_DETACH (0x1u << 9) /**< \brief (UDPHS_CTRL) Detach Command */ +#define UDPHS_CTRL_REWAKEUP (0x1u << 10) /**< \brief (UDPHS_CTRL) Send Remote Wake Up (cleared upon USB reset) */ +#define UDPHS_CTRL_PULLD_DIS (0x1u << 11) /**< \brief (UDPHS_CTRL) Pull-Down Disable (cleared upon USB reset) */ +/* -------- UDPHS_FNUM : (UDPHS Offset: 0x04) UDPHS Frame Number Register -------- */ +#define UDPHS_FNUM_MICRO_FRAME_NUM_Pos 0 +#define UDPHS_FNUM_MICRO_FRAME_NUM_Msk (0x7u << UDPHS_FNUM_MICRO_FRAME_NUM_Pos) /**< \brief (UDPHS_FNUM) Microframe Number (cleared upon USB reset) */ +#define UDPHS_FNUM_FRAME_NUMBER_Pos 3 +#define UDPHS_FNUM_FRAME_NUMBER_Msk (0x7ffu << UDPHS_FNUM_FRAME_NUMBER_Pos) /**< \brief (UDPHS_FNUM) Frame Number as defined in the Packet Field Formats (cleared upon USB reset) */ +#define UDPHS_FNUM_FNUM_ERR (0x1u << 31) /**< \brief (UDPHS_FNUM) Frame Number CRC Error (cleared upon USB reset) */ +/* -------- UDPHS_IEN : (UDPHS Offset: 0x10) UDPHS Interrupt Enable Register -------- */ +#define UDPHS_IEN_DET_SUSPD (0x1u << 1) /**< \brief (UDPHS_IEN) Suspend Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_MICRO_SOF (0x1u << 2) /**< \brief (UDPHS_IEN) Micro-SOF Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_INT_SOF (0x1u << 3) /**< \brief (UDPHS_IEN) SOF Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_ENDRESET (0x1u << 4) /**< \brief (UDPHS_IEN) End Of Reset Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_WAKE_UP (0x1u << 5) /**< \brief (UDPHS_IEN) Wake Up CPU Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_ENDOFRSM (0x1u << 6) /**< \brief (UDPHS_IEN) End Of Resume Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_UPSTR_RES (0x1u << 7) /**< \brief (UDPHS_IEN) Upstream Resume Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_0 (0x1u << 8) /**< \brief (UDPHS_IEN) Endpoint 0 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_1 (0x1u << 9) /**< \brief (UDPHS_IEN) Endpoint 1 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_2 (0x1u << 10) /**< \brief (UDPHS_IEN) Endpoint 2 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_3 (0x1u << 11) /**< \brief (UDPHS_IEN) Endpoint 3 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_4 (0x1u << 12) /**< \brief (UDPHS_IEN) Endpoint 4 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_5 (0x1u << 13) /**< \brief (UDPHS_IEN) Endpoint 5 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_6 (0x1u << 14) /**< \brief (UDPHS_IEN) Endpoint 6 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_7 (0x1u << 15) /**< \brief (UDPHS_IEN) Endpoint 7 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_8 (0x1u << 16) /**< \brief (UDPHS_IEN) Endpoint 8 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_9 (0x1u << 17) /**< \brief (UDPHS_IEN) Endpoint 9 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_10 (0x1u << 18) /**< \brief (UDPHS_IEN) Endpoint 10 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_11 (0x1u << 19) /**< \brief (UDPHS_IEN) Endpoint 11 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_12 (0x1u << 20) /**< \brief (UDPHS_IEN) Endpoint 12 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_13 (0x1u << 21) /**< \brief (UDPHS_IEN) Endpoint 13 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_14 (0x1u << 22) /**< \brief (UDPHS_IEN) Endpoint 14 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_EPT_15 (0x1u << 23) /**< \brief (UDPHS_IEN) Endpoint 15 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_1 (0x1u << 25) /**< \brief (UDPHS_IEN) DMA Channel 1 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_2 (0x1u << 26) /**< \brief (UDPHS_IEN) DMA Channel 2 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_3 (0x1u << 27) /**< \brief (UDPHS_IEN) DMA Channel 3 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_4 (0x1u << 28) /**< \brief (UDPHS_IEN) DMA Channel 4 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_5 (0x1u << 29) /**< \brief (UDPHS_IEN) DMA Channel 5 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_6 (0x1u << 30) /**< \brief (UDPHS_IEN) DMA Channel 6 Interrupt Enable (cleared upon USB reset) */ +#define UDPHS_IEN_DMA_7 (0x1u << 31) /**< \brief (UDPHS_IEN) DMA Channel 7 Interrupt Enable (cleared upon USB reset) */ +/* -------- UDPHS_INTSTA : (UDPHS Offset: 0x14) UDPHS Interrupt Status Register -------- */ +#define UDPHS_INTSTA_SPEED (0x1u << 0) /**< \brief (UDPHS_INTSTA) Speed Status */ +#define UDPHS_INTSTA_DET_SUSPD (0x1u << 1) /**< \brief (UDPHS_INTSTA) Suspend Interrupt */ +#define UDPHS_INTSTA_MICRO_SOF (0x1u << 2) /**< \brief (UDPHS_INTSTA) Micro Start Of Frame Interrupt */ +#define UDPHS_INTSTA_INT_SOF (0x1u << 3) /**< \brief (UDPHS_INTSTA) Start Of Frame Interrupt */ +#define UDPHS_INTSTA_ENDRESET (0x1u << 4) /**< \brief (UDPHS_INTSTA) End Of Reset Interrupt */ +#define UDPHS_INTSTA_WAKE_UP (0x1u << 5) /**< \brief (UDPHS_INTSTA) Wake Up CPU Interrupt */ +#define UDPHS_INTSTA_ENDOFRSM (0x1u << 6) /**< \brief (UDPHS_INTSTA) End Of Resume Interrupt */ +#define UDPHS_INTSTA_UPSTR_RES (0x1u << 7) /**< \brief (UDPHS_INTSTA) Upstream Resume Interrupt */ +#define UDPHS_INTSTA_EPT_0 (0x1u << 8) /**< \brief (UDPHS_INTSTA) Endpoint 0 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_1 (0x1u << 9) /**< \brief (UDPHS_INTSTA) Endpoint 1 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_2 (0x1u << 10) /**< \brief (UDPHS_INTSTA) Endpoint 2 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_3 (0x1u << 11) /**< \brief (UDPHS_INTSTA) Endpoint 3 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_4 (0x1u << 12) /**< \brief (UDPHS_INTSTA) Endpoint 4 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_5 (0x1u << 13) /**< \brief (UDPHS_INTSTA) Endpoint 5 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_6 (0x1u << 14) /**< \brief (UDPHS_INTSTA) Endpoint 6 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_7 (0x1u << 15) /**< \brief (UDPHS_INTSTA) Endpoint 7 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_8 (0x1u << 16) /**< \brief (UDPHS_INTSTA) Endpoint 8 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_9 (0x1u << 17) /**< \brief (UDPHS_INTSTA) Endpoint 9 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_10 (0x1u << 18) /**< \brief (UDPHS_INTSTA) Endpoint 10 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_11 (0x1u << 19) /**< \brief (UDPHS_INTSTA) Endpoint 11 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_12 (0x1u << 20) /**< \brief (UDPHS_INTSTA) Endpoint 12 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_13 (0x1u << 21) /**< \brief (UDPHS_INTSTA) Endpoint 13 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_14 (0x1u << 22) /**< \brief (UDPHS_INTSTA) Endpoint 14 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_EPT_15 (0x1u << 23) /**< \brief (UDPHS_INTSTA) Endpoint 15 Interrupt (cleared upon USB reset) */ +#define UDPHS_INTSTA_DMA_1 (0x1u << 25) /**< \brief (UDPHS_INTSTA) DMA Channel 1 Interrupt */ +#define UDPHS_INTSTA_DMA_2 (0x1u << 26) /**< \brief (UDPHS_INTSTA) DMA Channel 2 Interrupt */ +#define UDPHS_INTSTA_DMA_3 (0x1u << 27) /**< \brief (UDPHS_INTSTA) DMA Channel 3 Interrupt */ +#define UDPHS_INTSTA_DMA_4 (0x1u << 28) /**< \brief (UDPHS_INTSTA) DMA Channel 4 Interrupt */ +#define UDPHS_INTSTA_DMA_5 (0x1u << 29) /**< \brief (UDPHS_INTSTA) DMA Channel 5 Interrupt */ +#define UDPHS_INTSTA_DMA_6 (0x1u << 30) /**< \brief (UDPHS_INTSTA) DMA Channel 6 Interrupt */ +#define UDPHS_INTSTA_DMA_7 (0x1u << 31) /**< \brief (UDPHS_INTSTA) DMA Channel 7 Interrupt */ +/* -------- UDPHS_CLRINT : (UDPHS Offset: 0x18) UDPHS Clear Interrupt Register -------- */ +#define UDPHS_CLRINT_DET_SUSPD (0x1u << 1) /**< \brief (UDPHS_CLRINT) Suspend Interrupt Clear */ +#define UDPHS_CLRINT_MICRO_SOF (0x1u << 2) /**< \brief (UDPHS_CLRINT) Micro Start Of Frame Interrupt Clear */ +#define UDPHS_CLRINT_INT_SOF (0x1u << 3) /**< \brief (UDPHS_CLRINT) Start Of Frame Interrupt Clear */ +#define UDPHS_CLRINT_ENDRESET (0x1u << 4) /**< \brief (UDPHS_CLRINT) End Of Reset Interrupt Clear */ +#define UDPHS_CLRINT_WAKE_UP (0x1u << 5) /**< \brief (UDPHS_CLRINT) Wake Up CPU Interrupt Clear */ +#define UDPHS_CLRINT_ENDOFRSM (0x1u << 6) /**< \brief (UDPHS_CLRINT) End Of Resume Interrupt Clear */ +#define UDPHS_CLRINT_UPSTR_RES (0x1u << 7) /**< \brief (UDPHS_CLRINT) Upstream Resume Interrupt Clear */ +/* -------- UDPHS_EPTRST : (UDPHS Offset: 0x1C) UDPHS Endpoints Reset Register -------- */ +#define UDPHS_EPTRST_EPT_0 (0x1u << 0) /**< \brief (UDPHS_EPTRST) Endpoint 0 Reset */ +#define UDPHS_EPTRST_EPT_1 (0x1u << 1) /**< \brief (UDPHS_EPTRST) Endpoint 1 Reset */ +#define UDPHS_EPTRST_EPT_2 (0x1u << 2) /**< \brief (UDPHS_EPTRST) Endpoint 2 Reset */ +#define UDPHS_EPTRST_EPT_3 (0x1u << 3) /**< \brief (UDPHS_EPTRST) Endpoint 3 Reset */ +#define UDPHS_EPTRST_EPT_4 (0x1u << 4) /**< \brief (UDPHS_EPTRST) Endpoint 4 Reset */ +#define UDPHS_EPTRST_EPT_5 (0x1u << 5) /**< \brief (UDPHS_EPTRST) Endpoint 5 Reset */ +#define UDPHS_EPTRST_EPT_6 (0x1u << 6) /**< \brief (UDPHS_EPTRST) Endpoint 6 Reset */ +#define UDPHS_EPTRST_EPT_7 (0x1u << 7) /**< \brief (UDPHS_EPTRST) Endpoint 7 Reset */ +#define UDPHS_EPTRST_EPT_8 (0x1u << 8) /**< \brief (UDPHS_EPTRST) Endpoint 8 Reset */ +#define UDPHS_EPTRST_EPT_9 (0x1u << 9) /**< \brief (UDPHS_EPTRST) Endpoint 9 Reset */ +#define UDPHS_EPTRST_EPT_10 (0x1u << 10) /**< \brief (UDPHS_EPTRST) Endpoint 10 Reset */ +#define UDPHS_EPTRST_EPT_11 (0x1u << 11) /**< \brief (UDPHS_EPTRST) Endpoint 11 Reset */ +#define UDPHS_EPTRST_EPT_12 (0x1u << 12) /**< \brief (UDPHS_EPTRST) Endpoint 12 Reset */ +#define UDPHS_EPTRST_EPT_13 (0x1u << 13) /**< \brief (UDPHS_EPTRST) Endpoint 13 Reset */ +#define UDPHS_EPTRST_EPT_14 (0x1u << 14) /**< \brief (UDPHS_EPTRST) Endpoint 14 Reset */ +#define UDPHS_EPTRST_EPT_15 (0x1u << 15) /**< \brief (UDPHS_EPTRST) Endpoint 15 Reset */ +/* -------- UDPHS_TSTSOFCNT : (UDPHS Offset: 0xD0) UDPHS Test SOF Counter Register -------- */ +#define UDPHS_TSTSOFCNT_SOFCNTMAX_Pos 0 +#define UDPHS_TSTSOFCNT_SOFCNTMAX_Msk (0x7fu << UDPHS_TSTSOFCNT_SOFCNTMAX_Pos) /**< \brief (UDPHS_TSTSOFCNT) SOF Counter Max Value */ +#define UDPHS_TSTSOFCNT_SOFCNTMAX(value) ((UDPHS_TSTSOFCNT_SOFCNTMAX_Msk & ((value) << UDPHS_TSTSOFCNT_SOFCNTMAX_Pos))) +#define UDPHS_TSTSOFCNT_SOFCTLOAD (0x1u << 7) /**< \brief (UDPHS_TSTSOFCNT) SOF Counter Load */ +/* -------- UDPHS_TSTCNTA : (UDPHS Offset: 0xD4) UDPHS Test A Counter Register -------- */ +#define UDPHS_TSTCNTA_CNTAMAX_Pos 0 +#define UDPHS_TSTCNTA_CNTAMAX_Msk (0x7fffu << UDPHS_TSTCNTA_CNTAMAX_Pos) /**< \brief (UDPHS_TSTCNTA) A Counter Max Value */ +#define UDPHS_TSTCNTA_CNTAMAX(value) ((UDPHS_TSTCNTA_CNTAMAX_Msk & ((value) << UDPHS_TSTCNTA_CNTAMAX_Pos))) +#define UDPHS_TSTCNTA_CNTALOAD (0x1u << 15) /**< \brief (UDPHS_TSTCNTA) A Counter Load */ +/* -------- UDPHS_TSTCNTB : (UDPHS Offset: 0xD8) UDPHS Test B Counter Register -------- */ +#define UDPHS_TSTCNTB_CNTBMAX_Pos 0 +#define UDPHS_TSTCNTB_CNTBMAX_Msk (0x7fffu << UDPHS_TSTCNTB_CNTBMAX_Pos) /**< \brief (UDPHS_TSTCNTB) B Counter Max Value */ +#define UDPHS_TSTCNTB_CNTBMAX(value) ((UDPHS_TSTCNTB_CNTBMAX_Msk & ((value) << UDPHS_TSTCNTB_CNTBMAX_Pos))) +#define UDPHS_TSTCNTB_CNTBLOAD (0x1u << 15) /**< \brief (UDPHS_TSTCNTB) B Counter Load */ +/* -------- UDPHS_TSTMODEREG : (UDPHS Offset: 0xDC) UDPHS Test Mode Register -------- */ +#define UDPHS_TSTMODEREG_TSTMODE_Pos 1 +#define UDPHS_TSTMODEREG_TSTMODE_Msk (0x1fu << UDPHS_TSTMODEREG_TSTMODE_Pos) /**< \brief (UDPHS_TSTMODEREG) UDPHS Core TestModeReg */ +#define UDPHS_TSTMODEREG_TSTMODE(value) ((UDPHS_TSTMODEREG_TSTMODE_Msk & ((value) << UDPHS_TSTMODEREG_TSTMODE_Pos))) +/* -------- UDPHS_TST : (UDPHS Offset: 0xE0) UDPHS Test Register -------- */ +#define UDPHS_TST_SPEED_CFG_Pos 0 +#define UDPHS_TST_SPEED_CFG_Msk (0x3u << UDPHS_TST_SPEED_CFG_Pos) /**< \brief (UDPHS_TST) Speed Configuration */ +#define UDPHS_TST_SPEED_CFG(value) ((UDPHS_TST_SPEED_CFG_Msk & ((value) << UDPHS_TST_SPEED_CFG_Pos))) +#define UDPHS_TST_SPEED_CFG_NORMAL (0x0u << 0) /**< \brief (UDPHS_TST) Normal mode: The macro is in Full Speed mode, ready to make a High Speed identification, if the host supports it and then to automatically switch to High Speed mode. */ +#define UDPHS_TST_SPEED_CFG_HIGH_SPEED (0x2u << 0) /**< \brief (UDPHS_TST) Force High Speed: Set this value to force the hardware to work in High Speed mode. Only for debug or test purpose. */ +#define UDPHS_TST_SPEED_CFG_FULL_SPEED (0x3u << 0) /**< \brief (UDPHS_TST) Force Full Speed: Set this value to force the hardware to work only in Full Speed mode. In this configuration, the macro will not respond to a High Speed reset handshake. */ +#define UDPHS_TST_TST_J (0x1u << 2) /**< \brief (UDPHS_TST) Test J Mode */ +#define UDPHS_TST_TST_K (0x1u << 3) /**< \brief (UDPHS_TST) Test K Mode */ +#define UDPHS_TST_TST_PKT (0x1u << 4) /**< \brief (UDPHS_TST) Test Packet Mode */ +#define UDPHS_TST_OPMODE2 (0x1u << 5) /**< \brief (UDPHS_TST) OpMode2 */ +/* -------- UDPHS_VERSION : (UDPHS Offset: 0xFC) UDPHS Version Register -------- */ +#define UDPHS_VERSION_VERSION_Pos 0 +#define UDPHS_VERSION_VERSION_Msk (0xffffu << UDPHS_VERSION_VERSION_Pos) /**< \brief (UDPHS_VERSION) Version of the Hardware Module */ +#define UDPHS_VERSION_MFN_Pos 16 +#define UDPHS_VERSION_MFN_Msk (0x7u << UDPHS_VERSION_MFN_Pos) /**< \brief (UDPHS_VERSION) Metal Fix Number */ +/* -------- UDPHS_EPTCFG : (UDPHS Offset: N/A) UDPHS Endpoint Configuration Register -------- */ +#define UDPHS_EPTCFG_EPT_SIZE_Pos 0 +#define UDPHS_EPTCFG_EPT_SIZE_Msk (0x7u << UDPHS_EPTCFG_EPT_SIZE_Pos) /**< \brief (UDPHS_EPTCFG) Endpoint Size (cleared upon USB reset) */ +#define UDPHS_EPTCFG_EPT_SIZE(value) ((UDPHS_EPTCFG_EPT_SIZE_Msk & ((value) << UDPHS_EPTCFG_EPT_SIZE_Pos))) +#define UDPHS_EPTCFG_EPT_SIZE_8 (0x0u << 0) /**< \brief (UDPHS_EPTCFG) 8 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_16 (0x1u << 0) /**< \brief (UDPHS_EPTCFG) 16 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_32 (0x2u << 0) /**< \brief (UDPHS_EPTCFG) 32 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_64 (0x3u << 0) /**< \brief (UDPHS_EPTCFG) 64 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_128 (0x4u << 0) /**< \brief (UDPHS_EPTCFG) 128 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_256 (0x5u << 0) /**< \brief (UDPHS_EPTCFG) 256 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_512 (0x6u << 0) /**< \brief (UDPHS_EPTCFG) 512 bytes */ +#define UDPHS_EPTCFG_EPT_SIZE_1024 (0x7u << 0) /**< \brief (UDPHS_EPTCFG) 1024 bytes */ +#define UDPHS_EPTCFG_EPT_DIR (0x1u << 3) /**< \brief (UDPHS_EPTCFG) Endpoint Direction (cleared upon USB reset) */ +#define UDPHS_EPTCFG_EPT_TYPE_Pos 4 +#define UDPHS_EPTCFG_EPT_TYPE_Msk (0x3u << UDPHS_EPTCFG_EPT_TYPE_Pos) /**< \brief (UDPHS_EPTCFG) Endpoint Type (cleared upon USB reset) */ +#define UDPHS_EPTCFG_EPT_TYPE(value) ((UDPHS_EPTCFG_EPT_TYPE_Msk & ((value) << UDPHS_EPTCFG_EPT_TYPE_Pos))) +#define UDPHS_EPTCFG_EPT_TYPE_CTRL8 (0x0u << 4) /**< \brief (UDPHS_EPTCFG) Control endpoint */ +#define UDPHS_EPTCFG_EPT_TYPE_ISO (0x1u << 4) /**< \brief (UDPHS_EPTCFG) Isochronous endpoint */ +#define UDPHS_EPTCFG_EPT_TYPE_BULK (0x2u << 4) /**< \brief (UDPHS_EPTCFG) Bulk endpoint */ +#define UDPHS_EPTCFG_EPT_TYPE_INT (0x3u << 4) /**< \brief (UDPHS_EPTCFG) Interrupt endpoint */ +#define UDPHS_EPTCFG_BK_NUMBER_Pos 6 +#define UDPHS_EPTCFG_BK_NUMBER_Msk (0x3u << UDPHS_EPTCFG_BK_NUMBER_Pos) /**< \brief (UDPHS_EPTCFG) Number of Banks (cleared upon USB reset) */ +#define UDPHS_EPTCFG_BK_NUMBER(value) ((UDPHS_EPTCFG_BK_NUMBER_Msk & ((value) << UDPHS_EPTCFG_BK_NUMBER_Pos))) +#define UDPHS_EPTCFG_BK_NUMBER_0 (0x0u << 6) /**< \brief (UDPHS_EPTCFG) Zero bank, the endpoint is not mapped in memory */ +#define UDPHS_EPTCFG_BK_NUMBER_1 (0x1u << 6) /**< \brief (UDPHS_EPTCFG) One bank (bank 0) */ +#define UDPHS_EPTCFG_BK_NUMBER_2 (0x2u << 6) /**< \brief (UDPHS_EPTCFG) Double bank (Ping-Pong: bank0/bank1) */ +#define UDPHS_EPTCFG_BK_NUMBER_3 (0x3u << 6) /**< \brief (UDPHS_EPTCFG) Triple bank (bank0/bank1/bank2) */ +#define UDPHS_EPTCFG_NB_TRANS_Pos 8 +#define UDPHS_EPTCFG_NB_TRANS_Msk (0x3u << UDPHS_EPTCFG_NB_TRANS_Pos) /**< \brief (UDPHS_EPTCFG) Number Of Transaction per Microframe (cleared upon USB reset) */ +#define UDPHS_EPTCFG_NB_TRANS(value) ((UDPHS_EPTCFG_NB_TRANS_Msk & ((value) << UDPHS_EPTCFG_NB_TRANS_Pos))) +#define UDPHS_EPTCFG_EPT_MAPD (0x1u << 31) /**< \brief (UDPHS_EPTCFG) Endpoint Mapped (cleared upon USB reset) */ +/* -------- UDPHS_EPTCTLENB : (UDPHS Offset: N/A) UDPHS Endpoint Control Enable Register -------- */ +#define UDPHS_EPTCTLENB_EPT_ENABL (0x1u << 0) /**< \brief (UDPHS_EPTCTLENB) Endpoint Enable */ +#define UDPHS_EPTCTLENB_AUTO_VALID (0x1u << 1) /**< \brief (UDPHS_EPTCTLENB) Packet Auto-Valid Enable */ +#define UDPHS_EPTCTLENB_INTDIS_DMA (0x1u << 3) /**< \brief (UDPHS_EPTCTLENB) Interrupts Disable DMA */ +#define UDPHS_EPTCTLENB_NYET_DIS (0x1u << 4) /**< \brief (UDPHS_EPTCTLENB) NYET Disable (Only for High Speed Bulk OUT endpoints) */ +#define UDPHS_EPTCTLENB_ERR_OVFLW (0x1u << 8) /**< \brief (UDPHS_EPTCTLENB) Overflow Error Interrupt Enable */ +#define UDPHS_EPTCTLENB_RXRDY_TXKL (0x1u << 9) /**< \brief (UDPHS_EPTCTLENB) Received OUT Data Interrupt Enable */ +#define UDPHS_EPTCTLENB_TX_COMPLT (0x1u << 10) /**< \brief (UDPHS_EPTCTLENB) Transmitted IN Data Complete Interrupt Enable */ +#define UDPHS_EPTCTLENB_TXRDY (0x1u << 11) /**< \brief (UDPHS_EPTCTLENB) TX Packet Ready Interrupt Enable */ +#define UDPHS_EPTCTLENB_RX_SETUP (0x1u << 12) /**< \brief (UDPHS_EPTCTLENB) Received SETUP */ +#define UDPHS_EPTCTLENB_STALL_SNT (0x1u << 13) /**< \brief (UDPHS_EPTCTLENB) Stall Sent Interrupt Enable */ +#define UDPHS_EPTCTLENB_NAK_IN (0x1u << 14) /**< \brief (UDPHS_EPTCTLENB) NAKIN Interrupt Enable */ +#define UDPHS_EPTCTLENB_NAK_OUT (0x1u << 15) /**< \brief (UDPHS_EPTCTLENB) NAKOUT Interrupt Enable */ +#define UDPHS_EPTCTLENB_BUSY_BANK (0x1u << 18) /**< \brief (UDPHS_EPTCTLENB) Busy Bank Interrupt Enable */ +#define UDPHS_EPTCTLENB_SHRT_PCKT (0x1u << 31) /**< \brief (UDPHS_EPTCTLENB) Short Packet Send/Short Packet Interrupt Enable */ +#define UDPHS_EPTCTLENB_DATAX_RX (0x1u << 6) /**< \brief (UDPHS_EPTCTLENB) DATAx Interrupt Enable (Only for high bandwidth Isochronous OUT endpoints) */ +#define UDPHS_EPTCTLENB_MDATA_RX (0x1u << 7) /**< \brief (UDPHS_EPTCTLENB) MDATA Interrupt Enable (Only for high bandwidth Isochronous OUT endpoints) */ +#define UDPHS_EPTCTLENB_TXRDY_TRER (0x1u << 11) /**< \brief (UDPHS_EPTCTLENB) TX Packet Ready/Transaction Error Interrupt Enable */ +#define UDPHS_EPTCTLENB_ERR_FL_ISO (0x1u << 12) /**< \brief (UDPHS_EPTCTLENB) Error Flow Interrupt Enable */ +#define UDPHS_EPTCTLENB_ERR_CRC_NTR (0x1u << 13) /**< \brief (UDPHS_EPTCTLENB) ISO CRC Error/Number of Transaction Error Interrupt Enable */ +#define UDPHS_EPTCTLENB_ERR_FLUSH (0x1u << 14) /**< \brief (UDPHS_EPTCTLENB) Bank Flush Error Interrupt Enable */ +/* -------- UDPHS_EPTCTLDIS : (UDPHS Offset: N/A) UDPHS Endpoint Control Disable Register -------- */ +#define UDPHS_EPTCTLDIS_EPT_DISABL (0x1u << 0) /**< \brief (UDPHS_EPTCTLDIS) Endpoint Disable */ +#define UDPHS_EPTCTLDIS_AUTO_VALID (0x1u << 1) /**< \brief (UDPHS_EPTCTLDIS) Packet Auto-Valid Disable */ +#define UDPHS_EPTCTLDIS_INTDIS_DMA (0x1u << 3) /**< \brief (UDPHS_EPTCTLDIS) Interrupts Disable DMA */ +#define UDPHS_EPTCTLDIS_NYET_DIS (0x1u << 4) /**< \brief (UDPHS_EPTCTLDIS) NYET Enable (Only for High Speed Bulk OUT endpoints) */ +#define UDPHS_EPTCTLDIS_ERR_OVFLW (0x1u << 8) /**< \brief (UDPHS_EPTCTLDIS) Overflow Error Interrupt Disable */ +#define UDPHS_EPTCTLDIS_RXRDY_TXKL (0x1u << 9) /**< \brief (UDPHS_EPTCTLDIS) Received OUT Data Interrupt Disable */ +#define UDPHS_EPTCTLDIS_TX_COMPLT (0x1u << 10) /**< \brief (UDPHS_EPTCTLDIS) Transmitted IN Data Complete Interrupt Disable */ +#define UDPHS_EPTCTLDIS_TXRDY (0x1u << 11) /**< \brief (UDPHS_EPTCTLDIS) TX Packet Ready Interrupt Disable */ +#define UDPHS_EPTCTLDIS_RX_SETUP (0x1u << 12) /**< \brief (UDPHS_EPTCTLDIS) Received SETUP Interrupt Disable */ +#define UDPHS_EPTCTLDIS_STALL_SNT (0x1u << 13) /**< \brief (UDPHS_EPTCTLDIS) Stall Sent Interrupt Disable */ +#define UDPHS_EPTCTLDIS_NAK_IN (0x1u << 14) /**< \brief (UDPHS_EPTCTLDIS) NAKIN Interrupt Disable */ +#define UDPHS_EPTCTLDIS_NAK_OUT (0x1u << 15) /**< \brief (UDPHS_EPTCTLDIS) NAKOUT Interrupt Disable */ +#define UDPHS_EPTCTLDIS_BUSY_BANK (0x1u << 18) /**< \brief (UDPHS_EPTCTLDIS) Busy Bank Interrupt Disable */ +#define UDPHS_EPTCTLDIS_SHRT_PCKT (0x1u << 31) /**< \brief (UDPHS_EPTCTLDIS) Short Packet Interrupt Disable */ +#define UDPHS_EPTCTLDIS_DATAX_RX (0x1u << 6) /**< \brief (UDPHS_EPTCTLDIS) DATAx Interrupt Disable (Only for High Bandwidth Isochronous OUT endpoints) */ +#define UDPHS_EPTCTLDIS_MDATA_RX (0x1u << 7) /**< \brief (UDPHS_EPTCTLDIS) MDATA Interrupt Disable (Only for High Bandwidth Isochronous OUT endpoints) */ +#define UDPHS_EPTCTLDIS_TXRDY_TRER (0x1u << 11) /**< \brief (UDPHS_EPTCTLDIS) TX Packet Ready/Transaction Error Interrupt Disable */ +#define UDPHS_EPTCTLDIS_ERR_FL_ISO (0x1u << 12) /**< \brief (UDPHS_EPTCTLDIS) Error Flow Interrupt Disable */ +#define UDPHS_EPTCTLDIS_ERR_CRC_NTR (0x1u << 13) /**< \brief (UDPHS_EPTCTLDIS) ISO CRC Error/Number of Transaction Error Interrupt Disable */ +#define UDPHS_EPTCTLDIS_ERR_FLUSH (0x1u << 14) /**< \brief (UDPHS_EPTCTLDIS) bank flush error Interrupt Disable */ +/* -------- UDPHS_EPTCTL : (UDPHS Offset: N/A) UDPHS Endpoint Control Register -------- */ +#define UDPHS_EPTCTL_EPT_ENABL (0x1u << 0) /**< \brief (UDPHS_EPTCTL) Endpoint Enable (cleared upon USB reset) */ +#define UDPHS_EPTCTL_AUTO_VALID (0x1u << 1) /**< \brief (UDPHS_EPTCTL) Packet Auto-Valid Enabled (Not for CONTROL Endpoints) (cleared upon USB reset) */ +#define UDPHS_EPTCTL_INTDIS_DMA (0x1u << 3) /**< \brief (UDPHS_EPTCTL) Interrupt Disables DMA (cleared upon USB reset) */ +#define UDPHS_EPTCTL_NYET_DIS (0x1u << 4) /**< \brief (UDPHS_EPTCTL) NYET Disable (Only for High Speed Bulk OUT Endpoints) (cleared upon USB reset) */ +#define UDPHS_EPTCTL_ERR_OVFLW (0x1u << 8) /**< \brief (UDPHS_EPTCTL) Overflow Error Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_RXRDY_TXKL (0x1u << 9) /**< \brief (UDPHS_EPTCTL) Received OUT Data Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_TX_COMPLT (0x1u << 10) /**< \brief (UDPHS_EPTCTL) Transmitted IN Data Complete Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_TXRDY (0x1u << 11) /**< \brief (UDPHS_EPTCTL) TX Packet Ready Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_RX_SETUP (0x1u << 12) /**< \brief (UDPHS_EPTCTL) Received SETUP Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_STALL_SNT (0x1u << 13) /**< \brief (UDPHS_EPTCTL) Stall Sent Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_NAK_IN (0x1u << 14) /**< \brief (UDPHS_EPTCTL) NAKIN Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_NAK_OUT (0x1u << 15) /**< \brief (UDPHS_EPTCTL) NAKOUT Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_BUSY_BANK (0x1u << 18) /**< \brief (UDPHS_EPTCTL) Busy Bank Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_SHRT_PCKT (0x1u << 31) /**< \brief (UDPHS_EPTCTL) Short Packet Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_DATAX_RX (0x1u << 6) /**< \brief (UDPHS_EPTCTL) DATAx Interrupt Enabled (Only for High Bandwidth Isochronous OUT endpoints) (cleared upon USB reset) */ +#define UDPHS_EPTCTL_MDATA_RX (0x1u << 7) /**< \brief (UDPHS_EPTCTL) MDATA Interrupt Enabled (Only for High Bandwidth Isochronous OUT endpoints) (cleared upon USB reset) */ +#define UDPHS_EPTCTL_TXRDY_TRER (0x1u << 11) /**< \brief (UDPHS_EPTCTL) TX Packet Ready/Transaction Error Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_ERR_FL_ISO (0x1u << 12) /**< \brief (UDPHS_EPTCTL) Error Flow Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_ERR_CRC_NTR (0x1u << 13) /**< \brief (UDPHS_EPTCTL) ISO CRC Error/Number of Transaction Error Interrupt Enabled (cleared upon USB reset) */ +#define UDPHS_EPTCTL_ERR_FLUSH (0x1u << 14) /**< \brief (UDPHS_EPTCTL) Bank Flush Error Interrupt Enabled (cleared upon USB reset) */ +/* -------- UDPHS_EPTSETSTA : (UDPHS Offset: N/A) UDPHS Endpoint Set Status Register -------- */ +#define UDPHS_EPTSETSTA_FRCESTALL (0x1u << 5) /**< \brief (UDPHS_EPTSETSTA) Stall Handshake Request Set */ +#define UDPHS_EPTSETSTA_RXRDY_TXKL (0x1u << 9) /**< \brief (UDPHS_EPTSETSTA) KILL Bank Set (for IN Endpoint) */ +#define UDPHS_EPTSETSTA_TXRDY (0x1u << 11) /**< \brief (UDPHS_EPTSETSTA) TX Packet Ready Set */ +#define UDPHS_EPTSETSTA_TXRDY_TRER (0x1u << 11) /**< \brief (UDPHS_EPTSETSTA) TX Packet Ready Set */ +/* -------- UDPHS_EPTCLRSTA : (UDPHS Offset: N/A) UDPHS Endpoint Clear Status Register -------- */ +#define UDPHS_EPTCLRSTA_FRCESTALL (0x1u << 5) /**< \brief (UDPHS_EPTCLRSTA) Stall Handshake Request Clear */ +#define UDPHS_EPTCLRSTA_TOGGLESQ (0x1u << 6) /**< \brief (UDPHS_EPTCLRSTA) Data Toggle Clear */ +#define UDPHS_EPTCLRSTA_RXRDY_TXKL (0x1u << 9) /**< \brief (UDPHS_EPTCLRSTA) Received OUT Data Clear */ +#define UDPHS_EPTCLRSTA_TX_COMPLT (0x1u << 10) /**< \brief (UDPHS_EPTCLRSTA) Transmitted IN Data Complete Clear */ +#define UDPHS_EPTCLRSTA_RX_SETUP (0x1u << 12) /**< \brief (UDPHS_EPTCLRSTA) Received SETUP Clear */ +#define UDPHS_EPTCLRSTA_STALL_SNT (0x1u << 13) /**< \brief (UDPHS_EPTCLRSTA) Stall Sent Clear */ +#define UDPHS_EPTCLRSTA_NAK_IN (0x1u << 14) /**< \brief (UDPHS_EPTCLRSTA) NAKIN Clear */ +#define UDPHS_EPTCLRSTA_NAK_OUT (0x1u << 15) /**< \brief (UDPHS_EPTCLRSTA) NAKOUT Clear */ +#define UDPHS_EPTCLRSTA_ERR_FL_ISO (0x1u << 12) /**< \brief (UDPHS_EPTCLRSTA) Error Flow Clear */ +#define UDPHS_EPTCLRSTA_ERR_CRC_NTR (0x1u << 13) /**< \brief (UDPHS_EPTCLRSTA) Number of Transaction Error Clear */ +#define UDPHS_EPTCLRSTA_ERR_FLUSH (0x1u << 14) /**< \brief (UDPHS_EPTCLRSTA) Bank Flush Error Clear */ +/* -------- UDPHS_EPTSTA : (UDPHS Offset: N/A) UDPHS Endpoint Status Register -------- */ +#define UDPHS_EPTSTA_FRCESTALL (0x1u << 5) /**< \brief (UDPHS_EPTSTA) Stall Handshake Request (cleared upon USB reset) */ +#define UDPHS_EPTSTA_TOGGLESQ_STA_Pos 6 +#define UDPHS_EPTSTA_TOGGLESQ_STA_Msk (0x3u << UDPHS_EPTSTA_TOGGLESQ_STA_Pos) /**< \brief (UDPHS_EPTSTA) Toggle Sequencing (cleared upon USB reset) */ +#define UDPHS_EPTSTA_TOGGLESQ_STA_DATA0 (0x0u << 6) /**< \brief (UDPHS_EPTSTA) DATA0 */ +#define UDPHS_EPTSTA_TOGGLESQ_STA_DATA1 (0x1u << 6) /**< \brief (UDPHS_EPTSTA) DATA1 */ +#define UDPHS_EPTSTA_TOGGLESQ_STA_DATA2 (0x2u << 6) /**< \brief (UDPHS_EPTSTA) Reserved for High Bandwidth Isochronous Endpoint */ +#define UDPHS_EPTSTA_TOGGLESQ_STA_MDATA (0x3u << 6) /**< \brief (UDPHS_EPTSTA) Reserved for High Bandwidth Isochronous Endpoint */ +#define UDPHS_EPTSTA_ERR_OVFLW (0x1u << 8) /**< \brief (UDPHS_EPTSTA) Overflow Error (cleared upon USB reset) */ +#define UDPHS_EPTSTA_RXRDY_TXKL (0x1u << 9) /**< \brief (UDPHS_EPTSTA) Received OUT Data/KILL Bank (cleared upon USB reset) */ +#define UDPHS_EPTSTA_TX_COMPLT (0x1u << 10) /**< \brief (UDPHS_EPTSTA) Transmitted IN Data Complete (cleared upon USB reset) */ +#define UDPHS_EPTSTA_TXRDY (0x1u << 11) /**< \brief (UDPHS_EPTSTA) TX Packet Ready (cleared upon USB reset) */ +#define UDPHS_EPTSTA_RX_SETUP (0x1u << 12) /**< \brief (UDPHS_EPTSTA) Received SETUP (cleared upon USB reset) */ +#define UDPHS_EPTSTA_STALL_SNT (0x1u << 13) /**< \brief (UDPHS_EPTSTA) Stall Sent (cleared upon USB reset) */ +#define UDPHS_EPTSTA_NAK_IN (0x1u << 14) /**< \brief (UDPHS_EPTSTA) NAK IN (cleared upon USB reset) */ +#define UDPHS_EPTSTA_NAK_OUT (0x1u << 15) /**< \brief (UDPHS_EPTSTA) NAK OUT (cleared upon USB reset) */ +#define UDPHS_EPTSTA_CURBK_CTLDIR_Pos 16 +#define UDPHS_EPTSTA_CURBK_CTLDIR_Msk (0x3u << UDPHS_EPTSTA_CURBK_CTLDIR_Pos) /**< \brief (UDPHS_EPTSTA) Current Bank/Control Direction (cleared upon USB reset) */ +#define UDPHS_EPTSTA_BUSY_BANK_STA_Pos 18 +#define UDPHS_EPTSTA_BUSY_BANK_STA_Msk (0x3u << UDPHS_EPTSTA_BUSY_BANK_STA_Pos) /**< \brief (UDPHS_EPTSTA) Busy Bank Number (cleared upon USB reset) */ +#define UDPHS_EPTSTA_BUSY_BANK_STA_0BUSYBANK (0x0u << 18) /**< \brief (UDPHS_EPTSTA) All banks are free */ +#define UDPHS_EPTSTA_BUSY_BANK_STA_1BUSYBANK (0x1u << 18) /**< \brief (UDPHS_EPTSTA) 1 busy bank */ +#define UDPHS_EPTSTA_BUSY_BANK_STA_2BUSYBANKS (0x2u << 18) /**< \brief (UDPHS_EPTSTA) 2 busy banks */ +#define UDPHS_EPTSTA_BUSY_BANK_STA_3BUSYBANKS (0x3u << 18) /**< \brief (UDPHS_EPTSTA) 3 busy banks */ +#define UDPHS_EPTSTA_BYTE_COUNT_Pos 20 +#define UDPHS_EPTSTA_BYTE_COUNT_Msk (0x7ffu << UDPHS_EPTSTA_BYTE_COUNT_Pos) /**< \brief (UDPHS_EPTSTA) UDPHS Byte Count (cleared upon USB reset) */ +#define UDPHS_EPTSTA_SHRT_PCKT (0x1u << 31) /**< \brief (UDPHS_EPTSTA) Short Packet (cleared upon USB reset) */ +#define UDPHS_EPTSTA_TXRDY_TRER (0x1u << 11) /**< \brief (UDPHS_EPTSTA) TX Packet Ready/Transaction Error (cleared upon USB reset) */ +#define UDPHS_EPTSTA_ERR_FL_ISO (0x1u << 12) /**< \brief (UDPHS_EPTSTA) Error Flow (cleared upon USB reset) */ +#define UDPHS_EPTSTA_ERR_CRC_NTR (0x1u << 13) /**< \brief (UDPHS_EPTSTA) CRC ISO Error/Number of Transaction Error (cleared upon USB reset) */ +#define UDPHS_EPTSTA_ERR_FLUSH (0x1u << 14) /**< \brief (UDPHS_EPTSTA) Bank Flush Error (cleared upon USB reset) */ +#define UDPHS_EPTSTA_CURBK_Pos 16 +#define UDPHS_EPTSTA_CURBK_Msk (0x3u << UDPHS_EPTSTA_CURBK_Pos) /**< \brief (UDPHS_EPTSTA) Current Bank (cleared upon USB reset) */ +#define UDPHS_EPTSTA_CURBK_BANK0 (0x0u << 16) /**< \brief (UDPHS_EPTSTA) Bank 0 (or single bank) */ +#define UDPHS_EPTSTA_CURBK_BANK1 (0x1u << 16) /**< \brief (UDPHS_EPTSTA) Bank 1 */ +#define UDPHS_EPTSTA_CURBK_BANK2 (0x2u << 16) /**< \brief (UDPHS_EPTSTA) Bank 2 */ +/* -------- UDPHS_DMANXTDSC : (UDPHS Offset: N/A) UDPHS DMA Next Descriptor Address Register -------- */ +#define UDPHS_DMANXTDSC_NXT_DSC_ADD_Pos 0 +#define UDPHS_DMANXTDSC_NXT_DSC_ADD_Msk (0xffffffffu << UDPHS_DMANXTDSC_NXT_DSC_ADD_Pos) /**< \brief (UDPHS_DMANXTDSC) Next Descriptor Address */ +#define UDPHS_DMANXTDSC_NXT_DSC_ADD(value) ((UDPHS_DMANXTDSC_NXT_DSC_ADD_Msk & ((value) << UDPHS_DMANXTDSC_NXT_DSC_ADD_Pos))) +/* -------- UDPHS_DMAADDRESS : (UDPHS Offset: N/A) UDPHS DMA Channel Address Register -------- */ +#define UDPHS_DMAADDRESS_BUFF_ADD_Pos 0 +#define UDPHS_DMAADDRESS_BUFF_ADD_Msk (0xffffffffu << UDPHS_DMAADDRESS_BUFF_ADD_Pos) /**< \brief (UDPHS_DMAADDRESS) Buffer Address */ +#define UDPHS_DMAADDRESS_BUFF_ADD(value) ((UDPHS_DMAADDRESS_BUFF_ADD_Msk & ((value) << UDPHS_DMAADDRESS_BUFF_ADD_Pos))) +/* -------- UDPHS_DMACONTROL : (UDPHS Offset: N/A) UDPHS DMA Channel Control Register -------- */ +#define UDPHS_DMACONTROL_CHANN_ENB (0x1u << 0) /**< \brief (UDPHS_DMACONTROL) (Channel Enable Command) */ +#define UDPHS_DMACONTROL_LDNXT_DSC (0x1u << 1) /**< \brief (UDPHS_DMACONTROL) Load Next Channel Transfer Descriptor Enable (Command) */ +#define UDPHS_DMACONTROL_END_TR_EN (0x1u << 2) /**< \brief (UDPHS_DMACONTROL) End of Transfer Enable (Control) */ +#define UDPHS_DMACONTROL_END_B_EN (0x1u << 3) /**< \brief (UDPHS_DMACONTROL) End of Buffer Enable (Control) */ +#define UDPHS_DMACONTROL_END_TR_IT (0x1u << 4) /**< \brief (UDPHS_DMACONTROL) End of Transfer Interrupt Enable */ +#define UDPHS_DMACONTROL_END_BUFFIT (0x1u << 5) /**< \brief (UDPHS_DMACONTROL) End of Buffer Interrupt Enable */ +#define UDPHS_DMACONTROL_DESC_LD_IT (0x1u << 6) /**< \brief (UDPHS_DMACONTROL) Descriptor Loaded Interrupt Enable */ +#define UDPHS_DMACONTROL_BURST_LCK (0x1u << 7) /**< \brief (UDPHS_DMACONTROL) Burst Lock Enable */ +#define UDPHS_DMACONTROL_BUFF_LENGTH_Pos 16 +#define UDPHS_DMACONTROL_BUFF_LENGTH_Msk (0xffffu << UDPHS_DMACONTROL_BUFF_LENGTH_Pos) /**< \brief (UDPHS_DMACONTROL) Buffer Byte Length (Write-only) */ +#define UDPHS_DMACONTROL_BUFF_LENGTH(value) ((UDPHS_DMACONTROL_BUFF_LENGTH_Msk & ((value) << UDPHS_DMACONTROL_BUFF_LENGTH_Pos))) +/* -------- UDPHS_DMASTATUS : (UDPHS Offset: N/A) UDPHS DMA Channel Status Register -------- */ +#define UDPHS_DMASTATUS_CHANN_ENB (0x1u << 0) /**< \brief (UDPHS_DMASTATUS) Channel Enable Status */ +#define UDPHS_DMASTATUS_CHANN_ACT (0x1u << 1) /**< \brief (UDPHS_DMASTATUS) Channel Active Status */ +#define UDPHS_DMASTATUS_END_TR_ST (0x1u << 4) /**< \brief (UDPHS_DMASTATUS) End of Channel Transfer Status */ +#define UDPHS_DMASTATUS_END_BF_ST (0x1u << 5) /**< \brief (UDPHS_DMASTATUS) End of Channel Buffer Status */ +#define UDPHS_DMASTATUS_DESC_LDST (0x1u << 6) /**< \brief (UDPHS_DMASTATUS) Descriptor Loaded Status */ +#define UDPHS_DMASTATUS_BUFF_COUNT_Pos 16 +#define UDPHS_DMASTATUS_BUFF_COUNT_Msk (0xffffu << UDPHS_DMASTATUS_BUFF_COUNT_Pos) /**< \brief (UDPHS_DMASTATUS) Buffer Byte Count */ +#define UDPHS_DMASTATUS_BUFF_COUNT(value) ((UDPHS_DMASTATUS_BUFF_COUNT_Msk & ((value) << UDPHS_DMASTATUS_BUFF_COUNT_Pos))) + +/*@}*/ + + +#endif /* _SAMA5D2_UDPHS_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_wdt.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_wdt.h new file mode 100644 index 000000000..7dd6c2d14 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_wdt.h @@ -0,0 +1,74 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_WDT_COMPONENT_ +#define _SAMA5D2_WDT_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Watchdog Timer */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_WDT Watchdog Timer */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief Wdt hardware registers */ +typedef struct { + __O uint32_t WDT_CR; /**< \brief (Wdt Offset: 0x00) Control Register */ + __IO uint32_t WDT_MR; /**< \brief (Wdt Offset: 0x04) Mode Register */ + __I uint32_t WDT_SR; /**< \brief (Wdt Offset: 0x08) Status Register */ +} Wdt; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- WDT_CR : (WDT Offset: 0x00) Control Register -------- */ +#define WDT_CR_WDRSTT (0x1u << 0) /**< \brief (WDT_CR) Watchdog Restart */ +#define WDT_CR_LOCKMR (0x1u << 4) /**< \brief (WDT_CR) Lock Mode Register Write Access */ +#define WDT_CR_KEY_Pos 24 +#define WDT_CR_KEY_Msk (0xffu << WDT_CR_KEY_Pos) /**< \brief (WDT_CR) Password */ +#define WDT_CR_KEY(value) ((WDT_CR_KEY_Msk & ((value) << WDT_CR_KEY_Pos))) +#define WDT_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (WDT_CR) Writing any other value in this field aborts the write operation. */ +/* -------- WDT_MR : (WDT Offset: 0x04) Mode Register -------- */ +#define WDT_MR_WDV_Pos 0 +#define WDT_MR_WDV_Msk (0xfffu << WDT_MR_WDV_Pos) /**< \brief (WDT_MR) Watchdog Counter Value */ +#define WDT_MR_WDV(value) ((WDT_MR_WDV_Msk & ((value) << WDT_MR_WDV_Pos))) +#define WDT_MR_WDFIEN (0x1u << 12) /**< \brief (WDT_MR) Watchdog Fault Interrupt Enable */ +#define WDT_MR_WDRSTEN (0x1u << 13) /**< \brief (WDT_MR) Watchdog Reset Enable */ +#define WDT_MR_WDRPROC (0x1u << 14) /**< \brief (WDT_MR) Watchdog Reset Processor */ +#define WDT_MR_WDDIS (0x1u << 15) /**< \brief (WDT_MR) Watchdog Disable */ +#define WDT_MR_WDD_Pos 16 +#define WDT_MR_WDD_Msk (0xfffu << WDT_MR_WDD_Pos) /**< \brief (WDT_MR) Watchdog Delta Value */ +#define WDT_MR_WDD(value) ((WDT_MR_WDD_Msk & ((value) << WDT_MR_WDD_Pos))) +#define WDT_MR_WDDBGHLT (0x1u << 28) /**< \brief (WDT_MR) Watchdog Debug Halt */ +#define WDT_MR_WDIDLEHLT (0x1u << 29) /**< \brief (WDT_MR) Watchdog Idle Halt */ +/* -------- WDT_SR : (WDT Offset: 0x08) Status Register -------- */ +#define WDT_SR_WDUNF (0x1u << 0) /**< \brief (WDT_SR) Watchdog Underflow (cleared on read) */ +#define WDT_SR_WDERR (0x1u << 1) /**< \brief (WDT_SR) Watchdog Error (cleared on read) */ + +/*@}*/ + + +#endif /* _SAMA5D2_WDT_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_xdmac.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_xdmac.h new file mode 100644 index 000000000..4a10cdb2c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/component/component_xdmac.h @@ -0,0 +1,489 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D2_XDMAC_COMPONENT_ +#define _SAMA5D2_XDMAC_COMPONENT_ + +/* ============================================================================= */ +/** SOFTWARE API DEFINITION FOR Extensible DMA Controller */ +/* ============================================================================= */ +/** \addtogroup SAMA5D2_XDMAC Extensible DMA Controller */ +/*@{*/ + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/** \brief XdmacChid hardware registers */ +typedef struct { + __O uint32_t XDMAC_CIE; /**< \brief (XdmacChid Offset: 0x0) Channel Interrupt Enable Register */ + __O uint32_t XDMAC_CID; /**< \brief (XdmacChid Offset: 0x4) Channel Interrupt Disable Register */ + __O uint32_t XDMAC_CIM; /**< \brief (XdmacChid Offset: 0x8) Channel Interrupt Mask Register */ + __I uint32_t XDMAC_CIS; /**< \brief (XdmacChid Offset: 0xC) Channel Interrupt Status Register */ + __IO uint32_t XDMAC_CSA; /**< \brief (XdmacChid Offset: 0x10) Channel Source Address Register */ + __IO uint32_t XDMAC_CDA; /**< \brief (XdmacChid Offset: 0x14) Channel Destination Address Register */ + __IO uint32_t XDMAC_CNDA; /**< \brief (XdmacChid Offset: 0x18) Channel Next Descriptor Address Register */ + __IO uint32_t XDMAC_CNDC; /**< \brief (XdmacChid Offset: 0x1C) Channel Next Descriptor Control Register */ + __IO uint32_t XDMAC_CUBC; /**< \brief (XdmacChid Offset: 0x20) Channel Microblock Control Register */ + __IO uint32_t XDMAC_CBC; /**< \brief (XdmacChid Offset: 0x24) Channel Block Control Register */ + __IO uint32_t XDMAC_CC; /**< \brief (XdmacChid Offset: 0x28) Channel Configuration Register */ + __IO uint32_t XDMAC_CDS_MSP; /**< \brief (XdmacChid Offset: 0x2C) Channel Data Stride Memory Set Pattern */ + __IO uint32_t XDMAC_CSUS; /**< \brief (XdmacChid Offset: 0x30) Channel Source Microblock Stride */ + __IO uint32_t XDMAC_CDUS; /**< \brief (XdmacChid Offset: 0x34) Channel Destination Microblock Stride */ + __I uint32_t Reserved1[2]; +} XdmacChid; +/** \brief Xdmac hardware registers */ +#define XDMACCHID_NUMBER 16 +typedef struct { + __IO uint32_t XDMAC_GTYPE; /**< \brief (Xdmac Offset: 0x00) Global Type Register */ + __I uint32_t XDMAC_GCFG; /**< \brief (Xdmac Offset: 0x04) Global Configuration Register */ + __IO uint32_t XDMAC_GWAC; /**< \brief (Xdmac Offset: 0x08) Global Weighted Arbiter Configuration Register */ + __O uint32_t XDMAC_GIE; /**< \brief (Xdmac Offset: 0x0C) Global Interrupt Enable Register */ + __O uint32_t XDMAC_GID; /**< \brief (Xdmac Offset: 0x10) Global Interrupt Disable Register */ + __I uint32_t XDMAC_GIM; /**< \brief (Xdmac Offset: 0x14) Global Interrupt Mask Register */ + __I uint32_t XDMAC_GIS; /**< \brief (Xdmac Offset: 0x18) Global Interrupt Status Register */ + __O uint32_t XDMAC_GE; /**< \brief (Xdmac Offset: 0x1C) Global Channel Enable Register */ + __O uint32_t XDMAC_GD; /**< \brief (Xdmac Offset: 0x20) Global Channel Disable Register */ + __I uint32_t XDMAC_GS; /**< \brief (Xdmac Offset: 0x24) Global Channel Status Register */ + __IO uint32_t XDMAC_GRS; /**< \brief (Xdmac Offset: 0x28) Global Channel Read Suspend Register */ + __IO uint32_t XDMAC_GWS; /**< \brief (Xdmac Offset: 0x2C) Global Channel Write Suspend Register */ + __O uint32_t XDMAC_GRWS; /**< \brief (Xdmac Offset: 0x30) Global Channel Read Write Suspend Register */ + __O uint32_t XDMAC_GRWR; /**< \brief (Xdmac Offset: 0x34) Global Channel Read Write Resume Register */ + __O uint32_t XDMAC_GSWR; /**< \brief (Xdmac Offset: 0x38) Global Channel Software Request Register */ + __I uint32_t XDMAC_GSWS; /**< \brief (Xdmac Offset: 0x3C) Global Channel Software Request Status Register */ + __O uint32_t XDMAC_GSWF; /**< \brief (Xdmac Offset: 0x40) Global Channel Software Flush Request Register */ + __I uint32_t Reserved1[3]; + XdmacChid XDMAC_CHID[XDMACCHID_NUMBER]; /**< \brief (Xdmac Offset: 0x50) chid = 0 .. 15 */ + __I uint32_t Reserved2[747]; + __IO uint32_t XDMAC_VERSION; /**< \brief (Xdmac Offset: 0xFFC) XDMAC Version Register */ +} Xdmac; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/* -------- XDMAC_GTYPE : (XDMAC Offset: 0x00) Global Type Register -------- */ +#define XDMAC_GTYPE_NB_CH_Pos 0 +#define XDMAC_GTYPE_NB_CH_Msk (0x1fu << XDMAC_GTYPE_NB_CH_Pos) /**< \brief (XDMAC_GTYPE) Number of Channels Minus One */ +#define XDMAC_GTYPE_NB_CH(value) ((XDMAC_GTYPE_NB_CH_Msk & ((value) << XDMAC_GTYPE_NB_CH_Pos))) +#define XDMAC_GTYPE_FIFO_SZ_Pos 5 +#define XDMAC_GTYPE_FIFO_SZ_Msk (0x7ffu << XDMAC_GTYPE_FIFO_SZ_Pos) /**< \brief (XDMAC_GTYPE) Number of Bytes */ +#define XDMAC_GTYPE_FIFO_SZ(value) ((XDMAC_GTYPE_FIFO_SZ_Msk & ((value) << XDMAC_GTYPE_FIFO_SZ_Pos))) +#define XDMAC_GTYPE_NB_REQ_Pos 16 +#define XDMAC_GTYPE_NB_REQ_Msk (0x7fu << XDMAC_GTYPE_NB_REQ_Pos) /**< \brief (XDMAC_GTYPE) Number of Peripheral Requests Minus One */ +#define XDMAC_GTYPE_NB_REQ(value) ((XDMAC_GTYPE_NB_REQ_Msk & ((value) << XDMAC_GTYPE_NB_REQ_Pos))) +/* -------- XDMAC_GCFG : (XDMAC Offset: 0x04) Global Configuration Register -------- */ +#define XDMAC_GCFG_CGDISREG (0x1u << 0) /**< \brief (XDMAC_GCFG) Configuration Registers Clock Gating Disable */ +#define XDMAC_GCFG_CGDISPIPE (0x1u << 1) /**< \brief (XDMAC_GCFG) Pipeline Clock Gating Disable */ +#define XDMAC_GCFG_CGDISFIFO (0x1u << 2) /**< \brief (XDMAC_GCFG) FIFO Clock Gating Disable */ +#define XDMAC_GCFG_CGDISIF (0x1u << 3) /**< \brief (XDMAC_GCFG) Bus Interface Clock Gating Disable */ +#define XDMAC_GCFG_BXKBEN (0x1u << 8) /**< \brief (XDMAC_GCFG) Boundary X Kilobyte Enable */ +/* -------- XDMAC_GWAC : (XDMAC Offset: 0x08) Global Weighted Arbiter Configuration Register -------- */ +#define XDMAC_GWAC_PW0_Pos 0 +#define XDMAC_GWAC_PW0_Msk (0xfu << XDMAC_GWAC_PW0_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 0 */ +#define XDMAC_GWAC_PW0(value) ((XDMAC_GWAC_PW0_Msk & ((value) << XDMAC_GWAC_PW0_Pos))) +#define XDMAC_GWAC_PW1_Pos 4 +#define XDMAC_GWAC_PW1_Msk (0xfu << XDMAC_GWAC_PW1_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 1 */ +#define XDMAC_GWAC_PW1(value) ((XDMAC_GWAC_PW1_Msk & ((value) << XDMAC_GWAC_PW1_Pos))) +#define XDMAC_GWAC_PW2_Pos 8 +#define XDMAC_GWAC_PW2_Msk (0xfu << XDMAC_GWAC_PW2_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 2 */ +#define XDMAC_GWAC_PW2(value) ((XDMAC_GWAC_PW2_Msk & ((value) << XDMAC_GWAC_PW2_Pos))) +#define XDMAC_GWAC_PW3_Pos 12 +#define XDMAC_GWAC_PW3_Msk (0xfu << XDMAC_GWAC_PW3_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 3 */ +#define XDMAC_GWAC_PW3(value) ((XDMAC_GWAC_PW3_Msk & ((value) << XDMAC_GWAC_PW3_Pos))) +/* -------- XDMAC_GIE : (XDMAC Offset: 0x0C) Global Interrupt Enable Register -------- */ +#define XDMAC_GIE_IE0 (0x1u << 0) /**< \brief (XDMAC_GIE) XDMAC Channel 0 Interrupt Enable Bit */ +#define XDMAC_GIE_IE1 (0x1u << 1) /**< \brief (XDMAC_GIE) XDMAC Channel 1 Interrupt Enable Bit */ +#define XDMAC_GIE_IE4 (0x1u << 4) /**< \brief (XDMAC_GIE) XDMAC Channel 4 Interrupt Enable Bit */ +#define XDMAC_GIE_IE5 (0x1u << 5) /**< \brief (XDMAC_GIE) XDMAC Channel 5 Interrupt Enable Bit */ +#define XDMAC_GIE_IE6 (0x1u << 6) /**< \brief (XDMAC_GIE) XDMAC Channel 6 Interrupt Enable Bit */ +#define XDMAC_GIE_IE7 (0x1u << 7) /**< \brief (XDMAC_GIE) XDMAC Channel 7 Interrupt Enable Bit */ +#define XDMAC_GIE_IE8 (0x1u << 8) /**< \brief (XDMAC_GIE) XDMAC Channel 8 Interrupt Enable Bit */ +#define XDMAC_GIE_IE9 (0x1u << 9) /**< \brief (XDMAC_GIE) XDMAC Channel 9 Interrupt Enable Bit */ +#define XDMAC_GIE_IE10 (0x1u << 10) /**< \brief (XDMAC_GIE) XDMAC Channel 10 Interrupt Enable Bit */ +#define XDMAC_GIE_IE11 (0x1u << 11) /**< \brief (XDMAC_GIE) XDMAC Channel 11 Interrupt Enable Bit */ +#define XDMAC_GIE_IE12 (0x1u << 12) /**< \brief (XDMAC_GIE) XDMAC Channel 12 Interrupt Enable Bit */ +#define XDMAC_GIE_IE13 (0x1u << 13) /**< \brief (XDMAC_GIE) XDMAC Channel 13 Interrupt Enable Bit */ +#define XDMAC_GIE_IE14 (0x1u << 14) /**< \brief (XDMAC_GIE) XDMAC Channel 14 Interrupt Enable Bit */ +#define XDMAC_GIE_IE15 (0x1u << 15) /**< \brief (XDMAC_GIE) XDMAC Channel 15 Interrupt Enable Bit */ +/* -------- XDMAC_GID : (XDMAC Offset: 0x10) Global Interrupt Disable Register -------- */ +#define XDMAC_GID_ID0 (0x1u << 0) /**< \brief (XDMAC_GID) XDMAC Channel 0 Interrupt Disable Bit */ +#define XDMAC_GID_ID1 (0x1u << 1) /**< \brief (XDMAC_GID) XDMAC Channel 1 Interrupt Disable Bit */ +#define XDMAC_GID_ID4 (0x1u << 4) /**< \brief (XDMAC_GID) XDMAC Channel 4 Interrupt Disable Bit */ +#define XDMAC_GID_ID5 (0x1u << 5) /**< \brief (XDMAC_GID) XDMAC Channel 5 Interrupt Disable Bit */ +#define XDMAC_GID_ID6 (0x1u << 6) /**< \brief (XDMAC_GID) XDMAC Channel 6 Interrupt Disable Bit */ +#define XDMAC_GID_ID7 (0x1u << 7) /**< \brief (XDMAC_GID) XDMAC Channel 7 Interrupt Disable Bit */ +#define XDMAC_GID_ID8 (0x1u << 8) /**< \brief (XDMAC_GID) XDMAC Channel 8 Interrupt Disable Bit */ +#define XDMAC_GID_ID9 (0x1u << 9) /**< \brief (XDMAC_GID) XDMAC Channel 9 Interrupt Disable Bit */ +#define XDMAC_GID_ID10 (0x1u << 10) /**< \brief (XDMAC_GID) XDMAC Channel 10 Interrupt Disable Bit */ +#define XDMAC_GID_ID11 (0x1u << 11) /**< \brief (XDMAC_GID) XDMAC Channel 11 Interrupt Disable Bit */ +#define XDMAC_GID_ID12 (0x1u << 12) /**< \brief (XDMAC_GID) XDMAC Channel 12 Interrupt Disable Bit */ +#define XDMAC_GID_ID13 (0x1u << 13) /**< \brief (XDMAC_GID) XDMAC Channel 13 Interrupt Disable Bit */ +#define XDMAC_GID_ID14 (0x1u << 14) /**< \brief (XDMAC_GID) XDMAC Channel 14 Interrupt Disable Bit */ +#define XDMAC_GID_ID15 (0x1u << 15) /**< \brief (XDMAC_GID) XDMAC Channel 15 Interrupt Disable Bit */ +/* -------- XDMAC_GIM : (XDMAC Offset: 0x14) Global Interrupt Mask Register -------- */ +#define XDMAC_GIM_IM0 (0x1u << 0) /**< \brief (XDMAC_GIM) XDMAC Channel 0 Interrupt Mask Bit */ +#define XDMAC_GIM_IM1 (0x1u << 1) /**< \brief (XDMAC_GIM) XDMAC Channel 1 Interrupt Mask Bit */ +#define XDMAC_GIM_IM4 (0x1u << 4) /**< \brief (XDMAC_GIM) XDMAC Channel 4 Interrupt Mask Bit */ +#define XDMAC_GIM_IM5 (0x1u << 5) /**< \brief (XDMAC_GIM) XDMAC Channel 5 Interrupt Mask Bit */ +#define XDMAC_GIM_IM6 (0x1u << 6) /**< \brief (XDMAC_GIM) XDMAC Channel 6 Interrupt Mask Bit */ +#define XDMAC_GIM_IM7 (0x1u << 7) /**< \brief (XDMAC_GIM) XDMAC Channel 7 Interrupt Mask Bit */ +#define XDMAC_GIM_IM8 (0x1u << 8) /**< \brief (XDMAC_GIM) XDMAC Channel 8 Interrupt Mask Bit */ +#define XDMAC_GIM_IM9 (0x1u << 9) /**< \brief (XDMAC_GIM) XDMAC Channel 9 Interrupt Mask Bit */ +#define XDMAC_GIM_IM10 (0x1u << 10) /**< \brief (XDMAC_GIM) XDMAC Channel 10 Interrupt Mask Bit */ +#define XDMAC_GIM_IM11 (0x1u << 11) /**< \brief (XDMAC_GIM) XDMAC Channel 11 Interrupt Mask Bit */ +#define XDMAC_GIM_IM12 (0x1u << 12) /**< \brief (XDMAC_GIM) XDMAC Channel 12 Interrupt Mask Bit */ +#define XDMAC_GIM_IM13 (0x1u << 13) /**< \brief (XDMAC_GIM) XDMAC Channel 13 Interrupt Mask Bit */ +#define XDMAC_GIM_IM14 (0x1u << 14) /**< \brief (XDMAC_GIM) XDMAC Channel 14 Interrupt Mask Bit */ +#define XDMAC_GIM_IM15 (0x1u << 15) /**< \brief (XDMAC_GIM) XDMAC Channel 15 Interrupt Mask Bit */ +/* -------- XDMAC_GIS : (XDMAC Offset: 0x18) Global Interrupt Status Register -------- */ +#define XDMAC_GIS_IS0 (0x1u << 0) /**< \brief (XDMAC_GIS) XDMAC Channel 0 Interrupt Status Bit */ +#define XDMAC_GIS_IS1 (0x1u << 1) /**< \brief (XDMAC_GIS) XDMAC Channel 1 Interrupt Status Bit */ +#define XDMAC_GIS_IS4 (0x1u << 4) /**< \brief (XDMAC_GIS) XDMAC Channel 4 Interrupt Status Bit */ +#define XDMAC_GIS_IS5 (0x1u << 5) /**< \brief (XDMAC_GIS) XDMAC Channel 5 Interrupt Status Bit */ +#define XDMAC_GIS_IS6 (0x1u << 6) /**< \brief (XDMAC_GIS) XDMAC Channel 6 Interrupt Status Bit */ +#define XDMAC_GIS_IS7 (0x1u << 7) /**< \brief (XDMAC_GIS) XDMAC Channel 7 Interrupt Status Bit */ +#define XDMAC_GIS_IS8 (0x1u << 8) /**< \brief (XDMAC_GIS) XDMAC Channel 8 Interrupt Status Bit */ +#define XDMAC_GIS_IS9 (0x1u << 9) /**< \brief (XDMAC_GIS) XDMAC Channel 9 Interrupt Status Bit */ +#define XDMAC_GIS_IS10 (0x1u << 10) /**< \brief (XDMAC_GIS) XDMAC Channel 10 Interrupt Status Bit */ +#define XDMAC_GIS_IS11 (0x1u << 11) /**< \brief (XDMAC_GIS) XDMAC Channel 11 Interrupt Status Bit */ +#define XDMAC_GIS_IS12 (0x1u << 12) /**< \brief (XDMAC_GIS) XDMAC Channel 12 Interrupt Status Bit */ +#define XDMAC_GIS_IS13 (0x1u << 13) /**< \brief (XDMAC_GIS) XDMAC Channel 13 Interrupt Status Bit */ +#define XDMAC_GIS_IS14 (0x1u << 14) /**< \brief (XDMAC_GIS) XDMAC Channel 14 Interrupt Status Bit */ +#define XDMAC_GIS_IS15 (0x1u << 15) /**< \brief (XDMAC_GIS) XDMAC Channel 15 Interrupt Status Bit */ +/* -------- XDMAC_GE : (XDMAC Offset: 0x1C) Global Channel Enable Register -------- */ +#define XDMAC_GE_EN0 (0x1u << 0) /**< \brief (XDMAC_GE) XDMAC Channel 0 Enable Bit */ +#define XDMAC_GE_EN1 (0x1u << 1) /**< \brief (XDMAC_GE) XDMAC Channel 1 Enable Bit */ +#define XDMAC_GE_EN4 (0x1u << 4) /**< \brief (XDMAC_GE) XDMAC Channel 4 Enable Bit */ +#define XDMAC_GE_EN5 (0x1u << 5) /**< \brief (XDMAC_GE) XDMAC Channel 5 Enable Bit */ +#define XDMAC_GE_EN6 (0x1u << 6) /**< \brief (XDMAC_GE) XDMAC Channel 6 Enable Bit */ +#define XDMAC_GE_EN7 (0x1u << 7) /**< \brief (XDMAC_GE) XDMAC Channel 7 Enable Bit */ +#define XDMAC_GE_EN8 (0x1u << 8) /**< \brief (XDMAC_GE) XDMAC Channel 8 Enable Bit */ +#define XDMAC_GE_EN9 (0x1u << 9) /**< \brief (XDMAC_GE) XDMAC Channel 9 Enable Bit */ +#define XDMAC_GE_EN10 (0x1u << 10) /**< \brief (XDMAC_GE) XDMAC Channel 10 Enable Bit */ +#define XDMAC_GE_EN11 (0x1u << 11) /**< \brief (XDMAC_GE) XDMAC Channel 11 Enable Bit */ +#define XDMAC_GE_EN12 (0x1u << 12) /**< \brief (XDMAC_GE) XDMAC Channel 12 Enable Bit */ +#define XDMAC_GE_EN13 (0x1u << 13) /**< \brief (XDMAC_GE) XDMAC Channel 13 Enable Bit */ +#define XDMAC_GE_EN14 (0x1u << 14) /**< \brief (XDMAC_GE) XDMAC Channel 14 Enable Bit */ +#define XDMAC_GE_EN15 (0x1u << 15) /**< \brief (XDMAC_GE) XDMAC Channel 15 Enable Bit */ +/* -------- XDMAC_GD : (XDMAC Offset: 0x20) Global Channel Disable Register -------- */ +#define XDMAC_GD_DI0 (0x1u << 0) /**< \brief (XDMAC_GD) XDMAC Channel 0 Disable Bit */ +#define XDMAC_GD_DI1 (0x1u << 1) /**< \brief (XDMAC_GD) XDMAC Channel 1 Disable Bit */ +#define XDMAC_GD_DI4 (0x1u << 4) /**< \brief (XDMAC_GD) XDMAC Channel 4 Disable Bit */ +#define XDMAC_GD_DI5 (0x1u << 5) /**< \brief (XDMAC_GD) XDMAC Channel 5 Disable Bit */ +#define XDMAC_GD_DI6 (0x1u << 6) /**< \brief (XDMAC_GD) XDMAC Channel 6 Disable Bit */ +#define XDMAC_GD_DI7 (0x1u << 7) /**< \brief (XDMAC_GD) XDMAC Channel 7 Disable Bit */ +#define XDMAC_GD_DI8 (0x1u << 8) /**< \brief (XDMAC_GD) XDMAC Channel 8 Disable Bit */ +#define XDMAC_GD_DI9 (0x1u << 9) /**< \brief (XDMAC_GD) XDMAC Channel 9 Disable Bit */ +#define XDMAC_GD_DI10 (0x1u << 10) /**< \brief (XDMAC_GD) XDMAC Channel 10 Disable Bit */ +#define XDMAC_GD_DI11 (0x1u << 11) /**< \brief (XDMAC_GD) XDMAC Channel 11 Disable Bit */ +#define XDMAC_GD_DI12 (0x1u << 12) /**< \brief (XDMAC_GD) XDMAC Channel 12 Disable Bit */ +#define XDMAC_GD_DI13 (0x1u << 13) /**< \brief (XDMAC_GD) XDMAC Channel 13 Disable Bit */ +#define XDMAC_GD_DI14 (0x1u << 14) /**< \brief (XDMAC_GD) XDMAC Channel 14 Disable Bit */ +#define XDMAC_GD_DI15 (0x1u << 15) /**< \brief (XDMAC_GD) XDMAC Channel 15 Disable Bit */ +/* -------- XDMAC_GS : (XDMAC Offset: 0x24) Global Channel Status Register -------- */ +#define XDMAC_GS_ST0 (0x1u << 0) /**< \brief (XDMAC_GS) XDMAC Channel 0 Status Bit */ +#define XDMAC_GS_ST1 (0x1u << 1) /**< \brief (XDMAC_GS) XDMAC Channel 1 Status Bit */ +#define XDMAC_GS_ST4 (0x1u << 4) /**< \brief (XDMAC_GS) XDMAC Channel 4 Status Bit */ +#define XDMAC_GS_ST5 (0x1u << 5) /**< \brief (XDMAC_GS) XDMAC Channel 5 Status Bit */ +#define XDMAC_GS_ST6 (0x1u << 6) /**< \brief (XDMAC_GS) XDMAC Channel 6 Status Bit */ +#define XDMAC_GS_ST7 (0x1u << 7) /**< \brief (XDMAC_GS) XDMAC Channel 7 Status Bit */ +#define XDMAC_GS_ST8 (0x1u << 8) /**< \brief (XDMAC_GS) XDMAC Channel 8 Status Bit */ +#define XDMAC_GS_ST9 (0x1u << 9) /**< \brief (XDMAC_GS) XDMAC Channel 9 Status Bit */ +#define XDMAC_GS_ST10 (0x1u << 10) /**< \brief (XDMAC_GS) XDMAC Channel 10 Status Bit */ +#define XDMAC_GS_ST11 (0x1u << 11) /**< \brief (XDMAC_GS) XDMAC Channel 11 Status Bit */ +#define XDMAC_GS_ST12 (0x1u << 12) /**< \brief (XDMAC_GS) XDMAC Channel 12 Status Bit */ +#define XDMAC_GS_ST13 (0x1u << 13) /**< \brief (XDMAC_GS) XDMAC Channel 13 Status Bit */ +#define XDMAC_GS_ST14 (0x1u << 14) /**< \brief (XDMAC_GS) XDMAC Channel 14 Status Bit */ +#define XDMAC_GS_ST15 (0x1u << 15) /**< \brief (XDMAC_GS) XDMAC Channel 15 Status Bit */ +/* -------- XDMAC_GRS : (XDMAC Offset: 0x28) Global Channel Read Suspend Register -------- */ +#define XDMAC_GRS_RS0 (0x1u << 0) /**< \brief (XDMAC_GRS) XDMAC Channel 0 Read Suspend Bit */ +#define XDMAC_GRS_RS1 (0x1u << 1) /**< \brief (XDMAC_GRS) XDMAC Channel 1 Read Suspend Bit */ +#define XDMAC_GRS_RS4 (0x1u << 4) /**< \brief (XDMAC_GRS) XDMAC Channel 4 Read Suspend Bit */ +#define XDMAC_GRS_RS5 (0x1u << 5) /**< \brief (XDMAC_GRS) XDMAC Channel 5 Read Suspend Bit */ +#define XDMAC_GRS_RS6 (0x1u << 6) /**< \brief (XDMAC_GRS) XDMAC Channel 6 Read Suspend Bit */ +#define XDMAC_GRS_RS7 (0x1u << 7) /**< \brief (XDMAC_GRS) XDMAC Channel 7 Read Suspend Bit */ +#define XDMAC_GRS_RS8 (0x1u << 8) /**< \brief (XDMAC_GRS) XDMAC Channel 8 Read Suspend Bit */ +#define XDMAC_GRS_RS9 (0x1u << 9) /**< \brief (XDMAC_GRS) XDMAC Channel 9 Read Suspend Bit */ +#define XDMAC_GRS_RS10 (0x1u << 10) /**< \brief (XDMAC_GRS) XDMAC Channel 10 Read Suspend Bit */ +#define XDMAC_GRS_RS11 (0x1u << 11) /**< \brief (XDMAC_GRS) XDMAC Channel 11 Read Suspend Bit */ +#define XDMAC_GRS_RS12 (0x1u << 12) /**< \brief (XDMAC_GRS) XDMAC Channel 12 Read Suspend Bit */ +#define XDMAC_GRS_RS13 (0x1u << 13) /**< \brief (XDMAC_GRS) XDMAC Channel 13 Read Suspend Bit */ +#define XDMAC_GRS_RS14 (0x1u << 14) /**< \brief (XDMAC_GRS) XDMAC Channel 14 Read Suspend Bit */ +#define XDMAC_GRS_RS15 (0x1u << 15) /**< \brief (XDMAC_GRS) XDMAC Channel 15 Read Suspend Bit */ +/* -------- XDMAC_GWS : (XDMAC Offset: 0x2C) Global Channel Write Suspend Register -------- */ +#define XDMAC_GWS_WS0 (0x1u << 0) /**< \brief (XDMAC_GWS) XDMAC Channel 0 Write Suspend Bit */ +#define XDMAC_GWS_WS1 (0x1u << 1) /**< \brief (XDMAC_GWS) XDMAC Channel 1 Write Suspend Bit */ +#define XDMAC_GWS_WS4 (0x1u << 4) /**< \brief (XDMAC_GWS) XDMAC Channel 4 Write Suspend Bit */ +#define XDMAC_GWS_WS5 (0x1u << 5) /**< \brief (XDMAC_GWS) XDMAC Channel 5 Write Suspend Bit */ +#define XDMAC_GWS_WS6 (0x1u << 6) /**< \brief (XDMAC_GWS) XDMAC Channel 6 Write Suspend Bit */ +#define XDMAC_GWS_WS7 (0x1u << 7) /**< \brief (XDMAC_GWS) XDMAC Channel 7 Write Suspend Bit */ +#define XDMAC_GWS_WS8 (0x1u << 8) /**< \brief (XDMAC_GWS) XDMAC Channel 8 Write Suspend Bit */ +#define XDMAC_GWS_WS9 (0x1u << 9) /**< \brief (XDMAC_GWS) XDMAC Channel 9 Write Suspend Bit */ +#define XDMAC_GWS_WS10 (0x1u << 10) /**< \brief (XDMAC_GWS) XDMAC Channel 10 Write Suspend Bit */ +#define XDMAC_GWS_WS11 (0x1u << 11) /**< \brief (XDMAC_GWS) XDMAC Channel 11 Write Suspend Bit */ +#define XDMAC_GWS_WS12 (0x1u << 12) /**< \brief (XDMAC_GWS) XDMAC Channel 12 Write Suspend Bit */ +#define XDMAC_GWS_WS13 (0x1u << 13) /**< \brief (XDMAC_GWS) XDMAC Channel 13 Write Suspend Bit */ +#define XDMAC_GWS_WS14 (0x1u << 14) /**< \brief (XDMAC_GWS) XDMAC Channel 14 Write Suspend Bit */ +#define XDMAC_GWS_WS15 (0x1u << 15) /**< \brief (XDMAC_GWS) XDMAC Channel 15 Write Suspend Bit */ +/* -------- XDMAC_GRWS : (XDMAC Offset: 0x30) Global Channel Read Write Suspend Register -------- */ +#define XDMAC_GRWS_RWS0 (0x1u << 0) /**< \brief (XDMAC_GRWS) XDMAC Channel 0 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS1 (0x1u << 1) /**< \brief (XDMAC_GRWS) XDMAC Channel 1 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS4 (0x1u << 4) /**< \brief (XDMAC_GRWS) XDMAC Channel 4 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS5 (0x1u << 5) /**< \brief (XDMAC_GRWS) XDMAC Channel 5 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS6 (0x1u << 6) /**< \brief (XDMAC_GRWS) XDMAC Channel 6 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS7 (0x1u << 7) /**< \brief (XDMAC_GRWS) XDMAC Channel 7 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS8 (0x1u << 8) /**< \brief (XDMAC_GRWS) XDMAC Channel 8 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS9 (0x1u << 9) /**< \brief (XDMAC_GRWS) XDMAC Channel 9 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS10 (0x1u << 10) /**< \brief (XDMAC_GRWS) XDMAC Channel 10 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS11 (0x1u << 11) /**< \brief (XDMAC_GRWS) XDMAC Channel 11 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS12 (0x1u << 12) /**< \brief (XDMAC_GRWS) XDMAC Channel 12 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS13 (0x1u << 13) /**< \brief (XDMAC_GRWS) XDMAC Channel 13 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS14 (0x1u << 14) /**< \brief (XDMAC_GRWS) XDMAC Channel 14 Read Write Suspend Bit */ +#define XDMAC_GRWS_RWS15 (0x1u << 15) /**< \brief (XDMAC_GRWS) XDMAC Channel 15 Read Write Suspend Bit */ +/* -------- XDMAC_GRWR : (XDMAC Offset: 0x34) Global Channel Read Write Resume Register -------- */ +#define XDMAC_GRWR_RWR0 (0x1u << 0) /**< \brief (XDMAC_GRWR) XDMAC Channel 0 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR1 (0x1u << 1) /**< \brief (XDMAC_GRWR) XDMAC Channel 1 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR4 (0x1u << 4) /**< \brief (XDMAC_GRWR) XDMAC Channel 4 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR5 (0x1u << 5) /**< \brief (XDMAC_GRWR) XDMAC Channel 5 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR6 (0x1u << 6) /**< \brief (XDMAC_GRWR) XDMAC Channel 6 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR7 (0x1u << 7) /**< \brief (XDMAC_GRWR) XDMAC Channel 7 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR8 (0x1u << 8) /**< \brief (XDMAC_GRWR) XDMAC Channel 8 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR9 (0x1u << 9) /**< \brief (XDMAC_GRWR) XDMAC Channel 9 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR10 (0x1u << 10) /**< \brief (XDMAC_GRWR) XDMAC Channel 10 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR11 (0x1u << 11) /**< \brief (XDMAC_GRWR) XDMAC Channel 11 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR12 (0x1u << 12) /**< \brief (XDMAC_GRWR) XDMAC Channel 12 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR13 (0x1u << 13) /**< \brief (XDMAC_GRWR) XDMAC Channel 13 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR14 (0x1u << 14) /**< \brief (XDMAC_GRWR) XDMAC Channel 14 Read Write Resume Bit */ +#define XDMAC_GRWR_RWR15 (0x1u << 15) /**< \brief (XDMAC_GRWR) XDMAC Channel 15 Read Write Resume Bit */ +/* -------- XDMAC_GSWR : (XDMAC Offset: 0x38) Global Channel Software Request Register -------- */ +#define XDMAC_GSWR_SWREQ0 (0x1u << 0) /**< \brief (XDMAC_GSWR) XDMAC Channel 0 Software Request Bit */ +#define XDMAC_GSWR_SWREQ1 (0x1u << 1) /**< \brief (XDMAC_GSWR) XDMAC Channel 1 Software Request Bit */ +#define XDMAC_GSWR_SWREQ4 (0x1u << 4) /**< \brief (XDMAC_GSWR) XDMAC Channel 4 Software Request Bit */ +#define XDMAC_GSWR_SWREQ5 (0x1u << 5) /**< \brief (XDMAC_GSWR) XDMAC Channel 5 Software Request Bit */ +#define XDMAC_GSWR_SWREQ6 (0x1u << 6) /**< \brief (XDMAC_GSWR) XDMAC Channel 6 Software Request Bit */ +#define XDMAC_GSWR_SWREQ7 (0x1u << 7) /**< \brief (XDMAC_GSWR) XDMAC Channel 7 Software Request Bit */ +#define XDMAC_GSWR_SWREQ8 (0x1u << 8) /**< \brief (XDMAC_GSWR) XDMAC Channel 8 Software Request Bit */ +#define XDMAC_GSWR_SWREQ9 (0x1u << 9) /**< \brief (XDMAC_GSWR) XDMAC Channel 9 Software Request Bit */ +#define XDMAC_GSWR_SWREQ10 (0x1u << 10) /**< \brief (XDMAC_GSWR) XDMAC Channel 10 Software Request Bit */ +#define XDMAC_GSWR_SWREQ11 (0x1u << 11) /**< \brief (XDMAC_GSWR) XDMAC Channel 11 Software Request Bit */ +#define XDMAC_GSWR_SWREQ12 (0x1u << 12) /**< \brief (XDMAC_GSWR) XDMAC Channel 12 Software Request Bit */ +#define XDMAC_GSWR_SWREQ13 (0x1u << 13) /**< \brief (XDMAC_GSWR) XDMAC Channel 13 Software Request Bit */ +#define XDMAC_GSWR_SWREQ14 (0x1u << 14) /**< \brief (XDMAC_GSWR) XDMAC Channel 14 Software Request Bit */ +#define XDMAC_GSWR_SWREQ15 (0x1u << 15) /**< \brief (XDMAC_GSWR) XDMAC Channel 15 Software Request Bit */ +/* -------- XDMAC_GSWS : (XDMAC Offset: 0x3C) Global Channel Software Request Status Register -------- */ +#define XDMAC_GSWS_SWRS0 (0x1u << 0) /**< \brief (XDMAC_GSWS) XDMAC Channel 0 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS1 (0x1u << 1) /**< \brief (XDMAC_GSWS) XDMAC Channel 1 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS4 (0x1u << 4) /**< \brief (XDMAC_GSWS) XDMAC Channel 4 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS5 (0x1u << 5) /**< \brief (XDMAC_GSWS) XDMAC Channel 5 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS6 (0x1u << 6) /**< \brief (XDMAC_GSWS) XDMAC Channel 6 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS7 (0x1u << 7) /**< \brief (XDMAC_GSWS) XDMAC Channel 7 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS8 (0x1u << 8) /**< \brief (XDMAC_GSWS) XDMAC Channel 8 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS9 (0x1u << 9) /**< \brief (XDMAC_GSWS) XDMAC Channel 9 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS10 (0x1u << 10) /**< \brief (XDMAC_GSWS) XDMAC Channel 10 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS11 (0x1u << 11) /**< \brief (XDMAC_GSWS) XDMAC Channel 11 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS12 (0x1u << 12) /**< \brief (XDMAC_GSWS) XDMAC Channel 12 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS13 (0x1u << 13) /**< \brief (XDMAC_GSWS) XDMAC Channel 13 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS14 (0x1u << 14) /**< \brief (XDMAC_GSWS) XDMAC Channel 14 Software Request Status Bit */ +#define XDMAC_GSWS_SWRS15 (0x1u << 15) /**< \brief (XDMAC_GSWS) XDMAC Channel 15 Software Request Status Bit */ +/* -------- XDMAC_GSWF : (XDMAC Offset: 0x40) Global Channel Software Flush Request Register -------- */ +#define XDMAC_GSWF_SWF0 (0x1u << 0) /**< \brief (XDMAC_GSWF) XDMAC Channel 0 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF1 (0x1u << 1) /**< \brief (XDMAC_GSWF) XDMAC Channel 1 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF4 (0x1u << 4) /**< \brief (XDMAC_GSWF) XDMAC Channel 4 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF5 (0x1u << 5) /**< \brief (XDMAC_GSWF) XDMAC Channel 5 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF6 (0x1u << 6) /**< \brief (XDMAC_GSWF) XDMAC Channel 6 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF7 (0x1u << 7) /**< \brief (XDMAC_GSWF) XDMAC Channel 7 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF8 (0x1u << 8) /**< \brief (XDMAC_GSWF) XDMAC Channel 8 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF9 (0x1u << 9) /**< \brief (XDMAC_GSWF) XDMAC Channel 9 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF10 (0x1u << 10) /**< \brief (XDMAC_GSWF) XDMAC Channel 10 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF11 (0x1u << 11) /**< \brief (XDMAC_GSWF) XDMAC Channel 11 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF12 (0x1u << 12) /**< \brief (XDMAC_GSWF) XDMAC Channel 12 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF13 (0x1u << 13) /**< \brief (XDMAC_GSWF) XDMAC Channel 13 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF14 (0x1u << 14) /**< \brief (XDMAC_GSWF) XDMAC Channel 14 Software Flush Request Bit */ +#define XDMAC_GSWF_SWF15 (0x1u << 15) /**< \brief (XDMAC_GSWF) XDMAC Channel 15 Software Flush Request Bit */ +/* -------- XDMAC_CIE : (XDMAC Offset: N/A) Channel Interrupt Enable Register -------- */ +#define XDMAC_CIE_BIE (0x1u << 0) /**< \brief (XDMAC_CIE) End of Block Interrupt Enable Bit */ +#define XDMAC_CIE_LIE (0x1u << 1) /**< \brief (XDMAC_CIE) End of Linked List Interrupt Enable Bit */ +#define XDMAC_CIE_DIE (0x1u << 2) /**< \brief (XDMAC_CIE) End of Disable Interrupt Enable Bit */ +#define XDMAC_CIE_FIE (0x1u << 3) /**< \brief (XDMAC_CIE) End of Flush Interrupt Enable Bit */ +#define XDMAC_CIE_RBIE (0x1u << 4) /**< \brief (XDMAC_CIE) Read Bus Error Interrupt Enable Bit */ +#define XDMAC_CIE_WBIE (0x1u << 5) /**< \brief (XDMAC_CIE) Write Bus Error Interrupt Enable Bit */ +#define XDMAC_CIE_ROIE (0x1u << 6) /**< \brief (XDMAC_CIE) Request Overflow Error Interrupt Enable Bit */ +/* -------- XDMAC_CID : (XDMAC Offset: N/A) Channel Interrupt Disable Register -------- */ +#define XDMAC_CID_BID (0x1u << 0) /**< \brief (XDMAC_CID) End of Block Interrupt Disable Bit */ +#define XDMAC_CID_LID (0x1u << 1) /**< \brief (XDMAC_CID) End of Linked List Interrupt Disable Bit */ +#define XDMAC_CID_DID (0x1u << 2) /**< \brief (XDMAC_CID) End of Disable Interrupt Disable Bit */ +#define XDMAC_CID_FID (0x1u << 3) /**< \brief (XDMAC_CID) End of Flush Interrupt Disable Bit */ +#define XDMAC_CID_RBEID (0x1u << 4) /**< \brief (XDMAC_CID) Read Bus Error Interrupt Disable Bit */ +#define XDMAC_CID_WBEID (0x1u << 5) /**< \brief (XDMAC_CID) Write Bus Error Interrupt Disable Bit */ +#define XDMAC_CID_ROID (0x1u << 6) /**< \brief (XDMAC_CID) Request Overflow Error Interrupt Disable Bit */ +/* -------- XDMAC_CIM : (XDMAC Offset: N/A) Channel Interrupt Mask Register -------- */ +#define XDMAC_CIM_BIM (0x1u << 0) /**< \brief (XDMAC_CIM) End of Block Interrupt Mask Bit */ +#define XDMAC_CIM_LIM (0x1u << 1) /**< \brief (XDMAC_CIM) End of Linked List Interrupt Mask Bit */ +#define XDMAC_CIM_DIM (0x1u << 2) /**< \brief (XDMAC_CIM) End of Disable Interrupt Mask Bit */ +#define XDMAC_CIM_FIM (0x1u << 3) /**< \brief (XDMAC_CIM) End of Flush Interrupt Mask Bit */ +#define XDMAC_CIM_RBEIM (0x1u << 4) /**< \brief (XDMAC_CIM) Read Bus Error Interrupt Mask Bit */ +#define XDMAC_CIM_WBEIM (0x1u << 5) /**< \brief (XDMAC_CIM) Write Bus Error Interrupt Mask Bit */ +#define XDMAC_CIM_ROIM (0x1u << 6) /**< \brief (XDMAC_CIM) Request Overflow Error Interrupt Mask Bit */ +/* -------- XDMAC_CIS : (XDMAC Offset: N/A) Channel Interrupt Status Register -------- */ +#define XDMAC_CIS_BIS (0x1u << 0) /**< \brief (XDMAC_CIS) End of Block Interrupt Status Bit */ +#define XDMAC_CIS_LIS (0x1u << 1) /**< \brief (XDMAC_CIS) End of Linked List Interrupt Status Bit */ +#define XDMAC_CIS_DIS (0x1u << 2) /**< \brief (XDMAC_CIS) End of Disable Interrupt Status Bit */ +#define XDMAC_CIS_FIS (0x1u << 3) /**< \brief (XDMAC_CIS) End of Flush Interrupt Status Bit */ +#define XDMAC_CIS_RBEIS (0x1u << 4) /**< \brief (XDMAC_CIS) Read Bus Error Interrupt Status Bit */ +#define XDMAC_CIS_WBEIS (0x1u << 5) /**< \brief (XDMAC_CIS) Write Bus Error Interrupt Status Bit */ +#define XDMAC_CIS_ROIS (0x1u << 6) /**< \brief (XDMAC_CIS) Request Overflow Error Interrupt Status Bit */ +/* -------- XDMAC_CSA : (XDMAC Offset: N/A) Channel Source Address Register -------- */ +#define XDMAC_CSA_SA_Pos 0 +#define XDMAC_CSA_SA_Msk (0xffffffffu << XDMAC_CSA_SA_Pos) /**< \brief (XDMAC_CSA) Channel x Source Address */ +#define XDMAC_CSA_SA(value) ((XDMAC_CSA_SA_Msk & ((value) << XDMAC_CSA_SA_Pos))) +/* -------- XDMAC_CDA : (XDMAC Offset: N/A) Channel Destination Address Register -------- */ +#define XDMAC_CDA_DA_Pos 0 +#define XDMAC_CDA_DA_Msk (0xffffffffu << XDMAC_CDA_DA_Pos) /**< \brief (XDMAC_CDA) Channel x Destination Address */ +#define XDMAC_CDA_DA(value) ((XDMAC_CDA_DA_Msk & ((value) << XDMAC_CDA_DA_Pos))) +/* -------- XDMAC_CNDA : (XDMAC Offset: N/A) Channel Next Descriptor Address Register -------- */ +#define XDMAC_CNDA_NDAIF (0x1u << 0) /**< \brief (XDMAC_CNDA) Channel x Next Descriptor Interface */ +#define XDMAC_CNDA_NDA_Pos 2 +#define XDMAC_CNDA_NDA_Msk (0x3fffffffu << XDMAC_CNDA_NDA_Pos) /**< \brief (XDMAC_CNDA) Channel x Next Descriptor Address */ +#define XDMAC_CNDA_NDA(value) ((XDMAC_CNDA_NDA_Msk & ((value) << XDMAC_CNDA_NDA_Pos))) +/* -------- XDMAC_CNDC : (XDMAC Offset: N/A) Channel Next Descriptor Control Register -------- */ +#define XDMAC_CNDC_NDE (0x1u << 0) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor Enable */ +#define XDMAC_CNDC_NDE_DSCR_FETCH_DIS (0x0u << 0) /**< \brief (XDMAC_CNDC) Descriptor fetch is disabled. */ +#define XDMAC_CNDC_NDE_DSCR_FETCH_EN (0x1u << 0) /**< \brief (XDMAC_CNDC) Descriptor fetch is enabled. */ +#define XDMAC_CNDC_NDSUP (0x1u << 1) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor Source Update */ +#define XDMAC_CNDC_NDSUP_SRC_PARAMS_UNCHANGED (0x0u << 1) /**< \brief (XDMAC_CNDC) Source parameters remain unchanged. */ +#define XDMAC_CNDC_NDSUP_SRC_PARAMS_UPDATED (0x1u << 1) /**< \brief (XDMAC_CNDC) Source parameters are updated when the descriptor is retrieved. */ +#define XDMAC_CNDC_NDDUP (0x1u << 2) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor Destination Update */ +#define XDMAC_CNDC_NDDUP_DST_PARAMS_UNCHANGED (0x0u << 2) /**< \brief (XDMAC_CNDC) Destination parameters remain unchanged. */ +#define XDMAC_CNDC_NDDUP_DST_PARAMS_UPDATED (0x1u << 2) /**< \brief (XDMAC_CNDC) Destination parameters are updated when the descriptor is retrieved. */ +#define XDMAC_CNDC_NDVIEW_Pos 3 +#define XDMAC_CNDC_NDVIEW_Msk (0x3u << XDMAC_CNDC_NDVIEW_Pos) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor View */ +#define XDMAC_CNDC_NDVIEW(value) ((XDMAC_CNDC_NDVIEW_Msk & ((value) << XDMAC_CNDC_NDVIEW_Pos))) +#define XDMAC_CNDC_NDVIEW_NDV0 (0x0u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 0 */ +#define XDMAC_CNDC_NDVIEW_NDV1 (0x1u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 1 */ +#define XDMAC_CNDC_NDVIEW_NDV2 (0x2u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 2 */ +#define XDMAC_CNDC_NDVIEW_NDV3 (0x3u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 3 */ +/* -------- XDMAC_CUBC : (XDMAC Offset: N/A) Channel Microblock Control Register -------- */ +#define XDMAC_CUBC_UBLEN_Pos 0 +#define XDMAC_CUBC_UBLEN_Msk (0xffffffu << XDMAC_CUBC_UBLEN_Pos) /**< \brief (XDMAC_CUBC) Channel x Microblock Length */ +#define XDMAC_CUBC_UBLEN(value) ((XDMAC_CUBC_UBLEN_Msk & ((value) << XDMAC_CUBC_UBLEN_Pos))) +/* -------- XDMAC_CBC : (XDMAC Offset: N/A) Channel Block Control Register -------- */ +#define XDMAC_CBC_BLEN_Pos 0 +#define XDMAC_CBC_BLEN_Msk (0xfffu << XDMAC_CBC_BLEN_Pos) /**< \brief (XDMAC_CBC) Channel x Block Length */ +#define XDMAC_CBC_BLEN(value) ((XDMAC_CBC_BLEN_Msk & ((value) << XDMAC_CBC_BLEN_Pos))) +/* -------- XDMAC_CC : (XDMAC Offset: N/A) Channel Configuration Register -------- */ +#define XDMAC_CC_TYPE (0x1u << 0) /**< \brief (XDMAC_CC) Channel x Transfer Type */ +#define XDMAC_CC_TYPE_MEM_TRAN (0x0u << 0) /**< \brief (XDMAC_CC) Self triggered mode (Memory to Memory Transfer). */ +#define XDMAC_CC_TYPE_PER_TRAN (0x1u << 0) /**< \brief (XDMAC_CC) Synchronized mode (Peripheral to Memory or Memory to Peripheral Transfer). */ +#define XDMAC_CC_MBSIZE_Pos 1 +#define XDMAC_CC_MBSIZE_Msk (0x3u << XDMAC_CC_MBSIZE_Pos) /**< \brief (XDMAC_CC) Channel x Memory Burst Size */ +#define XDMAC_CC_MBSIZE(value) ((XDMAC_CC_MBSIZE_Msk & ((value) << XDMAC_CC_MBSIZE_Pos))) +#define XDMAC_CC_MBSIZE_SINGLE (0x0u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to one. */ +#define XDMAC_CC_MBSIZE_FOUR (0x1u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to four. */ +#define XDMAC_CC_MBSIZE_EIGHT (0x2u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to eight. */ +#define XDMAC_CC_MBSIZE_SIXTEEN (0x3u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to sixteen. */ +#define XDMAC_CC_DSYNC (0x1u << 4) /**< \brief (XDMAC_CC) Channel x Synchronization */ +#define XDMAC_CC_DSYNC_PER2MEM (0x0u << 4) /**< \brief (XDMAC_CC) Peripheral to Memory transfer. */ +#define XDMAC_CC_DSYNC_MEM2PER (0x1u << 4) /**< \brief (XDMAC_CC) Memory to Peripheral transfer. */ +#define XDMAC_CC_PROT (0x1u << 5) /**< \brief (XDMAC_CC) Channel x Protection */ +#define XDMAC_CC_PROT_SEC (0x0u << 5) /**< \brief (XDMAC_CC) Channel is secured. */ +#define XDMAC_CC_PROT_UNSEC (0x1u << 5) /**< \brief (XDMAC_CC) Channel is unsecured. */ +#define XDMAC_CC_SWREQ (0x1u << 6) /**< \brief (XDMAC_CC) Channel x Software Request Trigger */ +#define XDMAC_CC_SWREQ_HWR_CONNECTED (0x0u << 6) /**< \brief (XDMAC_CC) Hardware request line is connected to the peripheral request line. */ +#define XDMAC_CC_SWREQ_SWR_CONNECTED (0x1u << 6) /**< \brief (XDMAC_CC) Software request is connected to the peripheral request line. */ +#define XDMAC_CC_MEMSET (0x1u << 7) /**< \brief (XDMAC_CC) Channel x Fill Block of memory */ +#define XDMAC_CC_MEMSET_NORMAL_MODE (0x0u << 7) /**< \brief (XDMAC_CC) Memset is not activated. */ +#define XDMAC_CC_MEMSET_HW_MODE (0x1u << 7) /**< \brief (XDMAC_CC) Sets the block of memory pointed by DA field to the specified value. This operation is performed on 8, 16 or 32 bits basis. */ +#define XDMAC_CC_CSIZE_Pos 8 +#define XDMAC_CC_CSIZE_Msk (0x7u << XDMAC_CC_CSIZE_Pos) /**< \brief (XDMAC_CC) Channel x Chunk Size */ +#define XDMAC_CC_CSIZE(value) ((XDMAC_CC_CSIZE_Msk & ((value) << XDMAC_CC_CSIZE_Pos))) +#define XDMAC_CC_CSIZE_CHK_1 (0x0u << 8) /**< \brief (XDMAC_CC) 1 data transferred */ +#define XDMAC_CC_CSIZE_CHK_2 (0x1u << 8) /**< \brief (XDMAC_CC) 2 data transferred */ +#define XDMAC_CC_CSIZE_CHK_4 (0x2u << 8) /**< \brief (XDMAC_CC) 4 data transferred */ +#define XDMAC_CC_CSIZE_CHK_8 (0x3u << 8) /**< \brief (XDMAC_CC) 8 data transferred */ +#define XDMAC_CC_CSIZE_CHK_16 (0x4u << 8) /**< \brief (XDMAC_CC) 16 data transferred */ +#define XDMAC_CC_DWIDTH_Pos 11 +#define XDMAC_CC_DWIDTH_Msk (0x3u << XDMAC_CC_DWIDTH_Pos) /**< \brief (XDMAC_CC) Channel x Data Width */ +#define XDMAC_CC_DWIDTH(value) ((XDMAC_CC_DWIDTH_Msk & ((value) << XDMAC_CC_DWIDTH_Pos))) +#define XDMAC_CC_DWIDTH_BYTE (0x0u << 11) /**< \brief (XDMAC_CC) The data size is set to 8 bits */ +#define XDMAC_CC_DWIDTH_HALFWORD (0x1u << 11) /**< \brief (XDMAC_CC) The data size is set to 16 bits */ +#define XDMAC_CC_DWIDTH_WORD (0x2u << 11) /**< \brief (XDMAC_CC) The data size is set to 32 bits */ +#define XDMAC_CC_DWIDTH_DWORD (0x3u << 11) /**< \brief (XDMAC_CC) The data size is set to 64 bits */ +#define XDMAC_CC_SIF (0x1u << 13) /**< \brief (XDMAC_CC) Channel x Source Interface Identifier */ +#define XDMAC_CC_SIF_AHB_IF0 (0x0u << 13) /**< \brief (XDMAC_CC) The data is read through the system bus interface 0. */ +#define XDMAC_CC_SIF_AHB_IF1 (0x1u << 13) /**< \brief (XDMAC_CC) The data is read through the system bus interface 1. */ +#define XDMAC_CC_DIF (0x1u << 14) /**< \brief (XDMAC_CC) Channel x Destination Interface Identifier */ +#define XDMAC_CC_DIF_AHB_IF0 (0x0u << 14) /**< \brief (XDMAC_CC) The data is written through the system bus interface 0. */ +#define XDMAC_CC_DIF_AHB_IF1 (0x1u << 14) /**< \brief (XDMAC_CC) The data is written though the system bus interface 1. */ +#define XDMAC_CC_SAM_Pos 16 +#define XDMAC_CC_SAM_Msk (0x3u << XDMAC_CC_SAM_Pos) /**< \brief (XDMAC_CC) Channel x Source Addressing Mode */ +#define XDMAC_CC_SAM(value) ((XDMAC_CC_SAM_Msk & ((value) << XDMAC_CC_SAM_Pos))) +#define XDMAC_CC_SAM_FIXED_AM (0x0u << 16) /**< \brief (XDMAC_CC) The address remains unchanged. */ +#define XDMAC_CC_SAM_INCREMENTED_AM (0x1u << 16) /**< \brief (XDMAC_CC) The addressing mode is incremented (the increment size is set to the data size). */ +#define XDMAC_CC_SAM_UBS_AM (0x2u << 16) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary. */ +#define XDMAC_CC_SAM_UBS_DS_AM (0x3u << 16) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary, the data stride is added at the data boundary. */ +#define XDMAC_CC_DAM_Pos 18 +#define XDMAC_CC_DAM_Msk (0x3u << XDMAC_CC_DAM_Pos) /**< \brief (XDMAC_CC) Channel x Destination Addressing Mode */ +#define XDMAC_CC_DAM(value) ((XDMAC_CC_DAM_Msk & ((value) << XDMAC_CC_DAM_Pos))) +#define XDMAC_CC_DAM_FIXED_AM (0x0u << 18) /**< \brief (XDMAC_CC) The address remains unchanged. */ +#define XDMAC_CC_DAM_INCREMENTED_AM (0x1u << 18) /**< \brief (XDMAC_CC) The addressing mode is incremented (the increment size is set to the data size). */ +#define XDMAC_CC_DAM_UBS_AM (0x2u << 18) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary. */ +#define XDMAC_CC_DAM_UBS_DS_AM (0x3u << 18) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary, the data stride is added at the data boundary. */ +#define XDMAC_CC_INITD (0x1u << 21) /**< \brief (XDMAC_CC) Channel Initialization Terminated (this bit is read-only) */ +#define XDMAC_CC_INITD_TERMINATED (0x0u << 21) /**< \brief (XDMAC_CC) Channel initialization is in progress. */ +#define XDMAC_CC_INITD_IN_PROGRESS (0x1u << 21) /**< \brief (XDMAC_CC) Channel initialization is completed. */ +#define XDMAC_CC_RDIP (0x1u << 22) /**< \brief (XDMAC_CC) Read in Progress (this bit is read-only) */ +#define XDMAC_CC_RDIP_DONE (0x0u << 22) /**< \brief (XDMAC_CC) No Active read transaction on the bus. */ +#define XDMAC_CC_RDIP_IN_PROGRESS (0x1u << 22) /**< \brief (XDMAC_CC) A read transaction is in progress. */ +#define XDMAC_CC_WRIP (0x1u << 23) /**< \brief (XDMAC_CC) Write in Progress (this bit is read-only) */ +#define XDMAC_CC_WRIP_DONE (0x0u << 23) /**< \brief (XDMAC_CC) No Active write transaction on the bus. */ +#define XDMAC_CC_WRIP_IN_PROGRESS (0x1u << 23) /**< \brief (XDMAC_CC) A Write transaction is in progress. */ +#define XDMAC_CC_PERID_Pos 24 +#define XDMAC_CC_PERID_Msk (0x7fu << XDMAC_CC_PERID_Pos) /**< \brief (XDMAC_CC) Channel x Peripheral Identifier */ +#define XDMAC_CC_PERID(value) ((XDMAC_CC_PERID_Msk & ((value) << XDMAC_CC_PERID_Pos))) +/* -------- XDMAC_CDS_MSP : (XDMAC Offset: N/A) Channel Data Stride Memory Set Pattern -------- */ +#define XDMAC_CDS_MSP_SDS_MSP_Pos 0 +#define XDMAC_CDS_MSP_SDS_MSP_Msk (0xffffu << XDMAC_CDS_MSP_SDS_MSP_Pos) /**< \brief (XDMAC_CDS_MSP) Channel x Source Data stride or Memory Set Pattern */ +#define XDMAC_CDS_MSP_SDS_MSP(value) ((XDMAC_CDS_MSP_SDS_MSP_Msk & ((value) << XDMAC_CDS_MSP_SDS_MSP_Pos))) +#define XDMAC_CDS_MSP_DDS_MSP_Pos 16 +#define XDMAC_CDS_MSP_DDS_MSP_Msk (0xffffu << XDMAC_CDS_MSP_DDS_MSP_Pos) /**< \brief (XDMAC_CDS_MSP) Channel x Destination Data Stride or Memory Set Pattern */ +#define XDMAC_CDS_MSP_DDS_MSP(value) ((XDMAC_CDS_MSP_DDS_MSP_Msk & ((value) << XDMAC_CDS_MSP_DDS_MSP_Pos))) +/* -------- XDMAC_CSUS : (XDMAC Offset: N/A) Channel Source Microblock Stride -------- */ +#define XDMAC_CSUS_SUBS_Pos 0 +#define XDMAC_CSUS_SUBS_Msk (0xffffffu << XDMAC_CSUS_SUBS_Pos) /**< \brief (XDMAC_CSUS) Channel x Source Microblock Stride */ +#define XDMAC_CSUS_SUBS(value) ((XDMAC_CSUS_SUBS_Msk & ((value) << XDMAC_CSUS_SUBS_Pos))) +/* -------- XDMAC_CDUS : (XDMAC Offset: N/A) Channel Destination Microblock Stride -------- */ +#define XDMAC_CDUS_DUBS_Pos 0 +#define XDMAC_CDUS_DUBS_Msk (0xffffffu << XDMAC_CDUS_DUBS_Pos) /**< \brief (XDMAC_CDUS) Channel x Destination Microblock Stride */ +#define XDMAC_CDUS_DUBS(value) ((XDMAC_CDUS_DUBS_Msk & ((value) << XDMAC_CDUS_DUBS_Pos))) +/* -------- XDMAC_VERSION : (XDMAC Offset: 0xFFC) XDMAC Version Register -------- */ +#define XDMAC_VERSION_VERSION_Pos 0 +#define XDMAC_VERSION_VERSION_Msk (0xfffu << XDMAC_VERSION_VERSION_Pos) /**< \brief (XDMAC_VERSION) Version of the Hardware Module */ +#define XDMAC_VERSION_VERSION(value) ((XDMAC_VERSION_VERSION_Msk & ((value) << XDMAC_VERSION_VERSION_Pos))) +#define XDMAC_VERSION_MFN_Pos 16 +#define XDMAC_VERSION_MFN_Msk (0x7u << XDMAC_VERSION_MFN_Pos) /**< \brief (XDMAC_VERSION) Metal Fix Number */ +#define XDMAC_VERSION_MFN(value) ((XDMAC_VERSION_MFN_Msk & ((value) << XDMAC_VERSION_MFN_Pos))) + +/*@}*/ + + +#endif /* _SAMA5D2_XDMAC_COMPONENT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d21.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d21.h new file mode 100644 index 000000000..26dda262e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d21.h @@ -0,0 +1,816 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D21_PIO_ +#define _SAMA5D21_PIO_ + +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA30E_SDMMC0_CD (1u << 30) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA27E_SDMMC0_RSTN (1u << 27) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA22E_SDMMC0_CK (1u << 22) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA28E_SDMMC0_CMD (1u << 28) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA29E_SDMMC0_WP (1u << 29) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA18E_SDMMC0_DAT0 (1u << 18) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA19E_SDMMC0_DAT1 (1u << 19) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA20E_SDMMC0_DAT2 (1u << 20) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA21E_SDMMC0_DAT3 (1u << 21) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 + +#endif /* _SAMA5D21_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d22.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d22.h new file mode 100644 index 000000000..87de6e3f3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d22.h @@ -0,0 +1,819 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D22_PIO_ +#define _SAMA5D22_PIO_ + +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for MCAN0 peripheral ========== */ +#define PIO_PC2C_CANRX0 (1u << 2) /**< \brief Mcan0 signal: CANRX0 */ +#define PIO_PC1C_CANTX0 (1u << 1) /**< \brief Mcan0 signal: CANTX0 */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA30E_SDMMC0_CD (1u << 30) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA27E_SDMMC0_RSTN (1u << 27) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA22E_SDMMC0_CK (1u << 22) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA28E_SDMMC0_CMD (1u << 28) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA29E_SDMMC0_WP (1u << 29) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA18E_SDMMC0_DAT0 (1u << 18) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA19E_SDMMC0_DAT1 (1u << 19) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA20E_SDMMC0_DAT2 (1u << 20) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA21E_SDMMC0_DAT3 (1u << 21) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 + +#endif /* _SAMA5D22_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d23.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d23.h new file mode 100644 index 000000000..5b94d4ebf --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d23.h @@ -0,0 +1,819 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D23_PIO_ +#define _SAMA5D23_PIO_ + +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for MCAN0 peripheral ========== */ +#define PIO_PC2C_CANRX0 (1u << 2) /**< \brief Mcan0 signal: CANRX0 */ +#define PIO_PC1C_CANTX0 (1u << 1) /**< \brief Mcan0 signal: CANTX0 */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA30E_SDMMC0_CD (1u << 30) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA27E_SDMMC0_RSTN (1u << 27) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA22E_SDMMC0_CK (1u << 22) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA28E_SDMMC0_CMD (1u << 28) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA29E_SDMMC0_WP (1u << 29) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA18E_SDMMC0_DAT0 (1u << 18) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA19E_SDMMC0_DAT1 (1u << 19) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA20E_SDMMC0_DAT2 (1u << 20) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA21E_SDMMC0_DAT3 (1u << 21) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 + +#endif /* _SAMA5D23_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d24.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d24.h new file mode 100644 index 000000000..f0c4acc60 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d24.h @@ -0,0 +1,908 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D24_PIO_ +#define _SAMA5D24_PIO_ + +#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ +#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ +#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ +#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ +#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ +#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ +#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ +#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ +#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ +#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ +#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ +#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ +#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ +#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ +#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ +#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ +#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ +#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ +#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ +#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ +#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ +#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ +#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ +#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ +#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ +#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ +#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ +#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ +#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ +#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ +#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM2 peripheral ========== */ +#define PIO_PA6E_FLEXCOM2_IO0 (1u << 6) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PD26C_FLEXCOM2_IO0 (1u << 26) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PA7E_FLEXCOM2_IO1 (1u << 7) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PD27C_FLEXCOM2_IO1 (1u << 27) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PA8E_FLEXCOM2_IO2 (1u << 8) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PD28C_FLEXCOM2_IO2 (1u << 28) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PA9E_FLEXCOM2_IO3 (1u << 9) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PD29C_FLEXCOM2_IO3 (1u << 29) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PA10E_FLEXCOM2_IO4 (1u << 10) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +#define PIO_PD30C_FLEXCOM2_IO4 (1u << 30) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA13A_SDMMC0_CD (1u << 13) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA11A_SDMMC0_VDDSEL (1u << 11)/**< \brief Sdmmc0 signal: SDMMC0_VDDSEL */ +#define PIO_PA10A_SDMMC0_RSTN (1u << 10) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA0A_SDMMC0_CK (1u << 0) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA1A_SDMMC0_CMD (1u << 1) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA12A_SDMMC0_WP (1u << 12) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA2A_SDMMC0_DAT0 (1u << 2) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA3A_SDMMC0_DAT1 (1u << 3) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA4A_SDMMC0_DAT2 (1u << 4) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA5A_SDMMC0_DAT3 (1u << 5) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +#define PIO_PA6A_SDMMC0_DAT4 (1u << 6) /**< \brief Sdmmc0 signal: SDMMC0_DAT4 */ +#define PIO_PA7A_SDMMC0_DAT5 (1u << 7) /**< \brief Sdmmc0 signal: SDMMC0_DAT5 */ +#define PIO_PA8A_SDMMC0_DAT6 (1u << 8) /**< \brief Sdmmc0 signal: SDMMC0_DAT6 */ +#define PIO_PA9A_SDMMC0_DAT7 (1u << 9) /**< \brief Sdmmc0 signal: SDMMC0_DAT7 */ +/* ========== Pio definition for SDMMC1 peripheral ========== */ +#define PIO_PA30E_SDMMC1_CD (1u << 30) /**< \brief Sdmmc1 signal: SDMMC1_CD */ +#define PIO_PA27E_SDMMC1_RSTN (1u << 27) /**< \brief Sdmmc1 signal: SDMMC1_RSTN */ +#define PIO_PA22E_SDMMC1_CK (1u << 22) /**< \brief Sdmmc1 signal: SDMMC1_CK */ +#define PIO_PA28E_SDMMC1_CMD (1u << 28) /**< \brief Sdmmc1 signal: SDMMC1_CMD */ +#define PIO_PA29E_SDMMC1_WP (1u << 29) /**< \brief Sdmmc1 signal: SDMMC1_WP */ +#define PIO_PA18E_SDMMC1_DAT0 (1u << 18) /**< \brief Sdmmc1 signal: SDMMC1_DAT0 */ +#define PIO_PA19E_SDMMC1_DAT1 (1u << 19) /**< \brief Sdmmc1 signal: SDMMC1_DAT1 */ +#define PIO_PA20E_SDMMC1_DAT2 (1u << 20) /**< \brief Sdmmc1 signal: SDMMC1_DAT2 */ +#define PIO_PA21E_SDMMC1_DAT3 (1u << 21) /**< \brief Sdmmc1 signal: SDMMC1_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA0_IDX 0 +#define PIO_PA1_IDX 1 +#define PIO_PA2_IDX 2 +#define PIO_PA3_IDX 3 +#define PIO_PA4_IDX 4 +#define PIO_PA5_IDX 5 +#define PIO_PA6_IDX 6 +#define PIO_PA7_IDX 7 +#define PIO_PA8_IDX 8 +#define PIO_PA9_IDX 9 +#define PIO_PA10_IDX 10 +#define PIO_PA11_IDX 11 +#define PIO_PA12_IDX 12 +#define PIO_PA13_IDX 13 +#define PIO_PA14_IDX 14 +#define PIO_PA15_IDX 15 +#define PIO_PA16_IDX 16 +#define PIO_PA17_IDX 17 +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PD0_IDX 96 +#define PIO_PD1_IDX 97 +#define PIO_PD2_IDX 98 +#define PIO_PD3_IDX 99 +#define PIO_PD4_IDX 100 +#define PIO_PD5_IDX 101 +#define PIO_PD6_IDX 102 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 +#define PIO_PD24_IDX 120 +#define PIO_PD25_IDX 121 +#define PIO_PD26_IDX 122 +#define PIO_PD27_IDX 123 +#define PIO_PD28_IDX 124 +#define PIO_PD29_IDX 125 +#define PIO_PD30_IDX 126 +#define PIO_PD31_IDX 127 + +#endif /* _SAMA5D24_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d26.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d26.h new file mode 100644 index 000000000..dfb6de1a0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d26.h @@ -0,0 +1,954 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D26_PIO_ +#define _SAMA5D26_PIO_ + +#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ +#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ +#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ +#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ +#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ +#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ +#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ +#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ +#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ +#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ +#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ +#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ +#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ +#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ +#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ +#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ +#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ +#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */ +#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */ +#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */ +#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */ +#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */ +#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */ +#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */ +#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */ +#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */ +#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */ +#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */ +#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */ +#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */ +#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */ +#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */ +#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */ +#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */ +#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */ +#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */ +#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */ +#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */ +#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */ +#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */ +#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ +#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ +#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ +#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ +#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ +#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ +#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ +#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ +#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ +#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ +#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ +#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ +#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ +#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM2 peripheral ========== */ +#define PIO_PA6E_FLEXCOM2_IO0 (1u << 6) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PD26C_FLEXCOM2_IO0 (1u << 26) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PA7E_FLEXCOM2_IO1 (1u << 7) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PD27C_FLEXCOM2_IO1 (1u << 27) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PA8E_FLEXCOM2_IO2 (1u << 8) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PD28C_FLEXCOM2_IO2 (1u << 28) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PA9E_FLEXCOM2_IO3 (1u << 9) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PD29C_FLEXCOM2_IO3 (1u << 29) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PA10E_FLEXCOM2_IO4 (1u << 10) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +#define PIO_PD30C_FLEXCOM2_IO4 (1u << 30) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA13A_SDMMC0_CD (1u << 13) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA11A_SDMMC0_VDDSEL (1u << 11)/**< \brief Sdmmc0 signal: SDMMC0_VDDSEL */ +#define PIO_PA10A_SDMMC0_RSTN (1u << 10) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA0A_SDMMC0_CK (1u << 0) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA1A_SDMMC0_CMD (1u << 1) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA12A_SDMMC0_WP (1u << 12) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA2A_SDMMC0_DAT0 (1u << 2) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA3A_SDMMC0_DAT1 (1u << 3) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA4A_SDMMC0_DAT2 (1u << 4) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA5A_SDMMC0_DAT3 (1u << 5) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +#define PIO_PA6A_SDMMC0_DAT4 (1u << 6) /**< \brief Sdmmc0 signal: SDMMC0_DAT4 */ +#define PIO_PA7A_SDMMC0_DAT5 (1u << 7) /**< \brief Sdmmc0 signal: SDMMC0_DAT5 */ +#define PIO_PA8A_SDMMC0_DAT6 (1u << 8) /**< \brief Sdmmc0 signal: SDMMC0_DAT6 */ +#define PIO_PA9A_SDMMC0_DAT7 (1u << 9) /**< \brief Sdmmc0 signal: SDMMC0_DAT7 */ +/* ========== Pio definition for SDMMC1 peripheral ========== */ +#define PIO_PA30E_SDMMC1_CD (1u << 30) /**< \brief Sdmmc1 signal: SDMMC1_CD */ +#define PIO_PA27E_SDMMC1_RSTN (1u << 27) /**< \brief Sdmmc1 signal: SDMMC1_RSTN */ +#define PIO_PA22E_SDMMC1_CK (1u << 22) /**< \brief Sdmmc1 signal: SDMMC1_CK */ +#define PIO_PA28E_SDMMC1_CMD (1u << 28) /**< \brief Sdmmc1 signal: SDMMC1_CMD */ +#define PIO_PA29E_SDMMC1_WP (1u << 29) /**< \brief Sdmmc1 signal: SDMMC1_WP */ +#define PIO_PA18E_SDMMC1_DAT0 (1u << 18) /**< \brief Sdmmc1 signal: SDMMC1_DAT0 */ +#define PIO_PA19E_SDMMC1_DAT1 (1u << 19) /**< \brief Sdmmc1 signal: SDMMC1_DAT1 */ +#define PIO_PA20E_SDMMC1_DAT2 (1u << 20) /**< \brief Sdmmc1 signal: SDMMC1_DAT2 */ +#define PIO_PA21E_SDMMC1_DAT3 (1u << 21) /**< \brief Sdmmc1 signal: SDMMC1_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA0_IDX 0 +#define PIO_PA1_IDX 1 +#define PIO_PA2_IDX 2 +#define PIO_PA3_IDX 3 +#define PIO_PA4_IDX 4 +#define PIO_PA5_IDX 5 +#define PIO_PA6_IDX 6 +#define PIO_PA7_IDX 7 +#define PIO_PA8_IDX 8 +#define PIO_PA9_IDX 9 +#define PIO_PA10_IDX 10 +#define PIO_PA11_IDX 11 +#define PIO_PA12_IDX 12 +#define PIO_PA13_IDX 13 +#define PIO_PA14_IDX 14 +#define PIO_PA15_IDX 15 +#define PIO_PA16_IDX 16 +#define PIO_PA17_IDX 17 +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PC9_IDX 73 +#define PIO_PC10_IDX 74 +#define PIO_PC11_IDX 75 +#define PIO_PC12_IDX 76 +#define PIO_PC13_IDX 77 +#define PIO_PC14_IDX 78 +#define PIO_PC15_IDX 79 +#define PIO_PC16_IDX 80 +#define PIO_PC17_IDX 81 +#define PIO_PC18_IDX 82 +#define PIO_PC19_IDX 83 +#define PIO_PC20_IDX 84 +#define PIO_PC21_IDX 85 +#define PIO_PC22_IDX 86 +#define PIO_PC23_IDX 87 +#define PIO_PC24_IDX 88 +#define PIO_PC25_IDX 89 +#define PIO_PC26_IDX 90 +#define PIO_PC27_IDX 91 +#define PIO_PC28_IDX 92 +#define PIO_PC29_IDX 93 +#define PIO_PC30_IDX 94 +#define PIO_PC31_IDX 95 +#define PIO_PD0_IDX 96 +#define PIO_PD1_IDX 97 +#define PIO_PD2_IDX 98 +#define PIO_PD3_IDX 99 +#define PIO_PD4_IDX 100 +#define PIO_PD5_IDX 101 +#define PIO_PD6_IDX 102 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 +#define PIO_PD24_IDX 120 +#define PIO_PD25_IDX 121 +#define PIO_PD26_IDX 122 +#define PIO_PD27_IDX 123 +#define PIO_PD28_IDX 124 +#define PIO_PD29_IDX 125 +#define PIO_PD30_IDX 126 +#define PIO_PD31_IDX 127 + +#endif /* _SAMA5D26_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d27.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d27.h new file mode 100644 index 000000000..dfc0f53eb --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d27.h @@ -0,0 +1,962 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D27_PIO_ +#define _SAMA5D27_PIO_ + +#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ +#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ +#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ +#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ +#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ +#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ +#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ +#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ +#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ +#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ +#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ +#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ +#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ +#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ +#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ +#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ +#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ +#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */ +#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */ +#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */ +#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */ +#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */ +#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */ +#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */ +#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */ +#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */ +#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */ +#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */ +#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */ +#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */ +#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */ +#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */ +#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */ +#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */ +#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */ +#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */ +#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */ +#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */ +#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */ +#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */ +#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ +#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ +#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ +#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ +#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ +#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ +#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ +#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ +#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ +#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ +#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ +#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ +#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ +#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM2 peripheral ========== */ +#define PIO_PA6E_FLEXCOM2_IO0 (1u << 6) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PD26C_FLEXCOM2_IO0 (1u << 26) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PA7E_FLEXCOM2_IO1 (1u << 7) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PD27C_FLEXCOM2_IO1 (1u << 27) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PA8E_FLEXCOM2_IO2 (1u << 8) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PD28C_FLEXCOM2_IO2 (1u << 28) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PA9E_FLEXCOM2_IO3 (1u << 9) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PD29C_FLEXCOM2_IO3 (1u << 29) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PA10E_FLEXCOM2_IO4 (1u << 10) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +#define PIO_PD30C_FLEXCOM2_IO4 (1u << 30) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for MCAN0 peripheral ========== */ +#define PIO_PC2C_CANRX0 (1u << 2) /**< \brief Mcan0 signal: CANRX0 */ +#define PIO_PC11E_CANRX0 (1u << 11) /**< \brief Mcan0 signal: CANRX0 */ +#define PIO_PC1C_CANTX0 (1u << 1) /**< \brief Mcan0 signal: CANTX0 */ +#define PIO_PC10E_CANTX0 (1u << 10) /**< \brief Mcan0 signal: CANTX0 */ +/* ========== Pio definition for MCAN1 peripheral ========== */ +#define PIO_PC27D_CANRX1 (1u << 27) /**< \brief Mcan1 signal: CANRX1 */ +#define PIO_PC26D_CANTX1 (1u << 26) /**< \brief Mcan1 signal: CANTX1 */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA13A_SDMMC0_CD (1u << 13) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA11A_SDMMC0_VDDSEL (1u << 11)/**< \brief Sdmmc0 signal: SDMMC0_VDDSEL */ +#define PIO_PA10A_SDMMC0_RSTN (1u << 10) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA0A_SDMMC0_CK (1u << 0) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA1A_SDMMC0_CMD (1u << 1) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA12A_SDMMC0_WP (1u << 12) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA2A_SDMMC0_DAT0 (1u << 2) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA3A_SDMMC0_DAT1 (1u << 3) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA4A_SDMMC0_DAT2 (1u << 4) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA5A_SDMMC0_DAT3 (1u << 5) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +#define PIO_PA6A_SDMMC0_DAT4 (1u << 6) /**< \brief Sdmmc0 signal: SDMMC0_DAT4 */ +#define PIO_PA7A_SDMMC0_DAT5 (1u << 7) /**< \brief Sdmmc0 signal: SDMMC0_DAT5 */ +#define PIO_PA8A_SDMMC0_DAT6 (1u << 8) /**< \brief Sdmmc0 signal: SDMMC0_DAT6 */ +#define PIO_PA9A_SDMMC0_DAT7 (1u << 9) /**< \brief Sdmmc0 signal: SDMMC0_DAT7 */ +/* ========== Pio definition for SDMMC1 peripheral ========== */ +#define PIO_PA30E_SDMMC1_CD (1u << 30) /**< \brief Sdmmc1 signal: SDMMC1_CD */ +#define PIO_PA27E_SDMMC1_RSTN (1u << 27) /**< \brief Sdmmc1 signal: SDMMC1_RSTN */ +#define PIO_PA22E_SDMMC1_CK (1u << 22) /**< \brief Sdmmc1 signal: SDMMC1_CK */ +#define PIO_PA28E_SDMMC1_CMD (1u << 28) /**< \brief Sdmmc1 signal: SDMMC1_CMD */ +#define PIO_PA29E_SDMMC1_WP (1u << 29) /**< \brief Sdmmc1 signal: SDMMC1_WP */ +#define PIO_PA18E_SDMMC1_DAT0 (1u << 18) /**< \brief Sdmmc1 signal: SDMMC1_DAT0 */ +#define PIO_PA19E_SDMMC1_DAT1 (1u << 19) /**< \brief Sdmmc1 signal: SDMMC1_DAT1 */ +#define PIO_PA20E_SDMMC1_DAT2 (1u << 20) /**< \brief Sdmmc1 signal: SDMMC1_DAT2 */ +#define PIO_PA21E_SDMMC1_DAT3 (1u << 21) /**< \brief Sdmmc1 signal: SDMMC1_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA0_IDX 0 +#define PIO_PA1_IDX 1 +#define PIO_PA2_IDX 2 +#define PIO_PA3_IDX 3 +#define PIO_PA4_IDX 4 +#define PIO_PA5_IDX 5 +#define PIO_PA6_IDX 6 +#define PIO_PA7_IDX 7 +#define PIO_PA8_IDX 8 +#define PIO_PA9_IDX 9 +#define PIO_PA10_IDX 10 +#define PIO_PA11_IDX 11 +#define PIO_PA12_IDX 12 +#define PIO_PA13_IDX 13 +#define PIO_PA14_IDX 14 +#define PIO_PA15_IDX 15 +#define PIO_PA16_IDX 16 +#define PIO_PA17_IDX 17 +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PC9_IDX 73 +#define PIO_PC10_IDX 74 +#define PIO_PC11_IDX 75 +#define PIO_PC12_IDX 76 +#define PIO_PC13_IDX 77 +#define PIO_PC14_IDX 78 +#define PIO_PC15_IDX 79 +#define PIO_PC16_IDX 80 +#define PIO_PC17_IDX 81 +#define PIO_PC18_IDX 82 +#define PIO_PC19_IDX 83 +#define PIO_PC20_IDX 84 +#define PIO_PC21_IDX 85 +#define PIO_PC22_IDX 86 +#define PIO_PC23_IDX 87 +#define PIO_PC24_IDX 88 +#define PIO_PC25_IDX 89 +#define PIO_PC26_IDX 90 +#define PIO_PC27_IDX 91 +#define PIO_PC28_IDX 92 +#define PIO_PC29_IDX 93 +#define PIO_PC30_IDX 94 +#define PIO_PC31_IDX 95 +#define PIO_PD0_IDX 96 +#define PIO_PD1_IDX 97 +#define PIO_PD2_IDX 98 +#define PIO_PD3_IDX 99 +#define PIO_PD4_IDX 100 +#define PIO_PD5_IDX 101 +#define PIO_PD6_IDX 102 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 +#define PIO_PD24_IDX 120 +#define PIO_PD25_IDX 121 +#define PIO_PD26_IDX 122 +#define PIO_PD27_IDX 123 +#define PIO_PD28_IDX 124 +#define PIO_PD29_IDX 125 +#define PIO_PD30_IDX 126 +#define PIO_PD31_IDX 127 + +#endif /* _SAMA5D27_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d28.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d28.h new file mode 100644 index 000000000..4e3eb2a37 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/pio/pio_sama5d28.h @@ -0,0 +1,962 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D28_PIO_ +#define _SAMA5D28_PIO_ + +#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ +#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ +#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ +#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ +#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ +#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ +#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ +#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ +#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ +#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ +#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ +#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ +#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ +#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ +#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ +#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ +#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ +#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ +#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ +#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ +#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ +#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ +#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ +#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ +#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ +#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ +#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ +#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ +#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ +#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ +#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ +#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ +#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ +#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ +#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ +#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ +#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ +#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ +#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ +#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ +#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ +#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ +#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ +#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ +#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ +#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ +#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ +#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */ +#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */ +#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */ +#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */ +#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */ +#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */ +#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */ +#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */ +#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */ +#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */ +#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */ +#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */ +#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */ +#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */ +#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */ +#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */ +#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */ +#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ +#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ +#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ +#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ +#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ +#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ +#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ +#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ +#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ +#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */ +#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */ +#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */ +#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */ +#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */ +#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */ +#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */ +#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */ +#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */ +#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */ +#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */ +#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */ +#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */ +#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */ +#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */ +#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */ +#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */ +#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */ +#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */ +#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */ +#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */ +#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */ +#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */ +#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ +#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ +#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ +#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ +#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ +#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ +#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ +#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ +#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ +#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ +#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ +#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ +#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ +#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ +#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ +#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ +#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ +#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ +#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ +#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ +#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ +#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ +#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ +#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ +#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ +#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ +#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ +#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ +#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ +#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ +#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ +#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ +/* ========== Pio definition for ADC peripheral ========== */ +#define PIO_PD19X1_AD0 (1u << 19) /**< \brief Adc signal: AD0 */ +#define PIO_PD20X1_AD1 (1u << 20) /**< \brief Adc signal: AD1 */ +#define PIO_PD29X1_AD10 (1u << 29) /**< \brief Adc signal: AD10 */ +#define PIO_PD30X1_AD11 (1u << 30) /**< \brief Adc signal: AD11 */ +#define PIO_PD21X1_AD2 (1u << 21) /**< \brief Adc signal: AD2 */ +#define PIO_PD22X1_AD3 (1u << 22) /**< \brief Adc signal: AD3 */ +#define PIO_PD23X1_AD4 (1u << 23) /**< \brief Adc signal: AD4 */ +#define PIO_PD24X1_AD5 (1u << 24) /**< \brief Adc signal: AD5 */ +#define PIO_PD25X1_AD6 (1u << 25) /**< \brief Adc signal: AD6 */ +#define PIO_PD26X1_AD7 (1u << 26) /**< \brief Adc signal: AD7 */ +#define PIO_PD27X1_AD8 (1u << 27) /**< \brief Adc signal: AD8 */ +#define PIO_PD28X1_AD9 (1u << 28) /**< \brief Adc signal: AD9 */ +#define PIO_PD31A_ADTRG (1u << 31) /**< \brief Adc signal: ADTRG */ +/* ========== Pio definition for AIC peripheral ========== */ +#define PIO_PB4C_FIQ (1u << 4) /**< \brief Aic signal: FIQ */ +#define PIO_PC8C_FIQ (1u << 8) /**< \brief Aic signal: FIQ */ +#define PIO_PC9A_FIQ (1u << 9) /**< \brief Aic signal: FIQ */ +#define PIO_PD3B_FIQ (1u << 3) /**< \brief Aic signal: FIQ */ +#define PIO_PA12B_IRQ (1u << 12) /**< \brief Aic signal: IRQ */ +#define PIO_PA21A_IRQ (1u << 21) /**< \brief Aic signal: IRQ */ +#define PIO_PB3C_IRQ (1u << 3) /**< \brief Aic signal: IRQ */ +#define PIO_PD31C_IRQ (1u << 31) /**< \brief Aic signal: IRQ */ +/* ========== Pio definition for ARM peripheral ========== */ +#define PIO_PA26C_NTRST (1u << 26) /**< \brief Arm signal: NTRST */ +#define PIO_PD10A_NTRST (1u << 10) /**< \brief Arm signal: NTRST */ +#define PIO_PD18A_NTRST (1u << 18) /**< \brief Arm signal: NTRST */ +#define PIO_PD31B_NTRST (1u << 31) /**< \brief Arm signal: NTRST */ +#define PIO_PA22C_TCK (1u << 22) /**< \brief Arm signal: TCK */ +#define PIO_PD6A_TCK (1u << 6) /**< \brief Arm signal: TCK */ +#define PIO_PD14A_TCK (1u << 14) /**< \brief Arm signal: TCK */ +#define PIO_PD27B_TCK (1u << 27) /**< \brief Arm signal: TCK */ +#define PIO_PA23C_TDI (1u << 23) /**< \brief Arm signal: TDI */ +#define PIO_PD7A_TDI (1u << 7) /**< \brief Arm signal: TDI */ +#define PIO_PD15A_TDI (1u << 15) /**< \brief Arm signal: TDI */ +#define PIO_PD28B_TDI (1u << 28) /**< \brief Arm signal: TDI */ +#define PIO_PA24C_TDO (1u << 24) /**< \brief Arm signal: TDO */ +#define PIO_PD8A_TDO (1u << 8) /**< \brief Arm signal: TDO */ +#define PIO_PD16A_TDO (1u << 16) /**< \brief Arm signal: TDO */ +#define PIO_PD29B_TDO (1u << 29) /**< \brief Arm signal: TDO */ +#define PIO_PA25C_TMS (1u << 25) /**< \brief Arm signal: TMS */ +#define PIO_PD9A_TMS (1u << 9) /**< \brief Arm signal: TMS */ +#define PIO_PD17A_TMS (1u << 17) /**< \brief Arm signal: TMS */ +#define PIO_PD30B_TMS (1u << 30) /**< \brief Arm signal: TMS */ +/* ========== Pio definition for CLASSD peripheral ========== */ +#define PIO_PA28F_CLASSD_L0 (1u << 28) /**< \brief Classd signal: CLASSD_L0 */ +#define PIO_PA29F_CLASSD_L1 (1u << 29) /**< \brief Classd signal: CLASSD_L1 */ +#define PIO_PA30F_CLASSD_L2 (1u << 30) /**< \brief Classd signal: CLASSD_L2 */ +#define PIO_PA31F_CLASSD_L3 (1u << 31) /**< \brief Classd signal: CLASSD_L3 */ +#define PIO_PB1F_CLASSD_R0 (1u << 1) /**< \brief Classd signal: CLASSD_R0 */ +#define PIO_PB2F_CLASSD_R1 (1u << 2) /**< \brief Classd signal: CLASSD_R1 */ +#define PIO_PB3F_CLASSD_R2 (1u << 3) /**< \brief Classd signal: CLASSD_R2 */ +#define PIO_PB4F_CLASSD_R3 (1u << 4) /**< \brief Classd signal: CLASSD_R3 */ +/* ========== Pio definition for EBI peripheral ========== */ +#define PIO_PB11B_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB11B_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_A0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PC11F_NBS0 (1u << 11) /**< \brief Ebi signal: A0/NBS0 */ +#define PIO_PB12B_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PC12F_A1 (1u << 12) /**< \brief Ebi signal: A1 */ +#define PIO_PB21B_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PC21F_A10 (1u << 21) /**< \brief Ebi signal: A10 */ +#define PIO_PB22B_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PC22F_A11 (1u << 22) /**< \brief Ebi signal: A11 */ +#define PIO_PB23B_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PC23F_A12 (1u << 23) /**< \brief Ebi signal: A12 */ +#define PIO_PB24B_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PC24F_A13 (1u << 24) /**< \brief Ebi signal: A13 */ +#define PIO_PB25B_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PC25F_A14 (1u << 25) /**< \brief Ebi signal: A14 */ +#define PIO_PB26B_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PC26F_A15 (1u << 26) /**< \brief Ebi signal: A15 */ +#define PIO_PB27B_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PC27F_A16 (1u << 27) /**< \brief Ebi signal: A16 */ +#define PIO_PB28B_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PC28F_A17 (1u << 28) /**< \brief Ebi signal: A17 */ +#define PIO_PB29B_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PC29F_A18 (1u << 29) /**< \brief Ebi signal: A18 */ +#define PIO_PB30B_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PC30F_A19 (1u << 30) /**< \brief Ebi signal: A19 */ +#define PIO_PB13B_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PC13F_A2 (1u << 13) /**< \brief Ebi signal: A2 */ +#define PIO_PB31B_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PC31F_A20 (1u << 31) /**< \brief Ebi signal: A20 */ +#define PIO_PA10F_A21 (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA10F_NANDALE (1u << 10) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_A21 (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PB0B_NANDALE (1u << 0) /**< \brief Ebi signal: A21/NANDALE */ +#define PIO_PA11F_A22 (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PA11F_NANDCLE (1u << 11) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_A22 (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PB1B_NANDCLE (1u << 1) /**< \brief Ebi signal: A22/NANDCLE */ +#define PIO_PC0B_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PD0F_A23 (1u << 0) /**< \brief Ebi signal: A23 */ +#define PIO_PC1B_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PD1F_A24 (1u << 1) /**< \brief Ebi signal: A24 */ +#define PIO_PC2B_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PD2F_A25 (1u << 2) /**< \brief Ebi signal: A25 */ +#define PIO_PB14B_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PC14F_A3 (1u << 14) /**< \brief Ebi signal: A3 */ +#define PIO_PB15B_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PC15F_A4 (1u << 15) /**< \brief Ebi signal: A4 */ +#define PIO_PB16B_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PC16F_A5 (1u << 16) /**< \brief Ebi signal: A5 */ +#define PIO_PB17B_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PC17F_A6 (1u << 17) /**< \brief Ebi signal: A6 */ +#define PIO_PB18B_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PC18F_A7 (1u << 18) /**< \brief Ebi signal: A7 */ +#define PIO_PB19B_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PC19F_A8 (1u << 19) /**< \brief Ebi signal: A8 */ +#define PIO_PB20B_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PC20F_A9 (1u << 20) /**< \brief Ebi signal: A9 */ +#define PIO_PA0F_D0 (1u << 0) /**< \brief Ebi signal: D0 */ +#define PIO_PA22B_D0 (1u << 22) /**< \brief Ebi signal: D0 */ +#define PIO_PA1F_D1 (1u << 1) /**< \brief Ebi signal: D1 */ +#define PIO_PA23B_D1 (1u << 23) /**< \brief Ebi signal: D1 */ +#define PIO_PA15F_D10 (1u << 15) /**< \brief Ebi signal: D10 */ +#define PIO_PB5B_D10 (1u << 5) /**< \brief Ebi signal: D10 */ +#define PIO_PA16F_D11 (1u << 16) /**< \brief Ebi signal: D11 */ +#define PIO_PB6B_D11 (1u << 6) /**< \brief Ebi signal: D11 */ +#define PIO_PA17F_D12 (1u << 17) /**< \brief Ebi signal: D12 */ +#define PIO_PB7B_D12 (1u << 7) /**< \brief Ebi signal: D12 */ +#define PIO_PA18F_D13 (1u << 18) /**< \brief Ebi signal: D13 */ +#define PIO_PB8B_D13 (1u << 8) /**< \brief Ebi signal: D13 */ +#define PIO_PA19F_D14 (1u << 19) /**< \brief Ebi signal: D14 */ +#define PIO_PB9B_D14 (1u << 9) /**< \brief Ebi signal: D14 */ +#define PIO_PA20F_D15 (1u << 20) /**< \brief Ebi signal: D15 */ +#define PIO_PB10B_D15 (1u << 10) /**< \brief Ebi signal: D15 */ +#define PIO_PA2F_D2 (1u << 2) /**< \brief Ebi signal: D2 */ +#define PIO_PA24B_D2 (1u << 24) /**< \brief Ebi signal: D2 */ +#define PIO_PA3F_D3 (1u << 3) /**< \brief Ebi signal: D3 */ +#define PIO_PA25B_D3 (1u << 25) /**< \brief Ebi signal: D3 */ +#define PIO_PA4F_D4 (1u << 4) /**< \brief Ebi signal: D4 */ +#define PIO_PA26B_D4 (1u << 26) /**< \brief Ebi signal: D4 */ +#define PIO_PA5F_D5 (1u << 5) /**< \brief Ebi signal: D5 */ +#define PIO_PA27B_D5 (1u << 27) /**< \brief Ebi signal: D5 */ +#define PIO_PA6F_D6 (1u << 6) /**< \brief Ebi signal: D6 */ +#define PIO_PA28B_D6 (1u << 28) /**< \brief Ebi signal: D6 */ +#define PIO_PA7F_D7 (1u << 7) /**< \brief Ebi signal: D7 */ +#define PIO_PA29B_D7 (1u << 29) /**< \brief Ebi signal: D7 */ +#define PIO_PA13F_D8 (1u << 13) /**< \brief Ebi signal: D8 */ +#define PIO_PB3B_D8 (1u << 3) /**< \brief Ebi signal: D8 */ +#define PIO_PA14F_D9 (1u << 14) /**< \brief Ebi signal: D9 */ +#define PIO_PB4B_D9 (1u << 4) /**< \brief Ebi signal: D9 */ +#define PIO_PA21F_NANDRDY (1u << 21) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC8B_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PD8F_NANDRDY (1u << 8) /**< \brief Ebi signal: NANDRDY */ +#define PIO_PC5B_NCS0 (1u << 5) /**< \brief Ebi signal: NCS0 */ +#define PIO_PD4F_NCS0 (1u << 4) /**< \brief Ebi signal: NCS0 */ +#define PIO_PC6B_NCS1 (1u << 6) /**< \brief Ebi signal: NCS1 */ +#define PIO_PD5F_NCS1 (1u << 5) /**< \brief Ebi signal: NCS1 */ +#define PIO_PC7B_NCS2 (1u << 7) /**< \brief Ebi signal: NCS2 */ +#define PIO_PD6F_NCS2 (1u << 6) /**< \brief Ebi signal: NCS2 */ +#define PIO_PA9F_NCS3 (1u << 9) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA31B_NCS3 (1u << 31) /**< \brief Ebi signal: NCS3 */ +#define PIO_PA12F_NRD (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PA12F_NANDOE (1u << 12) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NRD (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PB2B_NANDOE (1u << 2) /**< \brief Ebi signal: NRD/NANDOE */ +#define PIO_PC3B_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PD3F_NWAIT (1u << 3) /**< \brief Ebi signal: NWAIT */ +#define PIO_PA8F_NWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA8F_NANDWE (1u << 8) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PA30B_NANDWE (1u << 30) /**< \brief Ebi signal: NWE/NANDWE */ +#define PIO_PC4B_NWR1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PC4B_NBS1 (1u << 4) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NWR1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +#define PIO_PD7F_NBS1 (1u << 7) /**< \brief Ebi signal: NWR1/NBS1 */ +/* ========== Pio definition for FLEXCOM0 peripheral ========== */ +#define PIO_PB28C_FLEXCOM0_IO0 (1u << 28) /**< \brief Flexcom0 signal: FLEXCOM0_IO0 */ +#define PIO_PB29C_FLEXCOM0_IO1 (1u << 29) /**< \brief Flexcom0 signal: FLEXCOM0_IO1 */ +#define PIO_PB30C_FLEXCOM0_IO2 (1u << 30) /**< \brief Flexcom0 signal: FLEXCOM0_IO2 */ +#define PIO_PB31C_FLEXCOM0_IO3 (1u << 31) /**< \brief Flexcom0 signal: FLEXCOM0_IO3 */ +#define PIO_PC0C_FLEXCOM0_IO4 (1u << 0) /**< \brief Flexcom0 signal: FLEXCOM0_IO4 */ +/* ========== Pio definition for FLEXCOM1 peripheral ========== */ +#define PIO_PA24A_FLEXCOM1_IO0 (1u << 24) /**< \brief Flexcom1 signal: FLEXCOM1_IO0 */ +#define PIO_PA23A_FLEXCOM1_IO1 (1u << 23) /**< \brief Flexcom1 signal: FLEXCOM1_IO1 */ +#define PIO_PA22A_FLEXCOM1_IO2 (1u << 22) /**< \brief Flexcom1 signal: FLEXCOM1_IO2 */ +#define PIO_PA25A_FLEXCOM1_IO3 (1u << 25) /**< \brief Flexcom1 signal: FLEXCOM1_IO3 */ +#define PIO_PA26A_FLEXCOM1_IO4 (1u << 26) /**< \brief Flexcom1 signal: FLEXCOM1_IO4 */ +/* ========== Pio definition for FLEXCOM2 peripheral ========== */ +#define PIO_PA6E_FLEXCOM2_IO0 (1u << 6) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PD26C_FLEXCOM2_IO0 (1u << 26) /**< \brief Flexcom2 signal: FLEXCOM2_IO0 */ +#define PIO_PA7E_FLEXCOM2_IO1 (1u << 7) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PD27C_FLEXCOM2_IO1 (1u << 27) /**< \brief Flexcom2 signal: FLEXCOM2_IO1 */ +#define PIO_PA8E_FLEXCOM2_IO2 (1u << 8) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PD28C_FLEXCOM2_IO2 (1u << 28) /**< \brief Flexcom2 signal: FLEXCOM2_IO2 */ +#define PIO_PA9E_FLEXCOM2_IO3 (1u << 9) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PD29C_FLEXCOM2_IO3 (1u << 29) /**< \brief Flexcom2 signal: FLEXCOM2_IO3 */ +#define PIO_PA10E_FLEXCOM2_IO4 (1u << 10) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +#define PIO_PD30C_FLEXCOM2_IO4 (1u << 30) /**< \brief Flexcom2 signal: FLEXCOM2_IO4 */ +/* ========== Pio definition for FLEXCOM3 peripheral ========== */ +#define PIO_PA15E_FLEXCOM3_IO0 (1u << 15) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PB23E_FLEXCOM3_IO0 (1u << 23) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PC20E_FLEXCOM3_IO0 (1u << 20) /**< \brief Flexcom3 signal: FLEXCOM3_IO0 */ +#define PIO_PA13E_FLEXCOM3_IO1 (1u << 13) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PB22E_FLEXCOM3_IO1 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PC19E_FLEXCOM3_IO1 (1u << 19) /**< \brief Flexcom3 signal: FLEXCOM3_IO1 */ +#define PIO_PA14E_FLEXCOM3_IO2 (1u << 14) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PB21E_FLEXCOM3_IO2 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PC18E_FLEXCOM3_IO2 (1u << 18) /**< \brief Flexcom3 signal: FLEXCOM3_IO2 */ +#define PIO_PA16E_FLEXCOM3_IO3 (1u << 16) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PB24E_FLEXCOM3_IO3 (1u << 24) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PC21E_FLEXCOM3_IO3 (1u << 21) /**< \brief Flexcom3 signal: FLEXCOM3_IO3 */ +#define PIO_PA17E_FLEXCOM3_IO4 (1u << 17) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PB25E_FLEXCOM3_IO4 (1u << 25) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +#define PIO_PC22E_FLEXCOM3_IO4 (1u << 22) /**< \brief Flexcom3 signal: FLEXCOM3_IO4 */ +/* ========== Pio definition for FLEXCOM4 peripheral ========== */ +#define PIO_PC28B_FLEXCOM4_IO0 (1u << 28) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD12B_FLEXCOM4_IO0 (1u << 12) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PD21C_FLEXCOM4_IO0 (1u << 21) /**< \brief Flexcom4 signal: FLEXCOM4_IO0 */ +#define PIO_PC29B_FLEXCOM4_IO1 (1u << 29) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD13B_FLEXCOM4_IO1 (1u << 13) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PD22C_FLEXCOM4_IO1 (1u << 22) /**< \brief Flexcom4 signal: FLEXCOM4_IO1 */ +#define PIO_PC30B_FLEXCOM4_IO2 (1u << 30) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD14B_FLEXCOM4_IO2 (1u << 14) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PD23C_FLEXCOM4_IO2 (1u << 23) /**< \brief Flexcom4 signal: FLEXCOM4_IO2 */ +#define PIO_PC31B_FLEXCOM4_IO3 (1u << 31) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD15B_FLEXCOM4_IO3 (1u << 15) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD24C_FLEXCOM4_IO3 (1u << 24) /**< \brief Flexcom4 signal: FLEXCOM4_IO3 */ +#define PIO_PD0B_FLEXCOM4_IO4 (1u << 0) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD16B_FLEXCOM4_IO4 (1u << 16) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +#define PIO_PD25C_FLEXCOM4_IO4 (1u << 25) /**< \brief Flexcom4 signal: FLEXCOM4_IO4 */ +/* ========== Pio definition for GMAC peripheral ========== */ +#define PIO_PB9F_GCOL (1u << 9) /**< \brief Gmac signal: GCOL */ +#define PIO_PC23B_GCOL (1u << 23) /**< \brief Gmac signal: GCOL */ +#define PIO_PD4D_GCOL (1u << 4) /**< \brief Gmac signal: GCOL */ +#define PIO_PB8F_GCRS (1u << 8) /**< \brief Gmac signal: GCRS */ +#define PIO_PC22B_GCRS (1u << 22) /**< \brief Gmac signal: GCRS */ +#define PIO_PD3D_GCRS (1u << 3) /**< \brief Gmac signal: GCRS */ +#define PIO_PB22F_GMDC (1u << 22) /**< \brief Gmac signal: GMDC */ +#define PIO_PC18B_GMDC (1u << 18) /**< \brief Gmac signal: GMDC */ +#define PIO_PD17D_GMDC (1u << 17) /**< \brief Gmac signal: GMDC */ +#define PIO_PB23F_GMDIO (1u << 23) /**< \brief Gmac signal: GMDIO */ +#define PIO_PC19B_GMDIO (1u << 19) /**< \brief Gmac signal: GMDIO */ +#define PIO_PD18D_GMDIO (1u << 18) /**< \brief Gmac signal: GMDIO */ +#define PIO_PB18F_GRX0 (1u << 18) /**< \brief Gmac signal: GRX0 */ +#define PIO_PC14B_GRX0 (1u << 14) /**< \brief Gmac signal: GRX0 */ +#define PIO_PD13D_GRX0 (1u << 13) /**< \brief Gmac signal: GRX0 */ +#define PIO_PB19F_GRX1 (1u << 19) /**< \brief Gmac signal: GRX1 */ +#define PIO_PC15B_GRX1 (1u << 15) /**< \brief Gmac signal: GRX1 */ +#define PIO_PD14D_GRX1 (1u << 14) /**< \brief Gmac signal: GRX1 */ +#define PIO_PB10F_GRX2 (1u << 10) /**< \brief Gmac signal: GRX2 */ +#define PIO_PC24B_GRX2 (1u << 24) /**< \brief Gmac signal: GRX2 */ +#define PIO_PD5D_GRX2 (1u << 5) /**< \brief Gmac signal: GRX2 */ +#define PIO_PB11F_GRX3 (1u << 11) /**< \brief Gmac signal: GRX3 */ +#define PIO_PC25B_GRX3 (1u << 25) /**< \brief Gmac signal: GRX3 */ +#define PIO_PD6D_GRX3 (1u << 6) /**< \brief Gmac signal: GRX3 */ +#define PIO_PB7F_GRXCK (1u << 7) /**< \brief Gmac signal: GRXCK */ +#define PIO_PC20B_GRXCK (1u << 20) /**< \brief Gmac signal: GRXCK */ +#define PIO_PD1D_GRXCK (1u << 1) /**< \brief Gmac signal: GRXCK */ +#define PIO_PB16F_GRXDV (1u << 16) /**< \brief Gmac signal: GRXDV */ +#define PIO_PC12B_GRXDV (1u << 12) /**< \brief Gmac signal: GRXDV */ +#define PIO_PD11D_GRXDV (1u << 11) /**< \brief Gmac signal: GRXDV */ +#define PIO_PB17F_GRXER (1u << 17) /**< \brief Gmac signal: GRXER */ +#define PIO_PC13B_GRXER (1u << 13) /**< \brief Gmac signal: GRXER */ +#define PIO_PD12D_GRXER (1u << 12) /**< \brief Gmac signal: GRXER */ +#define PIO_PB5F_GTSUCOMP (1u << 5) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PC9B_GTSUCOMP (1u << 9) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PD0D_GTSUCOMP (1u << 0) /**< \brief Gmac signal: GTSUCOMP */ +#define PIO_PB20F_GTX0 (1u << 20) /**< \brief Gmac signal: GTX0 */ +#define PIO_PC16B_GTX0 (1u << 16) /**< \brief Gmac signal: GTX0 */ +#define PIO_PD15D_GTX0 (1u << 15) /**< \brief Gmac signal: GTX0 */ +#define PIO_PB21F_GTX1 (1u << 21) /**< \brief Gmac signal: GTX1 */ +#define PIO_PC17B_GTX1 (1u << 17) /**< \brief Gmac signal: GTX1 */ +#define PIO_PD16D_GTX1 (1u << 16) /**< \brief Gmac signal: GTX1 */ +#define PIO_PB12F_GTX2 (1u << 12) /**< \brief Gmac signal: GTX2 */ +#define PIO_PC26B_GTX2 (1u << 26) /**< \brief Gmac signal: GTX2 */ +#define PIO_PD7D_GTX2 (1u << 7) /**< \brief Gmac signal: GTX2 */ +#define PIO_PB13F_GTX3 (1u << 13) /**< \brief Gmac signal: GTX3 */ +#define PIO_PC27B_GTX3 (1u << 27) /**< \brief Gmac signal: GTX3 */ +#define PIO_PD8D_GTX3 (1u << 8) /**< \brief Gmac signal: GTX3 */ +#define PIO_PB14F_GTXCK (1u << 14) /**< \brief Gmac signal: GTXCK */ +#define PIO_PC10B_GTXCK (1u << 10) /**< \brief Gmac signal: GTXCK */ +#define PIO_PD9D_GTXCK (1u << 9) /**< \brief Gmac signal: GTXCK */ +#define PIO_PB15F_GTXEN (1u << 15) /**< \brief Gmac signal: GTXEN */ +#define PIO_PC11B_GTXEN (1u << 11) /**< \brief Gmac signal: GTXEN */ +#define PIO_PD10D_GTXEN (1u << 10) /**< \brief Gmac signal: GTXEN */ +#define PIO_PB6F_GTXER (1u << 6) /**< \brief Gmac signal: GTXER */ +#define PIO_PC21B_GTXER (1u << 21) /**< \brief Gmac signal: GTXER */ +#define PIO_PD2D_GTXER (1u << 2) /**< \brief Gmac signal: GTXER */ +/* ========== Pio definition for I2SC0 peripheral ========== */ +#define PIO_PC1E_I2SC0_CK (1u << 1) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PD19E_I2SC0_CK (1u << 19) /**< \brief I2sc0 signal: I2SC0_CK */ +#define PIO_PC4E_I2SC0_DI0 (1u << 4) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PD22E_I2SC0_DI0 (1u << 22) /**< \brief I2sc0 signal: I2SC0_DI0 */ +#define PIO_PC5E_I2SC0_DO0 (1u << 5) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PD23E_I2SC0_DO0 (1u << 23) /**< \brief I2sc0 signal: I2SC0_DO0 */ +#define PIO_PC2E_I2SC0_MCK (1u << 2) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PD20E_I2SC0_MCK (1u << 20) /**< \brief I2sc0 signal: I2SC0_MCK */ +#define PIO_PC3E_I2SC0_WS (1u << 3) /**< \brief I2sc0 signal: I2SC0_WS */ +#define PIO_PD21E_I2SC0_WS (1u << 21) /**< \brief I2sc0 signal: I2SC0_WS */ +/* ========== Pio definition for I2SC1 peripheral ========== */ +#define PIO_PA15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PB15D_I2SC1_CK (1u << 15) /**< \brief I2sc1 signal: I2SC1_CK */ +#define PIO_PA17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PB17D_I2SC1_DI0 (1u << 17) /**< \brief I2sc1 signal: I2SC1_DI0 */ +#define PIO_PA18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PB18D_I2SC1_DO0 (1u << 18) /**< \brief I2sc1 signal: I2SC1_DO0 */ +#define PIO_PA14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PB14D_I2SC1_MCK (1u << 14) /**< \brief I2sc1 signal: I2SC1_MCK */ +#define PIO_PA16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +#define PIO_PB16D_I2SC1_WS (1u << 16) /**< \brief I2sc1 signal: I2SC1_WS */ +/* ========== Pio definition for ISC peripheral ========== */ +#define PIO_PB26F_ISC_D0 (1u << 26) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PC9C_ISC_D0 (1u << 9) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PD7E_ISC_D0 (1u << 7) /**< \brief Isc signal: ISC_D0 */ +#define PIO_PB27F_ISC_D1 (1u << 27) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PC10C_ISC_D1 (1u << 10) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PD8E_ISC_D1 (1u << 8) /**< \brief Isc signal: ISC_D1 */ +#define PIO_PB24F_ISC_D10 (1u << 24) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PC19C_ISC_D10 (1u << 19) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD4E_ISC_D10 (1u << 4) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PD18F_ISC_D10 (1u << 18) /**< \brief Isc signal: ISC_D10 */ +#define PIO_PB25F_ISC_D11 (1u << 25) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PC20C_ISC_D11 (1u << 20) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD3E_ISC_D11 (1u << 3) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PD19F_ISC_D11 (1u << 19) /**< \brief Isc signal: ISC_D11 */ +#define PIO_PB28F_ISC_D2 (1u << 28) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PC11C_ISC_D2 (1u << 11) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PD9E_ISC_D2 (1u << 9) /**< \brief Isc signal: ISC_D2 */ +#define PIO_PB29F_ISC_D3 (1u << 29) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PC12C_ISC_D3 (1u << 12) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PD10E_ISC_D3 (1u << 10) /**< \brief Isc signal: ISC_D3 */ +#define PIO_PB30F_ISC_D4 (1u << 30) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PC13C_ISC_D4 (1u << 13) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD11E_ISC_D4 (1u << 11) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PD12F_ISC_D4 (1u << 12) /**< \brief Isc signal: ISC_D4 */ +#define PIO_PB31F_ISC_D5 (1u << 31) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC14C_ISC_D5 (1u << 14) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD12E_ISC_D5 (1u << 12) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PD13F_ISC_D5 (1u << 13) /**< \brief Isc signal: ISC_D5 */ +#define PIO_PC0F_ISC_D6 (1u << 0) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC15C_ISC_D6 (1u << 15) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD13E_ISC_D6 (1u << 13) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PD14F_ISC_D6 (1u << 14) /**< \brief Isc signal: ISC_D6 */ +#define PIO_PC1F_ISC_D7 (1u << 1) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC16C_ISC_D7 (1u << 16) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD14E_ISC_D7 (1u << 14) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PD15F_ISC_D7 (1u << 15) /**< \brief Isc signal: ISC_D7 */ +#define PIO_PC2F_ISC_D8 (1u << 2) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC17C_ISC_D8 (1u << 17) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD6E_ISC_D8 (1u << 6) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PD16F_ISC_D8 (1u << 16) /**< \brief Isc signal: ISC_D8 */ +#define PIO_PC3F_ISC_D9 (1u << 3) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC18C_ISC_D9 (1u << 18) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD5E_ISC_D9 (1u << 5) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PD17F_ISC_D9 (1u << 17) /**< \brief Isc signal: ISC_D9 */ +#define PIO_PC8F_ISC_FIELD (1u << 8) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC25C_ISC_FIELD (1u << 25) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD18E_ISC_FIELD (1u << 18) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PD23F_ISC_FIELD (1u << 23) /**< \brief Isc signal: ISC_FIELD */ +#define PIO_PC6F_ISC_HSYNC (1u << 6) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC23C_ISC_HSYNC (1u << 23) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD17E_ISC_HSYNC (1u << 17) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PD22F_ISC_HSYNC (1u << 22) /**< \brief Isc signal: ISC_HSYNC */ +#define PIO_PC7F_ISC_MCK (1u << 7) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC24C_ISC_MCK (1u << 24) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD2E_ISC_MCK (1u << 2) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PD11F_ISC_MCK (1u << 11) /**< \brief Isc signal: ISC_MCK */ +#define PIO_PC4F_ISC_PCK (1u << 4) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC21C_ISC_PCK (1u << 21) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD15E_ISC_PCK (1u << 15) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PD20F_ISC_PCK (1u << 20) /**< \brief Isc signal: ISC_PCK */ +#define PIO_PC5F_ISC_VSYNC (1u << 5) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PC22C_ISC_VSYNC (1u << 22) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD16E_ISC_VSYNC (1u << 16) /**< \brief Isc signal: ISC_VSYNC */ +#define PIO_PD21F_ISC_VSYNC (1u << 21) /**< \brief Isc signal: ISC_VSYNC */ +/* ========== Pio definition for LCDC peripheral ========== */ +#define PIO_PB11A_LCDDAT0 (1u << 11) /**< \brief Lcdc signal: LCDDAT0 */ +#define PIO_PB12A_LCDDAT1 (1u << 12) /**< \brief Lcdc signal: LCDDAT1 */ +#define PIO_PB21A_LCDDAT10 (1u << 21) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PC16A_LCDDAT10 (1u << 16) /**< \brief Lcdc signal: LCDDAT10 */ +#define PIO_PB22A_LCDDAT11 (1u << 22) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PC17A_LCDDAT11 (1u << 17) /**< \brief Lcdc signal: LCDDAT11 */ +#define PIO_PB23A_LCDDAT12 (1u << 23) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PC18A_LCDDAT12 (1u << 18) /**< \brief Lcdc signal: LCDDAT12 */ +#define PIO_PB24A_LCDDAT13 (1u << 24) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PC19A_LCDDAT13 (1u << 19) /**< \brief Lcdc signal: LCDDAT13 */ +#define PIO_PB25A_LCDDAT14 (1u << 25) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PC20A_LCDDAT14 (1u << 20) /**< \brief Lcdc signal: LCDDAT14 */ +#define PIO_PB26A_LCDDAT15 (1u << 26) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PC21A_LCDDAT15 (1u << 21) /**< \brief Lcdc signal: LCDDAT15 */ +#define PIO_PB27A_LCDDAT16 (1u << 27) /**< \brief Lcdc signal: LCDDAT16 */ +#define PIO_PB28A_LCDDAT17 (1u << 28) /**< \brief Lcdc signal: LCDDAT17 */ +#define PIO_PB29A_LCDDAT18 (1u << 29) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PC22A_LCDDAT18 (1u << 22) /**< \brief Lcdc signal: LCDDAT18 */ +#define PIO_PB30A_LCDDAT19 (1u << 30) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PC23A_LCDDAT19 (1u << 23) /**< \brief Lcdc signal: LCDDAT19 */ +#define PIO_PB13A_LCDDAT2 (1u << 13) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PC10A_LCDDAT2 (1u << 10) /**< \brief Lcdc signal: LCDDAT2 */ +#define PIO_PB31A_LCDDAT20 (1u << 31) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC24A_LCDDAT20 (1u << 24) /**< \brief Lcdc signal: LCDDAT20 */ +#define PIO_PC0A_LCDDAT21 (1u << 0) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC25A_LCDDAT21 (1u << 25) /**< \brief Lcdc signal: LCDDAT21 */ +#define PIO_PC1A_LCDDAT22 (1u << 1) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC26A_LCDDAT22 (1u << 26) /**< \brief Lcdc signal: LCDDAT22 */ +#define PIO_PC2A_LCDDAT23 (1u << 2) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PC27A_LCDDAT23 (1u << 27) /**< \brief Lcdc signal: LCDDAT23 */ +#define PIO_PB14A_LCDDAT3 (1u << 14) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PC11A_LCDDAT3 (1u << 11) /**< \brief Lcdc signal: LCDDAT3 */ +#define PIO_PB15A_LCDDAT4 (1u << 15) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PC12A_LCDDAT4 (1u << 12) /**< \brief Lcdc signal: LCDDAT4 */ +#define PIO_PB16A_LCDDAT5 (1u << 16) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PC13A_LCDDAT5 (1u << 13) /**< \brief Lcdc signal: LCDDAT5 */ +#define PIO_PB17A_LCDDAT6 (1u << 17) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PC14A_LCDDAT6 (1u << 14) /**< \brief Lcdc signal: LCDDAT6 */ +#define PIO_PB18A_LCDDAT7 (1u << 18) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PC15A_LCDDAT7 (1u << 15) /**< \brief Lcdc signal: LCDDAT7 */ +#define PIO_PB19A_LCDDAT8 (1u << 19) /**< \brief Lcdc signal: LCDDAT8 */ +#define PIO_PB20A_LCDDAT9 (1u << 20) /**< \brief Lcdc signal: LCDDAT9 */ +#define PIO_PC8A_LCDDEN (1u << 8) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PD1A_LCDDEN (1u << 1) /**< \brief Lcdc signal: LCDDEN */ +#define PIO_PC4A_LCDDISP (1u << 4) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC29A_LCDDISP (1u << 29) /**< \brief Lcdc signal: LCDDISP */ +#define PIO_PC6A_LCDHSYNC (1u << 6) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC31A_LCDHSYNC (1u << 31) /**< \brief Lcdc signal: LCDHSYNC */ +#define PIO_PC7A_LCDPCK (1u << 7) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PD0A_LCDPCK (1u << 0) /**< \brief Lcdc signal: LCDPCK */ +#define PIO_PC3A_LCDPWM (1u << 3) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC28A_LCDPWM (1u << 28) /**< \brief Lcdc signal: LCDPWM */ +#define PIO_PC5A_LCDVSYNC (1u << 5) /**< \brief Lcdc signal: LCDVSYNC */ +#define PIO_PC30A_LCDVSYNC (1u << 30) /**< \brief Lcdc signal: LCDVSYNC */ +/* ========== Pio definition for MCAN0 peripheral ========== */ +#define PIO_PC2C_CANRX0 (1u << 2) /**< \brief Mcan0 signal: CANRX0 */ +#define PIO_PC11E_CANRX0 (1u << 11) /**< \brief Mcan0 signal: CANRX0 */ +#define PIO_PC1C_CANTX0 (1u << 1) /**< \brief Mcan0 signal: CANTX0 */ +#define PIO_PC10E_CANTX0 (1u << 10) /**< \brief Mcan0 signal: CANTX0 */ +/* ========== Pio definition for MCAN1 peripheral ========== */ +#define PIO_PC27D_CANRX1 (1u << 27) /**< \brief Mcan1 signal: CANRX1 */ +#define PIO_PC26D_CANTX1 (1u << 26) /**< \brief Mcan1 signal: CANTX1 */ +/* ========== Pio definition for PDMIC peripheral ========== */ +#define PIO_PB12D_PDMIC_CLK (1u << 12) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB27D_PDMIC_CLK (1u << 27) /**< \brief Pdmic signal: PDMIC_CLK */ +#define PIO_PB11D_PDMIC_DAT (1u << 11) /**< \brief Pdmic signal: PDMIC_DAT */ +#define PIO_PB26D_PDMIC_DAT (1u << 26) /**< \brief Pdmic signal: PDMIC_DAT */ +/* ========== Pio definition for PMC peripheral ========== */ +#define PIO_PC8D_PCK0 (1u << 8) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD19A_PCK0 (1u << 19) /**< \brief Pmc signal: PCK0 */ +#define PIO_PD31E_PCK0 (1u << 31) /**< \brief Pmc signal: PCK0 */ +#define PIO_PB13C_PCK1 (1u << 13) /**< \brief Pmc signal: PCK1 */ +#define PIO_PB20E_PCK1 (1u << 20) /**< \brief Pmc signal: PCK1 */ +#define PIO_PC27C_PCK1 (1u << 27) /**< \brief Pmc signal: PCK1 */ +#define PIO_PD6B_PCK1 (1u << 6) /**< \brief Pmc signal: PCK1 */ +#define PIO_PA21B_PCK2 (1u << 21) /**< \brief Pmc signal: PCK2 */ +#define PIO_PC28C_PCK2 (1u << 28) /**< \brief Pmc signal: PCK2 */ +#define PIO_PD11B_PCK2 (1u << 11) /**< \brief Pmc signal: PCK2 */ +/* ========== Pio definition for PWM peripheral ========== */ +#define PIO_PB3D_PWMEXTRG0 (1u << 3) /**< \brief Pwm signal: PWMEXTRG0 */ +#define PIO_PB10C_PWMEXTRG1 (1u << 10) /**< \brief Pwm signal: PWMEXTRG1 */ +#define PIO_PB2D_PWMFI0 (1u << 2) /**< \brief Pwm signal: PWMFI0 */ +#define PIO_PB9C_PWMFI1 (1u << 9) /**< \brief Pwm signal: PWMFI1 */ +#define PIO_PA30D_PWMH0 (1u << 30) /**< \brief Pwm signal: PWMH0 */ +#define PIO_PB0D_PWMH1 (1u << 0) /**< \brief Pwm signal: PWMH1 */ +#define PIO_PB5C_PWMH2 (1u << 5) /**< \brief Pwm signal: PWMH2 */ +#define PIO_PB7C_PWMH3 (1u << 7) /**< \brief Pwm signal: PWMH3 */ +#define PIO_PA31D_PWML0 (1u << 31) /**< \brief Pwm signal: PWML0 */ +#define PIO_PB1D_PWML1 (1u << 1) /**< \brief Pwm signal: PWML1 */ +#define PIO_PB6C_PWML2 (1u << 6) /**< \brief Pwm signal: PWML2 */ +#define PIO_PB8C_PWML3 (1u << 8) /**< \brief Pwm signal: PWML3 */ +/* ========== Pio definition for QSPI0 peripheral ========== */ +#define PIO_PA1B_QSPI0_CS (1u << 1) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA15C_QSPI0_CS (1u << 15) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA23F_QSPI0_CS (1u << 23) /**< \brief Qspi0 signal: QSPI0_CS */ +#define PIO_PA2B_QSPI0_IO0 (1u << 2) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA16C_QSPI0_IO0 (1u << 16) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA24F_QSPI0_IO0 (1u << 24) /**< \brief Qspi0 signal: QSPI0_IO0 */ +#define PIO_PA3B_QSPI0_IO1 (1u << 3) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA17C_QSPI0_IO1 (1u << 17) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA25F_QSPI0_IO1 (1u << 25) /**< \brief Qspi0 signal: QSPI0_IO1 */ +#define PIO_PA4B_QSPI0_IO2 (1u << 4) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA18C_QSPI0_IO2 (1u << 18) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA26F_QSPI0_IO2 (1u << 26) /**< \brief Qspi0 signal: QSPI0_IO2 */ +#define PIO_PA5B_QSPI0_IO3 (1u << 5) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA19C_QSPI0_IO3 (1u << 19) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA27F_QSPI0_IO3 (1u << 27) /**< \brief Qspi0 signal: QSPI0_IO3 */ +#define PIO_PA0B_QSPI0_SCK (1u << 0) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA14C_QSPI0_SCK (1u << 14) /**< \brief Qspi0 signal: QSPI0_SCK */ +#define PIO_PA22F_QSPI0_SCK (1u << 22) /**< \brief Qspi0 signal: QSPI0_SCK */ +/* ========== Pio definition for QSPI1 peripheral ========== */ +#define PIO_PA11B_QSPI1_CS (1u << 11) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB6D_QSPI1_CS (1u << 6) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PB15E_QSPI1_CS (1u << 15) /**< \brief Qspi1 signal: QSPI1_CS */ +#define PIO_PA7B_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB7D_QSPI1_IO0 (1u << 7) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PB16E_QSPI1_IO0 (1u << 16) /**< \brief Qspi1 signal: QSPI1_IO0 */ +#define PIO_PA8B_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB8D_QSPI1_IO1 (1u << 8) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PB17E_QSPI1_IO1 (1u << 17) /**< \brief Qspi1 signal: QSPI1_IO1 */ +#define PIO_PA9B_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB9D_QSPI1_IO2 (1u << 9) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PB18E_QSPI1_IO2 (1u << 18) /**< \brief Qspi1 signal: QSPI1_IO2 */ +#define PIO_PA10B_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB10D_QSPI1_IO3 (1u << 10) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PB19E_QSPI1_IO3 (1u << 19) /**< \brief Qspi1 signal: QSPI1_IO3 */ +#define PIO_PA6B_QSPI1_SCK (1u << 6) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB5D_QSPI1_SCK (1u << 5) /**< \brief Qspi1 signal: QSPI1_SCK */ +#define PIO_PB14E_QSPI1_SCK (1u << 14) /**< \brief Qspi1 signal: QSPI1_SCK */ +/* ========== Pio definition for SDMMC0 peripheral ========== */ +#define PIO_PA13A_SDMMC0_CD (1u << 13) /**< \brief Sdmmc0 signal: SDMMC0_CD */ +#define PIO_PA11A_SDMMC0_VDDSEL (1u << 11)/**< \brief Sdmmc0 signal: SDMMC0_VDDSEL */ +#define PIO_PA10A_SDMMC0_RSTN (1u << 10) /**< \brief Sdmmc0 signal: SDMMC0_RSTN */ +#define PIO_PA0A_SDMMC0_CK (1u << 0) /**< \brief Sdmmc0 signal: SDMMC0_CK */ +#define PIO_PA1A_SDMMC0_CMD (1u << 1) /**< \brief Sdmmc0 signal: SDMMC0_CMD */ +#define PIO_PA12A_SDMMC0_WP (1u << 12) /**< \brief Sdmmc0 signal: SDMMC0_WP */ +#define PIO_PA2A_SDMMC0_DAT0 (1u << 2) /**< \brief Sdmmc0 signal: SDMMC0_DAT0 */ +#define PIO_PA3A_SDMMC0_DAT1 (1u << 3) /**< \brief Sdmmc0 signal: SDMMC0_DAT1 */ +#define PIO_PA4A_SDMMC0_DAT2 (1u << 4) /**< \brief Sdmmc0 signal: SDMMC0_DAT2 */ +#define PIO_PA5A_SDMMC0_DAT3 (1u << 5) /**< \brief Sdmmc0 signal: SDMMC0_DAT3 */ +#define PIO_PA6A_SDMMC0_DAT4 (1u << 6) /**< \brief Sdmmc0 signal: SDMMC0_DAT4 */ +#define PIO_PA7A_SDMMC0_DAT5 (1u << 7) /**< \brief Sdmmc0 signal: SDMMC0_DAT5 */ +#define PIO_PA8A_SDMMC0_DAT6 (1u << 8) /**< \brief Sdmmc0 signal: SDMMC0_DAT6 */ +#define PIO_PA9A_SDMMC0_DAT7 (1u << 9) /**< \brief Sdmmc0 signal: SDMMC0_DAT7 */ +/* ========== Pio definition for SDMMC1 peripheral ========== */ +#define PIO_PA30E_SDMMC1_CD (1u << 30) /**< \brief Sdmmc1 signal: SDMMC1_CD */ +#define PIO_PA27E_SDMMC1_RSTN (1u << 27) /**< \brief Sdmmc1 signal: SDMMC1_RSTN */ +#define PIO_PA22E_SDMMC1_CK (1u << 22) /**< \brief Sdmmc1 signal: SDMMC1_CK */ +#define PIO_PA28E_SDMMC1_CMD (1u << 28) /**< \brief Sdmmc1 signal: SDMMC1_CMD */ +#define PIO_PA29E_SDMMC1_WP (1u << 29) /**< \brief Sdmmc1 signal: SDMMC1_WP */ +#define PIO_PA18E_SDMMC1_DAT0 (1u << 18) /**< \brief Sdmmc1 signal: SDMMC1_DAT0 */ +#define PIO_PA19E_SDMMC1_DAT1 (1u << 19) /**< \brief Sdmmc1 signal: SDMMC1_DAT1 */ +#define PIO_PA20E_SDMMC1_DAT2 (1u << 20) /**< \brief Sdmmc1 signal: SDMMC1_DAT2 */ +#define PIO_PA21E_SDMMC1_DAT3 (1u << 21) /**< \brief Sdmmc1 signal: SDMMC1_DAT3 */ +/* ========== Pio definition for SPI0 peripheral ========== */ +#define PIO_PA16A_SPI0_MISO (1u << 16) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA31C_SPI0_MISO (1u << 31) /**< \brief Spi0 signal: SPI0_MISO */ +#define PIO_PA15A_SPI0_MOSI (1u << 15) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PB0C_SPI0_MOSI (1u << 0) /**< \brief Spi0 signal: SPI0_MOSI */ +#define PIO_PA17A_SPI0_NPCS0 (1u << 17) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA30C_SPI0_NPCS0 (1u << 30) /**< \brief Spi0 signal: SPI0_NPCS0 */ +#define PIO_PA18A_SPI0_NPCS1 (1u << 18) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA29C_SPI0_NPCS1 (1u << 29) /**< \brief Spi0 signal: SPI0_NPCS1 */ +#define PIO_PA19A_SPI0_NPCS2 (1u << 19) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA27C_SPI0_NPCS2 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS2 */ +#define PIO_PA20A_SPI0_NPCS3 (1u << 20) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA28C_SPI0_NPCS3 (1u << 28) /**< \brief Spi0 signal: SPI0_NPCS3 */ +#define PIO_PA14A_SPI0_SPCK (1u << 14) /**< \brief Spi0 signal: SPI0_SPCK */ +#define PIO_PB1C_SPI0_SPCK (1u << 1) /**< \brief Spi0 signal: SPI0_SPCK */ +/* ========== Pio definition for SPI1 peripheral ========== */ +#define PIO_PA24D_SPI1_MISO (1u << 24) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PC3D_SPI1_MISO (1u << 3) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PD27A_SPI1_MISO (1u << 27) /**< \brief Spi1 signal: SPI1_MISO */ +#define PIO_PA23D_SPI1_MOSI (1u << 23) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PC2D_SPI1_MOSI (1u << 2) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PD26A_SPI1_MOSI (1u << 26) /**< \brief Spi1 signal: SPI1_MOSI */ +#define PIO_PA25D_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PC4D_SPI1_NPCS0 (1u << 4) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PD28A_SPI1_NPCS0 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS0 */ +#define PIO_PA26D_SPI1_NPCS1 (1u << 26) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PC5D_SPI1_NPCS1 (1u << 5) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PD29A_SPI1_NPCS1 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS1 */ +#define PIO_PA27D_SPI1_NPCS2 (1u << 27) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PC6D_SPI1_NPCS2 (1u << 6) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PD30A_SPI1_NPCS2 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS2 */ +#define PIO_PA28D_SPI1_NPCS3 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PC7D_SPI1_NPCS3 (1u << 7) /**< \brief Spi1 signal: SPI1_NPCS3 */ +#define PIO_PA22D_SPI1_SPCK (1u << 22) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PC1D_SPI1_SPCK (1u << 1) /**< \brief Spi1 signal: SPI1_SPCK */ +#define PIO_PD25A_SPI1_SPCK (1u << 25) /**< \brief Spi1 signal: SPI1_SPCK */ +/* ========== Pio definition for SSC0 peripheral ========== */ +#define PIO_PB23C_RD0 (1u << 23) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PC15E_RD0 (1u << 15) /**< \brief Ssc0 signal: RD0 */ +#define PIO_PB25C_RF0 (1u << 25) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PC17E_RF0 (1u << 17) /**< \brief Ssc0 signal: RF0 */ +#define PIO_PB24C_RK0 (1u << 24) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PC16E_RK0 (1u << 16) /**< \brief Ssc0 signal: RK0 */ +#define PIO_PB22C_TD0 (1u << 22) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PC14E_TD0 (1u << 14) /**< \brief Ssc0 signal: TD0 */ +#define PIO_PB21C_TF0 (1u << 21) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PC13E_TF0 (1u << 13) /**< \brief Ssc0 signal: TF0 */ +#define PIO_PB20C_TK0 (1u << 20) /**< \brief Ssc0 signal: TK0 */ +#define PIO_PC12E_TK0 (1u << 12) /**< \brief Ssc0 signal: TK0 */ +/* ========== Pio definition for SSC1 peripheral ========== */ +#define PIO_PA17B_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PB17C_RD1 (1u << 17) /**< \brief Ssc1 signal: RD1 */ +#define PIO_PA19B_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PB19C_RF1 (1u << 19) /**< \brief Ssc1 signal: RF1 */ +#define PIO_PA18B_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PB18C_RK1 (1u << 18) /**< \brief Ssc1 signal: RK1 */ +#define PIO_PA16B_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PB16C_TD1 (1u << 16) /**< \brief Ssc1 signal: TD1 */ +#define PIO_PA15B_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PB15C_TF1 (1u << 15) /**< \brief Ssc1 signal: TF1 */ +#define PIO_PA14B_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +#define PIO_PB14C_TK1 (1u << 14) /**< \brief Ssc1 signal: TK1 */ +/* ========== Pio definition for TC0 peripheral ========== */ +#define PIO_PA21D_TCLK0 (1u << 21) /**< \brief Tc0 signal: TCLK0 */ +#define PIO_PA29A_TCLK1 (1u << 29) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PC5C_TCLK1 (1u << 5) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PD13A_TCLK1 (1u << 13) /**< \brief Tc0 signal: TCLK1 */ +#define PIO_PB5A_TCLK2 (1u << 5) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PB24D_TCLK2 (1u << 24) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PD22A_TCLK2 (1u << 22) /**< \brief Tc0 signal: TCLK2 */ +#define PIO_PA19D_TIOA0 (1u << 19) /**< \brief Tc0 signal: TIOA0 */ +#define PIO_PA27A_TIOA1 (1u << 27) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PC3C_TIOA1 (1u << 3) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PD11A_TIOA1 (1u << 11) /**< \brief Tc0 signal: TIOA1 */ +#define PIO_PB6A_TIOA2 (1u << 6) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PB22D_TIOA2 (1u << 22) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PD20A_TIOA2 (1u << 20) /**< \brief Tc0 signal: TIOA2 */ +#define PIO_PA20D_TIOB0 (1u << 20) /**< \brief Tc0 signal: TIOB0 */ +#define PIO_PA28A_TIOB1 (1u << 28) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PC4C_TIOB1 (1u << 4) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PD12A_TIOB1 (1u << 12) /**< \brief Tc0 signal: TIOB1 */ +#define PIO_PB7A_TIOB2 (1u << 7) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PB23D_TIOB2 (1u << 23) /**< \brief Tc0 signal: TIOB2 */ +#define PIO_PD21A_TIOB2 (1u << 21) /**< \brief Tc0 signal: TIOB2 */ +/* ========== Pio definition for TC1 peripheral ========== */ +#define PIO_PB8A_TCLK3 (1u << 8) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PB21D_TCLK3 (1u << 21) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PD31D_TCLK3 (1u << 31) /**< \brief Tc1 signal: TCLK3 */ +#define PIO_PA11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PC11D_TCLK4 (1u << 11) /**< \brief Tc1 signal: TCLK4 */ +#define PIO_PA8D_TCLK5 (1u << 8) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB30D_TCLK5 (1u << 30) /**< \brief Tc1 signal: TCLK5 */ +#define PIO_PB9A_TIOA3 (1u << 9) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PB19D_TIOA3 (1u << 19) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PD29D_TIOA3 (1u << 29) /**< \brief Tc1 signal: TIOA3 */ +#define PIO_PA9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PC9D_TIOA4 (1u << 9) /**< \brief Tc1 signal: TIOA4 */ +#define PIO_PA6D_TIOA5 (1u << 6) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB28D_TIOA5 (1u << 28) /**< \brief Tc1 signal: TIOA5 */ +#define PIO_PB10A_TIOB3 (1u << 10) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PB20D_TIOB3 (1u << 20) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PD30D_TIOB3 (1u << 30) /**< \brief Tc1 signal: TIOB3 */ +#define PIO_PA10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PC10D_TIOB4 (1u << 10) /**< \brief Tc1 signal: TIOB4 */ +#define PIO_PA7D_TIOB5 (1u << 7) /**< \brief Tc1 signal: TIOB5 */ +#define PIO_PB29D_TIOB5 (1u << 29) /**< \brief Tc1 signal: TIOB5 */ +/* ========== Pio definition for TWIHS0 peripheral ========== */ +#define PIO_PC0D_TWCK0 (1u << 0) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PC28E_TWCK0 (1u << 28) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD22B_TWCK0 (1u << 22) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PD30E_TWCK0 (1u << 30) /**< \brief Twihs0 signal: TWCK0 */ +#define PIO_PB31D_TWD0 (1u << 31) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PC27E_TWD0 (1u << 27) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD21B_TWD0 (1u << 21) /**< \brief Twihs0 signal: TWD0 */ +#define PIO_PD29E_TWD0 (1u << 29) /**< \brief Twihs0 signal: TWD0 */ +/* ========== Pio definition for TWIHS1 peripheral ========== */ +#define PIO_PC7C_TWCK1 (1u << 7) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PD20B_TWCK1 (1u << 20) /**< \brief Twihs1 signal: TWCK1 */ +#define PIO_PC6C_TWD1 (1u << 6) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ +#define PIO_PD19B_TWD1 (1u << 19) /**< \brief Twihs1 signal: TWD1 */ +/* ========== Pio definition for UART0 peripheral ========== */ +#define PIO_PB26C_URXD0 (1u << 26) /**< \brief Uart0 signal: URXD0 */ +#define PIO_PB27C_UTXD0 (1u << 27) /**< \brief Uart0 signal: UTXD0 */ +/* ========== Pio definition for UART1 peripheral ========== */ +#define PIO_PC7E_URXD1 (1u << 7) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PD2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ +#define PIO_PC8E_UTXD1 (1u << 8) /**< \brief Uart1 signal: UTXD1 */ +#define PIO_PD3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ +/* ========== Pio definition for UART2 peripheral ========== */ +#define PIO_PD4B_URXD2 (1u << 4) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD19C_URXD2 (1u << 19) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD23A_URXD2 (1u << 23) /**< \brief Uart2 signal: URXD2 */ +#define PIO_PD5B_UTXD2 (1u << 5) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD20C_UTXD2 (1u << 20) /**< \brief Uart2 signal: UTXD2 */ +#define PIO_PD24A_UTXD2 (1u << 24) /**< \brief Uart2 signal: UTXD2 */ +/* ========== Pio definition for UART3 peripheral ========== */ +#define PIO_PB11C_URXD3 (1u << 11) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC12D_URXD3 (1u << 12) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PC31C_URXD3 (1u << 31) /**< \brief Uart3 signal: URXD3 */ +#define PIO_PB12C_UTXD3 (1u << 12) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PC13D_UTXD3 (1u << 13) /**< \brief Uart3 signal: UTXD3 */ +#define PIO_PD0C_UTXD3 (1u << 0) /**< \brief Uart3 signal: UTXD3 */ +/* ========== Pio definition for UART4 peripheral ========== */ +#define PIO_PB3A_URXD4 (1u << 3) /**< \brief Uart4 signal: URXD4 */ +#define PIO_PB4A_UTXD4 (1u << 4) /**< \brief Uart4 signal: UTXD4 */ +/* ========== Pio indexes ========== */ +#define PIO_PA0_IDX 0 +#define PIO_PA1_IDX 1 +#define PIO_PA2_IDX 2 +#define PIO_PA3_IDX 3 +#define PIO_PA4_IDX 4 +#define PIO_PA5_IDX 5 +#define PIO_PA6_IDX 6 +#define PIO_PA7_IDX 7 +#define PIO_PA8_IDX 8 +#define PIO_PA9_IDX 9 +#define PIO_PA10_IDX 10 +#define PIO_PA11_IDX 11 +#define PIO_PA12_IDX 12 +#define PIO_PA13_IDX 13 +#define PIO_PA14_IDX 14 +#define PIO_PA15_IDX 15 +#define PIO_PA16_IDX 16 +#define PIO_PA17_IDX 17 +#define PIO_PA18_IDX 18 +#define PIO_PA19_IDX 19 +#define PIO_PA20_IDX 20 +#define PIO_PA21_IDX 21 +#define PIO_PA22_IDX 22 +#define PIO_PA23_IDX 23 +#define PIO_PA24_IDX 24 +#define PIO_PA25_IDX 25 +#define PIO_PA26_IDX 26 +#define PIO_PA27_IDX 27 +#define PIO_PA28_IDX 28 +#define PIO_PA29_IDX 29 +#define PIO_PA30_IDX 30 +#define PIO_PA31_IDX 31 +#define PIO_PB0_IDX 32 +#define PIO_PB1_IDX 33 +#define PIO_PB2_IDX 34 +#define PIO_PB3_IDX 35 +#define PIO_PB4_IDX 36 +#define PIO_PB5_IDX 37 +#define PIO_PB6_IDX 38 +#define PIO_PB7_IDX 39 +#define PIO_PB8_IDX 40 +#define PIO_PB9_IDX 41 +#define PIO_PB10_IDX 42 +#define PIO_PB11_IDX 43 +#define PIO_PB12_IDX 44 +#define PIO_PB13_IDX 45 +#define PIO_PB14_IDX 46 +#define PIO_PB15_IDX 47 +#define PIO_PB16_IDX 48 +#define PIO_PB17_IDX 49 +#define PIO_PB18_IDX 50 +#define PIO_PB19_IDX 51 +#define PIO_PB20_IDX 52 +#define PIO_PB21_IDX 53 +#define PIO_PB22_IDX 54 +#define PIO_PB23_IDX 55 +#define PIO_PB24_IDX 56 +#define PIO_PB25_IDX 57 +#define PIO_PB26_IDX 58 +#define PIO_PB27_IDX 59 +#define PIO_PB28_IDX 60 +#define PIO_PB29_IDX 61 +#define PIO_PB30_IDX 62 +#define PIO_PB31_IDX 63 +#define PIO_PC0_IDX 64 +#define PIO_PC1_IDX 65 +#define PIO_PC2_IDX 66 +#define PIO_PC3_IDX 67 +#define PIO_PC4_IDX 68 +#define PIO_PC5_IDX 69 +#define PIO_PC6_IDX 70 +#define PIO_PC7_IDX 71 +#define PIO_PC8_IDX 72 +#define PIO_PC9_IDX 73 +#define PIO_PC10_IDX 74 +#define PIO_PC11_IDX 75 +#define PIO_PC12_IDX 76 +#define PIO_PC13_IDX 77 +#define PIO_PC14_IDX 78 +#define PIO_PC15_IDX 79 +#define PIO_PC16_IDX 80 +#define PIO_PC17_IDX 81 +#define PIO_PC18_IDX 82 +#define PIO_PC19_IDX 83 +#define PIO_PC20_IDX 84 +#define PIO_PC21_IDX 85 +#define PIO_PC22_IDX 86 +#define PIO_PC23_IDX 87 +#define PIO_PC24_IDX 88 +#define PIO_PC25_IDX 89 +#define PIO_PC26_IDX 90 +#define PIO_PC27_IDX 91 +#define PIO_PC28_IDX 92 +#define PIO_PC29_IDX 93 +#define PIO_PC30_IDX 94 +#define PIO_PC31_IDX 95 +#define PIO_PD0_IDX 96 +#define PIO_PD1_IDX 97 +#define PIO_PD2_IDX 98 +#define PIO_PD3_IDX 99 +#define PIO_PD4_IDX 100 +#define PIO_PD5_IDX 101 +#define PIO_PD6_IDX 102 +#define PIO_PD7_IDX 103 +#define PIO_PD8_IDX 104 +#define PIO_PD9_IDX 105 +#define PIO_PD10_IDX 106 +#define PIO_PD11_IDX 107 +#define PIO_PD12_IDX 108 +#define PIO_PD13_IDX 109 +#define PIO_PD14_IDX 110 +#define PIO_PD15_IDX 111 +#define PIO_PD16_IDX 112 +#define PIO_PD17_IDX 113 +#define PIO_PD18_IDX 114 +#define PIO_PD19_IDX 115 +#define PIO_PD20_IDX 116 +#define PIO_PD21_IDX 117 +#define PIO_PD22_IDX 118 +#define PIO_PD23_IDX 119 +#define PIO_PD24_IDX 120 +#define PIO_PD25_IDX 121 +#define PIO_PD26_IDX 122 +#define PIO_PD27_IDX 123 +#define PIO_PD28_IDX 124 +#define PIO_PD29_IDX 125 +#define PIO_PD30_IDX 126 +#define PIO_PD31_IDX 127 + +#endif /* _SAMA5D28_PIO_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d21.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d21.h new file mode 100644 index 000000000..992d5dbb9 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d21.h @@ -0,0 +1,269 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D21_ +#define _SAMA5D21_ + +/** \addtogroup SAMA5D21_definitions SAMA5D21 definitions + This file defines all structures and symbols for SAMA5D21: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "compiler.h" +#include + +/*------------------------------------------------------------------------------ + * + *------------------------------------------------------------------------------*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D21 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D21_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D21 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D21_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC0 ((Gmac *)0xF8008000U) /**< \brief (GMAC0 ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define USART0 ((Usart *)0xF8034200U) /**< \brief (FLEXCOM0_USART) Base Address */ +#define FCOMSPI0 ((Spi *)0xF8034400U) /**< \brief (FLEXCOM0_SPI) Base Address */ +#define TWI0 ((Twi *)0xF8034600U) /**< \brief (FLEXCOM0_TWI) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define USART1 ((Usart *)0xF8038200U) /**< \brief (FLEXCOM1_USART) Base Address */ +#define FCOMSPI1 ((Spi *)0xF8038400U) /**< \brief (FLEXCOM1_SPI) Base Address */ +#define TWI1 ((Twi *)0xF8038600U) /**< \brief (FLEXCOM1_TWI) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define USART3 ((Usart *)0xFC014200U) /**< \brief (FLEXCOM3_USART) Base Address */ +#define FCOMSPI3 ((Spi *)0xFC014400U) /**< \brief (FLEXCOM3_SPI) Base Address */ +#define TWI3 ((Twi *)0xFC014600U) /**< \brief (FLEXCOM3_TWI) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define USART4 ((Usart *)0xFC018200U) /**< \brief (FLEXCOM4_USART) Base Address */ +#define FCOMSPI4 ((Spi *)0xFC018400U) /**< \brief (FLEXCOM4_SPI) Base Address */ +#define TWI4 ((Twi *)0xFC018600U) /**< \brief (FLEXCOM4_TWI) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D21 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D21_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d21.h" + +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D21 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xB0000000u) /**< SDMMC 0 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D21 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D21 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D21_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d22.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d22.h new file mode 100644 index 000000000..ffcbe8b0d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d22.h @@ -0,0 +1,248 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D22_ +#define _SAMA5D22_ + +/** \addtogroup SAMA5D22_definitions SAMA5D22 definitions + This file defines all structures and symbols for SAMA5D22: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D22 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D22_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mcan.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D22 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D22_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC0 ((Gmac *)0xF8008000U) /**< \brief (GMAC0 ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define MCAN0 ((Mcan *)0xF8054000U) /**< \brief (MCAN0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D22 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D22_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d22.h" + +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D22 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xB0000000u) /**< SDMMC 0 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D22 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D22 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D22_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d23.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d23.h new file mode 100644 index 000000000..92b907840 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d23.h @@ -0,0 +1,247 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D23_ +#define _SAMA5D23_ + +/** \addtogroup SAMA5D23_definitions SAMA5D23 definitions + This file defines all structures and symbols for SAMA5D23: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D23 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D23_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mcan.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D23 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D23_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC ((Gmac *)0xF8008000U) /**< \brief (GMAC ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define MCAN0 ((Mcan *)0xF8054000U) /**< \brief (MCAN0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D23 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D23_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d23.h" +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D23 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xB0000000u) /**< SDMMC 0 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D23 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D23 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D23_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d24.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d24.h new file mode 100644 index 000000000..4ead3d47a --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d24.h @@ -0,0 +1,249 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D24_ +#define _SAMA5D24_ + +/** \addtogroup SAMA5D24_definitions SAMA5D24 definitions + This file defines all structures and symbols for SAMA5D24: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D24 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D24_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D24 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D24_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xA0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define SDMMC1 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC1 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC0 ((Gmac *)0xF8008000U) /**< \brief (GMAC0 ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM2 ((Flexcom *)0xFC010000U) /**< \brief (FLEXCOM2) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D24 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D24_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d24.h" + +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D24 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xA0000000u) /**< SDMMC 0 base address */ +#define SDMMC1_ADDR (0xB0000000u) /**< SDMMC 1 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D24 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D24 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D24_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d26.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d26.h new file mode 100644 index 000000000..12809add7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d26.h @@ -0,0 +1,249 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D26_ +#define _SAMA5D26_ + +/** \addtogroup SAMA5D26_definitions SAMA5D26 definitions + This file defines all structures and symbols for SAMA5D26: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D26 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D26_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D26 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D26_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xA0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define SDMMC1 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC1 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC0 ((Gmac *)0xF8008000U) /**< \brief (GMAC0 ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM2 ((Flexcom *)0xFC010000U) /**< \brief (FLEXCOM2) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D26 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D26_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d26.h" + +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D26 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xA0000000u) /**< SDMMC 0 base address */ +#define SDMMC1_ADDR (0xB0000000u) /**< SDMMC 1 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D26 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D26 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D26_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d27.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d27.h new file mode 100644 index 000000000..022a171e4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d27.h @@ -0,0 +1,269 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D27_ +#define _SAMA5D27_ + +#include "compiler.h" + +/** \addtogroup SAMA5D27_definitions SAMA5D27 definitions + This file defines all structures and symbols for SAMA5D27: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D27 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D27_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mcan.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D27 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D27_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xA0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define SDMMC1 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC1 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC0 ((Gmac *)0xF8008000U) /**< \brief (GMAC0 ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define USART0 ((Usart *)0xF8034200U) /**< \brief (FLEXCOM0_USART) Base Address */ +#define FCOMSPI0 ((Spi *)0xF8034400U) /**< \brief (FLEXCOM0_SPI) Base Address */ +#define TWI0 ((Twi *)0xF8034600U) /**< \brief (FLEXCOM0_TWI) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define USART1 ((Usart *)0xF8038200U) /**< \brief (FLEXCOM1_USART) Base Address */ +#define FCOMSPI1 ((Spi *)0xF8038400U) /**< \brief (FLEXCOM1_SPI) Base Address */ +#define TWI1 ((Twi *)0xF8038600U) /**< \brief (FLEXCOM1_TWI) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define MCAN0 ((Mcan *)0xF8054000U) /**< \brief (MCAN0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM2 ((Flexcom *)0xFC010000U) /**< \brief (FLEXCOM2) Base Address */ +#define USART2 ((Usart *)0xFC010200U) /**< \brief (FLEXCOM2_USART) Base Address */ +#define FCOMSPI2 ((Spi *)0xFC010400U) /**< \brief (FLEXCOM2_SPI) Base Address */ +#define TWI2 ((Twi *)0xFC010600U) /**< \brief (FLEXCOM2_TWI) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define USART3 ((Usart *)0xFC014200U) /**< \brief (FLEXCOM3_USART) Base Address */ +#define FCOMSPI3 ((Spi *)0xFC014400U) /**< \brief (FLEXCOM3_SPI) Base Address */ +#define TWI3 ((Twi *)0xFC014600U) /**< \brief (FLEXCOM3_TWI) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define USART4 ((Usart *)0xFC018200U) /**< \brief (FLEXCOM4_USART) Base Address */ +#define FCOMSPI4 ((Spi *)0xFC018400U) /**< \brief (FLEXCOM4_SPI) Base Address */ +#define TWI4 ((Twi *)0xFC018600U) /**< \brief (FLEXCOM4_TWI) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define MCAN1 ((Mcan *)0xFC050000U) /**< \brief (MCAN1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D27 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D27_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d27.h" + +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D27 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xA0000000u) /**< SDMMC 0 base address */ +#define SDMMC1_ADDR (0xB0000000u) /**< SDMMC 1 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D27 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D27 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D27_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d28.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d28.h new file mode 100644 index 000000000..53ece8fc7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/sama5d28.h @@ -0,0 +1,252 @@ +/* ---------------------------------------------------------------------------- */ +/* Atmel Microcontroller Software Support */ +/* SAM Software Package License */ +/* ---------------------------------------------------------------------------- */ +/* Copyright (c) 2015, Atmel Corporation */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following condition is met: */ +/* */ +/* - Redistributions of source code must retain the above copyright notice, */ +/* this list of conditions and the disclaimer below. */ +/* */ +/* Atmel's name may not be used to endorse or promote products derived from */ +/* this software without specific prior written permission. */ +/* */ +/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ +/* DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _SAMA5D28_ +#define _SAMA5D28_ + +/** \addtogroup SAMA5D28_definitions SAMA5D28 definitions + This file defines all structures and symbols for SAMA5D28: + - registers and bitfields + - peripheral base address + - peripheral ID + - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#include + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMA5D28 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D28_api Peripheral Software API */ +/*@{*/ + +#include "component/component_acc.h" +#include "component/component_adc.h" +#include "component/component_aesb.h" +#include "component/component_aes.h" +#include "component/component_aic.h" +#include "component/component_aximx.h" +#include "component/component_chipid.h" +#include "component/component_classd.h" +#include "component/component_flexcom.h" +#include "component/component_gmac.h" +#include "component/component_i2sc.h" +#include "component/component_icm.h" +#include "component/component_isc.h" +#include "component/component_l2cc.h" +#include "component/component_lcdc.h" +#include "component/component_matrix.h" +#include "component/component_mcan.h" +#include "component/component_mpddrc.h" +#include "component/component_pdmic.h" +#include "component/component_pio.h" +#include "component/component_pit.h" +#include "component/component_pmc.h" +#include "component/component_pwm.h" +#include "component/component_qspi.h" +#include "component/component_rstc.h" +#include "component/component_rtc.h" +#include "component/component_rxlp.h" +#include "component/component_sckc.h" +#include "component/component_sdmmc.h" +#include "component/component_sfc.h" +#include "component/component_sfr.h" +#include "component/component_sfrbu.h" +#include "component/component_sha.h" +#include "component/component_shdwc.h" +#include "component/component_smc.h" +#include "component/component_ssc.h" +#include "component/component_tc.h" +#include "component/component_tdes.h" +#include "component/component_trng.h" +#include "component/component_twihs.h" +#include "component/component_uart.h" +#include "component/component_udphs.h" +#include "component/component_wdt.h" +#include "component/component_xdmac.h" +/*@}*/ + +/* ************************************************************************** */ +/* BASE ADDRESS DEFINITIONS FOR SAMA5D28 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D28_base Peripheral Base Address Definitions */ +/*@{*/ + +#define AXIMX ((Aximx *)0x00600000U) /**< \brief (AXIMX ) Base Address */ +#define L2CC ((L2cc *)0x00A00000U) /**< \brief (L2CC ) Base Address */ +#define SDMMC0 ((Sdmmc *)0xA0000000U) /**< \brief (SDMMC0 ) Base Address */ +#define SDMMC1 ((Sdmmc *)0xB0000000U) /**< \brief (SDMMC1 ) Base Address */ +#define LCDC ((Lcdc *)0xF0000000U) /**< \brief (LCDC ) Base Address */ +#define XDMAC1 ((Xdmac *)0xF0004000U) /**< \brief (XDMAC1 ) Base Address */ +#define ISC ((Isc *)0xF0008000U) /**< \brief (ISC ) Base Address */ +#define MPDDRC ((Mpddrc *)0xF000C000U) /**< \brief (MPDDRC ) Base Address */ +#define XDMAC0 ((Xdmac *)0xF0010000U) /**< \brief (XDMAC0 ) Base Address */ +#define PMC ((Pmc *)0xF0014000U) /**< \brief (PMC ) Base Address */ +#define MATRIX0 ((Matrix *)0xF0018000U) /**< \brief (MATRIX0 ) Base Address */ +#define AESB ((Aesb *)0xF001C000U) /**< \brief (AESB ) Base Address */ +#define QSPI0 ((Qspi *)0xF0020000U) /**< \brief (QSPI0 ) Base Address */ +#define QSPI1 ((Qspi *)0xF0024000U) /**< \brief (QSPI1 ) Base Address */ +#define SHA ((Sha *)0xF0028000U) /**< \brief (SHA ) Base Address */ +#define AES ((Aes *)0xF002C000U) /**< \brief (AES ) Base Address */ +#define SPI0 ((Spi *)0xF8000000U) /**< \brief (SPI0 ) Base Address */ +#define SSC0 ((Ssc *)0xF8004000U) /**< \brief (SSC0 ) Base Address */ +#define GMAC0 ((Gmac *)0xF8008000U) /**< \brief (GMAC0 ) Base Address */ +#define TC0 ((Tc *)0xF800C000U) /**< \brief (TC0 ) Base Address */ +#define TC1 ((Tc *)0xF8010000U) /**< \brief (TC1 ) Base Address */ +#define HSMC ((Smc *)0xF8014000U) /**< \brief (HSMC ) Base Address */ +#define PDMIC ((Pdmic *)0xF8018000U) /**< \brief (PDMIC ) Base Address */ +#define UART0 ((Uart *)0xF801C000U) /**< \brief (UART0 ) Base Address */ +#define UART1 ((Uart *)0xF8020000U) /**< \brief (UART1 ) Base Address */ +#define UART2 ((Uart *)0xF8024000U) /**< \brief (UART2 ) Base Address */ +#define TWIHS0 ((Twihs *)0xF8028000U) /**< \brief (TWIHS0 ) Base Address */ +#define PWM ((Pwm *)0xF802C000U) /**< \brief (PWM ) Base Address */ +#define SFR ((Sfr *)0xF8030000U) /**< \brief (SFR ) Base Address */ +#define FLEXCOM0 ((Flexcom *)0xF8034000U) /**< \brief (FLEXCOM0) Base Address */ +#define FLEXCOM1 ((Flexcom *)0xF8038000U) /**< \brief (FLEXCOM1) Base Address */ +#define SAIC ((Aic *)0xF803C000U) /**< \brief (SAIC ) Base Address */ +#define ICM ((Icm *)0xF8040000U) /**< \brief (ICM ) Base Address */ +#define RSTC ((Rstc *)0xF8048000U) /**< \brief (RSTC ) Base Address */ +#define SHDWC ((Shdwc *)0xF8048010U) /**< \brief (SHDWC ) Base Address */ +#define PIT ((Pit *)0xF8048030U) /**< \brief (PIT ) Base Address */ +#define WDT ((Wdt *)0xF8048040U) /**< \brief (WDT ) Base Address */ +#define SCKC ((Sckc *)0xF8048050U) /**< \brief (SCKC ) Base Address */ +#define RTC ((Rtc *)0xF80480B0U) /**< \brief (RTC ) Base Address */ +#define RXLP ((Rxlp *)0xF8049000U) /**< \brief (RXLP ) Base Address */ +#define ACC ((Acc *)0xF804A000U) /**< \brief (ACC ) Base Address */ +#define SFC ((Sfc *)0xF804C000U) /**< \brief (SFC ) Base Address */ +#define I2SC0 ((I2sc *)0xF8050000U) /**< \brief (I2SC0 ) Base Address */ +#define MCAN0 ((Mcan *)0xF8054000U) /**< \brief (MCAN0 ) Base Address */ +#define SPI1 ((Spi *)0xFC000000U) /**< \brief (SPI1 ) Base Address */ +#define SSC1 ((Ssc *)0xFC004000U) /**< \brief (SSC1 ) Base Address */ +#define UART3 ((Uart *)0xFC008000U) /**< \brief (UART3 ) Base Address */ +#define UART4 ((Uart *)0xFC00C000U) /**< \brief (UART4 ) Base Address */ +#define FLEXCOM2 ((Flexcom *)0xFC010000U) /**< \brief (FLEXCOM2) Base Address */ +#define FLEXCOM3 ((Flexcom *)0xFC014000U) /**< \brief (FLEXCOM3) Base Address */ +#define FLEXCOM4 ((Flexcom *)0xFC018000U) /**< \brief (FLEXCOM4) Base Address */ +#define TRNG ((Trng *)0xFC01C000U) /**< \brief (TRNG ) Base Address */ +#define AIC ((Aic *)0xFC020000U) /**< \brief (AIC ) Base Address */ +#define TWIHS1 ((Twihs *)0xFC028000U) /**< \brief (TWIHS1 ) Base Address */ +#define UDPHS ((Udphs *)0xFC02C000U) /**< \brief (UDPHS ) Base Address */ +#define ADC ((Adc *)0xFC030000U) /**< \brief (ADC ) Base Address */ +#define PIOA ((Pio *)0xFC038000U) /**< \brief (PIOA ) Base Address */ +#define MATRIX1 ((Matrix *)0xFC03C000U) /**< \brief (MATRIX1 ) Base Address */ +#define TDES ((Tdes *)0xFC044000U) /**< \brief (TDES ) Base Address */ +#define CLASSD ((Classd *)0xFC048000U) /**< \brief (CLASSD ) Base Address */ +#define I2SC1 ((I2sc *)0xFC04C000U) /**< \brief (I2SC1 ) Base Address */ +#define MCAN1 ((Mcan *)0xFC050000U) /**< \brief (MCAN1 ) Base Address */ +#define SFRBU ((Sfrbu *)0xFC05C000U) /**< \brief (SFRBU ) Base Address */ +#define CHIPID ((Chipid *)0xFC069000U) /**< \brief (CHIPID ) Base Address */ + +/*@}*/ + +/* ************************************************************************** */ +/* PIO DEFINITIONS FOR SAMA5D28 */ +/* ************************************************************************** */ +/** \addtogroup SAMA5D28_pio Peripheral Pio Definitions */ +/*@{*/ + +#include "pio/pio_sama5d28.h" + +/*@}*/ + +/* ************************************************************************** */ +/* MEMORY MAPPING DEFINITIONS FOR SAMA5D28 */ +/* ************************************************************************** */ + + +#define EBI_CS0_ADDR (0x10000000u) /**< EBI Chip Select 0 base address */ +#define DDR_CS_ADDR (0x20000000u) /**< DDR Chip Select base address */ +#define DDR_AES_CS_ADDR (0x40000000u) /**< DDR with AES Chip Select base address */ +#define EBI_CS1_ADDR (0x60000000u) /**< EBI Chip Select 1 base address */ +#define EBI_CS2_ADDR (0x70000000u) /**< EBI Chip Select 2 base address */ +#define EBI_CS3_ADDR (0x80000000u) /**< EBI Chip Select 3 base address */ +#define QSPI_AES0_ADDR (0x90000000u) /**< QPSI Memory crypted with AES 0 base address */ +#define QSPI_AES1_ADDR (0x98000000u) /**< QPSI Memory crypted with AES 1 base address */ +#define SDMMC0_ADDR (0xA0000000u) /**< SDMMC 0 base address */ +#define SDMMC1_ADDR (0xB0000000u) /**< SDMMC 1 base address */ +#define NFC_ADDR (0xC0000000u) /**< NAND Flash Controller Command base address */ +#define QSPIMEM0_ADDR (0xD0000000u) /**< QSPI Memory 0 base address */ +#define QSPIMEM1_ADDR (0xD8000000u) /**< QSPI Memory 1 base address */ +#define IROM_ADDR (0x00000000u) /**< Internal ROM base address */ +#define ECC_ROM_ADDR (0x00040000u) /**< ECC ROM base address */ +#define NFC_RAM_ADDR (0x00100000u) /**< NAND Flash Controller RAM base address */ +#define IRAM0_ADDR (0x00200000u) /**< Internal RAM 0 base address */ +#define IRAM1_ADDR (0x00220000u) /**< Internal RAM 1 base address */ +#define UDPHS_RAM_ADDR (0x00300000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_OHCI_ADDR (0x00400000u) /**< USB High Speed Device Port RAM base address */ +#define UHPHS_EHCI_ADDR (0x00500000u) /**< USB High Speed Device Port RAM base address */ +#define AXIMX_ADDR (0x00600000u) /**< AXI Bus Matrix base address */ +#define DAP_ADDR (0x00700000u) /**< Debug Access Port base address */ +#define PTCMEM_ADDR (0x00800000u) /**< PTC Memory base address */ + +/* ************************************************************************** */ +/* MISCELLANEOUS DEFINITIONS FOR SAMA5D28 */ +/* ************************************************************************** */ + +#define CHIP_JTAGID (0x05B3F03FUL) +#define CHIP_CIDR (0x8A5C08C0UL) +#define CHIP_EXID (0x00000002UL) + +/* ************************************************************************** */ +/* ELECTRICAL DEFINITIONS FOR SAMA5D28 */ +/* ************************************************************************** */ + +/* %ATMEL_ELECTRICAL% */ + +/* Device characteristics */ +#define CHIP_FREQ_SLCK_RC_MIN (20000UL) +#define CHIP_FREQ_SLCK_RC (32000UL) +#define CHIP_FREQ_SLCK_RC_MAX (44000UL) +#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) +#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) +#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) +#define CHIP_FREQ_CPU_MAX (120000000UL) +#define CHIP_FREQ_XTAL_32K (32768UL) +#define CHIP_FREQ_XTAL_12M (12000000UL) + +/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ +#define CHIP_FREQ_FWS_0 (20000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ +#define CHIP_FREQ_FWS_1 (40000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ +#define CHIP_FREQ_FWS_2 (60000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ +#define CHIP_FREQ_FWS_3 (80000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ +#define CHIP_FREQ_FWS_4 (100000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ +#define CHIP_FREQ_FWS_5 (123000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* _SAMA5D28_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/common.gdb b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/common.gdb new file mode 100644 index 000000000..47ec2dc71 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/common.gdb @@ -0,0 +1,102 @@ +# Connect to the J-Link gdb server +define jlink_connect + target remote localhost:2331 +end + +define reset_peripherals + # Disable all interrupts and go to supervisor mode + mon reg cpsr = 0xd3 + + # Reset the chip to get to a known state + #monitor reset + + # Reset peripherals (using RSTC_CR) + set *0xF8048000 = 0xA5000004 + + # Reset L2 Cache controller + set *0x00A00100 = 0x0 + + # Disable Watchdog (using WDT_MR) + set *0xF8048044 = 0x00008000 + + # Disable D-Cache, I-Cache and MMU + mon cp15 1 0 0 0 = 0x00C50078 +end + +# Disable DDR clock and MPDDRC controller +# to avoid corrupted RAM data on soft reset. +define disable_ddr + set *0xF0014004 = 0x4 + set *0xF0014014 = (1 << 13) +end + +define reset_registers + # Zero registers (cannot reset core because it will disable JTAG) + mon reg r8_fiq = 0 + mon reg r9_fiq = 0 + mon reg r10_fiq = 0 + mon reg r11_fiq = 0 + mon reg r12_fiq = 0 + mon reg sp_fiq = 0 + mon reg lr_fiq = 0 + mon reg spsr_fiq = 0 + mon reg sp_irq = 0 + mon reg lr_irq = 0 + mon reg spsr_irq = 0 + mon reg sp_abt = 0 + mon reg lr_abt = 0 + mon reg spsr_abt = 0 + mon reg sp_und = 0 + mon reg lr_und = 0 + mon reg spsr_und = 0 + mon reg sp_svc = 0 + mon reg lr_svc = 0 + mon reg spsr_svc = 0 + mon reg r0 = 0 + mon reg r1 = 0 + mon reg r2 = 0 + mon reg r3 = 0 + mon reg r4 = 0 + mon reg r5 = 0 + mon reg r6 = 0 + mon reg r7 = 0 + mon reg r8_usr = 0 + mon reg r9_usr = 0 + mon reg r10_usr = 0 + mon reg r11_usr = 0 + mon reg r12_usr = 0 + mon reg sp_usr = 0 + mon reg lr_usr = 0 +end + +define init_ddr + + reset_registers + + load target/bootstrap.elf + + # Initialize PC + mon reg pc = 0x00200000 + mon reg pc = 0x00200000 + + continue +end + +define load_in_ddr + + reset_registers + + load + + # Initialize PC + mon reg pc = 0x20000000 +end + +define load_in_sram + reset_registers + + load + + # Initialize PC + mon reg pc = 0x00200000 +end diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/cstartup.S b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/cstartup.S new file mode 100644 index 000000000..62340a357 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/cstartup.S @@ -0,0 +1,291 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2014, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + + +//------------------------------------------------------------------------------ +// Definitions +//------------------------------------------------------------------------------ + +#define AIC 0xFC020000 +#define SAIC 0xF803C000 +#define AIC_IVR 0x10 +#define AIC_EOICR 0x38 + +#define MODE_MSK 0x1F + +#define ARM_MODE_FIQ 0x11 +#define ARM_MODE_IRQ 0x12 +#define ARM_MODE_SVC 0x13 +#define ARM_MODE_ABT 0x17 +#define ARM_MODE_UND 0x1B +#define ARM_MODE_SYS 0x1F + +#define I_BIT 0x80 +#define F_BIT 0x40 + +#define FPU_NON_SECURE_ACCESS_OFFSET 10 +#define FPU_ACCESS_CONTROL_OFFSET 20 +#define FPU_FPEXC_EN_BIT 0x40000000 + +//------------------------------------------------------------------------------ +// Startup routine +//------------------------------------------------------------------------------ + + .align 4 + .arm + +/* Exception vectors + *******************/ + .section .vectors, "a", %progbits + +resetVector: +/* Reset */ + ldr pc, =resetHandler +/* Undefined Instruction */ + ldr pc, =undefined_instruction_irq_handler +/* Software Interrupt */ + ldr pc, =software_interrupt_irq_handler +/* Prefetch Abort */ + ldr pc, =prefetch_abort_irq_handler +/* Data Abort */ + ldr pc, =data_abort_irq_handler +/* Reserved for future use */ +1: + b 1b +/* Interrupt */ + b irqHandler +/* Fast interrupt */ + b fiqHandler + +//------------------------------------------------------------------------------ +/// Handles a fast interrupt request by branching to the address defined in the +/// AIC. +//------------------------------------------------------------------------------ +fiqHandler: + sub lr, lr, #4 + stmfd sp!, {lr} + //mrs lr, SPSR + stmfd sp!, {r0} + + /* Write in the IVR to support Protect Mode */ + + ldr lr, =SAIC + ldr r0, [r14, #AIC_IVR] + str lr, [r14, #AIC_IVR] + + /* Branch to interrupt handler in Supervisor mode */ + + msr CPSR_c, #ARM_MODE_SVC + stmfd sp!, {r1-r3, r4, r12, lr} + + blx r0 + + ldmia sp!, {r1-r3, r4, r12, lr} + msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + + /* Acknowledge interrupt */ + + ldr lr, =SAIC + str lr, [r14, #AIC_EOICR] + + /* Restore interrupt context and branch back to calling code */ + + ldmia sp!, {r0} + //msr SPSR_cxsf, lr + ldmia sp!, {pc}^ + +//------------------------------------------------------------------------------ +/// Handles incoming interrupt requests by branching to the corresponding +/// handler, as defined in the AIC. Supports interrupt nesting. +//------------------------------------------------------------------------------ +irqHandler: + /* Save interrupt context on the stack to allow nesting */ + + sub lr, lr, #4 + stmfd sp!, {lr} + mrs lr, SPSR + stmfd sp!, {r0, lr} + + /* Write in the IVR to support Protect Mode */ + + ldr lr, =AIC + ldr r0, [r14, #AIC_IVR] + str lr, [r14, #AIC_IVR] + + /* Branch to interrupt handler in Supervisor mode */ + + msr CPSR_c, #ARM_MODE_SVC + stmfd sp!, {r1-r3, r4, r12, lr} + + /* Check for 8-byte alignment and save lr plus a */ + /* word to indicate the stack adjustment used (0 or 4) */ + + and r1, sp, #4 + sub sp, sp, r1 + stmfd sp!, {r1, lr} + + blx r0 + + ldmia sp!, {r1, lr} + add sp, sp, r1 + + ldmia sp!, {r1-r3, r4, r12, lr} + msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT + + /* Acknowledge interrupt */ + + ldr lr, =AIC + str lr, [r14, #AIC_EOICR] + + /* Restore interrupt context and branch back to calling code */ + + ldmia sp!, {r0, lr} + msr SPSR_cxsf, lr + ldmia sp!, {pc}^ + + +//------------------------------------------------------------------------------ +/// Initializes the chip and branches to the main() function. +//------------------------------------------------------------------------------ + .section .textEntry + .global entry + +entry: +resetHandler: + + cpsie a + +/* Useless instruction for referencing the .vectors section */ + + ldr r0, =resetVector + +/* Set pc to actual code location (i.e. not in remap zone) */ + + ldr pc, =1f +1: + +/* Relocate */ + ldr r0, =_etext + ldr r1, =_srelocate + ldr r2, =_erelocate +1: + cmp r1, r2 + ldrcc r3, [r0], #4 + strcc r3, [r1], #4 + bcc 1b + +/* Set up the fast interrupt stack pointer */ + + mrs r0, CPSR + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_FIQ + msr CPSR_c, r0 + ldr sp, =_fiqstack + bic sp, sp, #0x7 + +/* Set up the normal interrupt stack pointer */ + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_IRQ + msr CPSR_c, r0 + ldr sp, =_irqstack + bic sp, sp, #0x7 + +/* Set up the abort mode stack pointer */ + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_ABT + msr CPSR_c, r0 + ldr sp, =_abtstack + bic sp, sp, #0x7 + +/* Set up the undefined mode stack pointer */ + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_UND + msr CPSR_c, r0 + ldr sp, =_undstack + bic sp, sp, #0x7 + +/* Set up the system mode stack pointer */ + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_SYS + msr CPSR_c, r0 + ldr sp, =_sysstack + bic sp, sp, #0x7 + +/* Set up the supervisor mode stack pointer */ + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_SVC + msr CPSR_c, r0 + ldr sp, =_cstack + bic sp, sp, #0x7 + +/* Perform low-level initialization of the chip using low_level_init() */ + + ldr r0, =low_level_init + blx r0 + +/* Clear the zero segment */ + ldr r0, =_szero + ldr r1, =_ezero + mov r2, #0 +1: + cmp r0, r1 + strcc r2, [r0], #4 + bcc 1b + +/* Enable fpu */ + /* Grant non secure access for CP10 and CP11 */ + mrc p15, 0, r0, c1, c1, 2 + orr r0, r0, #3 << FPU_NON_SECURE_ACCESS_OFFSET + mcr p15, 0, r0, c1, c1, 2 + /* Set CP10 and CP11 access permission (Privileged and User mode) */ + ldr r0, =(0xF << FPU_ACCESS_CONTROL_OFFSET) + mcr p15, 0, r0, c1, c0, 2 + /* Set the FPEXC EN bit to enable the FPU (and NEON instructions) */ + mov r1, #FPU_FPEXC_EN_BIT + vmsr FPEXC, r1 + +/* Initialize the C library */ + + ldr r0, =__libc_init_array + blx r0 + +/* Branch to main() */ + + ldr r0, =main + blx r0 + +/* Loop indefinitely when program is finished */ + +1: + b 1b diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.gdb b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.gdb new file mode 100644 index 000000000..b30b41e3d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.gdb @@ -0,0 +1,12 @@ +source target/common.gdb + +define reset + jlink_connect + reset_peripherals + disable_ddr + + init_ddr + load_in_ddr + # Show registers state + mon regs +end diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.ld b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.ld new file mode 100644 index 000000000..fdc049313 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.ld @@ -0,0 +1,196 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal DDRAM on the SAMA5-MIURA + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(entry) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + sram (W!RX) : ORIGIN = 0x200000, LENGTH = 128K /* sram */ + ddr (W!RX) : ORIGIN = 0x20000000, LENGTH = 64M /* ddr */ + ddr_nocache (RWX) : ORIGIN = 0x24000000, LENGTH = 16M /* ddr (non-cached) */ +} + +/* Sizes of the stacks used by the application. NOTE: you need to adjust */ +C_STACK_SIZE = 0x3000; +IRQ_STACK_SIZE = 0x60; +FIQ_STACK_SIZE = 0x60; +SYS_STACK_SIZE = 0x40; +ABT_STACK_SIZE = 0x40; +UND_STACK_SIZE = 0x40; +HEAP_SIZE = 0x200; + +/* Section Definitions */ +SECTIONS +{ + .fixed0 : + { + . = ALIGN(4); + _sfixed = .; + *(.textEntry) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.cp15_*) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + *(.data .data.*); + . = ALIGN(4); + _efixed = .; /* End of text section */ + } >ddr + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >ddr + PROVIDE_HIDDEN (__exidx_end = .); + + /* _etext must be just before .relocate section */ + . = ALIGN(4); + _etext = .; + + .relocate : + { + . = ALIGN(4); + _srelocate = .; + *(.vectors); + *(.ramfunc) + . = ALIGN(4); + _erelocate = .; + } >sram AT>ddr + + .region_sram (NOLOAD) : + { + . = ALIGN(4); + *(.region_sram) + } >sram + + .region_ddr (NOLOAD) : + { + . = ALIGN(4); + *(.region_ddr) + } >ddr + + .region_ddr_nocache (NOLOAD) : + { + . = ALIGN(4); + *(.region_ddr_nocache) + } >ddr_nocache + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } >ddr + + .stack (NOLOAD) : + { + __stack_start__ = . ; + + . += IRQ_STACK_SIZE; + . = ALIGN (4); + _irqstack = . ; + + . += FIQ_STACK_SIZE; + . = ALIGN (4); + _fiqstack = . ; + + . += ABT_STACK_SIZE; + . = ALIGN (4); + _abtstack = . ; + + . += UND_STACK_SIZE; + . = ALIGN (4); + _undstack = . ; + + . += SYS_STACK_SIZE; + . = ALIGN (4); + _sysstack = . ; + + . += C_STACK_SIZE; + . = ALIGN (4); + _cstack = . ; + + . += HEAP_SIZE; + . = ALIGN (4); + _heap = . ; + + __stack_end__ = .; + } >ddr +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.gdb b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.gdb new file mode 100644 index 000000000..934db3ffe --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.gdb @@ -0,0 +1,15 @@ +source target/common.gdb + +# define 'reset' command +define reset + + # Connect to the J-Link gdb server + jlink_connect + + reset_peripherals + + disable_ddr + + load_in_sram + +end diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.ld b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.ld new file mode 100644 index 000000000..1f121e7aa --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.ld @@ -0,0 +1,194 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * Linker script for running in internal SRAM on the SAMA5D2 + *----------------------------------------------------------------------------*/ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(entry) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + sram (W!RX) : ORIGIN = 0x200000, LENGTH = 128K /* sram */ + ddr (W!RX) : ORIGIN = 0x20000000, LENGTH = 64M /* ddr */ + ddr_nocache (RWX) : ORIGIN = 0x24000000, LENGTH = 16M /* ddr (non-cached) */ +} + +/* Sizes of the stacks used by the application. NOTE: you need to adjust */ +C_STACK_SIZE = 0x3000; +IRQ_STACK_SIZE = 0x60; +FIQ_STACK_SIZE = 0x60; +SYS_STACK_SIZE = 0x40; +ABT_STACK_SIZE = 0x40; +UND_STACK_SIZE = 0x40; +HEAP_SIZE = 0x200; + +/* Section Definitions */ +SECTIONS +{ + .fixed0 : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.textEntry) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.cp15_*) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + *(.data .data.*); + . = ALIGN(4); + _efixed = .; /* End of text section */ + + /* no relocation when running from sram */ + _srelocate = .; + _erelocate = .; + } >sram + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >sram + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .region_sram (NOLOAD) : + { + . = ALIGN(4); + *(.region_sram) + } >sram + + .region_ddr (NOLOAD) : + { + . = ALIGN(4); + *(.region_ddr) + } >ddr + + .region_ddr_nocache (NOLOAD) : + { + . = ALIGN(4); + *(.region_ddr_nocache) + } >ddr_nocache + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } >sram + + .stack (NOLOAD) : + { + __stack_start__ = . ; + + . += IRQ_STACK_SIZE; + . = ALIGN (4); + _irqstack = . ; + + . += FIQ_STACK_SIZE; + . = ALIGN (4); + _fiqstack = . ; + + . += ABT_STACK_SIZE; + . = ALIGN (4); + _abtstack = . ; + + . += UND_STACK_SIZE; + . = ALIGN (4); + _undstack = . ; + + . += SYS_STACK_SIZE; + . = ALIGN (4); + _sysstack = . ; + + . += C_STACK_SIZE; + . = ALIGN (4); + _cstack = . ; + + . += HEAP_SIZE; + . = ALIGN (4); + _heap = . ; + + __stack_end__ = .; + } >sram + + _end = . ; + __end = . ; + PROVIDE(end = .); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/cstartup.s b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/cstartup.s new file mode 100644 index 000000000..3df5232e4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/cstartup.s @@ -0,0 +1,290 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION IRQ_STACK:DATA:NOROOT(2) + SECTION FIQ_STACK:DATA:NOROOT(2) + SECTION ABT_STACK:DATA:NOROOT(2) + SECTION UND_STACK:DATA:NOROOT(2) + SECTION SYS_STACK:DATA:NOROOT(2) + SECTION CSTACK:DATA:NOROOT(3) + +//------------------------------------------------------------------------------ +// Headers +//------------------------------------------------------------------------------ + +#define __ASSEMBLY__ + +//------------------------------------------------------------------------------ +// Definitions +//------------------------------------------------------------------------------ + +AT91C_BASE_AIC DEFINE 0xFC020000 +AT91C_BASE_SAIC DEFINE 0xF803C000 +AIC_IVR DEFINE 0x10 +AIC_EOICR DEFINE 0x38 + +MODE_MSK DEFINE 0x1F ; Bit mask for mode bits in CPSR + +ARM_MODE_ABT DEFINE 0x17 +ARM_MODE_FIQ DEFINE 0x11 +ARM_MODE_IRQ DEFINE 0x12 +ARM_MODE_SVC DEFINE 0x13 +ARM_MODE_SYS DEFINE 0x1F +ARM_MODE_UND DEFINE 0x1B + +I_BIT DEFINE 0x80 +F_BIT DEFINE 0x40 + +//------------------------------------------------------------------------------ +// Startup routine +//------------------------------------------------------------------------------ + + SECTION .vectors:CODE:NOROOT(2) + + PUBLIC _reset_vector + PUBLIC __iar_program_start + PUBLIC irqHandler + PUBLIC fiqHandler + + EXTERN undefined_instruction_irq_handler + EXTERN prefetch_abort_irq_handler + EXTERN data_abort_irq_handler + EXTERN software_interrupt_irq_handler + + DATA + +__iar_init$$done: ; The vector table is not needed + ; until after copy initialization is done + +_reset_vector: ; Make this a DATA label, so that stack usage + ; analysis doesn't consider it an uncalled fun + + ARM + + ldr pc, reset_addr ; 0x0 Reset + ldr pc, undefined_addr ; 0x4 Undefined instructions + ldr pc, soft_int_addr ; 0x8 Software interrupt (SWI/SVC) + ldr pc, prefetch_abt_addr ; 0xc Prefetch abort + ldr pc, data_abt_addr ; 0x10 Data abort + DCD 0 ; 0x14 RESERVED + ldr pc, irq_addr ; 0x18 IRQ + ldr pc, fiq_addr ; 0x1c FIQ + + DATA + +; All default handlers (except reset, irq and fiq) are +; defined as weak symbol definitions. +; If a handler is defined by the application it will take precedence. +reset_addr: DCD __iar_program_start +undefined_addr: DCD undefined_instruction_irq_handler +soft_int_addr: DCD software_interrupt_irq_handler +prefetch_abt_addr: DCD prefetch_abort_irq_handler +data_abt_addr: DCD data_abort_irq_handler +irq_addr: DCD irqHandler +fiq_addr: DCD fiqHandler + +;------------------------------------------------------------------------------ +; Handles a fast interrupt request by branching to the address defined in the +; AIC. +;------------------------------------------------------------------------------ + SECTION .text:CODE:NOROOT(2) + ARM +fiqHandler: + sub lr, lr, #4 + stmfd sp!, {lr} + stmfd sp!, {r0} + + ; Write in the IVR to support Protect Mode + + ldr lr, =AT91C_BASE_SAIC + ldr r0, [r14, #AIC_IVR] + str lr, [r14, #AIC_IVR] + + ; Branch to interrupt handler in Supervisor mode + + msr CPSR_c, #ARM_MODE_SVC + stmfd sp!, { r1-r3, r4, r12, lr} + + blx r0 + + ldmia sp!, { r1-r3, r4, r12, lr} + msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT + + ; Acknowledge interrupt + + ldr lr, =AT91C_BASE_SAIC + str lr, [r14, #AIC_EOICR] + + ; Restore interrupt context and branch back to calling code + ldmia sp!, {r0} + ldmia sp!, {pc}^ + +;------------------------------------------------------------------------------ +; Handles incoming interrupt requests by branching to the corresponding +; handler, as defined in the AIC. Supports interrupt nesting. +;------------------------------------------------------------------------------ + SECTION .text:CODE:NOROOT(2) + ARM +irqHandler: + ; Save interrupt context on the stack to allow nesting + + sub lr, lr, #4 + stmfd sp!, {lr} + mrs lr, SPSR + stmfd sp!, {r0, lr} + + ; Write in the IVR to support Protect Mode + + ldr lr, =AT91C_BASE_AIC + ldr r0, [r14, #AIC_IVR] + str lr, [r14, #AIC_IVR] + + ; Branch to interrupt handler in Supervisor mode + + msr CPSR_c, #ARM_MODE_SVC + stmfd sp!, { r1-r3, r4, r12, lr} + + ; Check for 8-byte alignment and save lr plus a + ; word to indicate the stack adjustment used (0 or 4) + + and r1, sp, #4 + sub sp, sp, r1 + stmfd sp!, {r1, lr} + + blx r0 + + ldmia sp!, {r1, lr} + add sp, sp, r1 + + ldmia sp!, { r1-r3, r4, r12, lr} + msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT + + ; Acknowledge interrupt + + ldr lr, =AT91C_BASE_AIC + str lr, [r14, #AIC_EOICR] + + ; Restore interrupt context and branch back to calling code + + ldmia sp!, {r0, lr} + msr SPSR_cxsf, lr + ldmia sp!, {pc}^ + +//------------------------------------------------------------------------------ +/// Initializes the chip and branches to the main() function. +//------------------------------------------------------------------------------ + + SECTION .text:CODE:NOROOT(2) + PUBLIC __iar_program_start + EXTERN __cmain + EXTERN low_level_init + REQUIRE _reset_vector + + EXTWEAK __iar_init_core + EXTWEAK __iar_init_vfp + + ARM + +__iar_program_start: +?cstartup: + + cpsie a + + ; Set up the fast interrupt stack pointer + + mrs r0, CPSR + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_FIQ + msr cpsr_c, r0 + ldr sp, =SFE(FIQ_STACK) + bic sp, sp, #0x7 + + ; Set up the normal interrupt stack pointer + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_IRQ + msr CPSR_c, r0 + ldr sp, =SFE(IRQ_STACK) + bic sp, sp, #0x7 + + ; Set up the abort mode stack pointer + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_ABT + msr CPSR_c, r0 + ldr sp, =SFE(ABT_STACK) + bic sp, sp, #0x7 + + ; Set up the undefined mode stack pointer + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_UND + msr CPSR_c, r0 + ldr sp, =SFE(UND_STACK) + bic sp, sp, #0x7 + + ; Set up the system mode stack pointer + + bic r0, r0, #MODE_MSK + orr r0, r0, #ARM_MODE_SYS + msr CPSR_c, r0 + ldr sp, =SFE(SYS_STACK) + bic sp, sp, #0x7 + + ; Set up the supervisor mode stack pointer + + bic r0 ,r0, #MODE_MSK + orr r0 ,r0, #ARM_MODE_SVC + msr cpsr_c, r0 + ldr sp, =SFE(CSTACK) + bic sp, sp, #0x7 + + ; Perform low-level initialization of the chip using low_level_init() + + ldr r0, =low_level_init + blx r0 + + ; Turn on core features assumed to be enabled + FUNCALL __iar_program_start, __iar_init_core + bl __iar_init_core + + ;; Initialize VFP (if needed) + FUNCALL __iar_program_start, __iar_init_vfp + bl __iar_init_vfp + + FUNCALL __iar_program_start, __cmain + bl __cmain + + ;; Loop indefinitely when program is finished +loop4: b loop4 + + END diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram.icf b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram.icf new file mode 100644 index 000000000..9882375f0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram.icf @@ -0,0 +1,65 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_1.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_IROM1_start__ = 0x0; +define symbol __ICFEDIT_region_IROM1_end__ = 0x0; +define symbol __ICFEDIT_region_IROM2_start__ = 0x0; +define symbol __ICFEDIT_region_IROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM1_start__ = 0x0; +define symbol __ICFEDIT_region_EROM1_end__ = 0x0; +define symbol __ICFEDIT_region_EROM2_start__ = 0x0; +define symbol __ICFEDIT_region_EROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM3_start__ = 0x0; +define symbol __ICFEDIT_region_EROM3_end__ = 0x0; +define symbol __ICFEDIT_region_IRAM1_start__ = 0x200000; +define symbol __ICFEDIT_region_IRAM1_end__ = 0x21FFFF; +define symbol __ICFEDIT_region_IRAM2_start__ = 0x0; +define symbol __ICFEDIT_region_IRAM2_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM1_start__ = 0x20000000; +define symbol __ICFEDIT_region_ERAM1_end__ = 0x23FFFFFF; +define symbol __ICFEDIT_region_ERAM2_start__ = 0x24000000; +define symbol __ICFEDIT_region_ERAM2_end__ = 0x24FFFFFF; +define symbol __ICFEDIT_region_ERAM3_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM3_end__ = 0x0; +/*-Sizes-*/ +define symbol __ICFEDIT_size_intvec__ = 0x100; +define symbol __ICFEDIT_size_irqstack__ = 0x60; +define symbol __ICFEDIT_size_fiqstack__ = 0x60; +define symbol __ICFEDIT_size_abtstack__ = 0x40; +define symbol __ICFEDIT_size_undstack__ = 0x40; +define symbol __ICFEDIT_size_sysstack__ = 0x40; +define symbol __ICFEDIT_size_cstack__ = 0x3000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region VEC_region = mem:[from __ICFEDIT_region_IRAM1_start__ size __ICFEDIT_size_intvec__]; +define region RAM_region = mem:[from __ICFEDIT_region_IRAM1_start__+__ICFEDIT_size_intvec__ to __ICFEDIT_region_IRAM1_end__]; +define region DDRAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]; +define region DDRAM_NOCACHE_region = mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; +define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; +define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; +define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; +define block SYS_STACK with alignment = 8, size = __ICFEDIT_size_sysstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy with packing=none { readwrite }; +do not initialize { readonly section .noinit }; +/* Warning: ICC still considers the sections below as zero-initialized, by default. */ +do not initialize { section .region_sram }; +do not initialize { section .region_ddr }; +do not initialize { section .region_ddr_nocache }; + +place in VEC_region { section .vectors }; +place in RAM_region { section .region_sram }; +place in DDRAM_region { readonly }; +place in DDRAM_region { section .cstartup }; +place in DDRAM_region { readwrite, block IRQ_STACK, block FIQ_STACK, block ABT_STACK, block UND_STACK, block SYS_STACK, block CSTACK, block HEAP }; +place in DDRAM_region { section .region_ddr }; +place in DDRAM_NOCACHE_region { section .region_ddr_nocache }; diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram_sama5d2-xplained.mac b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram_sama5d2-xplained.mac new file mode 100644 index 000000000..775620a1e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/ddram_sama5d2-xplained.mac @@ -0,0 +1,499 @@ +// --------------------------------------------------------- +// ATMEL Microcontroller Software Support +// --------------------------------------------------------- +// The software is delivered "AS IS" without warranty or +// condition of any kind, either express, implied or +// statutory. This includes without limitation any warranty +// or condition with respect to merchantability or fitness +// for any particular purpose, or against the infringements of +// intellectual property rights of others. +// --------------------------------------------------------- +// File: sama5d2-xplained_ddram.mac +// User setup file for CSPY debugger. +// +// --------------------------------------------------------- + +__var __tempo_var; +__var __tempo_reg; +__var __dummy_read; +__var __ba_offset; +__var __data_test; +__var __mac_i; + +__var REG_CKGR_MOR; +__var CKGR_MOR_MOSCXTEN; +__var CKGR_MOR_MOSCXTBY; +__var CKGR_MOR_MOSCRCEN; +__var CKGR_MOR_MOSCSEL; +__var REG_CKGR_MCFR; +__var CKGR_MCFR_MAINFRDY; +__var REG_PMC_SR; +__var PMC_SR_MCKRDY; +__var PMC_SR_LOCKA; +__var PMC_PCK_CSS_MAIN_CLK; +__var REG_CKGR_PLLAR; +__var REG_PMC_PLLICPR; +__var REG_PMC_MCKR; +__var PMC_MCKR_PLLADIV2_DIV2; +__var PMC_MCKR_PRES_Msk; +__var PMC_MCKR_PRES_CLOCK; +__var PMC_MCKR_MDIV_Msk; +__var PMC_MCKR_MDIV_PCK_DIV3; +__var PMC_MCKR_CSS_PLLA_CLK; +__var PMC_SR_MOSCSELS; + +__var REG_MPDDRC_RTR; + +/********************************************************************* +* pmc_select_external_osc() +* +* Function description +* Select external 12MHz oscillator +*********************************************************************/ +pmc_select_external_osc() +{ + REG_CKGR_MOR = 0xF0014020; + CKGR_MOR_MOSCXTEN = (0x1 << 0); /*(CKGR_MOR) Main Crystal Oscillator Enable */ + CKGR_MOR_MOSCXTBY = (0x1 << 1); /*(CKGR_MOR) Main Crystal Oscillator Bypass */ + CKGR_MOR_MOSCRCEN = (0x1 << 3); /*(CKGR_MOR) Main On-Chip RC Oscillator Enable */ + CKGR_MOR_MOSCSEL = (0x1 << 24); /*(CKGR_MOR) Main Oscillator Selection */ + + REG_CKGR_MCFR = 0xF0014024; /*(PMC) Main Clock Frequency Register */ + CKGR_MCFR_MAINFRDY = (0x1 << 16); /*(CKGR_MCFR) Main Clock Ready */ + + REG_PMC_SR = 0xF0014068; /*(PMC) Status Register */ + PMC_SR_MOSCSELS = (0x1 << 16); /*(PMC_SR) Main Oscillator Selection Status */ + PMC_SR_MCKRDY = (0x1 << 3); /*(PMC_SR) Master Clock Status */ + + /* enable external OSC 12 MHz */ + __tempo_var = __readMemory32(REG_CKGR_MOR,"Memory"); + __tempo_var |= CKGR_MOR_MOSCXTEN | (0x37 << 16); + __writeMemory32(__tempo_var,REG_CKGR_MOR,"Memory"); + + /* wait Main CLK Ready */ + while(!((__readMemory32(REG_CKGR_MCFR,"Memory")) & CKGR_MCFR_MAINFRDY)); + + /* disable external OSC 12 MHz bypass */ + __tempo_var = __readMemory32(REG_CKGR_MOR,"Memory"); + __tempo_var = (__tempo_var & ~CKGR_MOR_MOSCXTBY) | (0x37 << 16); + __writeMemory32(__tempo_var,REG_CKGR_MOR,"Memory"); + + /* switch MAIN clock to external OSC 12 MHz*/ + __tempo_var = __readMemory32(REG_CKGR_MOR,"Memory"); + __tempo_var |= CKGR_MOR_MOSCSEL | (0x37 << 16); + __writeMemory32(__tempo_var,REG_CKGR_MOR,"Memory"); + + /* wait MAIN clock status change for external OSC 12 MHz selection*/ + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MOSCSELS)); + + /* in case when MCK is running on MAIN CLK */ + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MCKRDY)); + +} + +/********************************************************************* +* pmc_switch_mck_to_main() +* +* Function description +* Switch PMC from MCK to main clock. +*********************************************************************/ +pmc_switch_mck_to_main() +{ + REG_PMC_MCKR = 0xF0014030; /*(PMC) Master Clock Register */ + PMC_PCK_CSS_MAIN_CLK = (0x1 << 0); /*(PMC_PCK[3]) Main Clock is selected */ + + REG_PMC_SR = 0xF0018068; /*(PMC) Status Register */ + PMC_SR_MCKRDY = (0x1 << 3); /*(PMC_SR) Master Clock Status */ + + /* Select Main Oscillator as input clock for PCK and MCK */ + __tempo_var = __readMemory32(REG_PMC_MCKR,"Memory"); + __tempo_var = (__tempo_var & ~0x03)| PMC_PCK_CSS_MAIN_CLK ; + __writeMemory32(__tempo_var, REG_PMC_MCKR,"Memory"); + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MCKRDY)); + __mac_i=__readMemory32(REG_PMC_MCKR,"Memory"); + __message " --- Master clock switched to main --- REG_PMC_MCKR 0x",__mac_i:%X; +} + +/********************************************************************* +* pmc_set_plla() +* +* Function description +* Configure PLLA Registe. +*********************************************************************/ +pmc_set_plla(pllmul) +{ + REG_CKGR_PLLAR = 0xF0014028; /*(PMC) PLLA Register */ + REG_PMC_PLLICPR = 0xF0014080; /*(PMC) PLL Charge Pump Current Register */ + REG_PMC_SR = 0xF0014068; /*(PMC) Status Register */ + PMC_SR_LOCKA = (0x1 << 1); /*(PMC_SR) PLLA Lock Status */ + + __writeMemory32(((0x1 << 29) | (0x3F << 8) | ( 0 << 14) | ((pllmul) << 18) | 1 ), REG_CKGR_PLLAR,"Memory"); + //__writeMemory32((0x03<<8), REG_PMC_PLLICPR,"Memory"); + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_LOCKA)); + __mac_i=__readMemory32(REG_CKGR_PLLAR,"Memory"); + __message " --- PLL A set up -------------------- REG_CKGR_PLLAR 0x",__mac_i:%X; +} + +/********************************************************************* +* pmc_set_mck_plla_div() +* +* Function description +* Configure MCK PLLA divider. +*********************************************************************/ +pmc_set_mck_plla_div() +{ + REG_PMC_MCKR = 0xF0014030; /*(PMC) Master Clock Register */ + PMC_MCKR_PLLADIV2_DIV2 = (0x1 << 12); /*(PMC_MCKR) PLLA clock frequency is divided by 2. */ + __tempo_var = __readMemory32(REG_PMC_MCKR,"Memory"); + if ((__tempo_var & PMC_MCKR_PLLADIV2_DIV2) != PMC_MCKR_PLLADIV2_DIV2) + { + __tempo_var |= PMC_MCKR_PLLADIV2_DIV2; + __writeMemory32(__tempo_var, REG_PMC_MCKR,"Memory"); + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MCKRDY)); + } +} + +/********************************************************************* +* pmc_set_mck_prescaler() +* +* Function description +* Configure MCK Prescaler. +*********************************************************************/ +pmc_set_mck_prescaler() +{ + REG_PMC_MCKR = 0xF0014030; /*(PMC) Master Clock Register */ + PMC_MCKR_PRES_Msk = (0x7 << 4); /*(PMC_MCKR) Master/Processor Clock Prescaler */ + PMC_MCKR_PRES_CLOCK = (0x0 << 4); /*(PMC_MCKR) Selected clock */ + + /* Change MCK Prescaler divider in PMC_MCKR register */ + __tempo_var = __readMemory32(REG_PMC_MCKR,"Memory"); + __tempo_var = (__tempo_var & ~PMC_MCKR_PRES_Msk) | PMC_MCKR_PRES_CLOCK; + __writeMemory32(__tempo_var, REG_PMC_MCKR,"Memory"); + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MCKRDY)); + __mac_i=__readMemory32(REG_PMC_MCKR,"Memory"); + __message " --- Master clock prescaler set ------ REG_PMC_MCKR 0x",__mac_i:%X; +} + +/********************************************************************* +* pmc_set_mck_divider() +* +* Function description +* Configure MCK Divider. +*********************************************************************/ +pmc_set_mck_divider() +{ + REG_PMC_MCKR = 0xF0014030; /*(PMC) Master Clock Register */ + PMC_MCKR_MDIV_Msk = (0x3 << 8); /*(PMC_MCKR) Master Clock Division */ + PMC_MCKR_MDIV_PCK_DIV3 = (0x3 << 8); /*(PMC_MCKR) Master Clock is Prescaler Output Clock divided by 3.SysClk DDR is equal to 2 x MCK. DDRCK is equal to MCK. */ + + /* change MCK Prescaler divider in PMC_MCKR register */ + __tempo_var = __readMemory32(REG_PMC_MCKR,"Memory"); + __tempo_var = (__tempo_var & ~PMC_MCKR_MDIV_Msk) | PMC_MCKR_MDIV_PCK_DIV3; + __writeMemory32(__tempo_var, REG_PMC_MCKR,"Memory"); + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MCKRDY)); + __mac_i=__readMemory32(REG_PMC_MCKR,"Memory"); + __message " --- Master clock divider set -------- REG_PMC_MCKR 0x",__mac_i:%X; +} + +/********************************************************************* +* pmc_switch_mck_to_pll() +* +* Function description +* Switch PMC from MCK to PLL clock. +*********************************************************************/ +pmc_switch_mck_to_pll() +{ + REG_PMC_MCKR = 0xF0014030; /*(PMC) Master Clock Register */ + PMC_MCKR_CSS_PLLA_CLK = (0x2 << 0); /*(PMC_MCKR) PLLACK/PLLADIV2 is selected */ + + /* Select PLL as input clock for PCK and MCK */ + __tempo_var = __readMemory32(REG_PMC_MCKR,"Memory"); + __tempo_var = (__tempo_var & ~0x03) | PMC_MCKR_CSS_PLLA_CLK; + __writeMemory32(__tempo_var, REG_PMC_MCKR,"Memory"); + while(!((__readMemory32(REG_PMC_SR,"Memory")) & PMC_SR_MCKRDY)); + __mac_i=__readMemory32(REG_PMC_MCKR,"Memory"); + __message " --- Master clock is on PLL ---------- REG_PMC_MCKR 0x",__mac_i:%X; +} + + + +send_nop() +{ + __writeMemory32(0x00000001,0xF000C000,"Memory"); + /* Write to memory to acknoledge the command */ + __writeMemory32(0x00000000,0x20000000,"Memory"); +} + +send_ext_lmr(opcode, offset) +{ + __writeMemory32(0x00000005,0xF000C000,"Memory"); + /* Write to memory to acknoledge the command */ + __writeMemory32(0x00000000,0x20000000 + (opcode << offset),"Memory"); +} + +send_lmr() +{ + __writeMemory32(0x00000003,0xF000C000,"Memory"); + /* Write to memory to acknoledge the command */ + __writeMemory32(0x00000000,0x20000000,"Memory"); +} + +send_calib() +{ + __writeMemory32(0x00000006,0xF000C000,"Memory"); + /* Write to memory to acknoledge the command */ + __writeMemory32(0x00000000,0x20000000,"Memory"); +} + +send_normal() +{ + __writeMemory32(0x00000000,0xF000C000,"Memory"); + /* Write to memory to acknoledge the command */ + __writeMemory32(0x00000000,0x20000000,"Memory"); +} + + +matrix_configure_slave_ddr() +{ + + /* matrix_remove_write_protection(MATRIX0);*/ + __tempo_reg = 0xF00181E4; + __tempo_var = (0x4D4154u << 8); + __writeMemory32(__tempo_var, __tempo_reg,"Memory"); + + for (__tempo_var = 3 ; __tempo_var < 10 ; __tempo_var = __tempo_var + 1) + { + __tempo_reg = 0xF0018200 + 4 * __tempo_var; + /* matrix_configure_slave_sec(MATRIX0, i, 0xFF, 0xFF, 0xFF); */ + __writeMemory32(0xFFFFFF, __tempo_reg,"Memory"); + + /* matrix_set_slave_split_addr(MATRIX0, i, MATRIX_AREA_128M, 0xF);*/ + __tempo_reg = 0xF0018240 + 4 * __tempo_var; + __writeMemory32(0xFFFF, __tempo_reg,"Memory"); + + /* matrix_set_slave_region_size(MATRIX0, i, MATRIX_AREA_128M, 0x1); */ + __tempo_reg = 0xF0018280 + 4 * __tempo_var; + __writeMemory32(0xF, __tempo_reg,"Memory"); + } +} + +initialize_ddr() +{ + REG_MPDDRC_RTR = 0xF000C004; + matrix_configure_slave_ddr(); + + /* Enable DDR and MPDDRC clocks */ + __writeMemory32((1<<2), 0xF0014000, "Memory"); + + __writeMemory32(13, 0xF001410C, "Memory"); + __writeMemory32((13 | (1<<28) | (1<<12)) , 0xF001410C, "Memory"); + + /* Step 1: Program memory device type */ + __writeMemory32(0x00000004, 0xF000C020, "Memory"); + + /* set driver impedance */ + __writeMemory32(0x00000004, 0xF000C034, "Memory"); + __writeMemory32(0x00000002, 0xF000C05C, "Memory"); + + /* Step 2: Program features of the DDR3-SDRAM device in the + * configuration register and timing parameter registers (TPR0 + * TPR1 and TPR2) */ + __writeMemory32(0x00d0025d, 0xF000C008, "Memory"); + + /* Timings */ + /* tp0 */ + __writeMemory32(0x44439425, 0xF000C00C, "Memory"); //0x32139336 + /* tp1 */ + __writeMemory32(0x0f001d1b, 0xF000C010, "Memory"); //0x03001d1b + /* tp2 */ + __writeMemory32(0x00072000, 0xF000C014, "Memory"); //0x00072328 + + __tempo_var = __readMemory32(0xF000C008,"Memory"); + __ba_offset = (__tempo_var & 0x3) + 9; + + if (!(__tempo_var & (1<<0x22))== (1<<0x22) ) + { + __ba_offset += ((__tempo_var & (0x3<<2))>>2) + 11; + } + + __tempo_var = __readMemory32(0xF000C020,"Memory"); + + if (__tempo_var & 0x10) + { + __ba_offset += 1; + } + else + { + __ba_offset += 2; + } + + /* + * Step 3: Issue a NOP command to the memory controller using + * its mode register (MPDDRC_MR). + */ + send_nop(); + + /* + * Step 4: A pause of at least 500us must be observed before a + * single toggle. + */ + __delay(50); + + /* + * Step 5: Issue a NOP command to the memory controller using + * its mode register (MPDDRC_MR). CKE is now driven high. + */ + send_nop(); + __delay(10); + + /* + * Step 6: Issue Extended Mode Register Set 2 (EMRS2) cycle to + * choose between commercial or high temperature + * operations. + */ + send_ext_lmr(0x2, __ba_offset); + __delay(10); + + /* + * Step 7: Issue Extended Mode Register Set 3 (EMRS3) cycle to set + * the Extended Mode Register to 0. + */ + send_ext_lmr(0x3, __ba_offset); + __delay(10); + + /* + * Step 8: Issue Extended Mode Register Set 1 (EMRS1) cycle to + * disable and to program O.D.S. (Output Driver Strength). + */ + send_ext_lmr(0x1, __ba_offset); + __delay(10); + + /* + * Step 9: Write a one to the DLL bit (enable DLL reset) in the MPDDRC + * Configuration Register (MPDDRC_CR) + */ + /* Not done for DDR3 */ + + /* + * Step 10: Issue a Mode Register Set (MRS) cycle to reset DLL. + */ + send_lmr(); + __delay(10); + + /* + * Step 11: Issue a Calibration command (MRS) cycle to calibrate RTT and + * RON values for the Process Voltage Temperature (PVT). + */ + send_calib(); + __delay(10); + + /* + * Step 12: A Normal Mode command is provided. + * Program the Normal mode in the MPDDRC_MR and perform a write access + * to any DDR3-SDRAM address to acknowledge this command. + */ + send_normal(); + __delay(10); + /* + * Step 13: Perform a write access to any DDR3-SDRAM address. + */ + __writeMemory32(0x00000000,0x20000000,"Memory"); + + /* Last step: Write the refresh rate */ + /* Refresh Timer is (64ms / (bank_size)) * master_clock */ + __writeMemory32(0x511, REG_MPDDRC_RTR,"Memory"); + __delay(10); + +} + +initialize_clocks() +{ + pmc_select_external_osc(); + pmc_switch_mck_to_main(); + pmc_set_mck_plla_div(); + pmc_set_plla(82); + pmc_set_mck_prescaler(); + pmc_set_mck_divider(); + pmc_switch_mck_to_pll(); +} + +/********************************************************************* +* execUserReset() +*********************************************************************/ +execUserReset() +{ + __message "--- execUserReset -------------------"; + + /* Reset peripherals (using RSTC_CR) */ + __writeMemory32(0xA5000004, 0xF8048000, "Memory"); + + /* Disable Watchdog (using WDT_MR) */ + __writeMemory32(0x00008000, 0xF8048044, "Memory"); + + /* Disable D-Cache, I-Cache and MMU */ + __jtagCP15WriteReg(1, 0, 0, 0, 0x00C50078); + + /* Disable all interrupts and go to supervisor mode */ + #CPSR = 0xD3; + + /* Zero registers (cannot reset core because it will disable JTAG) */ + #R8_fiq = 0; + #R9_fiq = 0; + #R10_fiq = 0; + #R11_fiq = 0; + #R12_fiq = 0; + #SP_fiq = 0; + #LR_fiq = 0; + #SPSR_fiq = 0; + #SP_irq = 0; + #LR_irq = 0; + #SPSR_irq = 0; + #SP_abt = 0; + #LR_abt = 0; + #SPSR_abt = 0; + #SP_und = 0; + #LR_und = 0; + #SPSR_und = 0; + #SP_svc = 0; + #LR_svc = 0; + #SPSR_svc = 0; + #R0 = 0; + #R1 = 0; + #R2 = 0; + #R3 = 0; + #R4 = 0; + #R5 = 0; + #R6 = 0; + #R7 = 0; + #R8_usr = 0; + #R9_usr = 0; + #R10_usr = 0; + #R11_usr = 0; + #R12_usr = 0; + #SP_usr = 0; + #LR_usr = 0; +} + +/********************************************************************* +* execUserPreload() +*********************************************************************/ +execUserPreload() +{ + __message "------------------------------ execUserPreload ---------------------------------"; + /* Reset peripherals (using RSTC_CR) */ + __writeMemory32(0xA5000004, 0xF8048000, "Memory"); + + /* Disable Watchdog (using WDT_MR) */ + __writeMemory32(0x00008000, 0xF8048044, "Memory"); + + /* Disable D-Cache, I-Cache and MMU */ + __jtagCP15WriteReg(1, 0, 0, 0, 0x00C50078); + + /* Reset L2 Cache controller */ + __writeMemory32(0x0, 0x00A00100, "Memory"); + + + initialize_clocks(); + + initialize_ddr(); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.icf b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.icf new file mode 100644 index 000000000..342fec5c7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.icf @@ -0,0 +1,65 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_1.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_IROM1_start__ = 0x0; +define symbol __ICFEDIT_region_IROM1_end__ = 0x0; +define symbol __ICFEDIT_region_IROM2_start__ = 0x0; +define symbol __ICFEDIT_region_IROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM1_start__ = 0x0; +define symbol __ICFEDIT_region_EROM1_end__ = 0x0; +define symbol __ICFEDIT_region_EROM2_start__ = 0x0; +define symbol __ICFEDIT_region_EROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM3_start__ = 0x0; +define symbol __ICFEDIT_region_EROM3_end__ = 0x0; +define symbol __ICFEDIT_region_IRAM1_start__ = 0x200000; +define symbol __ICFEDIT_region_IRAM1_end__ = 0x21FFFF; +define symbol __ICFEDIT_region_IRAM2_start__ = 0x0; +define symbol __ICFEDIT_region_IRAM2_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM1_start__ = 0x20000000; +define symbol __ICFEDIT_region_ERAM1_end__ = 0x23FFFFFF; +define symbol __ICFEDIT_region_ERAM2_start__ = 0x24000000; +define symbol __ICFEDIT_region_ERAM2_end__ = 0x24FFFFFF; +define symbol __ICFEDIT_region_ERAM3_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM3_end__ = 0x0; +/*-Sizes-*/ +define symbol __ICFEDIT_size_intvec__ = 0x100; +define symbol __ICFEDIT_size_irqstack__ = 0x60; +define symbol __ICFEDIT_size_fiqstack__ = 0x60; +define symbol __ICFEDIT_size_abtstack__ = 0x40; +define symbol __ICFEDIT_size_undstack__ = 0x40; +define symbol __ICFEDIT_size_sysstack__ = 0x40; +define symbol __ICFEDIT_size_cstack__ = 0x3000; +define symbol __ICFEDIT_size_heap__ = 0x200; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region VEC_region = mem:[from __ICFEDIT_region_IRAM1_start__ size __ICFEDIT_size_intvec__]; +define region RAM_region = mem:[from __ICFEDIT_region_IRAM1_start__+__ICFEDIT_size_intvec__ to __ICFEDIT_region_IRAM1_end__]; +define region DDRAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__]; +define region DDRAM_NOCACHE_region = mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; +define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; +define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; +define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; +define block SYS_STACK with alignment = 8, size = __ICFEDIT_size_sysstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy with packing=none { readwrite }; +do not initialize { readonly section .noinit }; +/* Warning: ICC still considers the sections below as zero-initialized, by default. */ +do not initialize { section .region_sram }; +do not initialize { section .region_ddr }; +do not initialize { section .region_ddr_nocache }; + +place in VEC_region { section .vectors }; +place in RAM_region { readonly }; +place in RAM_region { section .cstartup }; +place in RAM_region { readwrite, block IRQ_STACK, block FIQ_STACK, block ABT_STACK, block UND_STACK, block SYS_STACK, block CSTACK, block HEAP }; +place in RAM_region { section .region_sram }; +place in DDRAM_region { section .region_ddr }; +place in DDRAM_NOCACHE_region { section .region_ddr_nocache }; diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.mac b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.mac new file mode 100644 index 000000000..2b05b0453 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/iar/sram.mac @@ -0,0 +1,75 @@ +/********************************************************************* +* execUserReset() +*********************************************************************/ +execUserReset() +{ + __message "------------------------------ execUserReset ---------------------------------"; + + /* Reset peripherals (using RSTC_CR) */ + __writeMemory32(0xA5000004, 0xF8048000, "Memory"); + + /* Disable Watchdog (using WDT_MR) */ + __writeMemory32(0x00008000, 0xF8048044, "Memory"); + + /* Disable D-Cache, I-Cache and MMU */ + __jtagCP15WriteReg(1, 0, 0, 0, 0x00C50078); + + /* Reset L2 Cache controller */ + __writeMemory32(0x0, 0x00A00100, "Memory"); + + /* Disable DDR clock and MPDDRC controller to avoid */ + /* corrupted RAM data on soft reset. */ + __writeMemory32(0x00000004, 0xF0014004, "Memory"); + __writeMemory32(0x00002000, 0xF0014014, "Memory"); + + /* Disable all interrupts and go to supervisor mode */ + #CPSR = 0xD3; + + /* Zero registers (cannot reset core because it will disable JTAG) */ + #R8_fiq = 0; + #R9_fiq = 0; + #R10_fiq = 0; + #R11_fiq = 0; + #R12_fiq = 0; + #SP_fiq = 0; + #LR_fiq = 0; + #SPSR_fiq = 0; + #SP_irq = 0; + #LR_irq = 0; + #SPSR_irq = 0; + #SP_abt = 0; + #LR_abt = 0; + #SPSR_abt = 0; + #SP_und = 0; + #LR_und = 0; + #SPSR_und = 0; + #SP_svc = 0; + #LR_svc = 0; + #SPSR_svc = 0; + #R0 = 0; + #R1 = 0; + #R2 = 0; + #R3 = 0; + #R4 = 0; + #R5 = 0; + #R6 = 0; + #R7 = 0; + #R8_usr = 0; + #R9_usr = 0; + #R10_usr = 0; + #R11_usr = 0; + #R12_usr = 0; + #SP_usr = 0; + #LR_usr = 0; + + /* Initialize PC */ + #PC = 0x200000; +} + +/********************************************************************* +* execUserPreload() +*********************************************************************/ +execUserPreload() +{ + __message "------------------------------ execUserPreload ---------------------------------"; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/Makefile.inc b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/Makefile.inc new file mode 100644 index 000000000..899550aa6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/Makefile.inc @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------- +# SAM Software Package License +# ---------------------------------------------------------------------------- +# Copyright (c) 2015, Atmel Corporation +# +# 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 disclaimer below. +# +# Atmel's name may not be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE +# DISCLAIMED. IN NO EVENT SHALL ATMEL 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. +# ---------------------------------------------------------------------------- + +CFLAGS_INC += -I$(TOP)/utils + +lib-y += utils/utils.a + +utils-y := utils/dbg_util.o +utils-y += utils/hamming.o +utils-y += utils/rand.o +utils-y += utils/trace.o +utils-y += utils/syscalls.o +utils-y += utils/crc.o +utils-y += utils/timer.o +utils-y += utils/mutex.o +utils-y += utils/mutex_gcc.o +utils-y += utils/font.o +utils-y += utils/lcd_draw.o +utils-y += utils/lcd_font.o +utils-y += utils/wav.o + +UTILS_OBJS := $(addprefix $(BUILDDIR)/,$(utils-y)) + +-include $(UTILS_OBJS:.o=.d) + +$(BUILDDIR)/utils/utils.a: $(UTILS_OBJS) + @mkdir -p $(dir $@) + $(ECHO) AR $@ + $(Q)$(AR) -cr $@ $^ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/README.utils.md b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/README.utils.md new file mode 100644 index 000000000..e69de29bb diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.c new file mode 100644 index 000000000..13777c7fb --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.c @@ -0,0 +1,54 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Provide a routine for asynchronos transfer. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "chip.h" +#include "async.h" + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ +/** +* \brief Returns 1 if the given transfer has ended; otherwise returns 0. +* \param pAsync Pointer to an Async instance. +*/ +uint32_t async_is_finished(struct _async * pAsync) +{ + return (pAsync->status != ASYNC_STATUS_PENDING); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.h new file mode 100644 index 000000000..33cabbecd --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/async.h @@ -0,0 +1,76 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Provide a routine for asynchronous transfer. + * + */ + +#ifndef _ASYNC_ +#define _ASYNC_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ +#include + +/*---------------------------------------------------------------------------- + * Definition + *----------------------------------------------------------------------------*/ +/** Transfer is still pending.*/ +#define ASYNC_STATUS_PENDING 0xFF + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------- + * Type + *----------------------------------------------------------------------------*/ +/** \brief Asynchronous transfer descriptor. */ +struct _async { + /** Asynchronous transfer status.*/ + volatile uint32_t status; + /** Callback function to invoke when transfer completes or fails.*/ + void *callback; + /** Driver storage area; do not use.*/ + uint8_t pStorage[12]; +} ; + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ +extern uint32_t async_is_finished(struct _async * pAsync); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _ASYNC_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/compiler.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/compiler.h new file mode 100644 index 000000000..4d6384324 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/compiler.h @@ -0,0 +1,68 @@ +#ifndef _COMPILER_H_ +#define _COMPILER_H_ + +#define _CC_PRAGMA(x) _Pragma(#x) + +#define PACK_SET(alignment) _CC_PRAGMA(pack(alignment)) +#define PACK_RESET() _CC_PRAGMA(pack()) + +#if defined(__ICCARM__) + #define WEAK __weak + #define CONSTRUCTOR + #define SECTION(a) _CC_PRAGMA(location = a) + #define ALIGNED(a) _CC_PRAGMA(data_alignment = a) +#elif defined(__GNUC__) + #define WEAK __attribute__((weak)) + #define CONSTRUCTOR __attribute__((constructor)) + #define SECTION(a) __attribute__((__section__(a))) + #define ALIGNED(a) __attribute__((__aligned__(a))) +#else + #error Unknown compiler! +#endif + +#if defined(__ICCARM__) + #define DMB() asm("dmb") + #define DSB() asm("dsb") + #define ISB() asm("isb") + #define COMPILER_BARRIER() +#elif defined(__GNUC__) + #define DMB() asm("dmb":::"memory") + #define DSB() asm volatile ("dsb":::"memory") + #define ISB() asm volatile ("isb":::"memory") + #define COMPILER_BARRIER() asm volatile ("":::"memory") +#else + #error Unknown compiler! +#endif + +#ifndef NULL + #define NULL ((void*)0) +#endif + +#define ROUND_UP_MULT(x,m) (((x) + ((m)-1)) & ~((m)-1)) + +#define ROUND_INT_DIV(n,d) ((2 * (n) + (d)) / (2 * (d))) + +#define ARRAY_SIZE(x) (sizeof ((x)) / sizeof(*(x))) + +#define _STRINGY_EXPAND(x) #x +#define STRINGIFY(x) _STRINGY_EXPAND(x) + +#if defined(__GNUC__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)) + #define SWAP(a, b) do { \ + __auto_type _swp = (a); \ + (a) = (b); \ + (b) = _swp; } while (0) +#else + /* The compiler will replace memcpy calls with direct assignations */ + #define SWAP(a, b) do { \ + uint8_t _swp[sizeof(a) == sizeof(b) ? (signed)sizeof(a) : -1]; \ + memcpy(_swp, &(a), sizeof(a)); \ + memcpy(&(a), &(b), sizeof(a)); \ + memcpy(&(b), _swp, sizeof(a)); } while(0) +#endif + +#define BIG_ENDIAN_TO_HOST(x) (((x) & 0xFF) << 24) | (((x) & 0xFF00) << 8) \ + | (((x) & 0xFF0000) >> 8) | (((x) & 0xFF000000) >> 24) + +#endif /* _COMPILER_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.c new file mode 100644 index 000000000..b1958d3ef --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.c @@ -0,0 +1,92 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "chip.h" + +#include "crc.h" + +/*------------------------------------------------------------------------------ + * Local variables + *----------------------------------------------------------------------------*/ + +uint8_t Crc8; + +//------------------------------------------------------------------------------ +/// Local functions +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Calculate the CRC8 of the byte value provided with the current +// global 'crc8' value. +// Returns current global crc8 value +//------------------------------------------------------------------------------ + +static const uint8_t dscrc_table[] = +{ + 0, 94,188,226, 97, 63,221,131,194,156,126, 32,163,253, 31, 65, + 157,195, 33,127,252,162, 64, 30, 95, 1,227,189, 62, 96,130,220, + 35,125,159,193, 66, 28,254,160,225,191, 93, 3,128,222, 60, 98, + 190,224, 2, 92,223,129, 99, 61,124, 34,192,158, 29, 67,161,255, + 70, 24,250,164, 39,121,155,197,132,218, 56,102,229,187, 89, 7, + 219,133,103, 57,186,228, 6, 88, 25, 71,165,251,120, 38,196,154, + 101, 59,217,135, 4, 90,184,230,167,249, 27, 69,198,152,122, 36, + 248,166, 68, 26,153,199, 37,123, 58,100,134,216, 91, 5,231,185, + 140,210, 48,110,237,179, 81, 15, 78, 16,242,172, 47,113,147,205, + 17, 79,173,243,112, 46,204,146,211,141,111, 49,178,236, 14, 80, + 175,241, 19, 77,206,144,114, 44,109, 51,209,143, 12, 82,176,238, + 50,108,142,208, 83, 13,239,177,240,174, 76, 18,145,207, 45,115, + 202,148,118, 40,171,245, 23, 73, 8, 86,180,234,105, 55,213,139, + 87, 9,235,181, 54,104,138,212,149,203, 41,119,244,170, 72, 22, + 233,183, 85, 11,136,214, 52,106, 43,117,151,201, 74, 20,246,168, + 116, 42,200,150, 21, 75,169,247,182,232, 10, 84,215,137,107, 53}; + +static uint8_t _do_crc8 (uint8_t value) +{ + return dscrc_table[Crc8 ^ value]; +} + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ + +uint8_t compute_crc8 (uint8_t* pData, uint8_t Length) +{ + Crc8 = 0x00; + while (Length) + { + Crc8 = _do_crc8( *pData); + pData ++; + Length--; + } + return Crc8; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.h new file mode 100644 index 000000000..4a9a30d12 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/crc.h @@ -0,0 +1,41 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CRC_H_ +#define _CRC_H_ + +#include + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ + +extern uint8_t compute_crc8 (uint8_t* pData, uint8_t Length); + + +#endif // _CRC_H_ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.c new file mode 100644 index 000000000..929ba7772 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.c @@ -0,0 +1,292 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * Implement simple DBGU usage as stream receiver. + */ + +/*------------------------------- + * Headers + *-------------------------------*/ + +//#include +#include +#include "dbg_util.h" +#include "timer.h" + +#include "misc/console.h" + +/*------------------------------- + * Defines + *-------------------------------*/ + +/** Data RX timeout in binary start up */ +#define TIMEOUT_RX_START (1000*20) +/** Data RX timeout default value */ +#define TIMEOUT_RX (200) + +/* ASCII Character Codes */ +#define SOH 0x01 +#define STX 0x02 +#define EOT 0x04 +#define CTRL_D 0x04 /**< Transfer Done */ +#define ACK 0x06 +#define NAK 0x15 +#define CAN 0x18 /**< Cancel transfer */ +#define CTRL_X 0x24 + +/* 1K XMODEM Parameters */ +#define SOH_LENGTH 128 +#define STX_LENGTH 1024 +#define SOH_TIMEOUT 1000 + +/*------------------------------- + * Local functions + *-------------------------------*/ + +/** + * \brief Compute the CRC + */ +static uint16_t +_GetCRC(uint8_t bByte, uint16_t wCrc) +{ + int32_t cnt; + uint8_t newBit; + for (cnt = 7; cnt >= 0; cnt--) { + newBit = ((wCrc >> 15) & 0x1) ^ ((bByte >> cnt) & 0x1); + wCrc <<= 1; + if (newBit) + wCrc ^= (0x1021); + } + return wCrc; + +} + +/*------------------------------- + * Exported functions + *-------------------------------*/ + +/** + * \brief Receives byte with timeout. + * \param pByte pointer to locate received byte, can be NULL + * to discard data. + * \param timeOut timeout setting, in number of ticks. + */ +uint8_t +DbgReceiveByte(uint8_t * pByte, uint32_t timeOut) +{ + uint32_t tick; + uint32_t delay; + tick = timer_get_tick(); + while (1) { + if (console_is_rx_ready()) { + uint8_t tmp = console_get_char(); + if (pByte) + *pByte = tmp; + return 1; + } + + if (timeOut == 0) { + /* Never timeout */ + } else { + delay = timer_get_interval(tick, timer_get_tick()); + if (delay > timeOut) { + return 0; + } + } + } +} + +/** + * \brief Receives raw binary file through DBGU. + * \param bStart 1 to start a new data stream. + * \param address receiving data address + * \param maxSize max receive data size in bytes + * \return number of received bytes + */ +uint32_t +DbgReceiveBinary(uint8_t bStart, uint32_t address, uint32_t maxSize) +{ + volatile uint32_t tick0; + uint32_t delay; + uint8_t *pBuffer = (uint8_t *) address; + uint8_t xSign = 0; + uint32_t rxCnt = 0; + + if (maxSize == 0) + return 0; + + if (bStart) { + printf("\n\r-- Please start binary data in %d seconds:\n\r", + TIMEOUT_RX_START / 1000); + tick0 = timer_get_tick(); + while (1) { + if (console_is_rx_ready()) { + pBuffer[rxCnt++] = console_get_char(); + console_put_char(' '); + break; + } else { + delay = timer_get_interval(tick0, timer_get_tick()); + if ((delay % 1000) == 0) { + if (xSign == 0) { + console_put_char('*'); + xSign = 1; + } + } else if (xSign) { + xSign = 0; + } + + if (delay > TIMEOUT_RX_START) { + printf("\n\rRX timeout!\n\r"); + return rxCnt; + } + } + } + } + /* Get data */ + while (1) { + tick0 = timer_get_tick(); + while (1) { + if (console_is_rx_ready()) { + pBuffer[rxCnt++] = console_get_char(); + if ((rxCnt % (10 * 1024)) == 0) { + console_put_char('.'); + } + if (rxCnt >= maxSize) { + /* Wait until file transfer finished */ + return rxCnt; + } + break; + } + delay = timer_get_interval(tick0, timer_get_tick()); + if (delay > TIMEOUT_RX) { + return rxCnt; + } + } + } +} + +/** + * \brief Receives raw binary file through DBGU. + * + * \note When "CCC..", uses Ctrl + D to exit. + * + * \param pktBuffer 1K size packet buffer + * \param address receiving data address + * \param maxSize max receive data size in bytes + * \return number of received bytes + */ +uint32_t +DbgReceive1KXModem(uint8_t * pktBuffer, uint32_t address, uint32_t maxSize) +{ + uint8_t inChar; + uint32_t i, index = 0, pktLen = 0; + uint8_t pktNum = 0, prevPktNum = 0; + uint32_t error = 0; + uint16_t inCrc, myCrc; + uint8_t inCheckSum = 0xFF, checkSum = 0; + uint8_t *pBuffer = (uint8_t *) address; + uint32_t totalLen = 0; + + console_put_char('C'); + while (1) { + if (!DbgReceiveByte(&inChar, SOH_TIMEOUT)) { + console_put_char('C'); + continue; + } + /* Done */ + if (EOT == inChar) { + error = 0; + console_put_char(ACK); + break; + } else if (CAN == inChar) { + error = 2; + } else if (CTRL_X == inChar) { + error = 3; + } else if (SOH == inChar) { + pktLen = SOH_LENGTH; + } else if (STX == inChar) { + pktLen = STX_LENGTH; + } else + continue; + /* Get Packet Number */ + if (!DbgReceiveByte(&pktNum, SOH_TIMEOUT)) + error = 4; + /* Get 1's complement of packet number */ + if (!DbgReceiveByte(&inChar, SOH_TIMEOUT)) + error = 5; + /* Get 1 packet of information. */ + checkSum = 0; + myCrc = 0; + index = 0; + for (i = 0; i < pktLen; i++) { + if (!DbgReceiveByte(&inChar, SOH_TIMEOUT)) + error = 6; + checkSum += inChar; + myCrc = _GetCRC(inChar, myCrc); + if (pktNum != prevPktNum) { + pktBuffer[index++] = inChar; + } + } + /* Get CRC bytes */ + if (!DbgReceiveByte(&inCheckSum, SOH_TIMEOUT)) + error = 7; + inCrc = inCheckSum << 8; + if (!DbgReceiveByte(&inCheckSum, SOH_TIMEOUT)) + error = 7; + inCrc += inCheckSum; + /* If CRC error, NAK */ + if (error || (inCrc != myCrc)) { + console_put_char(NAK); + error = 0; + } + /* Save packet, ACK and next */ + else { + prevPktNum = pktNum; + + /* Buffer full? */ + if (totalLen + pktLen > maxSize) { + /* Copy until buffer full? */ + /* Stop transfer */ + console_put_char(CAN); + return totalLen; + } + + /* Copy the packet */ + for (i = 0; i < pktLen; i++) { + pBuffer[totalLen + i] = pktBuffer[i]; + } + totalLen += pktLen; + console_put_char(ACK); + } + } + + return totalLen; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.h new file mode 100644 index 000000000..0d07b0209 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/dbg_util.h @@ -0,0 +1,64 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \section Purpose + * + * Implements DBG utility that uses DBGU and System tick to get byte or binary + * stream from DBGU console. + */ + +#ifndef _DBG_UTIL_ +#define _DBG_UTIL_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +extern uint8_t DbgReceiveByte(uint8_t * pByte, uint32_t timeOut); + +extern uint32_t DbgReceiveBinary(uint8_t start, + uint32_t address, uint32_t maxSize); + +extern uint32_t DbgReceive1KXModem(uint8_t * pktBuffer, + uint32_t address, uint32_t maxSize); + +#endif /* _DBG_UTIL_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.c new file mode 100644 index 000000000..f8aedf6b0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.c @@ -0,0 +1,555 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +#include "font.h" + +/*---------------------------------------------------------------------------- + * + *----------------------------------------------------------------------------*/ + +struct _font_parameters font_param[NB_FONT] = { + {10, 14, 2, pCharset10x14}, + {10, 8, 1, pCharset10x8}, + {8, 8, 1, pCharset8x8}, + {6, 8, 0, pCharset6x8}, +} ; + +/*---------------------------------------------------------------------------- + * Char set of font 10x14 + *----------------------------------------------------------------------------*/ + +const uint8_t pCharset10x14[] = +{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xCC, + 0xFF, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF0, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0xC0, 0x0C, 0xC0, 0xFF, 0xFC, 0xFF, 0xFC, 0x0C, 0xC0, + 0x0C, 0xC0, 0xFF, 0xFC, 0xFF, 0xFC, 0x0C, 0xC0, 0x0C, 0xC0, + 0x0C, 0x60, 0x1E, 0x70, 0x3F, 0x30, 0x33, 0x30, 0xFF, 0xFC, + 0xFF, 0xFC, 0x33, 0x30, 0x33, 0xF0, 0x39, 0xE0, 0x18, 0xC0, + 0x60, 0x00, 0xF0, 0x0C, 0xF0, 0x3C, 0x60, 0xF0, 0x03, 0xC0, + 0x0F, 0x00, 0x3C, 0x18, 0xF0, 0x3C, 0xC0, 0x3C, 0x00, 0x18, + 0x3C, 0xF0, 0x7F, 0xF8, 0xC3, 0x1C, 0xC7, 0x8C, 0xCF, 0xCC, + 0xDC, 0xEC, 0x78, 0x78, 0x30, 0x30, 0x00, 0xFC, 0x00, 0xCC, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0xEC, 0x00, + 0xF8, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0F, 0xC0, 0x3F, 0xF0, 0x78, 0x78, + 0x60, 0x18, 0xC0, 0x0C, 0xC0, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, 0xC0, 0x0C, 0x60, 0x18, + 0x78, 0x78, 0x3F, 0xF0, 0x0F, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x60, 0x0E, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x3F, 0xF8, + 0x3F, 0xF8, 0x03, 0x80, 0x07, 0xC0, 0x0E, 0xE0, 0x0C, 0x60, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x3F, 0xF0, + 0x3F, 0xF0, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x00, 0x44, 0x00, 0xEC, 0x00, 0xF8, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x00, 0x18, 0x00, 0x3C, 0x00, 0x3C, 0x00, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0C, 0x00, 0x3C, 0x00, 0xF0, 0x03, 0xC0, + 0x0F, 0x00, 0x3C, 0x00, 0xF0, 0x00, 0xC0, 0x00, 0x00, 0x00, + 0x3F, 0xF0, 0x7F, 0xF8, 0xE0, 0xFC, 0xC1, 0xCC, 0xC3, 0x8C, + 0xC7, 0x0C, 0xCE, 0x0C, 0xFC, 0x1C, 0x7F, 0xF8, 0x3F, 0xF0, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x0C, 0x70, 0x0C, 0xFF, 0xFC, + 0xFF, 0xFC, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x0C, 0x70, 0x1C, 0xE0, 0x3C, 0xC0, 0x7C, 0xC0, 0xEC, + 0xC1, 0xCC, 0xC3, 0x8C, 0xE7, 0x0C, 0x7E, 0x0C, 0x3C, 0x0C, + 0x30, 0x30, 0x70, 0x38, 0xE0, 0x1C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xE3, 0x1C, 0x7F, 0xF8, 0x3C, 0xF0, + 0x03, 0xC0, 0x07, 0xC0, 0x0E, 0xC0, 0x1C, 0xC0, 0x38, 0xC0, + 0x70, 0xC0, 0xFF, 0xFC, 0xFF, 0xFC, 0x00, 0xC0, 0x00, 0xC0, + 0xFC, 0x30, 0xFC, 0x38, 0xCC, 0x1C, 0xCC, 0x0C, 0xCC, 0x0C, + 0xCC, 0x0C, 0xCC, 0x0C, 0xCE, 0x1C, 0xC7, 0xF8, 0xC3, 0xF0, + 0x3F, 0xF0, 0x7F, 0xF8, 0xE3, 0x1C, 0xC3, 0x0C, 0xC3, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xE3, 0x9C, 0x71, 0xF8, 0x30, 0xF0, + 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC3, 0xFC, + 0xC7, 0xFC, 0xCE, 0x00, 0xDC, 0x00, 0xF8, 0x00, 0xF0, 0x00, + 0x3C, 0xF0, 0x7F, 0xF8, 0xE7, 0x9C, 0xC3, 0x0C, 0xC3, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xE7, 0x9C, 0x7F, 0xF8, 0x3C, 0xF0, + 0x3C, 0x00, 0x7E, 0x00, 0xE7, 0x0C, 0xC3, 0x0C, 0xC3, 0x1C, + 0xC3, 0x38, 0xC3, 0x70, 0xE7, 0xE0, 0x7F, 0xC0, 0x3F, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x60, 0x3C, 0xF0, + 0x3C, 0xF0, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x44, 0x3C, 0xEC, + 0x3C, 0xF8, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x07, 0x80, 0x0F, 0xC0, 0x1C, 0xE0, + 0x38, 0x70, 0x70, 0x38, 0xE0, 0x1C, 0xC0, 0x0C, 0x00, 0x00, + 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, + 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, + 0x00, 0x00, 0xC0, 0x0C, 0xE0, 0x1C, 0x70, 0x38, 0x38, 0x70, + 0x1C, 0xE0, 0x0F, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x70, 0x00, 0xE0, 0x00, 0xC0, 0x00, 0xC1, 0xEC, + 0xC3, 0xEC, 0xC3, 0x00, 0xE6, 0x00, 0x7E, 0x00, 0x3C, 0x00, + 0x30, 0xF0, 0x71, 0xF8, 0xE3, 0x9C, 0xC3, 0x0C, 0xC3, 0xFC, + 0xC3, 0xFC, 0xC0, 0x0C, 0xE0, 0x1C, 0x7F, 0xF8, 0x3F, 0xF0, + 0x3F, 0xFC, 0x7F, 0xFC, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, + 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xC0, 0x7F, 0xFC, 0x3F, 0xFC, + 0xFF, 0xFC, 0xFF, 0xFC, 0xC3, 0x0C, 0xC3, 0x0C, 0xC3, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xE7, 0x9C, 0x7F, 0xF8, 0x3C, 0xF0, + 0x3F, 0xF0, 0x7F, 0xF8, 0xE0, 0x1C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xC0, 0x0C, 0xC0, 0x0C, 0xE0, 0x1C, 0x70, 0x38, 0x30, 0x30, + 0xFF, 0xFC, 0xFF, 0xFC, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xC0, 0x0C, 0xC0, 0x0C, 0xE0, 0x1C, 0x7F, 0xF8, 0x3F, 0xF0, + 0xFF, 0xFC, 0xFF, 0xFC, 0xC3, 0x0C, 0xC3, 0x0C, 0xC3, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xC3, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xFF, 0xFC, 0xFF, 0xFC, 0xC3, 0x00, 0xC3, 0x00, 0xC3, 0x00, + 0xC3, 0x00, 0xC3, 0x00, 0xC3, 0x00, 0xC0, 0x00, 0xC0, 0x00, + 0x3F, 0xF0, 0x7F, 0xF8, 0xE0, 0x1C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xE3, 0x1C, 0x73, 0xF8, 0x33, 0xF0, + 0xFF, 0xFC, 0xFF, 0xFC, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xFF, 0xFC, 0xFF, 0xFC, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, 0xC0, 0x0C, 0xFF, 0xFC, + 0xFF, 0xFC, 0xC0, 0x0C, 0xC0, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x38, 0xC0, 0x1C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xC0, 0x1C, 0xFF, 0xF8, 0xFF, 0xF0, 0xC0, 0x00, 0xC0, 0x00, + 0xFF, 0xFC, 0xFF, 0xFC, 0x07, 0x80, 0x07, 0x80, 0x0F, 0xC0, + 0x1C, 0xE0, 0x38, 0x70, 0x70, 0x38, 0xE0, 0x1C, 0xC0, 0x0C, + 0xFF, 0xFC, 0xFF, 0xFC, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, + 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, + 0xFF, 0xFC, 0xFF, 0xFC, 0x70, 0x00, 0x38, 0x00, 0x1F, 0x00, + 0x1F, 0x00, 0x38, 0x00, 0x70, 0x00, 0xFF, 0xFC, 0xFF, 0xFC, + 0xFF, 0xFC, 0xFF, 0xFC, 0x1C, 0x00, 0x0E, 0x00, 0x07, 0x00, + 0x03, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0xFF, 0xFC, 0xFF, 0xFC, + 0x3F, 0xF0, 0x7F, 0xF8, 0xE0, 0x1C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xC0, 0x0C, 0xC0, 0x0C, 0xE0, 0x1C, 0x7F, 0xF8, 0x3F, 0xF0, + 0xFF, 0xFC, 0xFF, 0xFC, 0xC3, 0x00, 0xC3, 0x00, 0xC3, 0x00, + 0xC3, 0x00, 0xC3, 0x00, 0xE7, 0x00, 0x7E, 0x00, 0x3C, 0x00, + 0x3F, 0xF0, 0x7F, 0xF8, 0xE0, 0x1C, 0xC0, 0x0C, 0xC0, 0xCC, + 0xC0, 0xEC, 0xC0, 0x7C, 0xE0, 0x38, 0x7F, 0xFC, 0x3F, 0xEC, + 0xFF, 0xFC, 0xFF, 0xFC, 0xC3, 0x00, 0xC3, 0x80, 0xC3, 0x80, + 0xC3, 0xC0, 0xC3, 0xC0, 0xE7, 0x70, 0x7E, 0x3C, 0x3C, 0x1C, + 0x3C, 0x18, 0x7E, 0x1C, 0xE7, 0x0C, 0xC3, 0x0C, 0xC3, 0x0C, + 0xC3, 0x0C, 0xC3, 0x0C, 0xC3, 0x9C, 0xE1, 0xF8, 0x60, 0xF0, + 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xFF, 0xFC, + 0xFF, 0xFC, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, + 0xFF, 0xF0, 0xFF, 0xF8, 0x00, 0x1C, 0x00, 0x0C, 0x00, 0x0C, + 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x1C, 0xFF, 0xF8, 0xFF, 0xF0, + 0xFF, 0xC0, 0xFF, 0xE0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1C, + 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0xFF, 0xE0, 0xFF, 0xC0, + 0xFF, 0xF0, 0xFF, 0xF8, 0x00, 0x1C, 0x00, 0x3C, 0x00, 0xF8, + 0x00, 0xF8, 0x00, 0x3C, 0x00, 0x1C, 0xFF, 0xF8, 0xFF, 0xF0, + 0xF0, 0x3C, 0xF8, 0x7C, 0x1C, 0xE0, 0x0F, 0xC0, 0x07, 0x80, + 0x07, 0x80, 0x0F, 0xC0, 0x1C, 0xE0, 0xF8, 0x7C, 0xF0, 0x3C, + 0xFC, 0x00, 0xFE, 0x00, 0x07, 0x00, 0x03, 0x80, 0x01, 0xFC, + 0x01, 0xFC, 0x03, 0x80, 0x07, 0x00, 0xFE, 0x00, 0xFC, 0x00, + 0xC0, 0x3C, 0xC0, 0x7C, 0xC0, 0xEC, 0xC1, 0xCC, 0xC3, 0x8C, + 0xC7, 0x0C, 0xCE, 0x0C, 0xDC, 0x0C, 0xF8, 0x0C, 0xF0, 0x0C, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0xFF, 0xFC, 0xC0, 0x0C, + 0xC0, 0x0C, 0xC0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0x30, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, + 0xFF, 0xFC, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x00, + 0xE0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1C, 0x00, 0x0C, 0x00, + 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, + 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0xE0, 0x00, 0x70, 0x00, + 0x38, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x06, 0x78, 0x0E, 0xFC, 0x0C, 0xCC, 0x0C, 0xCC, + 0x0C, 0xCC, 0x0C, 0xCC, 0x0E, 0xCC, 0x07, 0xFC, 0x03, 0xF8, + 0xFF, 0xFC, 0xFF, 0xFC, 0x03, 0x0C, 0x03, 0x0C, 0x03, 0x0C, + 0x03, 0x0C, 0x03, 0x0C, 0x03, 0x9C, 0x01, 0xF8, 0x00, 0xF0, + 0x03, 0xF0, 0x07, 0xF8, 0x0E, 0x1C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0E, 0x1C, 0x07, 0x38, 0x03, 0x30, + 0x00, 0xF0, 0x01, 0xF8, 0x03, 0x9C, 0x03, 0x0C, 0x03, 0x0C, + 0x03, 0x0C, 0x03, 0x0C, 0x03, 0x0C, 0xFF, 0xFC, 0xFF, 0xFC, + 0x03, 0xF0, 0x07, 0xF8, 0x0E, 0xDC, 0x0C, 0xCC, 0x0C, 0xCC, + 0x0C, 0xCC, 0x0C, 0xCC, 0x0E, 0xDC, 0x07, 0xD8, 0x03, 0x90, + 0x00, 0x00, 0x03, 0x00, 0x3F, 0xFC, 0x7F, 0xFC, 0xE3, 0x00, + 0xE3, 0x00, 0x70, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x18, 0x07, 0x9C, 0x0F, 0xCC, 0x0C, 0xCC, 0x0C, 0xCC, + 0x0C, 0xCC, 0x0C, 0xCC, 0x0C, 0xDC, 0x0F, 0xF8, 0x07, 0xF0, + 0xFF, 0xFC, 0xFF, 0xFC, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x03, 0x80, 0x01, 0xFC, 0x00, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0xFC, + 0x1B, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x38, 0x00, 0x1C, 0x00, 0x0C, + 0x00, 0x0C, 0x00, 0x1C, 0xCF, 0xF8, 0xCF, 0xF0, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFC, 0xFF, 0xFC, 0x00, 0xE0, 0x01, 0xE0, + 0x03, 0xF0, 0x07, 0x38, 0x0E, 0x1C, 0x0C, 0x0C, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C, 0xC0, 0x0C, 0xFF, 0xFC, + 0xFF, 0xFC, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0xFC, 0x0F, 0xFC, 0x0E, 0x00, 0x07, 0x00, 0x03, 0xC0, + 0x03, 0xC0, 0x07, 0x00, 0x0E, 0x00, 0x0F, 0xFC, 0x0F, 0xFC, + 0x0F, 0xFC, 0x0F, 0xFC, 0x03, 0x00, 0x07, 0x00, 0x0E, 0x00, + 0x0C, 0x00, 0x0C, 0x00, 0x0E, 0x00, 0x07, 0xFC, 0x03, 0xFC, + 0x03, 0xF0, 0x07, 0xF8, 0x0E, 0x1C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0E, 0x1C, 0x07, 0xF8, 0x03, 0xF0, + 0x0F, 0xFC, 0x0F, 0xFC, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, + 0x0C, 0xC0, 0x0C, 0xC0, 0x0F, 0xC0, 0x07, 0x80, 0x03, 0x00, + 0x03, 0x00, 0x07, 0x80, 0x0F, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, + 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0F, 0xFC, 0x0F, 0xFC, + 0x0F, 0xFC, 0x0F, 0xFC, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, + 0x0C, 0x00, 0x0C, 0x00, 0x0E, 0x00, 0x07, 0x00, 0x03, 0x00, + 0x03, 0x18, 0x07, 0x9C, 0x0F, 0xCC, 0x0C, 0xCC, 0x0C, 0xCC, + 0x0C, 0xCC, 0x0C, 0xCC, 0x0C, 0xFC, 0x0E, 0x78, 0x06, 0x30, + 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0xFF, 0xF0, 0xFF, 0xF8, + 0x0C, 0x1C, 0x0C, 0x1C, 0x0C, 0x38, 0x0C, 0x30, 0x00, 0x00, + 0x0F, 0xF0, 0x0F, 0xF8, 0x00, 0x1C, 0x00, 0x0C, 0x00, 0x0C, + 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x1C, 0x0F, 0xF8, 0x0F, 0xF0, + 0x0F, 0xC0, 0x0F, 0xE0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1C, + 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x0F, 0xE0, 0x0F, 0xC0, + 0x0F, 0xF0, 0x0F, 0xF8, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0xF8, + 0x00, 0xF8, 0x00, 0x1C, 0x00, 0x1C, 0x0F, 0xF8, 0x0F, 0xF0, + 0x0C, 0x0C, 0x0E, 0x1C, 0x07, 0x38, 0x03, 0xF0, 0x01, 0xE0, + 0x01, 0xE0, 0x03, 0xF0, 0x07, 0x38, 0x0E, 0x1C, 0x0C, 0x0C, + 0x0C, 0x00, 0x0E, 0x00, 0x07, 0x0C, 0x03, 0x9C, 0x01, 0xF8, + 0x01, 0xF0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x0C, 0x00, + 0x0C, 0x0C, 0x0C, 0x1C, 0x0C, 0x3C, 0x0C, 0x7C, 0x0C, 0xEC, + 0x0D, 0xCC, 0x0F, 0x8C, 0x0F, 0x0C, 0x0E, 0x0C, 0x0C, 0x0C, + 0x00, 0x00, 0x03, 0x00, 0x07, 0x80, 0x3F, 0xF0, 0x7C, 0xF8, + 0xE0, 0x1C, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0x00, 0x00, + 0x03, 0x0C, 0x03, 0x0C, 0x3F, 0xFC, 0x7F, 0xFC, 0xE3, 0x0C, + 0xC3, 0x0C, 0xC0, 0x0C, 0xE0, 0x0C, 0x70, 0x0C, 0x30, 0x0C, + 0x00, 0x00, 0xC0, 0x0C, 0xC0, 0x0C, 0xC0, 0x0C, 0xE0, 0x1C, + 0x7C, 0xF8, 0x3F, 0xF0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, + 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, + 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, + 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFC, + 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFC +} ; + +/*---------------------------------------------------------------------------- + * Char set of font 10x8 + *----------------------------------------------------------------------------*/ +const uint8_t pCharset10x8[] = +{ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // space 0x20 +0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18, // ! +0x63,0x63,0x63,0x22,0x00,0x00,0x00,0x00,0x00,0x00, // " +0x00,0x36,0x36,0x7F,0x36,0x36,0x36,0x7F,0x36,0x36, // # +0x3E,0x63,0x61,0x60,0x3E,0x03,0x03,0x43,0x63,0x3E, // $ +0x00,0x00,0x00,0x61,0x63,0x06,0x0C,0x18,0x33,0x63, // % +0x00,0x1C,0x36,0x36,0x1C,0x3B,0x6E,0x66,0x66,0x3B, // & +0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00, // ' +0x0C,0x18,0x18,0x30,0x30,0x30,0x30,0x18,0x18,0x0C, // ( +0x18,0x0C,0x0C,0x06,0x06,0x06,0x06,0x0C,0x0C,0x18, // ) +0x00,0x00,0x42,0x66,0x3C,0xFF,0x3C,0x66,0x42,0x00, // * +0x00,0x00,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x00, // + +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, // , +0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00, // - +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, // . +0x01,0x03,0x07,0x0E,0x1C,0x38,0x70,0xE0,0xC0,0x80, // / (forward slash) +0x3E,0x63,0x63,0x63,0x6B,0x6B,0x63,0x63,0x63,0x3E, // 0 0x30 +0x0C,0x1C,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3F, // 1 +0x3E,0x63,0x03,0x06,0x0C,0x18,0x30,0x61,0x63,0x7F, // 2 +0x3E,0x63,0x03,0x03,0x1E,0x03,0x03,0x03,0x63,0x3E, // 3 +0x06,0x0E,0x1E,0x36,0x66,0x66,0x7F,0x06,0x06,0x0F, // 4 +0x7F,0x60,0x60,0x60,0x7E,0x03,0x03,0x63,0x73,0x3E, // 5 +0x1C,0x30,0x60,0x60,0x7E,0x63,0x63,0x63,0x63,0x3E, // 6 +0x7F,0x63,0x03,0x06,0x06,0x0C,0x0C,0x18,0x18,0x18, // 7 +0x3E,0x63,0x63,0x63,0x3E,0x63,0x63,0x63,0x63,0x3E, // 8 +0x3E,0x63,0x63,0x63,0x63,0x3F,0x03,0x03,0x06,0x3C, // 9 +0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18, // : +0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18, // ; +0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06, // < +0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00, // = +0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60, // > +0x3E,0x63,0x63,0x06,0x0C,0x0C,0x0C,0x00,0x0C,0x0C, // ? +0x3E,0x63,0x63,0x6F,0x6B,0x6B,0x6E,0x60,0x60,0x3E, // @ 0x40 +0x08,0x1C,0x36,0x63,0x63,0x63,0x7F,0x63,0x63,0x63, // A +0x7E,0x33,0x33,0x33,0x3E,0x33,0x33,0x33,0x33,0x7E, // B +0x1E,0x33,0x61,0x60,0x60,0x60,0x60,0x61,0x33,0x1E, // C +0x7C,0x36,0x33,0x33,0x33,0x33,0x33,0x33,0x36,0x7C, // D +0x7F,0x33,0x31,0x34,0x3C,0x34,0x30,0x31,0x33,0x7F, // E +0x7F,0x33,0x31,0x34,0x3C,0x34,0x30,0x30,0x30,0x78, // F +0x1E,0x33,0x61,0x60,0x60,0x6F,0x63,0x63,0x37,0x1D, // G +0x63,0x63,0x63,0x63,0x7F,0x63,0x63,0x63,0x63,0x63, // H +0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C, // I +0x0F,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C, // J +0x73,0x33,0x36,0x36,0x3C,0x36,0x36,0x33,0x33,0x73, // K +0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x7F, // L +0x63,0x77,0x7F,0x6B,0x63,0x63,0x63,0x63,0x63,0x63, // M +0x63,0x63,0x73,0x7B,0x7F,0x6F,0x67,0x63,0x63,0x63, // N +0x1C,0x36,0x63,0x63,0x63,0x63,0x63,0x63,0x36,0x1C, // O +0x7E,0x33,0x33,0x33,0x3E,0x30,0x30,0x30,0x30,0x78, // P 0x50 +0x3E,0x63,0x63,0x63,0x63,0x6B,0x6F,0x3E,0x06,0x07, // Q +0x7E,0x33,0x33,0x33,0x3E,0x36,0x36,0x33,0x33,0x73, // R +0x3E,0x63,0x63,0x30,0x1C,0x06,0x03,0x63,0x63,0x3E, // S +0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C, // T +0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E, // U +0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x36,0x1C,0x08, // V +0x63,0x63,0x63,0x63,0x63,0x6B,0x6B,0x7F,0x36,0x36, // W +0xC3,0xC3,0x66,0x3C,0x18,0x18,0x3C,0x66,0xC3,0xC3, // X +0xC3,0xC3,0xC3,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C, // Y +0x7F,0x63,0x43,0x06,0x0C,0x18,0x30,0x61,0x63,0x7F, // Z +0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C, // [ +0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x07,0x03,0x01, // \ (back slash) +0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C, // ] +0x08,0x1C,0x36,0x63,0x00,0x00,0x00,0x00,0x00,0x00, // ^ +0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00, // _ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ` 0x60 +0x00,0x00,0x00,0x3C,0x46,0x06,0x3E,0x66,0x66,0x3B, // a +0x70,0x30,0x30,0x3C,0x36,0x33,0x33,0x33,0x33,0x6E, // b +0x00,0x00,0x00,0x3E,0x63,0x60,0x60,0x60,0x63,0x3E, // c +0x0E,0x06,0x06,0x1E,0x36,0x66,0x66,0x66,0x66,0x3B, // d +0x00,0x00,0x00,0x3E,0x63,0x63,0x7E,0x60,0x63,0x3E, // e +0x1C,0x36,0x32,0x30,0x7C,0x30,0x30,0x30,0x30,0x78, // f +0x00,0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x66,0x3C, // g +0x70,0x30,0x30,0x36,0x3B,0x33,0x33,0x33,0x33,0x73, // h +0x0C,0x0C,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E, // i +0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x66,0x66,0x3C, // j +0x70,0x30,0x30,0x33,0x33,0x36,0x3C,0x36,0x33,0x73, // k +0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E, // l +0x00,0x00,0x00,0x6E,0x7F,0x6B,0x6B,0x6B,0x6B,0x6B, // m +0x00,0x00,0x00,0x6E,0x33,0x33,0x33,0x33,0x33,0x33, // n +0x00,0x00,0x00,0x3E,0x63,0x63,0x63,0x63,0x63,0x3E, // o +0x00,0x00,0x00,0x6E,0x33,0x33,0x3E,0x30,0x30,0x78, // p +0x00,0x00,0x00,0x3B,0x66,0x66,0x3E,0x06,0x06,0x0F, // q +0x00,0x00,0x00,0x6E,0x3B,0x33,0x30,0x30,0x30,0x78, // r +0x00,0x00,0x00,0x3E,0x63,0x38,0x0E,0x03,0x63,0x3E, // s +0x08,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x1B,0x0E, // t +0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3B, // u +0x00,0x00,0x00,0x63,0x63,0x36,0x36,0x1C,0x1C,0x08, // v +0x00,0x00,0x00,0x63,0x63,0x63,0x6B,0x6B,0x7F,0x36, // w +0x00,0x00,0x00,0x63,0x36,0x1C,0x1C,0x1C,0x36,0x63, // x +0x00,0x00,0x63,0x63,0x63,0x63,0x3F,0x03,0x06,0x3C, // y +0x00,0x00,0x00,0x7F,0x66,0x0C,0x18,0x30,0x63,0x7F, // z +0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E, // { +0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18, // | +0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70, // } +0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ~ +0x70,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,0x00,0x00, // DEL +}; + +/*---------------------------------------------------------------------------- + * Char set of font 8x8 + *----------------------------------------------------------------------------*/ +const uint8_t pCharset8x8[] = +{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0020 (space) + 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00, // U+0021 (!) + 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0022 (") + 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00, // U+0023 (#) + 0x0C, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x0C, 0x00, // U+0024 ($) + 0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00, // U+0025 (%) + 0x1C, 0x36, 0x1C, 0x6E, 0x3B, 0x33, 0x6E, 0x00, // U+0026 (&) + 0x06, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0027 (') + 0x18, 0x0C, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x00, // U+0028 (() + 0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06, 0x00, // U+0029 ()) + 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, // U+002A (*) + 0x00, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x00, 0x00, // U+002B (+) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06, // U+002C (,) + 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, // U+002D (-) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, // U+002E (.) + 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, // U+002F (/) + 0x3E, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x3E, 0x00, // U+0030 (0) + 0x0C, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x3F, 0x00, // U+0031 (1) + 0x1E, 0x33, 0x30, 0x1C, 0x06, 0x33, 0x3F, 0x00, // U+0032 (2) + 0x1E, 0x33, 0x30, 0x1C, 0x30, 0x33, 0x1E, 0x00, // U+0033 (3) + 0x38, 0x3C, 0x36, 0x33, 0x7F, 0x30, 0x78, 0x00, // U+0034 (4) + 0x3F, 0x03, 0x1F, 0x30, 0x30, 0x33, 0x1E, 0x00, // U+0035 (5) + 0x1C, 0x06, 0x03, 0x1F, 0x33, 0x33, 0x1E, 0x00, // U+0036 (6) + 0x3F, 0x33, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00, // U+0037 (7) + 0x1E, 0x33, 0x33, 0x1E, 0x33, 0x33, 0x1E, 0x00, // U+0038 (8) + 0x1E, 0x33, 0x33, 0x3E, 0x30, 0x18, 0x0E, 0x00, // U+0039 (9) + 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, // U+003A (:) + 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06, // U+003B (//) + 0x18, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x18, 0x00, // U+003C (<) + 0x00, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x00, // U+003D (=) + 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, // U+003E (>) + 0x1E, 0x33, 0x30, 0x18, 0x0C, 0x00, 0x0C, 0x00, // U+003F (?) + 0x3E, 0x63, 0x7B, 0x7B, 0x7B, 0x03, 0x1E, 0x00, // U+0040 (@) + 0x0C, 0x1E, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x00, // U+0041 (A) + 0x3F, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3F, 0x00, // U+0042 (B) + 0x3C, 0x66, 0x03, 0x03, 0x03, 0x66, 0x3C, 0x00, // U+0043 (C) + 0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x00, // U+0044 (D) + 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x46, 0x7F, 0x00, // U+0045 (E) + 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x06, 0x0F, 0x00, // U+0046 (F) + 0x3C, 0x66, 0x03, 0x03, 0x73, 0x66, 0x7C, 0x00, // U+0047 (G) + 0x33, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x33, 0x00, // U+0048 (H) + 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, // U+0049 (I) + 0x78, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, 0x00, // U+004A (J) + 0x67, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x67, 0x00, // U+004B (K) + 0x0F, 0x06, 0x06, 0x06, 0x46, 0x66, 0x7F, 0x00, // U+004C (L) + 0x63, 0x77, 0x7F, 0x7F, 0x6B, 0x63, 0x63, 0x00, // U+004D (M) + 0x63, 0x67, 0x6F, 0x7B, 0x73, 0x63, 0x63, 0x00, // U+004E (N) + 0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00, // U+004F (O) + 0x3F, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x0F, 0x00, // U+0050 (P) + 0x1E, 0x33, 0x33, 0x33, 0x3B, 0x1E, 0x38, 0x00, // U+0051 (Q) + 0x3F, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x67, 0x00, // U+0052 (R) + 0x1E, 0x33, 0x07, 0x0E, 0x38, 0x33, 0x1E, 0x00, // U+0053 (S) + 0x3F, 0x2D, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, // U+0054 (T) + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x00, // U+0055 (U) + 0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00, // U+0056 (V) + 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00, // U+0057 (W) + 0x63, 0x63, 0x36, 0x1C, 0x1C, 0x36, 0x63, 0x00, // U+0058 (X) + 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x0C, 0x1E, 0x00, // U+0059 (Y) + 0x7F, 0x63, 0x31, 0x18, 0x4C, 0x66, 0x7F, 0x00, // U+005A (Z) + 0x1E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00, // U+005B ([) + 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00, // U+005C (\) + 0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00, // U+005D (]) + 0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, 0x00, // U+005E (^) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // U+005F (_) + 0x0C, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // U+0060 (`) + 0x00, 0x00, 0x1E, 0x30, 0x3E, 0x33, 0x6E, 0x00, // U+0061 (a) + 0x07, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, // U+0062 (b) + 0x00, 0x00, 0x1E, 0x33, 0x03, 0x33, 0x1E, 0x00, // U+0063 (c) + 0x38, 0x30, 0x30, 0x3e, 0x33, 0x33, 0x6E, 0x00, // U+0064 (d) + 0x00, 0x00, 0x1E, 0x33, 0x3f, 0x03, 0x1E, 0x00, // U+0065 (e) + 0x1C, 0x36, 0x06, 0x0f, 0x06, 0x06, 0x0F, 0x00, // U+0066 (f) + 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x1F, // U+0067 (g) + 0x07, 0x06, 0x36, 0x6E, 0x66, 0x66, 0x67, 0x00, // U+0068 (h) + 0x0C, 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, // U+0069 (i) + 0x30, 0x00, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, // U+006A (j) + 0x07, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x67, 0x00, // U+006B (k) + 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, // U+006C (l) + 0x00, 0x00, 0x33, 0x7F, 0x7F, 0x6B, 0x63, 0x00, // U+006D (m) + 0x00, 0x00, 0x1F, 0x33, 0x33, 0x33, 0x33, 0x00, // U+006E (n) + 0x00, 0x00, 0x1E, 0x33, 0x33, 0x33, 0x1E, 0x00, // U+006F (o) + 0x00, 0x00, 0x3B, 0x66, 0x66, 0x3E, 0x06, 0x0F, // U+0070 (p) + 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x78, // U+0071 (q) + 0x00, 0x00, 0x3B, 0x6E, 0x66, 0x06, 0x0F, 0x00, // U+0072 (r) + 0x00, 0x00, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x00, // U+0073 (s) + 0x08, 0x0C, 0x3E, 0x0C, 0x0C, 0x2C, 0x18, 0x00, // U+0074 (t) + 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x6E, 0x00, // U+0075 (u) + 0x00, 0x00, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00, // U+0076 (v) + 0x00, 0x00, 0x63, 0x6B, 0x7F, 0x7F, 0x36, 0x00, // U+0077 (w) + 0x00, 0x00, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x00, // U+0078 (x) + 0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x1F, // U+0079 (y) + 0x00, 0x00, 0x3F, 0x19, 0x0C, 0x26, 0x3F, 0x00, // U+007A (z) + 0x38, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, 0x38, 0x00, // U+007B () + 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, // U+007C (|) + 0x07, 0x0C, 0x0C, 0x38, 0x0C, 0x0C, 0x07, 0x00, // U+007D () + 0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // U+007E (~) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // U+007F +} ; + +/*---------------------------------------------------------------------------- + * Char set of font 6x8 + *----------------------------------------------------------------------------*/ +const uint8_t pCharset6x8[] = +{ +0x00,0x00,0x00,0x00,0x00,0x00, // Symbol 20 +0x00,0x00,0x00,0x5F,0x00,0x00, // Symbol 21 +0x00,0x00,0x03,0x00,0x03,0x00, // Symbol 22 +0x22,0x7F,0x22,0x22,0x7F,0x22, // Symbol 23 +0x00,0x24,0x2A,0x6B,0x2A,0x12, // Symbol 24 +0x00,0x23,0x13,0x08,0x64,0x62, // Symbol 25 +0x00,0x3A,0x45,0x45,0x3A,0x28, // Symbol 26 +0x00,0x00,0x00,0x02,0x01,0x00, // Symbol 27 +0x00,0x00,0x3E,0x41,0x00,0x00, // Symbol 28 +0x00,0x00,0x41,0x3E,0x00,0x00, // Symbol 29 +0x00,0x2A,0x1C,0x1C,0x2A,0x00, // Symbol 2A +0x00,0x08,0x08,0x3E,0x08,0x08, // Symbol 2B +0x00,0x00,0x80,0x40,0x00,0x00, // Symbol 2C +0x00,0x08,0x08,0x08,0x08,0x00, // Symbol 2D +0x00,0x00,0x00,0x40,0x00,0x00, // Symbol 2E +0x00,0x20,0x10,0x08,0x04,0x02, // Symbol 2F +0x00,0x3E,0x51,0x49,0x45,0x3E, // Symbol 30 +0x00,0x00,0x42,0x7F,0x40,0x00, // Symbol 31 +0x00,0x62,0x51,0x51,0x51,0x4E, // Symbol 32 +0x00,0x21,0x41,0x45,0x45,0x3B, // Symbol 33 +0x00,0x18,0x16,0x11,0x7F,0x10, // Symbol 34 +0x00,0x27,0x45,0x45,0x45,0x39, // Symbol 35 +0x00,0x3E,0x49,0x49,0x49,0x32, // Symbol 36 +0x00,0x01,0x61,0x11,0x09,0x07, // Symbol 37 +0x00,0x36,0x49,0x49,0x49,0x36, // Symbol 38 +0x00,0x26,0x49,0x49,0x49,0x3E, // Symbol 39 +0x00,0x00,0x00,0x12,0x00,0x00, // Symbol 3A +0x00,0x00,0x20,0x12,0x00,0x00, // Symbol 3B +0x00,0x08,0x14,0x22,0x41,0x00, // Symbol 3C +0x00,0x14,0x14,0x14,0x14,0x14, // Symbol 3D +0x00,0x41,0x22,0x14,0x08,0x00, // Symbol 3E +0x00,0x06,0x01,0x51,0x09,0x06, // Symbol 3F +0x00,0x3E,0x41,0x4D,0x4D,0x2E, // Symbol 40 +0x00,0x78,0x16,0x11,0x16,0x78, // Symbol 41 +0x00,0x7F,0x49,0x49,0x49,0x36, // Symbol 42 +0x00,0x3E,0x41,0x41,0x41,0x22, // Symbol 43 +0x00,0x7F,0x41,0x41,0x41,0x3E, // Symbol 44 +0x00,0x7F,0x49,0x49,0x49,0x41, // Symbol 45 +0x00,0x7F,0x09,0x09,0x09,0x01, // Symbol 46 +0x00,0x3E,0x41,0x41,0x51,0x32, // Symbol 47 +0x00,0x7F,0x08,0x08,0x08,0x7F, // Symbol 48 +0x00,0x00,0x41,0x7F,0x41,0x00, // Symbol 49 +0x00,0x30,0x40,0x41,0x41,0x3F, // Symbol 4A +0x00,0x7F,0x08,0x08,0x14,0x63, // Symbol 4B +0x00,0x7F,0x40,0x40,0x40,0x60, // Symbol 4C +0x00,0x7F,0x04,0x18,0x04,0x7F, // Symbol 4D +0x00,0x7F,0x04,0x08,0x10,0x7F, // Symbol 4E +0x00,0x3E,0x41,0x41,0x41,0x3E, // Symbol 4F +0x00,0x7F,0x09,0x09,0x09,0x06, // Symbol 50 +0x00,0x3E,0x41,0x61,0x21,0x5E, // Symbol 51 +0x00,0x7F,0x09,0x09,0x19,0x66, // Symbol 52 +0x00,0x26,0x49,0x49,0x49,0x32, // Symbol 53 +0x00,0x01,0x01,0x7F,0x01,0x01, // Symbol 54 +0x00,0x3F,0x40,0x40,0x40,0x3F, // Symbol 55 +0x00,0x07,0x18,0x60,0x18,0x07, // Symbol 56 +0x00,0x1F,0x60,0x18,0x60,0x1F, // Symbol 57 +0x00,0x63,0x14,0x08,0x14,0x63, // Symbol 58 +0x00,0x03,0x04,0x78,0x04,0x03, // Symbol 59 +0x00,0x61,0x51,0x49,0x45,0x43, // Symbol 5A +0x00,0x00,0x7F,0x41,0x00,0x00, // Symbol 5B +0x00,0x02,0x04,0x08,0x10,0x20, // Symbol 5C +0x00,0x00,0x41,0x7F,0x00,0x00, // Symbol 5D +0x00,0x00,0x00,0x00,0x00,0x00, // Symbol 5E +0x40,0x40,0x40,0x40,0x40,0x40, // Symbol 5F +0x00,0x00,0x00,0x01,0x02,0x00, // Symbol 60 +0x00,0x20,0x54,0x54,0x54,0x78, // Symbol 61 +0x00,0x7E,0x48,0x48,0x48,0x30, // Symbol 62 +0x00,0x38,0x44,0x44,0x44,0x28, // Symbol 63 +0x00,0x30,0x48,0x48,0x48,0x7E, // Symbol 64 +0x00,0x38,0x54,0x54,0x54,0x18, // Symbol 65 +0x00,0x10,0x7C,0x12,0x02,0x04, // Symbol 66 +0x00,0x0C,0x52,0x52,0x3C,0x02, // Symbol 67 +0x00,0x7E,0x08,0x08,0x08,0x70, // Symbol 68 +0x00,0x00,0x00,0x74,0x00,0x00, // Symbol 69 +0x00,0x40,0x80,0x80,0x74,0x00, // Symbol 6A +0x00,0x7E,0x10,0x10,0x10,0x6C, // Symbol 6B +0x00,0x00,0x02,0x7E,0x00,0x00, // Symbol 6C +0x00,0x7C,0x04,0x78,0x04,0x78, // Symbol 6D +0x00,0x7C,0x04,0x04,0x04,0x78, // Symbol 6E +0x00,0x38,0x44,0x44,0x44,0x38, // Symbol 6F +0x00,0xFC,0x24,0x24,0x24,0x18, // Symbol 70 +0x00,0x18,0x24,0x24,0x24,0xFC, // Symbol 71 +0x00,0x7C,0x08,0x04,0x04,0x08, // Symbol 72 +0x00,0x48,0x54,0x54,0x54,0x20, // Symbol 73 +0x00,0x08,0x3E,0x48,0x40,0x00, // Symbol 74 +0x00,0x3C,0x40,0x40,0x40,0x3C, // Symbol 75 +0x00,0x1C,0x20,0x40,0x20,0x1C, // Symbol 76 +0x00,0x3C,0x40,0x30,0x40,0x3C, // Symbol 77 +0x00,0x44,0x28,0x10,0x28,0x44, // Symbol 78 +0x00,0x1C,0x20,0xA0,0xA0,0x7C, // Symbol 79 +0x00,0x44,0x64,0x54,0x4C,0x44, // Symbol 7A +0x00,0x08,0x36,0x41,0x00,0x00, // Symbol 7B +0x00,0x00,0x00,0x7F,0x00,0x00, // Symbol 7C +0x00,0x00,0x41,0x36,0x08,0x00, // Symbol 7D +0x02,0x01,0x01,0x02,0x02,0x01, // Symbol 7E +0x00,0x7F,0x7F,0x7F,0x7F,0x7F // Symbol 7F +}; + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +// End of file diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.h new file mode 100644 index 000000000..13c246629 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/font.h @@ -0,0 +1,71 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _FONT_H_ +#define _FONT_H_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +typedef enum +{ + FONT10x14 = 0, + FONT10x8, + FONT8x8, + FONT6x8, +} _FONT_enum; + +struct _font_parameters +{ + uint8_t width; /* Font width in pixels. */ + uint8_t height; /* Font height in pixels. */ + uint8_t char_space; /* Inter char space */ + const uint8_t* pfont; /* pointer to char table */ +} ; + +#define NB_FONT 4 +extern struct _font_parameters font_param[NB_FONT]; + +extern const uint8_t pCharset10x14[]; +extern const uint8_t pCharset10x8[]; +extern const uint8_t pCharset8x8[]; +extern const uint8_t pCharset6x8[]; + + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +#endif /* _FONT_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.c new file mode 100644 index 000000000..a4b26e554 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.c @@ -0,0 +1,320 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "hamming.h" +#include "trace.h" + +/*---------------------------------------------------------------------------- + * Internal function + *----------------------------------------------------------------------------*/ + +/** + * Counts and return the number of bits set to '1' in the given byte. + * \param byte Byte to count. + */ +static uint8_t count_bits_in_byte(uint8_t byte) +{ + uint8_t count = 0; + + while (byte > 0) { + if (byte & 1) { + count++; + } + byte >>= 1; + } + + return count; +} + +/** + * Counts and return the number of bits set to '1' in the given hamming code. + * \param code Hamming code. + */ +static uint8_t count_bits_in_code256(uint8_t *code) +{ + return count_bits_in_byte(code[0]) + + count_bits_in_byte(code[1]) + + count_bits_in_byte(code[2]); +} + +/** + * Calculates the 22-bit hamming code for a 256-bytes block of data. + * \param data Data buffer to calculate code for. + * \param code Pointer to a buffer where the code should be stored. + */ +static void compute256(const uint8_t *data, uint8_t *code) +{ + uint32_t i; + uint8_t column_sum = 0; + uint8_t even_line_code = 0; + uint8_t odd_line_code = 0; + uint8_t even_column_code = 0; + uint8_t odd_column_code = 0; + + // Xor all bytes together to get the column sum; + // At the same time, calculate the even and odd line codes + for (i = 0; i < 256; i++) { + column_sum ^= data[i]; + + // If the xor sum of the byte is 0, then this byte has no incidence on + // the computed code; so check if the sum is 1. + if ((count_bits_in_byte(data[i]) & 1) == 1) { + // Parity groups are formed by forcing a particular index bit to 0 + // (even) or 1 (odd). + // Example on one byte: + // + // bits (dec) 7 6 5 4 3 2 1 0 + // (bin) 111 110 101 100 011 010 001 000 + // '---'---'---'----------. + // | + // groups P4' ooooooooooooooo eeeeeeeeeeeeeee P4 | + // P2' ooooooo eeeeeee ooooooo eeeeeee P2 | + // P1' ooo eee ooo eee ooo eee ooo eee P1 | + // | + // We can see that: | + // - P4 -> bit 2 of index is 0 --------------------' + // - P4' -> bit 2 of index is 1. + // - P2 -> bit 1 of index if 0. + // - etc... + // We deduce that a bit position has an impact on all even Px if + // the log2(x)nth bit of its index is 0 + // ex: log2(4) = 2, bit2 of the index must be 0 (-> 0 1 2 3) + // and on all odd Px' if the log2(x)nth bit of its index is 1 + // ex: log2(2) = 1, bit1 of the index must be 1 (-> 0 1 4 5) + // + // As such, we calculate all the possible Px and Px' values at the + // same time in two variables, even_line_code and odd_line_code, such as + // even_line_code bits: P128 P64 P32 P16 P8 P4 P2 P1 + // odd_line_code bits: P128' P64' P32' P16' P8' P4' P2' P1' + // + even_line_code ^= (255 - i); + odd_line_code ^= i; + } + } + + // At this point, we have the line parities, and the column sum. First, We + // must caculate the parity group values on the column sum. + for (i = 0; i < 8; i++) { + if (column_sum & 1) { + even_column_code ^= (7 - i); + odd_column_code ^= i; + } + column_sum >>= 1; + } + + // Now, we must interleave the parity values, to obtain the following layout: + // Code[0] = Line1 + // Code[1] = Line2 + // Code[2] = Column + // Line = Px' Px P(x-1)- P(x-1) ... + // Column = P4' P4 P2' P2 P1' P1 PadBit PadBit + code[0] = 0; + code[1] = 0; + code[2] = 0; + + for (i = 0; i < 4; i++) { + code[0] <<= 2; + code[1] <<= 2; + code[2] <<= 2; + + // Line 1 + if ((odd_line_code & 0x80) != 0) { + code[0] |= 2; + } + + if ((even_line_code & 0x80) != 0) { + code[0] |= 1; + } + // Line 2 + if ((odd_line_code & 0x08) != 0) { + code[1] |= 2; + } + + if ((even_line_code & 0x08) != 0) { + code[1] |= 1; + } + // Column + if ((odd_column_code & 0x04) != 0) { + code[2] |= 2; + } + + if ((even_column_code & 0x04) != 0) { + code[2] |= 1; + } + + odd_line_code <<= 1; + even_line_code <<= 1; + odd_column_code <<= 1; + even_column_code <<= 1; + } + + // Invert codes (linux compatibility) + code[0] = ~code[0]; + code[1] = ~code[1]; + code[2] = ~code[2]; + + trace_debug("Computed code = %02x %02x %02x\n\r", + (unsigned)code[0], + (unsigned)code[1], + (unsigned)code[2]); +} + +/** + * Verifies and corrects a 256-bytes block of data using the given 22-bits + * hamming code. + * + * \param data Data buffer to check. + * \param code Hamming code to use for verifying the data. + * + * \return 0 if there is no error, otherwise returns a HAMMING_ERROR code. + */ +static uint8_t verify256(uint8_t *data, const uint8_t *code) +{ + /* Calculate new code */ + uint8_t computed_code[3]; + uint8_t correction_code[3]; + + compute256(data, computed_code); + + /* Xor both codes together */ + correction_code[0] = computed_code[0] ^ code[0]; + correction_code[1] = computed_code[1] ^ code[1]; + correction_code[2] = computed_code[2] ^ code[2]; + + trace_debug("Correction code = %02x %02x %02x\n\r", + (unsigned)correction_code[0], + (unsigned)correction_code[1], + (unsigned)correction_code[2]); + + // If all bytes are 0, there is no error + if (correction_code[0] == 0 && correction_code[1] == 0 && + correction_code[2] == 0) { + return 0; + } + + /* If there is a single bit error, there are 11 bits set to 1 */ + if (count_bits_in_code256(correction_code) == 11) { + // Get byte and bit indexes + uint8_t byte = correction_code[0] & 0x80; + byte |= (correction_code[0] << 1) & 0x40; + byte |= (correction_code[0] << 2) & 0x20; + byte |= (correction_code[0] << 3) & 0x10; + + byte |= (correction_code[1] >> 4) & 0x08; + byte |= (correction_code[1] >> 3) & 0x04; + byte |= (correction_code[1] >> 2) & 0x02; + byte |= (correction_code[1] >> 1) & 0x01; + + uint8_t bit = (correction_code[2] >> 5) & 0x04; + bit |= (correction_code[2] >> 4) & 0x02; + bit |= (correction_code[2] >> 3) & 0x01; + + /* Correct bit */ + printf("Correcting byte #%d at bit %d\n\r", byte, bit); + data[byte] ^= (1 << bit); + + return HAMMING_ERROR_SINGLEBIT; + } + + /* Check if ECC has been corrupted */ + if (count_bits_in_code256(correction_code) == 1) { + return HAMMING_ERROR_ECC; + } else { + /* Otherwise, this is a multi-bit error */ + return HAMMING_ERROR_MULTIPLEBITS; + } +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * Computes 3-bytes hamming codes for a data block whose size is multiple of + * 256 bytes. Each 256 bytes block gets its own code. + * \param data Data to compute code for. + * \param size Data size in bytes. + * \param code Codes buffer. + */ +void hamming_compute_256x(const uint8_t *data, uint32_t size, uint8_t *code) +{ + trace_debug("hamming_compute_256x()\n\r"); + + while (size > 0) { + compute256(data, code); + + data += 256; + code += 3; + size -= 256; + } +} + +/** + * Verifies 3-bytes hamming codes for a data block whose size is multiple of + * 256 bytes. Each 256-bytes block is verified with its own code. + * + * \return 0 if the data is correct, HAMMING_ERROR_SINGLEBIT if one or more + * block(s) have had a single bit corrected, or either HAMMING_ERROR_ECC + * or HAMMING_ERROR_MULTIPLEBITS. + * + * \param data Data buffer to verify. + * \param size Size of the data in bytes. + * \param code Original codes. + */ +uint8_t hamming_verify_256x(uint8_t *data, uint32_t size, const uint8_t *code) +{ + uint8_t error; + uint8_t result = 0; + + trace_debug("hamming_verify_256x()\n\r"); + + while (size > 0) { + error = verify256(data, code); + + if (error == HAMMING_ERROR_SINGLEBIT) { + result = HAMMING_ERROR_SINGLEBIT; + } else { + if (error) { + return error; + } + } + + data += 256; + code += 3; + size -= 256; + } + + return result; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.h new file mode 100644 index 000000000..b21f0f9ea --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/hamming.h @@ -0,0 +1,67 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _HAMMING_ +#define _HAMMING_ + +#include + +/*------------------------------------------------------------------------------ + * Defines + *------------------------------------------------------------------------------*/ + +/** + * These are the possible errors when trying to verify a block of data encoded + * using a Hamming code: + * + * \section Errors + * - HAMMING_ERROR_SINGLEBIT + * - HAMMING_ERROR_ECC + * - HAMMING_ERROR_MULTIPLEBITS + */ + +/** A single bit was incorrect but has been recovered. */ +#define HAMMING_ERROR_SINGLEBIT 1 + +/** The original code has been corrupted. */ +#define HAMMING_ERROR_ECC 2 + +/** Multiple bits are incorrect in the data and they cannot be corrected. */ +#define HAMMING_ERROR_MULTIPLEBITS 3 + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +void hamming_compute_256x(const uint8_t *data, uint32_t size, uint8_t *code); + +extern uint8_t hamming_verify_256x(uint8_t *data, uint32_t size, + const uint8_t *code); + +#endif /* _HAMMING_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/intmath.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/intmath.h new file mode 100644 index 000000000..8e3e5f783 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/intmath.h @@ -0,0 +1,97 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _INTMATH_H_ +#define _INTMATH_H_ + +/** + * \brief Compute the absolute value of the difference between two integers. + * \param a The first integer. + * \param b The second integer. + * \return The absolute difference. + */ +#define ABS_DIFF(a,b) ((a) < (b) ? (b) - (a) : (a) - (b)) + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +#include + +/** + * Returns the minimum value between two integers. + * \param a First integer to compare + * \param b Second integer to compare + */ +static inline int32_t min_u32(uint32_t a, uint32_t b) +{ + return a < b ? a : b; +} + +/** + * Returns the absolute value of an integer. + * \param value Integer value + */ +static inline uint32_t abs_u32(int32_t value) +{ + return value > 0 ? value : -value; +} + +/** + * Computes and returns x to the power of y. + * \param x Value + * \param y Power + */ +static inline uint32_t power_u32(uint32_t x, uint32_t y) +{ + uint32_t result = 1; + while (y > 0) { + result *= x; + y--; + } + return result; +} + +/** ISO/IEC 14882:2003(E) - 5.6 Multiplicative operators: + * The binary / operator yields the quotient, and the binary % operator yields the remainder + * from the division of the first expression by the second. + * If the second operand of / or % is zero the behavior is undefined; otherwise (a/b)*b + a%b is equal to a. + * If both operands are nonnegative then the remainder is nonnegative; + * if not, the sign of the remainder is implementation-defined 74). + */ +static inline int fixed_mod(int a, int b) +{ + int rem = a % b; + while (rem < 0) + rem += b; + + return rem; +} + +#endif /* _INTMATH_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/io.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/io.h new file mode 100644 index 000000000..9930fc093 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/io.h @@ -0,0 +1,32 @@ +#ifndef UTILS_IO_HEADER +#define UTILS_IO_HEADER + +#include + +struct _buffer +{ + uint8_t* data; + uint32_t size; +}; + +static inline void writeb(volatile void* reg, uint8_t value) +{ + *(volatile uint8_t*)reg = value; +} + +static inline void writehw(volatile void* reg, uint16_t value) +{ + *(volatile uint16_t*)reg = value; +} + +static inline void readb(volatile const void* reg, uint8_t* value) +{ + *value = *(volatile const uint8_t*)reg; +} + +static inline void readhw(volatile const void* reg, uint16_t* value) +{ + *value = *(volatile const uint16_t*)reg; +} + +#endif diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_color.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_color.h new file mode 100644 index 000000000..506ad2a2e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_color.h @@ -0,0 +1,197 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 COLOR_H +#define COLOR_H + +/** + * \file + * + * RGB 24-bits color table definition. + * + */ + +#define color_t uint32_t + +/* + * RGB 24 Bpp + */ + +// From HTML color names +// 140 color names are defined in the HTML and CSS color specification +// (17 standard colors plus 123 more). +// The table below lists them all, along with their hexadecimal values. + +// The 17 standard colors are: aqua, black, blue, fuchsia, gray, green, +// lime, maroon, navy, olive, orange, purple, red, silver, teal, white, +// and yellow. + +#define COLOR_AliceBlue 0xF0F8FF +#define COLOR_AntiqueWhite 0xFAEBD7 +#define COLOR_Aqua 0x00FFFF +#define COLOR_Aquamarine 0x7FFFD4 +#define COLOR_AZUR 0xF0FFFF +#define COLOR_BEIGE 0xF5F5DC +#define COLOR_Bisque 0xFFE4C4 +#define COLOR_BLACK 0x000000 +#define COLOR_BlanchedAlmond 0xFFEBCD +#define COLOR_BLUE 0x0000FF +#define COLOR_BLUEVIOLET 0x8A2BE2 +#define COLOR_BROWN 0xA52A2A +#define COLOR_BurlyWood 0xDEB887 +#define COLOR_CadetBlue 0x5F9EA0 +#define COLOR_Chartreuse 0x7FFF00 +#define COLOR_Chocolate 0xD2691E +#define COLOR_Coral 0xFF7F50 +#define COLOR_CornflowerBlue 0x6495ED +#define COLOR_Cornsilk 0xFFF8DC +#define COLOR_Crimson 0xDC143C +#define COLOR_CYAN 0x00FFFF +#define COLOR_DARKBLUE 0x00008B +#define COLOR_DARKCYAN 0x008B8B +#define COLOR_DarkGoldenRod 0xB8860B +#define COLOR_DARKGRAY 0xA9A9A9 +#define COLOR_DARKGREEN 0x006400 +#define COLOR_DarkKhaki 0xBDB76B +#define COLOR_DarkMagenta 0x8B008B +#define COLOR_DarkOliveGreen 0x556B2F +#define COLOR_DarkOrange 0xFF8C00 +#define COLOR_DarkOrchid 0x9932CC +#define COLOR_DARKRED 0x8B0000 +#define COLOR_DarkSalmon 0xE9967A +#define COLOR_DarkSeaGreen 0x8FBC8F +#define COLOR_DarkSlateBlue 0x483D8B +#define COLOR_DarkSlateGray 0x2F4F4F +#define COLOR_DarkTurquoise 0x00CED1 +#define COLOR_DARKVIOLET 0x9400D3 +#define COLOR_DeepPink 0xFF1493 +#define COLOR_DeepSkyBlue 0x00BFFF +#define COLOR_DimGray 0x696969 +#define COLOR_DodgerBlue 0x1E90FF +#define COLOR_FireBrick 0xB22222 +#define COLOR_FloralWhite 0xFFFAF0 +#define COLOR_ForestGreen 0x228B22 +#define COLOR_Fuchsia 0xFF00FF +#define COLOR_Gainsboro 0xDCDCDC +#define COLOR_GhostWhite 0xF8F8FF +#define COLOR_GOLD 0xFFD700 +#define COLOR_GoldenRod 0xDAA520 +#define COLOR_GRAY 0x808080 +#define COLOR_GREEN 0x008000 +#define COLOR_GREENYELLOW 0xADFF2F +#define COLOR_HoneyDew 0xF0FFF0 +#define COLOR_HotPink 0xFF69B4 +#define COLOR_IndianRed 0xCD5C5C +#define COLOR_INDIGO 0x4B0082 +#define COLOR_Ivory 0xFFFFF0 +#define COLOR_Khaki 0xF0E68C +#define COLOR_Lavender 0xE6E6FA +#define COLOR_LavenderBlush 0xFFF0F5 +#define COLOR_LawnGreen 0x7CFC00 +#define COLOR_LemonChiffon 0xFFFACD +#define COLOR_LIGHTBLUE 0xADD8E6 +#define COLOR_LightCoral 0xF08080 +#define COLOR_LIGHTCYAN 0xE0FFFF +#define COLOR_LightGoldenRodYellow 0xFAFAD2 +#define COLOR_LIGHTGREY 0xD3D3D3 +#define COLOR_LIGHTGREEN 0x90EE90 +#define COLOR_LightPink 0xFFB6C1 +#define COLOR_LightSalmon 0xFFA07A +#define COLOR_LightSeaGreen 0x20B2AA +#define COLOR_LightSkyBlue 0x87CEFA +#define COLOR_LightSlateGray 0x778899 +#define COLOR_LightSteelBlue 0xB0C4DE +#define COLOR_LightYellow 0xFFFFE0 +#define COLOR_Lime 0x00FF00 +#define COLOR_LimeGreen 0x32CD32 +#define COLOR_Linen 0xFAF0E6 +#define COLOR_MAGENTA 0xFF00FF +#define COLOR_Maroon 0x800000 +#define COLOR_MediumAquaMarine 0x66CDAA +#define COLOR_MediumBlue 0x0000CD +#define COLOR_MediumOrchid 0xBA55D3 +#define COLOR_MediumPurple 0x9370DB +#define COLOR_MediumSeaGreen 0x3CB371 +#define COLOR_MediumSlateBlue 0x7B68EE +#define COLOR_MediumSpringGreen 0x00FA9A +#define COLOR_MediumTurquoise 0x48D1CC +#define COLOR_MediumVioletRed 0xC71585 +#define COLOR_MidnightBlue 0x191970 +#define COLOR_MintCream 0xF5FFFA +#define COLOR_MistyRose 0xFFE4E1 +#define COLOR_Moccasin 0xFFE4B5 +#define COLOR_NavajoWhite 0xFFDEAD +#define COLOR_NAVY 0x000080 +#define COLOR_OldLace 0xFDF5E6 +#define COLOR_OLIVE 0x808000 +#define COLOR_OliveDrab 0x6B8E23 +#define COLOR_ORANGE 0xFFA500 +#define COLOR_OrangeRed 0xFF4500 +#define COLOR_Orchid 0xDA70D6 +#define COLOR_PaleGoldenRod 0xEEE8AA +#define COLOR_PaleGreen 0x98FB98 +#define COLOR_PaleTurquoise 0xAFEEEE +#define COLOR_PaleVioletRed 0xDB7093 +#define COLOR_PapayaWhip 0xFFEFD5 +#define COLOR_PeachPuff 0xFFDAB9 +#define COLOR_Peru 0xCD853F +#define COLOR_Pink 0xFFC0CB +#define COLOR_Plum 0xDDA0DD +#define COLOR_PowderBlue 0xB0E0E6 +#define COLOR_Purple 0x800080 +#define COLOR_RebeccaPurple 0x663399 +#define COLOR_RED 0xFF0000 +#define COLOR_RosyBrown 0xBC8F8F +#define COLOR_RoyalBlue 0x4169E1 +#define COLOR_SaddleBrown 0x8B4513 +#define COLOR_Salmon 0xFA8072 +#define COLOR_SandyBrown 0xF4A460 +#define COLOR_SeaGreen 0x2E8B57 +#define COLOR_SeaShell 0xFFF5EE +#define COLOR_SIENNA 0xA0522D +#define COLOR_SILVER 0xC0C0C0 +#define COLOR_SKYBLUE 0x87CEEB +#define COLOR_SlateBlue 0x6A5ACD +#define COLOR_SlateGray 0x708090 +#define COLOR_SNOW 0xFFFAFA +#define COLOR_SpringGreen 0x00FF7F +#define COLOR_SteelBlue 0x4682B4 +#define COLOR_Tan 0xD2B48C +#define COLOR_Teal 0x008080 +#define COLOR_Thistle 0xD8BFD8 +#define COLOR_TOMATO 0xFF6347 +#define COLOR_TURQUOISE 0x40E0D0 +#define COLOR_VIOLET 0xEE82EE +#define COLOR_Wheat 0xF5DEB3 +#define COLOR_WHITE 0xFFFFFF +#define COLOR_WhiteSmoke 0xF5F5F5 +#define COLOR_YELLOW 0xFFFF00 +#define COLOR_YELLOWGREEN 0x9ACD32 + +#endif /* #define COLOR_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.c new file mode 100644 index 000000000..1441a6ae8 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.c @@ -0,0 +1,828 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \addtogroup lcdd_draw + * + * Implementation of draw function on LCD, Include draw text, image + * and basic shapes (line, rectangle, circle). + * + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" + +#include "video/lcdd.h" + +#include "lcd_draw.h" +#include "lcd_font.h" +#include "font.h" + +#include +#include +#include + +/*---------------------------------------------------------------------------- + * Local variable + *----------------------------------------------------------------------------*/ + +/** Front color cache */ +static uint32_t front_color; + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +/** + * Hide canvas layer + */ +static void _hide_canvas(void) +{ + //lcdd_enable_layer(lcdd_get_canvas()->layer_id, false); +} + +/** + * Update canvas + */ +static void _show_canvas(void) +{ + //lcdd_enable_layer(lcdd_get_canvas()->layer_id, true); +} + +/** + * Set front color + * \param color Pixel color. + */ +static void _set_front_color(uint32_t color) +{ + front_color = color; +} + +/** + * \brief Draw a pixel on LCD of front color. + * + * \param dwX X-coordinate of pixel. + * \param dwY Y-coordinate of pixel. + */ +static void _draw_pixel(uint32_t dwX, uint32_t dwY) +{ + struct _lcdd_layer *pDisp = lcdd_get_canvas(); + uint8_t *buffer = pDisp->buffer; + uint16_t w = pDisp->width; + //uint16_t h = pDisp->height; + uint16_t cw = pDisp->bpp / 8; /* color width */ + uint32_t rw = w * cw; /* row width in bytes */ + //uint8_t r, g, b; + uint8_t *pPix; + + if (buffer == NULL) + return; + + if (rw & 0x3) + rw = (rw | 0x3) + 1; /* 4-byte aligned rows */ + pPix = &buffer[dwY * rw + cw * dwX]; + + switch (pDisp->bpp) { + case 16: /* TRGB 1555 */ + pPix[0] = (front_color) & 0xFF; + pPix[1] = (front_color >> 8) & 0xFF; + break; + case 24: /* RGB 888 */ + pPix[0] = (front_color) & 0xFF; + pPix[1] = (front_color >> 8) & 0xFF; + pPix[2] = (front_color >> 16) & 0xFF; + break; + case 32: /* ARGB 8888 */ + pPix[0] = (front_color) & 0xFF; + pPix[1] = (front_color >> 8) & 0xFF; + pPix[2] = (front_color >> 16) & 0xFF; + pPix[3] = (front_color >> 24) & 0xFF; + break; + } +} + +/** + * \brief Fill rectangle with front color. + * \param dwX1 X-coordinate of top left. + * \param dwY1 Y-coordinate of top left. + * \param dwX2 X-coordinate of bottom right. + * \param dwY1 Y-coordinate of bottom right. + */ +static void _fill_rect(uint32_t dwX1, uint32_t dwY1, uint32_t dwX2, uint32_t dwY2) +{ + struct _lcdd_layer *pDisp = lcdd_get_canvas(); + uint16_t w = pDisp->width; + uint16_t cw = pDisp->bpp / 8; /* color width */ + uint32_t rw = w * cw; /* row width in bytes */ + uint8_t *base = pDisp->buffer; + uint8_t *buffer = pDisp->buffer; + uint32_t fillStart, fillEnd; + uint32_t i; + if (buffer == NULL) + return; + + /* 4-byte aligned rows */ + if (rw & 0x3) + rw = (rw | 0x3) + 1; + /* Buffer address for the starting row */ + base = &buffer[dwY1 * rw]; + + fillStart = dwX1 * cw; + fillEnd = dwX2 * cw; + +#if 1 /* Memcopy pixel */ + buffer = base; + for (; dwY1 <= dwY2; dwY1++) { + for (i = fillStart; i <= fillEnd; i += cw) { + memcpy(&buffer[i], &front_color, cw); + } + buffer = &buffer[rw]; + } +#endif + +#if 0 /* Pixel by pixel */ + for (; dwY1 <= dwY2; dwY1++) { + for (i = dwX1; i <= dwX2; i++) { + _draw_pixel(i, dwY1); + } + } +#endif + +#if 0 /* Optimized */ + /* First row */ + for (i = fillStart; i <= fillEnd; i += cw) { + memcpy(&base[i], &front_color, cw); + } + /* Next rows, copy first */ + buffer = &base[rw + fillStart]; + for (i = dwY1 + 1; i <= dwY2; i++) { + memcpy(buffer, &base[fillStart], fillEnd - fillStart + cw); + buffer = &buffer[rw]; + } +#endif +} + +/** + * \brief Draw a line on LCD, which is not horizontal or vertical. + * + * \param dwX1 X-coordinate of line start. + * \param dwY1 Y-coordinate of line start. + * \param dwX2 X-coordinate of line end. + * \param dwY2 Y-coordinate of line end. + */ + +/* +static uint32_t _draw_line_bresenham (uint32_t dwX1, uint32_t dwY1, uint32_t dwX2, uint32_t dwY2) +{ + int dx, dy; + int i; + int xinc, yinc, cumul; + int x, y; + + x = dwX1; + y = dwY1; + dx = dwX2 - dwX1; + dy = dwY2 - dwY1; + + xinc = (dx > 0) ? 1 : -1; + yinc = (dy > 0) ? 1 : -1; + dx = (dx > 0) ? dx : -dx; + dy = (dy > 0) ? dy : -dy; + + _draw_pixel(x, y); + + if (dx > dy) { + cumul = dx / 2; + for (i = 1; i <= dx; i++) { + x += xinc; + cumul += dy; + + if (cumul >= dx) { + cumul -= dx; + y += yinc; + } + _draw_pixel(x, y); + } + } else { + cumul = dy / 2; + for (i = 1; i <= dy; i++) { + y += yinc; + cumul += dx; + + if (cumul >= dy) { + cumul -= dy; + x += xinc; + } + + _draw_pixel(x, y); + } + } + + return 0; +} +*/ + +static uint32_t _draw_line_bresenham (uint32_t dwX1, uint32_t dwY1, uint32_t dwX2, uint32_t dwY2) +{ + int dx = abs(dwX2 - dwX1); + int dy = abs(dwY2 - dwY1); + int sx = (dwX1 < dwX2) ? 1 : -1; + int sy = (dwY1 < dwY2) ? 1 : -1; + int err = dx - dy; + int e2 ; + + while (1) { + _draw_pixel(dwX1, dwY1); + if ((dwX1 == dwX2) && (dwY1 == dwY2)) + break; + e2 = 2 * err; + if (e2 > -dy) { + err -= dy; dwX1 += sx; + } + if (e2 < dx) { + err += dx; dwY1 += sy; + } + } + return 0; +} + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Fills the given LCD buffer with a particular color. + * + * \param color Fill color. + */ +void lcdd_fill(uint32_t color) +{ + struct _lcdd_layer *pDisp = lcdd_get_canvas(); + _set_front_color(color); + _hide_canvas(); + _fill_rect(0, 0, pDisp->width, pDisp->height); + _show_canvas(); +} + +void lcdd_fill_white(void) +{ + struct _lcdd_layer *pDisp = lcdd_get_canvas(); + _hide_canvas(); + _set_front_color(0x0000FF); + _fill_rect(0, 0, pDisp->width / 3, pDisp->height); + _set_front_color(0xFFFFFF); + _fill_rect(pDisp->width/3, 0, pDisp->width/3+pDisp->width/3, pDisp->height); + _set_front_color(0xFF0000); + _fill_rect(pDisp->width/3+pDisp->width/3, 0, pDisp->width-1, pDisp->height); + _show_canvas(); +} + +/** + * \brief Draw a pixel on LCD of given color. + * + * \param x X-coordinate of pixel. + * \param y Y-coordinate of pixel. + * \param color Pixel color. + */ +void lcdd_draw_pixel(uint32_t x, uint32_t y, uint32_t color) +{ + _set_front_color(color); + _hide_canvas(); + _draw_pixel(x, y); + _show_canvas(); +} + +/** + * \brief Read a pixel from LCD. + * + * \param x X-coordinate of pixel. + * \param y Y-coordinate of pixel. + * + * \return color Readed pixel color. + */ +extern uint32_t lcdd_read_pixel(uint32_t x, uint32_t y) +{ + struct _lcdd_layer *pDisp = lcdd_get_canvas(); + uint8_t *buffer = pDisp->buffer; + uint16_t w = pDisp->width; + //uint16_t h = pDisp->height; + uint16_t cw = pDisp->bpp / 8; /* color width */ + uint32_t rw = w * cw; /* row width in bytes */ + uint8_t *pPix; + uint32_t color = 0; + + if (buffer == NULL) + return 0; + + if (rw & 0x3) + rw = (rw | 0x3) + 1; /* 4-byte aligned rows */ + pPix = &buffer[x * rw + cw * y]; + + switch (pDisp->bpp) { + case 16: /* TRGB 1555 */ + color = pPix[0] | (pPix[1] << 8); + break; + case 24: /* RGB 888 */ + color = pPix[0] | (pPix[1] << 8) | (pPix[2] << 16); + break; + case 32: /* ARGB 8888 */ + color = + pPix[0] | (pPix[1] << 8) | (pPix[2] << 16) | (pPix[3] << + 24); + break; + } + return color; +} + +/** + * \brief Draw a line on LCD, horizontal and vertical line are supported. + * + * \param x1 X-coordinate of line start. + * \param y1 Y-coordinate of line start. + * \param x2 X-coordinate of line end. + * \param y2 Y-coordinate of line end. + * \param color Pixel color. + */ +void lcdd_draw_line(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, + uint32_t color) +{ + _set_front_color(color); + + if ((x1 == x2) && (y1 > y2)) { + SWAP(y1, y2); + } + if ((x1 > x2) & (y1 == y2)) { + SWAP(x1, x2); + } + + if ((x1 == x2) || (y1 == y2)) { + lcdd_draw_filled_rectangle(x1, y1, x2, y2, color); + } else { + _hide_canvas(); + _draw_line_bresenham(x1, y1, x2, y2); + _show_canvas(); + } +} + +/** + * \brief Draws a rectangle on LCD, at the given coordinates. + * + * \param x X-coordinate of upper-left rectangle corner. + * \param y Y-coordinate of upper-left rectangle corner. + * \param width Rectangle width in pixels. + * \param height Rectangle height in pixels. + * \param color Rectangle color. + */ +void lcdd_draw_rectangle(uint32_t x, uint32_t y, uint32_t width, uint32_t height, + uint32_t color) +{ + uint32_t x1 = x + width - 1; + uint32_t y1 = y + height - 1; + + _set_front_color(color); + _hide_canvas(); + _fill_rect(x, y, x1, y); + _fill_rect(x1, y, x1, y1); + _fill_rect(x, y, x, y1); + _fill_rect(x, y1, x1, y1); + _show_canvas(); +} + +/** + * \brief Draws a rectangle with fill inside on LCD, at the given coordinates. + * + * \param dwX1 X-coordinate of upper-left rectangle corner. + * \param dwY1 Y-coordinate of upper-left rectangle corner. + * \param dwX2 X-coordinate of down-right rectangle corner. + * \param dwY2 Y-coordinate of down-right rectangle corner. + * \param color Rectangle color. + */ +void lcdd_draw_filled_rectangle(uint32_t dwX1, uint32_t dwY1, + uint32_t dwX2, uint32_t dwY2, uint32_t color) +{ + _set_front_color(color); + _hide_canvas(); + _fill_rect(dwX1, dwY1, dwX2, dwY2); + _show_canvas(); +} + +/** + * \brief Draws a circle on LCD, at the given coordinates. + * + * \param dwX X-coordinate of circle center. + * \param dwY Y-coordinate of circle center. + * \param dwR circle radius. + * \param color circle color. + */ +void lcdd_draw_circle(uint32_t dwX, uint32_t dwY, uint32_t dwR, uint32_t color) +{ + int32_t d; /* Decision Variable */ + uint32_t curX; /* Current X Value */ + uint32_t curY; /* Current Y Value */ + + if (dwR == 0) + return; + _set_front_color(color); + + d = 3 - (dwR << 1); + curX = 0; + curY = dwR; + + _hide_canvas(); + while (curX <= curY) { + _draw_pixel(dwX + curX, dwY + curY); + _draw_pixel(dwX + curX, dwY - curY); + _draw_pixel(dwX - curX, dwY + curY); + _draw_pixel(dwX - curX, dwY - curY); + _draw_pixel(dwX + curY, dwY + curX); + _draw_pixel(dwX + curY, dwY - curX); + _draw_pixel(dwX - curY, dwY + curX); + _draw_pixel(dwX - curY, dwY - curX); + + if (d < 0) { + d += (curX << 2) + 6; + } else { + d += ((curX - curY) << 2) + 10; + curY--; + } + curX++; + } + _show_canvas(); +} + +/** + * \brief Draws a filled circle on LCD, at the given coordinates. + * + * \param dwX X-coordinate of circle center. + * \param dwY Y-coordinate of circle center. + * \param dwR circle radius. + * \param color circle color. + */ +void lcdd_draw_filled_circle(uint32_t dwX, uint32_t dwY, uint32_t dwR, + uint32_t color) +{ + signed int d; // Decision Variable + uint32_t dwCurX; // Current X Value + uint32_t dwCurY; // Current Y Value + uint32_t dwXmin, dwYmin; + + if (dwR == 0) + return; + _set_front_color(color); + + d = 3 - (dwR << 1); + dwCurX = 0; + dwCurY = dwR; + + _hide_canvas(); + while (dwCurX <= dwCurY) { + dwXmin = (dwCurX > dwX) ? 0 : dwX - dwCurX; + dwYmin = (dwCurY > dwY) ? 0 : dwY - dwCurY; + _fill_rect(dwXmin, dwYmin, dwX + dwCurX, dwYmin); + _fill_rect(dwXmin, dwY + dwCurY, dwX + dwCurX, dwY + dwCurY); + dwXmin = (dwCurY > dwX) ? 0 : dwX - dwCurY; + dwYmin = (dwCurX > dwY) ? 0 : dwY - dwCurX; + _fill_rect(dwXmin, dwYmin, dwX + dwCurY, dwYmin); + _fill_rect(dwXmin, dwY + dwCurX, dwX + dwCurY, dwY + dwCurX); + + if (d < 0) { + d += (dwCurX << 2) + 6; + } else { + d += ((dwCurX - dwCurY) << 2) + 10; + dwCurY--; + } + + dwCurX++; + } + _show_canvas(); +} + +/** + * \brief Draws a string inside a LCD buffer, at the given coordinates. Line breaks + * will be honored. + * + * \param x X-coordinate of string top-left corner. + * \param y Y-coordinate of string top-left corner. + * \param p_string String to display. + * \param color String color. + */ +void lcdd_draw_string(uint32_t x, uint32_t y, const char *p_string, uint32_t color) +{ + uint32_t xorg = x; + uint8_t font_sel = lcdd_get_selected_font(); + uint8_t width = font_param[font_sel].width ; + uint8_t height = font_param[font_sel].height; + uint8_t char_space = font_param[font_sel].char_space; + + /* Font 10*8 reverse height and width */ + if (font_sel == FONT10x8) { + width = font_param[font_sel].height ; + height = font_param[font_sel].width; + } + + while (*p_string) { + if (*p_string == '\n') { + y += height + char_space; + x = xorg; + } else { + lcdd_draw_char(x, y, *p_string, color); + x += width + char_space; + } + p_string++; + } +} + +/** + * \brief Draws a string inside a LCD buffer, at the given coordinates + * with given background color. Line breaks will be honored. + * + * \param x X-coordinate of string top-left corner. + * \param y Y-coordinate of string top-left corner. + * \param p_string String to display. + * \param fontColor String color. + * \param bgColor Background color. + */ +void lcdd_draw_string_with_bgcolor(uint32_t x, uint32_t y, + const char *p_string, + uint32_t fontColor, + uint32_t bgColor) +{ + uint32_t xorg = x; + uint8_t font_sel = lcdd_get_selected_font(); + uint8_t width = font_param[font_sel].width ; + uint8_t height = font_param[font_sel].height; + uint8_t char_space = font_param[font_sel].char_space; + + /* Font 10*8 reverse height and width */ + if (font_sel == FONT10x8) { + width = font_param[font_sel].height ; + height = font_param[font_sel].width; + } + + while (*p_string) { + if (*p_string == '\n') { + y += height + char_space;; + x = xorg; + } else { + lcdd_draw_char_with_bgcolor(x, y, *p_string, fontColor, bgColor); + x += width + char_space;; + } + p_string++; + } +} + +/** + * \brief Returns the width & height in pixels that a string will occupy on the screen + * if drawn using lcdd_draw_string. + * + * \param p_string String. + * \param p_width Pointer for storing the string width (optional). + * \param p_height Pointer for storing the string height (optional). + * + * \return String width in pixels. + */ +void lcdd_get_string_size(const char *p_string, uint32_t * p_width, uint32_t * p_height) +{ + uint8_t font_sel = lcdd_get_selected_font(); + uint8_t width = font_param[font_sel].width; + uint8_t height = font_param[font_sel].height; + uint8_t char_space = font_param[font_sel].char_space; + uint32_t str_width = 0; + + /* Font 10*8 reverse height and width */ + if (font_sel == FONT10x8) { + width = font_param[font_sel].height ; + height = font_param[font_sel].width; + } + + while (*p_string) { + if (*p_string == '\n') + height += height + char_space; + else + str_width += width + char_space; + p_string++; + } + if (width > 0) + str_width -= char_space; + + if (p_width != NULL) + *p_width = str_width; + if (p_height != NULL) + *p_height = height; +} + +/** + * \brief Draw a raw image at given position on LCD. + * + * \param dwX X-coordinate of image start. + * \param dwY Y-coordinate of image start. + * \param pImage Image buffer. + * \param width Image width. + * \param height Image height. + */ +void lcdd_draw_image(uint32_t dwX, uint32_t dwY, const uint8_t * pImage, + uint32_t width, uint32_t height) +{ + struct _lcdd_layer *pDisp = lcdd_get_canvas(); + uint16_t cw = pDisp->bpp / 8; /* color width */ + uint32_t rw = pDisp->width * cw; /* Row width in bytes */ + uint32_t rws = width * cw; /* Source Row Width */ + uint32_t rl = (rw & 0x3) ? ((rw | 0x3) + 1) : rw; /* Aligned length */ + uint32_t rls = (rws & 0x3) ? ((rws | 0x3) + 1) : rws; /* Aligned length */ + uint8_t *pSrc, *pDst; + uint32_t i; + + pSrc = (uint8_t *) pImage; + pDst = pDisp->buffer; + pDst = &pDst[dwX * cw + dwY * rl]; + + for (i = 0; i < height; i++) { + memcpy(pDst, pSrc, rws); + pSrc = &pSrc[rls]; + pDst = &pDst[rl]; + } +} + +/** + * \brief Clear a window with an color. + * + * \param dwX X-coordinate of the window. + * \param dwY Y-coordinate of the window. + * \param width window width. + * \param height window height. + * \param color background color + */ +void lcdd_clear_window(uint32_t dwX, uint32_t dwY, uint32_t width, + uint32_t height, uint32_t color) +{ + _set_front_color(color); + _hide_canvas(); + _fill_rect(0, 0, dwX + width - 1, dwY + height - 1); + _show_canvas(); +} + +/*---------------------------------------------------------------------------- + * Local functions + *----------------------------------------------------------------------------*/ + +/** + * Draw fast vertical line + */ +void lcdd_draw_fast_vline (uint32_t x, uint32_t y, uint32_t h, uint32_t color) +{ + lcdd_draw_line(x, y, x, y+h-1, color); +} +/** + * Draw fast horizontal line + */ +void lcdd_draw_fast_hline (uint32_t x, uint32_t y, uint32_t w, uint32_t color) +{ + lcdd_draw_line(x, y, x+w-1, y, color); +} +/** + * Fill rectangle with color + */ +static void _lcdd_fill_rectangle (uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color) +{ + uint32_t i; + for (i=x; i= 0) + { + y--; + ddF_y += 2; + f += ddF_y; + } + x++; + ddF_x += 2; + f += ddF_x; + if (corner & 0x4) { + _draw_pixel(x0 + x, y0 + y); + _draw_pixel(x0 + y, y0 + x); + } + if (corner & 0x2) { + _draw_pixel(x0 + x, y0 - y); + _draw_pixel(x0 + y, y0 - x); + } + if (corner & 0x8) { + _draw_pixel(x0 - y, y0 + x); + _draw_pixel(x0 - x, y0 + y); + } + if (corner & 0x1) { + _draw_pixel(x0 - y, y0 - x); + _draw_pixel(x0 - x, y0 - y); + } + } +} +/** + * Fill a circle + */ +static void _lcdd_fill_circle (uint32_t x0, uint32_t y0, uint32_t r, uint8_t corner, uint32_t delta, uint32_t color) +{ + int32_t f = 1 - r; + int32_t ddF_x = 1; + int32_t ddF_y = -2 * (int32_t)r; + int32_t x = 0; + int32_t y = r; + + while (x= 0) { + y--; + ddF_y += 2; + f += ddF_y; + } + x++; + ddF_x += 2; + f += ddF_x; + + if (corner & 0x1) { + lcdd_draw_fast_vline(x0+x, y0-y, 2*y+1+delta, color); + lcdd_draw_fast_vline(x0+y, y0-x, 2*x+1+delta, color); + } + if (corner & 0x2) { + lcdd_draw_fast_vline(x0-x, y0-y, 2*y+1+delta, color); + lcdd_draw_fast_vline(x0-y, y0-x, 2*x+1+delta, color); + } + } +} + +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * Draw a rectangle with rounded corners + */ +void lcdd_draw_rounded_rect (uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t r, uint32_t color) +{ + _set_front_color(color); + _hide_canvas(); + // smarter version + lcdd_draw_fast_hline(x+r, y, w-2*r, color); // Top + lcdd_draw_fast_hline(x+r, y+h-1, w-2*r, color); // Bottom + lcdd_draw_fast_vline(x, y+r, h-2*r, color); // Left + lcdd_draw_fast_vline(x+w-1, y+r, h-2*r, color); // Right + // draw four corners + _lcdd_draw_circle(x+r, y+r, r, 1, color); + _lcdd_draw_circle(x+w-r-1, y+r, r, 2, color); + _lcdd_draw_circle(x+w-r-1, y+h-r-1, r, 4, color); + _lcdd_draw_circle(x+r, y+h-r-1, r, 8, color); + _show_canvas(); +} +/** + * Fill a rectangle with rounded corners + */ +void lcdd_fill_rounded_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t r, uint32_t color) +{ + _set_front_color(color); + _hide_canvas(); + if (w>(2*r)) { + _lcdd_fill_rectangle(x+r, y, w-(2*r), h, color); + // draw four corners + _lcdd_fill_circle(x+w-r-1, y+r, r, 1, h-2*r-1, color); + _lcdd_fill_circle(x+r, y+r, r, 2, h-2*r-1, color); + } + _show_canvas(); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.h new file mode 100644 index 000000000..c70605c5d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_draw.h @@ -0,0 +1,125 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/** \addtogroup lcdd_draw Drawing On LCD + * + * Interface for drawing function on LCD. + * + * \note Before drawing, canvas should be selected via + * lcdd_select_canvas(), or created by lcdd_create_canvas(). + * + * Following functions can use: + * - Simple drawing: + * - lcdd_fill() + * - lcdd_draw_pixel() + * - lcdd_read_pixel() + * - lcdd_draw_line() + * - lcdd_draw_rectangle(), lcdd_draw_filled_rectangle() + * - lcdd_draw_circle(), lcdd_draw_filled_circle() + * - lcdd_draw_image() + * - String related: + * - lcdd_draw_string() + * - lcdd_get_string_size() + * + * \sa \ref lcdd_module, \ref lcdd_font + */ + +#ifndef DRAW_H +#define DRAW_H +/** \addtogroup lcdd_draw + *@{ + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + + /** \addtogroup lcdd_draw_func LCD Drawing Functions */ +/** @{*/ +extern void lcdd_fill_white(void); + +extern void lcdd_fill(uint32_t color); + +extern void lcdd_draw_pixel(uint32_t x, uint32_t y, uint32_t c); + +extern uint32_t lcdd_read_pixel(uint32_t x, uint32_t y); + +extern void lcdd_draw_line(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, + uint32_t color); + +extern void lcdd_draw_rectangle(uint32_t dwX, uint32_t dwY, uint32_t dwWidth, + uint32_t dwHeight, uint32_t dwColor); + +extern void lcdd_draw_filled_rectangle(uint32_t dwX1, uint32_t dwY1, + uint32_t dwX2, uint32_t dwY2, uint32_t dwColor); + +extern void lcdd_draw_circle(uint32_t x, uint32_t y, uint32_t r, uint32_t color); +extern void lcdd_draw_filled_circle(uint32_t dwX, uint32_t dwY, uint32_t dwR, + uint32_t dwColor); + +extern void lcdd_draw_string(uint32_t x, uint32_t y, const char *pString, + uint32_t color); + +extern void lcdd_draw_string_with_bgcolor(uint32_t x, uint32_t y, + const char *pString, uint32_t fontColor, + uint32_t bgColor); + +extern void lcdd_get_string_size(const char *pString, uint32_t * pWidth, + uint32_t * pHeight); + +extern void lcdd_draw_image(uint32_t x, uint32_t y, const uint8_t * pImage, + uint32_t width, uint32_t height); + +extern void lcdd_clear_window(uint32_t dwX, uint32_t dwY, uint32_t dwWidth, + uint32_t dwHeight, uint32_t dwColor); + + +extern void lcdd_draw_rounded_rect (uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t r, uint32_t color); + +extern void lcdd_fill_rounded_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t r, uint32_t color); + + +extern void lcdd_draw_fast_vline (uint32_t x, uint32_t y, uint32_t h, uint32_t color); +extern void lcdd_draw_fast_hline (uint32_t x, uint32_t y, uint32_t w, uint32_t color); + +/** @}*/ +/**@}*/ +#endif /* #ifndef DRAW_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.c new file mode 100644 index 000000000..8dfcf0526 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.c @@ -0,0 +1,204 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file + * + * Implementation of draw font on LCD. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "lcd_font.h" +#include "lcd_draw.h" + +#include "font.h" + +#include + +/*---------------------------------------------------------------------------- + * Local variables + *----------------------------------------------------------------------------*/ + +/** Global variable describing the font being instanced. */ +//const Font gFont = { 10, 14 }; + +static uint8_t font_sel = FONT10x14; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +struct _font_parameters* lcdd_select_font (_FONT_enum font) +{ + font_sel = font; + return &font_param[font]; +} + +uint8_t lcdd_get_selected_font (void) +{ + return font_sel; +} + +void lcdd_draw_char(uint32_t x, uint32_t y, uint8_t c, uint32_t color) +{ + uint32_t row, col; + uint8_t Ch; + uint8_t width = font_param[font_sel].width ; + uint8_t height = font_param[font_sel].height; + const uint8_t* pfont = font_param[font_sel].pfont; + + assert((c >= 0x20) && (c <= 0x7F)); + + switch (font_sel) + { + case FONT10x14: + for (col=0 ; col < width ; col++ ) { + for (row=0 ; row<8 ; row++ ) { + Ch = (pfont[((c - 0x20) * 20) + col * 2] >> (7 - row)) & 0x1; + if (Ch) lcdd_draw_pixel( x+col, y+row, color) ; + } + for (row=0; row<6; row++ ) { + Ch = (pfont[((c - 0x20) * 20) + col * 2 + 1] >> (7 - row)) & 0x1; + if (Ch) lcdd_draw_pixel( x+col, y+row+8, color) ; + } + } + break; + + case FONT10x8: + for (col=0 ; col < width ; col++ ) { + Ch = pfont[((c-0x20)*width)+ col]; + if (Ch) { + for (row=0 ; row < height; row++ ) { + if ((Ch>>row)&0x1) { + lcdd_draw_pixel( x+(height-row), y+col, color) ; + } + } + } + } + break; + + case FONT8x8: + case FONT6x8: + for (col=0 ; col < width ; col++ ) { + Ch = pfont[((c-0x20)*width)+ col]; + if (Ch) { + for (row=0 ; row < height; row++ ) { + if ((Ch>>row)&0x1) { + if (font_sel == FONT8x8) + lcdd_draw_pixel( x+row, y+col, color) ; + else + lcdd_draw_pixel( x+col, y+row, color) ; + } + } + } + } + break; + } +} + +/** + * \brief Draws an ASCII character on LCD with given background color. + * + * \param x X-coordinate of character upper-left corner. + * \param y Y-coordinate of character upper-left corner. + * \param c Character to output. + * \param fontColor Character color. + * \param bgColor Background color. + */ +void lcdd_draw_char_with_bgcolor(uint32_t x, uint32_t y, uint8_t c, uint32_t fontColor, + uint32_t bgColor) +{ + uint32_t row, col; + uint8_t Ch; + uint8_t width = font_param[font_sel].width ; + uint8_t height = font_param[font_sel].height; + const uint8_t* pfont = font_param[font_sel].pfont; + + assert((c >= 0x20) && (c <= 0x7F)); + + switch (font_sel) + { + case FONT10x14: + for (col=0 ; col < width ; col++ ) { + for (row=0 ; row<8 ; row++ ) { + Ch = (pfont[((c - 0x20) * 20) + col * 2] >> (7 - row)) & 0x1; + if (Ch) lcdd_draw_pixel( x+col, y+row, fontColor) ; + else lcdd_draw_pixel( x+col, y+row, bgColor) ; + } + for (row=0; row<6; row++ ) { + Ch = (pfont[((c - 0x20) * 20) + col * 2 + 1] >> (7 - row)) & 0x1; + if (Ch) lcdd_draw_pixel( x+col, y+row+8, fontColor) ; + else lcdd_draw_pixel( x+col, y+row+8, bgColor) ; + } + } + break; + + case FONT10x8: + for (col=0 ; col < width ; col++ ) { + Ch = pfont[((c-0x20)*width)+ col]; + if (Ch) { + for (row=0 ; row < height; row++ ) { + if ((Ch>>row)&0x1) { + lcdd_draw_pixel( x+(height-row), y+col, fontColor) ; + } + else { + lcdd_draw_pixel( x+(height-row), y+col, bgColor) ; + } + } + } + } + break; + + case FONT8x8: + case FONT6x8: + for (col=0 ; col < width ; col++ ) { + Ch = pfont[((c-0x20)*width)+ col]; + if (Ch) { + for (row=0 ; row < height; row++ ) { + if ((Ch>>row)&0x1) { + if (font_sel == FONT8x8) + lcdd_draw_pixel( x+row, y+col, fontColor) ; + else + lcdd_draw_pixel( x+col, y+row, fontColor) ; + } + else { + if (font_sel == FONT8x8) + lcdd_draw_pixel( x+row, y+col, bgColor) ; + else + lcdd_draw_pixel( x+col, y+row, bgColor) ; + } + } + } + } + break; + } +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h new file mode 100644 index 000000000..cfa7608eb --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h @@ -0,0 +1,112 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * Interface for draw font on LCD. + * + */ + +/** + * \addtogroup lcdd_font LCD Font Drawing + * + * \section Purpose + * + * The lcd_font.h files declares a font structure and a LCDD_DrawChar() function + * that must be implemented by a font definition file to be used with the + * lcdd_draw_string() method of draw.h. + * + * The font10x14.c implements the necessary variable and function for a 10x14 + * font. + * + * \note Before drawing fonts, canvas should be selected via + * LCDD_SelectCanvas(), or created by LCDD_CreateCanvas(). + * + * \section Usage + * + * -# Declare a gFont global variable with the necessary Font information. + * -# Implement an LCDD_DrawChar() function which displays the specified + * character on the LCD. + * -# Select or create canvas via LCDD_SelectCanvas() or LCDD_CreateCanvas(). + * -# Use the lcdd_draw_string() method defined in draw.h to display a complete + * string. + * + * \sa \ref lcdd_module, \ref lcdd_draw. + */ + +#ifndef _LCD_FONT_ +#define _LCD_FONT_ +/** \addtogroup lcdd_font + *@{ + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "font.h" + +#include + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** \brief Describes the font (width, height, supported characters, etc.) used by + * the LCD driver draw API. + */ +struct _font { + uint8_t width; /* Font width in pixels. */ + uint8_t height; /* Font height in pixels. */ +}; + +/*---------------------------------------------------------------------------- + * Variables + *----------------------------------------------------------------------------*/ + + + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ +/** \addtogroup lcdd_font_func Font Functions */ +/** @{*/ + +extern struct _font_parameters* lcdd_select_font (_FONT_enum font); + +extern uint8_t lcdd_get_selected_font (void); + +extern void lcdd_draw_char(uint32_t x, uint32_t y, uint8_t c, uint32_t color); + +extern void lcdd_draw_char_with_bgcolor(uint32_t x, uint32_t y, uint8_t c, + uint32_t fontColor, uint32_t bgColor); +/** @}*/ +/**@}*/ +#endif /* #ifndef LCD_FONT_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.c new file mode 100644 index 000000000..73f06ee98 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.c @@ -0,0 +1,35 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +#include "mutex.h" + +void mutex_lock(mutex_t* mutex) +{ + while(mutex_try_lock(mutex)); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.h new file mode 100644 index 000000000..5cff50559 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex.h @@ -0,0 +1,43 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 MUTEX_HEADER_ +#define MUTEX_HEADER_ + +#include "compiler.h" + +/* Instances of mutex_t should be word-aligned (ALIGNED(4)) */ +typedef volatile int mutex_t; + +int mutex_try_lock(mutex_t* mutex); +void mutex_free(mutex_t* mutex); +void mutex_lock(mutex_t* mutex); +int mutex_is_locked(const mutex_t* mutex); + +#endif /* MUTEX_HEADER_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_gcc.S b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_gcc.S new file mode 100644 index 000000000..3b86a4a73 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_gcc.S @@ -0,0 +1,52 @@ +#define LOCKED 0x1 +#define FREE 0x0 +#define SUCCESS 0x1 +#define FAILURE 0x0 + + +/* try to lock mutex */ + .global mutex_try_lock + .section .text.mutex_try_lock +mutex_try_lock: + push {r1,r2,r3} + mov r1, #LOCKED + mov r3, #SUCCESS +1: + ldrex r2, [r0] + cmp r2, r1 /* Test if mutex is locked or unlocked */ + moveq r3, #FAILURE /* If locked */ + beq 2f /* return failure */ + strexne r2, r1, [r0] /* Not locked, attempt to lock it */ + cmp r2, #LOCKED /* Check if Store-Exclusive failed */ + movne r3, #FAILURE /* If failed - return failure */ +2: + dmb /* Required before accessing protected resource */ + mov r0, r3 + pop {r1,r2,r3} + bx lr + + +/* free mutex */ + .global mutex_free + .section .text.mutex_free +mutex_free: + push {r1} + mov r1, #FREE + dmb /* Required before releasing protected resource */ + str r1, [r0] /* Unlock mutex */ + pop {r1} + bx lr + +/* Check if mutex is locked or not */ + .global mutex_is_locked + .section .text.mutex_is_locked +mutex_is_locked: + push {r1, r2} + mov r1, #LOCKED + + ldrex r2, [r0] + cmp r2, r1 /* Test if mutex is locked or unlocked */ + moveq r0, #SUCCESS + movne r0, #FAILURE + pop {r1, r2} + bx lr diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_iar.s b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_iar.s new file mode 100644 index 000000000..7d681c84e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/mutex_iar.s @@ -0,0 +1,59 @@ + MODULE ?mutex + + //// Forward declaration of sections. + SECTION IRQ_STACK:DATA:NOROOT(2) + SECTION CSTACK:DATA:NOROOT(3) + +#define LOCKED 0x1 +#define FREE 0x0 +#define SUCCESS 0x1 +#define FAILURE 0x0 + +/* try to lock mutex */ + SECTION .mutex_try_lock:CODE:NOROOT(2) + PUBLIC mutex_try_lock +mutex_try_lock: + push {r1,r2,r3} + mov r1, #LOCKED + mov r3, #SUCCESS + + ldrex r2, [r0] + cmp r2, r1 /* Test if mutex is locked or unlocked */ + moveq r3, #FAILURE /* If locked */ + beq lbl1 /* return failure */ + strexne r2, r1, [r0] /* Not locked, attempt to lock it */ + cmp r2, #LOCKED /* Check if Store-Exclusive failed */ + movne r3, #FAILURE /* If failed - return failure */ +lbl1: + dmb /* Required before accessing protected resource */ + mov r0, r3 + pop {r1,r2,r3} + bx lr + + +/* free mutex */ + SECTION .mutex_free:CODE:NOROOT(2) + PUBLIC mutex_free +mutex_free: + push {r1} + mov r1, #FREE + dmb /* Required before releasing protected resource */ + str r1, [r0] /* Unlock mutex */ + pop {r1} + bx lr + +/* Check if mutex is locked or not */ + SECTION .mutex_is_locked:CODE:NOROOT(2) + PUBLIC mutex_is_locked +mutex_is_locked: + push {r1, r2} + mov r1, #LOCKED + + ldrex r2, [r0] + cmp r2, r1 /* Test if mutex is locked or unlocked */ + moveq r0, #SUCCESS + movne r0, #FAILURE + pop {r1, r2} + bx lr + + END diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.c new file mode 100644 index 000000000..4b3aede48 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.c @@ -0,0 +1,68 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*------------------------------------------------------------------------------ + * Header + *------------------------------------------------------------------------------*/ + +#include "board.h" + +#include "rand.h" + +/*------------------------------------------------------------------------------ + * Global Variables + *------------------------------------------------------------------------------*/ + +static uint32_t _dwRandNext = 1; + +/*------------------------------------------------------------------------------ + * Exported Functions + *------------------------------------------------------------------------------*/ + +/** + * Initialize the seed for rand generator. + * + * \param dwSeed rand initiation seed + */ +void srand(uint32_t dwSeed) +{ + _dwRandNext = dwSeed; +} + +/** + * Return a random number, maxinum assumed to be 65536 + */ +uint32_t rand(void) +{ + _dwRandNext = _dwRandNext * 1103515245 + 12345; + + return (uint32_t) (_dwRandNext / 131072) % 65536; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.h new file mode 100644 index 000000000..543d0012d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/rand.h @@ -0,0 +1,50 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------------ + * \file + * + * \section Purpose + * Small function for gererating random number. + * + *------------------------------------------------------------------------------*/ + +#ifndef _RAND_ +#define _RAND_ + +/*------------------------------------------------------------------------------ + * Global Functions + *------------------------------------------------------------------------------*/ + +#include + +void srand(uint32_t dwSeed); +extern uint32_t rand(void); + +#endif /* #ifndef _RAND_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/ring.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/ring.h new file mode 100644 index 000000000..4506f70ce --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/ring.h @@ -0,0 +1,81 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _RING_H_ +#define _RING_H_ + +#include "intmath.h" + +/*------------------------------------------------------------------------------ + * Exported functions + *------------------------------------------------------------------------------*/ + +/** Return count in buffer */ +#define RING_CNT(head,tail,size) fixed_mod((head) - (tail), (size)) + +/** Return space available, 0..size-1. always leave one free char as a + * completely full buffer has head == tail, which is the same as empty */ +#define RING_SPACE(head,tail,size) RING_CNT((tail),((head) + 1),(size)) + +/** Return count up to the end of the buffer. Carefully avoid accessing head + * and tail more than once, so they can change underneath us without returning + * inconsistent results */ +#define RING_CNT_TO_END(head,tail,size) \ + ({int end = (size) - (tail); \ + int n = fixed_mod((head) + end, (size)); \ + n < end ? n : end;}) + +/** Return space available up to the end of the buffer */ +#define RING_SPACE_TO_END(head,tail,size) \ + ({int end = (size) - 1 - (head); \ + int n = fixed_mod(end + (tail), (size)); \ + n <= end ? n : end+1;}) + +/** Increment head or tail */ +#define RING_INC(headortail,size) \ + (headortail)++; \ + if((headortail) >= (size)) { \ + (headortail) = 0; \ + } + +/** Decrement head or tail */ +#define RING_DEC(headortail,size) \ + if((headortail) == 0) { \ + (headortail) = (size) - 1; \ + } else { \ + (headortail)--; \ + } + +/** Circular buffer is empty ? */ +#define RING_EMPTY(head, tail) ((head) == (tail)) + +/** Clear circular buffer */ +#define RING_CLEAR(head, tail) ((head) = (tail) = 0) + +#endif /* _RING_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/syscalls.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/syscalls.c new file mode 100644 index 000000000..5ee6db0ac --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/syscalls.c @@ -0,0 +1,159 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file syscalls.c + * + * Implementation of syscall bindings. + * + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ +#include "compiler.h" +#include "misc/console.h" + +#ifdef __GNUC__ + +#include +#include +#include +#include + +/*---------------------------------------------------------------------------- + * Imported variables + *----------------------------------------------------------------------------*/ + +extern int _heap; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/* Desactivate stream buffering */ +CONSTRUCTOR static void _disable_io_buffering(void) +{ + setvbuf(stdout, (char *)NULL, _IONBF, 0); +} + +extern caddr_t _sbrk(int incr); +caddr_t _sbrk(int incr) +{ + static unsigned char *heap = NULL; + unsigned char *prev_heap; + + if (heap == NULL) { + heap = (unsigned char *) &_heap; + } + prev_heap = heap; + + heap += incr; + + return (caddr_t) prev_heap; +} + +extern int _getpid(void); +int _getpid(void) +{ + return -1; +} + +extern void _kill(int pid, int sig); +void _kill(int pid, int sig) +{ + return; +} + +extern void _exit(int status); +void _exit(int status) +{ + printf("Program terminated with status %d.\n", status); + while (1) ; +} + +extern int _fstat(int file, struct stat *st); +int _fstat(int file, struct stat *st) +{ + st->st_mode = S_IFCHR; + return 0; +} + +extern int _lseek(int file, int ptr, int dir); +int _lseek(int file, int ptr, int dir) +{ + return 0; +} + +extern int _isatty(int file); +int _isatty(int file) +{ + return 1; +} + +extern int _read(int file, char *ptr, int len); +int _read(int file, char *ptr, int len) +{ + return 0; +} + +extern int _write(int file, char *ptr, int len); +int _write(int file, char *ptr, int len) +{ + int i; + + for (i = 0; i < len; i++, ptr++) { + console_put_char(*ptr); + } + + return i; +} + +extern int _close(int file); +int _close(int file) +{ + return -1; +} + +#elif defined __ICCARM__ /* IAR Ewarm 5.41+ */ + +/** + * \brief Outputs a character on the DBGU. + * + * \param c Character to output. + * + * \return The character that was output. + */ +WEAK int putchar(int c) +{ + console_put_char(c); + return c; +} + +#endif /* defined __ICCARM__ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.c new file mode 100644 index 000000000..92f5a54b6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.c @@ -0,0 +1,141 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * Implement simple PIT usage as system tick. + */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "board.h" +#include "timer.h" +#include "peripherals/tc.h" +#include "peripherals/pit.h" +#include "peripherals/aic.h" +#include "peripherals/pmc.h" + +/*---------------------------------------------------------------------------- + * Local variables + *----------------------------------------------------------------------------*/ + +/** Tick Counter */ +static volatile uint32_t _timer = 0; +static uint32_t _resolution = 0; + +/*---------------------------------------------------------------------------- + * Exported Functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Handler for Sytem Tick interrupt. + */ +static void timer_increment(void) +{ + uint32_t status; + + /* Read the PIT status register */ + status = pit_get_status() & PIT_SR_PITS; + if (status != 0) { + + /* 1 = The Periodic Interval timer has reached PIV + * since the last read of PIT_PIVR. Read the PIVR to + * acknowledge interrupt and get number of ticks + * Returns the number of occurrences of periodic + * intervals since the last read of PIT_PIVR. */ + _timer += (pit_get_pivr() >> 20); + } +} + +uint32_t timer_configure(uint32_t resolution) +{ + pit_disable_it(); + if (!resolution) + resolution = BOARD_TIMER_RESOLUTION; + _timer = 0; + pmc_enable_peripheral(ID_PIT); + pit_init(resolution); + aic_set_source_vector(ID_PIT, timer_increment); + aic_enable(ID_PIT); + pit_enable_it(); + pit_enable(); + _resolution = resolution; + return 0; +} + +uint32_t timer_get_resolution(void) +{ + return _resolution; +} + +uint32_t timer_get_interval(uint32_t start, uint32_t end) +{ + if (end >= start) + return (end - start); + return (end + (0xFFFFFFFF - start) + 1); +} + +void timer_start_timeout(struct _timeout* timeout, uint32_t count) +{ + timeout->start = _timer; + timeout->count = count; +} + +uint8_t timer_timeout_reached(struct _timeout* timeout) +{ + return timer_get_interval(timeout->start, _timer) >= timeout->count; +} + +void timer_wait(uint32_t count) +{ + uint32_t start, current; + start = _timer; + do { + current = _timer; + } while (timer_get_interval(start, current) < count); +} + +void timer_sleep(uint32_t count) +{ + uint32_t start, current; + asm("CPSIE I"); + start = _timer; + + do { + asm("WFI"); + current = _timer; + } while (timer_get_interval(start, current) < count); +} + +uint32_t timer_get_tick(void) +{ + return _timer; +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.h new file mode 100644 index 000000000..d75f7e2b0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/timer.h @@ -0,0 +1,121 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * Methods and definitions for an internal timer. + * + * Defines a common and simpliest use of timer to generate delays using PIT + * + * \par Usage + * + * -# Configure the System Tick with timer_configure() when MCK changed + * \note + * Must be done before any invoke of timer_wait(), or timer_sleep() + * -# Uses timer_wait to actively wait according to your timer resolution. + * -# Uses timer_sleep to passively wait ccording to your timer resolution. + * + */ + +#ifndef TIMER_HEADER_ +#define TIMER_HEADER_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +struct _timeout +{ + uint32_t start; + uint32_t count; +}; +/*---------------------------------------------------------------------------- + * Global functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Configures the PIT & reset _timer. + * Systick interrupt handler will generates 1ms interrupt and increase a + * tickCount. + * + * \note PIT is enabled automatically in this function. + * \warning This function also set PIT handler to aic which is + * mandatory to make the timer API work + * + * \param resolution initialize PIT resolution (in nano seconds) + */ +extern uint32_t timer_configure(uint32_t resolution); + +/** + * \brief Sync wait for count times resoltion + */ +extern void timer_wait(uint32_t count); + +/** + * \brief Retrieve current timer resolution. + * + * \return Current timer resolution (0 if not already set) + */ +extern uint32_t timer_get_resolution(void); + +/** + * \brief Sync sleep for count times resolution + */ +extern void timer_sleep(uint32_t count); + +/** + * \brief Initialize a timeout + */ +extern void timer_start_timeout(struct _timeout* timeout, uint32_t count); + +/** + * \brief Tells if the timeout as been reached + */ +extern uint8_t timer_timeout_reached(struct _timeout* timeout); + +/** + * \brief Compute elapsed number of ticks between start and end with + * taking overlaps into accounts + * + * \param start Start tick point. + * \param end End tick point. + */ +extern uint32_t timer_get_interval(uint32_t start, uint32_t end); + +/** + * \brief Returns the current number of ticks + */ +extern uint32_t timer_get_tick(void); + +#endif /* TIMER_HEADER_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.c new file mode 100644 index 000000000..29ca74122 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.c @@ -0,0 +1,46 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "board.h" +#include "trace.h" +#include "misc/console.h" +#include "peripherals/pio.h" + +/*------------------------------------------------------------------------------ + * Internal variables + *------------------------------------------------------------------------------*/ + +/** Current trace level */ +uint32_t trace_level = TRACE_LEVEL; diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.h new file mode 100644 index 000000000..8629ca615 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/trace.h @@ -0,0 +1,158 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** + * \file + * + * \par Purpose + * + * Standard output methods for reporting debug information, warnings and + * errors, which can be easily be turned on/off. + * + * \par Usage + * -# Uses the trace_debug(), trace_info(), trace_warning(), trace_error() + * trace_fatal() macros to output traces throughout the program. + * -# Each type of trace has a level : Debug 5, Info 4, Warning 3, Error 2 + * and Fatal 1. Disable a group of traces by changing the value of + * TRACE_LEVEL during compilation; traces with a level bigger than TRACE_LEVEL + * are not generated. To generate no trace, use the reserved value 0. + * -# Trace disabling can be dynamic. The trace level can be modified in + * runtime but messages with a level higher that TRACE_LEVEL are compiled-out + * an will not be displayed regardless of the value of trace_level. + * + * \par traceevels Trace level description + * -# trace_debug (5): Traces whose only purpose is for debugging the program, + * and which do not produce meaningful information otherwise. + * -# trace_info (4): Informational trace about the program execution. Should + * enable the user to see the execution flow. + * -# trace_warning (3): Indicates that a minor error has happened. In most case + * it can be discarded safely; it may even be expected. + * -# trace_error (2): Indicates an error which may not stop the program execution, + * but which indicates there is a problem with the code. + * -# trace_fatal (1): Indicates a major error which prevents the program from going + * any further. Program will stop after the fatal trace message is displayed. + */ + +#ifndef _TRACE_H_ +#define _TRACE_H_ + +/* ------------------------------------------------------------------------------ + * Headers + * ----------------------------------------------------------------------------*/ + +#include "compiler.h" +#include +#include + +/* ------------------------------------------------------------------------------ + * Exported Definitions + * ----------------------------------------------------------------------------*/ + +#define TRACE_LEVEL_DEBUG 5 +#define TRACE_LEVEL_INFO 4 +#define TRACE_LEVEL_WARNING 3 +#define TRACE_LEVEL_ERROR 2 +#define TRACE_LEVEL_FATAL 1 +#define TRACE_LEVEL_SILENT 0 + +/* By default, all traces are output except the debug one. */ +#ifndef TRACE_LEVEL +#define TRACE_LEVEL TRACE_LEVEL_INFO +#endif + +/* ------------------------------------------------------------------------------ + * Exported variables + * ----------------------------------------------------------------------------*/ + +/** Trace level is modifable at runtime */ +extern uint32_t trace_level; + +/* ------------------------------------------------------------------------------ + * Exported functions + * ----------------------------------------------------------------------------*/ + +/** + * Outputs a formatted string using 'printf' if the log level is high + * enough. Can be disabled by defining TRACE_LEVEL=0 during compilation. + * \param ... Additional parameters depending on formatted string. + */ + +#if (TRACE_LEVEL >= 1) +#define trace_fatal(...) \ + { if (trace_level >= TRACE_LEVEL_FATAL) { printf("-F- " __VA_ARGS__); while(1); } } +#define trace_fatal_wp(...) \ + { if (trace_level >= TRACE_LEVEL_FATAL) { printf(__VA_ARGS__); while(1); } } +#else +#define trace_fatal(...) \ + { while (1); } +#define trace_fatal_wp(...) \ + { while (1); } +#endif + +#if (TRACE_LEVEL >= 2) +#define trace_error(...) \ + { if (trace_level >= TRACE_LEVEL_ERROR) { printf("-E- " __VA_ARGS__); } } +#define trace_error_wp(...) \ + { if (trace_level >= TRACE_LEVEL_ERROR) { printf(__VA_ARGS__); } } +#else +#define trace_error(...) { } +#define trace_error_wp(...) { } +#endif + +#if (TRACE_LEVEL >= 3) +#define trace_warning(...) \ + { if (trace_level >= TRACE_LEVEL_WARNING) { printf("-W- " __VA_ARGS__); } } +#define trace_warning_wp(...) \ + { if (trace_level >= TRACE_LEVEL_WARNING) { printf(__VA_ARGS__); } } +#else +#define trace_warning(...) { } +#define trace_warning_wp(...) { } +#endif + +#if (TRACE_LEVEL >= 4) +#define trace_info(...) \ + { if (trace_level >= TRACE_LEVEL_INFO) { printf("-I- " __VA_ARGS__); } } +#define trace_info_wp(...) \ + { if (trace_level >= TRACE_LEVEL_INFO) { printf(__VA_ARGS__); } } +#else +#define trace_info(...) { } +#define trace_info_wp(...) { } +#endif + +#if (TRACE_LEVEL >= 5) +#define trace_debug(...) \ + { if (trace_level >= TRACE_LEVEL_DEBUG) { printf("-D- " __FILE__ ":" STRINGIFY(__LINE__) " " __VA_ARGS__); } } +#define trace_debug_wp(...) \ + { if (trace_level >= TRACE_LEVEL_DEBUG) { printf(__VA_ARGS__); } } +#else +#define trace_debug(...) { } +#define trace_debug_wp(...) { } +#endif + +#endif /* _TRACE_H_ */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.c new file mode 100644 index 000000000..29fa665f7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.c @@ -0,0 +1,107 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/** \file */ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include + +#include "wav.h" + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** WAV letters "RIFF" */ +#define WAV_CHUNKID 0x46464952 + +/** WAV letters "WAVE"*/ +#define WAV_FORMAT 0x45564157 + +/** WAV letters "fmt "*/ +#define WAV_SUBCHUNKID 0x20746D66 + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +/** + * \brief Check if the header of a Wav file is valid or not. + * + * \param header Wav header information. + * \return true if the header of a Wav file is valid; otherwise returns false. + */ +bool wav_is_valid(const struct _wav_header *header) +{ + return (header->chunk_id == WAV_CHUNKID + && header->format == WAV_FORMAT + && header->subchunk1_size == 0x10); +} + +/** + * \brief Display the information of the WAV file (sample rate, stereo/mono + * and frame size). + * + * \param header Wav header information. + */ + +void wav_display_info(const struct _wav_header *header) +{ + printf("Wave file header information\n\r"); + printf("--------------------------------\n\r"); + printf(" - Chunk ID = 0x%08X\n\r", + (unsigned int)header->chunk_id); + printf(" - Chunk Size = %u\n\r", + (unsigned int)header->chunk_size); + printf(" - Format = 0x%08X\n\r", + (unsigned int)header->format); + printf(" - SubChunk ID = 0x%08X\n\r", + (unsigned int)header->subchunk1_id); + printf(" - Subchunk1 Size = %u\n\r", + (unsigned int)header->subchunk1_size); + printf(" - Audio Format = 0x%04X\n\r", + (unsigned int)header->audio_format); + printf(" - Num. Channels = %d\n\r", + (unsigned int)header->num_channels); + printf(" - Sample Rate = %u\n\r", + (unsigned int)header->sample_rate); + printf(" - Byte Rate = %u\n\r", + (unsigned int)header->byte_rate); + printf(" - Block Align = %d\n\r", + (unsigned int)header->block_align); + printf(" - Bits Per Sample = %d\n\r", + (unsigned int)header->bits_per_sample); + printf(" - Subchunk2 ID = 0x%08X\n\r", + (unsigned int)header->subchunk2_id); + printf(" - Subchunk2 Size = %u\n\r", + (unsigned int)header->subchunk2_size); +} diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.h new file mode 100644 index 000000000..8e9438d9b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/wav.h @@ -0,0 +1,82 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2015, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 WAV_H +#define WAV_H + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include +#include + +/*---------------------------------------------------------------------------- + * Types + *----------------------------------------------------------------------------*/ + +/** Standard WAV file header information. */ +struct _wav_header { + /** Contains the letters "RIFF" in ASCII form. */ + uint32_t chunk_id; + /** Size of the rest of the chunk following this number. */ + uint32_t chunk_size; + /** Contains the letters "WAVE". */ + uint32_t format; + /** Contains the letters "fmt ". */ + uint32_t subchunk1_id; + /** 16 for PCM. This is the size of the rest of the Subchunk which follows this number. */ + uint32_t subchunk1_size; + /** PCM = 1 (i.e. Linear quantization). Values other than 1 indicate some form of compression. */ + uint16_t audio_format; + /** Mono = 1, Stereo = 2, etc. */ + uint16_t num_channels; + /** 8000, 44100, etc. */ + uint32_t sample_rate; + /** SampleRate * NumChannels * BitsPerSample/8 */ + uint32_t byte_rate; + /** NumChannels * BitsPerSample/8 */ + uint16_t block_align; + /** 8 bits = 8, 16 bits = 16, etc. */ + uint16_t bits_per_sample; + /** Contains the letters "data". */ + uint32_t subchunk2_id; + /** Number of bytes in the data. */ + uint32_t subchunk2_size; +}; + +/*---------------------------------------------------------------------------- + * Exported functions + *----------------------------------------------------------------------------*/ + +extern bool wav_is_valid(const struct _wav_header *header); + +extern void wav_display_info(const struct _wav_header *header); + +#endif /* #ifndef WAV_H */ diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h new file mode 100644 index 000000000..05695b937 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOSConfig.h @@ -0,0 +1,204 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#define configCPU_CLOCK_HZ /* Not used in this port as the value comes from the Atmel libraries. */ +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configUSE_TICKLESS_IDLE 0 +#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 42 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 0 +#define configUSE_COUNTING_SEMAPHORES 1 + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define configTIMER_QUEUE_LENGTH 5 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xEventGroupSetBitsFromISR 1 +#define INCLUDE_xTimerPendFunctionCall 1 + +/* This demo makes use of one or more example stats formatting functions. These +format the raw data provided by the uxTaskGetSystemState() function in to human +readable ASCII form. See the notes in the implementation of vTaskList() within +FreeRTOS/Source/tasks.c for limitations. */ +#define configUSE_STATS_FORMATTING_FUNCTIONS 1 + +/* Cortex-A specific setting: FPU has 16 (rather than 32) d registers. See: +http://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-proprietary-interrupt-controller.html */ +#define configFPU_D32 0 + +/* Cortex-A specific setting for Atmel SAMA5D2x. */ +#define configAIC_BASE_ADDRESS ( 0xFC020000UL ) +#define configPIT_BASE_ADDRESS ( 0xF8048030UL ) + +/* Cortex-A specific setting: The address of the register within the interrupt +controller from which the address of the current interrupt's handling function +can be obtained. See: +http://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-proprietary-interrupt-controller.html */ +#define configINTERRUPT_VECTOR_ADDRESS ( configAIC_BASE_ADDRESS + 0x10UL ) + +/* Cortex-A specific setting: The address of End of Interrupt register within +the interrupt controller. See: +http://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-proprietary-interrupt-controller.html */ +#define configEOI_ADDRESS ( configAIC_BASE_ADDRESS + 0x38UL ) + +/* Cortex-A specific setting: configCLEAR_TICK_INTERRUPT() is a macro that is +called by the RTOS kernel's tick handler to clear the source of the tick +interrupt. See: +http://www.FreeRTOS.org/Using-FreeRTOS-on-Cortex-A-proprietary-interrupt-controller.html */ +#define configPIT_PIVR ( *( ( volatile uint32_t * ) ( configPIT_BASE_ADDRESS + 0x8UL ) ) ) +#define configCLEAR_TICK_INTERRUPT() ( void ) configPIT_PIVR /* Read PIT_PIVR to clear interrupt. */ + +/* Prevent C code being included in assembly files when the IAR compiler is +used. */ +#ifndef __IASMARM__ + + /* The interrupt nesting test creates a 20KHz timer. For convenience the + 20KHz timer is also used to generate the run time stats time base, removing + the need to use a separate timer for that purpose. The 20KHz timer + increments ulHighFrequencyTimerCounts, which is used as the time base. + Therefore the following macro is not implemented. */ + #define configGENERATE_RUN_TIME_STATS 1 + extern volatile uint32_t ulHighFrequencyTimerCounts; + #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() + #define portGET_RUN_TIME_COUNTER_VALUE() ulHighFrequencyTimerCounts + + /* The size of the global output buffer that is available for use when there + are multiple command interpreters running at once (for example, one on a UART + and one on TCP/IP). This is done to prevent an output buffer being defined by + each implementation - which would waste RAM. In this case, there is only one + command interpreter running. */ + #define configCOMMAND_INT_MAX_OUTPUT_SIZE 3000 + + /* Normal assert() semantics without relying on the provision of an assert.h + header file. */ + void vAssertCalled( const char * pcFile, unsigned long ulLine ); + #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ ); + + + + /****** Hardware specific settings. *******************************************/ + + /* + * The application must provide a function that configures a peripheral to + * create the FreeRTOS tick interrupt, then define configSETUP_TICK_INTERRUPT() + * in FreeRTOSConfig.h to call the function. FreeRTOS_Tick_Handler() must + * be installed as the peripheral's interrupt handler. + */ + void vConfigureTickInterrupt( void ); + #define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt() + +#endif /* __IASMARM__ */ + +#endif /* FREERTOS_CONFIG_H */ + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOS_tick_config.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOS_tick_config.c new file mode 100644 index 000000000..04ce0256d --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/FreeRTOS_tick_config.c @@ -0,0 +1,139 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +/* FreeRTOS includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Library includes. */ +#include "peripherals/aic.h" +#include "peripherals/pio.h" +#include "peripherals/pit.h" +#include "board.h" + +/* + * The FreeRTOS tick handler. This function must be installed as the handler + * for the timer used to generate the tick interrupt. Note that the interrupt + * generated by the PIT is shared by other system peripherals, so if the PIT is + * used for Tick generation then FreeRTOS_Tick_Handler() can only be installed + * directly as the PIT handler if no other system interrupts need to be + * serviced. If system interrupts other than the PIT need to be serviced then + * install System_Handler() as the PIT interrupt handler in place of + * FreeRTOS_Tick_Handler() and add additional interrupt processing into the + * implementation of System_Handler(). + */ +extern void FreeRTOS_Tick_Handler( void ); +static void System_Handler( void ); + +/*-----------------------------------------------------------*/ + +static void System_Handler( void ) +{ + /* See the comments above the function prototype in this file. */ + FreeRTOS_Tick_Handler(); +} +/*-----------------------------------------------------------*/ + +/* + * The application must provide a function that configures a peripheral to + * create the FreeRTOS tick interrupt, then define configSETUP_TICK_INTERRUPT() + * in FreeRTOSConfig.h to call the function. This file contains a function + * that is suitable for use on the Atmel SAMA5. + */ +void vConfigureTickInterrupt( void ) +{ + /* NOTE: The PIT interrupt is cleared by the configCLEAR_TICK_INTERRUPT() + macro in FreeRTOSConfig.h. */ + + /* Enable the PIT clock. */ + PMC->PMC_PCER0 = 1 << ID_PIT; + + /* Initialize the PIT to the desired frequency - specified in uS. */ + pit_init( 1000000UL / configTICK_RATE_HZ ); + + /* Configure interrupt on PIT. Note this is on the system interrupt, which + is shared with other system peripherals, so System_Handler() must be + installed in place of FreeRTOS_Tick_Handler() if other system handlers are + required. The tick must be given the lowest priority (0 in the SAMA5 AIC) */ + aic_configure( ID_PIT, AIC_SMR_SRCTYPE_EXT_POSITIVE_EDGE ); + aic_set_source_vector( ID_PIT, FreeRTOS_Tick_Handler ); + /* See commend directly above IRQ_ConfigureIT( ID_PIT, 0, System_Handler ); */ + aic_enable( ID_PIT ); + pit_enable_it(); + + /* Enable the pit. */ + pit_enable(); + + /* Prevent compiler warnings in the case where System_Handler() is not used + as the handler. See the comments above the System_Handler() function + prototype at the top of this file. */ + ( void ) System_Handler; +} +/*-----------------------------------------------------------*/ + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.c new file mode 100644 index 000000000..445fc8e50 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.c @@ -0,0 +1,208 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +/* + * This file initialises three timers as follows: + * + * TC0 channels 0 and 1 provide the interrupts that are used with the IntQ + * standard demo tasks, which test interrupt nesting and using queues from + * interrupts. As the interrupt is shared the nesting achieved is not as deep + * as normal when this test is executed, but still worth while. + * + * TC2 channel 0 provides a much higher frequency timer that tests the nesting + * of interrupts that don't use the FreeRTOS API. For convenience, the high + * frequency timer also keeps a count of the number of time it executes, and the + * count is used as the time base for the run time stats (which can be viewed + * through the CLI). + * + * All the timers can nest with the tick interrupt - creating a maximum + * interrupt nesting depth of 3 (normally 4, if the first two timers used + * separate interrupts). + * + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" + +/* Demo includes. */ +#include "IntQueueTimer.h" +#include "IntQueue.h" + +/* Library includes. */ +#include "peripherals/pio.h" +#include "peripherals/pmc.h" +#include "peripherals/aic.h" +#include "peripherals/tc.h" +#include "board.h" + +/* The frequencies at which the first two timers expire are slightly offset to +ensure they don't remain synchronised. The frequency of the highest priority +interrupt is 20 times faster so really hammers the interrupt entry and exit +code. */ +#define tmrTIMER_0_FREQUENCY ( 2000UL ) +#define tmrTIMER_1_FREQUENCY ( 1690UL ) +#define tmrTIMER_2_FREQUENCY ( 20000UL ) + +/* The channels used in TC0 for generating the three interrupts. */ +#define tmrTC0_CHANNEL_0 0 /* At tmrTIMER_0_FREQUENCY */ +#define tmrTC0_CHANNEL_1 1 /* At tmrTIMER_1_FREQUENCY */ +#define tmrTC1_CHANNEL_0 0 /* At tmrTIMER_2_FREQUENCY */ + +/* The bit within the RC_SR register that indicates an RC compare. */ +#define tmrRC_COMPARE ( 1UL << 4UL ) + +/* The high frequency interrupt given the highest priority or all. The priority +of the lower frequency timers must still be above the tick interrupt priority. */ +#define tmrLOWER_PRIORITY 1 +#define tmrHIGHER_PRIORITY 5 +/*-----------------------------------------------------------*/ + +/* Handlers for the two timer peripherals - two channels are used in the TC0 +timer. */ +static void prvTC0_Handler( void ); +static void prvTC1_Handler( void ); + +/* Used to provide a means of ensuring the intended interrupt nesting depth is +actually being reached. */ +extern uint32_t ulPortInterruptNesting; +static uint32_t ulMaxRecordedNesting = 0; + +/* For convenience the high frequency timer increments a variable that is then +used as the time base for the run time stats. */ +volatile uint32_t ulHighFrequencyTimerCounts = 0; + +/*-----------------------------------------------------------*/ + +void vInitialiseTimerForIntQueueTest( void ) +{ + /* Enable the TC clocks. */ + pmc_enable_peripheral( ID_TC0 ); + pmc_enable_peripheral( ID_TC1 ); + + /* Configure TC0 channel 0 for a tmrTIMER_0_FREQUENCY frequency and trigger + on RC compare. */ + tc_trigger_on_freq( TC0, tmrTC0_CHANNEL_0, tmrTIMER_0_FREQUENCY ); + TC0->TC_CHANNEL[ tmrTC0_CHANNEL_0 ].TC_IER = TC_IER_CPCS; + + /* Configure TC0 channel 1 for a tmrTIMER_1_FREQUENCY frequency and trigger + on RC compare. */ + tc_trigger_on_freq( TC0, tmrTC0_CHANNEL_1, tmrTIMER_1_FREQUENCY ); + TC0->TC_CHANNEL[ tmrTC0_CHANNEL_1 ].TC_IER = TC_IER_CPCS; + + /* Configure TC1 channel 0 tmrTIMER_2_FREQUENCY frequency and trigger on + RC compare. */ + tc_trigger_on_freq( TC1, tmrTC0_CHANNEL_0, tmrTIMER_2_FREQUENCY ); + TC1->TC_CHANNEL[ tmrTC0_CHANNEL_0 ].TC_IER = TC_IER_CPCS; + + /* Enable interrupts and start the timers. */ + aic_configure( ID_TC0, tmrLOWER_PRIORITY ); + aic_set_source_vector( ID_TC0, prvTC0_Handler ); + aic_configure( ID_TC1, tmrHIGHER_PRIORITY ); + aic_set_source_vector( ID_TC1, prvTC1_Handler ); + aic_enable( ID_TC0 ); + aic_enable( ID_TC1 ); + tc_start( TC0, tmrTC0_CHANNEL_0 ); + tc_start( TC0, tmrTC0_CHANNEL_1 ); + tc_start( TC1, tmrTC1_CHANNEL_0 ); +} +/*-----------------------------------------------------------*/ + +static void prvTC0_Handler( void ) +{ + /* Read will clear the status bit. */ + if( ( TC0->TC_CHANNEL[ tmrTC0_CHANNEL_0 ].TC_SR & tmrRC_COMPARE ) != 0 ) + { + portYIELD_FROM_ISR( xFirstTimerHandler() ); + } + + if( ( TC0->TC_CHANNEL[ tmrTC0_CHANNEL_1 ].TC_SR & tmrRC_COMPARE ) != 0 ) + { + portYIELD_FROM_ISR( xSecondTimerHandler() ); + } +} +/*-----------------------------------------------------------*/ + +static void prvTC1_Handler( void ) +{ +volatile uint32_t ulDummy; + + /* Dummy read to clear status bit. */ + ulDummy = TC1->TC_CHANNEL[ tmrTC1_CHANNEL_0 ].TC_SR; + + /* Latch the maximum nesting count. */ + if( ulPortInterruptNesting > ulMaxRecordedNesting ) + { + ulMaxRecordedNesting = ulPortInterruptNesting; + } + + /* Keep a count of the number of interrupts to use as a time base for the + run-time stats. */ + ulHighFrequencyTimerCounts++; +} + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.h new file mode 100644 index 000000000..30c61462b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/IntQueueTimer.h @@ -0,0 +1,78 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +#ifndef INT_QUEUE_TIMER_H +#define INT_QUEUE_TIMER_H + +void vInitialiseTimerForIntQueueTest( void ); +BaseType_t xTimer0Handler( void ); +BaseType_t xTimer1Handler( void ); + +#endif + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/main_full.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/main_full.c new file mode 100644 index 000000000..2bf333ff7 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/main_full.c @@ -0,0 +1,517 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +/****************************************************************************** + * NOTE 1: This project provides two demo applications. A simple blinky style + * project, and a more comprehensive test and demo application. The + * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select + * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY + * in main.c. This file implements the comprehensive test and demo version. + * + * NOTE 2: This file only contains the source code that is specific to the + * full demo. Generic functions, such FreeRTOS hook functions, and functions + * required to configure the hardware, are defined in main.c. + * + ****************************************************************************** + * + * main_full() creates all the demo application tasks and software timers, then + * starts the scheduler. The web documentation provides more details of the + * standard demo application tasks, which provide no particular functionality, + * but do provide a good example of how to use the FreeRTOS API. + * + * In addition to the standard demo tasks, the following tasks and tests are + * defined and/or created within this file: + * + * "Reg test" tasks - These fill both the core and floating point registers with + * known values, then check that each register maintains its expected value for + * the lifetime of the task. Each task uses a different set of values. The reg + * test tasks execute with a very low priority, so get preempted very + * frequently. A register containing an unexpected value is indicative of an + * error in the context switching mechanism. + * + * "Check" task - The check task period is initially set to three seconds. The + * task checks that all the standard demo tasks, and the register check tasks, + * are not only still executing, but are executing without reporting any errors. + * If the check task discovers that a task has either stalled, or reported an + * error, then it changes its own execution period from the initial three + * seconds, to just 200ms. The check task also toggles an LED each time it is + * called. This provides a visual indication of the system status: If the LED + * toggles every three seconds, then no issues have been discovered. If the LED + * toggles every 200ms, then an issue has been discovered with at least one + * task. The LED used is defined in mainCHECK_LED, below. + * + * NOTE on LEDS: + * + * This demo is NOT configured to use the LED built onto the SAMA6D2 + * XPLained board! + * + * The LED driver PIN_LED definitions have been altered in + * board_sama5d2-xplained.h to remap them to GPIOs terminating on pins 30, + * 32 and 34 of J17. (This change is conditional on the preprocessor + * #define "LEDS_ON_J17".) These GPIOs are configured to be "high drive" + * push-pull outputs; they can source up to 18mA at 1.8v. Low + * forward-voltage LEDs may be connected via 100 ohm resistors to pins + * 30, 32 and 34 with their cathodes to pin 35/36 (GND). + */ + +/* Standard includes. */ +#include + +/* Kernel includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "timers.h" +#include "semphr.h" + +/* Standard demo application includes. */ +#include "flop.h" +#include "semtest.h" +#include "dynamic.h" +#include "BlockQ.h" +#include "blocktim.h" +#include "countsem.h" +#include "GenQTest.h" +#include "recmutex.h" +#include "death.h" +#include "partest.h" +#include "comtest2.h" +#include "serial.h" +#include "TimerDemo.h" +#include "QueueOverwrite.h" +#include "IntQueue.h" +#include "EventGroupsDemo.h" +#include "flash.h" + +/* Priorities for the demo application tasks. */ +#define mainLED_FLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1UL ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1UL ) +#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2UL ) +#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3UL ) +#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY ) +#define mainCDC_COMMAND_CONSOLE_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2UL ) +#define mainCOM_TEST_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define mainQUEUE_OVERWRITE_PRIORITY ( tskIDLE_PRIORITY ) + +/* The initial priority used by the UART command console task. */ +#define mainUART_COMMAND_CONSOLE_TASK_PRIORITY ( configMAX_PRIORITIES - 2 ) + +/* The LED used by the check task. */ +#define mainCHECK_LED ( 2 ) + +/* A block time of zero simply means "don't block". */ +#define mainDONT_BLOCK ( 0UL ) + +/* The period of the check task, in ms, provided no errors have been reported by +any of the standard demo tasks. ms are converted to the equivalent in ticks +using the pdMS_TO_TICKS() macro constant. */ +#define mainNO_ERROR_CHECK_TASK_PERIOD pdMS_TO_TICKS( 3000UL ) + +/* The period of the check task, in ms, if an error has been reported in one of +the standard demo tasks. ms are converted to the equivalent in ticks using the +pdMS_TO_TICKS() macro. */ +#define mainERROR_CHECK_TASK_PERIOD pdMS_TO_TICKS( 200UL ) + +/* Parameters that are passed into the register check tasks solely for the +purpose of ensuring parameters are passed into tasks correctly. */ +#define mainREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x12345678 ) +#define mainREG_TEST_TASK_2_PARAMETER ( ( void * ) 0x87654321 ) + +/* The base period used by the timer test tasks. */ +#define mainTIMER_TEST_PERIOD ( 50 ) + +/*-----------------------------------------------------------*/ + +/* + * Called by main() to run the full demo (as opposed to the blinky demo) when + * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. + */ +void main_full( void ); + +/* + * The check task, as described at the top of this file. + */ +static void prvCheckTask( void *pvParameters ); + +/* + * Register check tasks, and the tasks used to write over and check the contents + * of the FPU registers, as described at the top of this file. The nature of + * these files necessitates that they are written in an assembly file, but the + * entry points are kept in the C file for the convenience of checking the task + * parameter. + */ +static void prvRegTestTaskEntry1( void *pvParameters ); +extern void vRegTest1Implementation( void ); +static void prvRegTestTaskEntry2( void *pvParameters ); +extern void vRegTest2Implementation( void ); + +/* + * A high priority task that does nothing other than execute at a pseudo random + * time to ensure the other test tasks don't just execute in a repeating + * pattern. + */ +static void prvPseudoRandomiser( void *pvParameters ); + +/*-----------------------------------------------------------*/ + +/* The following two variables are used to communicate the status of the +register check tasks to the check task. If the variables keep incrementing, +then the register check tasks have not discovered any errors. If a variable +stops incrementing, then an error has been found. */ +volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL; + +/*-----------------------------------------------------------*/ + +void main_full( void ) +{ + /* Start all the other standard demo/test tasks. They have no particular + functionality, but do demonstrate how to use the FreeRTOS API and test the + kernel port. */ + vStartInterruptQueueTasks(); + vStartDynamicPriorityTasks(); + vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); + vCreateBlockTimeTasks(); + vStartCountingSemaphoreTasks(); + vStartGenericQueueTasks( tskIDLE_PRIORITY ); + vStartRecursiveMutexTasks(); + vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); + vStartMathTasks( mainFLOP_TASK_PRIORITY ); + vStartTimerDemoTask( mainTIMER_TEST_PERIOD ); + vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY ); + vStartEventGroupTasks(); + + /* Create the register check tasks, as described at the top of this file */ + xTaskCreate( prvRegTestTaskEntry1, "Reg1", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_1_PARAMETER, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvRegTestTaskEntry2, "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL ); + + /* Create the task that just adds a little random behaviour. */ + xTaskCreate( prvPseudoRandomiser, "Rnd", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL ); + + /* Create the task that performs the 'check' functionality, as described at + the top of this file. */ + xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* The set of tasks created by the following function call have to be + created last as they keep account of the number of tasks they expect to see + running. */ + vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY ); + + /* Start the scheduler. */ + vTaskStartScheduler(); + + /* If all is well, the scheduler will now be running, and the following + line will never be reached. If the following line does execute, then + there was either insufficient FreeRTOS heap memory available for the idle + and/or timer tasks to be created, or vTaskStartScheduler() was called from + User mode. See the memory management section on the FreeRTOS web site for + more details on the FreeRTOS heap http://www.freertos.org/a00111.html. The + mode from which main() is called is set in the C start up code and must be + a privileged mode (not user mode). */ + for( ;; ); +} +/*-----------------------------------------------------------*/ + +static void prvCheckTask( void *pvParameters ) +{ +TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD; +TickType_t xLastExecutionTime; +static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0; +unsigned long ulErrorFound = pdFALSE; + + /* Just to stop compiler warnings. */ + ( void ) pvParameters; + + /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil() + works correctly. */ + xLastExecutionTime = xTaskGetTickCount(); + + /* Cycle for ever, delaying then checking all the other tasks are still + operating without error. The onboard LED is toggled on each iteration. + If an error is detected then the delay period is decreased from + mainNO_ERROR_CHECK_TASK_PERIOD to mainERROR_CHECK_TASK_PERIOD. This has the + effect of increasing the rate at which the onboard LED toggles, and in so + doing gives visual feedback of the system status. */ + for( ;; ) + { + /* Delay until it is time to execute again. */ + vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); + + /* Check all the demo tasks (other than the flash tasks) to ensure + that they are all still running, and that none have detected an error. */ + if( xAreIntQueueTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreMathsTaskStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if ( xAreGenericQueueTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xIsCreateTaskStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS ) + { + ulErrorFound = pdTRUE; + } + + if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) + { + ulErrorFound = pdTRUE; + } + + if( xIsQueueOverwriteTaskStillRunning() != pdPASS ) + { + ulErrorFound = pdTRUE; + } + + if( xAreEventGroupTasksStillRunning() != pdPASS ) + { + ulErrorFound = pdTRUE; + } + + /* Check that the register test 1 task is still running. */ + if( ulLastRegTest1Value == ulRegTest1LoopCounter ) + { + ulErrorFound = pdTRUE; + } + ulLastRegTest1Value = ulRegTest1LoopCounter; + + /* Check that the register test 2 task is still running. */ + if( ulLastRegTest2Value == ulRegTest2LoopCounter ) + { + ulErrorFound = pdTRUE; + } + ulLastRegTest2Value = ulRegTest2LoopCounter; + + /* Toggle the check LED to give an indication of the system status. If + the LED toggles every mainNO_ERROR_CHECK_TASK_PERIOD milliseconds then + everything is ok. A faster toggle indicates an error. */ + vParTestToggleLED( mainCHECK_LED ); + + if( ulErrorFound != pdFALSE ) + { + /* An error has been detected in one of the tasks - flash the LED + at a higher frequency to give visible feedback that something has + gone wrong (it might just be that the loop back connector required + by the comtest tasks has not been fitted). */ + xDelayPeriod = mainERROR_CHECK_TASK_PERIOD; + } + } +} +/*-----------------------------------------------------------*/ + +static void prvRegTestTaskEntry1( void *pvParameters ) +{ + /* Although the regtest task is written in assembler, its entry point is + written in C for convenience of checking the task parameter is being passed + in correctly. */ + if( pvParameters == mainREG_TEST_TASK_1_PARAMETER ) + { + /* The reg test task also tests the floating point registers. Tasks + that use the floating point unit must call vPortTaskUsesFPU() before + any floating point instructions are executed. */ + vPortTaskUsesFPU(); + + /* Start the part of the test that is written in assembler. */ + vRegTest1Implementation(); + } + + /* The following line will only execute if the task parameter is found to + be incorrect. The check task will detect that the regtest loop counter is + not being incremented and flag an error. */ + vTaskDelete( NULL ); +} +/*-----------------------------------------------------------*/ + +static void prvRegTestTaskEntry2( void *pvParameters ) +{ + /* Although the regtest task is written in assembler, its entry point is + written in C for convenience of checking the task parameter is being passed + in correctly. */ + if( pvParameters == mainREG_TEST_TASK_2_PARAMETER ) + { + /* The reg test task also tests the floating point registers. Tasks + that use the floating point unit must call vPortTaskUsesFPU() before + any floating point instructions are executed. */ + vPortTaskUsesFPU(); + + /* Start the part of the test that is written in assembler. */ + vRegTest2Implementation(); + } + + /* The following line will only execute if the task parameter is found to + be incorrect. The check task will detect that the regtest loop counter is + not being incremented and flag an error. */ + vTaskDelete( NULL ); +} +/*-----------------------------------------------------------*/ + +static void prvPseudoRandomiser( void *pvParameters ) +{ +const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL, ulMinDelay = ( 35 / portTICK_PERIOD_MS ), ulIBit = ( 1UL << 7UL ); +volatile uint32_t ulNextRand = ( uint32_t ) &pvParameters, ulValue; + + /* A few minor port tests before entering the randomiser loop. + + At this point interrupts should be enabled. */ + configASSERT( ( __get_CPSR() & ulIBit ) == 0 ); + + /* The CPU does not have an interrupt mask register, so critical sections + have to globally disable interrupts. Therefore entering a critical section + should leave the I bit set. */ + taskENTER_CRITICAL(); + configASSERT( ( __get_CPSR() & ulIBit ) == ulIBit ); + + /* Nest the critical sections. */ + taskENTER_CRITICAL(); + configASSERT( ( __get_CPSR() & ulIBit ) == ulIBit ); + + /* After yielding the I bit should still be set. Note yielding is possible + in a critical section as each task maintains its own critical section + nesting count so some tasks are in critical sections and others are not - + however this is *not* something task code should do! */ + taskYIELD(); + configASSERT( ( __get_CPSR() & ulIBit ) == ulIBit ); + + /* The I bit should not be cleared again until both critical sections have + been exited. */ + taskEXIT_CRITICAL(); + taskYIELD(); + configASSERT( ( __get_CPSR() & ulIBit ) == ulIBit ); + taskEXIT_CRITICAL(); + configASSERT( ( __get_CPSR() & ulIBit ) == 0 ); + taskYIELD(); + configASSERT( ( __get_CPSR() & ulIBit ) == 0 ); + + /* This task does nothing other than ensure there is a little bit of + disruption in the scheduling pattern of the other tasks. Normally this is + done by generating interrupts at pseudo random times. */ + for( ;; ) + { + ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement; + ulValue = ( ulNextRand >> 16UL ) & 0xffUL; + + if( ulValue < ulMinDelay ) + { + ulValue = ulMinDelay; + } + + vTaskDelay( ulValue ); + + while( ulValue > 0 ) + { + __asm volatile( "NOP" ); + __asm volatile( "NOP" ); + __asm volatile( "NOP" ); + __asm volatile( "NOP" ); + + ulValue--; + } + } +} + + + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/reg_test.S b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/reg_test.S new file mode 100644 index 000000000..272d81a25 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/Full_Demo/reg_test.S @@ -0,0 +1,468 @@ +;/* +; FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. +; +; FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT +; http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. +; +; *************************************************************************** +; * * +; * FreeRTOS tutorial books are available in pdf and paperback. * +; * Complete, revised, and edited pdf reference manuals are also * +; * available. * +; * * +; * Purchasing FreeRTOS documentation will not only help you, by * +; * ensuring you get running as quickly as possible and with an * +; * in-depth knowledge of how to use FreeRTOS, it will also help * +; * the FreeRTOS project to continue with its mission of providing * +; * professional grade, cross platform, de facto standard solutions * +; * for microcontrollers - completely free of charge! * +; * * +; * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * +; * * +; * Thank you for using FreeRTOS, and thank you for your support! * +; * * +; *************************************************************************** +; +; +; This file is part of the FreeRTOS distribution. +; +; FreeRTOS is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License (version 2) as published by the +; Free Software Foundation AND MODIFIED BY the FreeRTOS exception. +; +; >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to +; distribute a combined work that includes FreeRTOS without being obliged to +; provide the source code for proprietary components outside of the FreeRTOS +; kernel. +; +; FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +; details. You should have received a copy of the GNU General Public License +; and the FreeRTOS license exception along with FreeRTOS; if not itcan be +; viewed here: http://www.freertos.org/a00114.html and also obtained by +; writing to Real Time Engineers Ltd., contact details for whom are available +; on the FreeRTOS WEB site. +; +; 1 tab == 4 spaces! +; +; *************************************************************************** +; * * +; * Having a problem? Start by reading the FAQ "My application does * +; * not run, what could be wrong?" * +; * * +; * http://www.FreeRTOS.org/FAQHelp.html * +; * * +; *************************************************************************** +; +; +; http://www.FreeRTOS.org - Documentation, books, training, latest versions, +; license and Real Time Engineers Ltd. contact details. +; +; http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, +; including FreeRTOS+Trace - an indispensable productivity tool, and our new +; fully thread aware and reentrant UDP/IP stack. +; +; http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High +; Integrity Systems, who sell the code with commercial support, +; indemnification and middleware, under the OpenRTOS brand. +; +; http://www.SafeRTOS.com - High Integrity Systems also provide a safety +; engineered and independently SIL3 certified version for use in safety and +; mission critical applications that require provable dependability. +;*/ + + EXPORT vRegTest1Implementation + EXPORT vRegTest2Implementation + + ; This file is built with IAR and ARM compilers. When the ARM compiler + ; is used the compiler options must define __IASMARM__ as 0 using the + ; --predefine "__IASMARM__ SETA 0" command line option. When compiling + ; with IAR __IASMARM__ is automatically set to 1 so no additional assembler + ; options are required. + SECTION .text:CODE:ROOT(2) + ARM + + ; This function is explained in the comments at the top of main-full.c. +vRegTest1Implementation + + PRESERVE8 + IMPORT ulRegTest1LoopCounter + + ; Fill each general purpose register with a known value. + mov r0, #0xFF + mov r1, #0x11 + mov r2, #0x22 + mov r3, #0x33 + mov r4, #0x44 + mov r5, #0x55 + mov r6, #0x66 + mov r7, #0x77 + mov r8, #0x88 + mov r9, #0x99 + mov r10, #0xAA + mov r11, #0xBB + mov r12, #0xCC + mov r14, #0xEE + + ; Fill each FPU register with a known value. + vmov d0, r0, r1 + vmov d1, r2, r3 + vmov d2, r4, r5 + vmov d3, r6, r7 + vmov d4, r8, r9 + vmov d5, r10, r11 + vmov d6, r0, r1 + vmov d7, r2, r3 + vmov d8, r4, r5 + vmov d9, r6, r7 + vmov d10, r8, r9 + vmov d11, r10, r11 + vmov d12, r0, r1 + vmov d13, r2, r3 + vmov d14, r4, r5 + vmov d15, r6, r7 + + ; Loop, checking each iteration that each register still contains the + ; expected value. +reg1_loop + ; Yield to increase test coverage + svc 0 + + ; Check all the VFP registers still contain the values set above. + ; First save registers that are clobbered by the test. + push { r0-r1 } + + vmov r0, r1, d0 + cmp r0, #0xFF + bne reg1_error_loopf + cmp r1, #0x11 + bne reg1_error_loopf + vmov r0, r1, d1 + cmp r0, #0x22 + bne reg1_error_loopf + cmp r1, #0x33 + bne reg1_error_loopf + vmov r0, r1, d2 + cmp r0, #0x44 + bne reg1_error_loopf + cmp r1, #0x55 + bne reg1_error_loopf + vmov r0, r1, d3 + cmp r0, #0x66 + bne reg1_error_loopf + cmp r1, #0x77 + bne reg1_error_loopf + vmov r0, r1, d4 + cmp r0, #0x88 + bne reg1_error_loopf + cmp r1, #0x99 + bne reg1_error_loopf + vmov r0, r1, d5 + cmp r0, #0xAA + bne reg1_error_loopf + cmp r1, #0xBB + bne reg1_error_loopf + vmov r0, r1, d6 + cmp r0, #0xFF + bne reg1_error_loopf + cmp r1, #0x11 + bne reg1_error_loopf + vmov r0, r1, d7 + cmp r0, #0x22 + bne reg1_error_loopf + cmp r1, #0x33 + bne reg1_error_loopf + vmov r0, r1, d8 + cmp r0, #0x44 + bne reg1_error_loopf + cmp r1, #0x55 + bne reg1_error_loopf + vmov r0, r1, d9 + cmp r0, #0x66 + bne reg1_error_loopf + cmp r1, #0x77 + bne reg1_error_loopf + vmov r0, r1, d10 + cmp r0, #0x88 + bne reg1_error_loopf + cmp r1, #0x99 + bne reg1_error_loopf + vmov r0, r1, d11 + cmp r0, #0xAA + bne reg1_error_loopf + cmp r1, #0xBB + bne reg1_error_loopf + vmov r0, r1, d12 + cmp r0, #0xFF + bne reg1_error_loopf + cmp r1, #0x11 + bne reg1_error_loopf + vmov r0, r1, d13 + cmp r0, #0x22 + bne reg1_error_loopf + cmp r1, #0x33 + bne reg1_error_loopf + vmov r0, r1, d14 + cmp r0, #0x44 + bne reg1_error_loopf + cmp r1, #0x55 + bne reg1_error_loopf + vmov r0, r1, d15 + cmp r0, #0x66 + bne reg1_error_loopf + cmp r1, #0x77 + bne reg1_error_loopf + + ; Restore the registers that were clobbered by the test. + pop {r0-r1} + + ; VFP register test passed. Jump to the core register test. + b reg1_loopf_pass + +reg1_error_loopf + ; If this line is hit then a VFP register value was found to be + ; incorrect. + b reg1_error_loopf + +reg1_loopf_pass + + ; Test each general purpose register to check that it still contains the + ; expected known value, jumping to reg1_error_loop if any register contains + ; an unexpected value. + cmp r0, #0xFF + bne reg1_error_loop + cmp r1, #0x11 + bne reg1_error_loop + cmp r2, #0x22 + bne reg1_error_loop + cmp r3, #0x33 + bne reg1_error_loop + cmp r4, #0x44 + bne reg1_error_loop + cmp r5, #0x55 + bne reg1_error_loop + cmp r6, #0x66 + bne reg1_error_loop + cmp r7, #0x77 + bne reg1_error_loop + cmp r8, #0x88 + bne reg1_error_loop + cmp r9, #0x99 + bne reg1_error_loop + cmp r10, #0xAA + bne reg1_error_loop + cmp r11, #0xBB + bne reg1_error_loop + cmp r12, #0xCC + bne reg1_error_loop + cmp r14, #0xEE + bne reg1_error_loop + + ; Everything passed, increment the loop counter. + push { r0-r1 } + ldr r0, =ulRegTest1LoopCounter + ldr r1, [r0] + adds r1, r1, #1 + str r1, [r0] + pop { r0-r1 } + + ; Start again. + b reg1_loop + +reg1_error_loop + ; If this line is hit then there was an error in a core register value. + ; The loop ensures the loop counter stops incrementing. + b reg1_error_loop + nop + +;/*-----------------------------------------------------------*/ + +vRegTest2Implementation + + PRESERVE8 + IMPORT ulRegTest2LoopCounter + + ; Put a known value in each register. + mov r0, #0xFF000000 + mov r1, #0x11000000 + mov r2, #0x22000000 + mov r3, #0x33000000 + mov r4, #0x44000000 + mov r5, #0x55000000 + mov r6, #0x66000000 + mov r7, #0x77000000 + mov r8, #0x88000000 + mov r9, #0x99000000 + mov r10, #0xAA000000 + mov r11, #0xBB000000 + mov r12, #0xCC000000 + mov r14, #0xEE000000 + + ; Likewise the floating point registers + vmov d0, r0, r1 + vmov d1, r2, r3 + vmov d2, r4, r5 + vmov d3, r6, r7 + vmov d4, r8, r9 + vmov d5, r10, r11 + vmov d6, r0, r1 + vmov d7, r2, r3 + vmov d8, r4, r5 + vmov d9, r6, r7 + vmov d10, r8, r9 + vmov d11, r10, r11 + vmov d12, r0, r1 + vmov d13, r2, r3 + vmov d14, r4, r5 + vmov d15, r6, r7 + + ; Loop, checking each iteration that each register still contains the + ; expected value. +reg2_loop + ; Check all the VFP registers still contain the values set above. + ; First save registers that are clobbered by the test. + push { r0-r1 } + + vmov r0, r1, d0 + cmp r0, #0xFF000000 + bne reg2_error_loopf + cmp r1, #0x11000000 + bne reg2_error_loopf + vmov r0, r1, d1 + cmp r0, #0x22000000 + bne reg2_error_loopf + cmp r1, #0x33000000 + bne reg2_error_loopf + vmov r0, r1, d2 + cmp r0, #0x44000000 + bne reg2_error_loopf + cmp r1, #0x55000000 + bne reg2_error_loopf + vmov r0, r1, d3 + cmp r0, #0x66000000 + bne reg2_error_loopf + cmp r1, #0x77000000 + bne reg2_error_loopf + vmov r0, r1, d4 + cmp r0, #0x88000000 + bne reg2_error_loopf + cmp r1, #0x99000000 + bne reg2_error_loopf + vmov r0, r1, d5 + cmp r0, #0xAA000000 + bne reg2_error_loopf + cmp r1, #0xBB000000 + bne reg2_error_loopf + vmov r0, r1, d6 + cmp r0, #0xFF000000 + bne reg2_error_loopf + cmp r1, #0x11000000 + bne reg2_error_loopf + vmov r0, r1, d7 + cmp r0, #0x22000000 + bne reg2_error_loopf + cmp r1, #0x33000000 + bne reg2_error_loopf + vmov r0, r1, d8 + cmp r0, #0x44000000 + bne reg2_error_loopf + cmp r1, #0x55000000 + bne reg2_error_loopf + vmov r0, r1, d9 + cmp r0, #0x66000000 + bne reg2_error_loopf + cmp r1, #0x77000000 + bne reg2_error_loopf + vmov r0, r1, d10 + cmp r0, #0x88000000 + bne reg2_error_loopf + cmp r1, #0x99000000 + bne reg2_error_loopf + vmov r0, r1, d11 + cmp r0, #0xAA000000 + bne reg2_error_loopf + cmp r1, #0xBB000000 + bne reg2_error_loopf + vmov r0, r1, d12 + cmp r0, #0xFF000000 + bne reg2_error_loopf + cmp r1, #0x11000000 + bne reg2_error_loopf + vmov r0, r1, d13 + cmp r0, #0x22000000 + bne reg2_error_loopf + cmp r1, #0x33000000 + bne reg2_error_loopf + vmov r0, r1, d14 + cmp r0, #0x44000000 + bne reg2_error_loopf + cmp r1, #0x55000000 + bne reg2_error_loopf + vmov r0, r1, d15 + cmp r0, #0x66000000 + bne reg2_error_loopf + cmp r1, #0x77000000 + bne reg2_error_loopf + + ; Restore the registers that were clobbered by the test. + pop {r0-r1} + + ; VFP register test passed. Jump to the core register test. + b reg2_loopf_pass + +reg2_error_loopf + ; If this line is hit then a VFP register value was found to be + ; incorrect. + b reg2_error_loopf + +reg2_loopf_pass + + cmp r0, #0xFF000000 + bne reg2_error_loop + cmp r1, #0x11000000 + bne reg2_error_loop + cmp r2, #0x22000000 + bne reg2_error_loop + cmp r3, #0x33000000 + bne reg2_error_loop + cmp r4, #0x44000000 + bne reg2_error_loop + cmp r5, #0x55000000 + bne reg2_error_loop + cmp r6, #0x66000000 + bne reg2_error_loop + cmp r7, #0x77000000 + bne reg2_error_loop + cmp r8, #0x88000000 + bne reg2_error_loop + cmp r9, #0x99000000 + bne reg2_error_loop + cmp r10, #0xAA000000 + bne reg2_error_loop + cmp r11, #0xBB000000 + bne reg2_error_loop + cmp r12, #0xCC000000 + bne reg2_error_loop + cmp r14, #0xEE000000 + bne reg2_error_loop + + ; Everything passed, increment the loop counter. + push { r0-r1 } + ldr r0, =ulRegTest2LoopCounter + ldr r1, [r0] + adds r1, r1, #1 + str r1, [r0] + pop { r0-r1 } + + ; Start again. + b reg2_loop + +reg2_error_loop + ; If this line is hit then there was an error in a core register value. + ; The loop ensures the loop counter stops incrementing. + b reg2_error_loop + nop + + + END diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/LEDs.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/LEDs.c new file mode 100644 index 000000000..ef77c2758 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/LEDs.c @@ -0,0 +1,117 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +/*----------------------------------------------------------- + * Simple IO routines to control the LEDs. + * This file is called ParTest.c for historic reasons. Originally it stood for + * PARallel port TEST. + *-----------------------------------------------------------*/ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Demo includes. */ +#include "partest.h" + +/* Library includes. */ +#include "misc/led.h" +#include "peripherals/pio.h" +#include "board.h" + +/*-----------------------------------------------------------*/ + +void vParTestInitialise( void ) +{ + led_configure( 0 ); + led_configure( 1 ); + led_configure( 2 ); +} +/*-----------------------------------------------------------*/ + +void vParTestSetLED( UBaseType_t uxLED, BaseType_t xValue ) +{ + if( xValue == pdTRUE ) + { + led_set( uxLED ); + } + else + { + led_clear( uxLED ); + } +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ + led_toggle( uxLED ); +} + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewd b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewd new file mode 100644 index 000000000..8e0ec6e40 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewd @@ -0,0 +1,1585 @@ + + + + 2 + + sram + + ARM + + 1 + + C-SPY + 2 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_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 + + 5 + 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 + 1 + + + $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/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewp new file mode 100644 index 000000000..f1fbf31ea --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.ewp @@ -0,0 +1,1505 @@ + + + + 2 + + sram + + ARM + + 1 + + General + 3 + + 24 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Atmel Files + + drivers + + cortex-a + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cortexa5_interrupts.c + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cortexa5_interrupts.h + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cp15.c + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cp15.h + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cp15_asm_iar.s + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cp15_pmu.c + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cp15_pmu.h + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cpsr.h + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\cpsr_iar.s + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\Makefile.inc + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\mmu.c + + + $PROJ_DIR$\AtmelFiles\drivers\cortex-a\mmu.h + + + + misc + + $PROJ_DIR$\AtmelFiles\drivers\misc\led.c + + + $PROJ_DIR$\AtmelFiles\drivers\misc\led.h + + + + peripherals + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\aic.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\aic.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\flexcom.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\flexcom.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\l2cc.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\l2cc.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\matrix.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\matrix.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pio.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pio4.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pio4.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pit.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pit.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pmc.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\pmc.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\tc.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\tc.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\twi.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\twid.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\wdt.c + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\wdt.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\xdmac.h + + + $PROJ_DIR$\AtmelFiles\drivers\peripherals\xdmad.h + + + + power + + $PROJ_DIR$\AtmelFiles\drivers\power\act8945a.h + + + + + target + + component + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_acc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_adc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_aes.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_aesb.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_aic.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_aximx.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_chipid.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_classd.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_flexcom.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_gmac.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_i2sc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_icm.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_isc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_l2cc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_lcdc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_matrix.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_mcan.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_mpddrc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_pdmic.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_pio.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_pit.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_pmc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_pwm.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_qspi.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_rstc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_rtc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_rxlp.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_sckc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_sdmmc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_sfc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_sfr.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_sfrbu.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_sha.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_shdwc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_smc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_spi.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_ssc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_tc.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_tdes.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_trng.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_twihs.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_uart.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_udphs.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_wdt.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\component\component_xdmac.h + + + + pio + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d21.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d22.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d23.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d24.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d26.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d27.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\pio\pio_sama5d28.h + + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_lowlevel.c + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_lowlevel.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_memories.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_sama5d2-ptc-engi.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_sama5d2-vb-bga196.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_sama5d2-vb-bga289.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_sama5d2-xplained-proto.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\board_sama5d2-xplained.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\chip.c + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\chip.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\chip_pins.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d21.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d22.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d23.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d24.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d26.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d27.h + + + $PROJ_DIR$\AtmelFiles\target\sama5d2\sama5d28.h + + + + utils + + $PROJ_DIR$\AtmelFiles\utils\async.h + + + $PROJ_DIR$\AtmelFiles\utils\compiler.h + + + $PROJ_DIR$\AtmelFiles\utils\crc.h + + + $PROJ_DIR$\AtmelFiles\utils\dbg_util.h + + + $PROJ_DIR$\AtmelFiles\utils\font.h + + + $PROJ_DIR$\AtmelFiles\utils\hamming.h + + + $PROJ_DIR$\AtmelFiles\utils\intmath.h + + + $PROJ_DIR$\AtmelFiles\utils\io.h + + + $PROJ_DIR$\AtmelFiles\utils\lcd_color.h + + + $PROJ_DIR$\AtmelFiles\utils\lcd_draw.h + + + $PROJ_DIR$\AtmelFiles\utils\lcd_font.h + + + $PROJ_DIR$\AtmelFiles\utils\mutex.h + + + $PROJ_DIR$\AtmelFiles\utils\rand.h + + + $PROJ_DIR$\AtmelFiles\utils\ring.h + + + $PROJ_DIR$\AtmelFiles\utils\timer.h + + + $PROJ_DIR$\AtmelFiles\utils\trace.h + + + $PROJ_DIR$\AtmelFiles\utils\wav.h + + + + + Blinky Demo + + $PROJ_DIR$\blinky_demo\main_blinky.c + + + + FreeRTOS Source + + portable + + MemMang + + $PROJ_DIR$\..\..\Source\portable\MemMang\heap_4.c + + + + $PROJ_DIR$\..\..\Source\portable\IAR\ARM_CA5_No_GIC\port.c + + + $PROJ_DIR$\..\..\Source\portable\IAR\ARM_CA5_No_GIC\portASM.h + + + $PROJ_DIR$\..\..\Source\portable\IAR\ARM_CA5_No_GIC\portASM.s + + + $PROJ_DIR$\..\..\Source\portable\IAR\ARM_CA5_No_GIC\portmacro.h + + + + $PROJ_DIR$\..\..\Source\event_groups.c + + + $PROJ_DIR$\..\..\Source\list.c + + + $PROJ_DIR$\..\..\Source\queue.c + + + $PROJ_DIR$\..\..\Source\tasks.c + + + $PROJ_DIR$\..\..\Source\timers.c + + + + Full Demo + + Common Demo Tasks + + $PROJ_DIR$\..\Common\Minimal\BlockQ.c + + + $PROJ_DIR$\..\Common\Minimal\blocktim.c + + + $PROJ_DIR$\..\Common\Minimal\countsem.c + + + $PROJ_DIR$\..\Common\Minimal\death.c + + + $PROJ_DIR$\..\Common\Minimal\dynamic.c + + + $PROJ_DIR$\..\Common\Minimal\EventGroupsDemo.c + + + $PROJ_DIR$\..\Common\Minimal\flop.c + + + $PROJ_DIR$\..\Common\Minimal\GenQTest.c + + + $PROJ_DIR$\..\Common\Minimal\IntQueue.c + + + $PROJ_DIR$\..\Common\Minimal\QueueOverwrite.c + + + $PROJ_DIR$\..\Common\Minimal\recmutex.c + + + $PROJ_DIR$\..\Common\Minimal\semtest.c + + + $PROJ_DIR$\..\Common\Minimal\TimerDemo.c + + + + $PROJ_DIR$\Full_Demo\IntQueueTimer.c + + + $PROJ_DIR$\Full_Demo\main_full.c + + + $PROJ_DIR$\Full_Demo\reg_test.S + + + + $PROJ_DIR$\cstartup_with_FreeRTOS_vectors.s + + + $PROJ_DIR$\FreeRTOS_tick_config.c + + + $PROJ_DIR$\FreeRTOSConfig.h + + + $PROJ_DIR$\LEDs.c + + + $PROJ_DIR$\main.c + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.eww b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.eww new file mode 100644 index 000000000..239a9381e --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/RTOSDemo.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\RTOSDemo.ewp + + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/blinky_demo/main_blinky.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/blinky_demo/main_blinky.c new file mode 100644 index 000000000..6f1de4009 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/blinky_demo/main_blinky.c @@ -0,0 +1,249 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +/****************************************************************************** + * NOTE 1: This project provides two demo applications. A simple blinky style + * project, and a more comprehensive test and demo application. The + * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select + * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY + * in main.c. This file implements the simply blinky style version. + * + * NOTE 2: This file only contains the source code that is specific to the + * basic demo. Generic functions, such FreeRTOS hook functions, and functions + * required to configure the hardware are defined in main.c. + ****************************************************************************** + * + * main_blinky() creates one queue, and two tasks. It then starts the + * scheduler. + * + * The Queue Send Task: + * The queue send task is implemented by the prvQueueSendTask() function in + * this file. prvQueueSendTask() sits in a loop that causes it to repeatedly + * block for 200 milliseconds, before sending the value 100 to the queue that + * was created within main_blinky(). Once the value is sent, the task loops + * back around to block for another 200 milliseconds...and so on. + * + * The Queue Receive Task: + * The queue receive task is implemented by the prvQueueReceiveTask() function + * in this file. prvQueueReceiveTask() sits in a loop where it repeatedly + * blocks on attempts to read data from the queue that was created within + * main_blinky(). When data is received, the task checks the value of the + * data, and if the value equals the expected 100, toggles an LED. The 'block + * time' parameter passed to the queue receive function specifies that the + * task should be held in the Blocked state indefinitely to wait for data to + * be available on the queue. The queue receive task will only leave the + * Blocked state when the queue send task writes to the queue. As the queue + * send task writes to the queue every 200 milliseconds, the queue receive + * task leaves the Blocked state every 200 milliseconds, and therefore toggles + * the LED every 200 milliseconds. + * + * NOTE on LEDS: + * + * This demo is NOT configured to use the LED built onto the SAMA6D2 + * XPLained board! + * + * The LED driver PIN_LED definitions have been altered in + * board_sama5d2-xplained.h to remap them to GPIOs terminating on pins 30, + * 32 and 34 of J17. (This change is conditional on the preprocessor + * #define "LEDS_ON_J17".) These GPIOs are configured to be "high drive" + * push-pull outputs; they can source up to 18mA at 1.8v. Low + * forward-voltage LEDs may be connected via 100 ohm resistors to pins + * 30, 32 and 34 with their cathodes to pin 35/36 (GND). + */ + +/* Kernel includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "semphr.h" + +/* Standard demo includes. */ +#include "partest.h" + +/* Priorities at which the tasks are created. */ +#define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) + +/* The rate at which data is sent to the queue. The 200ms value is converted +to ticks using the portTICK_PERIOD_MS constant. */ +#define mainQUEUE_SEND_FREQUENCY_MS ( 200 / portTICK_PERIOD_MS ) + +/* The number of items the queue can hold. This is 1 as the receive task +will remove items as they are added, meaning the send task should always find +the queue empty. */ +#define mainQUEUE_LENGTH ( 1 ) + +/* The LED toggled by the Rx task. */ +#define mainTASK_LED ( 2 ) + +/*-----------------------------------------------------------*/ + +/* + * Called by main when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1 in + * main.c. + */ +void main_blinky( void ); + +/* + * The tasks as described in the comments at the top of this file. + */ +static void prvQueueReceiveTask( void *pvParameters ); +static void prvQueueSendTask( void *pvParameters ); + +/*-----------------------------------------------------------*/ + +/* The queue used by both tasks. */ +static QueueHandle_t xQueue = NULL; + +/*-----------------------------------------------------------*/ + +void main_blinky( void ) +{ + /* Create the queue. */ + xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) ); + + if( xQueue != NULL ) + { + /* Start the two tasks as described in the comments at the top of this + file. */ + xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */ + "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ + configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */ + NULL, /* The parameter passed to the task - not used in this case. */ + mainQUEUE_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */ + NULL ); /* The task handle is not required, so NULL is passed. */ + + xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL ); + + /* Start the tasks and timer running. */ + vTaskStartScheduler(); + } + + /* If all is well, the scheduler will now be running, and the following + line will never be reached. If the following line does execute, then + there was either insufficient FreeRTOS heap memory available for the idle + and/or timer tasks to be created, or vTaskStartScheduler() was called from + User mode. See the memory management section on the FreeRTOS web site for + more details on the FreeRTOS heap http://www.freertos.org/a00111.html. The + mode from which main() is called is set in the C start up code and must be + a privileged mode (not user mode). */ + for( ;; ); +} +/*-----------------------------------------------------------*/ + +static void prvQueueSendTask( void *pvParameters ) +{ +TickType_t xNextWakeTime; +const unsigned long ulValueToSend = 100UL; + + /* Remove compiler warning about unused parameter. */ + ( void ) pvParameters; + + /* Initialise xNextWakeTime - this only needs to be done once. */ + xNextWakeTime = xTaskGetTickCount(); + + for( ;; ) + { + /* Place this task in the blocked state until it is time to run again. */ + vTaskDelayUntil( &xNextWakeTime, mainQUEUE_SEND_FREQUENCY_MS ); + + /* Send to the queue - causing the queue receive task to unblock and + toggle the LED. 0 is used as the block time so the sending operation + will not block - it shouldn't need to block as the queue should always + be empty at this point in the code. */ + xQueueSend( xQueue, &ulValueToSend, 0U ); + } +} +/*-----------------------------------------------------------*/ + +static void prvQueueReceiveTask( void *pvParameters ) +{ +unsigned long ulReceivedValue; +const unsigned long ulExpectedValue = 100UL; + + /* Remove compiler warning about unused parameter. */ + ( void ) pvParameters; + + for( ;; ) + { + /* Wait until something arrives in the queue - this task will block + indefinitely provided INCLUDE_vTaskSuspend is set to 1 in + FreeRTOSConfig.h. */ + xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY ); + + /* To get here something must have been received from the queue, but + is it the expected value? If it is, toggle the LED. */ + if( ulReceivedValue == ulExpectedValue ) + { + vParTestToggleLED( mainTASK_LED ); + ulReceivedValue = 0U; + } + } +} +/*-----------------------------------------------------------*/ + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/cstartup_with_FreeRTOS_vectors.s b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/cstartup_with_FreeRTOS_vectors.s new file mode 100644 index 000000000..2d1b17b4c --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/cstartup_with_FreeRTOS_vectors.s @@ -0,0 +1,159 @@ +/* ---------------------------------------------------------------------------- + * SAM Software Package License + * ---------------------------------------------------------------------------- + * Copyright (c) 2011, Atmel Corporation + * + * 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 disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. + * ---------------------------------------------------------------------------- + */ + +/* + IAR startup file for AT91SAMA5D3X microcontrollers. + */ + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION IRQ_STACK:DATA:NOROOT(2) + SECTION CSTACK:DATA:NOROOT(3) + +//------------------------------------------------------------------------------ +// Headers +//------------------------------------------------------------------------------ + +//#define __ASSEMBLY__ +//#include "board.h" + +//------------------------------------------------------------------------------ +// Definitions +//------------------------------------------------------------------------------ + +#define ARM_MODE_ABT 0x17 +#define ARM_MODE_FIQ 0x11 +#define ARM_MODE_IRQ 0x12 +#define ARM_MODE_SVC 0x13 +#define ARM_MODE_SYS 0x1F + +#define I_BIT 0x80 +#define F_BIT 0x40 + +//------------------------------------------------------------------------------ +// Startup routine +//------------------------------------------------------------------------------ + +/* + Exception vectors + */ + SECTION .vectors:CODE:NOROOT(2) + + PUBLIC resetVector + + EXTERN FreeRTOS_IRQ_Handler + EXTERN Undefined_Handler + EXTERN FreeRTOS_SWI_Handler + EXTERN Prefetch_Handler + EXTERN Abort_Handler + EXTERN FIQ_Handler + + ARM + +__iar_init$$done: ; The interrupt vector is not needed + ; until after copy initialization is done + +resetVector: + ; All default exception handlers (except reset) are + ; defined as weak symbol definitions. + ; If a handler is defined by the application it will take precedence. + LDR pc, =resetHandler ; Reset + LDR pc, Undefined_Addr ; Undefined instructions + LDR pc, SWI_Addr ; Software interrupt (SWI/SYS) + LDR pc, Prefetch_Addr ; Prefetch abort + LDR pc, Abort_Addr ; Data abort + B . ; RESERVED + LDR pc, IRQ_Addr ; IRQ + LDR pc, FIQ_Addr ; FIQ + +IRQ_Addr: DCD FreeRTOS_IRQ_Handler +Undefined_Addr: DCD Undefined_Handler +SWI_Addr: DCD FreeRTOS_SWI_Handler +Prefetch_Addr: DCD Prefetch_Handler +Abort_Addr: DCD Abort_Handler +FIQ_Addr: DCD FIQ_Handler + + +/* + After a reset, execution starts here, the mode is ARM, supervisor + with interrupts disabled. + Initializes the chip and branches to the main() function. + */ + SECTION .cstartup:CODE:NOROOT(2) + + PUBLIC resetHandler + EXTERN low_level_init + EXTERN ?main + REQUIRE resetVector + ARM + +resetHandler: + CPSIE A + /* Enable VFP */ + /* - Enable access to CP10 and CP11 in CP15.CACR */ + mrc p15, 0, r0, c1, c0, 2 + orr r0, r0, #0xf00000 + mcr p15, 0, r0, c1, c0, 2 + /* - Enable access to CP10 and CP11 in CP15.NSACR */ + /* - Set FPEXC.EN (B30) */ + fmrx r0, fpexc + orr r0, r0, #0x40000000 + fmxr fpexc, r0 + /* Set pc to actual code location (i.e. not in remap zone) */ + LDR pc, =label + + /* Perform low-level initialization of the chip using LowLevelInit() */ +label: + /* Sets up Supervisor stack before running LowLevelInit. The supervisor + stack is reused by interrupts, which switch from IRQ mode to SVC mode. */ + LDR r0, =low_level_init + LDR r4, =SFE(CSTACK) + MOV sp, r4 + BLX r0 + + /* Set up the interrupt stack pointer. */ + MSR cpsr_c, #ARM_MODE_IRQ | I_BIT | F_BIT ; Change the mode + LDR sp, =SFE(IRQ_STACK) + + /* No need to set up stacks for any other mode as that stack used by + tasks is allocated by FreeRTOS. */ + + /* Back to Supervisor mode bfore calling main(). The schduduler should + be started from Supervisor mode. */ + MSR cpsr_c, #ARM_MODE_SVC | F_BIT ; Change the mode + + /* Branch to main() */ + LDR r0, =?main + BLX r0 + + /* Loop indefinitely when program is finished */ +loop4: + B loop4 + END diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/main.c b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/main.c new file mode 100644 index 000000000..9767ae1b2 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/main.c @@ -0,0 +1,321 @@ +/* + FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +/****************************************************************************** + * This project provides two demo applications. A simple blinky style project, + * and a more comprehensive test and demo application. The + * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting (defined in this file) is used to + * select between the two. The simply blinky demo is implemented and described + * in main_blinky.c. The more comprehensive test and demo application is + * implemented and described in main_full.c. + * + * This file implements the code that is not demo specific, including the + * hardware setup, standard FreeRTOS hook functions, and the ISR hander called + * by the RTOS after interrupt entry (including nesting) has been taken care of. + * + * NOTE on LEDS: + * + * This demo is NOT configured to use the LED built onto the SAMA6D2 + * XPLained board! + * + * The LED driver PIN_LED definitions have been altered in + * board_sama5d2-xplained.h to remap them to GPIOs terminating on pins 30, + * 32 and 34 of J17. (This change is conditional on the preprocessor + * #define "LEDS_ON_J17".) These GPIOs are configured to be "high drive" + * push-pull outputs; they can source up to 18mA at 1.8v. Low + * forward-voltage LEDs may be connected via 100 ohm resistors to pins + * 30, 32 and 34 with their cathodes to pin 35/36 (GND). + * + */ + +/* + * Procedure to download and execute code from RAM + * ----------------------------------------------- + * + * 1. Close jumper JP9(BOOT_DIS) and JP2(DEBUG_DIS). + * 2. Open jumper JP1(EDBG_DIS). + * 3. Power on the board by USB connection on J14(EDBG_JTAG). + * 4. Open “EDBG Virtual COM Port” with setting “57600,8,N,1”. + * 5. Type “#” on HyperTerminal and get “>” as a reply. + * 6. Don’t reset the board during debugging. For IAR, set the Debugger to CMSIS + * DAP, with the "Disabled(no reset)" option. + */ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" +#include "semphr.h" + +/* Standard demo includes. */ +#include "partest.h" +#include "TimerDemo.h" +#include "QueueOverwrite.h" +#include "EventGroupsDemo.h" + +/* Library includes. */ +#include "board_sama5d2-xplained.h" +#include "peripherals/wdt.h" +#include "peripherals/pio.h" +#include "chip.h" + +/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo, +or 0 to run the more comprehensive test and demo application. */ +#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1 + +/*-----------------------------------------------------------*/ + +/* + * Configure the hardware as necessary to run this demo. + */ +static void prvSetupHardware( void ); + +/* + * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1. + * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. + */ +#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 + extern void main_blinky( void ); +#else + extern void main_full( void ); +#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */ + +/* Prototypes for the standard FreeRTOS callback/hook functions implemented +within this file. */ +void vApplicationMallocFailedHook( void ); +void vApplicationIdleHook( void ); +void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ); +void vApplicationTickHook( void ); + +/* Prototype for the IRQ handler called by the generic Cortex-A5 RTOS port +layer. */ +void vApplicationIRQHandler( void ); + +/*-----------------------------------------------------------*/ + +int main( void ) +{ + /* Configure the hardware ready to run the demo. */ + prvSetupHardware(); + + /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top + of this file. */ + #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 ) + { + main_blinky(); + } + #else + { + main_full(); + } + #endif + + return 0; +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + /* Disable watchdog */ + wdt_disable( ); + + /* Set protect mode in the AIC for easier debugging. */ + AIC->AIC_DCR |= AIC_DCR_PROT; + + /* Configure ports used by LEDs. */ + vParTestInitialise(); + + #if defined (ddram) + MMU_Initialize( ( uint32_t * ) 0x30C000 ); + CP15_EnableMMU(); + CP15_EnableDcache(); + CP15_EnableIcache(); + #endif +} +/*-----------------------------------------------------------*/ + +void vApplicationMallocFailedHook( void ) +{ + /* Called if a call to pvPortMalloc() fails because there is insufficient + free memory available in the FreeRTOS heap. pvPortMalloc() is called + internally by FreeRTOS API functions that create tasks, queues, software + timers, and semaphores. The size of the FreeRTOS heap is set by the + configTOTAL_HEAP_SIZE configuration constant in FreeRTOSConfig.h. */ + + /* Force an assert. */ + configASSERT( ( volatile void * ) NULL ); +} +/*-----------------------------------------------------------*/ + +void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) +{ + ( void ) pcTaskName; + ( void ) pxTask; + + /* Run time stack overflow checking is performed if + configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook + function is called if a stack overflow is detected. */ + + /* Force an assert. */ + configASSERT( ( volatile void * ) NULL ); +} +/*-----------------------------------------------------------*/ + +void vApplicationIdleHook( void ) +{ +volatile size_t xFreeHeapSpace; + + /* This is just a trivial example of an idle hook. It is called on each + cycle of the idle task. It must *NOT* attempt to block. In this case the + idle task just queries the amount of FreeRTOS heap that remains. See the + memory management section on the http://www.FreeRTOS.org web site for memory + management options. If there is a lot of heap memory free then the + configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up + RAM. */ + xFreeHeapSpace = xPortGetFreeHeapSize(); + + /* Remove compiler warning about xFreeHeapSpace being set but never used. */ + ( void ) xFreeHeapSpace; +} +/*-----------------------------------------------------------*/ + +void vAssertCalled( const char * pcFile, unsigned long ulLine ) +{ +volatile unsigned long ul = 0; + + ( void ) pcFile; + ( void ) ulLine; + + taskENTER_CRITICAL(); + { + /* Set ul to a non-zero value using the debugger to step out of this + function. */ + while( ul == 0 ) + { + portNOP(); + } + } + taskEXIT_CRITICAL(); +} +/*-----------------------------------------------------------*/ + +void vApplicationTickHook( void ) +{ + #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 + { + /* The full demo includes a software timer demo/test that requires + prodding periodically from the tick interrupt. */ + vTimerPeriodicISRTests(); + + /* Call the periodic queue overwrite from ISR demo. */ + vQueueOverwritePeriodicISRDemo(); + + /* Call the periodic event group from ISR demo. */ + vPeriodicEventGroupsProcessing(); + } + #endif +} +/*-----------------------------------------------------------*/ + +/* The function called by the RTOS port layer after it has managed interrupt +entry. */ +void vApplicationIRQHandler( void ) +{ +typedef void (*ISRFunction_t)( void ); +ISRFunction_t pxISRFunction; +volatile uint32_t * pulAIC_IVR = ( uint32_t * ) configINTERRUPT_VECTOR_ADDRESS; + + /* Obtain the address of the interrupt handler from the AIR. */ + pxISRFunction = ( ISRFunction_t ) *pulAIC_IVR; + + /* Write back to the SAMA5's interrupt controller's IVR register in case the + CPU is in protect mode. If the interrupt controller is not in protect mode + then this write is not necessary. */ + *pulAIC_IVR = ( uint32_t ) pxISRFunction; + + /* Ensure the write takes before re-enabling interrupts. */ + __DSB(); + __ISB(); + __enable_irq(); + + /* Call the installed ISR. */ + pxISRFunction(); +} + +/* Keep the linker quiet. */ +size_t __write(int, const unsigned char *, size_t); +size_t __write(int f, const unsigned char *p, size_t s) +{ + (void) f; + (void) p; + (void) s; + return 0; +} + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.crun b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.crun new file mode 100644 index 000000000..5bb5acca4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.crun @@ -0,0 +1,16 @@ + + + + 1 + + + * + * + * + 0 + 1 + + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dbgdt b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dbgdt new file mode 100644 index 000000000..98a60afd4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dbgdt @@ -0,0 +1,71 @@ + + + + + + + + + 300201622 + + + + + + 20121632481300Debug-LogFind-in-Files + + + + + + + 221272727 + + + + + + Disassembly_I0 + + + + 50020 + 0x3054440x0030211C0x00302750 + + + 20011 + 200xTickCountExpressionLocationTypeValue207150100294200100Frame_I040020300Breakpoint_I050035300Debug-Log49782746331200ExpressionLocationTypeValue100150100100TC0TC0->TC_CHANNEL[ tmrTC0_CHANNEL_0 ].TC_RC30010300150200100100100100100100150300300100100100100100100100CSTACK410DataFrameLocationTypeValueVariable100100100100100100 + + + + + + + + TabID-24673-23877 + Workspace + Workspace + + + RTOSDemoRTOSDemo/Blinky DemoRTOSDemo/FreeRTOS+CLI + + + + 0TabID-17936-21395Debug LogDebug-Log0TabID-2504-23322Watch 1WATCH_10 + + + + + + TextEditor$WS_DIR$\AtmelFiles\drivers\peripherals\pmc.c000006611747217518TextEditor$WS_DIR$\FreeRTOSConfig.h000006300TextEditor$WS_DIR$\Full_Demo\IntQueueTimer.c0000012474257425TextEditor$WS_DIR$\AtmelFiles\target\sama5d2\board_sama5d2-xplained.h0000028730463046TextEditor$WS_DIR$\AtmelFiles\drivers\peripherals\tc.c0000010344334433TextEditor$WS_DIR$\..\Common\Minimal\flop.c000003181237512375TextEditor$WS_DIR$\..\..\Source\tasks.c0000026709066790667TextEditor$WS_DIR$\Full_Demo\reg_test.S000003961223312233TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CA5_No_GIC\port.c00000651223812238TextEditor$WS_DIR$\..\..\Source\queue.c000008183196931969TextEditor$WS_DIR$\..\Common\Minimal\IntQueue.c000006922655726557TextEditor$WS_DIR$\Full_Demo\main_full.c0000012877517751TextEditor$WS_DIR$\..\Common\Minimal\flash.c000008250715071TextEditor$WS_DIR$\AtmelFiles\drivers\peripherals\pio4.c0000013752555255TextEditor$WS_DIR$\main.c000001367392739214TextEditor$WS_DIR$\blinky_demo\main_blinky.c0000081689568950100000010000001 + + + + + + + iaridepm.enu1debuggergui.enu1armjet.enu1-2-2868295-2-2228230118750202822154688767196-2-2868642-2-2200200104167176367335417767196-2-21981922-2-219242001002083176367104167176367 + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.ddram.cspy.bat b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.ddram.cspy.bat new file mode 100644 index 000000000..097b81288 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.ddram.cspy.bat @@ -0,0 +1,24 @@ +@REM This batch file has been generated by the IAR Embedded Workbench +@REM C-SPY Debugger, as an aid to preparing a command line for running +@REM the cspybat command line utility using the appropriate settings. +@REM +@REM Note that this file is generated every time a new debug session +@REM is initialized, so you may want to move or rename the file before +@REM making changes. +@REM +@REM You can launch cspybat by typing the name of this batch file followed +@REM by the name of the debug file (usually an ELF/DWARF or UBROF file). +@REM +@REM Read about available command line parameters in the C-SPY Debugging +@REM Guide. Hints about additional command line parameters that may be +@REM useful in specific cases: +@REM --download_only Downloads a code image without starting a debug +@REM session afterwards. +@REM --silent Omits the sign-on message. +@REM --timeout Limits the maximum allowed execution time. +@REM + + +"C:\DevTools\IAR Systems\Embedded Workbench 7.0\common\bin\cspybat" "C:\DevTools\IAR Systems\Embedded Workbench 7.0\arm\bin\armproc.dll" "C:\DevTools\IAR Systems\Embedded Workbench 7.0\arm\bin\armjlink.dll" %1 --plugin "C:\DevTools\IAR Systems\Embedded Workbench 7.0\arm\bin\armbat.dll" --macro "C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D3x_Xplained_IAR\..\..\..\..\libraries\libboard_sama5d3x-ek\resources\ewarm\sama5d3x-ek-ddram.mac" --backend -B "--endian=little" "--cpu=Cortex-A5" "--fpu=None" "-p" "C:\DevTools\IAR Systems\Embedded Workbench 7.0\arm\CONFIG\debugger\Atmel\ATSAMA5D35.ddf" "--drv_verify_download" "--semihosting=none" "--device=ATSAMA5D35" "--drv_communication=USB0" "--jlink_speed=auto" "--jlink_initial_speed=32" "--drv_catch_exceptions=0x000" + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dni b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dni new file mode 100644 index 000000000..b5ac83494 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.dni @@ -0,0 +1,101 @@ +[Stack] +FillEnabled=0 +OverflowWarningsEnabled=1 +WarningThreshold=90 +SpWarningsEnabled=0 +WarnLogOnly=1 +UseTrigger=1 +TriggerName=main +LimitSize=0 +ByteLimit=50 +[JLinkDriver] +WatchCond=_ 0 +Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0 +CStepIntDis=_ 0 +LeaveTargetRunning=_ 0 +[DebugChecksum] +Checksum=-596461035 +[Exceptions] +StopOnUncaught=_ 0 +StopOnThrow=_ 0 +[CallStack] +ShowArgs=0 +[Disassembly] +MixedMode=1 +[CallStackLog] +Enabled=0 +[DriverProfiling] +Enabled=0 +Mode=0 +Graph=0 +Symbiont=0 +Exclusions= +[PlDriver] +MemConfigValue=C:\DevTools\IAR Systems\Embedded Workbench 7.4\arm\CONFIG\debugger\Atmel\ATSAMA5D35.ddf +FirstRun=0 +[Jet] +DisableInterrupts=0 +MultiCoreRunAll=0 +JetConnSerialNo=408243741 +JetConnFoundProbes= +OnlineReset=Software +PrevWtdReset=Disabled (no reset) +LeaveRunning=0 +[ArmDriver] +EnableCache=1 +[SWOManager] +SamplingDivider=8192 +OverrideClock=0 +CpuClock=1919246957 +SwoClock=941636128 +DataLogMode=0 +ItmPortsEnabled=63 +ItmTermIOPorts=1 +ItmLogPorts=0 +ItmLogFile=$PROJ_DIR$\ITM.log +PowerForcePC=1 +PowerConnectPC=1 +[watch_formats] +Fmt0={W}1:xTickCount 3 0 +[Trace1] +Enabled=0 +ShowSource=1 +[ETMTraceWindow] +PortWidth=4 +PortMode=0 +CaptureDataValues=0 +CaptureDataAddresses=0 +CaptureDataRange=0 +DataFirst=0 +DataLast=-1 +StopWhen=0 +StallCPU=0 +NoPCCapture=0 +[Trace2] +Enabled=0 +ShowSource=0 +[SWOTraceWindow] +ForcedPcSampling=0 +ForcedInterruptLogs=0 +ForcedItmLogs=0 +EventCPI=0 +EventEXC=0 +EventFOLD=0 +EventLSU=0 +EventSLEEP=0 +[Log file] +LoggingEnabled=_ 0 +LogFile=_ "" +Category=_ 0 +[TermIOLog] +LoggingEnabled=_ 0 +LogFile=_ "" +[Disassemble mode] +mode=0 +[Breakpoints2] +Bp0=_ 1 "EMUL_CODE" "{$PROJ_DIR$\main.c}.254.2" 0 0 1 "" 0 "" 0 +Count=1 +[Aliases] +Count=0 +SuppressDialog=0 diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.cspy.bat b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.cspy.bat new file mode 100644 index 000000000..7558eb1b0 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.cspy.bat @@ -0,0 +1,40 @@ +@REM This batch file has been generated by the IAR Embedded Workbench +@REM C-SPY Debugger, as an aid to preparing a command line for running +@REM the cspybat command line utility using the appropriate settings. +@REM +@REM Note that this file is generated every time a new debug session +@REM is initialized, so you may want to move or rename the file before +@REM making changes. +@REM +@REM You can launch cspybat by typing the name of this batch file followed +@REM by the name of the debug file (usually an ELF/DWARF or UBROF file). +@REM +@REM Read about available command line parameters in the C-SPY Debugging +@REM Guide. Hints about additional command line parameters that may be +@REM useful in specific cases: +@REM --download_only Downloads a code image without starting a debug +@REM session afterwards. +@REM --silent Omits the sign-on message. +@REM --timeout Limits the maximum allowed execution time. +@REM + + +@echo off + +if not "%~1" == "" goto debugFile + +@echo on + +"C:\DevTools\IAR Systems\Embedded Workbench 7.4\common\bin\cspybat" -f "C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D2x_Xplained_IAR\settings\RTOSDemo.sram.general.xcl" --backend -f "C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D2x_Xplained_IAR\settings\RTOSDemo.sram.driver.xcl" + +@echo off +goto end + +:debugFile + +@echo on + +"C:\DevTools\IAR Systems\Embedded Workbench 7.4\common\bin\cspybat" -f "C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D2x_Xplained_IAR\settings\RTOSDemo.sram.general.xcl" "--debug_file=%~1" --backend -f "C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D2x_Xplained_IAR\settings\RTOSDemo.sram.driver.xcl" + +@echo off +:end \ No newline at end of file diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.driver.xcl b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.driver.xcl new file mode 100644 index 000000000..676996549 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.driver.xcl @@ -0,0 +1,35 @@ +"--endian=little" + +"--cpu=Cortex-A5" + +"--fpu=VFPv4Neon" + +"-p" + +"C:\DevTools\IAR Systems\Embedded Workbench 7.4\arm\CONFIG\debugger\Atmel\ATSAMA5D35.ddf" + +"--drv_verify_download" + +"--semihosting=none" + +"--device=ATSAMA5D35" + +"--multicore_nr_of_cores=1" + +"--jet_probe=cmsisdap" + +"--jet_standard_reset=0,0,0" + +"--reset_style=\"0,-,1,Disabled__no_reset_\"" + +"--reset_style=\"1,-,0,Software\"" + +"--reset_style=\"2,-,0,Hardware\"" + +"--reset_style=\"5,SoftwareReset,0,Custom\"" + +"--drv_catch_exceptions=0x01a" + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.general.xcl b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.general.xcl new file mode 100644 index 000000000..b8ba8f817 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.sram.general.xcl @@ -0,0 +1,15 @@ +"C:\DevTools\IAR Systems\Embedded Workbench 7.4\arm\bin\armproc.dll" + +"C:\DevTools\IAR Systems\Embedded Workbench 7.4\arm\bin\armJET.dll" + +"C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D2x_Xplained_IAR\sram\bin\sram.out" + +--plugin "C:\DevTools\IAR Systems\Embedded Workbench 7.4\arm\bin\armbat.dll" + +--device_macro "C:\DevTools\IAR Systems\Embedded Workbench 7.4\arm\config\debugger\Atmel\SAMA5D3.dmac" + +--macro "C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_A5_SAMA5D2x_Xplained_IAR\AtmelFiles\target\sama5d2\toolchain\iar\sram.mac" + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wsdt b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wsdt new file mode 100644 index 000000000..4f0fd82b4 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wsdt @@ -0,0 +1,78 @@ + + + + + + RTOSDemo/sram + + + + + + + + + 3620270 + + + + Action + Check + Source File + + + 100 + 400 + 200 + + + + + + + + 20121632481 + 1816245527894684682746331Breakpoint_I050035300 + + + + + + + TabID-22351-19008 + Workspace + Workspace + + + RTOSDemoRTOSDemo/FreeRTOS+CLIRTOSDemo/Output + + + + 0 + + + TabID-21076-19237 + Build + Build + + + TabID-23502-23081Debug LogDebug-LogTabID-24431-23894Ambiguous DefinitionsSelect-Ambiguous-DefinitionsTabID-9033-6116Find in FilesFind-in-Files + + 0 + + + + + + TextEditor$WS_DIR$\main.c0000073465152760TextEditor$WS_DIR$\Full_Demo\main_full.c000006669636963TextEditor$WS_DIR$\blinky_demo\main_blinky.c0000069670867080100000010000001 + + + + + + + iaridepm.enu1-2-2848409-2-214815177083133157214063749559-2-22421922-2-21924244100208321516877083133157 + + + + diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wspos b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wspos new file mode 100644 index 000000000..5be63aad6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo.wspos @@ -0,0 +1,2 @@ +[MainWindow] +WindowPlacement=_ 352 17 1850 887 3 diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo_sram.jlink b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo_sram.jlink new file mode 100644 index 000000000..de1b137f3 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/settings/RTOSDemo_sram.jlink @@ -0,0 +1,34 @@ +[BREAKPOINTS] +ShowInfoWin = 1 +EnableFlashBP = 2 +BPDuringExecution = 0 +[CFI] +CFISize = 0x00 +CFIAddr = 0x00 +[CPU] +OverrideMemMap = 0 +AllowSimulation = 1 +ScriptFile="" +[FLASH] +CacheExcludeSize = 0x00 +CacheExcludeAddr = 0x00 +MinNumBytesFlashDL = 0 +SkipProgOnCRCMatch = 1 +VerifyDownload = 1 +AllowCaching = 1 +EnableFlashDL = 2 +Override = 0 +Device="UNSPECIFIED" +[GENERAL] +WorkRAMSize = 0x00 +WorkRAMAddr = 0x00 +RAMUsageLimit = 0x00 +[SWO] +SWOLogFile="" +[MEM] +RdOverrideOrMask = 0x00 +RdOverrideAndMask = 0xFFFFFFFF +RdOverrideAddr = 0xFFFFFFFF +WrOverrideOrMask = 0x00 +WrOverrideAndMask = 0xFFFFFFFF +WrOverrideAddr = 0xFFFFFFFF -- 2.39.5