#[doc = concat!("assert_eq!(chip_name, ", chip!(), ")")]
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! chip {
() => {
"esp32s31"
};
}
#[doc = concat!("assert_eq!(chip_name, ", chip_pretty!(), ")")]
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! chip_pretty {
() => {
"ESP32-S31"
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! property {
("chip") => {
"esp32s31"
};
("arch") => {
"riscv"
};
("cores") => {
2
};
("cores", str) => {
stringify!(2)
};
("trm") => {
"https://www.espressif.com/sites/default/files/documentation/esp32-s31_technical_reference_manual_en.pdf"
};
("gpio.version") => {
3
};
("gpio.version", str) => {
stringify!(3)
};
("gpio.has_input_sync") => {
true
};
("gpio.gpio_function") => {
1
};
("gpio.gpio_function", str) => {
stringify!(1)
};
("gpio.constant_0_input") => {
192
};
("gpio.constant_0_input", str) => {
stringify!(192)
};
("gpio.constant_1_input") => {
128
};
("gpio.constant_1_input", str) => {
stringify!(128)
};
("gpio.remap_iomux_pin_registers") => {
false
};
("gpio.func_in_sel_offset") => {
0
};
("gpio.func_in_sel_offset", str) => {
stringify!(0)
};
("gpio.has_bank_1") => {
true
};
("gpio.input_signal_max") => {
255
};
("gpio.input_signal_max", str) => {
stringify!(255)
};
("gpio.output_signal_max") => {
256
};
("gpio.output_signal_max", str) => {
stringify!(256)
};
("dedicated_gpio.version") => {
"riscv_v2"
};
("dedicated_gpio.needs_initialization") => {
false
};
("dedicated_gpio.channel_count") => {
8
};
("dedicated_gpio.channel_count", str) => {
stringify!(8)
};
("lp_io.version") => {
"esp32s31"
};
("lp_io.has_gpio_matrix") => {
true
};
("uart.ram_size") => {
128
};
("uart.ram_size", str) => {
stringify!(128)
};
("uart.version") => {
2
};
("uart.version", str) => {
stringify!(2)
};
("uart.peripheral_controls_mem_clk") => {
true
};
("uart.has_sclk_divider") => {
false
};
("uart.has_sclk_enable") => {
true
};
("uhci.combined_uart_selector_field") => {
true
};
("i2c_master.version") => {
4
};
("i2c_master.version", str) => {
stringify!(4)
};
("i2c_master.has_fsm_timeouts") => {
true
};
("i2c_master.has_hw_bus_clear") => {
true
};
("i2c_master.has_bus_timeout_enable") => {
true
};
("i2c_master.separate_filter_config_registers") => {
false
};
("i2c_master.can_estimate_nack_reason") => {
true
};
("i2c_master.has_conf_update") => {
true
};
("i2c_master.has_reliable_fsm_reset") => {
true
};
("i2c_master.has_arbitration_en") => {
true
};
("i2c_master.has_tx_fifo_watermark") => {
true
};
("i2c_master.bus_timeout_is_exponential") => {
true
};
("i2c_master.has_pd_en") => {
true
};
("i2c_master.max_bus_timeout") => {
31
};
("i2c_master.max_bus_timeout", str) => {
stringify!(31)
};
("i2c_master.ll_intr_mask") => {
262143
};
("i2c_master.ll_intr_mask", str) => {
stringify!(262143)
};
("i2c_master.fifo_size") => {
32
};
("i2c_master.fifo_size", str) => {
stringify!(32)
};
("spi_master.version") => {
3
};
("spi_master.version", str) => {
stringify!(3)
};
("spi_master.fifo_size") => {
64
};
("spi_master.fifo_size", str) => {
stringify!(64)
};
("spi_master.bit_order_is_bool") => {
false
};
("spi_master.has_octal") => {
true
};
("spi_master.has_app_interrupts") => {
true
};
("spi_master.has_dma_segmented_transfer") => {
true
};
("spi_master.has_clk_pre_div") => {
false
};
("spi_master.dma_can_access_flash") => {
false
};
("i2s.version") => {
3
};
("i2s.version", str) => {
stringify!(3)
};
("i2s.mclk_divider_bit_width") => {
8
};
("i2s.mclk_divider_bit_width", str) => {
stringify!(8)
};
("i2s.max_ws_width") => {
512
};
("i2s.max_ws_width", str) => {
stringify!(512)
};
("i2s.clock_configured_by_pcr") => {
false
};
("i2s.clock_configured_by_hp_sys_clkrst") => {
true
};
("i2s.supports_pdm_rx_hp_filter") => {
true
};
("i2s.supports_pdm_tx") => {
true
};
("i2s.supports_pdm_rx") => {
true
};
("i2s.supports_pcm2pdm") => {
true
};
("i2s.supports_pdm2pcm") => {
true
};
("rmt.ram_start") => {
540366848
};
("rmt.ram_start", str) => {
stringify!(540366848)
};
("rmt.channel_ram_size") => {
48
};
("rmt.channel_ram_size", str) => {
stringify!(48)
};
("rmt.has_tx_immediate_stop") => {
true
};
("rmt.has_tx_loop_count") => {
true
};
("rmt.has_tx_loop_auto_stop") => {
true
};
("rmt.has_tx_carrier_data_only") => {
true
};
("rmt.has_tx_sync") => {
true
};
("rmt.has_rx_wrap") => {
true
};
("rmt.has_rx_demodulation") => {
true
};
("rmt.has_per_channel_clock") => {
false
};
("sdmmc.delay_phase_num") => {
8
};
("sdmmc.delay_phase_num", str) => {
stringify!(8)
};
("sdmmc.has_iomux") => {
true
};
("sdmmc.has_gpio_matrix") => {
false
};
("sdmmc.psram_dma") => {
true
};
("sdmmc.uhs") => {
false
};
("usb_otg_hs.fifo_depth_words") => {
896
};
("usb_otg_hs.fifo_depth_words", str) => {
stringify!(896)
};
("wifi.has_wifi6") => {
true
};
("wifi.mac_version") => {
3
};
("wifi.mac_version", str) => {
stringify!(3)
};
("wifi.has_5g") => {
false
};
("wifi.csi_supported") => {
true
};
("ethernet.mii_via_gpio_matrix") => {
true
};
("ethernet.rx_store_and_forward") => {
false
};
("ethernet.rx_checksum_offload") => {
true
};
("ethernet.tx_checksum_offload") => {
false
};
("ethernet.dma_burst_len") => {
16
};
("ethernet.dma_burst_len", str) => {
stringify!(16)
};
("ethernet.has_rgmii") => {
true
};
("phy.combo_module") => {
false
};
("rgb_display.output_lines") => {
24
};
("rgb_display.output_lines", str) => {
stringify!(24)
};
("sdm.channel_count") => {
8
};
("sdm.channel_count", str) => {
stringify!(8)
};
("timergroup.timg_has_timer1") => {
false
};
("timergroup.timg_has_divcnt_rst") => {
true
};
("timergroup.rc_fast_calibration_divider_min_rev") => {
0
};
("timergroup.rc_fast_calibration_divider") => {
50
};
("timergroup.rc_fast_calibration_tick_enable") => {
false
};
("aes.has_split_text_registers") => {
true
};
("aes.endianness_configurable") => {
false
};
("ecc.zero_extend_writes") => {
false
};
("ecc.separate_jacobian_point_memory") => {
true
};
("ecc.has_memory_clock_gate") => {
true
};
("ecc.supports_enhanced_security") => {
true
};
("ecc.mem_block_size") => {
48
};
("rng.apb_cycle_wait_num") => {
16
};
("rng.apb_cycle_wait_num", str) => {
stringify!(16)
};
("rng.trng_supported") => {
false
};
("rng.is_lp_sys") => {
false
};
("rsa.version") => {
3
};
("rsa.version", str) => {
stringify!(3)
};
("rsa.size_increment") => {
32
};
("rsa.size_increment", str) => {
stringify!(32)
};
("rsa.memory_size_bytes") => {
512
};
("rsa.memory_size_bytes", str) => {
stringify!(512)
};
("sleep.light_sleep") => {
true
};
("sleep.deep_sleep") => {
true
};
("sleep.rejectable_mask") => {
46150029
};
("sleep.ext1_version") => {
3
};
("sleep.ext1_version", str) => {
stringify!(3)
};
("sleep.pin_wakeup_version") => {
3
};
("sleep.pin_wakeup_version", str) => {
stringify!(3)
};
("sleep.deep_sleep_needs_gpio_isolation") => {
false
};
("dma.mem2mem_requires_peripheral") => {
false
};
("dma.ext_mem_configurable_block_size") => {
false
};
("dma.separate_in_out_interrupts") => {
true
};
("dma.gdma_version") => {
3
};
("dma.gdma_version", str) => {
stringify!(3)
};
("interrupts.status_registers") => {
6
};
("interrupts.status_registers", str) => {
stringify!(6)
};
("interrupts.disabled_interrupt") => {
0
};
("mmu.page_size") => {
65536
};
("mmu.page_size", str) => {
stringify!(65536)
};
("mmu.entry_num") => {
1024
};
("mmu.entry_num", str) => {
stringify!(1024)
};
("psram.octal_spi") => {
true
};
("psram.hex_spi") => {
false
};
("psram.extmem_origin") => {
1342177280
};
("psram.extmem_origin", str) => {
stringify!(1342177280)
};
("rom.has_crc_le") => {
true
};
("rom.has_crc_be") => {
true
};
("rom.has_md5_bsd") => {
true
};
("rom.has_md5_mbedtls") => {
false
};
("soc.cpu_has_branch_predictor") => {
true
};
("soc.cpu_has_csr_pc") => {
false
};
("soc.multi_core_enabled") => {
true
};
("soc.cpu_csr_prv_mode") => {
2064
};
("soc.cpu_csr_prv_mode", str) => {
stringify!(2064)
};
("soc.internal_memory_cached") => {
false
};
("soc.has_swd_watchdog") => {
true
};
("soc.cpu_mcause_mask") => {
63
};
("soc.cpu_mcause_mask", str) => {
stringify!(63)
};
("clock_tree.cpu_root_clk") => {
[crate ::soc::clocks::CpuRootClkConfig::Xtal, crate
::soc::clocks::CpuRootClkConfig::Cpll, crate
::soc::clocks::CpuRootClkConfig::RcFast, crate
::soc::clocks::CpuRootClkConfig::PllF240m]
};
("clock_tree.cpu_clk.divisor") => {
(0, 255)
};
("clock_tree.mem_clk.divisor") => {
(0, 1)
};
("clock_tree.sys_clk.divisor") => {
(0, 255)
};
("clock_tree.apb_clk.divisor") => {
(0, 255)
};
("clock_tree.lp_fast_clk") => {
[crate ::soc::clocks::LpFastClkConfig::RcFast, crate
::soc::clocks::LpFastClkConfig::Xtal]
};
("clock_tree.lp_slow_clk") => {
[crate ::soc::clocks::LpSlowClkConfig::RcSlow, #[cfg(use_xtal32k)] crate
::soc::clocks::LpSlowClkConfig::Xtal32k]
};
("clock_tree.crypto_clk") => {
[crate ::soc::clocks::CryptoClkConfig::Xtal, crate
::soc::clocks::CryptoClkConfig::RcFast, crate
::soc::clocks::CryptoClkConfig::PllF240m]
};
("clock_tree.iomux_function_clock.source") => {
[crate ::soc::clocks::IomuxFunctionClockSource::XtalClk, crate
::soc::clocks::IomuxFunctionClockSource::PllF80m]
};
("clock_tree.iomux_function_clock.div_num") => {
(0, 255)
};
("clock_tree.timg_calibration_clock") => {
[crate ::soc::clocks::TimgCalibrationClockConfig::RcSlowClk, crate
::soc::clocks::TimgCalibrationClockConfig::RcFastDivClk, #[cfg(use_xtal32k)]
crate ::soc::clocks::TimgCalibrationClockConfig::Xtal32kClk]
};
("clock_tree.psram.function_clock") => {
[crate ::soc::clocks::PsramFunctionClockConfig::Xtal, crate
::soc::clocks::PsramFunctionClockConfig::Mpll, crate
::soc::clocks::PsramFunctionClockConfig::Cpll]
};
("clock_tree.uart.function_clock.sclk") => {
[crate ::soc::clocks::UartFunctionClockSclk::PllF80m, crate
::soc::clocks::UartFunctionClockSclk::Xtal, crate
::soc::clocks::UartFunctionClockSclk::RcFast]
};
("clock_tree.uart.function_clock.div_num") => {
(0, 255)
};
("clock_tree.uart.baud_rate_generator.fractional") => {
(0, 15)
};
("clock_tree.uart.baud_rate_generator.integral") => {
(0, 4095)
};
("clock_tree.timg.function_clock") => {
[crate ::soc::clocks::TimgFunctionClockConfig::PllF80m, crate
::soc::clocks::TimgFunctionClockConfig::RcFastClk, crate
::soc::clocks::TimgFunctionClockConfig::XtalClk]
};
("clock_tree.timg.wdt_clock") => {
[crate ::soc::clocks::TimgWdtClockConfig::XtalClk, crate
::soc::clocks::TimgWdtClockConfig::PllF80m, crate
::soc::clocks::TimgWdtClockConfig::RcFastClk]
};
("clock_tree.spi.function_clock") => {
[crate ::soc::clocks::SpiFunctionClockConfig::Bbpll, crate
::soc::clocks::SpiFunctionClockConfig::Xtal, crate
::soc::clocks::SpiFunctionClockConfig::RcFast]
};
("clock_tree.i2c.function_clock.sclk") => {
[crate ::soc::clocks::I2cFunctionClockSclk::Xtal, crate
::soc::clocks::I2cFunctionClockSclk::RcFast]
};
("clock_tree.i2c.function_clock.div_num") => {
(0, 255)
};
("clock_tree.i2s.tx_clk.sclk") => {
[crate ::soc::clocks::I2sClkSclk::Xtal]
};
("clock_tree.i2s.tx_clk.div_num") => {
(1, 256)
};
("clock_tree.i2s.tx_clk.div_a") => {
(1, 511)
};
("clock_tree.i2s.tx_clk.div_b") => {
(0, 511)
};
("clock_tree.i2s.rx_clk.sclk") => {
[crate ::soc::clocks::I2sClkSclk::Xtal]
};
("clock_tree.i2s.rx_clk.div_num") => {
(1, 256)
};
("clock_tree.i2s.rx_clk.div_a") => {
(1, 511)
};
("clock_tree.i2s.rx_clk.div_b") => {
(0, 511)
};
("clock_tree.i2s.mclk_out") => {
[crate ::soc::clocks::I2sMclkOutConfig::Tx, crate
::soc::clocks::I2sMclkOutConfig::Rx]
};
("clock_tree.rmt.sclk") => {
[crate ::soc::clocks::RmtSclkConfig::PllF80m, crate
::soc::clocks::RmtSclkConfig::RcFastClk, crate
::soc::clocks::RmtSclkConfig::XtalClk]
};
("clock_tree.lcd_cam.lcd_clock.sclk") => {
[crate ::soc::clocks::LcdCamLcdClockSclk::XtalClk, crate
::soc::clocks::LcdCamLcdClockSclk::PllF160m]
};
("clock_tree.lcd_cam.lcd_clock.div_num") => {
(1, 256)
};
("clock_tree.lcd_cam.lcd_clock.div_a") => {
(1, 255)
};
("clock_tree.lcd_cam.lcd_clock.div_b") => {
(0, 255)
};
("clock_tree.lcd_cam.cam_clock.sclk") => {
[crate ::soc::clocks::LcdCamCamClockSclk::XtalClk, crate
::soc::clocks::LcdCamCamClockSclk::PllF160m]
};
("clock_tree.lcd_cam.cam_clock.div_num") => {
(1, 256)
};
("clock_tree.lcd_cam.cam_clock.div_a") => {
(1, 255)
};
("clock_tree.lcd_cam.cam_clock.div_b") => {
(0, 255)
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_dedicated_gpio {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_dedicated_gpio { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_dedicated_gpio!((0));
_for_each_inner_dedicated_gpio!((1)); _for_each_inner_dedicated_gpio!((2));
_for_each_inner_dedicated_gpio!((3)); _for_each_inner_dedicated_gpio!((4));
_for_each_inner_dedicated_gpio!((5)); _for_each_inner_dedicated_gpio!((6));
_for_each_inner_dedicated_gpio!((7)); _for_each_inner_dedicated_gpio!((0, 0,
CPU_GPIO_0)); _for_each_inner_dedicated_gpio!((0, 1, CPU_GPIO_1));
_for_each_inner_dedicated_gpio!((0, 2, CPU_GPIO_2));
_for_each_inner_dedicated_gpio!((0, 3, CPU_GPIO_3));
_for_each_inner_dedicated_gpio!((0, 4, CPU_GPIO_4));
_for_each_inner_dedicated_gpio!((0, 5, CPU_GPIO_5));
_for_each_inner_dedicated_gpio!((0, 6, CPU_GPIO_6));
_for_each_inner_dedicated_gpio!((0, 7, CPU_GPIO_7));
_for_each_inner_dedicated_gpio!((1, 0, CPU_GPIO_8));
_for_each_inner_dedicated_gpio!((1, 1, CPU_GPIO_9));
_for_each_inner_dedicated_gpio!((1, 2, CPU_GPIO_10));
_for_each_inner_dedicated_gpio!((1, 3, CPU_GPIO_11));
_for_each_inner_dedicated_gpio!((1, 4, CPU_GPIO_12));
_for_each_inner_dedicated_gpio!((1, 5, CPU_GPIO_13));
_for_each_inner_dedicated_gpio!((1, 6, CPU_GPIO_14));
_for_each_inner_dedicated_gpio!((1, 7, CPU_GPIO_15));
_for_each_inner_dedicated_gpio!((channels(0), (1), (2), (3), (4), (5), (6),
(7))); _for_each_inner_dedicated_gpio!((signals(0, 0, CPU_GPIO_0), (0, 1,
CPU_GPIO_1), (0, 2, CPU_GPIO_2), (0, 3, CPU_GPIO_3), (0, 4, CPU_GPIO_4), (0, 5,
CPU_GPIO_5), (0, 6, CPU_GPIO_6), (0, 7, CPU_GPIO_7), (1, 0, CPU_GPIO_8), (1, 1,
CPU_GPIO_9), (1, 2, CPU_GPIO_10), (1, 3, CPU_GPIO_11), (1, 4, CPU_GPIO_12), (1,
5, CPU_GPIO_13), (1, 6, CPU_GPIO_14), (1, 7, CPU_GPIO_15)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! define_lp_io_signals {
() => {
#[allow(non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Debug, PartialEq, Copy, Clone)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[doc(hidden)]
pub enum LpInputSignal {
LP_I2C_SCL = 0,
LP_I2C_SDA = 1,
LP_UART_RXD = 2,
LP_UART_CTSN = 3,
LP_UART_DSRN = 4,
LP_SPI_CK = 5,
LP_SPI_CS = 6,
LP_SPI_D = 7,
LP_SPI_Q = 8,
}
#[allow(non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Debug, PartialEq, Copy, Clone)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[doc(hidden)]
pub enum LpOutputSignal {
LP_I2C_SCL = 0,
LP_I2C_SDA = 1,
LP_UART_TXD = 2,
LP_UART_RTSN = 3,
LP_UART_DTRN = 4,
LP_SPI_CK = 5,
LP_SPI_CS = 6,
LP_SPI_D = 7,
LP_SPI_Q = 8,
}
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_rmt_channel {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_rmt_channel { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_rmt_channel!((0)); _for_each_inner_rmt_channel!((1));
_for_each_inner_rmt_channel!((2)); _for_each_inner_rmt_channel!((3));
_for_each_inner_rmt_channel!((4)); _for_each_inner_rmt_channel!((5));
_for_each_inner_rmt_channel!((6)); _for_each_inner_rmt_channel!((7));
_for_each_inner_rmt_channel!((0, 0)); _for_each_inner_rmt_channel!((1, 1));
_for_each_inner_rmt_channel!((2, 2)); _for_each_inner_rmt_channel!((3, 3));
_for_each_inner_rmt_channel!((4, 0)); _for_each_inner_rmt_channel!((5, 1));
_for_each_inner_rmt_channel!((6, 2)); _for_each_inner_rmt_channel!((7, 3));
_for_each_inner_rmt_channel!((all(0), (1), (2), (3), (4), (5), (6), (7)));
_for_each_inner_rmt_channel!((tx(0, 0), (1, 1), (2, 2), (3, 3)));
_for_each_inner_rmt_channel!((rx(4, 0), (5, 1), (6, 2), (7, 3)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_sdmmc {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_sdmmc { $(($pattern) => $code;)* ($other : tt) => {}
} _for_each_inner_sdmmc!((slot0, 0, true, [], [], [], [], [],
[SDHOST_CARD_DETECT_N_1], [SDHOST_CARD_WRITE_PRT_1], [SDHOST_CARD_INT_N_1],
[SDHOST_DATA_STROBE_1], [SD_RST_N_1])); _for_each_inner_sdmmc!((slot1, 1, true,
[], [], [], [], [], [SDHOST_CARD_DETECT_N_2], [SDHOST_CARD_WRITE_PRT_2],
[SDHOST_CARD_INT_N_2], [SDHOST_DATA_STROBE_2], [SD_RST_N_2]));
_for_each_inner_sdmmc!((all(slot0, 0, true, [], [], [], [], [],
[SDHOST_CARD_DETECT_N_1], [SDHOST_CARD_WRITE_PRT_1], [SDHOST_CARD_INT_N_1],
[SDHOST_DATA_STROBE_1], [SD_RST_N_1]), (slot1, 1, true, [], [], [], [], [],
[SDHOST_CARD_DETECT_N_2], [SDHOST_CARD_WRITE_PRT_2], [SDHOST_CARD_INT_N_2],
[SDHOST_DATA_STROBE_2], [SD_RST_N_2])));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_sdm_channel {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_sdm_channel { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_sdm_channel!((0, SDM_CH0, SdmCh0, GPIO_SD0));
_for_each_inner_sdm_channel!((1, SDM_CH1, SdmCh1, GPIO_SD1));
_for_each_inner_sdm_channel!((2, SDM_CH2, SdmCh2, GPIO_SD2));
_for_each_inner_sdm_channel!((3, SDM_CH3, SdmCh3, GPIO_SD3));
_for_each_inner_sdm_channel!((4, SDM_CH4, SdmCh4, GPIO_SD4));
_for_each_inner_sdm_channel!((5, SDM_CH5, SdmCh5, GPIO_SD5));
_for_each_inner_sdm_channel!((6, SDM_CH6, SdmCh6, GPIO_SD6));
_for_each_inner_sdm_channel!((7, SDM_CH7, SdmCh7, GPIO_SD7));
_for_each_inner_sdm_channel!((channels(0, SDM_CH0, SdmCh0, GPIO_SD0), (1,
SDM_CH1, SdmCh1, GPIO_SD1), (2, SDM_CH2, SdmCh2, GPIO_SD2), (3, SDM_CH3, SdmCh3,
GPIO_SD3), (4, SDM_CH4, SdmCh4, GPIO_SD4), (5, SDM_CH5, SdmCh5, GPIO_SD5), (6,
SDM_CH6, SdmCh6, GPIO_SD6), (7, SDM_CH7, SdmCh7, GPIO_SD7)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_aes_key_length {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_aes_key_length { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_aes_key_length!((128));
_for_each_inner_aes_key_length!((256)); _for_each_inner_aes_key_length!((128, 0,
4)); _for_each_inner_aes_key_length!((256, 2, 6));
_for_each_inner_aes_key_length!((bits(128), (256)));
_for_each_inner_aes_key_length!((modes(128, 0, 4), (256, 2, 6)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_ecc_working_mode {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_ecc_working_mode { $(($pattern) => $code;)* ($other
: tt) => {} } _for_each_inner_ecc_working_mode!((0, AffinePointMultiplication));
_for_each_inner_ecc_working_mode!((2, AffinePointVerification));
_for_each_inner_ecc_working_mode!((3, AffinePointVerificationAndMultiplication));
_for_each_inner_ecc_working_mode!((4, JacobianPointMultiplication));
_for_each_inner_ecc_working_mode!((5, AffinePointAddition));
_for_each_inner_ecc_working_mode!((6, JacobianPointVerification));
_for_each_inner_ecc_working_mode!((7,
AffinePointVerificationAndJacobianPointMultiplication));
_for_each_inner_ecc_working_mode!((8, ModularAddition));
_for_each_inner_ecc_working_mode!((9, ModularSubtraction));
_for_each_inner_ecc_working_mode!((10, ModularMultiplication));
_for_each_inner_ecc_working_mode!((11, ModularDivision));
_for_each_inner_ecc_working_mode!((all(0, AffinePointMultiplication), (2,
AffinePointVerification), (3, AffinePointVerificationAndMultiplication), (4,
JacobianPointMultiplication), (5, AffinePointAddition), (6,
JacobianPointVerification), (7,
AffinePointVerificationAndJacobianPointMultiplication), (8, ModularAddition), (9,
ModularSubtraction), (10, ModularMultiplication), (11, ModularDivision)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_ecc_curve {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_ecc_curve { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_ecc_curve!((0, P192, 192));
_for_each_inner_ecc_curve!((1, P256, 256)); _for_each_inner_ecc_curve!((2, P384,
384)); _for_each_inner_ecc_curve!((all(0, P192, 192), (1, P256, 256), (2, P384,
384)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_rsa_exponentiation {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_rsa_exponentiation { $(($pattern) => $code;)*
($other : tt) => {} } _for_each_inner_rsa_exponentiation!((32));
_for_each_inner_rsa_exponentiation!((64));
_for_each_inner_rsa_exponentiation!((96));
_for_each_inner_rsa_exponentiation!((128));
_for_each_inner_rsa_exponentiation!((160));
_for_each_inner_rsa_exponentiation!((192));
_for_each_inner_rsa_exponentiation!((224));
_for_each_inner_rsa_exponentiation!((256));
_for_each_inner_rsa_exponentiation!((288));
_for_each_inner_rsa_exponentiation!((320));
_for_each_inner_rsa_exponentiation!((352));
_for_each_inner_rsa_exponentiation!((384));
_for_each_inner_rsa_exponentiation!((416));
_for_each_inner_rsa_exponentiation!((448));
_for_each_inner_rsa_exponentiation!((480));
_for_each_inner_rsa_exponentiation!((512));
_for_each_inner_rsa_exponentiation!((544));
_for_each_inner_rsa_exponentiation!((576));
_for_each_inner_rsa_exponentiation!((608));
_for_each_inner_rsa_exponentiation!((640));
_for_each_inner_rsa_exponentiation!((672));
_for_each_inner_rsa_exponentiation!((704));
_for_each_inner_rsa_exponentiation!((736));
_for_each_inner_rsa_exponentiation!((768));
_for_each_inner_rsa_exponentiation!((800));
_for_each_inner_rsa_exponentiation!((832));
_for_each_inner_rsa_exponentiation!((864));
_for_each_inner_rsa_exponentiation!((896));
_for_each_inner_rsa_exponentiation!((928));
_for_each_inner_rsa_exponentiation!((960));
_for_each_inner_rsa_exponentiation!((992));
_for_each_inner_rsa_exponentiation!((1024));
_for_each_inner_rsa_exponentiation!((1056));
_for_each_inner_rsa_exponentiation!((1088));
_for_each_inner_rsa_exponentiation!((1120));
_for_each_inner_rsa_exponentiation!((1152));
_for_each_inner_rsa_exponentiation!((1184));
_for_each_inner_rsa_exponentiation!((1216));
_for_each_inner_rsa_exponentiation!((1248));
_for_each_inner_rsa_exponentiation!((1280));
_for_each_inner_rsa_exponentiation!((1312));
_for_each_inner_rsa_exponentiation!((1344));
_for_each_inner_rsa_exponentiation!((1376));
_for_each_inner_rsa_exponentiation!((1408));
_for_each_inner_rsa_exponentiation!((1440));
_for_each_inner_rsa_exponentiation!((1472));
_for_each_inner_rsa_exponentiation!((1504));
_for_each_inner_rsa_exponentiation!((1536));
_for_each_inner_rsa_exponentiation!((1568));
_for_each_inner_rsa_exponentiation!((1600));
_for_each_inner_rsa_exponentiation!((1632));
_for_each_inner_rsa_exponentiation!((1664));
_for_each_inner_rsa_exponentiation!((1696));
_for_each_inner_rsa_exponentiation!((1728));
_for_each_inner_rsa_exponentiation!((1760));
_for_each_inner_rsa_exponentiation!((1792));
_for_each_inner_rsa_exponentiation!((1824));
_for_each_inner_rsa_exponentiation!((1856));
_for_each_inner_rsa_exponentiation!((1888));
_for_each_inner_rsa_exponentiation!((1920));
_for_each_inner_rsa_exponentiation!((1952));
_for_each_inner_rsa_exponentiation!((1984));
_for_each_inner_rsa_exponentiation!((2016));
_for_each_inner_rsa_exponentiation!((2048));
_for_each_inner_rsa_exponentiation!((2080));
_for_each_inner_rsa_exponentiation!((2112));
_for_each_inner_rsa_exponentiation!((2144));
_for_each_inner_rsa_exponentiation!((2176));
_for_each_inner_rsa_exponentiation!((2208));
_for_each_inner_rsa_exponentiation!((2240));
_for_each_inner_rsa_exponentiation!((2272));
_for_each_inner_rsa_exponentiation!((2304));
_for_each_inner_rsa_exponentiation!((2336));
_for_each_inner_rsa_exponentiation!((2368));
_for_each_inner_rsa_exponentiation!((2400));
_for_each_inner_rsa_exponentiation!((2432));
_for_each_inner_rsa_exponentiation!((2464));
_for_each_inner_rsa_exponentiation!((2496));
_for_each_inner_rsa_exponentiation!((2528));
_for_each_inner_rsa_exponentiation!((2560));
_for_each_inner_rsa_exponentiation!((2592));
_for_each_inner_rsa_exponentiation!((2624));
_for_each_inner_rsa_exponentiation!((2656));
_for_each_inner_rsa_exponentiation!((2688));
_for_each_inner_rsa_exponentiation!((2720));
_for_each_inner_rsa_exponentiation!((2752));
_for_each_inner_rsa_exponentiation!((2784));
_for_each_inner_rsa_exponentiation!((2816));
_for_each_inner_rsa_exponentiation!((2848));
_for_each_inner_rsa_exponentiation!((2880));
_for_each_inner_rsa_exponentiation!((2912));
_for_each_inner_rsa_exponentiation!((2944));
_for_each_inner_rsa_exponentiation!((2976));
_for_each_inner_rsa_exponentiation!((3008));
_for_each_inner_rsa_exponentiation!((3040));
_for_each_inner_rsa_exponentiation!((3072));
_for_each_inner_rsa_exponentiation!((3104));
_for_each_inner_rsa_exponentiation!((3136));
_for_each_inner_rsa_exponentiation!((3168));
_for_each_inner_rsa_exponentiation!((3200));
_for_each_inner_rsa_exponentiation!((3232));
_for_each_inner_rsa_exponentiation!((3264));
_for_each_inner_rsa_exponentiation!((3296));
_for_each_inner_rsa_exponentiation!((3328));
_for_each_inner_rsa_exponentiation!((3360));
_for_each_inner_rsa_exponentiation!((3392));
_for_each_inner_rsa_exponentiation!((3424));
_for_each_inner_rsa_exponentiation!((3456));
_for_each_inner_rsa_exponentiation!((3488));
_for_each_inner_rsa_exponentiation!((3520));
_for_each_inner_rsa_exponentiation!((3552));
_for_each_inner_rsa_exponentiation!((3584));
_for_each_inner_rsa_exponentiation!((3616));
_for_each_inner_rsa_exponentiation!((3648));
_for_each_inner_rsa_exponentiation!((3680));
_for_each_inner_rsa_exponentiation!((3712));
_for_each_inner_rsa_exponentiation!((3744));
_for_each_inner_rsa_exponentiation!((3776));
_for_each_inner_rsa_exponentiation!((3808));
_for_each_inner_rsa_exponentiation!((3840));
_for_each_inner_rsa_exponentiation!((3872));
_for_each_inner_rsa_exponentiation!((3904));
_for_each_inner_rsa_exponentiation!((3936));
_for_each_inner_rsa_exponentiation!((3968));
_for_each_inner_rsa_exponentiation!((4000));
_for_each_inner_rsa_exponentiation!((4032));
_for_each_inner_rsa_exponentiation!((4064));
_for_each_inner_rsa_exponentiation!((4096));
_for_each_inner_rsa_exponentiation!((all(32), (64), (96), (128), (160), (192),
(224), (256), (288), (320), (352), (384), (416), (448), (480), (512), (544),
(576), (608), (640), (672), (704), (736), (768), (800), (832), (864), (896),
(928), (960), (992), (1024), (1056), (1088), (1120), (1152), (1184), (1216),
(1248), (1280), (1312), (1344), (1376), (1408), (1440), (1472), (1504), (1536),
(1568), (1600), (1632), (1664), (1696), (1728), (1760), (1792), (1824), (1856),
(1888), (1920), (1952), (1984), (2016), (2048), (2080), (2112), (2144), (2176),
(2208), (2240), (2272), (2304), (2336), (2368), (2400), (2432), (2464), (2496),
(2528), (2560), (2592), (2624), (2656), (2688), (2720), (2752), (2784), (2816),
(2848), (2880), (2912), (2944), (2976), (3008), (3040), (3072), (3104), (3136),
(3168), (3200), (3232), (3264), (3296), (3328), (3360), (3392), (3424), (3456),
(3488), (3520), (3552), (3584), (3616), (3648), (3680), (3712), (3744), (3776),
(3808), (3840), (3872), (3904), (3936), (3968), (4000), (4032), (4064), (4096)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_rsa_multiplication {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_rsa_multiplication { $(($pattern) => $code;)*
($other : tt) => {} } _for_each_inner_rsa_multiplication!((32));
_for_each_inner_rsa_multiplication!((64));
_for_each_inner_rsa_multiplication!((96));
_for_each_inner_rsa_multiplication!((128));
_for_each_inner_rsa_multiplication!((160));
_for_each_inner_rsa_multiplication!((192));
_for_each_inner_rsa_multiplication!((224));
_for_each_inner_rsa_multiplication!((256));
_for_each_inner_rsa_multiplication!((288));
_for_each_inner_rsa_multiplication!((320));
_for_each_inner_rsa_multiplication!((352));
_for_each_inner_rsa_multiplication!((384));
_for_each_inner_rsa_multiplication!((416));
_for_each_inner_rsa_multiplication!((448));
_for_each_inner_rsa_multiplication!((480));
_for_each_inner_rsa_multiplication!((512));
_for_each_inner_rsa_multiplication!((544));
_for_each_inner_rsa_multiplication!((576));
_for_each_inner_rsa_multiplication!((608));
_for_each_inner_rsa_multiplication!((640));
_for_each_inner_rsa_multiplication!((672));
_for_each_inner_rsa_multiplication!((704));
_for_each_inner_rsa_multiplication!((736));
_for_each_inner_rsa_multiplication!((768));
_for_each_inner_rsa_multiplication!((800));
_for_each_inner_rsa_multiplication!((832));
_for_each_inner_rsa_multiplication!((864));
_for_each_inner_rsa_multiplication!((896));
_for_each_inner_rsa_multiplication!((928));
_for_each_inner_rsa_multiplication!((960));
_for_each_inner_rsa_multiplication!((992));
_for_each_inner_rsa_multiplication!((1024));
_for_each_inner_rsa_multiplication!((1056));
_for_each_inner_rsa_multiplication!((1088));
_for_each_inner_rsa_multiplication!((1120));
_for_each_inner_rsa_multiplication!((1152));
_for_each_inner_rsa_multiplication!((1184));
_for_each_inner_rsa_multiplication!((1216));
_for_each_inner_rsa_multiplication!((1248));
_for_each_inner_rsa_multiplication!((1280));
_for_each_inner_rsa_multiplication!((1312));
_for_each_inner_rsa_multiplication!((1344));
_for_each_inner_rsa_multiplication!((1376));
_for_each_inner_rsa_multiplication!((1408));
_for_each_inner_rsa_multiplication!((1440));
_for_each_inner_rsa_multiplication!((1472));
_for_each_inner_rsa_multiplication!((1504));
_for_each_inner_rsa_multiplication!((1536));
_for_each_inner_rsa_multiplication!((1568));
_for_each_inner_rsa_multiplication!((1600));
_for_each_inner_rsa_multiplication!((1632));
_for_each_inner_rsa_multiplication!((1664));
_for_each_inner_rsa_multiplication!((1696));
_for_each_inner_rsa_multiplication!((1728));
_for_each_inner_rsa_multiplication!((1760));
_for_each_inner_rsa_multiplication!((1792));
_for_each_inner_rsa_multiplication!((1824));
_for_each_inner_rsa_multiplication!((1856));
_for_each_inner_rsa_multiplication!((1888));
_for_each_inner_rsa_multiplication!((1920));
_for_each_inner_rsa_multiplication!((1952));
_for_each_inner_rsa_multiplication!((1984));
_for_each_inner_rsa_multiplication!((2016));
_for_each_inner_rsa_multiplication!((2048));
_for_each_inner_rsa_multiplication!((all(32), (64), (96), (128), (160), (192),
(224), (256), (288), (320), (352), (384), (416), (448), (480), (512), (544),
(576), (608), (640), (672), (704), (736), (768), (800), (832), (864), (896),
(928), (960), (992), (1024), (1056), (1088), (1120), (1152), (1184), (1216),
(1248), (1280), (1312), (1344), (1376), (1408), (1440), (1472), (1504), (1536),
(1568), (1600), (1632), (1664), (1696), (1728), (1760), (1792), (1824), (1856),
(1888), (1920), (1952), (1984), (2016), (2048)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_sha_algorithm {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_sha_algorithm { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_sha_algorithm!((Sha1, "SHA-1"(sizes : 64, 20, 8)
(insecure_against : "collision", "length extension"), 0));
_for_each_inner_sha_algorithm!((Sha224, "SHA-224"(sizes : 64, 28, 8)
(insecure_against : "length extension"), 1));
_for_each_inner_sha_algorithm!((Sha256, "SHA-256"(sizes : 64, 32, 8)
(insecure_against : "length extension"), 2));
_for_each_inner_sha_algorithm!((Sha384, "SHA-384"(sizes : 128, 48, 16)
(insecure_against :), 3)); _for_each_inner_sha_algorithm!((Sha512,
"SHA-512"(sizes : 128, 64, 16) (insecure_against : "length extension"), 4));
_for_each_inner_sha_algorithm!((Sha512_224, "SHA-512/224"(sizes : 128, 28, 16)
(insecure_against :), 5)); _for_each_inner_sha_algorithm!((Sha512_256,
"SHA-512/256"(sizes : 128, 32, 16) (insecure_against :), 6));
_for_each_inner_sha_algorithm!((algos(Sha1, "SHA-1"(sizes : 64, 20, 8)
(insecure_against : "collision", "length extension"), 0), (Sha224,
"SHA-224"(sizes : 64, 28, 8) (insecure_against : "length extension"), 1),
(Sha256, "SHA-256"(sizes : 64, 32, 8) (insecure_against : "length extension"),
2), (Sha384, "SHA-384"(sizes : 128, 48, 16) (insecure_against :), 3), (Sha512,
"SHA-512"(sizes : 128, 64, 16) (insecure_against : "length extension"), 4),
(Sha512_224, "SHA-512/224"(sizes : 128, 28, 16) (insecure_against :), 5),
(Sha512_256, "SHA-512/256"(sizes : 128, 32, 16) (insecure_against :), 6)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_wakeup_source {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_wakeup_source { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_wakeup_source!((LpCore, 0));
_for_each_inner_wakeup_source!((Gpio, 2)); _for_each_inner_wakeup_source!((Usb,
3)); _for_each_inner_wakeup_source!((Uart1, 7));
_for_each_inner_wakeup_source!((Uart0, 8)); _for_each_inner_wakeup_source!((Ext1,
12)); _for_each_inner_wakeup_source!((Timer, 13));
_for_each_inner_wakeup_source!((Wifi, 22));
_for_each_inner_wakeup_source!((WifiBeacon, 23));
_for_each_inner_wakeup_source!((Bt, 25));
_for_each_inner_wakeup_source!((all(LpCore, 0), (Gpio, 2), (Usb, 3), (Uart1, 7),
(Uart0, 8), (Ext1, 12), (Timer, 13), (Wifi, 22), (WifiBeacon, 23), (Bt, 25)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_dma_engine { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_dma_engine!(("AHB_GDMA"));
_for_each_inner_dma_engine!(("AXI_GDMA"));
_for_each_inner_dma_engine!((all("AHB_GDMA"), ("AXI_GDMA")));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_dma_channel {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_dma_channel { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH0));
_for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH1));
_for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH2));
_for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH3));
_for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH4));
_for_each_inner_dma_channel!(("AXI_GDMA", DMA_AXI_CH0));
_for_each_inner_dma_channel!(("AXI_GDMA", DMA_AXI_CH1));
_for_each_inner_dma_channel!(("AXI_GDMA", DMA_AXI_CH2));
_for_each_inner_dma_channel!(("AHB_GDMA", any_channel = AhbGdmaChannel));
_for_each_inner_dma_channel!(("AXI_GDMA", any_channel = AxiGdmaChannel));
_for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH0, 0, interrupt_in =
AHB_PDMA_IN_CH0, interrupt_out = AHB_PDMA_OUT_CH0, compatible = [UHCI0, I2S0,
I2S1])); _for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH1, 1, interrupt_in =
AHB_PDMA_IN_CH1, interrupt_out = AHB_PDMA_OUT_CH1, compatible = [UHCI0, I2S0,
I2S1])); _for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH2, 2, interrupt_in =
AHB_PDMA_IN_CH2, interrupt_out = AHB_PDMA_OUT_CH2, compatible = [UHCI0, I2S0,
I2S1])); _for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH3, 3, interrupt_in =
AHB_PDMA_IN_CH3, interrupt_out = AHB_PDMA_OUT_CH3, compatible = [UHCI0, I2S0,
I2S1])); _for_each_inner_dma_channel!(("AHB_GDMA", DMA_CH4, 4, interrupt_in =
AHB_PDMA_IN_CH4, interrupt_out = AHB_PDMA_OUT_CH4, compatible = [UHCI0, I2S0,
I2S1])); _for_each_inner_dma_channel!(("AXI_GDMA", DMA_AXI_CH0, 0, interrupt_in =
AXI_PDMA_IN_CH0, interrupt_out = AXI_PDMA_OUT_CH0, compatible = [LCD_CAM, SPI2,
SPI3, AES, SHA])); _for_each_inner_dma_channel!(("AXI_GDMA", DMA_AXI_CH1, 1,
interrupt_in = AXI_PDMA_IN_CH1, interrupt_out = AXI_PDMA_OUT_CH1, compatible =
[LCD_CAM, SPI2, SPI3, AES, SHA])); _for_each_inner_dma_channel!(("AXI_GDMA",
DMA_AXI_CH2, 2, interrupt_in = AXI_PDMA_IN_CH2, interrupt_out = AXI_PDMA_OUT_CH2,
compatible = [LCD_CAM, SPI2, SPI3, AES, SHA]));
_for_each_inner_dma_channel!((names("AHB_GDMA", DMA_CH0), ("AHB_GDMA", DMA_CH1),
("AHB_GDMA", DMA_CH2), ("AHB_GDMA", DMA_CH3), ("AHB_GDMA", DMA_CH4), ("AXI_GDMA",
DMA_AXI_CH0), ("AXI_GDMA", DMA_AXI_CH1), ("AXI_GDMA", DMA_AXI_CH2)));
_for_each_inner_dma_channel!((separate_any_type("AHB_GDMA", any_channel =
AhbGdmaChannel), ("AXI_GDMA", any_channel = AxiGdmaChannel)));
_for_each_inner_dma_channel!((shared));
_for_each_inner_dma_channel!((split("AHB_GDMA", DMA_CH0, 0, interrupt_in =
AHB_PDMA_IN_CH0, interrupt_out = AHB_PDMA_OUT_CH0, compatible = [UHCI0, I2S0,
I2S1]), ("AHB_GDMA", DMA_CH1, 1, interrupt_in = AHB_PDMA_IN_CH1, interrupt_out =
AHB_PDMA_OUT_CH1, compatible = [UHCI0, I2S0, I2S1]), ("AHB_GDMA", DMA_CH2, 2,
interrupt_in = AHB_PDMA_IN_CH2, interrupt_out = AHB_PDMA_OUT_CH2, compatible =
[UHCI0, I2S0, I2S1]), ("AHB_GDMA", DMA_CH3, 3, interrupt_in = AHB_PDMA_IN_CH3,
interrupt_out = AHB_PDMA_OUT_CH3, compatible = [UHCI0, I2S0, I2S1]), ("AHB_GDMA",
DMA_CH4, 4, interrupt_in = AHB_PDMA_IN_CH4, interrupt_out = AHB_PDMA_OUT_CH4,
compatible = [UHCI0, I2S0, I2S1]), ("AXI_GDMA", DMA_AXI_CH0, 0, interrupt_in =
AXI_PDMA_IN_CH0, interrupt_out = AXI_PDMA_OUT_CH0, compatible = [LCD_CAM, SPI2,
SPI3, AES, SHA]), ("AXI_GDMA", DMA_AXI_CH1, 1, interrupt_in = AXI_PDMA_IN_CH1,
interrupt_out = AXI_PDMA_OUT_CH1, compatible = [LCD_CAM, SPI2, SPI3, AES, SHA]),
("AXI_GDMA", DMA_AXI_CH2, 2, interrupt_in = AXI_PDMA_IN_CH2, interrupt_out =
AXI_PDMA_OUT_CH2, compatible = [LCD_CAM, SPI2, SPI3, AES, SHA])));
_for_each_inner_dma_channel!((no_own_interrupt));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_dma_channel_peri_pair {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_dma_channel_peri_pair { $(($pattern) => $code;)*
($other : tt) => {} } _for_each_inner_dma_channel_peri_pair!(("AHB_GDMA",
DMA_CH0, UHCI0)); _for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH0,
I2S0)); _for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH0, I2S1));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH1, UHCI0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH1, I2S0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH1, I2S1));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH2, UHCI0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH2, I2S0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH2, I2S1));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH3, UHCI0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH3, I2S0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH3, I2S1));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH4, UHCI0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH4, I2S0));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", DMA_CH4, I2S1));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH0, LCD_CAM));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH0, SPI2));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH0, SPI3));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH0, AES));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH0, SHA));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH1, LCD_CAM));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH1, SPI2));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH1, SPI3));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH1, AES));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH1, SHA));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH2, LCD_CAM));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH2, SPI2));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH2, SPI3));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH2, AES));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", DMA_AXI_CH2, SHA));
_for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", any_channel = AhbGdmaChannel,
UHCI0)); _for_each_inner_dma_channel_peri_pair!(("AHB_GDMA", any_channel =
AhbGdmaChannel, I2S0)); _for_each_inner_dma_channel_peri_pair!(("AHB_GDMA",
any_channel = AhbGdmaChannel, I2S1));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", any_channel = AxiGdmaChannel,
LCD_CAM)); _for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", any_channel =
AxiGdmaChannel, SPI2)); _for_each_inner_dma_channel_peri_pair!(("AXI_GDMA",
any_channel = AxiGdmaChannel, SPI3));
_for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", any_channel = AxiGdmaChannel,
AES)); _for_each_inner_dma_channel_peri_pair!(("AXI_GDMA", any_channel =
AxiGdmaChannel, SHA));
_for_each_inner_dma_channel_peri_pair!((channels("AHB_GDMA", DMA_CH0, UHCI0),
("AHB_GDMA", DMA_CH0, I2S0), ("AHB_GDMA", DMA_CH0, I2S1), ("AHB_GDMA", DMA_CH1,
UHCI0), ("AHB_GDMA", DMA_CH1, I2S0), ("AHB_GDMA", DMA_CH1, I2S1), ("AHB_GDMA",
DMA_CH2, UHCI0), ("AHB_GDMA", DMA_CH2, I2S0), ("AHB_GDMA", DMA_CH2, I2S1),
("AHB_GDMA", DMA_CH3, UHCI0), ("AHB_GDMA", DMA_CH3, I2S0), ("AHB_GDMA", DMA_CH3,
I2S1), ("AHB_GDMA", DMA_CH4, UHCI0), ("AHB_GDMA", DMA_CH4, I2S0), ("AHB_GDMA",
DMA_CH4, I2S1), ("AXI_GDMA", DMA_AXI_CH0, LCD_CAM), ("AXI_GDMA", DMA_AXI_CH0,
SPI2), ("AXI_GDMA", DMA_AXI_CH0, SPI3), ("AXI_GDMA", DMA_AXI_CH0, AES),
("AXI_GDMA", DMA_AXI_CH0, SHA), ("AXI_GDMA", DMA_AXI_CH1, LCD_CAM), ("AXI_GDMA",
DMA_AXI_CH1, SPI2), ("AXI_GDMA", DMA_AXI_CH1, SPI3), ("AXI_GDMA", DMA_AXI_CH1,
AES), ("AXI_GDMA", DMA_AXI_CH1, SHA), ("AXI_GDMA", DMA_AXI_CH2, LCD_CAM),
("AXI_GDMA", DMA_AXI_CH2, SPI2), ("AXI_GDMA", DMA_AXI_CH2, SPI3), ("AXI_GDMA",
DMA_AXI_CH2, AES), ("AXI_GDMA", DMA_AXI_CH2, SHA)));
_for_each_inner_dma_channel_peri_pair!((any_channels("AHB_GDMA", any_channel =
AhbGdmaChannel, UHCI0), ("AHB_GDMA", any_channel = AhbGdmaChannel, I2S0),
("AHB_GDMA", any_channel = AhbGdmaChannel, I2S1), ("AXI_GDMA", any_channel =
AxiGdmaChannel, LCD_CAM), ("AXI_GDMA", any_channel = AxiGdmaChannel, SPI2),
("AXI_GDMA", any_channel = AxiGdmaChannel, SPI3), ("AXI_GDMA", any_channel =
AxiGdmaChannel, AES), ("AXI_GDMA", any_channel = AxiGdmaChannel, SHA)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_mem2mem_channel {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_mem2mem_channel { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_mem2mem_channel!(("AHB_GDMA", AhbGdma,
AhbGdmaChannel, DMA_CH0, 9)); _for_each_inner_mem2mem_channel!(("AXI_GDMA",
AxiGdma, AxiGdmaChannel, DMA_AXI_CH0, 6));
_for_each_inner_mem2mem_channel!(("AXI_GDMA", AxiGdma, AxiGdmaChannel,
DMA_AXI_CH1, 7)); _for_each_inner_mem2mem_channel!(("AXI_GDMA", AxiGdma,
AxiGdmaChannel, DMA_AXI_CH2, 8)); _for_each_inner_mem2mem_channel!(("AHB_GDMA",
AhbGdma, AhbGdmaChannel, 0, 9)); _for_each_inner_mem2mem_channel!(("AXI_GDMA",
AxiGdma, AxiGdmaChannel, 0, 6, 1, 7, 2, 8));
_for_each_inner_mem2mem_channel!(("AHB_GDMA", AhbGdma, AhbGdmaChannel));
_for_each_inner_mem2mem_channel!(("AXI_GDMA", AxiGdma, AxiGdmaChannel));
_for_each_inner_mem2mem_channel!((channels("AHB_GDMA", AhbGdma, AhbGdmaChannel,
DMA_CH0, 9), ("AXI_GDMA", AxiGdma, AxiGdmaChannel, DMA_AXI_CH0, 6), ("AXI_GDMA",
AxiGdma, AxiGdmaChannel, DMA_AXI_CH1, 7), ("AXI_GDMA", AxiGdma, AxiGdmaChannel,
DMA_AXI_CH2, 8))); _for_each_inner_mem2mem_channel!((erased("AHB_GDMA", AhbGdma,
AhbGdmaChannel, 0, 9), ("AXI_GDMA", AxiGdma, AxiGdmaChannel, 0, 6, 1, 7, 2, 8)));
_for_each_inner_mem2mem_channel!((engines("AHB_GDMA", AhbGdma, AhbGdmaChannel),
("AXI_GDMA", AxiGdma, AxiGdmaChannel)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! with_aes_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _with_inner_aes_dma_engine { $(($pattern) => $code;)* ($other : tt)
=> {} } _with_inner_aes_dma_engine!(("AXI_GDMA", AxiGdmaChannel));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! with_i2s_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _with_inner_i2s_dma_engine { $(($pattern) => $code;)* ($other : tt)
=> {} } _with_inner_i2s_dma_engine!(("AHB_GDMA", AhbGdmaChannel));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! with_lcd_cam_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _with_inner_lcd_cam_dma_engine { $(($pattern) => $code;)* ($other :
tt) => {} } _with_inner_lcd_cam_dma_engine!(("AXI_GDMA", AxiGdmaChannel));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! with_spi_master_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _with_inner_spi_master_dma_engine { $(($pattern) => $code;)* ($other
: tt) => {} } _with_inner_spi_master_dma_engine!(("AXI_GDMA", AxiGdmaChannel));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! with_spi_slave_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _with_inner_spi_slave_dma_engine { $(($pattern) => $code;)* ($other
: tt) => {} } _with_inner_spi_slave_dma_engine!(("AXI_GDMA", AxiGdmaChannel));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! with_uhci_dma_engine {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _with_inner_uhci_dma_engine { $(($pattern) => $code;)* ($other : tt)
=> {} } _with_inner_uhci_dma_engine!(("AHB_GDMA", AhbGdmaChannel));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_interrupt {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_interrupt { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_interrupt!(([disabled 0] 0));
_for_each_inner_interrupt!(([reserved 0] 1));
_for_each_inner_interrupt!(([reserved 1] 2));
_for_each_inner_interrupt!(([reserved 2] 3));
_for_each_inner_interrupt!(([reserved 3] 4));
_for_each_inner_interrupt!(([reserved 4] 5));
_for_each_inner_interrupt!(([reserved 5] 6));
_for_each_inner_interrupt!(([reserved 6] 7));
_for_each_inner_interrupt!(([reserved 7] 8));
_for_each_inner_interrupt!(([reserved 8] 9));
_for_each_inner_interrupt!(([reserved 9] 10));
_for_each_inner_interrupt!(([reserved 10] 11));
_for_each_inner_interrupt!(([reserved 11] 12));
_for_each_inner_interrupt!(([reserved 12] 13));
_for_each_inner_interrupt!(([reserved 13] 14));
_for_each_inner_interrupt!(([reserved 14] 15));
_for_each_inner_interrupt!(([vector 0] 16)); _for_each_inner_interrupt!(([vector
1] 17)); _for_each_inner_interrupt!(([vector 2] 18));
_for_each_inner_interrupt!(([vector 3] 19)); _for_each_inner_interrupt!(([vector
4] 20)); _for_each_inner_interrupt!(([vector 5] 21));
_for_each_inner_interrupt!(([vector 6] 22)); _for_each_inner_interrupt!(([vector
7] 23)); _for_each_inner_interrupt!(([direct_bindable 0] 24));
_for_each_inner_interrupt!(([direct_bindable 1] 25));
_for_each_inner_interrupt!(([direct_bindable 2] 26));
_for_each_inner_interrupt!(([direct_bindable 3] 27));
_for_each_inner_interrupt!(([direct_bindable 4] 28));
_for_each_inner_interrupt!(([direct_bindable 5] 29));
_for_each_inner_interrupt!(([direct_bindable 6] 30));
_for_each_inner_interrupt!(([direct_bindable 7] 31));
_for_each_inner_interrupt!(([direct_bindable 8] 32));
_for_each_inner_interrupt!(([direct_bindable 9] 33));
_for_each_inner_interrupt!(([direct_bindable 10] 34));
_for_each_inner_interrupt!(([direct_bindable 11] 35));
_for_each_inner_interrupt!(([direct_bindable 12] 36));
_for_each_inner_interrupt!(([direct_bindable 13] 37));
_for_each_inner_interrupt!(([direct_bindable 14] 38));
_for_each_inner_interrupt!(([direct_bindable 15] 39));
_for_each_inner_interrupt!(([direct_bindable 16] 40));
_for_each_inner_interrupt!(([direct_bindable 17] 41));
_for_each_inner_interrupt!(([direct_bindable 18] 42));
_for_each_inner_interrupt!(([direct_bindable 19] 43));
_for_each_inner_interrupt!(([direct_bindable 20] 44));
_for_each_inner_interrupt!(([direct_bindable 21] 45));
_for_each_inner_interrupt!(([direct_bindable 22] 46));
_for_each_inner_interrupt!(([direct_bindable 23] 47));
_for_each_inner_interrupt!((all([disabled 0] 0), ([reserved 0] 1), ([reserved 1]
2), ([reserved 2] 3), ([reserved 3] 4), ([reserved 4] 5), ([reserved 5] 6),
([reserved 6] 7), ([reserved 7] 8), ([reserved 8] 9), ([reserved 9] 10),
([reserved 10] 11), ([reserved 11] 12), ([reserved 12] 13), ([reserved 13] 14),
([reserved 14] 15), ([vector 0] 16), ([vector 1] 17), ([vector 2] 18), ([vector
3] 19), ([vector 4] 20), ([vector 5] 21), ([vector 6] 22), ([vector 7] 23),
([direct_bindable 0] 24), ([direct_bindable 1] 25), ([direct_bindable 2] 26),
([direct_bindable 3] 27), ([direct_bindable 4] 28), ([direct_bindable 5] 29),
([direct_bindable 6] 30), ([direct_bindable 7] 31), ([direct_bindable 8] 32),
([direct_bindable 9] 33), ([direct_bindable 10] 34), ([direct_bindable 11] 35),
([direct_bindable 12] 36), ([direct_bindable 13] 37), ([direct_bindable 14] 38),
([direct_bindable 15] 39), ([direct_bindable 16] 40), ([direct_bindable 17] 41),
([direct_bindable 18] 42), ([direct_bindable 19] 43), ([direct_bindable 20] 44),
([direct_bindable 21] 45), ([direct_bindable 22] 46), ([direct_bindable 23]
47)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_classified_interrupt {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_classified_interrupt { $(($pattern) => $code;)*
($other : tt) => {} } _for_each_inner_classified_interrupt!(([direct_bindable 0]
24)); _for_each_inner_classified_interrupt!(([direct_bindable 1] 25));
_for_each_inner_classified_interrupt!(([direct_bindable 2] 26));
_for_each_inner_classified_interrupt!(([direct_bindable 3] 27));
_for_each_inner_classified_interrupt!(([direct_bindable 4] 28));
_for_each_inner_classified_interrupt!(([direct_bindable 5] 29));
_for_each_inner_classified_interrupt!(([direct_bindable 6] 30));
_for_each_inner_classified_interrupt!(([direct_bindable 7] 31));
_for_each_inner_classified_interrupt!(([direct_bindable 8] 32));
_for_each_inner_classified_interrupt!(([direct_bindable 9] 33));
_for_each_inner_classified_interrupt!(([direct_bindable 10] 34));
_for_each_inner_classified_interrupt!(([direct_bindable 11] 35));
_for_each_inner_classified_interrupt!(([direct_bindable 12] 36));
_for_each_inner_classified_interrupt!(([direct_bindable 13] 37));
_for_each_inner_classified_interrupt!(([direct_bindable 14] 38));
_for_each_inner_classified_interrupt!(([direct_bindable 15] 39));
_for_each_inner_classified_interrupt!(([direct_bindable 16] 40));
_for_each_inner_classified_interrupt!(([direct_bindable 17] 41));
_for_each_inner_classified_interrupt!(([direct_bindable 18] 42));
_for_each_inner_classified_interrupt!(([direct_bindable 19] 43));
_for_each_inner_classified_interrupt!(([direct_bindable 20] 44));
_for_each_inner_classified_interrupt!(([direct_bindable 21] 45));
_for_each_inner_classified_interrupt!(([direct_bindable 22] 46));
_for_each_inner_classified_interrupt!(([direct_bindable 23] 47));
_for_each_inner_classified_interrupt!(([vector 0] 16));
_for_each_inner_classified_interrupt!(([vector 1] 17));
_for_each_inner_classified_interrupt!(([vector 2] 18));
_for_each_inner_classified_interrupt!(([vector 3] 19));
_for_each_inner_classified_interrupt!(([vector 4] 20));
_for_each_inner_classified_interrupt!(([vector 5] 21));
_for_each_inner_classified_interrupt!(([vector 6] 22));
_for_each_inner_classified_interrupt!(([vector 7] 23));
_for_each_inner_classified_interrupt!(([reserved 0] 1));
_for_each_inner_classified_interrupt!(([reserved 1] 2));
_for_each_inner_classified_interrupt!(([reserved 2] 3));
_for_each_inner_classified_interrupt!(([reserved 3] 4));
_for_each_inner_classified_interrupt!(([reserved 4] 5));
_for_each_inner_classified_interrupt!(([reserved 5] 6));
_for_each_inner_classified_interrupt!(([reserved 6] 7));
_for_each_inner_classified_interrupt!(([reserved 7] 8));
_for_each_inner_classified_interrupt!(([reserved 8] 9));
_for_each_inner_classified_interrupt!(([reserved 9] 10));
_for_each_inner_classified_interrupt!(([reserved 10] 11));
_for_each_inner_classified_interrupt!(([reserved 11] 12));
_for_each_inner_classified_interrupt!(([reserved 12] 13));
_for_each_inner_classified_interrupt!(([reserved 13] 14));
_for_each_inner_classified_interrupt!(([reserved 14] 15));
_for_each_inner_classified_interrupt!((direct_bindable([direct_bindable 0] 24),
([direct_bindable 1] 25), ([direct_bindable 2] 26), ([direct_bindable 3] 27),
([direct_bindable 4] 28), ([direct_bindable 5] 29), ([direct_bindable 6] 30),
([direct_bindable 7] 31), ([direct_bindable 8] 32), ([direct_bindable 9] 33),
([direct_bindable 10] 34), ([direct_bindable 11] 35), ([direct_bindable 12] 36),
([direct_bindable 13] 37), ([direct_bindable 14] 38), ([direct_bindable 15] 39),
([direct_bindable 16] 40), ([direct_bindable 17] 41), ([direct_bindable 18] 42),
([direct_bindable 19] 43), ([direct_bindable 20] 44), ([direct_bindable 21] 45),
([direct_bindable 22] 46), ([direct_bindable 23] 47)));
_for_each_inner_classified_interrupt!((vector([vector 0] 16), ([vector 1] 17),
([vector 2] 18), ([vector 3] 19), ([vector 4] 20), ([vector 5] 21), ([vector 6]
22), ([vector 7] 23))); _for_each_inner_classified_interrupt!((reserved([reserved
0] 1), ([reserved 1] 2), ([reserved 2] 3), ([reserved 3] 4), ([reserved 4] 5),
([reserved 5] 6), ([reserved 6] 7), ([reserved 7] 8), ([reserved 8] 9),
([reserved 9] 10), ([reserved 10] 11), ([reserved 11] 12), ([reserved 12] 13),
([reserved 13] 14), ([reserved 14] 15)));
_for_each_inner_classified_interrupt!((context_switch));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_interrupt_priority {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_interrupt_priority { $(($pattern) => $code;)*
($other : tt) => {} } _for_each_inner_interrupt_priority!((0, 1, Priority1,
Level1)); _for_each_inner_interrupt_priority!((1, 2, Priority2, Level2));
_for_each_inner_interrupt_priority!((2, 3, Priority3, Level3));
_for_each_inner_interrupt_priority!((3, 4, Priority4, Level4));
_for_each_inner_interrupt_priority!((4, 5, Priority5, Level5));
_for_each_inner_interrupt_priority!((5, 6, Priority6, Level6));
_for_each_inner_interrupt_priority!((6, 7, Priority7, Level7));
_for_each_inner_interrupt_priority!((7, 8, Priority8, Level8));
_for_each_inner_interrupt_priority!((all(0, 1, Priority1, Level1), (1, 2,
Priority2, Level2), (2, 3, Priority3, Level3), (3, 4, Priority4, Level4), (4, 5,
Priority5, Level5), (5, 6, Priority6, Level6), (6, 7, Priority7, Level7), (7, 8,
Priority8, Level8)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_sw_interrupt {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_sw_interrupt { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_sw_interrupt!((0, FROM_CPU_INTR0,
software_interrupt0)); _for_each_inner_sw_interrupt!((1, FROM_CPU_INTR1,
software_interrupt1)); _for_each_inner_sw_interrupt!((2, FROM_CPU_INTR2,
software_interrupt2)); _for_each_inner_sw_interrupt!((3, FROM_CPU_INTR3,
software_interrupt3)); _for_each_inner_sw_interrupt!((all(0, FROM_CPU_INTR0,
software_interrupt0), (1, FROM_CPU_INTR1, software_interrupt1), (2,
FROM_CPU_INTR2, software_interrupt2), (3, FROM_CPU_INTR3, software_interrupt3)));
};
}
#[macro_export]
macro_rules! define_clock_tree_types {
() => {
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum SdmInstance {
GpioSd = 0,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum I2cInstance {
I2c0 = 0,
I2c1 = 1,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum I2sInstance {
I2s0 = 0,
I2s1 = 1,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum LcdCamInstance {
LcdCam = 0,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RmtInstance {
Rmt = 0,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum SpiInstance {
Spi2 = 0,
Spi3 = 1,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TimgInstance {
Timg0 = 0,
Timg1 = 1,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum UartInstance {
Uart0 = 0,
Uart1 = 1,
Uart2 = 2,
Uart3 = 3,
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum PsramInstance {
Psram = 0,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum CpuRootClkConfig {
Xtal,
Cpll,
RcFast,
PllF240m,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct CpuClkConfig {
divisor: u32,
}
impl CpuClkConfig {
pub const fn new(divisor: u32) -> Self {
::core::assert!(
divisor <= 255,
"`CPU_CLK` divisor must be between 0 and 255 (inclusive)."
);
Self { divisor }
}
pub(crate) fn divisor(self) -> u32 {
self.divisor as u32
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct MemClkConfig {
divisor: u32,
}
impl MemClkConfig {
pub const fn new(divisor: u32) -> Self {
::core::assert!(
divisor <= 1,
"`MEM_CLK` divisor must be between 0 and 1 (inclusive)."
);
Self { divisor }
}
pub(crate) fn divisor(self) -> u32 {
self.divisor as u32
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SysClkConfig {
divisor: u32,
}
impl SysClkConfig {
pub const fn new(divisor: u32) -> Self {
::core::assert!(
divisor <= 255,
"`SYS_CLK` divisor must be between 0 and 255 (inclusive)."
);
Self { divisor }
}
pub(crate) fn divisor(self) -> u32 {
self.divisor as u32
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct ApbClkConfig {
divisor: u32,
}
impl ApbClkConfig {
pub const fn new(divisor: u32) -> Self {
::core::assert!(
divisor <= 255,
"`APB_CLK` divisor must be between 0 and 255 (inclusive)."
);
Self { divisor }
}
pub(crate) fn divisor(self) -> u32 {
self.divisor as u32
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum LpFastClkConfig {
RcFast,
Xtal,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum LpSlowClkConfig {
RcSlow,
#[cfg(use_xtal32k)]
Xtal32k,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum CryptoClkConfig {
Xtal,
RcFast,
PllF240m,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum IomuxFunctionClockSource {
XtalClk,
#[default]
PllF80m,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct IomuxFunctionClockConfig {
source: IomuxFunctionClockSource,
div_num: u32,
}
impl IomuxFunctionClockConfig {
pub const fn new(source: IomuxFunctionClockSource, div_num: u32) -> Self {
::core::assert!(
div_num <= 255,
"`IOMUX_FUNCTION_CLOCK` div_num must be between 0 and 255 (inclusive)."
);
Self { source, div_num }
}
pub(crate) fn source(self) -> IomuxFunctionClockSource {
self.source
}
pub(crate) fn div_num(self) -> u32 {
self.div_num as u32
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TimgCalibrationClockConfig {
RcSlowClk,
RcFastDivClk,
#[cfg(use_xtal32k)]
Xtal32kClk,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum I2cFunctionClockSclk {
#[default]
Xtal,
RcFast,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct I2cFunctionClockConfig {
sclk: I2cFunctionClockSclk,
div_num: u32,
}
impl I2cFunctionClockConfig {
pub const fn new(sclk: I2cFunctionClockSclk, div_num: u32) -> Self {
::core::assert!(
div_num <= 255,
"`I2C0_FUNCTION_CLOCK` div_num must be between 0 and 255 (inclusive)."
);
Self { sclk, div_num }
}
pub(crate) fn sclk(self) -> I2cFunctionClockSclk {
self.sclk
}
pub(crate) fn div_num(self) -> u32 {
self.div_num as u32
}
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum I2sClkSclk {
#[default]
Xtal,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct I2sClkConfig {
sclk: I2sClkSclk,
div_num: u32,
div_a: u32,
div_b: u32,
}
impl I2sClkConfig {
pub const fn new(sclk: I2sClkSclk, div_num: u32, div_a: u32, div_b: u32) -> Self {
::core::assert!(
div_num >= 1 && div_num <= 256,
"`I2S0_TX_CLK` div_num must be between 1 and 256 (inclusive)."
);
::core::assert!(
div_a >= 1 && div_a <= 511,
"`I2S0_TX_CLK` div_a must be between 1 and 511 (inclusive)."
);
::core::assert!(
div_b <= 511,
"`I2S0_TX_CLK` div_b must be between 0 and 511 (inclusive)."
);
Self {
sclk,
div_num,
div_a,
div_b,
}
}
pub(crate) fn sclk(self) -> I2sClkSclk {
self.sclk
}
pub(crate) fn div_num(self) -> u32 {
self.div_num as u32
}
pub(crate) fn div_a(self) -> u32 {
self.div_a as u32
}
pub(crate) fn div_b(self) -> u32 {
self.div_b as u32
}
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum I2sMclkOutConfig {
Tx,
#[default]
Rx,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum LcdCamLcdClockSclk {
#[default]
XtalClk,
PllF160m,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct LcdCamLcdClockConfig {
sclk: LcdCamLcdClockSclk,
div_num: u32,
div_a: u32,
div_b: u32,
}
impl LcdCamLcdClockConfig {
pub const fn new(
sclk: LcdCamLcdClockSclk,
div_num: u32,
div_a: u32,
div_b: u32,
) -> Self {
::core::assert!(
div_num >= 1 && div_num <= 256,
"`LCD_CAM_LCD_CLOCK` div_num must be between 1 and 256 (inclusive)."
);
::core::assert!(
div_a >= 1 && div_a <= 255,
"`LCD_CAM_LCD_CLOCK` div_a must be between 1 and 255 (inclusive)."
);
::core::assert!(
div_b <= 255,
"`LCD_CAM_LCD_CLOCK` div_b must be between 0 and 255 (inclusive)."
);
Self {
sclk,
div_num,
div_a,
div_b,
}
}
pub(crate) fn sclk(self) -> LcdCamLcdClockSclk {
self.sclk
}
pub(crate) fn div_num(self) -> u32 {
self.div_num as u32
}
pub(crate) fn div_a(self) -> u32 {
self.div_a as u32
}
pub(crate) fn div_b(self) -> u32 {
self.div_b as u32
}
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum LcdCamCamClockSclk {
#[default]
XtalClk,
PllF160m,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct LcdCamCamClockConfig {
sclk: LcdCamCamClockSclk,
div_num: u32,
div_a: u32,
div_b: u32,
}
impl LcdCamCamClockConfig {
pub const fn new(
sclk: LcdCamCamClockSclk,
div_num: u32,
div_a: u32,
div_b: u32,
) -> Self {
::core::assert!(
div_num >= 1 && div_num <= 256,
"`LCD_CAM_CAM_CLOCK` div_num must be between 1 and 256 (inclusive)."
);
::core::assert!(
div_a >= 1 && div_a <= 255,
"`LCD_CAM_CAM_CLOCK` div_a must be between 1 and 255 (inclusive)."
);
::core::assert!(
div_b <= 255,
"`LCD_CAM_CAM_CLOCK` div_b must be between 0 and 255 (inclusive)."
);
Self {
sclk,
div_num,
div_a,
div_b,
}
}
pub(crate) fn sclk(self) -> LcdCamCamClockSclk {
self.sclk
}
pub(crate) fn div_num(self) -> u32 {
self.div_num as u32
}
pub(crate) fn div_a(self) -> u32 {
self.div_a as u32
}
pub(crate) fn div_b(self) -> u32 {
self.div_b as u32
}
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum RmtSclkConfig {
#[default]
PllF80m,
RcFastClk,
XtalClk,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum SpiFunctionClockConfig {
#[default]
Bbpll,
Xtal,
RcFast,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TimgFunctionClockConfig {
#[default]
PllF80m,
RcFastClk,
XtalClk,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum TimgWdtClockConfig {
#[default]
XtalClk,
PllF80m,
RcFastClk,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum UartFunctionClockSclk {
#[default]
PllF80m,
Xtal,
RcFast,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct UartFunctionClockConfig {
sclk: UartFunctionClockSclk,
div_num: u32,
}
impl UartFunctionClockConfig {
pub const fn new(sclk: UartFunctionClockSclk, div_num: u32) -> Self {
::core::assert!(
div_num <= 255,
"`UART0_FUNCTION_CLOCK` div_num must be between 0 and 255 (inclusive)."
);
Self { sclk, div_num }
}
pub(crate) fn sclk(self) -> UartFunctionClockSclk {
self.sclk
}
pub(crate) fn div_num(self) -> u32 {
self.div_num as u32
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct UartBaudRateGeneratorConfig {
fractional: u32,
integral: u32,
}
impl UartBaudRateGeneratorConfig {
pub const fn new(fractional: u32, integral: u32) -> Self {
::core::assert!(
fractional <= 15,
"`UART0_BAUD_RATE_GENERATOR` fractional must be between 0 and 15 (inclusive)."
);
::core::assert!(
integral <= 4095,
"`UART0_BAUD_RATE_GENERATOR` integral must be between 0 and 4095 (inclusive)."
);
Self {
fractional,
integral,
}
}
pub(crate) fn fractional(self) -> u32 {
self.fractional as u32
}
pub(crate) fn integral(self) -> u32 {
self.integral as u32
}
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum PsramFunctionClockConfig {
#[default]
Xtal,
Mpll,
Cpll,
}
pub struct ClockTree {
cpu_root_clk: Option<CpuRootClkConfig>,
cpu_clk: Option<CpuClkConfig>,
mem_clk: Option<MemClkConfig>,
sys_clk: Option<SysClkConfig>,
apb_clk: Option<ApbClkConfig>,
lp_fast_clk: Option<LpFastClkConfig>,
lp_slow_clk: Option<LpSlowClkConfig>,
crypto_clk: Option<CryptoClkConfig>,
iomux_function_clock: Option<IomuxFunctionClockConfig>,
timg_calibration_clock: Option<TimgCalibrationClockConfig>,
i2c_function_clock: [Option<I2cFunctionClockConfig>; 2],
i2s_tx_clk: [Option<I2sClkConfig>; 2],
i2s_rx_clk: [Option<I2sClkConfig>; 2],
i2s_mclk_out: [Option<I2sMclkOutConfig>; 2],
lcd_cam_lcd_clock: [Option<LcdCamLcdClockConfig>; 1],
lcd_cam_cam_clock: [Option<LcdCamCamClockConfig>; 1],
rmt_sclk: [Option<RmtSclkConfig>; 1],
spi_function_clock: [Option<SpiFunctionClockConfig>; 2],
timg_function_clock: [Option<TimgFunctionClockConfig>; 2],
timg_wdt_clock: [Option<TimgWdtClockConfig>; 2],
uart_function_clock: [Option<UartFunctionClockConfig>; 4],
uart_baud_rate_generator: [Option<UartBaudRateGeneratorConfig>; 4],
psram_function_clock: [Option<PsramFunctionClockConfig>; 1],
bbpll_clk_refcount: u32,
cpll_clk_refcount: u32,
mpll_clk_refcount: u32,
rc_fast_clk_refcount: u32,
#[cfg(use_xtal32k)]
xtal32k_clk_refcount: u32,
rc_slow_clk_refcount: u32,
pll_f20m_refcount: u32,
pll_f80m_refcount: u32,
pll_f120m_refcount: u32,
pll_f160m_refcount: u32,
pll_f240m_refcount: u32,
bbpll_d3_clock_refcount: u32,
pll_f25m_refcount: u32,
pll_f50m_refcount: u32,
xtal_d2_clk_refcount: u32,
cpu_clk_refcount: u32,
mem_clk_refcount: u32,
lp_fast_clk_refcount: u32,
lp_slow_clk_refcount: u32,
crypto_clk_refcount: u32,
timg_calibration_clock_refcount: u32,
sdm_function_clock_refcount: [u32; 1],
i2c_function_clock_refcount: [u32; 2],
i2s_tx_clk_refcount: [u32; 2],
i2s_rx_clk_refcount: [u32; 2],
i2s_mclk_out_refcount: [u32; 2],
lcd_cam_lcd_clock_refcount: [u32; 1],
lcd_cam_cam_clock_refcount: [u32; 1],
rmt_sclk_refcount: [u32; 1],
spi_function_clock_refcount: [u32; 2],
timg_function_clock_refcount: [u32; 2],
timg_wdt_clock_refcount: [u32; 2],
uart_function_clock_refcount: [u32; 4],
uart_baud_rate_generator_refcount: [u32; 4],
uart_mem_clock_refcount: [u32; 4],
psram_function_clock_refcount: [u32; 1],
}
impl ClockTree {
pub fn with<R>(f: impl FnOnce(&mut ClockTree) -> R) -> R {
CLOCK_TREE.with(f)
}
pub fn cpu_root_clk(&self) -> Option<CpuRootClkConfig> {
self.cpu_root_clk
}
pub fn cpu_clk(&self) -> Option<CpuClkConfig> {
self.cpu_clk
}
pub fn mem_clk(&self) -> Option<MemClkConfig> {
self.mem_clk
}
pub fn sys_clk(&self) -> Option<SysClkConfig> {
self.sys_clk
}
pub fn apb_clk(&self) -> Option<ApbClkConfig> {
self.apb_clk
}
pub fn lp_fast_clk(&self) -> Option<LpFastClkConfig> {
self.lp_fast_clk
}
pub fn lp_slow_clk(&self) -> Option<LpSlowClkConfig> {
self.lp_slow_clk
}
pub fn crypto_clk(&self) -> Option<CryptoClkConfig> {
self.crypto_clk
}
pub fn iomux_function_clock(&self) -> Option<IomuxFunctionClockConfig> {
self.iomux_function_clock
}
pub fn timg_calibration_clock(&self) -> Option<TimgCalibrationClockConfig> {
self.timg_calibration_clock
}
pub fn i2c0_function_clock(&self) -> Option<I2cFunctionClockConfig> {
self.i2c_function_clock[I2cInstance::I2c0 as usize]
}
pub fn i2c1_function_clock(&self) -> Option<I2cFunctionClockConfig> {
self.i2c_function_clock[I2cInstance::I2c1 as usize]
}
pub fn i2s0_tx_clk(&self) -> Option<I2sClkConfig> {
self.i2s_tx_clk[I2sInstance::I2s0 as usize]
}
pub fn i2s0_rx_clk(&self) -> Option<I2sClkConfig> {
self.i2s_rx_clk[I2sInstance::I2s0 as usize]
}
pub fn i2s0_mclk_out(&self) -> Option<I2sMclkOutConfig> {
self.i2s_mclk_out[I2sInstance::I2s0 as usize]
}
pub fn i2s1_tx_clk(&self) -> Option<I2sClkConfig> {
self.i2s_tx_clk[I2sInstance::I2s1 as usize]
}
pub fn i2s1_rx_clk(&self) -> Option<I2sClkConfig> {
self.i2s_rx_clk[I2sInstance::I2s1 as usize]
}
pub fn i2s1_mclk_out(&self) -> Option<I2sMclkOutConfig> {
self.i2s_mclk_out[I2sInstance::I2s1 as usize]
}
pub fn lcd_cam_lcd_clock(&self) -> Option<LcdCamLcdClockConfig> {
self.lcd_cam_lcd_clock[LcdCamInstance::LcdCam as usize]
}
pub fn lcd_cam_cam_clock(&self) -> Option<LcdCamCamClockConfig> {
self.lcd_cam_cam_clock[LcdCamInstance::LcdCam as usize]
}
pub fn rmt_sclk(&self) -> Option<RmtSclkConfig> {
self.rmt_sclk[RmtInstance::Rmt as usize]
}
pub fn spi2_function_clock(&self) -> Option<SpiFunctionClockConfig> {
self.spi_function_clock[SpiInstance::Spi2 as usize]
}
pub fn spi3_function_clock(&self) -> Option<SpiFunctionClockConfig> {
self.spi_function_clock[SpiInstance::Spi3 as usize]
}
pub fn timg0_function_clock(&self) -> Option<TimgFunctionClockConfig> {
self.timg_function_clock[TimgInstance::Timg0 as usize]
}
pub fn timg0_wdt_clock(&self) -> Option<TimgWdtClockConfig> {
self.timg_wdt_clock[TimgInstance::Timg0 as usize]
}
pub fn timg1_function_clock(&self) -> Option<TimgFunctionClockConfig> {
self.timg_function_clock[TimgInstance::Timg1 as usize]
}
pub fn timg1_wdt_clock(&self) -> Option<TimgWdtClockConfig> {
self.timg_wdt_clock[TimgInstance::Timg1 as usize]
}
pub fn uart0_function_clock(&self) -> Option<UartFunctionClockConfig> {
self.uart_function_clock[UartInstance::Uart0 as usize]
}
pub fn uart0_baud_rate_generator(&self) -> Option<UartBaudRateGeneratorConfig> {
self.uart_baud_rate_generator[UartInstance::Uart0 as usize]
}
pub fn uart1_function_clock(&self) -> Option<UartFunctionClockConfig> {
self.uart_function_clock[UartInstance::Uart1 as usize]
}
pub fn uart1_baud_rate_generator(&self) -> Option<UartBaudRateGeneratorConfig> {
self.uart_baud_rate_generator[UartInstance::Uart1 as usize]
}
pub fn uart2_function_clock(&self) -> Option<UartFunctionClockConfig> {
self.uart_function_clock[UartInstance::Uart2 as usize]
}
pub fn uart2_baud_rate_generator(&self) -> Option<UartBaudRateGeneratorConfig> {
self.uart_baud_rate_generator[UartInstance::Uart2 as usize]
}
pub fn uart3_function_clock(&self) -> Option<UartFunctionClockConfig> {
self.uart_function_clock[UartInstance::Uart3 as usize]
}
pub fn uart3_baud_rate_generator(&self) -> Option<UartBaudRateGeneratorConfig> {
self.uart_baud_rate_generator[UartInstance::Uart3 as usize]
}
pub fn psram_function_clock(&self) -> Option<PsramFunctionClockConfig> {
self.psram_function_clock[PsramInstance::Psram as usize]
}
}
static CLOCK_TREE: ::esp_sync::NonReentrantMutex<ClockTree> =
::esp_sync::NonReentrantMutex::new(ClockTree {
cpu_root_clk: None,
cpu_clk: None,
mem_clk: None,
sys_clk: None,
apb_clk: None,
lp_fast_clk: None,
lp_slow_clk: None,
crypto_clk: None,
iomux_function_clock: None,
timg_calibration_clock: None,
i2c_function_clock: [None; 2],
i2s_tx_clk: [None; 2],
i2s_rx_clk: [None; 2],
i2s_mclk_out: [None; 2],
lcd_cam_lcd_clock: [None; 1],
lcd_cam_cam_clock: [None; 1],
rmt_sclk: [None; 1],
spi_function_clock: [None; 2],
timg_function_clock: [None; 2],
timg_wdt_clock: [None; 2],
uart_function_clock: [None; 4],
uart_baud_rate_generator: [None; 4],
psram_function_clock: [None; 1],
bbpll_clk_refcount: 0,
cpll_clk_refcount: 0,
mpll_clk_refcount: 0,
rc_fast_clk_refcount: 0,
#[cfg(use_xtal32k)]
xtal32k_clk_refcount: 0,
rc_slow_clk_refcount: 0,
pll_f20m_refcount: 0,
pll_f80m_refcount: 0,
pll_f120m_refcount: 0,
pll_f160m_refcount: 0,
pll_f240m_refcount: 0,
bbpll_d3_clock_refcount: 0,
pll_f25m_refcount: 0,
pll_f50m_refcount: 0,
xtal_d2_clk_refcount: 0,
cpu_clk_refcount: 0,
mem_clk_refcount: 0,
lp_fast_clk_refcount: 0,
lp_slow_clk_refcount: 0,
crypto_clk_refcount: 0,
timg_calibration_clock_refcount: 0,
sdm_function_clock_refcount: [0; 1],
i2c_function_clock_refcount: [0; 2],
i2s_tx_clk_refcount: [0; 2],
i2s_rx_clk_refcount: [0; 2],
i2s_mclk_out_refcount: [0; 2],
lcd_cam_lcd_clock_refcount: [0; 1],
lcd_cam_cam_clock_refcount: [0; 1],
rmt_sclk_refcount: [0; 1],
spi_function_clock_refcount: [0; 2],
timg_function_clock_refcount: [0; 2],
timg_wdt_clock_refcount: [0; 2],
uart_function_clock_refcount: [0; 4],
uart_baud_rate_generator_refcount: [0; 4],
uart_mem_clock_refcount: [0; 4],
psram_function_clock_refcount: [0; 1],
});
static CPU_ROOT_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static CPU_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static MEM_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static SYS_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static APB_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static LP_FAST_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static LP_SLOW_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static CRYPTO_CLK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static IOMUX_FUNCTION_CLOCK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static TIMG_CALIBRATION_CLOCK_FREQ_CACHE: ::core::sync::atomic::AtomicU32 =
::core::sync::atomic::AtomicU32::new(0);
static I2C_FUNCTION_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static I2S_TX_CLK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static I2S_RX_CLK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static I2S_MCLK_OUT_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static LCD_CAM_LCD_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 1] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 1];
static LCD_CAM_CAM_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 1] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 1];
static RMT_SCLK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 1] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 1];
static SPI_FUNCTION_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static TIMG_FUNCTION_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static TIMG_WDT_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 2] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 2];
static UART_FUNCTION_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 4] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 4];
static UART_BAUD_RATE_GENERATOR_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 4] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 4];
static PSRAM_FUNCTION_CLOCK_FREQ_CACHE: [::core::sync::atomic::AtomicU32; 1] =
[const { ::core::sync::atomic::AtomicU32::new(0) }; 1];
fn request_xtal_clk(_clocks: &mut ClockTree) {}
fn release_xtal_clk(_clocks: &mut ClockTree) {}
pub fn xtal_clk_frequency() -> u32 {
40000000
}
pub fn request_bbpll_clk(clocks: &mut ClockTree) {
trace!("Requesting BBPLL_CLK");
if increment_reference_count(&mut clocks.bbpll_clk_refcount) {
trace!("Enabling BBPLL_CLK");
request_xtal_clk(clocks);
enable_bbpll_clk_impl(clocks, true);
}
}
pub fn release_bbpll_clk(clocks: &mut ClockTree) {
trace!("Releasing BBPLL_CLK");
if decrement_reference_count(&mut clocks.bbpll_clk_refcount) {
trace!("Disabling BBPLL_CLK");
enable_bbpll_clk_impl(clocks, false);
release_xtal_clk(clocks);
}
}
pub fn bbpll_clk_frequency() -> u32 {
(480 * 1000000)
}
pub fn bbpll_clk_source_frequency() -> u32 {
xtal_clk_frequency()
}
pub fn request_cpll_clk(clocks: &mut ClockTree) {
trace!("Requesting CPLL_CLK");
if increment_reference_count(&mut clocks.cpll_clk_refcount) {
trace!("Enabling CPLL_CLK");
request_xtal_clk(clocks);
enable_cpll_clk_impl(clocks, true);
}
}
pub fn release_cpll_clk(clocks: &mut ClockTree) {
trace!("Releasing CPLL_CLK");
if decrement_reference_count(&mut clocks.cpll_clk_refcount) {
trace!("Disabling CPLL_CLK");
enable_cpll_clk_impl(clocks, false);
release_xtal_clk(clocks);
}
}
pub fn cpll_clk_frequency() -> u32 {
(320 * 1000000)
}
pub fn cpll_clk_source_frequency() -> u32 {
xtal_clk_frequency()
}
pub fn request_mpll_clk(clocks: &mut ClockTree) {
trace!("Requesting MPLL_CLK");
if increment_reference_count(&mut clocks.mpll_clk_refcount) {
trace!("Enabling MPLL_CLK");
request_xtal_clk(clocks);
enable_mpll_clk_impl(clocks, true);
}
}
pub fn release_mpll_clk(clocks: &mut ClockTree) {
trace!("Releasing MPLL_CLK");
if decrement_reference_count(&mut clocks.mpll_clk_refcount) {
trace!("Disabling MPLL_CLK");
enable_mpll_clk_impl(clocks, false);
release_xtal_clk(clocks);
}
}
pub fn mpll_clk_frequency() -> u32 {
(500 * 1000000)
}
pub fn mpll_clk_source_frequency() -> u32 {
xtal_clk_frequency()
}
pub fn request_rc_fast_clk(clocks: &mut ClockTree) {
trace!("Requesting RC_FAST_CLK");
if increment_reference_count(&mut clocks.rc_fast_clk_refcount) {
trace!("Enabling RC_FAST_CLK");
enable_rc_fast_clk_impl(clocks, true);
}
}
pub fn release_rc_fast_clk(clocks: &mut ClockTree) {
trace!("Releasing RC_FAST_CLK");
if decrement_reference_count(&mut clocks.rc_fast_clk_refcount) {
trace!("Disabling RC_FAST_CLK");
enable_rc_fast_clk_impl(clocks, false);
}
}
pub fn rc_fast_clk_frequency() -> u32 {
17500000
}
#[cfg(use_xtal32k)]
pub fn request_xtal32k_clk(clocks: &mut ClockTree) {
trace!("Requesting XTAL32K_CLK");
if increment_reference_count(&mut clocks.xtal32k_clk_refcount) {
trace!("Enabling XTAL32K_CLK");
enable_xtal32k_clk_impl(clocks, true);
}
}
#[cfg(use_xtal32k)]
pub fn release_xtal32k_clk(clocks: &mut ClockTree) {
trace!("Releasing XTAL32K_CLK");
if decrement_reference_count(&mut clocks.xtal32k_clk_refcount) {
trace!("Disabling XTAL32K_CLK");
enable_xtal32k_clk_impl(clocks, false);
}
}
#[cfg(use_xtal32k)]
pub fn xtal32k_clk_frequency() -> u32 {
32768
}
pub fn request_rc_slow_clk(clocks: &mut ClockTree) {
trace!("Requesting RC_SLOW_CLK");
if increment_reference_count(&mut clocks.rc_slow_clk_refcount) {
trace!("Enabling RC_SLOW_CLK");
enable_rc_slow_clk_impl(clocks, true);
}
}
pub fn release_rc_slow_clk(clocks: &mut ClockTree) {
trace!("Releasing RC_SLOW_CLK");
if decrement_reference_count(&mut clocks.rc_slow_clk_refcount) {
trace!("Disabling RC_SLOW_CLK");
enable_rc_slow_clk_impl(clocks, false);
}
}
pub fn rc_slow_clk_frequency() -> u32 {
136000
}
pub fn request_pll_f20m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F20M");
if increment_reference_count(&mut clocks.pll_f20m_refcount) {
trace!("Enabling PLL_F20M");
request_bbpll_clk(clocks);
enable_pll_f20m_impl(clocks, true);
}
}
pub fn release_pll_f20m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F20M");
if decrement_reference_count(&mut clocks.pll_f20m_refcount) {
trace!("Disabling PLL_F20M");
enable_pll_f20m_impl(clocks, false);
release_bbpll_clk(clocks);
}
}
pub fn pll_f20m_frequency() -> u32 {
(bbpll_clk_frequency() / 24)
}
pub fn pll_f20m_source_frequency() -> u32 {
bbpll_clk_frequency()
}
pub fn request_pll_f80m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F80M");
if increment_reference_count(&mut clocks.pll_f80m_refcount) {
trace!("Enabling PLL_F80M");
request_bbpll_clk(clocks);
enable_pll_f80m_impl(clocks, true);
}
}
pub fn release_pll_f80m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F80M");
if decrement_reference_count(&mut clocks.pll_f80m_refcount) {
trace!("Disabling PLL_F80M");
enable_pll_f80m_impl(clocks, false);
release_bbpll_clk(clocks);
}
}
pub fn pll_f80m_frequency() -> u32 {
(bbpll_clk_frequency() / 6)
}
pub fn pll_f80m_source_frequency() -> u32 {
bbpll_clk_frequency()
}
pub fn request_pll_f120m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F120M");
if increment_reference_count(&mut clocks.pll_f120m_refcount) {
trace!("Enabling PLL_F120M");
request_bbpll_clk(clocks);
enable_pll_f120m_impl(clocks, true);
}
}
pub fn release_pll_f120m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F120M");
if decrement_reference_count(&mut clocks.pll_f120m_refcount) {
trace!("Disabling PLL_F120M");
enable_pll_f120m_impl(clocks, false);
release_bbpll_clk(clocks);
}
}
pub fn pll_f120m_frequency() -> u32 {
(bbpll_clk_frequency() / 4)
}
pub fn pll_f120m_source_frequency() -> u32 {
bbpll_clk_frequency()
}
pub fn request_pll_f160m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F160M");
if increment_reference_count(&mut clocks.pll_f160m_refcount) {
trace!("Enabling PLL_F160M");
request_bbpll_clk(clocks);
enable_pll_f160m_impl(clocks, true);
}
}
pub fn release_pll_f160m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F160M");
if decrement_reference_count(&mut clocks.pll_f160m_refcount) {
trace!("Disabling PLL_F160M");
enable_pll_f160m_impl(clocks, false);
release_bbpll_clk(clocks);
}
}
pub fn pll_f160m_frequency() -> u32 {
(bbpll_clk_frequency() / 3)
}
pub fn pll_f160m_source_frequency() -> u32 {
bbpll_clk_frequency()
}
pub fn request_pll_f240m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F240M");
if increment_reference_count(&mut clocks.pll_f240m_refcount) {
trace!("Enabling PLL_F240M");
request_bbpll_clk(clocks);
enable_pll_f240m_impl(clocks, true);
}
}
pub fn release_pll_f240m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F240M");
if decrement_reference_count(&mut clocks.pll_f240m_refcount) {
trace!("Disabling PLL_F240M");
enable_pll_f240m_impl(clocks, false);
release_bbpll_clk(clocks);
}
}
pub fn pll_f240m_frequency() -> u32 {
(bbpll_clk_frequency() / 2)
}
pub fn pll_f240m_source_frequency() -> u32 {
bbpll_clk_frequency()
}
pub fn request_bbpll_d3_clock(clocks: &mut ClockTree) {
trace!("Requesting BBPLL_D3_CLOCK");
if increment_reference_count(&mut clocks.bbpll_d3_clock_refcount) {
trace!("Enabling BBPLL_D3_CLOCK");
request_bbpll_clk(clocks);
enable_bbpll_d3_clock_impl(clocks, true);
}
}
pub fn release_bbpll_d3_clock(clocks: &mut ClockTree) {
trace!("Releasing BBPLL_D3_CLOCK");
if decrement_reference_count(&mut clocks.bbpll_d3_clock_refcount) {
trace!("Disabling BBPLL_D3_CLOCK");
enable_bbpll_d3_clock_impl(clocks, false);
release_bbpll_clk(clocks);
}
}
pub fn bbpll_d3_clock_frequency() -> u32 {
(bbpll_clk_frequency() / 3)
}
pub fn bbpll_d3_clock_source_frequency() -> u32 {
bbpll_clk_frequency()
}
pub fn request_pll_f25m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F25M");
if increment_reference_count(&mut clocks.pll_f25m_refcount) {
trace!("Enabling PLL_F25M");
request_mpll_clk(clocks);
enable_pll_f25m_impl(clocks, true);
}
}
pub fn release_pll_f25m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F25M");
if decrement_reference_count(&mut clocks.pll_f25m_refcount) {
trace!("Disabling PLL_F25M");
enable_pll_f25m_impl(clocks, false);
release_mpll_clk(clocks);
}
}
pub fn pll_f25m_frequency() -> u32 {
(mpll_clk_frequency() / 20)
}
pub fn pll_f25m_source_frequency() -> u32 {
mpll_clk_frequency()
}
pub fn request_pll_f50m(clocks: &mut ClockTree) {
trace!("Requesting PLL_F50M");
if increment_reference_count(&mut clocks.pll_f50m_refcount) {
trace!("Enabling PLL_F50M");
request_mpll_clk(clocks);
enable_pll_f50m_impl(clocks, true);
}
}
pub fn release_pll_f50m(clocks: &mut ClockTree) {
trace!("Releasing PLL_F50M");
if decrement_reference_count(&mut clocks.pll_f50m_refcount) {
trace!("Disabling PLL_F50M");
enable_pll_f50m_impl(clocks, false);
release_mpll_clk(clocks);
}
}
pub fn pll_f50m_frequency() -> u32 {
(mpll_clk_frequency() / 10)
}
pub fn pll_f50m_source_frequency() -> u32 {
mpll_clk_frequency()
}
pub fn request_xtal_d2_clk(clocks: &mut ClockTree) {
trace!("Requesting XTAL_D2_CLK");
if increment_reference_count(&mut clocks.xtal_d2_clk_refcount) {
trace!("Enabling XTAL_D2_CLK");
request_xtal_clk(clocks);
enable_xtal_d2_clk_impl(clocks, true);
}
}
pub fn release_xtal_d2_clk(clocks: &mut ClockTree) {
trace!("Releasing XTAL_D2_CLK");
if decrement_reference_count(&mut clocks.xtal_d2_clk_refcount) {
trace!("Disabling XTAL_D2_CLK");
enable_xtal_d2_clk_impl(clocks, false);
release_xtal_clk(clocks);
}
}
pub fn xtal_d2_clk_frequency() -> u32 {
(xtal_clk_frequency() / 2)
}
pub fn xtal_d2_clk_source_frequency() -> u32 {
xtal_clk_frequency()
}
pub fn configure_cpu_root_clk(clocks: &mut ClockTree, new_selector: CpuRootClkConfig) {
let old_selector = clocks.cpu_root_clk.replace(new_selector);
refresh_cpu_root_clk_downstream(clocks);
match new_selector {
CpuRootClkConfig::Xtal => request_xtal_clk(clocks),
CpuRootClkConfig::Cpll => request_cpll_clk(clocks),
CpuRootClkConfig::RcFast => request_rc_fast_clk(clocks),
CpuRootClkConfig::PllF240m => request_pll_f240m(clocks),
}
configure_cpu_root_clk_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
CpuRootClkConfig::Xtal => release_xtal_clk(clocks),
CpuRootClkConfig::Cpll => release_cpll_clk(clocks),
CpuRootClkConfig::RcFast => release_rc_fast_clk(clocks),
CpuRootClkConfig::PllF240m => release_pll_f240m(clocks),
}
}
}
pub fn cpu_root_clk_config(clocks: &mut ClockTree) -> Option<CpuRootClkConfig> {
clocks.cpu_root_clk
}
pub fn request_cpu_root_clk(clocks: &mut ClockTree) {
trace!("Requesting CPU_ROOT_CLK");
trace!("Enabling CPU_ROOT_CLK");
match unwrap!(clocks.cpu_root_clk) {
CpuRootClkConfig::Xtal => request_xtal_clk(clocks),
CpuRootClkConfig::Cpll => request_cpll_clk(clocks),
CpuRootClkConfig::RcFast => request_rc_fast_clk(clocks),
CpuRootClkConfig::PllF240m => request_pll_f240m(clocks),
}
enable_cpu_root_clk_impl(clocks, true);
}
pub fn release_cpu_root_clk(clocks: &mut ClockTree) {
trace!("Releasing CPU_ROOT_CLK");
trace!("Disabling CPU_ROOT_CLK");
enable_cpu_root_clk_impl(clocks, false);
match unwrap!(clocks.cpu_root_clk) {
CpuRootClkConfig::Xtal => release_xtal_clk(clocks),
CpuRootClkConfig::Cpll => release_cpll_clk(clocks),
CpuRootClkConfig::RcFast => release_rc_fast_clk(clocks),
CpuRootClkConfig::PllF240m => release_pll_f240m(clocks),
}
}
#[allow(unused_variables)]
pub fn cpu_root_clk_config_frequency(
clocks: &mut ClockTree,
config: CpuRootClkConfig,
) -> u32 {
match config {
CpuRootClkConfig::Xtal => xtal_clk_frequency(),
CpuRootClkConfig::Cpll => cpll_clk_frequency(),
CpuRootClkConfig::RcFast => rc_fast_clk_frequency(),
CpuRootClkConfig::PllF240m => pll_f240m_frequency(),
}
}
pub fn cpu_root_clk_frequency() -> u32 {
CPU_ROOT_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn cpu_root_clk_source_frequency(source: CpuRootClkConfig) -> u32 {
match source {
CpuRootClkConfig::Xtal => xtal_clk_frequency(),
CpuRootClkConfig::Cpll => cpll_clk_frequency(),
CpuRootClkConfig::RcFast => rc_fast_clk_frequency(),
CpuRootClkConfig::PllF240m => pll_f240m_frequency(),
}
}
pub fn configure_cpu_clk(clocks: &mut ClockTree, config: CpuClkConfig) {
let old_config = clocks.cpu_clk.replace(config);
refresh_cpu_clk_downstream(clocks);
configure_cpu_clk_impl(clocks, old_config, config);
}
pub fn cpu_clk_config(clocks: &mut ClockTree) -> Option<CpuClkConfig> {
clocks.cpu_clk
}
pub fn request_cpu_clk(clocks: &mut ClockTree) {
trace!("Requesting CPU_CLK");
if increment_reference_count(&mut clocks.cpu_clk_refcount) {
trace!("Enabling CPU_CLK");
request_cpu_root_clk(clocks);
enable_cpu_clk_impl(clocks, true);
}
}
pub fn release_cpu_clk(clocks: &mut ClockTree) {
trace!("Releasing CPU_CLK");
if decrement_reference_count(&mut clocks.cpu_clk_refcount) {
trace!("Disabling CPU_CLK");
enable_cpu_clk_impl(clocks, false);
release_cpu_root_clk(clocks);
}
}
#[allow(unused_variables)]
pub fn cpu_clk_config_frequency(clocks: &mut ClockTree, config: CpuClkConfig) -> u32 {
(cpu_root_clk_frequency() / (config.divisor() + 1))
}
pub fn cpu_clk_frequency() -> u32 {
CPU_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn cpu_clk_source_frequency() -> u32 {
cpu_root_clk_frequency()
}
pub fn configure_mem_clk(clocks: &mut ClockTree, config: MemClkConfig) {
let old_config = clocks.mem_clk.replace(config);
refresh_mem_clk_downstream(clocks);
configure_mem_clk_impl(clocks, old_config, config);
}
pub fn mem_clk_config(clocks: &mut ClockTree) -> Option<MemClkConfig> {
clocks.mem_clk
}
pub fn request_mem_clk(clocks: &mut ClockTree) {
trace!("Requesting MEM_CLK");
if increment_reference_count(&mut clocks.mem_clk_refcount) {
trace!("Enabling MEM_CLK");
request_cpu_clk(clocks);
enable_mem_clk_impl(clocks, true);
}
}
pub fn release_mem_clk(clocks: &mut ClockTree) {
trace!("Releasing MEM_CLK");
if decrement_reference_count(&mut clocks.mem_clk_refcount) {
trace!("Disabling MEM_CLK");
enable_mem_clk_impl(clocks, false);
release_cpu_clk(clocks);
}
}
#[allow(unused_variables)]
pub fn mem_clk_config_frequency(clocks: &mut ClockTree, config: MemClkConfig) -> u32 {
(cpu_clk_frequency() / (config.divisor() + 1))
}
pub fn mem_clk_frequency() -> u32 {
MEM_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn mem_clk_source_frequency() -> u32 {
cpu_clk_frequency()
}
pub fn configure_sys_clk(clocks: &mut ClockTree, config: SysClkConfig) {
let old_config = clocks.sys_clk.replace(config);
refresh_sys_clk_downstream(clocks);
configure_sys_clk_impl(clocks, old_config, config);
}
pub fn sys_clk_config(clocks: &mut ClockTree) -> Option<SysClkConfig> {
clocks.sys_clk
}
pub fn request_sys_clk(clocks: &mut ClockTree) {
trace!("Requesting SYS_CLK");
trace!("Enabling SYS_CLK");
request_cpu_clk(clocks);
enable_sys_clk_impl(clocks, true);
}
pub fn release_sys_clk(clocks: &mut ClockTree) {
trace!("Releasing SYS_CLK");
trace!("Disabling SYS_CLK");
enable_sys_clk_impl(clocks, false);
release_cpu_clk(clocks);
}
#[allow(unused_variables)]
pub fn sys_clk_config_frequency(clocks: &mut ClockTree, config: SysClkConfig) -> u32 {
(cpu_clk_frequency() / (config.divisor() + 1))
}
pub fn sys_clk_frequency() -> u32 {
SYS_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn sys_clk_source_frequency() -> u32 {
cpu_clk_frequency()
}
pub fn configure_apb_clk(clocks: &mut ClockTree, config: ApbClkConfig) {
let old_config = clocks.apb_clk.replace(config);
refresh_apb_clk_downstream(clocks);
configure_apb_clk_impl(clocks, old_config, config);
}
pub fn apb_clk_config(clocks: &mut ClockTree) -> Option<ApbClkConfig> {
clocks.apb_clk
}
fn request_apb_clk(_clocks: &mut ClockTree) {}
fn release_apb_clk(_clocks: &mut ClockTree) {}
#[allow(unused_variables)]
pub fn apb_clk_config_frequency(clocks: &mut ClockTree, config: ApbClkConfig) -> u32 {
(sys_clk_frequency() / (config.divisor() + 1))
}
pub fn apb_clk_frequency() -> u32 {
APB_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn apb_clk_source_frequency() -> u32 {
sys_clk_frequency()
}
pub fn configure_lp_fast_clk(clocks: &mut ClockTree, new_selector: LpFastClkConfig) {
let old_selector = clocks.lp_fast_clk.replace(new_selector);
refresh_lp_fast_clk_downstream(clocks);
if clocks.lp_fast_clk_refcount > 0 {
match new_selector {
LpFastClkConfig::RcFast => request_rc_fast_clk(clocks),
LpFastClkConfig::Xtal => request_xtal_clk(clocks),
}
configure_lp_fast_clk_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
LpFastClkConfig::RcFast => release_rc_fast_clk(clocks),
LpFastClkConfig::Xtal => release_xtal_clk(clocks),
}
}
} else {
configure_lp_fast_clk_impl(clocks, old_selector, new_selector);
}
}
pub fn lp_fast_clk_config(clocks: &mut ClockTree) -> Option<LpFastClkConfig> {
clocks.lp_fast_clk
}
pub fn request_lp_fast_clk(clocks: &mut ClockTree) {
trace!("Requesting LP_FAST_CLK");
if increment_reference_count(&mut clocks.lp_fast_clk_refcount) {
trace!("Enabling LP_FAST_CLK");
match unwrap!(clocks.lp_fast_clk) {
LpFastClkConfig::RcFast => request_rc_fast_clk(clocks),
LpFastClkConfig::Xtal => request_xtal_clk(clocks),
}
enable_lp_fast_clk_impl(clocks, true);
}
}
pub fn release_lp_fast_clk(clocks: &mut ClockTree) {
trace!("Releasing LP_FAST_CLK");
if decrement_reference_count(&mut clocks.lp_fast_clk_refcount) {
trace!("Disabling LP_FAST_CLK");
enable_lp_fast_clk_impl(clocks, false);
match unwrap!(clocks.lp_fast_clk) {
LpFastClkConfig::RcFast => release_rc_fast_clk(clocks),
LpFastClkConfig::Xtal => release_xtal_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn lp_fast_clk_config_frequency(
clocks: &mut ClockTree,
config: LpFastClkConfig,
) -> u32 {
match config {
LpFastClkConfig::RcFast => rc_fast_clk_frequency(),
LpFastClkConfig::Xtal => xtal_clk_frequency(),
}
}
pub fn lp_fast_clk_frequency() -> u32 {
LP_FAST_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn lp_fast_clk_source_frequency(source: LpFastClkConfig) -> u32 {
match source {
LpFastClkConfig::RcFast => rc_fast_clk_frequency(),
LpFastClkConfig::Xtal => xtal_clk_frequency(),
}
}
pub fn configure_lp_slow_clk(clocks: &mut ClockTree, new_selector: LpSlowClkConfig) {
let old_selector = clocks.lp_slow_clk.replace(new_selector);
refresh_lp_slow_clk_downstream(clocks);
if clocks.lp_slow_clk_refcount > 0 {
match new_selector {
LpSlowClkConfig::RcSlow => request_rc_slow_clk(clocks),
#[cfg(use_xtal32k)]
LpSlowClkConfig::Xtal32k => request_xtal32k_clk(clocks),
}
configure_lp_slow_clk_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
LpSlowClkConfig::RcSlow => release_rc_slow_clk(clocks),
#[cfg(use_xtal32k)]
LpSlowClkConfig::Xtal32k => release_xtal32k_clk(clocks),
}
}
} else {
configure_lp_slow_clk_impl(clocks, old_selector, new_selector);
}
}
pub fn lp_slow_clk_config(clocks: &mut ClockTree) -> Option<LpSlowClkConfig> {
clocks.lp_slow_clk
}
pub fn request_lp_slow_clk(clocks: &mut ClockTree) {
trace!("Requesting LP_SLOW_CLK");
if increment_reference_count(&mut clocks.lp_slow_clk_refcount) {
trace!("Enabling LP_SLOW_CLK");
match unwrap!(clocks.lp_slow_clk) {
LpSlowClkConfig::RcSlow => request_rc_slow_clk(clocks),
#[cfg(use_xtal32k)]
LpSlowClkConfig::Xtal32k => request_xtal32k_clk(clocks),
}
enable_lp_slow_clk_impl(clocks, true);
}
}
pub fn release_lp_slow_clk(clocks: &mut ClockTree) {
trace!("Releasing LP_SLOW_CLK");
if decrement_reference_count(&mut clocks.lp_slow_clk_refcount) {
trace!("Disabling LP_SLOW_CLK");
enable_lp_slow_clk_impl(clocks, false);
match unwrap!(clocks.lp_slow_clk) {
LpSlowClkConfig::RcSlow => release_rc_slow_clk(clocks),
#[cfg(use_xtal32k)]
LpSlowClkConfig::Xtal32k => release_xtal32k_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn lp_slow_clk_config_frequency(
clocks: &mut ClockTree,
config: LpSlowClkConfig,
) -> u32 {
match config {
LpSlowClkConfig::RcSlow => rc_slow_clk_frequency(),
#[cfg(use_xtal32k)]
LpSlowClkConfig::Xtal32k => xtal32k_clk_frequency(),
}
}
pub fn lp_slow_clk_frequency() -> u32 {
LP_SLOW_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn lp_slow_clk_source_frequency(source: LpSlowClkConfig) -> u32 {
match source {
LpSlowClkConfig::RcSlow => rc_slow_clk_frequency(),
#[cfg(use_xtal32k)]
LpSlowClkConfig::Xtal32k => xtal32k_clk_frequency(),
}
}
pub fn configure_crypto_clk(clocks: &mut ClockTree, new_selector: CryptoClkConfig) {
let old_selector = clocks.crypto_clk.replace(new_selector);
refresh_crypto_clk_downstream(clocks);
if clocks.crypto_clk_refcount > 0 {
match new_selector {
CryptoClkConfig::Xtal => request_xtal_clk(clocks),
CryptoClkConfig::RcFast => request_rc_fast_clk(clocks),
CryptoClkConfig::PllF240m => request_pll_f240m(clocks),
}
configure_crypto_clk_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
CryptoClkConfig::Xtal => release_xtal_clk(clocks),
CryptoClkConfig::RcFast => release_rc_fast_clk(clocks),
CryptoClkConfig::PllF240m => release_pll_f240m(clocks),
}
}
} else {
configure_crypto_clk_impl(clocks, old_selector, new_selector);
}
}
pub fn crypto_clk_config(clocks: &mut ClockTree) -> Option<CryptoClkConfig> {
clocks.crypto_clk
}
pub fn request_crypto_clk(clocks: &mut ClockTree) {
trace!("Requesting CRYPTO_CLK");
if increment_reference_count(&mut clocks.crypto_clk_refcount) {
trace!("Enabling CRYPTO_CLK");
match unwrap!(clocks.crypto_clk) {
CryptoClkConfig::Xtal => request_xtal_clk(clocks),
CryptoClkConfig::RcFast => request_rc_fast_clk(clocks),
CryptoClkConfig::PllF240m => request_pll_f240m(clocks),
}
enable_crypto_clk_impl(clocks, true);
}
}
pub fn release_crypto_clk(clocks: &mut ClockTree) {
trace!("Releasing CRYPTO_CLK");
if decrement_reference_count(&mut clocks.crypto_clk_refcount) {
trace!("Disabling CRYPTO_CLK");
enable_crypto_clk_impl(clocks, false);
match unwrap!(clocks.crypto_clk) {
CryptoClkConfig::Xtal => release_xtal_clk(clocks),
CryptoClkConfig::RcFast => release_rc_fast_clk(clocks),
CryptoClkConfig::PllF240m => release_pll_f240m(clocks),
}
}
}
#[allow(unused_variables)]
pub fn crypto_clk_config_frequency(clocks: &mut ClockTree, config: CryptoClkConfig) -> u32 {
match config {
CryptoClkConfig::Xtal => xtal_clk_frequency(),
CryptoClkConfig::RcFast => rc_fast_clk_frequency(),
CryptoClkConfig::PllF240m => pll_f240m_frequency(),
}
}
pub fn crypto_clk_frequency() -> u32 {
CRYPTO_CLK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn crypto_clk_source_frequency(source: CryptoClkConfig) -> u32 {
match source {
CryptoClkConfig::Xtal => xtal_clk_frequency(),
CryptoClkConfig::RcFast => rc_fast_clk_frequency(),
CryptoClkConfig::PllF240m => pll_f240m_frequency(),
}
}
pub fn configure_iomux_function_clock(
clocks: &mut ClockTree,
config: IomuxFunctionClockConfig,
) {
let old_config = clocks.iomux_function_clock.replace(config);
refresh_iomux_function_clock_downstream(clocks);
match config.source {
IomuxFunctionClockSource::XtalClk => request_xtal_clk(clocks),
IomuxFunctionClockSource::PllF80m => request_pll_f80m(clocks),
}
configure_iomux_function_clock_impl(clocks, old_config, config);
if let Some(old_config) = old_config {
match old_config.source {
IomuxFunctionClockSource::XtalClk => release_xtal_clk(clocks),
IomuxFunctionClockSource::PllF80m => release_pll_f80m(clocks),
}
}
}
pub fn iomux_function_clock_config(
clocks: &mut ClockTree,
) -> Option<IomuxFunctionClockConfig> {
clocks.iomux_function_clock
}
fn request_iomux_function_clock(_clocks: &mut ClockTree) {}
fn release_iomux_function_clock(_clocks: &mut ClockTree) {}
#[allow(unused_variables)]
pub fn iomux_function_clock_config_frequency(
clocks: &mut ClockTree,
config: IomuxFunctionClockConfig,
) -> u32 {
(match config.source {
IomuxFunctionClockSource::XtalClk => xtal_clk_frequency(),
IomuxFunctionClockSource::PllF80m => pll_f80m_frequency(),
} / (config.div_num() + 1))
}
pub fn iomux_function_clock_frequency() -> u32 {
IOMUX_FUNCTION_CLOCK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn iomux_function_clock_source_frequency(source: IomuxFunctionClockSource) -> u32 {
match source {
IomuxFunctionClockSource::XtalClk => xtal_clk_frequency(),
IomuxFunctionClockSource::PllF80m => pll_f80m_frequency(),
}
}
pub fn configure_timg_calibration_clock(
clocks: &mut ClockTree,
new_selector: TimgCalibrationClockConfig,
) {
let old_selector = clocks.timg_calibration_clock.replace(new_selector);
refresh_timg_calibration_clock_downstream(clocks);
if clocks.timg_calibration_clock_refcount > 0 {
match new_selector {
TimgCalibrationClockConfig::RcSlowClk => request_rc_slow_clk(clocks),
TimgCalibrationClockConfig::RcFastDivClk => request_rc_fast_clk(clocks),
#[cfg(use_xtal32k)]
TimgCalibrationClockConfig::Xtal32kClk => request_xtal32k_clk(clocks),
}
configure_timg_calibration_clock_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
TimgCalibrationClockConfig::RcSlowClk => release_rc_slow_clk(clocks),
TimgCalibrationClockConfig::RcFastDivClk => release_rc_fast_clk(clocks),
#[cfg(use_xtal32k)]
TimgCalibrationClockConfig::Xtal32kClk => release_xtal32k_clk(clocks),
}
}
} else {
configure_timg_calibration_clock_impl(clocks, old_selector, new_selector);
}
}
pub fn timg_calibration_clock_config(
clocks: &mut ClockTree,
) -> Option<TimgCalibrationClockConfig> {
clocks.timg_calibration_clock
}
pub fn request_timg_calibration_clock(clocks: &mut ClockTree) {
trace!("Requesting TIMG_CALIBRATION_CLOCK");
if increment_reference_count(&mut clocks.timg_calibration_clock_refcount) {
trace!("Enabling TIMG_CALIBRATION_CLOCK");
crate::rtc_cntl::WakeLock::acquire();
match unwrap!(clocks.timg_calibration_clock) {
TimgCalibrationClockConfig::RcSlowClk => request_rc_slow_clk(clocks),
TimgCalibrationClockConfig::RcFastDivClk => request_rc_fast_clk(clocks),
#[cfg(use_xtal32k)]
TimgCalibrationClockConfig::Xtal32kClk => request_xtal32k_clk(clocks),
}
enable_timg_calibration_clock_impl(clocks, true);
}
}
pub fn release_timg_calibration_clock(clocks: &mut ClockTree) {
trace!("Releasing TIMG_CALIBRATION_CLOCK");
if decrement_reference_count(&mut clocks.timg_calibration_clock_refcount) {
trace!("Disabling TIMG_CALIBRATION_CLOCK");
crate::rtc_cntl::WakeLock::release();
enable_timg_calibration_clock_impl(clocks, false);
match unwrap!(clocks.timg_calibration_clock) {
TimgCalibrationClockConfig::RcSlowClk => release_rc_slow_clk(clocks),
TimgCalibrationClockConfig::RcFastDivClk => release_rc_fast_clk(clocks),
#[cfg(use_xtal32k)]
TimgCalibrationClockConfig::Xtal32kClk => release_xtal32k_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn timg_calibration_clock_config_frequency(
clocks: &mut ClockTree,
config: TimgCalibrationClockConfig,
) -> u32 {
match config {
TimgCalibrationClockConfig::RcSlowClk => rc_slow_clk_frequency(),
TimgCalibrationClockConfig::RcFastDivClk => rc_fast_clk_frequency(),
#[cfg(use_xtal32k)]
TimgCalibrationClockConfig::Xtal32kClk => xtal32k_clk_frequency(),
}
}
pub fn timg_calibration_clock_frequency() -> u32 {
TIMG_CALIBRATION_CLOCK_FREQ_CACHE.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn timg_calibration_clock_source_frequency(source: TimgCalibrationClockConfig) -> u32 {
match source {
TimgCalibrationClockConfig::RcSlowClk => rc_slow_clk_frequency(),
TimgCalibrationClockConfig::RcFastDivClk => rc_fast_clk_frequency(),
#[cfg(use_xtal32k)]
TimgCalibrationClockConfig::Xtal32kClk => xtal32k_clk_frequency(),
}
}
impl SdmInstance {
pub fn request_function_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::FUNCTION_CLOCK", self);
if increment_reference_count(&mut clocks.sdm_function_clock_refcount[self as usize])
{
trace!("Enabling {:?}::FUNCTION_CLOCK", self);
request_iomux_function_clock(clocks);
self.enable_function_clock_impl(clocks, true);
}
}
pub fn release_function_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::FUNCTION_CLOCK", self);
if decrement_reference_count(&mut clocks.sdm_function_clock_refcount[self as usize])
{
trace!("Disabling {:?}::FUNCTION_CLOCK", self);
self.enable_function_clock_impl(clocks, false);
release_iomux_function_clock(clocks);
}
}
pub fn function_clock_frequency(self) -> u32 {
iomux_function_clock_frequency()
}
pub fn function_clock_source_frequency() -> u32 {
iomux_function_clock_frequency()
}
}
impl I2cInstance {
pub fn configure_function_clock(
self,
clocks: &mut ClockTree,
config: I2cFunctionClockConfig,
) {
let old_config = clocks.i2c_function_clock[self as usize].replace(config);
refresh_i2c_function_clock_downstream(clocks, self);
if clocks.i2c_function_clock_refcount[self as usize] > 0 {
match config.sclk {
I2cFunctionClockSclk::Xtal => request_xtal_clk(clocks),
I2cFunctionClockSclk::RcFast => request_rc_fast_clk(clocks),
}
self.configure_function_clock_impl(clocks, old_config, config);
if let Some(old_config) = old_config {
match old_config.sclk {
I2cFunctionClockSclk::Xtal => release_xtal_clk(clocks),
I2cFunctionClockSclk::RcFast => release_rc_fast_clk(clocks),
}
}
} else {
self.configure_function_clock_impl(clocks, old_config, config);
}
}
pub fn function_clock_config(
self,
clocks: &mut ClockTree,
) -> Option<I2cFunctionClockConfig> {
clocks.i2c_function_clock[self as usize]
}
pub fn request_function_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::FUNCTION_CLOCK", self);
if increment_reference_count(&mut clocks.i2c_function_clock_refcount[self as usize])
{
trace!("Enabling {:?}::FUNCTION_CLOCK", self);
match unwrap!(clocks.i2c_function_clock[self as usize]).sclk {
I2cFunctionClockSclk::Xtal => request_xtal_clk(clocks),
I2cFunctionClockSclk::RcFast => request_rc_fast_clk(clocks),
}
self.enable_function_clock_impl(clocks, true);
}
}
pub fn release_function_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::FUNCTION_CLOCK", self);
if decrement_reference_count(&mut clocks.i2c_function_clock_refcount[self as usize])
{
trace!("Disabling {:?}::FUNCTION_CLOCK", self);
self.enable_function_clock_impl(clocks, false);
match unwrap!(clocks.i2c_function_clock[self as usize]).sclk {
I2cFunctionClockSclk::Xtal => release_xtal_clk(clocks),
I2cFunctionClockSclk::RcFast => release_rc_fast_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn function_clock_config_frequency(
clocks: &mut ClockTree,
config: I2cFunctionClockConfig,
) -> u32 {
(match config.sclk {
I2cFunctionClockSclk::Xtal => xtal_clk_frequency(),
I2cFunctionClockSclk::RcFast => rc_fast_clk_frequency(),
} / (config.div_num() + 1))
}
pub fn function_clock_frequency(self) -> u32 {
I2C_FUNCTION_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn function_clock_source_frequency(sclk: I2cFunctionClockSclk) -> u32 {
match sclk {
I2cFunctionClockSclk::Xtal => xtal_clk_frequency(),
I2cFunctionClockSclk::RcFast => rc_fast_clk_frequency(),
}
}
}
impl I2sInstance {
pub fn configure_tx_clk(self, clocks: &mut ClockTree, config: I2sClkConfig) {
let old_config = clocks.i2s_tx_clk[self as usize].replace(config);
refresh_i2s_tx_clk_downstream(clocks, self);
self.configure_tx_clk_impl(clocks, old_config, config);
}
pub fn tx_clk_config(self, clocks: &mut ClockTree) -> Option<I2sClkConfig> {
clocks.i2s_tx_clk[self as usize]
}
pub fn request_tx_clk(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::TX_CLK", self);
if increment_reference_count(&mut clocks.i2s_tx_clk_refcount[self as usize]) {
trace!("Enabling {:?}::TX_CLK", self);
crate::rtc_cntl::WakeLock::acquire();
match unwrap!(clocks.i2s_tx_clk[self as usize]).sclk {
I2sClkSclk::Xtal => request_xtal_clk(clocks),
}
self.enable_tx_clk_impl(clocks, true);
}
}
pub fn release_tx_clk(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::TX_CLK", self);
if decrement_reference_count(&mut clocks.i2s_tx_clk_refcount[self as usize]) {
trace!("Disabling {:?}::TX_CLK", self);
crate::rtc_cntl::WakeLock::release();
self.enable_tx_clk_impl(clocks, false);
match unwrap!(clocks.i2s_tx_clk[self as usize]).sclk {
I2sClkSclk::Xtal => release_xtal_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn tx_clk_config_frequency(clocks: &mut ClockTree, config: I2sClkConfig) -> u32 {
(((xtal_clk_frequency() as u64) * (config.div_a() as u64))
/ (((config.div_num() * config.div_a()) + config.div_b()) as u64))
as u32
}
pub fn tx_clk_frequency(self) -> u32 {
I2S_TX_CLK_FREQ_CACHE[self as usize].load(::core::sync::atomic::Ordering::Acquire)
}
pub fn tx_clk_source_frequency(sclk: I2sClkSclk) -> u32 {
match sclk {
I2sClkSclk::Xtal => xtal_clk_frequency(),
}
}
pub fn configure_rx_clk(self, clocks: &mut ClockTree, config: I2sClkConfig) {
let old_config = clocks.i2s_rx_clk[self as usize].replace(config);
refresh_i2s_rx_clk_downstream(clocks, self);
self.configure_rx_clk_impl(clocks, old_config, config);
}
pub fn rx_clk_config(self, clocks: &mut ClockTree) -> Option<I2sClkConfig> {
clocks.i2s_rx_clk[self as usize]
}
pub fn request_rx_clk(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::RX_CLK", self);
if increment_reference_count(&mut clocks.i2s_rx_clk_refcount[self as usize]) {
trace!("Enabling {:?}::RX_CLK", self);
crate::rtc_cntl::WakeLock::acquire();
match unwrap!(clocks.i2s_rx_clk[self as usize]).sclk {
I2sClkSclk::Xtal => request_xtal_clk(clocks),
}
self.enable_rx_clk_impl(clocks, true);
}
}
pub fn release_rx_clk(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::RX_CLK", self);
if decrement_reference_count(&mut clocks.i2s_rx_clk_refcount[self as usize]) {
trace!("Disabling {:?}::RX_CLK", self);
crate::rtc_cntl::WakeLock::release();
self.enable_rx_clk_impl(clocks, false);
match unwrap!(clocks.i2s_rx_clk[self as usize]).sclk {
I2sClkSclk::Xtal => release_xtal_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn rx_clk_config_frequency(clocks: &mut ClockTree, config: I2sClkConfig) -> u32 {
(((xtal_clk_frequency() as u64) * (config.div_a() as u64))
/ (((config.div_num() * config.div_a()) + config.div_b()) as u64))
as u32
}
pub fn rx_clk_frequency(self) -> u32 {
I2S_RX_CLK_FREQ_CACHE[self as usize].load(::core::sync::atomic::Ordering::Acquire)
}
pub fn rx_clk_source_frequency(sclk: I2sClkSclk) -> u32 {
match sclk {
I2sClkSclk::Xtal => xtal_clk_frequency(),
}
}
pub fn configure_mclk_out(
self,
clocks: &mut ClockTree,
new_selector: I2sMclkOutConfig,
) {
let old_selector = clocks.i2s_mclk_out[self as usize].replace(new_selector);
refresh_i2s_mclk_out_downstream(clocks, self);
if clocks.i2s_mclk_out_refcount[self as usize] > 0 {
match new_selector {
I2sMclkOutConfig::Tx => self.request_tx_clk(clocks),
I2sMclkOutConfig::Rx => self.request_rx_clk(clocks),
}
self.configure_mclk_out_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
I2sMclkOutConfig::Tx => self.release_tx_clk(clocks),
I2sMclkOutConfig::Rx => self.release_rx_clk(clocks),
}
}
} else {
self.configure_mclk_out_impl(clocks, old_selector, new_selector);
}
}
pub fn mclk_out_config(self, clocks: &mut ClockTree) -> Option<I2sMclkOutConfig> {
clocks.i2s_mclk_out[self as usize]
}
pub fn request_mclk_out(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::MCLK_OUT", self);
if increment_reference_count(&mut clocks.i2s_mclk_out_refcount[self as usize]) {
trace!("Enabling {:?}::MCLK_OUT", self);
match unwrap!(clocks.i2s_mclk_out[self as usize]) {
I2sMclkOutConfig::Tx => self.request_tx_clk(clocks),
I2sMclkOutConfig::Rx => self.request_rx_clk(clocks),
}
self.enable_mclk_out_impl(clocks, true);
}
}
pub fn release_mclk_out(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::MCLK_OUT", self);
if decrement_reference_count(&mut clocks.i2s_mclk_out_refcount[self as usize]) {
trace!("Disabling {:?}::MCLK_OUT", self);
self.enable_mclk_out_impl(clocks, false);
match unwrap!(clocks.i2s_mclk_out[self as usize]) {
I2sMclkOutConfig::Tx => self.release_tx_clk(clocks),
I2sMclkOutConfig::Rx => self.release_rx_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn mclk_out_config_frequency(
self,
clocks: &mut ClockTree,
config: I2sMclkOutConfig,
) -> u32 {
match config {
I2sMclkOutConfig::Tx => self.tx_clk_frequency(),
I2sMclkOutConfig::Rx => self.rx_clk_frequency(),
}
}
pub fn mclk_out_frequency(self) -> u32 {
I2S_MCLK_OUT_FREQ_CACHE[self as usize].load(::core::sync::atomic::Ordering::Acquire)
}
}
impl LcdCamInstance {
pub fn configure_lcd_clock(self, clocks: &mut ClockTree, config: LcdCamLcdClockConfig) {
let old_config = clocks.lcd_cam_lcd_clock[self as usize].replace(config);
refresh_lcd_cam_lcd_clock_downstream(clocks, self);
if clocks.lcd_cam_lcd_clock_refcount[self as usize] > 0 {
match config.sclk {
LcdCamLcdClockSclk::XtalClk => request_xtal_clk(clocks),
LcdCamLcdClockSclk::PllF160m => request_pll_f160m(clocks),
}
self.configure_lcd_clock_impl(clocks, old_config, config);
if let Some(old_config) = old_config {
match old_config.sclk {
LcdCamLcdClockSclk::XtalClk => release_xtal_clk(clocks),
LcdCamLcdClockSclk::PllF160m => release_pll_f160m(clocks),
}
}
} else {
self.configure_lcd_clock_impl(clocks, old_config, config);
}
}
pub fn lcd_clock_config(self, clocks: &mut ClockTree) -> Option<LcdCamLcdClockConfig> {
clocks.lcd_cam_lcd_clock[self as usize]
}
pub fn request_lcd_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::LCD_CLOCK", self);
if increment_reference_count(&mut clocks.lcd_cam_lcd_clock_refcount[self as usize])
{
trace!("Enabling {:?}::LCD_CLOCK", self);
crate::rtc_cntl::WakeLock::acquire();
match unwrap!(clocks.lcd_cam_lcd_clock[self as usize]).sclk {
LcdCamLcdClockSclk::XtalClk => request_xtal_clk(clocks),
LcdCamLcdClockSclk::PllF160m => request_pll_f160m(clocks),
}
self.enable_lcd_clock_impl(clocks, true);
}
}
pub fn release_lcd_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::LCD_CLOCK", self);
if decrement_reference_count(&mut clocks.lcd_cam_lcd_clock_refcount[self as usize])
{
trace!("Disabling {:?}::LCD_CLOCK", self);
crate::rtc_cntl::WakeLock::release();
self.enable_lcd_clock_impl(clocks, false);
match unwrap!(clocks.lcd_cam_lcd_clock[self as usize]).sclk {
LcdCamLcdClockSclk::XtalClk => release_xtal_clk(clocks),
LcdCamLcdClockSclk::PllF160m => release_pll_f160m(clocks),
}
}
}
#[allow(unused_variables)]
pub fn lcd_clock_config_frequency(
clocks: &mut ClockTree,
config: LcdCamLcdClockConfig,
) -> u32 {
(((match config.sclk {
LcdCamLcdClockSclk::XtalClk => xtal_clk_frequency(),
LcdCamLcdClockSclk::PllF160m => pll_f160m_frequency(),
} as u64)
* (config.div_a() as u64))
/ (((config.div_num() * config.div_a()) + config.div_b()) as u64))
as u32
}
pub fn lcd_clock_frequency(self) -> u32 {
LCD_CAM_LCD_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn lcd_clock_source_frequency(sclk: LcdCamLcdClockSclk) -> u32 {
match sclk {
LcdCamLcdClockSclk::XtalClk => xtal_clk_frequency(),
LcdCamLcdClockSclk::PllF160m => pll_f160m_frequency(),
}
}
pub fn configure_cam_clock(self, clocks: &mut ClockTree, config: LcdCamCamClockConfig) {
let old_config = clocks.lcd_cam_cam_clock[self as usize].replace(config);
refresh_lcd_cam_cam_clock_downstream(clocks, self);
if clocks.lcd_cam_cam_clock_refcount[self as usize] > 0 {
match config.sclk {
LcdCamCamClockSclk::XtalClk => request_xtal_clk(clocks),
LcdCamCamClockSclk::PllF160m => request_pll_f160m(clocks),
}
self.configure_cam_clock_impl(clocks, old_config, config);
if let Some(old_config) = old_config {
match old_config.sclk {
LcdCamCamClockSclk::XtalClk => release_xtal_clk(clocks),
LcdCamCamClockSclk::PllF160m => release_pll_f160m(clocks),
}
}
} else {
self.configure_cam_clock_impl(clocks, old_config, config);
}
}
pub fn cam_clock_config(self, clocks: &mut ClockTree) -> Option<LcdCamCamClockConfig> {
clocks.lcd_cam_cam_clock[self as usize]
}
pub fn request_cam_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::CAM_CLOCK", self);
if increment_reference_count(&mut clocks.lcd_cam_cam_clock_refcount[self as usize])
{
trace!("Enabling {:?}::CAM_CLOCK", self);
crate::rtc_cntl::WakeLock::acquire();
match unwrap!(clocks.lcd_cam_cam_clock[self as usize]).sclk {
LcdCamCamClockSclk::XtalClk => request_xtal_clk(clocks),
LcdCamCamClockSclk::PllF160m => request_pll_f160m(clocks),
}
self.enable_cam_clock_impl(clocks, true);
}
}
pub fn release_cam_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::CAM_CLOCK", self);
if decrement_reference_count(&mut clocks.lcd_cam_cam_clock_refcount[self as usize])
{
trace!("Disabling {:?}::CAM_CLOCK", self);
crate::rtc_cntl::WakeLock::release();
self.enable_cam_clock_impl(clocks, false);
match unwrap!(clocks.lcd_cam_cam_clock[self as usize]).sclk {
LcdCamCamClockSclk::XtalClk => release_xtal_clk(clocks),
LcdCamCamClockSclk::PllF160m => release_pll_f160m(clocks),
}
}
}
#[allow(unused_variables)]
pub fn cam_clock_config_frequency(
clocks: &mut ClockTree,
config: LcdCamCamClockConfig,
) -> u32 {
(((match config.sclk {
LcdCamCamClockSclk::XtalClk => xtal_clk_frequency(),
LcdCamCamClockSclk::PllF160m => pll_f160m_frequency(),
} as u64)
* (config.div_a() as u64))
/ (((config.div_num() * config.div_a()) + config.div_b()) as u64))
as u32
}
pub fn cam_clock_frequency(self) -> u32 {
LCD_CAM_CAM_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn cam_clock_source_frequency(sclk: LcdCamCamClockSclk) -> u32 {
match sclk {
LcdCamCamClockSclk::XtalClk => xtal_clk_frequency(),
LcdCamCamClockSclk::PllF160m => pll_f160m_frequency(),
}
}
}
impl RmtInstance {
pub fn configure_sclk(self, clocks: &mut ClockTree, new_selector: RmtSclkConfig) {
let old_selector = clocks.rmt_sclk[self as usize].replace(new_selector);
refresh_rmt_sclk_downstream(clocks, self);
if clocks.rmt_sclk_refcount[self as usize] > 0 {
match new_selector {
RmtSclkConfig::PllF80m => request_pll_f80m(clocks),
RmtSclkConfig::RcFastClk => request_rc_fast_clk(clocks),
RmtSclkConfig::XtalClk => request_xtal_clk(clocks),
}
self.configure_sclk_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
RmtSclkConfig::PllF80m => release_pll_f80m(clocks),
RmtSclkConfig::RcFastClk => release_rc_fast_clk(clocks),
RmtSclkConfig::XtalClk => release_xtal_clk(clocks),
}
}
} else {
self.configure_sclk_impl(clocks, old_selector, new_selector);
}
}
pub fn sclk_config(self, clocks: &mut ClockTree) -> Option<RmtSclkConfig> {
clocks.rmt_sclk[self as usize]
}
pub fn request_sclk(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::SCLK", self);
if increment_reference_count(&mut clocks.rmt_sclk_refcount[self as usize]) {
trace!("Enabling {:?}::SCLK", self);
crate::rtc_cntl::WakeLock::acquire();
match unwrap!(clocks.rmt_sclk[self as usize]) {
RmtSclkConfig::PllF80m => request_pll_f80m(clocks),
RmtSclkConfig::RcFastClk => request_rc_fast_clk(clocks),
RmtSclkConfig::XtalClk => request_xtal_clk(clocks),
}
self.enable_sclk_impl(clocks, true);
}
}
pub fn release_sclk(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::SCLK", self);
if decrement_reference_count(&mut clocks.rmt_sclk_refcount[self as usize]) {
trace!("Disabling {:?}::SCLK", self);
crate::rtc_cntl::WakeLock::release();
self.enable_sclk_impl(clocks, false);
match unwrap!(clocks.rmt_sclk[self as usize]) {
RmtSclkConfig::PllF80m => release_pll_f80m(clocks),
RmtSclkConfig::RcFastClk => release_rc_fast_clk(clocks),
RmtSclkConfig::XtalClk => release_xtal_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn sclk_config_frequency(clocks: &mut ClockTree, config: RmtSclkConfig) -> u32 {
match config {
RmtSclkConfig::PllF80m => pll_f80m_frequency(),
RmtSclkConfig::RcFastClk => rc_fast_clk_frequency(),
RmtSclkConfig::XtalClk => xtal_clk_frequency(),
}
}
pub fn sclk_frequency(self) -> u32 {
RMT_SCLK_FREQ_CACHE[self as usize].load(::core::sync::atomic::Ordering::Acquire)
}
pub fn sclk_source_frequency(source: RmtSclkConfig) -> u32 {
match source {
RmtSclkConfig::PllF80m => pll_f80m_frequency(),
RmtSclkConfig::RcFastClk => rc_fast_clk_frequency(),
RmtSclkConfig::XtalClk => xtal_clk_frequency(),
}
}
}
impl SpiInstance {
pub fn configure_function_clock(
self,
clocks: &mut ClockTree,
new_selector: SpiFunctionClockConfig,
) {
let old_selector = clocks.spi_function_clock[self as usize].replace(new_selector);
refresh_spi_function_clock_downstream(clocks, self);
if clocks.spi_function_clock_refcount[self as usize] > 0 {
match new_selector {
SpiFunctionClockConfig::Bbpll => request_bbpll_d3_clock(clocks),
SpiFunctionClockConfig::Xtal => request_xtal_clk(clocks),
SpiFunctionClockConfig::RcFast => request_rc_fast_clk(clocks),
}
self.configure_function_clock_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
SpiFunctionClockConfig::Bbpll => release_bbpll_d3_clock(clocks),
SpiFunctionClockConfig::Xtal => release_xtal_clk(clocks),
SpiFunctionClockConfig::RcFast => release_rc_fast_clk(clocks),
}
}
} else {
self.configure_function_clock_impl(clocks, old_selector, new_selector);
}
}
pub fn function_clock_config(
self,
clocks: &mut ClockTree,
) -> Option<SpiFunctionClockConfig> {
clocks.spi_function_clock[self as usize]
}
pub fn request_function_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::FUNCTION_CLOCK", self);
if increment_reference_count(&mut clocks.spi_function_clock_refcount[self as usize])
{
trace!("Enabling {:?}::FUNCTION_CLOCK", self);
match unwrap!(clocks.spi_function_clock[self as usize]) {
SpiFunctionClockConfig::Bbpll => request_bbpll_d3_clock(clocks),
SpiFunctionClockConfig::Xtal => request_xtal_clk(clocks),
SpiFunctionClockConfig::RcFast => request_rc_fast_clk(clocks),
}
self.enable_function_clock_impl(clocks, true);
}
}
pub fn release_function_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::FUNCTION_CLOCK", self);
if decrement_reference_count(&mut clocks.spi_function_clock_refcount[self as usize])
{
trace!("Disabling {:?}::FUNCTION_CLOCK", self);
self.enable_function_clock_impl(clocks, false);
match unwrap!(clocks.spi_function_clock[self as usize]) {
SpiFunctionClockConfig::Bbpll => release_bbpll_d3_clock(clocks),
SpiFunctionClockConfig::Xtal => release_xtal_clk(clocks),
SpiFunctionClockConfig::RcFast => release_rc_fast_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn function_clock_config_frequency(
clocks: &mut ClockTree,
config: SpiFunctionClockConfig,
) -> u32 {
match config {
SpiFunctionClockConfig::Bbpll => bbpll_d3_clock_frequency(),
SpiFunctionClockConfig::Xtal => xtal_clk_frequency(),
SpiFunctionClockConfig::RcFast => rc_fast_clk_frequency(),
}
}
pub fn function_clock_frequency(self) -> u32 {
SPI_FUNCTION_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn function_clock_source_frequency(source: SpiFunctionClockConfig) -> u32 {
match source {
SpiFunctionClockConfig::Bbpll => bbpll_d3_clock_frequency(),
SpiFunctionClockConfig::Xtal => xtal_clk_frequency(),
SpiFunctionClockConfig::RcFast => rc_fast_clk_frequency(),
}
}
}
impl TimgInstance {
pub fn configure_function_clock(
self,
clocks: &mut ClockTree,
new_selector: TimgFunctionClockConfig,
) {
let old_selector = clocks.timg_function_clock[self as usize].replace(new_selector);
refresh_timg_function_clock_downstream(clocks, self);
if clocks.timg_function_clock_refcount[self as usize] > 0 {
match new_selector {
TimgFunctionClockConfig::PllF80m => request_pll_f80m(clocks),
TimgFunctionClockConfig::RcFastClk => request_rc_fast_clk(clocks),
TimgFunctionClockConfig::XtalClk => request_xtal_clk(clocks),
}
self.configure_function_clock_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
TimgFunctionClockConfig::PllF80m => release_pll_f80m(clocks),
TimgFunctionClockConfig::RcFastClk => release_rc_fast_clk(clocks),
TimgFunctionClockConfig::XtalClk => release_xtal_clk(clocks),
}
}
} else {
self.configure_function_clock_impl(clocks, old_selector, new_selector);
}
}
pub fn function_clock_config(
self,
clocks: &mut ClockTree,
) -> Option<TimgFunctionClockConfig> {
clocks.timg_function_clock[self as usize]
}
pub fn request_function_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::FUNCTION_CLOCK", self);
if increment_reference_count(
&mut clocks.timg_function_clock_refcount[self as usize],
) {
trace!("Enabling {:?}::FUNCTION_CLOCK", self);
match unwrap!(clocks.timg_function_clock[self as usize]) {
TimgFunctionClockConfig::PllF80m => request_pll_f80m(clocks),
TimgFunctionClockConfig::RcFastClk => request_rc_fast_clk(clocks),
TimgFunctionClockConfig::XtalClk => request_xtal_clk(clocks),
}
self.enable_function_clock_impl(clocks, true);
}
}
pub fn release_function_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::FUNCTION_CLOCK", self);
if decrement_reference_count(
&mut clocks.timg_function_clock_refcount[self as usize],
) {
trace!("Disabling {:?}::FUNCTION_CLOCK", self);
self.enable_function_clock_impl(clocks, false);
match unwrap!(clocks.timg_function_clock[self as usize]) {
TimgFunctionClockConfig::PllF80m => release_pll_f80m(clocks),
TimgFunctionClockConfig::RcFastClk => release_rc_fast_clk(clocks),
TimgFunctionClockConfig::XtalClk => release_xtal_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn function_clock_config_frequency(
clocks: &mut ClockTree,
config: TimgFunctionClockConfig,
) -> u32 {
match config {
TimgFunctionClockConfig::PllF80m => pll_f80m_frequency(),
TimgFunctionClockConfig::RcFastClk => rc_fast_clk_frequency(),
TimgFunctionClockConfig::XtalClk => xtal_clk_frequency(),
}
}
pub fn function_clock_frequency(self) -> u32 {
TIMG_FUNCTION_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn function_clock_source_frequency(source: TimgFunctionClockConfig) -> u32 {
match source {
TimgFunctionClockConfig::PllF80m => pll_f80m_frequency(),
TimgFunctionClockConfig::RcFastClk => rc_fast_clk_frequency(),
TimgFunctionClockConfig::XtalClk => xtal_clk_frequency(),
}
}
pub fn configure_wdt_clock(
self,
clocks: &mut ClockTree,
new_selector: TimgWdtClockConfig,
) {
let old_selector = clocks.timg_wdt_clock[self as usize].replace(new_selector);
refresh_timg_wdt_clock_downstream(clocks, self);
if clocks.timg_wdt_clock_refcount[self as usize] > 0 {
match new_selector {
TimgWdtClockConfig::XtalClk => request_xtal_clk(clocks),
TimgWdtClockConfig::PllF80m => request_pll_f80m(clocks),
TimgWdtClockConfig::RcFastClk => request_rc_fast_clk(clocks),
}
self.configure_wdt_clock_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
TimgWdtClockConfig::XtalClk => release_xtal_clk(clocks),
TimgWdtClockConfig::PllF80m => release_pll_f80m(clocks),
TimgWdtClockConfig::RcFastClk => release_rc_fast_clk(clocks),
}
}
} else {
self.configure_wdt_clock_impl(clocks, old_selector, new_selector);
}
}
pub fn wdt_clock_config(self, clocks: &mut ClockTree) -> Option<TimgWdtClockConfig> {
clocks.timg_wdt_clock[self as usize]
}
pub fn request_wdt_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::WDT_CLOCK", self);
if increment_reference_count(&mut clocks.timg_wdt_clock_refcount[self as usize]) {
trace!("Enabling {:?}::WDT_CLOCK", self);
match unwrap!(clocks.timg_wdt_clock[self as usize]) {
TimgWdtClockConfig::XtalClk => request_xtal_clk(clocks),
TimgWdtClockConfig::PllF80m => request_pll_f80m(clocks),
TimgWdtClockConfig::RcFastClk => request_rc_fast_clk(clocks),
}
self.enable_wdt_clock_impl(clocks, true);
}
}
pub fn release_wdt_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::WDT_CLOCK", self);
if decrement_reference_count(&mut clocks.timg_wdt_clock_refcount[self as usize]) {
trace!("Disabling {:?}::WDT_CLOCK", self);
self.enable_wdt_clock_impl(clocks, false);
match unwrap!(clocks.timg_wdt_clock[self as usize]) {
TimgWdtClockConfig::XtalClk => release_xtal_clk(clocks),
TimgWdtClockConfig::PllF80m => release_pll_f80m(clocks),
TimgWdtClockConfig::RcFastClk => release_rc_fast_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn wdt_clock_config_frequency(
clocks: &mut ClockTree,
config: TimgWdtClockConfig,
) -> u32 {
match config {
TimgWdtClockConfig::XtalClk => xtal_clk_frequency(),
TimgWdtClockConfig::PllF80m => pll_f80m_frequency(),
TimgWdtClockConfig::RcFastClk => rc_fast_clk_frequency(),
}
}
pub fn wdt_clock_frequency(self) -> u32 {
TIMG_WDT_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn wdt_clock_source_frequency(source: TimgWdtClockConfig) -> u32 {
match source {
TimgWdtClockConfig::XtalClk => xtal_clk_frequency(),
TimgWdtClockConfig::PllF80m => pll_f80m_frequency(),
TimgWdtClockConfig::RcFastClk => rc_fast_clk_frequency(),
}
}
}
impl UartInstance {
pub fn configure_function_clock(
self,
clocks: &mut ClockTree,
config: UartFunctionClockConfig,
) {
let old_config = clocks.uart_function_clock[self as usize].replace(config);
refresh_uart_function_clock_downstream(clocks, self);
if clocks.uart_function_clock_refcount[self as usize] > 0 {
match config.sclk {
UartFunctionClockSclk::PllF80m => request_pll_f80m(clocks),
UartFunctionClockSclk::Xtal => request_xtal_clk(clocks),
UartFunctionClockSclk::RcFast => request_rc_fast_clk(clocks),
}
self.configure_function_clock_impl(clocks, old_config, config);
if let Some(old_config) = old_config {
match old_config.sclk {
UartFunctionClockSclk::PllF80m => release_pll_f80m(clocks),
UartFunctionClockSclk::Xtal => release_xtal_clk(clocks),
UartFunctionClockSclk::RcFast => release_rc_fast_clk(clocks),
}
}
} else {
self.configure_function_clock_impl(clocks, old_config, config);
}
}
pub fn function_clock_config(
self,
clocks: &mut ClockTree,
) -> Option<UartFunctionClockConfig> {
clocks.uart_function_clock[self as usize]
}
pub fn request_function_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::FUNCTION_CLOCK", self);
if increment_reference_count(
&mut clocks.uart_function_clock_refcount[self as usize],
) {
trace!("Enabling {:?}::FUNCTION_CLOCK", self);
match unwrap!(clocks.uart_function_clock[self as usize]).sclk {
UartFunctionClockSclk::PllF80m => request_pll_f80m(clocks),
UartFunctionClockSclk::Xtal => request_xtal_clk(clocks),
UartFunctionClockSclk::RcFast => request_rc_fast_clk(clocks),
}
self.enable_function_clock_impl(clocks, true);
}
}
pub fn release_function_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::FUNCTION_CLOCK", self);
if decrement_reference_count(
&mut clocks.uart_function_clock_refcount[self as usize],
) {
trace!("Disabling {:?}::FUNCTION_CLOCK", self);
self.enable_function_clock_impl(clocks, false);
match unwrap!(clocks.uart_function_clock[self as usize]).sclk {
UartFunctionClockSclk::PllF80m => release_pll_f80m(clocks),
UartFunctionClockSclk::Xtal => release_xtal_clk(clocks),
UartFunctionClockSclk::RcFast => release_rc_fast_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn function_clock_config_frequency(
clocks: &mut ClockTree,
config: UartFunctionClockConfig,
) -> u32 {
(match config.sclk {
UartFunctionClockSclk::PllF80m => pll_f80m_frequency(),
UartFunctionClockSclk::Xtal => xtal_clk_frequency(),
UartFunctionClockSclk::RcFast => rc_fast_clk_frequency(),
} / (config.div_num() + 1))
}
pub fn function_clock_frequency(self) -> u32 {
UART_FUNCTION_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn function_clock_source_frequency(sclk: UartFunctionClockSclk) -> u32 {
match sclk {
UartFunctionClockSclk::PllF80m => pll_f80m_frequency(),
UartFunctionClockSclk::Xtal => xtal_clk_frequency(),
UartFunctionClockSclk::RcFast => rc_fast_clk_frequency(),
}
}
pub fn configure_baud_rate_generator(
self,
clocks: &mut ClockTree,
config: UartBaudRateGeneratorConfig,
) {
let old_config = clocks.uart_baud_rate_generator[self as usize].replace(config);
refresh_uart_baud_rate_generator_downstream(clocks, self);
self.configure_baud_rate_generator_impl(clocks, old_config, config);
}
pub fn baud_rate_generator_config(
self,
clocks: &mut ClockTree,
) -> Option<UartBaudRateGeneratorConfig> {
clocks.uart_baud_rate_generator[self as usize]
}
pub fn request_baud_rate_generator(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::BAUD_RATE_GENERATOR", self);
if increment_reference_count(
&mut clocks.uart_baud_rate_generator_refcount[self as usize],
) {
trace!("Enabling {:?}::BAUD_RATE_GENERATOR", self);
self.request_function_clock(clocks);
self.enable_baud_rate_generator_impl(clocks, true);
}
}
pub fn release_baud_rate_generator(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::BAUD_RATE_GENERATOR", self);
if decrement_reference_count(
&mut clocks.uart_baud_rate_generator_refcount[self as usize],
) {
trace!("Disabling {:?}::BAUD_RATE_GENERATOR", self);
self.enable_baud_rate_generator_impl(clocks, false);
self.release_function_clock(clocks);
}
}
#[allow(unused_variables)]
pub fn baud_rate_generator_config_frequency(
self,
clocks: &mut ClockTree,
config: UartBaudRateGeneratorConfig,
) -> u32 {
((self.function_clock_frequency() * 16)
/ ((config.integral() * 16) + config.fractional()))
}
pub fn baud_rate_generator_frequency(self) -> u32 {
UART_BAUD_RATE_GENERATOR_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn request_mem_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::MEM_CLOCK", self);
if increment_reference_count(&mut clocks.uart_mem_clock_refcount[self as usize]) {
trace!("Enabling {:?}::MEM_CLOCK", self);
request_apb_clk(clocks);
self.enable_mem_clock_impl(clocks, true);
}
}
pub fn release_mem_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::MEM_CLOCK", self);
if decrement_reference_count(&mut clocks.uart_mem_clock_refcount[self as usize]) {
trace!("Disabling {:?}::MEM_CLOCK", self);
self.enable_mem_clock_impl(clocks, false);
release_apb_clk(clocks);
}
}
pub fn mem_clock_frequency(self) -> u32 {
apb_clk_frequency()
}
pub fn mem_clock_source_frequency() -> u32 {
apb_clk_frequency()
}
}
impl PsramInstance {
pub fn configure_function_clock(
self,
clocks: &mut ClockTree,
new_selector: PsramFunctionClockConfig,
) {
let old_selector = clocks.psram_function_clock[self as usize].replace(new_selector);
refresh_psram_function_clock_downstream(clocks, self);
if clocks.psram_function_clock_refcount[self as usize] > 0 {
match new_selector {
PsramFunctionClockConfig::Xtal => request_xtal_clk(clocks),
PsramFunctionClockConfig::Mpll => request_mpll_clk(clocks),
PsramFunctionClockConfig::Cpll => request_cpll_clk(clocks),
}
self.configure_function_clock_impl(clocks, old_selector, new_selector);
if let Some(old_selector) = old_selector {
match old_selector {
PsramFunctionClockConfig::Xtal => release_xtal_clk(clocks),
PsramFunctionClockConfig::Mpll => release_mpll_clk(clocks),
PsramFunctionClockConfig::Cpll => release_cpll_clk(clocks),
}
}
} else {
self.configure_function_clock_impl(clocks, old_selector, new_selector);
}
}
pub fn function_clock_config(
self,
clocks: &mut ClockTree,
) -> Option<PsramFunctionClockConfig> {
clocks.psram_function_clock[self as usize]
}
pub fn request_function_clock(self, clocks: &mut ClockTree) {
trace!("Requesting {:?}::FUNCTION_CLOCK", self);
if increment_reference_count(
&mut clocks.psram_function_clock_refcount[self as usize],
) {
trace!("Enabling {:?}::FUNCTION_CLOCK", self);
match unwrap!(clocks.psram_function_clock[self as usize]) {
PsramFunctionClockConfig::Xtal => request_xtal_clk(clocks),
PsramFunctionClockConfig::Mpll => request_mpll_clk(clocks),
PsramFunctionClockConfig::Cpll => request_cpll_clk(clocks),
}
self.enable_function_clock_impl(clocks, true);
}
}
pub fn release_function_clock(self, clocks: &mut ClockTree) {
trace!("Releasing {:?}::FUNCTION_CLOCK", self);
if decrement_reference_count(
&mut clocks.psram_function_clock_refcount[self as usize],
) {
trace!("Disabling {:?}::FUNCTION_CLOCK", self);
self.enable_function_clock_impl(clocks, false);
match unwrap!(clocks.psram_function_clock[self as usize]) {
PsramFunctionClockConfig::Xtal => release_xtal_clk(clocks),
PsramFunctionClockConfig::Mpll => release_mpll_clk(clocks),
PsramFunctionClockConfig::Cpll => release_cpll_clk(clocks),
}
}
}
#[allow(unused_variables)]
pub fn function_clock_config_frequency(
clocks: &mut ClockTree,
config: PsramFunctionClockConfig,
) -> u32 {
match config {
PsramFunctionClockConfig::Xtal => xtal_clk_frequency(),
PsramFunctionClockConfig::Mpll => mpll_clk_frequency(),
PsramFunctionClockConfig::Cpll => cpll_clk_frequency(),
}
}
pub fn function_clock_frequency(self) -> u32 {
PSRAM_FUNCTION_CLOCK_FREQ_CACHE[self as usize]
.load(::core::sync::atomic::Ordering::Acquire)
}
pub fn function_clock_source_frequency(source: PsramFunctionClockConfig) -> u32 {
match source {
PsramFunctionClockConfig::Xtal => xtal_clk_frequency(),
PsramFunctionClockConfig::Mpll => mpll_clk_frequency(),
PsramFunctionClockConfig::Cpll => cpll_clk_frequency(),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[instability::unstable]
pub struct ClockConfig {
pub cpu_root_clk: Option<CpuRootClkConfig>,
pub cpu_clk: Option<CpuClkConfig>,
pub mem_clk: Option<MemClkConfig>,
pub sys_clk: Option<SysClkConfig>,
pub apb_clk: Option<ApbClkConfig>,
pub lp_fast_clk: Option<LpFastClkConfig>,
pub lp_slow_clk: Option<LpSlowClkConfig>,
pub crypto_clk: Option<CryptoClkConfig>,
pub iomux_function_clock: Option<IomuxFunctionClockConfig>,
pub timg_calibration_clock: Option<TimgCalibrationClockConfig>,
}
impl ClockConfig {
fn apply(&self, clocks: &mut ClockTree) {
if let Some(config) = self.cpu_root_clk {
configure_cpu_root_clk(clocks, config);
}
if let Some(config) = self.cpu_clk {
configure_cpu_clk(clocks, config);
}
if let Some(config) = self.mem_clk {
configure_mem_clk(clocks, config);
}
if let Some(config) = self.sys_clk {
configure_sys_clk(clocks, config);
}
if let Some(config) = self.apb_clk {
configure_apb_clk(clocks, config);
}
if let Some(config) = self.lp_fast_clk {
configure_lp_fast_clk(clocks, config);
}
if let Some(config) = self.lp_slow_clk {
configure_lp_slow_clk(clocks, config);
}
if let Some(config) = self.crypto_clk {
configure_crypto_clk(clocks, config);
}
if let Some(config) = self.iomux_function_clock {
configure_iomux_function_clock(clocks, config);
}
if let Some(config) = self.timg_calibration_clock {
configure_timg_calibration_clock(clocks, config);
}
}
}
fn increment_reference_count(refcount: &mut u32) -> bool {
let first = *refcount == 0;
*refcount = unwrap!(refcount.checked_add(1), "Reference count overflow");
first
}
fn decrement_reference_count(refcount: &mut u32) -> bool {
*refcount = refcount.saturating_sub(1);
let last = *refcount == 0;
last
}
fn refresh_cpu_root_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.cpu_root_clk {
CPU_ROOT_CLK_FREQ_CACHE.store(
cpu_root_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
refresh_cpu_clk_downstream(clocks);
}
fn refresh_cpu_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.cpu_clk {
CPU_CLK_FREQ_CACHE.store(
cpu_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
refresh_mem_clk_downstream(clocks);
refresh_sys_clk_downstream(clocks);
}
fn refresh_mem_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.mem_clk {
MEM_CLK_FREQ_CACHE.store(
mem_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_sys_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.sys_clk {
SYS_CLK_FREQ_CACHE.store(
sys_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
refresh_apb_clk_downstream(clocks);
}
fn refresh_apb_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.apb_clk {
APB_CLK_FREQ_CACHE.store(
apb_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_lp_fast_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.lp_fast_clk {
LP_FAST_CLK_FREQ_CACHE.store(
lp_fast_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_lp_slow_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.lp_slow_clk {
LP_SLOW_CLK_FREQ_CACHE.store(
lp_slow_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_crypto_clk_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.crypto_clk {
CRYPTO_CLK_FREQ_CACHE.store(
crypto_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_iomux_function_clock_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.iomux_function_clock {
IOMUX_FUNCTION_CLOCK_FREQ_CACHE.store(
iomux_function_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_timg_calibration_clock_downstream(clocks: &mut ClockTree) {
if let Some(config) = clocks.timg_calibration_clock {
TIMG_CALIBRATION_CLOCK_FREQ_CACHE.store(
timg_calibration_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_i2c_function_clock_downstream(clocks: &mut ClockTree, instance: I2cInstance) {
if let Some(config) = clocks.i2c_function_clock[instance as usize] {
I2C_FUNCTION_CLOCK_FREQ_CACHE[instance as usize].store(
I2cInstance::function_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_i2s_tx_clk_downstream(clocks: &mut ClockTree, instance: I2sInstance) {
if let Some(config) = clocks.i2s_tx_clk[instance as usize] {
I2S_TX_CLK_FREQ_CACHE[instance as usize].store(
I2sInstance::tx_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
refresh_i2s_mclk_out_downstream(clocks, instance);
}
fn refresh_i2s_rx_clk_downstream(clocks: &mut ClockTree, instance: I2sInstance) {
if let Some(config) = clocks.i2s_rx_clk[instance as usize] {
I2S_RX_CLK_FREQ_CACHE[instance as usize].store(
I2sInstance::rx_clk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
refresh_i2s_mclk_out_downstream(clocks, instance);
}
fn refresh_i2s_mclk_out_downstream(clocks: &mut ClockTree, instance: I2sInstance) {
if let Some(config) = clocks.i2s_mclk_out[instance as usize] {
I2S_MCLK_OUT_FREQ_CACHE[instance as usize].store(
instance.mclk_out_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_lcd_cam_lcd_clock_downstream(clocks: &mut ClockTree, instance: LcdCamInstance) {
if let Some(config) = clocks.lcd_cam_lcd_clock[instance as usize] {
LCD_CAM_LCD_CLOCK_FREQ_CACHE[instance as usize].store(
LcdCamInstance::lcd_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_lcd_cam_cam_clock_downstream(clocks: &mut ClockTree, instance: LcdCamInstance) {
if let Some(config) = clocks.lcd_cam_cam_clock[instance as usize] {
LCD_CAM_CAM_CLOCK_FREQ_CACHE[instance as usize].store(
LcdCamInstance::cam_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_rmt_sclk_downstream(clocks: &mut ClockTree, instance: RmtInstance) {
if let Some(config) = clocks.rmt_sclk[instance as usize] {
RMT_SCLK_FREQ_CACHE[instance as usize].store(
RmtInstance::sclk_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_spi_function_clock_downstream(clocks: &mut ClockTree, instance: SpiInstance) {
if let Some(config) = clocks.spi_function_clock[instance as usize] {
SPI_FUNCTION_CLOCK_FREQ_CACHE[instance as usize].store(
SpiInstance::function_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_timg_function_clock_downstream(clocks: &mut ClockTree, instance: TimgInstance) {
if let Some(config) = clocks.timg_function_clock[instance as usize] {
TIMG_FUNCTION_CLOCK_FREQ_CACHE[instance as usize].store(
TimgInstance::function_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_timg_wdt_clock_downstream(clocks: &mut ClockTree, instance: TimgInstance) {
if let Some(config) = clocks.timg_wdt_clock[instance as usize] {
TIMG_WDT_CLOCK_FREQ_CACHE[instance as usize].store(
TimgInstance::wdt_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_uart_function_clock_downstream(clocks: &mut ClockTree, instance: UartInstance) {
if let Some(config) = clocks.uart_function_clock[instance as usize] {
UART_FUNCTION_CLOCK_FREQ_CACHE[instance as usize].store(
UartInstance::function_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
refresh_uart_baud_rate_generator_downstream(clocks, instance);
}
fn refresh_uart_baud_rate_generator_downstream(
clocks: &mut ClockTree,
instance: UartInstance,
) {
if let Some(config) = clocks.uart_baud_rate_generator[instance as usize] {
UART_BAUD_RATE_GENERATOR_FREQ_CACHE[instance as usize].store(
instance.baud_rate_generator_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
fn refresh_psram_function_clock_downstream(
clocks: &mut ClockTree,
instance: PsramInstance,
) {
if let Some(config) = clocks.psram_function_clock[instance as usize] {
PSRAM_FUNCTION_CLOCK_FREQ_CACHE[instance as usize].store(
PsramInstance::function_clock_config_frequency(clocks, config),
::core::sync::atomic::Ordering::Release,
);
}
}
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! implement_peripheral_clocks {
() => {
#[doc(hidden)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u8)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Peripheral {
Aes,
AhbGdma,
ApbSarAdc,
AxiGdma,
Ecc,
Emac,
GpioSd,
I2c0,
I2c1,
I2s0,
I2s1,
LcdCam,
Pcnt,
Pcnt1,
Rmt,
Rsa,
SdioHost,
Sha,
Spi2,
Spi3,
Systimer,
Timg0,
Timg1,
Uart0,
Uart1,
Uart2,
Uart3,
Uhci0,
UsbDevice,
UsbHs,
}
impl Peripheral {
const KEEP_ENABLED: &[Peripheral] =
&[Self::Systimer, Self::Timg0, Self::Uart0, Self::UsbDevice];
const COUNT: usize = Self::ALL.len();
const ALL: &[Self] = &[
Self::Aes,
Self::AhbGdma,
Self::ApbSarAdc,
Self::AxiGdma,
Self::Ecc,
Self::Emac,
Self::GpioSd,
Self::I2c0,
Self::I2c1,
Self::I2s0,
Self::I2s1,
Self::LcdCam,
Self::Pcnt,
Self::Pcnt1,
Self::Rmt,
Self::Rsa,
Self::SdioHost,
Self::Sha,
Self::Spi2,
Self::Spi3,
Self::Systimer,
Self::Timg0,
Self::Timg1,
Self::Uart0,
Self::Uart1,
Self::Uart2,
Self::Uart3,
Self::Uhci0,
Self::UsbDevice,
Self::UsbHs,
];
}
unsafe fn enable_internal_racey(peripheral: Peripheral, enable: bool) {
match peripheral {
Peripheral::Aes => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_aes_clk_en().bit(enable));
}
Peripheral::AhbGdma => {
crate::peripherals::HP_SYS_CLKRST::regs()
.ahb_pdma_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable));
}
Peripheral::ApbSarAdc => {
crate::peripherals::LP_PERI::regs()
.adc_ctrl()
.modify(|_, w| w.lp_adc_clk_en().bit(enable));
}
Peripheral::AxiGdma => {
crate::peripherals::HP_SYS_CLKRST::regs()
.axi_pdma_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable));
}
Peripheral::Ecc => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_ecc_clk_en().bit(enable));
}
Peripheral::Emac => {
crate::peripherals::HP_SYS_CLKRST::regs()
.emac_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable));
}
Peripheral::GpioSd => {
crate::peripherals::GPIO_SD::regs()
.clock_gate()
.modify(|_, w| w.clk_en().bit(enable));
}
Peripheral::I2c0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2c_ctrl0(0)
.modify(|_, w| w.apb_clk_en().bit(enable).clk_en().bit(enable));
}
Peripheral::I2c1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2c_ctrl0(1)
.modify(|_, w| w.apb_clk_en().bit(enable).clk_en().bit(enable));
}
Peripheral::I2s0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2s0_ctrl0()
.modify(|_, w| w.apb_clk_en().bit(enable));
crate::peripherals::HP_ALIVE_SYS::regs()
.hp_pad_i2s0_ctrl()
.modify(|_, w| w.hp_pad_i2s0_mclk_en().bit(enable));
}
Peripheral::I2s1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2s1_ctrl0()
.modify(|_, w| w.apb_clk_en().bit(enable));
crate::peripherals::HP_ALIVE_SYS::regs()
.hp_pad_i2s1_ctrl()
.modify(|_, w| w.hp_pad_i2s1_mclk_en().bit(enable));
}
Peripheral::LcdCam => {
crate::peripherals::HP_SYS_CLKRST::regs()
.lcdcam_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Pcnt => {
crate::peripherals::HP_SYS_CLKRST::regs()
.pcnt_ctrl0()
.modify(|_, w| w.pcnt0_apb_clk_en().bit(enable));
}
Peripheral::Pcnt1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.pcnt_ctrl0()
.modify(|_, w| w.pcnt1_apb_clk_en().bit(enable));
}
Peripheral::Rmt => {
crate::peripherals::HP_SYS_CLKRST::regs()
.rmt_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable));
}
Peripheral::Rsa => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_rsa_clk_en().bit(enable));
}
Peripheral::SdioHost => {
crate::peripherals::HP_SYS_CLKRST::regs()
.sdio_host_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable));
}
Peripheral::Sha => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_sha_clk_en().bit(enable));
}
Peripheral::Spi2 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.gpspi2_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Spi3 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.gpspi3_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Systimer => {
crate::peripherals::HP_SYS_CLKRST::regs()
.systimer_ctrl0()
.modify(|_, w| w.apb_clk_en().bit(enable).clk_en().bit(enable));
}
Peripheral::Timg0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.timergrp0_ctrl0()
.modify(|_, w| w.apb_clk_en().bit(enable));
}
Peripheral::Timg1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.timergrp1_ctrl0()
.modify(|_, w| w.apb_clk_en().bit(enable));
}
Peripheral::Uart0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(0)
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Uart1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(1)
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Uart2 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(2)
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Uart3 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(3)
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::Uhci0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uhci_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
Peripheral::UsbDevice => {
crate::peripherals::HP_SYS_CLKRST::regs()
.usb_device_ctrl0()
.modify(|_, w| w.apb_clk_en().bit(enable));
crate::peripherals::CNNT_SYS::regs()
.sys_hp_usb_device_ctrl()
.modify(|_, w| w.sys_usb_device_48m_clk_en().bit(enable));
}
Peripheral::UsbHs => {
crate::peripherals::HP_SYS_CLKRST::regs()
.usb_otghs_ctrl0()
.modify(|_, w| w.sys_clk_en().bit(enable).apb_clk_en().bit(enable));
}
}
}
unsafe fn assert_peri_reset_racey(peripheral: Peripheral, reset: bool) {
match peripheral {
Peripheral::Aes => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_aes_rst_en().bit(reset));
}
Peripheral::AhbGdma => {
crate::peripherals::HP_SYS_CLKRST::regs()
.ahb_pdma_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::ApbSarAdc => {
crate::peripherals::LP_PERI::regs()
.adc_ctrl()
.modify(|_, w| w.lp_adc_rst_en().bit(reset));
}
Peripheral::AxiGdma => {
crate::peripherals::HP_SYS_CLKRST::regs()
.axi_pdma_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Ecc => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_ecc_rst_en().bit(reset));
}
Peripheral::Emac => {
let _ = reset;
}
Peripheral::GpioSd => {
let _ = reset;
}
Peripheral::I2c0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2c_ctrl0(0)
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::I2c1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2c_ctrl0(1)
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::I2s0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2s0_ctrl0()
.modify(|_, w| w.apb_rst_en().bit(reset));
}
Peripheral::I2s1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.i2s1_ctrl0()
.modify(|_, w| w.apb_rst_en().bit(reset));
}
Peripheral::LcdCam => {
crate::peripherals::HP_SYS_CLKRST::regs()
.lcdcam_ctrl0()
.modify(|_, w| w.apb_rst_en().bit(reset).rst_en().bit(reset));
}
Peripheral::Pcnt => {
crate::peripherals::HP_SYS_CLKRST::regs()
.pcnt_ctrl0()
.modify(|_, w| w.pcnt0_rst_en().bit(reset));
}
Peripheral::Pcnt1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.pcnt_ctrl0()
.modify(|_, w| w.pcnt1_rst_en().bit(reset));
}
Peripheral::Rmt => {
crate::peripherals::HP_SYS_CLKRST::regs()
.rmt_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Rsa => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_rsa_rst_en().bit(reset));
}
Peripheral::SdioHost => {
crate::peripherals::CNNT_SYS::regs()
.sys_hp_sdmmc_ctrl()
.modify(|_, w| w.sys_sdmmc_rst_en().bit(reset));
}
Peripheral::Sha => {
crate::peripherals::HP_SYS_CLKRST::regs()
.crypto_ctrl0()
.modify(|_, w| w.crypto_sha_rst_en().bit(reset));
}
Peripheral::Spi2 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.gpspi2_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Spi3 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.gpspi3_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Systimer => {
crate::peripherals::HP_SYS_CLKRST::regs()
.systimer_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Timg0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.timergrp0_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Timg1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.timergrp1_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::Uart0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(0)
.modify(|_, w| w.core_rst_en().bit(reset).apb_rst_en().bit(reset));
}
Peripheral::Uart1 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(1)
.modify(|_, w| w.core_rst_en().bit(reset).apb_rst_en().bit(reset));
}
Peripheral::Uart2 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(2)
.modify(|_, w| w.core_rst_en().bit(reset).apb_rst_en().bit(reset));
}
Peripheral::Uart3 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uart_ctrl0(3)
.modify(|_, w| w.core_rst_en().bit(reset).apb_rst_en().bit(reset));
}
Peripheral::Uhci0 => {
crate::peripherals::HP_SYS_CLKRST::regs()
.uhci_ctrl0()
.modify(|_, w| w.rst_en().bit(reset));
}
Peripheral::UsbDevice => {
crate::peripherals::CNNT_SYS::regs()
.sys_hp_usb_device_ctrl()
.modify(|_, w| w.sys_usb_device_rst_en().bit(reset));
}
Peripheral::UsbHs => {
let _ = reset;
}
}
}
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! memory_range {
("DRAM") => {
0x2F000000..0x2F07AFC0
};
(size as str, "DRAM") => {
"503744"
};
("DRAM2_UNINIT") => {
0x2F07AFC0..0x2F07CFB0
};
(size as str, "DRAM2_UNINIT") => {
"8176"
};
("IROM") => {
0x40000000..0x50000000
};
(size as str, "IROM") => {
"268435456"
};
("DROM") => {
0x40000000..0x50000000
};
(size as str, "DROM") => {
"268435456"
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_i2c_master {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_i2c_master { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_i2c_master!((0, I2C0, I2c0, I2CEXT0_SCL, I2CEXT0_SDA));
_for_each_inner_i2c_master!((1, I2C1, I2c1, I2CEXT1_SCL, I2CEXT1_SDA));
_for_each_inner_i2c_master!((all(0, I2C0, I2c0, I2CEXT0_SCL, I2CEXT0_SDA), (1,
I2C1, I2c1, I2CEXT1_SCL, I2CEXT1_SDA)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_i2s {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_i2s { $(($pattern) => $code;)* ($other : tt) => {} }
_for_each_inner_i2s!((I2S0)); _for_each_inner_i2s!((I2S1));
_for_each_inner_i2s!((I2S0, I2s0, I2S0_MCLK, I2S0O_BCK, I2S0O_WS, I2S0I_BCK,
I2S0I_WS, [I2S0O_SD, I2S0O_SD1], [I2S0I_SD, I2S0I_SD1, I2S0I_SD2, I2S0I_SD3],
true, true, true, true)); _for_each_inner_i2s!((I2S1, I2s1, I2S1_MCLK, I2S1O_BCK,
I2S1O_WS, I2S1I_BCK, I2S1I_WS, [I2S1O_SD], [I2S1I_SD], true, true, false,
false)); _for_each_inner_i2s!((names(I2S0), (I2S1)));
_for_each_inner_i2s!((all(I2S0, I2s0, I2S0_MCLK, I2S0O_BCK, I2S0O_WS, I2S0I_BCK,
I2S0I_WS, [I2S0O_SD, I2S0O_SD1], [I2S0I_SD, I2S0I_SD1, I2S0I_SD2, I2S0I_SD3],
true, true, true, true), (I2S1, I2s1, I2S1_MCLK, I2S1O_BCK, I2S1O_WS, I2S1I_BCK,
I2S1I_WS, [I2S1O_SD], [I2S1I_SD], true, true, false, false)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_uart {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_uart { $(($pattern) => $code;)* ($other : tt) => {}
} _for_each_inner_uart!((0, UART0, Uart0, U0RXD, U0TXD, U0CTS, U0RTS,
wakeup_source = true)); _for_each_inner_uart!((1, UART1, Uart1, U1RXD, U1TXD,
U1CTS, U1RTS, wakeup_source = true)); _for_each_inner_uart!((2, UART2, Uart2,
U2RXD, U2TXD, U2CTS, U2RTS, wakeup_source = false)); _for_each_inner_uart!((3,
UART3, Uart3, U3RXD, U3TXD, U3CTS, U3RTS, wakeup_source = false));
_for_each_inner_uart!((all(0, UART0, Uart0, U0RXD, U0TXD, U0CTS, U0RTS,
wakeup_source = true), (1, UART1, Uart1, U1RXD, U1TXD, U1CTS, U1RTS,
wakeup_source = true), (2, UART2, Uart2, U2RXD, U2TXD, U2CTS, U2RTS,
wakeup_source = false), (3, UART3, Uart3, U3RXD, U3TXD, U3CTS, U3RTS,
wakeup_source = false)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_spi_master {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_spi_master { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_spi_master!((SPI2)); _for_each_inner_spi_master!((SPI3));
_for_each_inner_spi_master!((SPI2, Spi2, FSPICLK[FSPICS0, FSPICS1, FSPICS2,
FSPICS3, FSPICS4, FSPICS5] [FSPID, FSPIQ, FSPIWP, FSPIHD, FSPIIO4, FSPIIO5,
FSPIIO6, FSPIIO7], true)); _for_each_inner_spi_master!((SPI3, Spi3,
SPI3_CK[SPI3_CS, SPI3_CS1, SPI3_CS2] [SPI3_D, SPI3_Q, SPI3_WP, SPI3_HOLD],
true)); _for_each_inner_spi_master!((names(SPI2), (SPI3)));
_for_each_inner_spi_master!((all(SPI2, Spi2, FSPICLK[FSPICS0, FSPICS1, FSPICS2,
FSPICS3, FSPICS4, FSPICS5] [FSPID, FSPIQ, FSPIWP, FSPIHD, FSPIIO4, FSPIIO5,
FSPIIO6, FSPIIO7], true), (SPI3, Spi3, SPI3_CK[SPI3_CS, SPI3_CS1, SPI3_CS2]
[SPI3_D, SPI3_Q, SPI3_WP, SPI3_HOLD], true)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_spi_slave {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_spi_slave { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_spi_slave!((SPI2)); _for_each_inner_spi_slave!((SPI3));
_for_each_inner_spi_slave!((SPI2, Spi2, FSPICLK, FSPID, FSPIQ, FSPICS0));
_for_each_inner_spi_slave!((SPI3, Spi3, SPI3_CK, SPI3_D, SPI3_Q, SPI3_CS));
_for_each_inner_spi_slave!((names(SPI2), (SPI3)));
_for_each_inner_spi_slave!((all(SPI2, Spi2, FSPICLK, FSPID, FSPIQ, FSPICS0),
(SPI3, Spi3, SPI3_CK, SPI3_D, SPI3_Q, SPI3_CS)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_pcnt_unit {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_pcnt_unit { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_pcnt_unit!((PCNT0_UNIT0));
_for_each_inner_pcnt_unit!((PCNT0_UNIT1));
_for_each_inner_pcnt_unit!((PCNT0_UNIT2));
_for_each_inner_pcnt_unit!((PCNT0_UNIT3));
_for_each_inner_pcnt_unit!((PCNT1_UNIT0));
_for_each_inner_pcnt_unit!((PCNT1_UNIT1));
_for_each_inner_pcnt_unit!((PCNT1_UNIT2));
_for_each_inner_pcnt_unit!((PCNT1_UNIT3));
_for_each_inner_pcnt_unit!((PCNT0_UNIT0, Pcnt0Unit0, Pcnt, PCNT, 0, PCNT0,
PCNT0_SIG_CH0, PCNT0_SIG_CH1, PCNT0_CTRL_CH0, PCNT0_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT0_UNIT1, Pcnt0Unit1, Pcnt, PCNT, 1, PCNT0,
PCNT1_SIG_CH0, PCNT1_SIG_CH1, PCNT1_CTRL_CH0, PCNT1_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT0_UNIT2, Pcnt0Unit2, Pcnt, PCNT, 2, PCNT0,
PCNT2_SIG_CH0, PCNT2_SIG_CH1, PCNT2_CTRL_CH0, PCNT2_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT0_UNIT3, Pcnt0Unit3, Pcnt, PCNT, 3, PCNT0,
PCNT3_SIG_CH0, PCNT3_SIG_CH1, PCNT3_CTRL_CH0, PCNT3_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT1_UNIT0, Pcnt1Unit0, Pcnt1, PCNT1, 0, PCNT1,
PCNT1_U0_SIG_CH0, PCNT1_U0_SIG_CH1, PCNT1_U0_CTRL_CH0, PCNT1_U0_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT1_UNIT1, Pcnt1Unit1, Pcnt1, PCNT1, 1, PCNT1,
PCNT1_U1_SIG_CH0, PCNT1_U1_SIG_CH1, PCNT1_U1_CTRL_CH0, PCNT1_U1_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT1_UNIT2, Pcnt1Unit2, Pcnt1, PCNT1, 2, PCNT1,
PCNT1_U2_SIG_CH0, PCNT1_U2_SIG_CH1, PCNT1_U2_CTRL_CH0, PCNT1_U2_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT1_UNIT3, Pcnt1Unit3, Pcnt1, PCNT1, 3, PCNT1,
PCNT1_U3_SIG_CH0, PCNT1_U3_SIG_CH1, PCNT1_U3_CTRL_CH0, PCNT1_U3_CTRL_CH1));
_for_each_inner_pcnt_unit!((PCNT0)); _for_each_inner_pcnt_unit!((PCNT1));
_for_each_inner_pcnt_unit!((PCNT)); _for_each_inner_pcnt_unit!((PCNT1));
_for_each_inner_pcnt_unit!((names(PCNT0_UNIT0), (PCNT0_UNIT1), (PCNT0_UNIT2),
(PCNT0_UNIT3), (PCNT1_UNIT0), (PCNT1_UNIT1), (PCNT1_UNIT2), (PCNT1_UNIT3)));
_for_each_inner_pcnt_unit!((all(PCNT0_UNIT0, Pcnt0Unit0, Pcnt, PCNT, 0, PCNT0,
PCNT0_SIG_CH0, PCNT0_SIG_CH1, PCNT0_CTRL_CH0, PCNT0_CTRL_CH1), (PCNT0_UNIT1,
Pcnt0Unit1, Pcnt, PCNT, 1, PCNT0, PCNT1_SIG_CH0, PCNT1_SIG_CH1, PCNT1_CTRL_CH0,
PCNT1_CTRL_CH1), (PCNT0_UNIT2, Pcnt0Unit2, Pcnt, PCNT, 2, PCNT0, PCNT2_SIG_CH0,
PCNT2_SIG_CH1, PCNT2_CTRL_CH0, PCNT2_CTRL_CH1), (PCNT0_UNIT3, Pcnt0Unit3, Pcnt,
PCNT, 3, PCNT0, PCNT3_SIG_CH0, PCNT3_SIG_CH1, PCNT3_CTRL_CH0, PCNT3_CTRL_CH1),
(PCNT1_UNIT0, Pcnt1Unit0, Pcnt1, PCNT1, 0, PCNT1, PCNT1_U0_SIG_CH0,
PCNT1_U0_SIG_CH1, PCNT1_U0_CTRL_CH0, PCNT1_U0_CTRL_CH1), (PCNT1_UNIT1,
Pcnt1Unit1, Pcnt1, PCNT1, 1, PCNT1, PCNT1_U1_SIG_CH0, PCNT1_U1_SIG_CH1,
PCNT1_U1_CTRL_CH0, PCNT1_U1_CTRL_CH1), (PCNT1_UNIT2, Pcnt1Unit2, Pcnt1, PCNT1, 2,
PCNT1, PCNT1_U2_SIG_CH0, PCNT1_U2_SIG_CH1, PCNT1_U2_CTRL_CH0, PCNT1_U2_CTRL_CH1),
(PCNT1_UNIT3, Pcnt1Unit3, Pcnt1, PCNT1, 3, PCNT1, PCNT1_U3_SIG_CH0,
PCNT1_U3_SIG_CH1, PCNT1_U3_CTRL_CH0, PCNT1_U3_CTRL_CH1)));
_for_each_inner_pcnt_unit!((interrupt(PCNT0), (PCNT1)));
_for_each_inner_pcnt_unit!((regs(PCNT), (PCNT1)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_peripheral {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_peripheral { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO0 peripheral singleton"] GPIO0 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO1 peripheral singleton"]
GPIO1 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO2 peripheral singleton"] GPIO2 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO3 peripheral singleton"]
GPIO3 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO4 peripheral singleton"] GPIO4 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO5 peripheral singleton"]
GPIO5 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO6 peripheral singleton"] GPIO6 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO7 peripheral singleton"]
GPIO7 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO8 peripheral singleton"] GPIO8 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO9 peripheral singleton"]
GPIO9 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO10 peripheral singleton"] GPIO10 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO11 peripheral singleton"]
GPIO11 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO12 peripheral singleton"] GPIO12 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO13 peripheral singleton"]
GPIO13 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO14 peripheral singleton"] GPIO14 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO15 peripheral singleton"]
GPIO15 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO16 peripheral singleton"] GPIO16 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO17 peripheral singleton"]
GPIO17 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO18 peripheral singleton"] GPIO18 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO19 peripheral singleton"]
GPIO19 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO20 peripheral singleton"] GPIO20 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO21 peripheral singleton"]
GPIO21 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO22 peripheral singleton"] GPIO22 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO23 peripheral singleton"]
GPIO23 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO24 peripheral singleton"] GPIO24 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO25 peripheral singleton"]
GPIO25 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO26 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO26 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO27 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO27 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO28 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO28 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO30 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO30 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO31 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO31 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO32 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO32 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO33 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using USB.</li>"] #[doc = "</ul>"]
#[doc = "</section>"] GPIO33 <= virtual())); _for_each_inner_peripheral!((@
peri_type #[doc = "GPIO34 peripheral singleton (Limitations exist)"] #[doc = ""]
#[doc = "<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using USB.</li>"] #[doc = "</ul>"]
#[doc = "</section>"] GPIO34 <= virtual())); _for_each_inner_peripheral!((@
peri_type #[doc = "GPIO35 peripheral singleton"] GPIO35 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO36 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO36 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO37 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO37 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO38 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO38 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO39 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO39 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO40 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO40 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO42 peripheral singleton"]
GPIO42 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO43 peripheral singleton"] GPIO43 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO44 peripheral singleton"]
GPIO44 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO45 peripheral singleton"] GPIO45 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO46 peripheral singleton"]
GPIO46 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO47 peripheral singleton"] GPIO47 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO48 peripheral singleton"]
GPIO48 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO49 peripheral singleton"] GPIO49 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO50 peripheral singleton"]
GPIO50 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO51 peripheral singleton"] GPIO51 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO52 peripheral singleton"]
GPIO52 <= virtual())); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO53 peripheral singleton"] GPIO53 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO54 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO54 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO55 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO55 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO56 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO56 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO57 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO57 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO58 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>By default, this pin is used by the UART programming interface.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO58 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO59 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>By default, this pin is used by the UART programming interface.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO59 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO60 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO60 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO61 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO61 <= virtual()));
_for_each_inner_peripheral!((@ peri_type #[doc = "DMA_CH0 peripheral singleton"]
DMA_CH0 <= virtual(AHB_PDMA_IN_CH0 : { bind_dma_in_interrupt,
enable_dma_in_interrupt, disable_dma_in_interrupt }, AHB_PDMA_OUT_CH0 : {
bind_dma_out_interrupt, enable_dma_out_interrupt, disable_dma_out_interrupt })
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"DMA_CH1 peripheral singleton"] DMA_CH1 <= virtual(AHB_PDMA_IN_CH1 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH1 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable))); _for_each_inner_peripheral!((@
peri_type #[doc = "DMA_CH2 peripheral singleton"] DMA_CH2 <=
virtual(AHB_PDMA_IN_CH2 : { bind_dma_in_interrupt, enable_dma_in_interrupt,
disable_dma_in_interrupt }, AHB_PDMA_OUT_CH2 : { bind_dma_out_interrupt,
enable_dma_out_interrupt, disable_dma_out_interrupt }) (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "DMA_CH3 peripheral singleton"]
DMA_CH3 <= virtual(AHB_PDMA_IN_CH3 : { bind_dma_in_interrupt,
enable_dma_in_interrupt, disable_dma_in_interrupt }, AHB_PDMA_OUT_CH3 : {
bind_dma_out_interrupt, enable_dma_out_interrupt, disable_dma_out_interrupt })
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"DMA_CH4 peripheral singleton"] DMA_CH4 <= virtual(AHB_PDMA_IN_CH4 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH4 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable))); _for_each_inner_peripheral!((@
peri_type #[doc = "DMA_AXI_CH0 peripheral singleton"] DMA_AXI_CH0 <=
virtual(AXI_PDMA_IN_CH0 : { bind_dma_in_interrupt, enable_dma_in_interrupt,
disable_dma_in_interrupt }, AXI_PDMA_OUT_CH0 : { bind_dma_out_interrupt,
enable_dma_out_interrupt, disable_dma_out_interrupt }) (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"DMA_AXI_CH1 peripheral singleton"] DMA_AXI_CH1 <= virtual(AXI_PDMA_IN_CH1 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AXI_PDMA_OUT_CH1 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable))); _for_each_inner_peripheral!((@
peri_type #[doc = "DMA_AXI_CH2 peripheral singleton"] DMA_AXI_CH2 <=
virtual(AXI_PDMA_IN_CH2 : { bind_dma_in_interrupt, enable_dma_in_interrupt,
disable_dma_in_interrupt }, AXI_PDMA_OUT_CH2 : { bind_dma_out_interrupt,
enable_dma_out_interrupt, disable_dma_out_interrupt }) (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT0_UNIT0 peripheral singleton"] PCNT0_UNIT0 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT0_UNIT1 peripheral singleton"] PCNT0_UNIT1 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT0_UNIT2 peripheral singleton"] PCNT0_UNIT2 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT0_UNIT3 peripheral singleton"] PCNT0_UNIT3 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT1_UNIT0 peripheral singleton"] PCNT1_UNIT0 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT1_UNIT1 peripheral singleton"] PCNT1_UNIT1 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT1_UNIT2 peripheral singleton"] PCNT1_UNIT2 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT1_UNIT3 peripheral singleton"] PCNT1_UNIT3 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SDM_CH0 peripheral singleton"]
SDM_CH0 <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc
= "SDM_CH1 peripheral singleton"] SDM_CH1 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SDM_CH2 peripheral singleton"]
SDM_CH2 <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc
= "SDM_CH3 peripheral singleton"] SDM_CH3 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SDM_CH4 peripheral singleton"]
SDM_CH4 <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc
= "SDM_CH5 peripheral singleton"] SDM_CH5 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SDM_CH6 peripheral singleton"]
SDM_CH6 <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc
= "SDM_CH7 peripheral singleton"] SDM_CH7 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "AES peripheral singleton"] AES
<= AES(AES : { bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt
}) (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"APB_SARADC peripheral singleton"] APB_SARADC <= ADC() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"ASSIST_DEBUG peripheral singleton"] ASSIST_DEBUG <= ASSIST_DEBUG() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "CACHE peripheral singleton"]
CACHE <= CACHE() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"CLIC peripheral singleton"] CLIC <= CLIC() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "CLINT peripheral singleton"]
CLINT <= CLINT() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"CLINT_OTHER_CORE peripheral singleton"] CLINT_OTHER_CORE <= CLINT_OTHER_CORE()
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"CNNT_SYS peripheral singleton"] CNNT_SYS <= CNNT_SYS() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"CNNT_IO_MUX peripheral singleton"] CNNT_IO_MUX <= CNNT_IO_MUX() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "ETH peripheral singleton"] ETH
<= virtual(SBD : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }) (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "EMAC_DMA peripheral singleton"] EMAC_DMA <= GMAC_DMA() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "EMAC_MAC peripheral singleton"]
EMAC_MAC <= GMAC() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"ECC peripheral singleton"] ECC <= ECC() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "EFUSE peripheral singleton"]
EFUSE <= EFUSE() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO peripheral singleton"] GPIO <= GPIO() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "GPIO_SD peripheral singleton"]
GPIO_SD <= GPIO_EXT() (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "HP_APM peripheral singleton"] HP_APM <= HP_APM() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"HP_MEM_APM peripheral singleton"] HP_MEM_APM <= HP_MEM_APM() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "HP_SYS peripheral singleton"]
HP_SYS <= HP_SYS() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"HP_ALIVE_SYS peripheral singleton"] HP_ALIVE_SYS <= HP_ALIVE_SYS() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"HP_SYS_CLKRST peripheral singleton"] HP_SYS_CLKRST <= HP_SYS_CLKRST()
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"I2C0 peripheral singleton"] I2C0 <= I2C0(I2C0 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt })));
_for_each_inner_peripheral!((@ peri_type #[doc = "I2C1 peripheral singleton"]
I2C1 <= I2C1(I2C1 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }))); _for_each_inner_peripheral!((@ peri_type #[doc =
"I2S0 peripheral singleton"] I2S0 <= I2S0(I2S0 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt }) (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "I2S1 peripheral singleton"]
I2S1 <= I2S1(I2S1 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }) (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "IEEE802154 peripheral singleton"] IEEE802154 <= IEEE802154(MODEM_ZB_MAC
: { bind_mac_interrupt, enable_mac_interrupt, disable_mac_interrupt })
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"INTERRUPT_CORE0 peripheral singleton"] INTERRUPT_CORE0 <= INTERRUPT_CORE0()
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"INTERRUPT_CORE1 peripheral singleton"] INTERRUPT_CORE1 <= INTERRUPT_CORE1()
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"IO_MUX peripheral singleton"] IO_MUX <= IO_MUX() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "LCD_CAM peripheral singleton"]
LCD_CAM <= LCD_CAM(LCD_CAM : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }) (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "IOMUX_MSPI_PIN peripheral singleton"] IOMUX_MSPI_PIN <= IOMUX_MSPI_PIN()
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"LP_AON_CLK_RST peripheral singleton"] LP_AON_CLK_RST <= LP_AON_CLKRST()
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"LP_APM peripheral singleton"] LP_APM <= LP_APM() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "LP_GPIO peripheral singleton"]
LP_GPIO <= LP_GPIO() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc
= "LP_IO_MUX peripheral singleton"] LP_IO_MUX <= LP_IO_MUX() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "LP_PERI peripheral singleton"]
LP_PERI <= LP_PERICLKRST() (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "LP_SYS peripheral singleton"] LP_SYS <= LP_SYS() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "LP_TEE peripheral singleton"]
LP_TEE <= LP_TEE() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"LP_WDT peripheral singleton"] LP_WDT <= LP_WDT() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "LPWR peripheral singleton"]
LPWR <= PMU() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"MEM_MONITOR peripheral singleton"] MEM_MONITOR <= MEM_MONITOR0() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"MODEM_LPCON peripheral singleton"] MODEM_LPCON <= MODEM_LPCON() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"MODEM_SYSCON peripheral singleton"] MODEM_SYSCON <= MODEM_SYSCON() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "PAU peripheral singleton"] PAU
<= PAU() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"PCNT peripheral singleton"] PCNT <= PCNT(PCNT0 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt }) (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "PCNT1 peripheral singleton"]
PCNT1 <= PCNT1(PCNT1 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }) (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "PMU peripheral singleton"] PMU <= PMU() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"RTC_TIMER peripheral singleton"] RTC_TIMER <= LP_TIMER() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "RNG peripheral singleton"] RNG
<= TRNG() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"RMT peripheral singleton"] RMT <= RMT(RMT : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt }) (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "RSA peripheral singleton"] RSA
<= RSA(RSA : { bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt
}) (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"SPI0 peripheral singleton"] SPI0 <= SPI0() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SPI1 peripheral singleton"]
SPI1 <= SPI1() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"MEMSPI2 peripheral singleton"] MEMSPI2 <= MEMSPI2() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "MEMSPI3 peripheral singleton"]
MEMSPI3 <= MEMSPI3() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc
= "SPI2 peripheral singleton"] SPI2 <= SPI2(SPI2 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt })));
_for_each_inner_peripheral!((@ peri_type #[doc = "SPI3 peripheral singleton"]
SPI3 <= SPI3(SPI3 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }))); _for_each_inner_peripheral!((@ peri_type #[doc =
"AXI_GDMA peripheral singleton"] AXI_GDMA <= AXI_DMA() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "DMA peripheral singleton"] DMA
<= AHB_DMA() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"SHA peripheral singleton"] SHA <= SHA() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SYSTEM peripheral singleton"]
SYSTEM <= HP_SYS() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"SYSTIMER peripheral singleton"] SYSTIMER <= SYSTIMER() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "SDHOST peripheral singleton"]
SDHOST <= SDHOST() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"TEE peripheral singleton"] TEE <= TEE() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "TIMG0 peripheral singleton"]
TIMG0 <= TIMG0() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"TIMG1 peripheral singleton"] TIMG1 <= TIMG1() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "UART0 peripheral singleton"]
UART0 <= UART0(UART0 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }))); _for_each_inner_peripheral!((@ peri_type #[doc =
"UART1 peripheral singleton"] UART1 <= UART1(UART1 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt })));
_for_each_inner_peripheral!((@ peri_type #[doc = "UART2 peripheral singleton"]
UART2 <= UART2(UART2 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }))); _for_each_inner_peripheral!((@ peri_type #[doc =
"UART3 peripheral singleton"] UART3 <= UART3(UART3 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt })));
_for_each_inner_peripheral!((@ peri_type #[doc = "UHCI0 peripheral singleton"]
UHCI0 <= UHCI0() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"USB_DEVICE peripheral singleton"] USB_DEVICE <= USB_DEVICE(USB_DEVICE : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"USB_HS peripheral singleton"] USB_HS <= USB_OTG_HS(USB_OTG_HS : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"ADC1 peripheral singleton"] ADC1 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "ADC2 peripheral singleton"]
ADC2 <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"FLASH peripheral singleton"] FLASH <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "PSRAM peripheral singleton"]
PSRAM <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type #[doc =
"GPIO_DEDICATED peripheral singleton"] GPIO_DEDICATED <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc = "WIFI peripheral singleton"]
WIFI <= virtual(MODEM_WIFI_BB : { bind_bb_interrupt, enable_bb_interrupt,
disable_bb_interrupt }, MODEM_WIFI_MAC : { bind_mac_interrupt,
enable_mac_interrupt, disable_mac_interrupt }, MODEM_WIFI_PWR : {
bind_pwr_interrupt, enable_pwr_interrupt, disable_pwr_interrupt })));
_for_each_inner_peripheral!((@ peri_type #[doc = "CPU_CTRL peripheral singleton"]
CPU_CTRL <= virtual() (unstable))); _for_each_inner_peripheral!((@ peri_type
#[doc = "IPC peripheral singleton"] IPC <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"FROM_CPU_INTR0 peripheral singleton"] FROM_CPU_INTR0 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"FROM_CPU_INTR1 peripheral singleton"] FROM_CPU_INTR1 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"FROM_CPU_INTR2 peripheral singleton"] FROM_CPU_INTR2 <= virtual() (unstable)));
_for_each_inner_peripheral!((@ peri_type #[doc =
"FROM_CPU_INTR3 peripheral singleton"] FROM_CPU_INTR3 <= virtual() (unstable)));
_for_each_inner_peripheral!((#[cfg(not(use_xtal32k))] GPIO0));
_for_each_inner_peripheral!((#[cfg(not(use_xtal32k))] GPIO1));
_for_each_inner_peripheral!((GPIO2)); _for_each_inner_peripheral!((GPIO3));
_for_each_inner_peripheral!((GPIO4)); _for_each_inner_peripheral!((GPIO5));
_for_each_inner_peripheral!((GPIO6)); _for_each_inner_peripheral!((GPIO7));
_for_each_inner_peripheral!((GPIO8)); _for_each_inner_peripheral!((GPIO9));
_for_each_inner_peripheral!((GPIO10)); _for_each_inner_peripheral!((GPIO11));
_for_each_inner_peripheral!((GPIO12)); _for_each_inner_peripheral!((GPIO13));
_for_each_inner_peripheral!((GPIO14)); _for_each_inner_peripheral!((GPIO15));
_for_each_inner_peripheral!((GPIO16)); _for_each_inner_peripheral!((GPIO17));
_for_each_inner_peripheral!((GPIO18)); _for_each_inner_peripheral!((GPIO19));
_for_each_inner_peripheral!((GPIO20)); _for_each_inner_peripheral!((GPIO21));
_for_each_inner_peripheral!((GPIO22)); _for_each_inner_peripheral!((GPIO23));
_for_each_inner_peripheral!((GPIO24)); _for_each_inner_peripheral!((GPIO25));
_for_each_inner_peripheral!((GPIO26)); _for_each_inner_peripheral!((GPIO27));
_for_each_inner_peripheral!((GPIO28)); _for_each_inner_peripheral!((GPIO30));
_for_each_inner_peripheral!((GPIO31)); _for_each_inner_peripheral!((GPIO32));
_for_each_inner_peripheral!((GPIO33)); _for_each_inner_peripheral!((GPIO34));
_for_each_inner_peripheral!((GPIO35)); _for_each_inner_peripheral!((GPIO36));
_for_each_inner_peripheral!((GPIO37)); _for_each_inner_peripheral!((GPIO38));
_for_each_inner_peripheral!((GPIO39)); _for_each_inner_peripheral!((GPIO40));
_for_each_inner_peripheral!((GPIO42)); _for_each_inner_peripheral!((GPIO43));
_for_each_inner_peripheral!((GPIO44)); _for_each_inner_peripheral!((GPIO45));
_for_each_inner_peripheral!((GPIO46)); _for_each_inner_peripheral!((GPIO47));
_for_each_inner_peripheral!((GPIO48)); _for_each_inner_peripheral!((GPIO49));
_for_each_inner_peripheral!((GPIO50)); _for_each_inner_peripheral!((GPIO51));
_for_each_inner_peripheral!((GPIO52)); _for_each_inner_peripheral!((GPIO53));
_for_each_inner_peripheral!((GPIO54)); _for_each_inner_peripheral!((GPIO55));
_for_each_inner_peripheral!((GPIO56)); _for_each_inner_peripheral!((GPIO57));
_for_each_inner_peripheral!((GPIO58)); _for_each_inner_peripheral!((GPIO59));
_for_each_inner_peripheral!((GPIO60)); _for_each_inner_peripheral!((GPIO61));
_for_each_inner_peripheral!((DMA_CH0(unstable)));
_for_each_inner_peripheral!((DMA_CH1(unstable)));
_for_each_inner_peripheral!((DMA_CH2(unstable)));
_for_each_inner_peripheral!((DMA_CH3(unstable)));
_for_each_inner_peripheral!((DMA_CH4(unstable)));
_for_each_inner_peripheral!((DMA_AXI_CH0(unstable)));
_for_each_inner_peripheral!((DMA_AXI_CH1(unstable)));
_for_each_inner_peripheral!((DMA_AXI_CH2(unstable)));
_for_each_inner_peripheral!((PCNT0_UNIT0(unstable)));
_for_each_inner_peripheral!((PCNT0_UNIT1(unstable)));
_for_each_inner_peripheral!((PCNT0_UNIT2(unstable)));
_for_each_inner_peripheral!((PCNT0_UNIT3(unstable)));
_for_each_inner_peripheral!((PCNT1_UNIT0(unstable)));
_for_each_inner_peripheral!((PCNT1_UNIT1(unstable)));
_for_each_inner_peripheral!((PCNT1_UNIT2(unstable)));
_for_each_inner_peripheral!((PCNT1_UNIT3(unstable)));
_for_each_inner_peripheral!((SDM_CH0(unstable)));
_for_each_inner_peripheral!((SDM_CH1(unstable)));
_for_each_inner_peripheral!((SDM_CH2(unstable)));
_for_each_inner_peripheral!((SDM_CH3(unstable)));
_for_each_inner_peripheral!((SDM_CH4(unstable)));
_for_each_inner_peripheral!((SDM_CH5(unstable)));
_for_each_inner_peripheral!((SDM_CH6(unstable)));
_for_each_inner_peripheral!((SDM_CH7(unstable)));
_for_each_inner_peripheral!((AES(unstable)));
_for_each_inner_peripheral!((APB_SARADC(unstable)));
_for_each_inner_peripheral!((ASSIST_DEBUG(unstable)));
_for_each_inner_peripheral!((CACHE(unstable)));
_for_each_inner_peripheral!((CLIC(unstable)));
_for_each_inner_peripheral!((CLINT(unstable)));
_for_each_inner_peripheral!((CLINT_OTHER_CORE(unstable)));
_for_each_inner_peripheral!((ETH(unstable)));
_for_each_inner_peripheral!((ECC(unstable)));
_for_each_inner_peripheral!((GPIO(unstable)));
_for_each_inner_peripheral!((GPIO_SD(unstable)));
_for_each_inner_peripheral!((HP_APM(unstable)));
_for_each_inner_peripheral!((HP_MEM_APM(unstable)));
_for_each_inner_peripheral!((HP_SYS(unstable)));
_for_each_inner_peripheral!((HP_ALIVE_SYS(unstable)));
_for_each_inner_peripheral!((HP_SYS_CLKRST(unstable)));
_for_each_inner_peripheral!((I2C0)); _for_each_inner_peripheral!((I2C1));
_for_each_inner_peripheral!((I2S0(unstable)));
_for_each_inner_peripheral!((I2S1(unstable)));
_for_each_inner_peripheral!((IEEE802154(unstable)));
_for_each_inner_peripheral!((INTERRUPT_CORE0(unstable)));
_for_each_inner_peripheral!((INTERRUPT_CORE1(unstable)));
_for_each_inner_peripheral!((IO_MUX(unstable)));
_for_each_inner_peripheral!((LCD_CAM(unstable)));
_for_each_inner_peripheral!((LP_AON_CLK_RST(unstable)));
_for_each_inner_peripheral!((LP_APM(unstable)));
_for_each_inner_peripheral!((LP_GPIO(unstable)));
_for_each_inner_peripheral!((LP_IO_MUX(unstable)));
_for_each_inner_peripheral!((LP_PERI(unstable)));
_for_each_inner_peripheral!((LP_SYS(unstable)));
_for_each_inner_peripheral!((LP_TEE(unstable)));
_for_each_inner_peripheral!((LP_WDT(unstable)));
_for_each_inner_peripheral!((LPWR(unstable)));
_for_each_inner_peripheral!((MEM_MONITOR(unstable)));
_for_each_inner_peripheral!((MODEM_LPCON(unstable)));
_for_each_inner_peripheral!((MODEM_SYSCON(unstable)));
_for_each_inner_peripheral!((PAU(unstable)));
_for_each_inner_peripheral!((PCNT(unstable)));
_for_each_inner_peripheral!((PCNT1(unstable)));
_for_each_inner_peripheral!((PMU(unstable)));
_for_each_inner_peripheral!((RTC_TIMER(unstable)));
_for_each_inner_peripheral!((RNG(unstable)));
_for_each_inner_peripheral!((RMT(unstable)));
_for_each_inner_peripheral!((RSA(unstable)));
_for_each_inner_peripheral!((SPI0(unstable)));
_for_each_inner_peripheral!((SPI1(unstable)));
_for_each_inner_peripheral!((SPI2)); _for_each_inner_peripheral!((SPI3));
_for_each_inner_peripheral!((AXI_GDMA(unstable)));
_for_each_inner_peripheral!((DMA(unstable)));
_for_each_inner_peripheral!((SHA(unstable)));
_for_each_inner_peripheral!((SYSTEM(unstable)));
_for_each_inner_peripheral!((SYSTIMER(unstable)));
_for_each_inner_peripheral!((SDHOST(unstable)));
_for_each_inner_peripheral!((TEE(unstable)));
_for_each_inner_peripheral!((TIMG0(unstable)));
_for_each_inner_peripheral!((TIMG1(unstable)));
_for_each_inner_peripheral!((UART0)); _for_each_inner_peripheral!((UART1));
_for_each_inner_peripheral!((UART2)); _for_each_inner_peripheral!((UART3));
_for_each_inner_peripheral!((UHCI0(unstable)));
_for_each_inner_peripheral!((USB_DEVICE(unstable)));
_for_each_inner_peripheral!((USB_HS(unstable)));
_for_each_inner_peripheral!((ADC1(unstable)));
_for_each_inner_peripheral!((ADC2(unstable)));
_for_each_inner_peripheral!((FLASH(unstable)));
_for_each_inner_peripheral!((PSRAM(unstable)));
_for_each_inner_peripheral!((GPIO_DEDICATED(unstable)));
_for_each_inner_peripheral!((WIFI));
_for_each_inner_peripheral!((CPU_CTRL(unstable)));
_for_each_inner_peripheral!((IPC(unstable)));
_for_each_inner_peripheral!((FROM_CPU_INTR0(unstable)));
_for_each_inner_peripheral!((FROM_CPU_INTR1(unstable)));
_for_each_inner_peripheral!((FROM_CPU_INTR2(unstable)));
_for_each_inner_peripheral!((FROM_CPU_INTR3(unstable)));
_for_each_inner_peripheral!((UHCI0, Uhci0, 0, AhbGdmaChannel));
_for_each_inner_peripheral!((LCD_CAM, LcdCam, 0, AxiGdmaChannel));
_for_each_inner_peripheral!((I2S0, I2s0, 1, AhbGdmaChannel));
_for_each_inner_peripheral!((SPI2, Spi2, 1, AxiGdmaChannel));
_for_each_inner_peripheral!((SPI3, Spi3, 2, AxiGdmaChannel));
_for_each_inner_peripheral!((AES, Aes, 4, AxiGdmaChannel));
_for_each_inner_peripheral!((I2S1, I2s1, 5, AhbGdmaChannel));
_for_each_inner_peripheral!((SHA, Sha, 5, AxiGdmaChannel));
_for_each_inner_peripheral!((all(@ peri_type #[doc =
"GPIO0 peripheral singleton"] GPIO0 <= virtual()), (@ peri_type #[doc =
"GPIO1 peripheral singleton"] GPIO1 <= virtual()), (@ peri_type #[doc =
"GPIO2 peripheral singleton"] GPIO2 <= virtual()), (@ peri_type #[doc =
"GPIO3 peripheral singleton"] GPIO3 <= virtual()), (@ peri_type #[doc =
"GPIO4 peripheral singleton"] GPIO4 <= virtual()), (@ peri_type #[doc =
"GPIO5 peripheral singleton"] GPIO5 <= virtual()), (@ peri_type #[doc =
"GPIO6 peripheral singleton"] GPIO6 <= virtual()), (@ peri_type #[doc =
"GPIO7 peripheral singleton"] GPIO7 <= virtual()), (@ peri_type #[doc =
"GPIO8 peripheral singleton"] GPIO8 <= virtual()), (@ peri_type #[doc =
"GPIO9 peripheral singleton"] GPIO9 <= virtual()), (@ peri_type #[doc =
"GPIO10 peripheral singleton"] GPIO10 <= virtual()), (@ peri_type #[doc =
"GPIO11 peripheral singleton"] GPIO11 <= virtual()), (@ peri_type #[doc =
"GPIO12 peripheral singleton"] GPIO12 <= virtual()), (@ peri_type #[doc =
"GPIO13 peripheral singleton"] GPIO13 <= virtual()), (@ peri_type #[doc =
"GPIO14 peripheral singleton"] GPIO14 <= virtual()), (@ peri_type #[doc =
"GPIO15 peripheral singleton"] GPIO15 <= virtual()), (@ peri_type #[doc =
"GPIO16 peripheral singleton"] GPIO16 <= virtual()), (@ peri_type #[doc =
"GPIO17 peripheral singleton"] GPIO17 <= virtual()), (@ peri_type #[doc =
"GPIO18 peripheral singleton"] GPIO18 <= virtual()), (@ peri_type #[doc =
"GPIO19 peripheral singleton"] GPIO19 <= virtual()), (@ peri_type #[doc =
"GPIO20 peripheral singleton"] GPIO20 <= virtual()), (@ peri_type #[doc =
"GPIO21 peripheral singleton"] GPIO21 <= virtual()), (@ peri_type #[doc =
"GPIO22 peripheral singleton"] GPIO22 <= virtual()), (@ peri_type #[doc =
"GPIO23 peripheral singleton"] GPIO23 <= virtual()), (@ peri_type #[doc =
"GPIO24 peripheral singleton"] GPIO24 <= virtual()), (@ peri_type #[doc =
"GPIO25 peripheral singleton"] GPIO25 <= virtual()), (@ peri_type #[doc =
"GPIO26 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO26 <= virtual()), (@ peri_type #[doc =
"GPIO27 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO27 <= virtual()), (@ peri_type #[doc =
"GPIO28 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO28 <= virtual()), (@ peri_type #[doc =
"GPIO30 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO30 <= virtual()), (@ peri_type #[doc =
"GPIO31 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO31 <= virtual()), (@ peri_type #[doc =
"GPIO32 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin may be reserved for interfacing with SPI flash.</li>"] #[doc =
"</ul>"] #[doc = "</section>"] GPIO32 <= virtual()), (@ peri_type #[doc =
"GPIO33 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using USB.</li>"] #[doc = "</ul>"]
#[doc = "</section>"] GPIO33 <= virtual()), (@ peri_type #[doc =
"GPIO34 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using USB.</li>"] #[doc = "</ul>"]
#[doc = "</section>"] GPIO34 <= virtual()), (@ peri_type #[doc =
"GPIO35 peripheral singleton"] GPIO35 <= virtual()), (@ peri_type #[doc =
"GPIO36 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO36 <= virtual()), (@ peri_type #[doc =
"GPIO37 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO37 <= virtual()), (@ peri_type #[doc =
"GPIO38 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO38 <= virtual()), (@ peri_type #[doc =
"GPIO39 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO39 <= virtual()), (@ peri_type #[doc =
"GPIO40 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO40 <= virtual()), (@ peri_type #[doc =
"GPIO42 peripheral singleton"] GPIO42 <= virtual()), (@ peri_type #[doc =
"GPIO43 peripheral singleton"] GPIO43 <= virtual()), (@ peri_type #[doc =
"GPIO44 peripheral singleton"] GPIO44 <= virtual()), (@ peri_type #[doc =
"GPIO45 peripheral singleton"] GPIO45 <= virtual()), (@ peri_type #[doc =
"GPIO46 peripheral singleton"] GPIO46 <= virtual()), (@ peri_type #[doc =
"GPIO47 peripheral singleton"] GPIO47 <= virtual()), (@ peri_type #[doc =
"GPIO48 peripheral singleton"] GPIO48 <= virtual()), (@ peri_type #[doc =
"GPIO49 peripheral singleton"] GPIO49 <= virtual()), (@ peri_type #[doc =
"GPIO50 peripheral singleton"] GPIO50 <= virtual()), (@ peri_type #[doc =
"GPIO51 peripheral singleton"] GPIO51 <= virtual()), (@ peri_type #[doc =
"GPIO52 peripheral singleton"] GPIO52 <= virtual()), (@ peri_type #[doc =
"GPIO53 peripheral singleton"] GPIO53 <= virtual()), (@ peri_type #[doc =
"GPIO54 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO54 <= virtual()), (@ peri_type #[doc =
"GPIO55 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO55 <= virtual()), (@ peri_type #[doc =
"GPIO56 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO56 <= virtual()), (@ peri_type #[doc =
"GPIO57 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>These pins may be used to debug the chip using an external JTAG debugger.</li>"]
#[doc = "</ul>"] #[doc = "</section>"] GPIO57 <= virtual()), (@ peri_type #[doc =
"GPIO58 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>By default, this pin is used by the UART programming interface.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO58 <= virtual()), (@ peri_type #[doc =
"GPIO59 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>By default, this pin is used by the UART programming interface.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO59 <= virtual()), (@ peri_type #[doc =
"GPIO60 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO60 <= virtual()), (@ peri_type #[doc =
"GPIO61 peripheral singleton (Limitations exist)"] #[doc = ""] #[doc =
"<section class=\"warning\">"] #[doc =
"This pin may be available with certain limitations. Check your hardware to make sure whether you can use it."]
#[doc = "<ul>"] #[doc =
"<li>This pin is a strapping pin, it determines how the chip boots.</li>"] #[doc
= "</ul>"] #[doc = "</section>"] GPIO61 <= virtual()), (@ peri_type #[doc =
"DMA_CH0 peripheral singleton"] DMA_CH0 <= virtual(AHB_PDMA_IN_CH0 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH0 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_CH1 peripheral singleton"] DMA_CH1 <= virtual(AHB_PDMA_IN_CH1 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH1 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_CH2 peripheral singleton"] DMA_CH2 <= virtual(AHB_PDMA_IN_CH2 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH2 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_CH3 peripheral singleton"] DMA_CH3 <= virtual(AHB_PDMA_IN_CH3 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH3 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_CH4 peripheral singleton"] DMA_CH4 <= virtual(AHB_PDMA_IN_CH4 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AHB_PDMA_OUT_CH4 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_AXI_CH0 peripheral singleton"] DMA_AXI_CH0 <= virtual(AXI_PDMA_IN_CH0 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AXI_PDMA_OUT_CH0 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_AXI_CH1 peripheral singleton"] DMA_AXI_CH1 <= virtual(AXI_PDMA_IN_CH1 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AXI_PDMA_OUT_CH1 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"DMA_AXI_CH2 peripheral singleton"] DMA_AXI_CH2 <= virtual(AXI_PDMA_IN_CH2 : {
bind_dma_in_interrupt, enable_dma_in_interrupt, disable_dma_in_interrupt },
AXI_PDMA_OUT_CH2 : { bind_dma_out_interrupt, enable_dma_out_interrupt,
disable_dma_out_interrupt }) (unstable)), (@ peri_type #[doc =
"PCNT0_UNIT0 peripheral singleton"] PCNT0_UNIT0 <= virtual() (unstable)), (@
peri_type #[doc = "PCNT0_UNIT1 peripheral singleton"] PCNT0_UNIT1 <= virtual()
(unstable)), (@ peri_type #[doc = "PCNT0_UNIT2 peripheral singleton"] PCNT0_UNIT2
<= virtual() (unstable)), (@ peri_type #[doc =
"PCNT0_UNIT3 peripheral singleton"] PCNT0_UNIT3 <= virtual() (unstable)), (@
peri_type #[doc = "PCNT1_UNIT0 peripheral singleton"] PCNT1_UNIT0 <= virtual()
(unstable)), (@ peri_type #[doc = "PCNT1_UNIT1 peripheral singleton"] PCNT1_UNIT1
<= virtual() (unstable)), (@ peri_type #[doc =
"PCNT1_UNIT2 peripheral singleton"] PCNT1_UNIT2 <= virtual() (unstable)), (@
peri_type #[doc = "PCNT1_UNIT3 peripheral singleton"] PCNT1_UNIT3 <= virtual()
(unstable)), (@ peri_type #[doc = "SDM_CH0 peripheral singleton"] SDM_CH0 <=
virtual() (unstable)), (@ peri_type #[doc = "SDM_CH1 peripheral singleton"]
SDM_CH1 <= virtual() (unstable)), (@ peri_type #[doc =
"SDM_CH2 peripheral singleton"] SDM_CH2 <= virtual() (unstable)), (@ peri_type
#[doc = "SDM_CH3 peripheral singleton"] SDM_CH3 <= virtual() (unstable)), (@
peri_type #[doc = "SDM_CH4 peripheral singleton"] SDM_CH4 <= virtual()
(unstable)), (@ peri_type #[doc = "SDM_CH5 peripheral singleton"] SDM_CH5 <=
virtual() (unstable)), (@ peri_type #[doc = "SDM_CH6 peripheral singleton"]
SDM_CH6 <= virtual() (unstable)), (@ peri_type #[doc =
"SDM_CH7 peripheral singleton"] SDM_CH7 <= virtual() (unstable)), (@ peri_type
#[doc = "AES peripheral singleton"] AES <= AES(AES : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt }) (unstable)), (@ peri_type #[doc
= "APB_SARADC peripheral singleton"] APB_SARADC <= ADC() (unstable)), (@
peri_type #[doc = "ASSIST_DEBUG peripheral singleton"] ASSIST_DEBUG <=
ASSIST_DEBUG() (unstable)), (@ peri_type #[doc = "CACHE peripheral singleton"]
CACHE <= CACHE() (unstable)), (@ peri_type #[doc = "CLIC peripheral singleton"]
CLIC <= CLIC() (unstable)), (@ peri_type #[doc = "CLINT peripheral singleton"]
CLINT <= CLINT() (unstable)), (@ peri_type #[doc =
"CLINT_OTHER_CORE peripheral singleton"] CLINT_OTHER_CORE <= CLINT_OTHER_CORE()
(unstable)), (@ peri_type #[doc = "CNNT_SYS peripheral singleton"] CNNT_SYS <=
CNNT_SYS() (unstable)), (@ peri_type #[doc = "CNNT_IO_MUX peripheral singleton"]
CNNT_IO_MUX <= CNNT_IO_MUX() (unstable)), (@ peri_type #[doc =
"ETH peripheral singleton"] ETH <= virtual(SBD : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt }) (unstable)), (@ peri_type #[doc
= "EMAC_DMA peripheral singleton"] EMAC_DMA <= GMAC_DMA() (unstable)), (@
peri_type #[doc = "EMAC_MAC peripheral singleton"] EMAC_MAC <= GMAC()
(unstable)), (@ peri_type #[doc = "ECC peripheral singleton"] ECC <= ECC()
(unstable)), (@ peri_type #[doc = "EFUSE peripheral singleton"] EFUSE <= EFUSE()
(unstable)), (@ peri_type #[doc = "GPIO peripheral singleton"] GPIO <= GPIO()
(unstable)), (@ peri_type #[doc = "GPIO_SD peripheral singleton"] GPIO_SD <=
GPIO_EXT() (unstable)), (@ peri_type #[doc = "HP_APM peripheral singleton"]
HP_APM <= HP_APM() (unstable)), (@ peri_type #[doc =
"HP_MEM_APM peripheral singleton"] HP_MEM_APM <= HP_MEM_APM() (unstable)), (@
peri_type #[doc = "HP_SYS peripheral singleton"] HP_SYS <= HP_SYS() (unstable)),
(@ peri_type #[doc = "HP_ALIVE_SYS peripheral singleton"] HP_ALIVE_SYS <=
HP_ALIVE_SYS() (unstable)), (@ peri_type #[doc =
"HP_SYS_CLKRST peripheral singleton"] HP_SYS_CLKRST <= HP_SYS_CLKRST()
(unstable)), (@ peri_type #[doc = "I2C0 peripheral singleton"] I2C0 <= I2C0(I2C0
: { bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (@
peri_type #[doc = "I2C1 peripheral singleton"] I2C1 <= I2C1(I2C1 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (@
peri_type #[doc = "I2S0 peripheral singleton"] I2S0 <= I2S0(I2S0 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "I2S1 peripheral singleton"] I2S1 <= I2S1(I2S1
: { bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "IEEE802154 peripheral singleton"] IEEE802154
<= IEEE802154(MODEM_ZB_MAC : { bind_mac_interrupt, enable_mac_interrupt,
disable_mac_interrupt }) (unstable)), (@ peri_type #[doc =
"INTERRUPT_CORE0 peripheral singleton"] INTERRUPT_CORE0 <= INTERRUPT_CORE0()
(unstable)), (@ peri_type #[doc = "INTERRUPT_CORE1 peripheral singleton"]
INTERRUPT_CORE1 <= INTERRUPT_CORE1() (unstable)), (@ peri_type #[doc =
"IO_MUX peripheral singleton"] IO_MUX <= IO_MUX() (unstable)), (@ peri_type #[doc
= "LCD_CAM peripheral singleton"] LCD_CAM <= LCD_CAM(LCD_CAM : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "IOMUX_MSPI_PIN peripheral singleton"]
IOMUX_MSPI_PIN <= IOMUX_MSPI_PIN() (unstable)), (@ peri_type #[doc =
"LP_AON_CLK_RST peripheral singleton"] LP_AON_CLK_RST <= LP_AON_CLKRST()
(unstable)), (@ peri_type #[doc = "LP_APM peripheral singleton"] LP_APM <=
LP_APM() (unstable)), (@ peri_type #[doc = "LP_GPIO peripheral singleton"]
LP_GPIO <= LP_GPIO() (unstable)), (@ peri_type #[doc =
"LP_IO_MUX peripheral singleton"] LP_IO_MUX <= LP_IO_MUX() (unstable)), (@
peri_type #[doc = "LP_PERI peripheral singleton"] LP_PERI <= LP_PERICLKRST()
(unstable)), (@ peri_type #[doc = "LP_SYS peripheral singleton"] LP_SYS <=
LP_SYS() (unstable)), (@ peri_type #[doc = "LP_TEE peripheral singleton"] LP_TEE
<= LP_TEE() (unstable)), (@ peri_type #[doc = "LP_WDT peripheral singleton"]
LP_WDT <= LP_WDT() (unstable)), (@ peri_type #[doc = "LPWR peripheral singleton"]
LPWR <= PMU() (unstable)), (@ peri_type #[doc =
"MEM_MONITOR peripheral singleton"] MEM_MONITOR <= MEM_MONITOR0() (unstable)), (@
peri_type #[doc = "MODEM_LPCON peripheral singleton"] MODEM_LPCON <=
MODEM_LPCON() (unstable)), (@ peri_type #[doc =
"MODEM_SYSCON peripheral singleton"] MODEM_SYSCON <= MODEM_SYSCON() (unstable)),
(@ peri_type #[doc = "PAU peripheral singleton"] PAU <= PAU() (unstable)), (@
peri_type #[doc = "PCNT peripheral singleton"] PCNT <= PCNT(PCNT0 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "PCNT1 peripheral singleton"] PCNT1 <=
PCNT1(PCNT1 : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }) (unstable)), (@ peri_type #[doc =
"PMU peripheral singleton"] PMU <= PMU() (unstable)), (@ peri_type #[doc =
"RTC_TIMER peripheral singleton"] RTC_TIMER <= LP_TIMER() (unstable)), (@
peri_type #[doc = "RNG peripheral singleton"] RNG <= TRNG() (unstable)), (@
peri_type #[doc = "RMT peripheral singleton"] RMT <= RMT(RMT : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "RSA peripheral singleton"] RSA <= RSA(RSA : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "SPI0 peripheral singleton"] SPI0 <= SPI0()
(unstable)), (@ peri_type #[doc = "SPI1 peripheral singleton"] SPI1 <= SPI1()
(unstable)), (@ peri_type #[doc = "MEMSPI2 peripheral singleton"] MEMSPI2 <=
MEMSPI2() (unstable)), (@ peri_type #[doc = "MEMSPI3 peripheral singleton"]
MEMSPI3 <= MEMSPI3() (unstable)), (@ peri_type #[doc =
"SPI2 peripheral singleton"] SPI2 <= SPI2(SPI2 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt })), (@ peri_type #[doc =
"SPI3 peripheral singleton"] SPI3 <= SPI3(SPI3 : { bind_peri_interrupt,
enable_peri_interrupt, disable_peri_interrupt })), (@ peri_type #[doc =
"AXI_GDMA peripheral singleton"] AXI_GDMA <= AXI_DMA() (unstable)), (@ peri_type
#[doc = "DMA peripheral singleton"] DMA <= AHB_DMA() (unstable)), (@ peri_type
#[doc = "SHA peripheral singleton"] SHA <= SHA() (unstable)), (@ peri_type #[doc
= "SYSTEM peripheral singleton"] SYSTEM <= HP_SYS() (unstable)), (@ peri_type
#[doc = "SYSTIMER peripheral singleton"] SYSTIMER <= SYSTIMER() (unstable)), (@
peri_type #[doc = "SDHOST peripheral singleton"] SDHOST <= SDHOST() (unstable)),
(@ peri_type #[doc = "TEE peripheral singleton"] TEE <= TEE() (unstable)), (@
peri_type #[doc = "TIMG0 peripheral singleton"] TIMG0 <= TIMG0() (unstable)), (@
peri_type #[doc = "TIMG1 peripheral singleton"] TIMG1 <= TIMG1() (unstable)), (@
peri_type #[doc = "UART0 peripheral singleton"] UART0 <= UART0(UART0 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (@
peri_type #[doc = "UART1 peripheral singleton"] UART1 <= UART1(UART1 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (@
peri_type #[doc = "UART2 peripheral singleton"] UART2 <= UART2(UART2 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (@
peri_type #[doc = "UART3 peripheral singleton"] UART3 <= UART3(UART3 : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })), (@
peri_type #[doc = "UHCI0 peripheral singleton"] UHCI0 <= UHCI0() (unstable)), (@
peri_type #[doc = "USB_DEVICE peripheral singleton"] USB_DEVICE <=
USB_DEVICE(USB_DEVICE : { bind_peri_interrupt, enable_peri_interrupt,
disable_peri_interrupt }) (unstable)), (@ peri_type #[doc =
"USB_HS peripheral singleton"] USB_HS <= USB_OTG_HS(USB_OTG_HS : {
bind_peri_interrupt, enable_peri_interrupt, disable_peri_interrupt })
(unstable)), (@ peri_type #[doc = "ADC1 peripheral singleton"] ADC1 <= virtual()
(unstable)), (@ peri_type #[doc = "ADC2 peripheral singleton"] ADC2 <= virtual()
(unstable)), (@ peri_type #[doc = "FLASH peripheral singleton"] FLASH <=
virtual() (unstable)), (@ peri_type #[doc = "PSRAM peripheral singleton"] PSRAM
<= virtual() (unstable)), (@ peri_type #[doc =
"GPIO_DEDICATED peripheral singleton"] GPIO_DEDICATED <= virtual() (unstable)),
(@ peri_type #[doc = "WIFI peripheral singleton"] WIFI <= virtual(MODEM_WIFI_BB :
{ bind_bb_interrupt, enable_bb_interrupt, disable_bb_interrupt }, MODEM_WIFI_MAC
: { bind_mac_interrupt, enable_mac_interrupt, disable_mac_interrupt },
MODEM_WIFI_PWR : { bind_pwr_interrupt, enable_pwr_interrupt,
disable_pwr_interrupt })), (@ peri_type #[doc = "CPU_CTRL peripheral singleton"]
CPU_CTRL <= virtual() (unstable)), (@ peri_type #[doc =
"IPC peripheral singleton"] IPC <= virtual() (unstable)), (@ peri_type #[doc =
"FROM_CPU_INTR0 peripheral singleton"] FROM_CPU_INTR0 <= virtual() (unstable)),
(@ peri_type #[doc = "FROM_CPU_INTR1 peripheral singleton"] FROM_CPU_INTR1 <=
virtual() (unstable)), (@ peri_type #[doc =
"FROM_CPU_INTR2 peripheral singleton"] FROM_CPU_INTR2 <= virtual() (unstable)),
(@ peri_type #[doc = "FROM_CPU_INTR3 peripheral singleton"] FROM_CPU_INTR3 <=
virtual() (unstable))));
_for_each_inner_peripheral!((singletons(#[cfg(not(use_xtal32k))] GPIO0),
(#[cfg(not(use_xtal32k))] GPIO1), (GPIO2), (GPIO3), (GPIO4), (GPIO5), (GPIO6),
(GPIO7), (GPIO8), (GPIO9), (GPIO10), (GPIO11), (GPIO12), (GPIO13), (GPIO14),
(GPIO15), (GPIO16), (GPIO17), (GPIO18), (GPIO19), (GPIO20), (GPIO21), (GPIO22),
(GPIO23), (GPIO24), (GPIO25), (GPIO26), (GPIO27), (GPIO28), (GPIO30), (GPIO31),
(GPIO32), (GPIO33), (GPIO34), (GPIO35), (GPIO36), (GPIO37), (GPIO38), (GPIO39),
(GPIO40), (GPIO42), (GPIO43), (GPIO44), (GPIO45), (GPIO46), (GPIO47), (GPIO48),
(GPIO49), (GPIO50), (GPIO51), (GPIO52), (GPIO53), (GPIO54), (GPIO55), (GPIO56),
(GPIO57), (GPIO58), (GPIO59), (GPIO60), (GPIO61), (DMA_CH0(unstable)),
(DMA_CH1(unstable)), (DMA_CH2(unstable)), (DMA_CH3(unstable)),
(DMA_CH4(unstable)), (DMA_AXI_CH0(unstable)), (DMA_AXI_CH1(unstable)),
(DMA_AXI_CH2(unstable)), (PCNT0_UNIT0(unstable)), (PCNT0_UNIT1(unstable)),
(PCNT0_UNIT2(unstable)), (PCNT0_UNIT3(unstable)), (PCNT1_UNIT0(unstable)),
(PCNT1_UNIT1(unstable)), (PCNT1_UNIT2(unstable)), (PCNT1_UNIT3(unstable)),
(SDM_CH0(unstable)), (SDM_CH1(unstable)), (SDM_CH2(unstable)),
(SDM_CH3(unstable)), (SDM_CH4(unstable)), (SDM_CH5(unstable)),
(SDM_CH6(unstable)), (SDM_CH7(unstable)), (AES(unstable)),
(APB_SARADC(unstable)), (ASSIST_DEBUG(unstable)), (CACHE(unstable)),
(CLIC(unstable)), (CLINT(unstable)), (CLINT_OTHER_CORE(unstable)),
(ETH(unstable)), (ECC(unstable)), (GPIO(unstable)), (GPIO_SD(unstable)),
(HP_APM(unstable)), (HP_MEM_APM(unstable)), (HP_SYS(unstable)),
(HP_ALIVE_SYS(unstable)), (HP_SYS_CLKRST(unstable)), (I2C0), (I2C1),
(I2S0(unstable)), (I2S1(unstable)), (IEEE802154(unstable)),
(INTERRUPT_CORE0(unstable)), (INTERRUPT_CORE1(unstable)), (IO_MUX(unstable)),
(LCD_CAM(unstable)), (LP_AON_CLK_RST(unstable)), (LP_APM(unstable)),
(LP_GPIO(unstable)), (LP_IO_MUX(unstable)), (LP_PERI(unstable)),
(LP_SYS(unstable)), (LP_TEE(unstable)), (LP_WDT(unstable)), (LPWR(unstable)),
(MEM_MONITOR(unstable)), (MODEM_LPCON(unstable)), (MODEM_SYSCON(unstable)),
(PAU(unstable)), (PCNT(unstable)), (PCNT1(unstable)), (PMU(unstable)),
(RTC_TIMER(unstable)), (RNG(unstable)), (RMT(unstable)), (RSA(unstable)),
(SPI0(unstable)), (SPI1(unstable)), (SPI2), (SPI3), (AXI_GDMA(unstable)),
(DMA(unstable)), (SHA(unstable)), (SYSTEM(unstable)), (SYSTIMER(unstable)),
(SDHOST(unstable)), (TEE(unstable)), (TIMG0(unstable)), (TIMG1(unstable)),
(UART0), (UART1), (UART2), (UART3), (UHCI0(unstable)), (USB_DEVICE(unstable)),
(USB_HS(unstable)), (ADC1(unstable)), (ADC2(unstable)), (FLASH(unstable)),
(PSRAM(unstable)), (GPIO_DEDICATED(unstable)), (WIFI), (CPU_CTRL(unstable)),
(IPC(unstable)), (FROM_CPU_INTR0(unstable)), (FROM_CPU_INTR1(unstable)),
(FROM_CPU_INTR2(unstable)), (FROM_CPU_INTR3(unstable))));
_for_each_inner_peripheral!((dma_eligible(UHCI0, Uhci0, 0, AhbGdmaChannel),
(LCD_CAM, LcdCam, 0, AxiGdmaChannel), (I2S0, I2s0, 1, AhbGdmaChannel), (SPI2,
Spi2, 1, AxiGdmaChannel), (SPI3, Spi3, 2, AxiGdmaChannel), (AES, Aes, 4,
AxiGdmaChannel), (I2S1, I2s1, 5, AhbGdmaChannel), (SHA, Sha, 5,
AxiGdmaChannel)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_gpio {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_gpio { $(($pattern) => $code;)* ($other : tt) => {}
} _for_each_inner_gpio!((0, GPIO0() () ([Input] [Output])));
_for_each_inner_gpio!((1, GPIO1() () ([Input] [Output])));
_for_each_inner_gpio!((2, GPIO2() (_3 => LCD_DATA_19) ([Input] [Output])));
_for_each_inner_gpio!((3, GPIO3() (_3 => LCD_DATA_20) ([Input] [Output])));
_for_each_inner_gpio!((4, GPIO4() (_3 => LCD_DATA_21) ([Input] [Output])));
_for_each_inner_gpio!((5, GPIO5() (_3 => LCD_DATA_22) ([Input] [Output])));
_for_each_inner_gpio!((6, GPIO6() () ([Input] [Output])));
_for_each_inner_gpio!((7, GPIO7() (_3 => LCD_DATA_23) ([Input] [Output])));
_for_each_inner_gpio!((8, GPIO8() (_2 => EMAC_TXD0 _3 => LCD_DATA_0) ([Input]
[Output]))); _for_each_inner_gpio!((9, GPIO9(_0 => FSPIHD _4 => DBG_PSRAM_CK) (_0
=> FSPIHD _2 => EMAC_TXD1 _3 => LCD_DATA_1 _4 => DBG_PSRAM_CK) ([Input]
[Output]))); _for_each_inner_gpio!((10, GPIO10(_0 => FSPICS0 _4 => DBG_PSRAM_CS)
(_0 => FSPICS0 _2 => EMAC_TXD2 _3 => LCD_DATA_2 _4 => DBG_PSRAM_CS) ([Input]
[Output]))); _for_each_inner_gpio!((11, GPIO11(_0 => FSPID _4 => DBG_PSRAM_D) (_0
=> FSPID _2 => EMAC_TXD3 _3 => LCD_DATA_3 _4 => DBG_PSRAM_D) ([Input]
[Output]))); _for_each_inner_gpio!((12, GPIO12(_0 => FSPICLK _4 => DBG_PSRAM_Q)
(_0 => FSPICLK _2 => EMAC_TXEN _3 => LCD_DATA_4 _4 => DBG_PSRAM_Q) ([Input]
[Output]))); _for_each_inner_gpio!((13, GPIO13(_0 => FSPIQ _2 => EMAC_RMII_CLK _4
=> DBG_PSRAM_WP) (_0 => FSPIQ _2 => EMAC_RMII_CLK _3 => LCD_DATA_5 _4 =>
DBG_PSRAM_WP) ([Input] [Output]))); _for_each_inner_gpio!((14, GPIO14(_0 =>
FSPIWP _2 => EMAC_RX_CLK _4 => DBG_PSRAM_HOLD) (_0 => FSPIWP _3 => LCD_DATA_6 _4
=> DBG_PSRAM_HOLD) ([Input] [Output]))); _for_each_inner_gpio!((15, GPIO15(_0 =>
FSPIIO4 _2 => EMAC_RXDV _4 => DBG_PSRAM_DQ4) (_0 => FSPIIO4 _3 => LCD_DATA_7 _4
=> DBG_PSRAM_DQ4) ([Input] [Output]))); _for_each_inner_gpio!((16, GPIO16(_0 =>
FSPIIO5 _2 => EMAC_RXD3 _4 => DBG_PSRAM_DQ5) (_0 => FSPIIO5 _3 => LCD_DATA_8 _4
=> DBG_PSRAM_DQ5) ([Input] [Output]))); _for_each_inner_gpio!((17, GPIO17(_0 =>
FSPIIO6 _2 => EMAC_RXD2 _4 => DBG_PSRAM_DQ6) (_0 => FSPIIO6 _3 => LCD_DATA_9 _4
=> DBG_PSRAM_DQ6) ([Input] [Output]))); _for_each_inner_gpio!((18, GPIO18(_0 =>
FSPIIO7 _2 => EMAC_RXD1 _4 => DBG_PSRAM_DQ7) (_0 => FSPIIO7 _3 => LCD_DATA_10 _4
=> DBG_PSRAM_DQ7) ([Input] [Output]))); _for_each_inner_gpio!((19, GPIO19(_2 =>
EMAC_RXD0 _4 => DBG_PSRAM_DQS_0) (_0 => FSPIDQS _3 => LCD_DATA_11 _4 =>
DBG_PSRAM_DQS_0) ([Input] [Output]))); _for_each_inner_gpio!((20, GPIO20(_0 =>
SD1_DATA0 _2 => FSPICLK _4 => DBG_FLASH_CK) (_0 => SD1_DATA0 _2 => FSPICLK _4 =>
DBG_FLASH_CK) ([Input] [Output]))); _for_each_inner_gpio!((21, GPIO21(_0 =>
SD1_DATA1 _2 => FSPID _4 => DBG_FLASH_D) (_0 => SD1_DATA1 _2 => FSPID _4 =>
DBG_FLASH_D) ([Input] [Output]))); _for_each_inner_gpio!((22, GPIO22(_0 =>
SD1_DATA2 _2 => FSPIQ _4 => DBG_FLASH_CS) (_0 => SD1_DATA2 _2 => FSPIQ _4 =>
DBG_FLASH_CS) ([Input] [Output]))); _for_each_inner_gpio!((23, GPIO23(_0 =>
SD1_DATA3 _2 => FSPICS0 _4 => DBG_FLASH_Q) (_0 => SD1_DATA3 _2 => FSPICS0 _4 =>
DBG_FLASH_Q) ([Input] [Output]))); _for_each_inner_gpio!((24, GPIO24(_0 =>
SD1_CLK _2 => FSPIHD _4 => DBG_FLASH_WP) (_0 => SD1_CLK _2 => FSPIHD _4 =>
DBG_FLASH_WP) ([Input] [Output]))); _for_each_inner_gpio!((25, GPIO25(_0 =>
SD1_CMD _2 => FSPIWP _4 => DBG_FLASH_HOLD) (_0 => SD1_CMD _2 => FSPIWP _4 =>
DBG_FLASH_HOLD) ([Input] [Output]))); _for_each_inner_gpio!((26, GPIO26(_0 =>
SPICS0) (_0 => SPICS0) ([Input] [Output]))); _for_each_inner_gpio!((27, GPIO27(_0
=> SPIQ) (_0 => SPIQ) ([Input] [Output]))); _for_each_inner_gpio!((28, GPIO28(_0
=> SPIWP) (_0 => SPIWP) ([Input] [Output]))); _for_each_inner_gpio!((30,
GPIO30(_0 => SPIHD) (_0 => SPIHD) ([Input] [Output])));
_for_each_inner_gpio!((31, GPIO31(_0 => SPICLK) (_0 => SPICLK) ([Input]
[Output]))); _for_each_inner_gpio!((32, GPIO32(_0 => SPID) (_0 => SPID) ([Input]
[Output]))); _for_each_inner_gpio!((33, GPIO33() (_3 => LCD_DATA_12) ([Input]
[Output]))); _for_each_inner_gpio!((34, GPIO34() (_3 => LCD_DATA_13) ([Input]
[Output]))); _for_each_inner_gpio!((35, GPIO35(_2 => REF_50M_CLK _4 =>
SD2_CDATA0) (_2 => REF_50M_CLK _3 => LCD_DATA_14 _4 => SD2_CDATA0) ([Input]
[Output]))); _for_each_inner_gpio!((36, GPIO36(_2 => EMAC_RXDV _4 => SD2_CDATA1)
(_3 => LCD_DATA_15 _4 => SD2_CDATA1) ([Input] [Output])));
_for_each_inner_gpio!((37, GPIO37(_4 => SD2_CDATA2) (_2 => EMAC_TXEN _3 =>
LCD_DATA_16 _4 => SD2_CDATA2) ([Input] [Output]))); _for_each_inner_gpio!((38,
GPIO38(_2 => EMAC_RXD3 _4 => SD2_CDATA3) (_3 => LCD_DATA_17 _4 => SD2_CDATA3)
([Input] [Output]))); _for_each_inner_gpio!((39, GPIO39(_2 => EMAC_RXD2 _4 =>
SD2_CCLK) (_3 => LCD_DATA_18 _4 => SD2_CCLK) ([Input] [Output])));
_for_each_inner_gpio!((40, GPIO40(_2 => EMAC_RXD1 _4 => SD2_CCMD) (_3 => LCD_PCLK
_4 => SD2_CCMD) ([Input] [Output]))); _for_each_inner_gpio!((42, GPIO42(_2 =>
EMAC_RX_CLK) () ([Input] [Output]))); _for_each_inner_gpio!((43, GPIO43(_2 =>
EMAC_RMII_CLK) (_2 => EMAC_RMII_CLK _3 => LCD_H_ENABLE) ([Input] [Output])));
_for_each_inner_gpio!((44, GPIO44() (_2 => EMAC_TXD0 _3 => LCD_H_SYNC) ([Input]
[Output]))); _for_each_inner_gpio!((45, GPIO45() (_2 => EMAC_TXD1 _3 =>
LCD_V_SYNC) ([Input] [Output]))); _for_each_inner_gpio!((46, GPIO46(_3 =>
CAM_DATA_0) (_2 => EMAC_TXD2) ([Input] [Output]))); _for_each_inner_gpio!((47,
GPIO47(_3 => CAM_DATA_1) (_2 => EMAC_TXD3) ([Input] [Output])));
_for_each_inner_gpio!((48, GPIO48(_3 => CAM_DATA_2) () ([Input] [Output])));
_for_each_inner_gpio!((49, GPIO49(_3 => CAM_DATA_3) () ([Input] [Output])));
_for_each_inner_gpio!((50, GPIO50(_3 => CAM_DATA_4) () ([Input] [Output])));
_for_each_inner_gpio!((51, GPIO51(_3 => CAM_DATA_5) () ([Input] [Output])));
_for_each_inner_gpio!((52, GPIO52(_2 => FSPICS0 _3 => CAM_DATA_6) (_2 => FSPICS0)
([Input] [Output]))); _for_each_inner_gpio!((53, GPIO53(_2 => FSPICLK _3 =>
CAM_DATA_7) (_2 => FSPICLK) ([Input] [Output]))); _for_each_inner_gpio!((54,
GPIO54(_0 => MTDO _2 => FSPID _3 => CAM_PCLK) (_0 => MTDO _2 => FSPID) ([Input]
[Output]))); _for_each_inner_gpio!((55, GPIO55(_0 => MTCK _2 => FSPIQ _3 =>
CAM_XCLK) (_0 => MTCK _2 => FSPIQ _3 => CAM_XCLK) ([Input] [Output])));
_for_each_inner_gpio!((56, GPIO56(_0 => MTDI _2 => FSPIHD _3 => CAM_V_SYNC) (_0
=> MTDI _2 => FSPIHD) ([Input] [Output]))); _for_each_inner_gpio!((57, GPIO57(_0
=> MTMS _2 => FSPIWP _3 => CAM_H_SYNC) (_0 => MTMS _2 => FSPIWP) ([Input]
[Output]))); _for_each_inner_gpio!((58, GPIO58() (_0 => U0TXD) ([Input]
[Output]))); _for_each_inner_gpio!((59, GPIO59(_0 => U0RXD) () ([Input]
[Output]))); _for_each_inner_gpio!((60, GPIO60() () ([Input] [Output])));
_for_each_inner_gpio!((61, GPIO61() () ([Input] [Output])));
_for_each_inner_gpio!((all(0, GPIO0() () ([Input] [Output])), (1, GPIO1() ()
([Input] [Output])), (2, GPIO2() (_3 => LCD_DATA_19) ([Input] [Output])), (3,
GPIO3() (_3 => LCD_DATA_20) ([Input] [Output])), (4, GPIO4() (_3 => LCD_DATA_21)
([Input] [Output])), (5, GPIO5() (_3 => LCD_DATA_22) ([Input] [Output])), (6,
GPIO6() () ([Input] [Output])), (7, GPIO7() (_3 => LCD_DATA_23) ([Input]
[Output])), (8, GPIO8() (_2 => EMAC_TXD0 _3 => LCD_DATA_0) ([Input] [Output])),
(9, GPIO9(_0 => FSPIHD _4 => DBG_PSRAM_CK) (_0 => FSPIHD _2 => EMAC_TXD1 _3 =>
LCD_DATA_1 _4 => DBG_PSRAM_CK) ([Input] [Output])), (10, GPIO10(_0 => FSPICS0 _4
=> DBG_PSRAM_CS) (_0 => FSPICS0 _2 => EMAC_TXD2 _3 => LCD_DATA_2 _4 =>
DBG_PSRAM_CS) ([Input] [Output])), (11, GPIO11(_0 => FSPID _4 => DBG_PSRAM_D) (_0
=> FSPID _2 => EMAC_TXD3 _3 => LCD_DATA_3 _4 => DBG_PSRAM_D) ([Input] [Output])),
(12, GPIO12(_0 => FSPICLK _4 => DBG_PSRAM_Q) (_0 => FSPICLK _2 => EMAC_TXEN _3 =>
LCD_DATA_4 _4 => DBG_PSRAM_Q) ([Input] [Output])), (13, GPIO13(_0 => FSPIQ _2 =>
EMAC_RMII_CLK _4 => DBG_PSRAM_WP) (_0 => FSPIQ _2 => EMAC_RMII_CLK _3 =>
LCD_DATA_5 _4 => DBG_PSRAM_WP) ([Input] [Output])), (14, GPIO14(_0 => FSPIWP _2
=> EMAC_RX_CLK _4 => DBG_PSRAM_HOLD) (_0 => FSPIWP _3 => LCD_DATA_6 _4 =>
DBG_PSRAM_HOLD) ([Input] [Output])), (15, GPIO15(_0 => FSPIIO4 _2 => EMAC_RXDV _4
=> DBG_PSRAM_DQ4) (_0 => FSPIIO4 _3 => LCD_DATA_7 _4 => DBG_PSRAM_DQ4) ([Input]
[Output])), (16, GPIO16(_0 => FSPIIO5 _2 => EMAC_RXD3 _4 => DBG_PSRAM_DQ5) (_0 =>
FSPIIO5 _3 => LCD_DATA_8 _4 => DBG_PSRAM_DQ5) ([Input] [Output])), (17, GPIO17(_0
=> FSPIIO6 _2 => EMAC_RXD2 _4 => DBG_PSRAM_DQ6) (_0 => FSPIIO6 _3 => LCD_DATA_9
_4 => DBG_PSRAM_DQ6) ([Input] [Output])), (18, GPIO18(_0 => FSPIIO7 _2 =>
EMAC_RXD1 _4 => DBG_PSRAM_DQ7) (_0 => FSPIIO7 _3 => LCD_DATA_10 _4 =>
DBG_PSRAM_DQ7) ([Input] [Output])), (19, GPIO19(_2 => EMAC_RXD0 _4 =>
DBG_PSRAM_DQS_0) (_0 => FSPIDQS _3 => LCD_DATA_11 _4 => DBG_PSRAM_DQS_0) ([Input]
[Output])), (20, GPIO20(_0 => SD1_DATA0 _2 => FSPICLK _4 => DBG_FLASH_CK) (_0 =>
SD1_DATA0 _2 => FSPICLK _4 => DBG_FLASH_CK) ([Input] [Output])), (21, GPIO21(_0
=> SD1_DATA1 _2 => FSPID _4 => DBG_FLASH_D) (_0 => SD1_DATA1 _2 => FSPID _4 =>
DBG_FLASH_D) ([Input] [Output])), (22, GPIO22(_0 => SD1_DATA2 _2 => FSPIQ _4 =>
DBG_FLASH_CS) (_0 => SD1_DATA2 _2 => FSPIQ _4 => DBG_FLASH_CS) ([Input]
[Output])), (23, GPIO23(_0 => SD1_DATA3 _2 => FSPICS0 _4 => DBG_FLASH_Q) (_0 =>
SD1_DATA3 _2 => FSPICS0 _4 => DBG_FLASH_Q) ([Input] [Output])), (24, GPIO24(_0 =>
SD1_CLK _2 => FSPIHD _4 => DBG_FLASH_WP) (_0 => SD1_CLK _2 => FSPIHD _4 =>
DBG_FLASH_WP) ([Input] [Output])), (25, GPIO25(_0 => SD1_CMD _2 => FSPIWP _4 =>
DBG_FLASH_HOLD) (_0 => SD1_CMD _2 => FSPIWP _4 => DBG_FLASH_HOLD) ([Input]
[Output])), (26, GPIO26(_0 => SPICS0) (_0 => SPICS0) ([Input] [Output])), (27,
GPIO27(_0 => SPIQ) (_0 => SPIQ) ([Input] [Output])), (28, GPIO28(_0 => SPIWP) (_0
=> SPIWP) ([Input] [Output])), (30, GPIO30(_0 => SPIHD) (_0 => SPIHD) ([Input]
[Output])), (31, GPIO31(_0 => SPICLK) (_0 => SPICLK) ([Input] [Output])), (32,
GPIO32(_0 => SPID) (_0 => SPID) ([Input] [Output])), (33, GPIO33() (_3 =>
LCD_DATA_12) ([Input] [Output])), (34, GPIO34() (_3 => LCD_DATA_13) ([Input]
[Output])), (35, GPIO35(_2 => REF_50M_CLK _4 => SD2_CDATA0) (_2 => REF_50M_CLK _3
=> LCD_DATA_14 _4 => SD2_CDATA0) ([Input] [Output])), (36, GPIO36(_2 => EMAC_RXDV
_4 => SD2_CDATA1) (_3 => LCD_DATA_15 _4 => SD2_CDATA1) ([Input] [Output])), (37,
GPIO37(_4 => SD2_CDATA2) (_2 => EMAC_TXEN _3 => LCD_DATA_16 _4 => SD2_CDATA2)
([Input] [Output])), (38, GPIO38(_2 => EMAC_RXD3 _4 => SD2_CDATA3) (_3 =>
LCD_DATA_17 _4 => SD2_CDATA3) ([Input] [Output])), (39, GPIO39(_2 => EMAC_RXD2 _4
=> SD2_CCLK) (_3 => LCD_DATA_18 _4 => SD2_CCLK) ([Input] [Output])), (40,
GPIO40(_2 => EMAC_RXD1 _4 => SD2_CCMD) (_3 => LCD_PCLK _4 => SD2_CCMD) ([Input]
[Output])), (42, GPIO42(_2 => EMAC_RX_CLK) () ([Input] [Output])), (43, GPIO43(_2
=> EMAC_RMII_CLK) (_2 => EMAC_RMII_CLK _3 => LCD_H_ENABLE) ([Input] [Output])),
(44, GPIO44() (_2 => EMAC_TXD0 _3 => LCD_H_SYNC) ([Input] [Output])), (45,
GPIO45() (_2 => EMAC_TXD1 _3 => LCD_V_SYNC) ([Input] [Output])), (46, GPIO46(_3
=> CAM_DATA_0) (_2 => EMAC_TXD2) ([Input] [Output])), (47, GPIO47(_3 =>
CAM_DATA_1) (_2 => EMAC_TXD3) ([Input] [Output])), (48, GPIO48(_3 => CAM_DATA_2)
() ([Input] [Output])), (49, GPIO49(_3 => CAM_DATA_3) () ([Input] [Output])),
(50, GPIO50(_3 => CAM_DATA_4) () ([Input] [Output])), (51, GPIO51(_3 =>
CAM_DATA_5) () ([Input] [Output])), (52, GPIO52(_2 => FSPICS0 _3 => CAM_DATA_6)
(_2 => FSPICS0) ([Input] [Output])), (53, GPIO53(_2 => FSPICLK _3 => CAM_DATA_7)
(_2 => FSPICLK) ([Input] [Output])), (54, GPIO54(_0 => MTDO _2 => FSPID _3 =>
CAM_PCLK) (_0 => MTDO _2 => FSPID) ([Input] [Output])), (55, GPIO55(_0 => MTCK _2
=> FSPIQ _3 => CAM_XCLK) (_0 => MTCK _2 => FSPIQ _3 => CAM_XCLK) ([Input]
[Output])), (56, GPIO56(_0 => MTDI _2 => FSPIHD _3 => CAM_V_SYNC) (_0 => MTDI _2
=> FSPIHD) ([Input] [Output])), (57, GPIO57(_0 => MTMS _2 => FSPIWP _3 =>
CAM_H_SYNC) (_0 => MTMS _2 => FSPIWP) ([Input] [Output])), (58, GPIO58() (_0 =>
U0TXD) ([Input] [Output])), (59, GPIO59(_0 => U0RXD) () ([Input] [Output])), (60,
GPIO60() () ([Input] [Output])), (61, GPIO61() () ([Input] [Output]))));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_analog_function {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_analog_function { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_analog_function!((XTAL_32K_N, GPIO0));
_for_each_inner_analog_function!((XTAL_32K_P, GPIO1));
_for_each_inner_analog_function!((USJ_DM, GPIO33));
_for_each_inner_analog_function!((USJ_DP, GPIO34));
_for_each_inner_analog_function!((ADC1_CH0, GPIO42));
_for_each_inner_analog_function!((ADC1_CH1, GPIO43));
_for_each_inner_analog_function!((ADC1_CH2, GPIO44));
_for_each_inner_analog_function!((ADC1_CH3, GPIO45));
_for_each_inner_analog_function!((ADC1_CH4, GPIO46));
_for_each_inner_analog_function!((ADC1_CH5, GPIO47));
_for_each_inner_analog_function!((ADC1_CH6, GPIO48));
_for_each_inner_analog_function!((ADC1_CH7, GPIO49));
_for_each_inner_analog_function!((ADC2_CH0, GPIO50));
_for_each_inner_analog_function!((ADC2_CH1, GPIO51));
_for_each_inner_analog_function!((ADC2_CH2, GPIO52));
_for_each_inner_analog_function!((ADC2_CH3, GPIO53));
_for_each_inner_analog_function!((ADC2_CH4, GPIO54));
_for_each_inner_analog_function!((ADC2_CH5, GPIO55));
_for_each_inner_analog_function!((ADC2_CH6, GPIO56));
_for_each_inner_analog_function!((ADC2_CH7, GPIO57));
_for_each_inner_analog_function!(((ADC1_CH0, ADCn_CHm, 1, 0), GPIO42));
_for_each_inner_analog_function!(((ADC1_CH1, ADCn_CHm, 1, 1), GPIO43));
_for_each_inner_analog_function!(((ADC1_CH2, ADCn_CHm, 1, 2), GPIO44));
_for_each_inner_analog_function!(((ADC1_CH3, ADCn_CHm, 1, 3), GPIO45));
_for_each_inner_analog_function!(((ADC1_CH4, ADCn_CHm, 1, 4), GPIO46));
_for_each_inner_analog_function!(((ADC1_CH5, ADCn_CHm, 1, 5), GPIO47));
_for_each_inner_analog_function!(((ADC1_CH6, ADCn_CHm, 1, 6), GPIO48));
_for_each_inner_analog_function!(((ADC1_CH7, ADCn_CHm, 1, 7), GPIO49));
_for_each_inner_analog_function!(((ADC2_CH0, ADCn_CHm, 2, 0), GPIO50));
_for_each_inner_analog_function!(((ADC2_CH1, ADCn_CHm, 2, 1), GPIO51));
_for_each_inner_analog_function!(((ADC2_CH2, ADCn_CHm, 2, 2), GPIO52));
_for_each_inner_analog_function!(((ADC2_CH3, ADCn_CHm, 2, 3), GPIO53));
_for_each_inner_analog_function!(((ADC2_CH4, ADCn_CHm, 2, 4), GPIO54));
_for_each_inner_analog_function!(((ADC2_CH5, ADCn_CHm, 2, 5), GPIO55));
_for_each_inner_analog_function!(((ADC2_CH6, ADCn_CHm, 2, 6), GPIO56));
_for_each_inner_analog_function!(((ADC2_CH7, ADCn_CHm, 2, 7), GPIO57));
_for_each_inner_analog_function!((all(XTAL_32K_N, GPIO0), (XTAL_32K_P, GPIO1),
(USJ_DM, GPIO33), (USJ_DP, GPIO34), (ADC1_CH0, GPIO42), (ADC1_CH1, GPIO43),
(ADC1_CH2, GPIO44), (ADC1_CH3, GPIO45), (ADC1_CH4, GPIO46), (ADC1_CH5, GPIO47),
(ADC1_CH6, GPIO48), (ADC1_CH7, GPIO49), (ADC2_CH0, GPIO50), (ADC2_CH1, GPIO51),
(ADC2_CH2, GPIO52), (ADC2_CH3, GPIO53), (ADC2_CH4, GPIO54), (ADC2_CH5, GPIO55),
(ADC2_CH6, GPIO56), (ADC2_CH7, GPIO57)));
_for_each_inner_analog_function!((ADCn_CHm((ADC1_CH0, ADCn_CHm, 1, 0), GPIO42),
((ADC1_CH1, ADCn_CHm, 1, 1), GPIO43), ((ADC1_CH2, ADCn_CHm, 1, 2), GPIO44),
((ADC1_CH3, ADCn_CHm, 1, 3), GPIO45), ((ADC1_CH4, ADCn_CHm, 1, 4), GPIO46),
((ADC1_CH5, ADCn_CHm, 1, 5), GPIO47), ((ADC1_CH6, ADCn_CHm, 1, 6), GPIO48),
((ADC1_CH7, ADCn_CHm, 1, 7), GPIO49), ((ADC2_CH0, ADCn_CHm, 2, 0), GPIO50),
((ADC2_CH1, ADCn_CHm, 2, 1), GPIO51), ((ADC2_CH2, ADCn_CHm, 2, 2), GPIO52),
((ADC2_CH3, ADCn_CHm, 2, 3), GPIO53), ((ADC2_CH4, ADCn_CHm, 2, 4), GPIO54),
((ADC2_CH5, ADCn_CHm, 2, 5), GPIO55), ((ADC2_CH6, ADCn_CHm, 2, 6), GPIO56),
((ADC2_CH7, ADCn_CHm, 2, 7), GPIO57)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_lp_function {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_lp_function { $(($pattern) => $code;)* ($other : tt)
=> {} } _for_each_inner_lp_function!((LP_GPIO0, GPIO0, _1));
_for_each_inner_lp_function!((LP_GPIO1, GPIO1, _1));
_for_each_inner_lp_function!((LP_GPIO2, GPIO2, _1));
_for_each_inner_lp_function!((LP_GPIO3, GPIO3, _1));
_for_each_inner_lp_function!((LP_GPIO4, GPIO4, _1));
_for_each_inner_lp_function!((LP_GPIO5, GPIO5, _1));
_for_each_inner_lp_function!((LP_GPIO6, GPIO6, _1));
_for_each_inner_lp_function!((LP_GPIO7, GPIO7, _1));
_for_each_inner_lp_function!(((LP_GPIO0, LP_GPIOn, 0), GPIO0, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO1, LP_GPIOn, 1), GPIO1, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO2, LP_GPIOn, 2), GPIO2, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO3, LP_GPIOn, 3), GPIO3, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO4, LP_GPIOn, 4), GPIO4, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO5, LP_GPIOn, 5), GPIO5, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO6, LP_GPIOn, 6), GPIO6, _1, () ()));
_for_each_inner_lp_function!(((LP_GPIO7, LP_GPIOn, 7), GPIO7, _1, () ()));
_for_each_inner_lp_function!((all(LP_GPIO0, GPIO0, _1), (LP_GPIO1, GPIO1, _1),
(LP_GPIO2, GPIO2, _1), (LP_GPIO3, GPIO3, _1), (LP_GPIO4, GPIO4, _1), (LP_GPIO5,
GPIO5, _1), (LP_GPIO6, GPIO6, _1), (LP_GPIO7, GPIO7, _1)));
_for_each_inner_lp_function!((LP_GPIOn((LP_GPIO0, LP_GPIOn, 0), GPIO0, _1, ()
()), ((LP_GPIO1, LP_GPIOn, 1), GPIO1, _1, () ()), ((LP_GPIO2, LP_GPIOn, 2),
GPIO2, _1, () ()), ((LP_GPIO3, LP_GPIOn, 3), GPIO3, _1, () ()), ((LP_GPIO4,
LP_GPIOn, 4), GPIO4, _1, () ()), ((LP_GPIO5, LP_GPIOn, 5), GPIO5, _1, () ()),
((LP_GPIO6, LP_GPIOn, 6), GPIO6, _1, () ()), ((LP_GPIO7, LP_GPIOn, 7), GPIO7, _1,
() ())));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! for_each_iomux_function {
($($pattern:tt => $code:tt;)*) => {
macro_rules! _for_each_inner_iomux_function { $(($pattern) => $code;)* ($other :
tt) => {} } _for_each_inner_iomux_function!((LCD_DATA_19, GPIO2, _3));
_for_each_inner_iomux_function!((LCD_DATA_20, GPIO3, _3));
_for_each_inner_iomux_function!((LCD_DATA_21, GPIO4, _3));
_for_each_inner_iomux_function!((LCD_DATA_22, GPIO5, _3));
_for_each_inner_iomux_function!((LCD_DATA_23, GPIO7, _3));
_for_each_inner_iomux_function!((EMAC_TXD0, GPIO8, _2));
_for_each_inner_iomux_function!((LCD_DATA_0, GPIO8, _3));
_for_each_inner_iomux_function!((FSPIHD, GPIO9, _0));
_for_each_inner_iomux_function!((EMAC_TXD1, GPIO9, _2));
_for_each_inner_iomux_function!((LCD_DATA_1, GPIO9, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_CK, GPIO9, _4));
_for_each_inner_iomux_function!((FSPICS0, GPIO10, _0));
_for_each_inner_iomux_function!((EMAC_TXD2, GPIO10, _2));
_for_each_inner_iomux_function!((LCD_DATA_2, GPIO10, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_CS, GPIO10, _4));
_for_each_inner_iomux_function!((FSPID, GPIO11, _0));
_for_each_inner_iomux_function!((EMAC_TXD3, GPIO11, _2));
_for_each_inner_iomux_function!((LCD_DATA_3, GPIO11, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_D, GPIO11, _4));
_for_each_inner_iomux_function!((FSPICLK, GPIO12, _0));
_for_each_inner_iomux_function!((EMAC_TXEN, GPIO12, _2));
_for_each_inner_iomux_function!((LCD_DATA_4, GPIO12, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_Q, GPIO12, _4));
_for_each_inner_iomux_function!((FSPIQ, GPIO13, _0));
_for_each_inner_iomux_function!((EMAC_RMII_CLK, GPIO13, _2));
_for_each_inner_iomux_function!((LCD_DATA_5, GPIO13, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_WP, GPIO13, _4));
_for_each_inner_iomux_function!((FSPIWP, GPIO14, _0));
_for_each_inner_iomux_function!((EMAC_RX_CLK, GPIO14, _2));
_for_each_inner_iomux_function!((LCD_DATA_6, GPIO14, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_HOLD, GPIO14, _4));
_for_each_inner_iomux_function!((FSPIIO4, GPIO15, _0));
_for_each_inner_iomux_function!((EMAC_RXDV, GPIO15, _2));
_for_each_inner_iomux_function!((LCD_DATA_7, GPIO15, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_DQ4, GPIO15, _4));
_for_each_inner_iomux_function!((FSPIIO5, GPIO16, _0));
_for_each_inner_iomux_function!((EMAC_RXD3, GPIO16, _2));
_for_each_inner_iomux_function!((LCD_DATA_8, GPIO16, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_DQ5, GPIO16, _4));
_for_each_inner_iomux_function!((FSPIIO6, GPIO17, _0));
_for_each_inner_iomux_function!((EMAC_RXD2, GPIO17, _2));
_for_each_inner_iomux_function!((LCD_DATA_9, GPIO17, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_DQ6, GPIO17, _4));
_for_each_inner_iomux_function!((FSPIIO7, GPIO18, _0));
_for_each_inner_iomux_function!((EMAC_RXD1, GPIO18, _2));
_for_each_inner_iomux_function!((LCD_DATA_10, GPIO18, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_DQ7, GPIO18, _4));
_for_each_inner_iomux_function!((FSPIDQS, GPIO19, _0));
_for_each_inner_iomux_function!((EMAC_RXD0, GPIO19, _2));
_for_each_inner_iomux_function!((LCD_DATA_11, GPIO19, _3));
_for_each_inner_iomux_function!((DBG_PSRAM_DQS_0, GPIO19, _4));
_for_each_inner_iomux_function!((SD1_DATA0, GPIO20, _0));
_for_each_inner_iomux_function!((FSPICLK, GPIO20, _2));
_for_each_inner_iomux_function!((DBG_FLASH_CK, GPIO20, _4));
_for_each_inner_iomux_function!((SD1_DATA1, GPIO21, _0));
_for_each_inner_iomux_function!((FSPID, GPIO21, _2));
_for_each_inner_iomux_function!((DBG_FLASH_D, GPIO21, _4));
_for_each_inner_iomux_function!((SD1_DATA2, GPIO22, _0));
_for_each_inner_iomux_function!((FSPIQ, GPIO22, _2));
_for_each_inner_iomux_function!((DBG_FLASH_CS, GPIO22, _4));
_for_each_inner_iomux_function!((SD1_DATA3, GPIO23, _0));
_for_each_inner_iomux_function!((FSPICS0, GPIO23, _2));
_for_each_inner_iomux_function!((DBG_FLASH_Q, GPIO23, _4));
_for_each_inner_iomux_function!((SD1_CLK, GPIO24, _0));
_for_each_inner_iomux_function!((FSPIHD, GPIO24, _2));
_for_each_inner_iomux_function!((DBG_FLASH_WP, GPIO24, _4));
_for_each_inner_iomux_function!((SD1_CMD, GPIO25, _0));
_for_each_inner_iomux_function!((FSPIWP, GPIO25, _2));
_for_each_inner_iomux_function!((DBG_FLASH_HOLD, GPIO25, _4));
_for_each_inner_iomux_function!((SPICS0, GPIO26, _0));
_for_each_inner_iomux_function!((SPIQ, GPIO27, _0));
_for_each_inner_iomux_function!((SPIWP, GPIO28, _0));
_for_each_inner_iomux_function!((SPIHD, GPIO30, _0));
_for_each_inner_iomux_function!((SPICLK, GPIO31, _0));
_for_each_inner_iomux_function!((SPID, GPIO32, _0));
_for_each_inner_iomux_function!((LCD_DATA_12, GPIO33, _3));
_for_each_inner_iomux_function!((LCD_DATA_13, GPIO34, _3));
_for_each_inner_iomux_function!((REF_50M_CLK, GPIO35, _2));
_for_each_inner_iomux_function!((LCD_DATA_14, GPIO35, _3));
_for_each_inner_iomux_function!((SD2_CDATA0, GPIO35, _4));
_for_each_inner_iomux_function!((EMAC_RXDV, GPIO36, _2));
_for_each_inner_iomux_function!((LCD_DATA_15, GPIO36, _3));
_for_each_inner_iomux_function!((SD2_CDATA1, GPIO36, _4));
_for_each_inner_iomux_function!((EMAC_TXEN, GPIO37, _2));
_for_each_inner_iomux_function!((LCD_DATA_16, GPIO37, _3));
_for_each_inner_iomux_function!((SD2_CDATA2, GPIO37, _4));
_for_each_inner_iomux_function!((EMAC_RXD3, GPIO38, _2));
_for_each_inner_iomux_function!((LCD_DATA_17, GPIO38, _3));
_for_each_inner_iomux_function!((SD2_CDATA3, GPIO38, _4));
_for_each_inner_iomux_function!((EMAC_RXD2, GPIO39, _2));
_for_each_inner_iomux_function!((LCD_DATA_18, GPIO39, _3));
_for_each_inner_iomux_function!((SD2_CCLK, GPIO39, _4));
_for_each_inner_iomux_function!((EMAC_RXD1, GPIO40, _2));
_for_each_inner_iomux_function!((LCD_PCLK, GPIO40, _3));
_for_each_inner_iomux_function!((SD2_CCMD, GPIO40, _4));
_for_each_inner_iomux_function!((EMAC_RX_CLK, GPIO42, _2));
_for_each_inner_iomux_function!((EMAC_RMII_CLK, GPIO43, _2));
_for_each_inner_iomux_function!((LCD_H_ENABLE, GPIO43, _3));
_for_each_inner_iomux_function!((EMAC_TXD0, GPIO44, _2));
_for_each_inner_iomux_function!((LCD_H_SYNC, GPIO44, _3));
_for_each_inner_iomux_function!((EMAC_TXD1, GPIO45, _2));
_for_each_inner_iomux_function!((LCD_V_SYNC, GPIO45, _3));
_for_each_inner_iomux_function!((EMAC_TXD2, GPIO46, _2));
_for_each_inner_iomux_function!((CAM_DATA_0, GPIO46, _3));
_for_each_inner_iomux_function!((EMAC_TXD3, GPIO47, _2));
_for_each_inner_iomux_function!((CAM_DATA_1, GPIO47, _3));
_for_each_inner_iomux_function!((CAM_DATA_2, GPIO48, _3));
_for_each_inner_iomux_function!((CAM_DATA_3, GPIO49, _3));
_for_each_inner_iomux_function!((CAM_DATA_4, GPIO50, _3));
_for_each_inner_iomux_function!((CAM_DATA_5, GPIO51, _3));
_for_each_inner_iomux_function!((FSPICS0, GPIO52, _2));
_for_each_inner_iomux_function!((CAM_DATA_6, GPIO52, _3));
_for_each_inner_iomux_function!((FSPICLK, GPIO53, _2));
_for_each_inner_iomux_function!((CAM_DATA_7, GPIO53, _3));
_for_each_inner_iomux_function!((MTDO, GPIO54, _0));
_for_each_inner_iomux_function!((FSPID, GPIO54, _2));
_for_each_inner_iomux_function!((CAM_PCLK, GPIO54, _3));
_for_each_inner_iomux_function!((MTCK, GPIO55, _0));
_for_each_inner_iomux_function!((FSPIQ, GPIO55, _2));
_for_each_inner_iomux_function!((CAM_XCLK, GPIO55, _3));
_for_each_inner_iomux_function!((MTDI, GPIO56, _0));
_for_each_inner_iomux_function!((FSPIHD, GPIO56, _2));
_for_each_inner_iomux_function!((CAM_V_SYNC, GPIO56, _3));
_for_each_inner_iomux_function!((MTMS, GPIO57, _0));
_for_each_inner_iomux_function!((FSPIWP, GPIO57, _2));
_for_each_inner_iomux_function!((CAM_H_SYNC, GPIO57, _3));
_for_each_inner_iomux_function!((U0TXD, GPIO58, _0));
_for_each_inner_iomux_function!((U0RXD, GPIO59, _0));
_for_each_inner_iomux_function!(((LCD_DATA_19, LCD_DATA_n, 19), GPIO2, _3));
_for_each_inner_iomux_function!(((LCD_DATA_20, LCD_DATA_n, 20), GPIO3, _3));
_for_each_inner_iomux_function!(((LCD_DATA_21, LCD_DATA_n, 21), GPIO4, _3));
_for_each_inner_iomux_function!(((LCD_DATA_22, LCD_DATA_n, 22), GPIO5, _3));
_for_each_inner_iomux_function!(((LCD_DATA_23, LCD_DATA_n, 23), GPIO7, _3));
_for_each_inner_iomux_function!(((LCD_DATA_0, LCD_DATA_n, 0), GPIO8, _3));
_for_each_inner_iomux_function!(((LCD_DATA_1, LCD_DATA_n, 1), GPIO9, _3));
_for_each_inner_iomux_function!(((LCD_DATA_2, LCD_DATA_n, 2), GPIO10, _3));
_for_each_inner_iomux_function!(((LCD_DATA_3, LCD_DATA_n, 3), GPIO11, _3));
_for_each_inner_iomux_function!(((LCD_DATA_4, LCD_DATA_n, 4), GPIO12, _3));
_for_each_inner_iomux_function!(((LCD_DATA_5, LCD_DATA_n, 5), GPIO13, _3));
_for_each_inner_iomux_function!(((LCD_DATA_6, LCD_DATA_n, 6), GPIO14, _3));
_for_each_inner_iomux_function!(((LCD_DATA_7, LCD_DATA_n, 7), GPIO15, _3));
_for_each_inner_iomux_function!(((LCD_DATA_8, LCD_DATA_n, 8), GPIO16, _3));
_for_each_inner_iomux_function!(((LCD_DATA_9, LCD_DATA_n, 9), GPIO17, _3));
_for_each_inner_iomux_function!(((LCD_DATA_10, LCD_DATA_n, 10), GPIO18, _3));
_for_each_inner_iomux_function!(((LCD_DATA_11, LCD_DATA_n, 11), GPIO19, _3));
_for_each_inner_iomux_function!(((LCD_DATA_12, LCD_DATA_n, 12), GPIO33, _3));
_for_each_inner_iomux_function!(((LCD_DATA_13, LCD_DATA_n, 13), GPIO34, _3));
_for_each_inner_iomux_function!(((LCD_DATA_14, LCD_DATA_n, 14), GPIO35, _3));
_for_each_inner_iomux_function!(((LCD_DATA_15, LCD_DATA_n, 15), GPIO36, _3));
_for_each_inner_iomux_function!(((LCD_DATA_16, LCD_DATA_n, 16), GPIO37, _3));
_for_each_inner_iomux_function!(((LCD_DATA_17, LCD_DATA_n, 17), GPIO38, _3));
_for_each_inner_iomux_function!(((LCD_DATA_18, LCD_DATA_n, 18), GPIO39, _3));
_for_each_inner_iomux_function!(((EMAC_TXD0, EMAC_TXDn, 0), GPIO8, _2));
_for_each_inner_iomux_function!(((EMAC_TXD1, EMAC_TXDn, 1), GPIO9, _2));
_for_each_inner_iomux_function!(((EMAC_TXD2, EMAC_TXDn, 2), GPIO10, _2));
_for_each_inner_iomux_function!(((EMAC_TXD3, EMAC_TXDn, 3), GPIO11, _2));
_for_each_inner_iomux_function!(((EMAC_TXD0, EMAC_TXDn, 0), GPIO44, _2));
_for_each_inner_iomux_function!(((EMAC_TXD1, EMAC_TXDn, 1), GPIO45, _2));
_for_each_inner_iomux_function!(((EMAC_TXD2, EMAC_TXDn, 2), GPIO46, _2));
_for_each_inner_iomux_function!(((EMAC_TXD3, EMAC_TXDn, 3), GPIO47, _2));
_for_each_inner_iomux_function!(((FSPICS0, FSPICSn, 0), GPIO10, _0));
_for_each_inner_iomux_function!(((FSPICS0, FSPICSn, 0), GPIO23, _2));
_for_each_inner_iomux_function!(((FSPICS0, FSPICSn, 0), GPIO52, _2));
_for_each_inner_iomux_function!(((FSPIIO4, FSPIIOn, 4), GPIO15, _0));
_for_each_inner_iomux_function!(((FSPIIO5, FSPIIOn, 5), GPIO16, _0));
_for_each_inner_iomux_function!(((FSPIIO6, FSPIIOn, 6), GPIO17, _0));
_for_each_inner_iomux_function!(((FSPIIO7, FSPIIOn, 7), GPIO18, _0));
_for_each_inner_iomux_function!(((DBG_PSRAM_DQ4, DBG_PSRAM_DQn, 4), GPIO15, _4));
_for_each_inner_iomux_function!(((DBG_PSRAM_DQ5, DBG_PSRAM_DQn, 5), GPIO16, _4));
_for_each_inner_iomux_function!(((DBG_PSRAM_DQ6, DBG_PSRAM_DQn, 6), GPIO17, _4));
_for_each_inner_iomux_function!(((DBG_PSRAM_DQ7, DBG_PSRAM_DQn, 7), GPIO18, _4));
_for_each_inner_iomux_function!(((EMAC_RXD3, EMAC_RXDn, 3), GPIO16, _2));
_for_each_inner_iomux_function!(((EMAC_RXD2, EMAC_RXDn, 2), GPIO17, _2));
_for_each_inner_iomux_function!(((EMAC_RXD1, EMAC_RXDn, 1), GPIO18, _2));
_for_each_inner_iomux_function!(((EMAC_RXD0, EMAC_RXDn, 0), GPIO19, _2));
_for_each_inner_iomux_function!(((EMAC_RXD3, EMAC_RXDn, 3), GPIO38, _2));
_for_each_inner_iomux_function!(((EMAC_RXD2, EMAC_RXDn, 2), GPIO39, _2));
_for_each_inner_iomux_function!(((EMAC_RXD1, EMAC_RXDn, 1), GPIO40, _2));
_for_each_inner_iomux_function!(((DBG_PSRAM_DQS_0, DBG_PSRAM_DQS_n, 0), GPIO19,
_4)); _for_each_inner_iomux_function!(((SD1_DATA0, SDn_DATAm, 1, 0), GPIO20,
_0)); _for_each_inner_iomux_function!(((SD1_DATA1, SDn_DATAm, 1, 1), GPIO21,
_0)); _for_each_inner_iomux_function!(((SD1_DATA2, SDn_DATAm, 1, 2), GPIO22,
_0)); _for_each_inner_iomux_function!(((SD1_DATA3, SDn_DATAm, 1, 3), GPIO23,
_0)); _for_each_inner_iomux_function!(((SD1_CLK, SDn_CLK, 1), GPIO24, _0));
_for_each_inner_iomux_function!(((SD1_CMD, SDn_CMD, 1), GPIO25, _0));
_for_each_inner_iomux_function!(((SPICS0, SPICSn, 0), GPIO26, _0));
_for_each_inner_iomux_function!(((SD2_CDATA0, SDn_CDATAm, 2, 0), GPIO35, _4));
_for_each_inner_iomux_function!(((SD2_CDATA1, SDn_CDATAm, 2, 1), GPIO36, _4));
_for_each_inner_iomux_function!(((SD2_CDATA2, SDn_CDATAm, 2, 2), GPIO37, _4));
_for_each_inner_iomux_function!(((SD2_CDATA3, SDn_CDATAm, 2, 3), GPIO38, _4));
_for_each_inner_iomux_function!(((SD2_CCLK, SDn_CCLK, 2), GPIO39, _4));
_for_each_inner_iomux_function!(((SD2_CCMD, SDn_CCMD, 2), GPIO40, _4));
_for_each_inner_iomux_function!(((CAM_DATA_0, CAM_DATA_n, 0), GPIO46, _3));
_for_each_inner_iomux_function!(((CAM_DATA_1, CAM_DATA_n, 1), GPIO47, _3));
_for_each_inner_iomux_function!(((CAM_DATA_2, CAM_DATA_n, 2), GPIO48, _3));
_for_each_inner_iomux_function!(((CAM_DATA_3, CAM_DATA_n, 3), GPIO49, _3));
_for_each_inner_iomux_function!(((CAM_DATA_4, CAM_DATA_n, 4), GPIO50, _3));
_for_each_inner_iomux_function!(((CAM_DATA_5, CAM_DATA_n, 5), GPIO51, _3));
_for_each_inner_iomux_function!(((CAM_DATA_6, CAM_DATA_n, 6), GPIO52, _3));
_for_each_inner_iomux_function!(((CAM_DATA_7, CAM_DATA_n, 7), GPIO53, _3));
_for_each_inner_iomux_function!((all(LCD_DATA_19, GPIO2, _3), (LCD_DATA_20,
GPIO3, _3), (LCD_DATA_21, GPIO4, _3), (LCD_DATA_22, GPIO5, _3), (LCD_DATA_23,
GPIO7, _3), (EMAC_TXD0, GPIO8, _2), (LCD_DATA_0, GPIO8, _3), (FSPIHD, GPIO9, _0),
(EMAC_TXD1, GPIO9, _2), (LCD_DATA_1, GPIO9, _3), (DBG_PSRAM_CK, GPIO9, _4),
(FSPICS0, GPIO10, _0), (EMAC_TXD2, GPIO10, _2), (LCD_DATA_2, GPIO10, _3),
(DBG_PSRAM_CS, GPIO10, _4), (FSPID, GPIO11, _0), (EMAC_TXD3, GPIO11, _2),
(LCD_DATA_3, GPIO11, _3), (DBG_PSRAM_D, GPIO11, _4), (FSPICLK, GPIO12, _0),
(EMAC_TXEN, GPIO12, _2), (LCD_DATA_4, GPIO12, _3), (DBG_PSRAM_Q, GPIO12, _4),
(FSPIQ, GPIO13, _0), (EMAC_RMII_CLK, GPIO13, _2), (LCD_DATA_5, GPIO13, _3),
(DBG_PSRAM_WP, GPIO13, _4), (FSPIWP, GPIO14, _0), (EMAC_RX_CLK, GPIO14, _2),
(LCD_DATA_6, GPIO14, _3), (DBG_PSRAM_HOLD, GPIO14, _4), (FSPIIO4, GPIO15, _0),
(EMAC_RXDV, GPIO15, _2), (LCD_DATA_7, GPIO15, _3), (DBG_PSRAM_DQ4, GPIO15, _4),
(FSPIIO5, GPIO16, _0), (EMAC_RXD3, GPIO16, _2), (LCD_DATA_8, GPIO16, _3),
(DBG_PSRAM_DQ5, GPIO16, _4), (FSPIIO6, GPIO17, _0), (EMAC_RXD2, GPIO17, _2),
(LCD_DATA_9, GPIO17, _3), (DBG_PSRAM_DQ6, GPIO17, _4), (FSPIIO7, GPIO18, _0),
(EMAC_RXD1, GPIO18, _2), (LCD_DATA_10, GPIO18, _3), (DBG_PSRAM_DQ7, GPIO18, _4),
(FSPIDQS, GPIO19, _0), (EMAC_RXD0, GPIO19, _2), (LCD_DATA_11, GPIO19, _3),
(DBG_PSRAM_DQS_0, GPIO19, _4), (SD1_DATA0, GPIO20, _0), (FSPICLK, GPIO20, _2),
(DBG_FLASH_CK, GPIO20, _4), (SD1_DATA1, GPIO21, _0), (FSPID, GPIO21, _2),
(DBG_FLASH_D, GPIO21, _4), (SD1_DATA2, GPIO22, _0), (FSPIQ, GPIO22, _2),
(DBG_FLASH_CS, GPIO22, _4), (SD1_DATA3, GPIO23, _0), (FSPICS0, GPIO23, _2),
(DBG_FLASH_Q, GPIO23, _4), (SD1_CLK, GPIO24, _0), (FSPIHD, GPIO24, _2),
(DBG_FLASH_WP, GPIO24, _4), (SD1_CMD, GPIO25, _0), (FSPIWP, GPIO25, _2),
(DBG_FLASH_HOLD, GPIO25, _4), (SPICS0, GPIO26, _0), (SPIQ, GPIO27, _0), (SPIWP,
GPIO28, _0), (SPIHD, GPIO30, _0), (SPICLK, GPIO31, _0), (SPID, GPIO32, _0),
(LCD_DATA_12, GPIO33, _3), (LCD_DATA_13, GPIO34, _3), (REF_50M_CLK, GPIO35, _2),
(LCD_DATA_14, GPIO35, _3), (SD2_CDATA0, GPIO35, _4), (EMAC_RXDV, GPIO36, _2),
(LCD_DATA_15, GPIO36, _3), (SD2_CDATA1, GPIO36, _4), (EMAC_TXEN, GPIO37, _2),
(LCD_DATA_16, GPIO37, _3), (SD2_CDATA2, GPIO37, _4), (EMAC_RXD3, GPIO38, _2),
(LCD_DATA_17, GPIO38, _3), (SD2_CDATA3, GPIO38, _4), (EMAC_RXD2, GPIO39, _2),
(LCD_DATA_18, GPIO39, _3), (SD2_CCLK, GPIO39, _4), (EMAC_RXD1, GPIO40, _2),
(LCD_PCLK, GPIO40, _3), (SD2_CCMD, GPIO40, _4), (EMAC_RX_CLK, GPIO42, _2),
(EMAC_RMII_CLK, GPIO43, _2), (LCD_H_ENABLE, GPIO43, _3), (EMAC_TXD0, GPIO44, _2),
(LCD_H_SYNC, GPIO44, _3), (EMAC_TXD1, GPIO45, _2), (LCD_V_SYNC, GPIO45, _3),
(EMAC_TXD2, GPIO46, _2), (CAM_DATA_0, GPIO46, _3), (EMAC_TXD3, GPIO47, _2),
(CAM_DATA_1, GPIO47, _3), (CAM_DATA_2, GPIO48, _3), (CAM_DATA_3, GPIO49, _3),
(CAM_DATA_4, GPIO50, _3), (CAM_DATA_5, GPIO51, _3), (FSPICS0, GPIO52, _2),
(CAM_DATA_6, GPIO52, _3), (FSPICLK, GPIO53, _2), (CAM_DATA_7, GPIO53, _3), (MTDO,
GPIO54, _0), (FSPID, GPIO54, _2), (CAM_PCLK, GPIO54, _3), (MTCK, GPIO55, _0),
(FSPIQ, GPIO55, _2), (CAM_XCLK, GPIO55, _3), (MTDI, GPIO56, _0), (FSPIHD, GPIO56,
_2), (CAM_V_SYNC, GPIO56, _3), (MTMS, GPIO57, _0), (FSPIWP, GPIO57, _2),
(CAM_H_SYNC, GPIO57, _3), (U0TXD, GPIO58, _0), (U0RXD, GPIO59, _0)));
_for_each_inner_iomux_function!((LCD_DATA_n((LCD_DATA_19, LCD_DATA_n, 19), GPIO2,
_3), ((LCD_DATA_20, LCD_DATA_n, 20), GPIO3, _3), ((LCD_DATA_21, LCD_DATA_n, 21),
GPIO4, _3), ((LCD_DATA_22, LCD_DATA_n, 22), GPIO5, _3), ((LCD_DATA_23,
LCD_DATA_n, 23), GPIO7, _3), ((LCD_DATA_0, LCD_DATA_n, 0), GPIO8, _3),
((LCD_DATA_1, LCD_DATA_n, 1), GPIO9, _3), ((LCD_DATA_2, LCD_DATA_n, 2), GPIO10,
_3), ((LCD_DATA_3, LCD_DATA_n, 3), GPIO11, _3), ((LCD_DATA_4, LCD_DATA_n, 4),
GPIO12, _3), ((LCD_DATA_5, LCD_DATA_n, 5), GPIO13, _3), ((LCD_DATA_6, LCD_DATA_n,
6), GPIO14, _3), ((LCD_DATA_7, LCD_DATA_n, 7), GPIO15, _3), ((LCD_DATA_8,
LCD_DATA_n, 8), GPIO16, _3), ((LCD_DATA_9, LCD_DATA_n, 9), GPIO17, _3),
((LCD_DATA_10, LCD_DATA_n, 10), GPIO18, _3), ((LCD_DATA_11, LCD_DATA_n, 11),
GPIO19, _3), ((LCD_DATA_12, LCD_DATA_n, 12), GPIO33, _3), ((LCD_DATA_13,
LCD_DATA_n, 13), GPIO34, _3), ((LCD_DATA_14, LCD_DATA_n, 14), GPIO35, _3),
((LCD_DATA_15, LCD_DATA_n, 15), GPIO36, _3), ((LCD_DATA_16, LCD_DATA_n, 16),
GPIO37, _3), ((LCD_DATA_17, LCD_DATA_n, 17), GPIO38, _3), ((LCD_DATA_18,
LCD_DATA_n, 18), GPIO39, _3)));
_for_each_inner_iomux_function!((EMAC_TXDn((EMAC_TXD0, EMAC_TXDn, 0), GPIO8, _2),
((EMAC_TXD1, EMAC_TXDn, 1), GPIO9, _2), ((EMAC_TXD2, EMAC_TXDn, 2), GPIO10, _2),
((EMAC_TXD3, EMAC_TXDn, 3), GPIO11, _2), ((EMAC_TXD0, EMAC_TXDn, 0), GPIO44, _2),
((EMAC_TXD1, EMAC_TXDn, 1), GPIO45, _2), ((EMAC_TXD2, EMAC_TXDn, 2), GPIO46, _2),
((EMAC_TXD3, EMAC_TXDn, 3), GPIO47, _2)));
_for_each_inner_iomux_function!((FSPICSn((FSPICS0, FSPICSn, 0), GPIO10, _0),
((FSPICS0, FSPICSn, 0), GPIO23, _2), ((FSPICS0, FSPICSn, 0), GPIO52, _2)));
_for_each_inner_iomux_function!((FSPIIOn((FSPIIO4, FSPIIOn, 4), GPIO15, _0),
((FSPIIO5, FSPIIOn, 5), GPIO16, _0), ((FSPIIO6, FSPIIOn, 6), GPIO17, _0),
((FSPIIO7, FSPIIOn, 7), GPIO18, _0)));
_for_each_inner_iomux_function!((DBG_PSRAM_DQn((DBG_PSRAM_DQ4, DBG_PSRAM_DQn, 4),
GPIO15, _4), ((DBG_PSRAM_DQ5, DBG_PSRAM_DQn, 5), GPIO16, _4), ((DBG_PSRAM_DQ6,
DBG_PSRAM_DQn, 6), GPIO17, _4), ((DBG_PSRAM_DQ7, DBG_PSRAM_DQn, 7), GPIO18,
_4))); _for_each_inner_iomux_function!((EMAC_RXDn((EMAC_RXD3, EMAC_RXDn, 3),
GPIO16, _2), ((EMAC_RXD2, EMAC_RXDn, 2), GPIO17, _2), ((EMAC_RXD1, EMAC_RXDn, 1),
GPIO18, _2), ((EMAC_RXD0, EMAC_RXDn, 0), GPIO19, _2), ((EMAC_RXD3, EMAC_RXDn, 3),
GPIO38, _2), ((EMAC_RXD2, EMAC_RXDn, 2), GPIO39, _2), ((EMAC_RXD1, EMAC_RXDn, 1),
GPIO40, _2))); _for_each_inner_iomux_function!((DBG_PSRAM_DQS_n((DBG_PSRAM_DQS_0,
DBG_PSRAM_DQS_n, 0), GPIO19, _4)));
_for_each_inner_iomux_function!((SDn_DATAm((SD1_DATA0, SDn_DATAm, 1, 0), GPIO20,
_0), ((SD1_DATA1, SDn_DATAm, 1, 1), GPIO21, _0), ((SD1_DATA2, SDn_DATAm, 1, 2),
GPIO22, _0), ((SD1_DATA3, SDn_DATAm, 1, 3), GPIO23, _0)));
_for_each_inner_iomux_function!((SDn_CLK((SD1_CLK, SDn_CLK, 1), GPIO24, _0)));
_for_each_inner_iomux_function!((SDn_CMD((SD1_CMD, SDn_CMD, 1), GPIO25, _0)));
_for_each_inner_iomux_function!((SPICSn((SPICS0, SPICSn, 0), GPIO26, _0)));
_for_each_inner_iomux_function!((SDn_CDATAm((SD2_CDATA0, SDn_CDATAm, 2, 0),
GPIO35, _4), ((SD2_CDATA1, SDn_CDATAm, 2, 1), GPIO36, _4), ((SD2_CDATA2,
SDn_CDATAm, 2, 2), GPIO37, _4), ((SD2_CDATA3, SDn_CDATAm, 2, 3), GPIO38, _4)));
_for_each_inner_iomux_function!((SDn_CCLK((SD2_CCLK, SDn_CCLK, 2), GPIO39, _4)));
_for_each_inner_iomux_function!((SDn_CCMD((SD2_CCMD, SDn_CCMD, 2), GPIO40, _4)));
_for_each_inner_iomux_function!((CAM_DATA_n((CAM_DATA_0, CAM_DATA_n, 0), GPIO46,
_3), ((CAM_DATA_1, CAM_DATA_n, 1), GPIO47, _3), ((CAM_DATA_2, CAM_DATA_n, 2),
GPIO48, _3), ((CAM_DATA_3, CAM_DATA_n, 3), GPIO49, _3), ((CAM_DATA_4, CAM_DATA_n,
4), GPIO50, _3), ((CAM_DATA_5, CAM_DATA_n, 5), GPIO51, _3), ((CAM_DATA_6,
CAM_DATA_n, 6), GPIO52, _3), ((CAM_DATA_7, CAM_DATA_n, 7), GPIO53, _3)));
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! gpio_for_signal {
(XTAL_32K_N $(, $_fallback:literal)?) => {
"GPIO0"
};
(LP_GPIO0 $(, $_fallback:literal)?) => {
"GPIO0"
};
(XTAL_32K_P $(, $_fallback:literal)?) => {
"GPIO1"
};
(LP_GPIO1 $(, $_fallback:literal)?) => {
"GPIO1"
};
(LCD_DATA_19 $(, $_fallback:literal)?) => {
"GPIO2"
};
(LP_GPIO2 $(, $_fallback:literal)?) => {
"GPIO2"
};
(LCD_DATA_20 $(, $_fallback:literal)?) => {
"GPIO3"
};
(LP_GPIO3 $(, $_fallback:literal)?) => {
"GPIO3"
};
(LCD_DATA_21 $(, $_fallback:literal)?) => {
"GPIO4"
};
(LP_GPIO4 $(, $_fallback:literal)?) => {
"GPIO4"
};
(LCD_DATA_22 $(, $_fallback:literal)?) => {
"GPIO5"
};
(LP_GPIO5 $(, $_fallback:literal)?) => {
"GPIO5"
};
(LP_GPIO6 $(, $_fallback:literal)?) => {
"GPIO6"
};
(LCD_DATA_23 $(, $_fallback:literal)?) => {
"GPIO7"
};
(LP_GPIO7 $(, $_fallback:literal)?) => {
"GPIO7"
};
(EMAC_TXD0 $(, $_fallback:literal)?) => {
"GPIO8"
};
(LCD_DATA_0 $(, $_fallback:literal)?) => {
"GPIO8"
};
(FSPIHD $(, $_fallback:literal)?) => {
"GPIO9"
};
(EMAC_TXD1 $(, $_fallback:literal)?) => {
"GPIO9"
};
(LCD_DATA_1 $(, $_fallback:literal)?) => {
"GPIO9"
};
(DBG_PSRAM_CK $(, $_fallback:literal)?) => {
"GPIO9"
};
(FSPICS0 $(, $_fallback:literal)?) => {
"GPIO10"
};
(EMAC_TXD2 $(, $_fallback:literal)?) => {
"GPIO10"
};
(LCD_DATA_2 $(, $_fallback:literal)?) => {
"GPIO10"
};
(DBG_PSRAM_CS $(, $_fallback:literal)?) => {
"GPIO10"
};
(FSPID $(, $_fallback:literal)?) => {
"GPIO11"
};
(EMAC_TXD3 $(, $_fallback:literal)?) => {
"GPIO11"
};
(LCD_DATA_3 $(, $_fallback:literal)?) => {
"GPIO11"
};
(DBG_PSRAM_D $(, $_fallback:literal)?) => {
"GPIO11"
};
(FSPICLK $(, $_fallback:literal)?) => {
"GPIO12"
};
(EMAC_TXEN $(, $_fallback:literal)?) => {
"GPIO12"
};
(LCD_DATA_4 $(, $_fallback:literal)?) => {
"GPIO12"
};
(DBG_PSRAM_Q $(, $_fallback:literal)?) => {
"GPIO12"
};
(FSPIQ $(, $_fallback:literal)?) => {
"GPIO13"
};
(EMAC_RMII_CLK $(, $_fallback:literal)?) => {
"GPIO13"
};
(LCD_DATA_5 $(, $_fallback:literal)?) => {
"GPIO13"
};
(DBG_PSRAM_WP $(, $_fallback:literal)?) => {
"GPIO13"
};
(FSPIWP $(, $_fallback:literal)?) => {
"GPIO14"
};
(EMAC_RX_CLK $(, $_fallback:literal)?) => {
"GPIO14"
};
(LCD_DATA_6 $(, $_fallback:literal)?) => {
"GPIO14"
};
(DBG_PSRAM_HOLD $(, $_fallback:literal)?) => {
"GPIO14"
};
(FSPIIO4 $(, $_fallback:literal)?) => {
"GPIO15"
};
(EMAC_RXDV $(, $_fallback:literal)?) => {
"GPIO15"
};
(LCD_DATA_7 $(, $_fallback:literal)?) => {
"GPIO15"
};
(DBG_PSRAM_DQ4 $(, $_fallback:literal)?) => {
"GPIO15"
};
(FSPIIO5 $(, $_fallback:literal)?) => {
"GPIO16"
};
(EMAC_RXD3 $(, $_fallback:literal)?) => {
"GPIO16"
};
(LCD_DATA_8 $(, $_fallback:literal)?) => {
"GPIO16"
};
(DBG_PSRAM_DQ5 $(, $_fallback:literal)?) => {
"GPIO16"
};
(FSPIIO6 $(, $_fallback:literal)?) => {
"GPIO17"
};
(EMAC_RXD2 $(, $_fallback:literal)?) => {
"GPIO17"
};
(LCD_DATA_9 $(, $_fallback:literal)?) => {
"GPIO17"
};
(DBG_PSRAM_DQ6 $(, $_fallback:literal)?) => {
"GPIO17"
};
(FSPIIO7 $(, $_fallback:literal)?) => {
"GPIO18"
};
(EMAC_RXD1 $(, $_fallback:literal)?) => {
"GPIO18"
};
(LCD_DATA_10 $(, $_fallback:literal)?) => {
"GPIO18"
};
(DBG_PSRAM_DQ7 $(, $_fallback:literal)?) => {
"GPIO18"
};
(FSPIDQS $(, $_fallback:literal)?) => {
"GPIO19"
};
(EMAC_RXD0 $(, $_fallback:literal)?) => {
"GPIO19"
};
(LCD_DATA_11 $(, $_fallback:literal)?) => {
"GPIO19"
};
(DBG_PSRAM_DQS_0 $(, $_fallback:literal)?) => {
"GPIO19"
};
(SD1_DATA0 $(, $_fallback:literal)?) => {
"GPIO20"
};
(DBG_FLASH_CK $(, $_fallback:literal)?) => {
"GPIO20"
};
(SD1_DATA1 $(, $_fallback:literal)?) => {
"GPIO21"
};
(DBG_FLASH_D $(, $_fallback:literal)?) => {
"GPIO21"
};
(SD1_DATA2 $(, $_fallback:literal)?) => {
"GPIO22"
};
(DBG_FLASH_CS $(, $_fallback:literal)?) => {
"GPIO22"
};
(SD1_DATA3 $(, $_fallback:literal)?) => {
"GPIO23"
};
(DBG_FLASH_Q $(, $_fallback:literal)?) => {
"GPIO23"
};
(SD1_CLK $(, $_fallback:literal)?) => {
"GPIO24"
};
(DBG_FLASH_WP $(, $_fallback:literal)?) => {
"GPIO24"
};
(SD1_CMD $(, $_fallback:literal)?) => {
"GPIO25"
};
(DBG_FLASH_HOLD $(, $_fallback:literal)?) => {
"GPIO25"
};
(SPICS0 $(, $_fallback:literal)?) => {
"GPIO26"
};
(SPIQ $(, $_fallback:literal)?) => {
"GPIO27"
};
(SPIWP $(, $_fallback:literal)?) => {
"GPIO28"
};
(SPIHD $(, $_fallback:literal)?) => {
"GPIO30"
};
(SPICLK $(, $_fallback:literal)?) => {
"GPIO31"
};
(SPID $(, $_fallback:literal)?) => {
"GPIO32"
};
(LCD_DATA_12 $(, $_fallback:literal)?) => {
"GPIO33"
};
(USJ_DM $(, $_fallback:literal)?) => {
"GPIO33"
};
(LCD_DATA_13 $(, $_fallback:literal)?) => {
"GPIO34"
};
(USJ_DP $(, $_fallback:literal)?) => {
"GPIO34"
};
(REF_50M_CLK $(, $_fallback:literal)?) => {
"GPIO35"
};
(LCD_DATA_14 $(, $_fallback:literal)?) => {
"GPIO35"
};
(SD2_CDATA0 $(, $_fallback:literal)?) => {
"GPIO35"
};
(LCD_DATA_15 $(, $_fallback:literal)?) => {
"GPIO36"
};
(SD2_CDATA1 $(, $_fallback:literal)?) => {
"GPIO36"
};
(LCD_DATA_16 $(, $_fallback:literal)?) => {
"GPIO37"
};
(SD2_CDATA2 $(, $_fallback:literal)?) => {
"GPIO37"
};
(LCD_DATA_17 $(, $_fallback:literal)?) => {
"GPIO38"
};
(SD2_CDATA3 $(, $_fallback:literal)?) => {
"GPIO38"
};
(LCD_DATA_18 $(, $_fallback:literal)?) => {
"GPIO39"
};
(SD2_CCLK $(, $_fallback:literal)?) => {
"GPIO39"
};
(LCD_PCLK $(, $_fallback:literal)?) => {
"GPIO40"
};
(SD2_CCMD $(, $_fallback:literal)?) => {
"GPIO40"
};
(ADC1_CH0 $(, $_fallback:literal)?) => {
"GPIO42"
};
(LCD_H_ENABLE $(, $_fallback:literal)?) => {
"GPIO43"
};
(ADC1_CH1 $(, $_fallback:literal)?) => {
"GPIO43"
};
(LCD_H_SYNC $(, $_fallback:literal)?) => {
"GPIO44"
};
(ADC1_CH2 $(, $_fallback:literal)?) => {
"GPIO44"
};
(LCD_V_SYNC $(, $_fallback:literal)?) => {
"GPIO45"
};
(ADC1_CH3 $(, $_fallback:literal)?) => {
"GPIO45"
};
(CAM_DATA_0 $(, $_fallback:literal)?) => {
"GPIO46"
};
(ADC1_CH4 $(, $_fallback:literal)?) => {
"GPIO46"
};
(CAM_DATA_1 $(, $_fallback:literal)?) => {
"GPIO47"
};
(ADC1_CH5 $(, $_fallback:literal)?) => {
"GPIO47"
};
(CAM_DATA_2 $(, $_fallback:literal)?) => {
"GPIO48"
};
(ADC1_CH6 $(, $_fallback:literal)?) => {
"GPIO48"
};
(CAM_DATA_3 $(, $_fallback:literal)?) => {
"GPIO49"
};
(ADC1_CH7 $(, $_fallback:literal)?) => {
"GPIO49"
};
(CAM_DATA_4 $(, $_fallback:literal)?) => {
"GPIO50"
};
(ADC2_CH0 $(, $_fallback:literal)?) => {
"GPIO50"
};
(CAM_DATA_5 $(, $_fallback:literal)?) => {
"GPIO51"
};
(ADC2_CH1 $(, $_fallback:literal)?) => {
"GPIO51"
};
(CAM_DATA_6 $(, $_fallback:literal)?) => {
"GPIO52"
};
(ADC2_CH2 $(, $_fallback:literal)?) => {
"GPIO52"
};
(CAM_DATA_7 $(, $_fallback:literal)?) => {
"GPIO53"
};
(ADC2_CH3 $(, $_fallback:literal)?) => {
"GPIO53"
};
(MTDO $(, $_fallback:literal)?) => {
"GPIO54"
};
(CAM_PCLK $(, $_fallback:literal)?) => {
"GPIO54"
};
(ADC2_CH4 $(, $_fallback:literal)?) => {
"GPIO54"
};
(MTCK $(, $_fallback:literal)?) => {
"GPIO55"
};
(CAM_XCLK $(, $_fallback:literal)?) => {
"GPIO55"
};
(ADC2_CH5 $(, $_fallback:literal)?) => {
"GPIO55"
};
(MTDI $(, $_fallback:literal)?) => {
"GPIO56"
};
(CAM_V_SYNC $(, $_fallback:literal)?) => {
"GPIO56"
};
(ADC2_CH6 $(, $_fallback:literal)?) => {
"GPIO56"
};
(MTMS $(, $_fallback:literal)?) => {
"GPIO57"
};
(CAM_H_SYNC $(, $_fallback:literal)?) => {
"GPIO57"
};
(ADC2_CH7 $(, $_fallback:literal)?) => {
"GPIO57"
};
(U0TXD $(, $_fallback:literal)?) => {
"GPIO58"
};
(U0RXD $(, $_fallback:literal)?) => {
"GPIO59"
};
($_signal:ident, $fallback:literal) => {
$fallback
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! define_io_mux_signals {
() => {
#[allow(non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Debug, PartialEq, Copy, Clone)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[doc(hidden)]
pub enum InputSignal {
U0RXD = 10,
U0CTS = 11,
U0DSR = 12,
U1RXD = 13,
U1CTS = 14,
U1DSR = 15,
U2RXD = 16,
U2CTS = 17,
U2DSR = 18,
U3RXD = 137,
U3CTS = 138,
U3DSR = 139,
I2S0O_BCK = 25,
I2S0_MCLK = 26,
I2S0O_WS = 27,
I2S0I_SD = 28,
I2S0I_BCK = 29,
I2S0I_WS = 30,
I2S0I_SD1 = 43,
I2S0I_SD2 = 44,
I2S0I_SD3 = 45,
I2S1O_BCK = 31,
I2S1_MCLK = 32,
I2S1O_WS = 33,
I2S1I_SD = 34,
I2S1I_BCK = 35,
I2S1I_WS = 36,
FSPICLK = 53,
FSPIQ = 54,
FSPID = 55,
FSPIHD = 56,
FSPIWP = 57,
FSPIIO4 = 58,
FSPIIO5 = 59,
FSPIIO6 = 60,
FSPIIO7 = 61,
FSPICS0 = 62,
FSPICS1 = 63,
FSPICS2 = 64,
FSPICS3 = 65,
FSPICS4 = 66,
FSPICS5 = 67,
SPI3_CK = 47,
SPI3_Q = 48,
SPI3_D = 49,
SPI3_HOLD = 50,
SPI3_WP = 51,
SPI3_CS = 52,
I2CEXT0_SCL = 68,
I2CEXT0_SDA = 69,
I2CEXT1_SCL = 70,
I2CEXT1_SDA = 71,
USB_JTAG_TDO_BRIDGE = 140,
PCNT0_SIG_CH0 = 141,
PCNT1_SIG_CH0 = 142,
PCNT2_SIG_CH0 = 143,
PCNT3_SIG_CH0 = 144,
PCNT0_SIG_CH1 = 145,
PCNT1_SIG_CH1 = 146,
PCNT2_SIG_CH1 = 147,
PCNT3_SIG_CH1 = 148,
PCNT0_CTRL_CH0 = 149,
PCNT1_CTRL_CH0 = 150,
PCNT2_CTRL_CH0 = 151,
PCNT3_CTRL_CH0 = 152,
PCNT0_CTRL_CH1 = 153,
PCNT1_CTRL_CH1 = 154,
PCNT2_CTRL_CH1 = 155,
PCNT3_CTRL_CH1 = 156,
PCNT1_U0_CTRL_CH0 = 72,
PCNT1_U1_CTRL_CH0 = 73,
PCNT1_U2_CTRL_CH0 = 74,
PCNT1_U3_CTRL_CH0 = 75,
PCNT1_U0_CTRL_CH1 = 76,
PCNT1_U1_CTRL_CH1 = 77,
PCNT1_U2_CTRL_CH1 = 78,
PCNT1_U3_CTRL_CH1 = 79,
PCNT1_U0_SIG_CH0 = 204,
PCNT1_U1_SIG_CH0 = 205,
PCNT1_U2_SIG_CH0 = 206,
PCNT1_U3_SIG_CH0 = 207,
PCNT1_U0_SIG_CH1 = 208,
PCNT1_U1_SIG_CH1 = 209,
PCNT1_U2_SIG_CH1 = 210,
PCNT1_U3_SIG_CH1 = 211,
CPU_GPIO_0 = 214,
CPU_GPIO_1 = 215,
CPU_GPIO_2 = 216,
CPU_GPIO_3 = 217,
CPU_GPIO_4 = 218,
CPU_GPIO_5 = 219,
CPU_GPIO_6 = 220,
CPU_GPIO_7 = 221,
CPU_GPIO_8 = 222,
CPU_GPIO_9 = 223,
CPU_GPIO_10 = 224,
CPU_GPIO_11 = 225,
CPU_GPIO_12 = 226,
CPU_GPIO_13 = 227,
CPU_GPIO_14 = 228,
CPU_GPIO_15 = 229,
RMT_SIG_0 = 246,
RMT_SIG_1 = 247,
RMT_SIG_2 = 248,
RMT_SIG_3 = 249,
CAM_PCLK = 158,
CAM_H_ENABLE = 159,
CAM_H_SYNC = 160,
CAM_V_SYNC = 161,
CAM_DATA_0 = 162,
CAM_DATA_1 = 163,
CAM_DATA_2 = 164,
CAM_DATA_3 = 165,
CAM_DATA_4 = 166,
CAM_DATA_5 = 167,
CAM_DATA_6 = 168,
CAM_DATA_7 = 169,
CAM_DATA_8 = 170,
CAM_DATA_9 = 171,
CAM_DATA_10 = 172,
CAM_DATA_11 = 173,
CAM_DATA_12 = 174,
CAM_DATA_13 = 175,
CAM_DATA_14 = 176,
CAM_DATA_15 = 177,
SDHOST_CDATA_IN_41 = 0,
SDHOST_CDATA_IN_51 = 1,
SDHOST_CDATA_IN_61 = 2,
SDHOST_CDATA_IN_71 = 3,
SDHOST_CDATA_IN_42 = 4,
SDHOST_CDATA_IN_52 = 5,
SDHOST_CDATA_IN_62 = 6,
SDHOST_CDATA_IN_72 = 7,
SDHOST_CARD_DETECT_N_1 = 126,
SDHOST_CARD_DETECT_N_2 = 127,
SDHOST_CARD_INT_N_1 = 128,
SDHOST_CARD_INT_N_2 = 129,
SDHOST_CARD_WRITE_PRT_1 = 130,
SDHOST_CARD_WRITE_PRT_2 = 131,
SDHOST_DATA_STROBE_1 = 132,
SDHOST_DATA_STROBE_2 = 133,
EMAC_MDI = 107,
EMAC_COL = 108,
EMAC_CRS = 109,
EMAC_RXDV = 178,
EMAC_RXD0 = 179,
EMAC_RXD1 = 180,
EMAC_RXD2 = 181,
EMAC_RXD3 = 182,
EMAC_RXER = 183,
EMAC_RX_CLK = 184,
EMAC_TX_CLK = 185,
SIG_IN_FUNC251 = 251,
SIG_IN_FUNC252 = 252,
SIG_IN_FUNC253 = 253,
SIG_IN_FUNC254 = 254,
SIG_IN_FUNC255 = 255,
MTDO,
MTCK,
MTDI,
MTMS,
SD1_DATA0,
SD1_DATA1,
SD1_DATA2,
SD1_DATA3,
SD1_CLK,
SD1_CMD,
SPICS0,
SPIQ,
SPIWP,
SPIHD,
SPICLK,
SPID,
EMAC_RMII_CLK,
REF_50M_CLK,
CAM_XCLK,
SD2_CDATA0,
SD2_CDATA1,
SD2_CDATA2,
SD2_CDATA3,
SD2_CCLK,
SD2_CCMD,
DBG_PSRAM_CK,
DBG_PSRAM_CS,
DBG_PSRAM_D,
DBG_PSRAM_Q,
DBG_PSRAM_WP,
DBG_PSRAM_HOLD,
DBG_PSRAM_DQ4,
DBG_PSRAM_DQ5,
DBG_PSRAM_DQ6,
DBG_PSRAM_DQ7,
DBG_PSRAM_DQS_0,
DBG_FLASH_CK,
DBG_FLASH_D,
DBG_FLASH_CS,
DBG_FLASH_Q,
DBG_FLASH_WP,
DBG_FLASH_HOLD,
}
#[allow(non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Debug, PartialEq, Copy, Clone)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[doc(hidden)]
pub enum OutputSignal {
SDHOST_CDATA_OUT_41 = 0,
SDHOST_CDATA_OUT_51 = 1,
SDHOST_CDATA_OUT_61 = 2,
SDHOST_CDATA_OUT_71 = 3,
SDHOST_CDATA_OUT_42 = 4,
SDHOST_CDATA_OUT_52 = 5,
SDHOST_CDATA_OUT_62 = 6,
SDHOST_CDATA_OUT_72 = 7,
SD_RST_N_1 = 146,
SD_RST_N_2 = 147,
SD_CCMD_OD_PULLUP_EN_N = 148,
U0TXD = 10,
U0RTS = 11,
U0DTR = 12,
U1TXD = 13,
U1RTS = 14,
U1DTR = 15,
U2TXD = 16,
U2RTS = 17,
U2DTR = 18,
U3TXD = 137,
U3RTS = 138,
U3DTR = 116,
I2S0O_BCK = 25,
I2S0_MCLK = 26,
I2S0O_WS = 27,
I2S0O_SD = 28,
I2S0I_BCK = 29,
I2S0I_WS = 30,
I2S0O_SD1 = 43,
I2S1O_BCK = 31,
I2S1_MCLK = 32,
I2S1O_WS = 33,
I2S1O_SD = 34,
I2S1I_BCK = 35,
I2S1I_WS = 36,
FSPICLK = 53,
FSPIQ = 54,
FSPID = 55,
FSPIHD = 56,
FSPIWP = 57,
FSPIIO4 = 58,
FSPIIO5 = 59,
FSPIIO6 = 60,
FSPIIO7 = 61,
FSPIDQS = 44,
FSPICS0 = 62,
FSPICS1 = 63,
FSPICS2 = 64,
FSPICS3 = 65,
FSPICS4 = 66,
FSPICS5 = 67,
SPI3_CS2 = 45,
SPI3_CS1 = 46,
SPI3_CK = 47,
SPI3_Q = 48,
SPI3_D = 49,
SPI3_HOLD = 50,
SPI3_WP = 51,
SPI3_CS = 52,
I2CEXT0_SCL = 68,
I2CEXT0_SDA = 69,
I2CEXT1_SCL = 70,
I2CEXT1_SDA = 71,
GPIO_SD0 = 72,
GPIO_SD1 = 73,
GPIO_SD2 = 74,
GPIO_SD3 = 75,
GPIO_SD4 = 76,
GPIO_SD5 = 77,
GPIO_SD6 = 78,
GPIO_SD7 = 79,
CPU_GPIO_0 = 214,
CPU_GPIO_1 = 215,
CPU_GPIO_2 = 216,
CPU_GPIO_3 = 217,
CPU_GPIO_4 = 218,
CPU_GPIO_5 = 219,
CPU_GPIO_6 = 220,
CPU_GPIO_7 = 221,
CPU_GPIO_8 = 222,
CPU_GPIO_9 = 223,
CPU_GPIO_10 = 224,
CPU_GPIO_11 = 225,
CPU_GPIO_12 = 226,
CPU_GPIO_13 = 227,
CPU_GPIO_14 = 228,
CPU_GPIO_15 = 229,
RMT_SIG_0 = 246,
RMT_SIG_1 = 247,
RMT_SIG_2 = 248,
RMT_SIG_3 = 249,
LCD_CS = 144,
LCD_DC = 145,
LCD_PCLK = 149,
CAM_CLK = 150,
LCD_H_ENABLE = 151,
LCD_H_SYNC = 152,
LCD_V_SYNC = 153,
LCD_DATA_0 = 154,
LCD_DATA_1 = 155,
LCD_DATA_2 = 156,
LCD_DATA_3 = 157,
LCD_DATA_4 = 158,
LCD_DATA_5 = 159,
LCD_DATA_6 = 160,
LCD_DATA_7 = 161,
LCD_DATA_8 = 162,
LCD_DATA_9 = 163,
LCD_DATA_10 = 164,
LCD_DATA_11 = 165,
LCD_DATA_12 = 166,
LCD_DATA_13 = 167,
LCD_DATA_14 = 168,
LCD_DATA_15 = 169,
LCD_DATA_16 = 170,
LCD_DATA_17 = 171,
LCD_DATA_18 = 172,
LCD_DATA_19 = 173,
LCD_DATA_20 = 174,
LCD_DATA_21 = 175,
LCD_DATA_22 = 176,
LCD_DATA_23 = 177,
EMAC_PTP_PPS = 105,
EMAC_MDC = 108,
EMAC_MDO = 109,
EMAC_TXEN = 178,
EMAC_TXD0 = 179,
EMAC_TXD1 = 180,
EMAC_TXD2 = 181,
EMAC_TXD3 = 182,
EMAC_TXER = 183,
GPIO = 256,
MTDO,
MTCK,
MTDI,
MTMS,
SD1_DATA0,
SD1_DATA1,
SD1_DATA2,
SD1_DATA3,
SD1_CLK,
SD1_CMD,
SPICS0,
SPIQ,
SPIWP,
SPIHD,
SPICLK,
SPID,
EMAC_RMII_CLK,
REF_50M_CLK,
CAM_XCLK,
SD2_CDATA0,
SD2_CDATA1,
SD2_CDATA2,
SD2_CDATA3,
SD2_CCLK,
SD2_CCMD,
DBG_PSRAM_CK,
DBG_PSRAM_CS,
DBG_PSRAM_D,
DBG_PSRAM_Q,
DBG_PSRAM_WP,
DBG_PSRAM_HOLD,
DBG_PSRAM_DQ4,
DBG_PSRAM_DQ5,
DBG_PSRAM_DQ6,
DBG_PSRAM_DQ7,
DBG_PSRAM_DQS_0,
DBG_FLASH_CK,
DBG_FLASH_D,
DBG_FLASH_CS,
DBG_FLASH_Q,
DBG_FLASH_WP,
DBG_FLASH_HOLD,
}
};
}
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! define_lp_functions {
() => {
#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[doc(hidden)]
pub enum LpFunction {
_1 = 1,
}
impl LpFunction {
pub const LP_GPIO: Self = Self::_1;
}
};
}
#[macro_export]
#[expect(clippy::crate_in_macro_def)]
#[cfg_attr(docsrs, doc(cfg(feature = "_device-selected")))]
macro_rules! define_io_mux_reg {
() => {
pub(crate) fn io_mux_reg(gpio_num: u8) -> &'static crate::pac::io_mux::GPIO {
crate::peripherals::IO_MUX::regs().gpio(gpio_num as usize)
}
};
}