mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-26 20:00:32 +00:00
Calculate max input/output signal ID automatically (#3773)
This commit is contained in:
parent
41fed590c2
commit
1a9b4bafe0
@ -224,12 +224,12 @@ impl Chip {
|
||||
"uart_uart2",
|
||||
"gpio_has_bank_1",
|
||||
"gpio_gpio_function=\"2\"",
|
||||
"gpio_input_signal_max=\"206\"",
|
||||
"gpio_output_signal_max=\"256\"",
|
||||
"gpio_constant_0_input=\"48\"",
|
||||
"gpio_constant_1_input=\"56\"",
|
||||
"gpio_remap_iomux_pin_registers",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"206\"",
|
||||
"gpio_output_signal_max=\"256\"",
|
||||
"i2c_master_separate_filter_config_registers",
|
||||
"i2c_master_i2c0_data_register_ahb_address=\"1610690588\"",
|
||||
"i2c_master_max_bus_timeout=\"1048575\"",
|
||||
@ -366,12 +366,12 @@ impl Chip {
|
||||
"cargo:rustc-cfg=uart_uart2",
|
||||
"cargo:rustc-cfg=gpio_has_bank_1",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"2\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"206\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"256\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"48\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"56\"",
|
||||
"cargo:rustc-cfg=gpio_remap_iomux_pin_registers",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"206\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"256\"",
|
||||
"cargo:rustc-cfg=i2c_master_separate_filter_config_registers",
|
||||
"cargo:rustc-cfg=i2c_master_i2c0_data_register_ahb_address=\"1610690588\"",
|
||||
"cargo:rustc-cfg=i2c_master_max_bus_timeout=\"1048575\"",
|
||||
@ -471,11 +471,11 @@ impl Chip {
|
||||
"uart_uart1",
|
||||
"assist_debug_has_sp_monitor",
|
||||
"gpio_gpio_function=\"1\"",
|
||||
"gpio_input_signal_max=\"100\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"gpio_constant_0_input=\"31\"",
|
||||
"gpio_constant_1_input=\"30\"",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"100\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"i2c_master_has_fsm_timeouts",
|
||||
"i2c_master_has_hw_bus_clear",
|
||||
"i2c_master_has_bus_timeout_enable",
|
||||
@ -573,11 +573,11 @@ impl Chip {
|
||||
"cargo:rustc-cfg=uart_uart1",
|
||||
"cargo:rustc-cfg=assist_debug_has_sp_monitor",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"1\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"100\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"31\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"30\"",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"100\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=i2c_master_has_fsm_timeouts",
|
||||
"cargo:rustc-cfg=i2c_master_has_hw_bus_clear",
|
||||
"cargo:rustc-cfg=i2c_master_has_bus_timeout_enable",
|
||||
@ -697,11 +697,11 @@ impl Chip {
|
||||
"assist_debug_has_sp_monitor",
|
||||
"assist_debug_has_region_monitor",
|
||||
"gpio_gpio_function=\"1\"",
|
||||
"gpio_input_signal_max=\"100\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"gpio_constant_0_input=\"31\"",
|
||||
"gpio_constant_1_input=\"30\"",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"100\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"i2c_master_has_fsm_timeouts",
|
||||
"i2c_master_has_hw_bus_clear",
|
||||
"i2c_master_has_bus_timeout_enable",
|
||||
@ -819,11 +819,11 @@ impl Chip {
|
||||
"cargo:rustc-cfg=assist_debug_has_sp_monitor",
|
||||
"cargo:rustc-cfg=assist_debug_has_region_monitor",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"1\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"100\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"31\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"30\"",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"100\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=i2c_master_has_fsm_timeouts",
|
||||
"cargo:rustc-cfg=i2c_master_has_hw_bus_clear",
|
||||
"cargo:rustc-cfg=i2c_master_has_bus_timeout_enable",
|
||||
@ -993,11 +993,11 @@ impl Chip {
|
||||
"assist_debug_has_sp_monitor",
|
||||
"assist_debug_has_region_monitor",
|
||||
"gpio_gpio_function=\"1\"",
|
||||
"gpio_input_signal_max=\"124\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"gpio_constant_0_input=\"60\"",
|
||||
"gpio_constant_1_input=\"56\"",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"124\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"i2c_master_has_fsm_timeouts",
|
||||
"i2c_master_has_hw_bus_clear",
|
||||
"i2c_master_has_bus_timeout_enable",
|
||||
@ -1166,11 +1166,11 @@ impl Chip {
|
||||
"cargo:rustc-cfg=assist_debug_has_sp_monitor",
|
||||
"cargo:rustc-cfg=assist_debug_has_region_monitor",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"1\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"124\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"60\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"56\"",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"124\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=i2c_master_has_fsm_timeouts",
|
||||
"cargo:rustc-cfg=i2c_master_has_hw_bus_clear",
|
||||
"cargo:rustc-cfg=i2c_master_has_bus_timeout_enable",
|
||||
@ -1322,11 +1322,11 @@ impl Chip {
|
||||
"assist_debug_has_sp_monitor",
|
||||
"assist_debug_has_region_monitor",
|
||||
"gpio_gpio_function=\"1\"",
|
||||
"gpio_input_signal_max=\"124\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"gpio_constant_0_input=\"60\"",
|
||||
"gpio_constant_1_input=\"56\"",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"124\"",
|
||||
"gpio_output_signal_max=\"128\"",
|
||||
"i2c_master_has_fsm_timeouts",
|
||||
"i2c_master_has_hw_bus_clear",
|
||||
"i2c_master_has_bus_timeout_enable",
|
||||
@ -1473,11 +1473,11 @@ impl Chip {
|
||||
"cargo:rustc-cfg=assist_debug_has_sp_monitor",
|
||||
"cargo:rustc-cfg=assist_debug_has_region_monitor",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"1\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"124\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"60\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"56\"",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"124\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"128\"",
|
||||
"cargo:rustc-cfg=i2c_master_has_fsm_timeouts",
|
||||
"cargo:rustc-cfg=i2c_master_has_hw_bus_clear",
|
||||
"cargo:rustc-cfg=i2c_master_has_bus_timeout_enable",
|
||||
@ -1623,11 +1623,11 @@ impl Chip {
|
||||
"uart_uart1",
|
||||
"gpio_has_bank_1",
|
||||
"gpio_gpio_function=\"1\"",
|
||||
"gpio_input_signal_max=\"204\"",
|
||||
"gpio_output_signal_max=\"256\"",
|
||||
"gpio_constant_0_input=\"60\"",
|
||||
"gpio_constant_1_input=\"56\"",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"242\"",
|
||||
"gpio_output_signal_max=\"256\"",
|
||||
"i2c_master_has_bus_timeout_enable",
|
||||
"i2c_master_separate_filter_config_registers",
|
||||
"i2c_master_has_arbitration_en",
|
||||
@ -1766,11 +1766,11 @@ impl Chip {
|
||||
"cargo:rustc-cfg=uart_uart1",
|
||||
"cargo:rustc-cfg=gpio_has_bank_1",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"1\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"204\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"256\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"60\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"56\"",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"242\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"256\"",
|
||||
"cargo:rustc-cfg=i2c_master_has_bus_timeout_enable",
|
||||
"cargo:rustc-cfg=i2c_master_separate_filter_config_registers",
|
||||
"cargo:rustc-cfg=i2c_master_has_arbitration_en",
|
||||
@ -1929,11 +1929,11 @@ impl Chip {
|
||||
"assist_debug_has_region_monitor",
|
||||
"gpio_has_bank_1",
|
||||
"gpio_gpio_function=\"1\"",
|
||||
"gpio_input_signal_max=\"189\"",
|
||||
"gpio_output_signal_max=\"256\"",
|
||||
"gpio_constant_0_input=\"60\"",
|
||||
"gpio_constant_1_input=\"56\"",
|
||||
"gpio_func_in_sel_offset=\"0\"",
|
||||
"gpio_input_signal_max=\"255\"",
|
||||
"gpio_output_signal_max=\"256\"",
|
||||
"i2c_master_has_fsm_timeouts",
|
||||
"i2c_master_has_hw_bus_clear",
|
||||
"i2c_master_has_bus_timeout_enable",
|
||||
@ -2092,11 +2092,11 @@ impl Chip {
|
||||
"cargo:rustc-cfg=assist_debug_has_region_monitor",
|
||||
"cargo:rustc-cfg=gpio_has_bank_1",
|
||||
"cargo:rustc-cfg=gpio_gpio_function=\"1\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"189\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"256\"",
|
||||
"cargo:rustc-cfg=gpio_constant_0_input=\"60\"",
|
||||
"cargo:rustc-cfg=gpio_constant_1_input=\"56\"",
|
||||
"cargo:rustc-cfg=gpio_func_in_sel_offset=\"0\"",
|
||||
"cargo:rustc-cfg=gpio_input_signal_max=\"255\"",
|
||||
"cargo:rustc-cfg=gpio_output_signal_max=\"256\"",
|
||||
"cargo:rustc-cfg=i2c_master_has_fsm_timeouts",
|
||||
"cargo:rustc-cfg=i2c_master_has_hw_bus_clear",
|
||||
"cargo:rustc-cfg=i2c_master_has_bus_timeout_enable",
|
||||
@ -2384,13 +2384,13 @@ impl Config {
|
||||
println!("cargo:rustc-check-cfg=cfg(octal_psram)");
|
||||
println!("cargo:rustc-check-cfg=cfg(camera)");
|
||||
println!("cargo:rustc-check-cfg=cfg(gpio_gpio_function, values(\"2\",\"1\"))");
|
||||
println!(
|
||||
"cargo:rustc-check-cfg=cfg(gpio_input_signal_max, values(\"206\",\"100\",\"124\",\"204\",\"189\"))"
|
||||
);
|
||||
println!("cargo:rustc-check-cfg=cfg(gpio_output_signal_max, values(\"256\",\"128\"))");
|
||||
println!("cargo:rustc-check-cfg=cfg(gpio_constant_0_input, values(\"48\",\"31\",\"60\"))");
|
||||
println!("cargo:rustc-check-cfg=cfg(gpio_constant_1_input, values(\"56\",\"30\"))");
|
||||
println!("cargo:rustc-check-cfg=cfg(gpio_func_in_sel_offset, values(\"0\"))");
|
||||
println!(
|
||||
"cargo:rustc-check-cfg=cfg(gpio_input_signal_max, values(\"206\",\"100\",\"124\",\"242\",\"255\"))"
|
||||
);
|
||||
println!("cargo:rustc-check-cfg=cfg(gpio_output_signal_max, values(\"256\",\"128\"))");
|
||||
println!(
|
||||
"cargo:rustc-check-cfg=cfg(i2c_master_i2c0_data_register_ahb_address, values(\"1610690588\"))"
|
||||
);
|
||||
|
@ -32,18 +32,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(2)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
206
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(206)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
256
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(256)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
48
|
||||
};
|
||||
@ -65,6 +53,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
206
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(206)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
256
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(256)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
false
|
||||
};
|
||||
|
@ -38,18 +38,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(1)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
100
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(100)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
31
|
||||
};
|
||||
@ -71,6 +59,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
100
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(100)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
true
|
||||
};
|
||||
|
@ -38,18 +38,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(1)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
100
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(100)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
31
|
||||
};
|
||||
@ -71,6 +59,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
100
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(100)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
true
|
||||
};
|
||||
|
@ -38,18 +38,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(1)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
124
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(124)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
60
|
||||
};
|
||||
@ -71,6 +59,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
124
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(124)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
true
|
||||
};
|
||||
|
@ -38,18 +38,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(1)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
124
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(124)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
60
|
||||
};
|
||||
@ -71,6 +59,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
124
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(124)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
128
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(128)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
true
|
||||
};
|
||||
|
@ -32,18 +32,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(1)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
204
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(204)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
256
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(256)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
60
|
||||
};
|
||||
@ -65,6 +53,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
242
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(242)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
256
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(256)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
false
|
||||
};
|
||||
@ -1239,6 +1239,14 @@ macro_rules! define_io_mux_signals {
|
||||
SUBSPIDQS = 171,
|
||||
PCMFSYNC = 203,
|
||||
PCMCLK = 204,
|
||||
PRO_ALONEGPIO_IN0 = 235,
|
||||
PRO_ALONEGPIO_IN1 = 236,
|
||||
PRO_ALONEGPIO_IN2 = 237,
|
||||
PRO_ALONEGPIO_IN3 = 238,
|
||||
PRO_ALONEGPIO_IN4 = 239,
|
||||
PRO_ALONEGPIO_IN5 = 240,
|
||||
PRO_ALONEGPIO_IN6 = 241,
|
||||
PRO_ALONEGPIO_IN7 = 242,
|
||||
MTDI,
|
||||
MTCK,
|
||||
MTMS,
|
||||
@ -1248,103 +1256,111 @@ macro_rules! define_io_mux_signals {
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
#[doc(hidden)]
|
||||
pub enum OutputSignal {
|
||||
SPIQ = 0,
|
||||
SPID = 1,
|
||||
SPIHD = 2,
|
||||
SPIWP = 3,
|
||||
SPICLK = 4,
|
||||
SPICS0 = 5,
|
||||
SPICS1 = 6,
|
||||
SPID4 = 7,
|
||||
SPID5 = 8,
|
||||
SPID6 = 9,
|
||||
SPID7 = 10,
|
||||
SPIDQS = 11,
|
||||
U0TXD = 14,
|
||||
U0RTS = 15,
|
||||
U0DTR = 16,
|
||||
U1TXD = 17,
|
||||
U1RTS = 18,
|
||||
U1DTR = 21,
|
||||
I2S0O_BCK = 23,
|
||||
I2S0O_WS = 25,
|
||||
I2S0I_BCK = 27,
|
||||
I2S0I_WS = 28,
|
||||
I2CEXT0_SCL = 29,
|
||||
I2CEXT0_SDA = 30,
|
||||
SDIO_TOHOST_INT = 31,
|
||||
USB_EXTPHY_OEN = 61,
|
||||
USB_EXTPHY_VPO = 63,
|
||||
USB_EXTPHY_VMO = 64,
|
||||
SPI3_CLK = 72,
|
||||
SPI3_Q = 73,
|
||||
SPI3_D = 74,
|
||||
SPI3_HD = 75,
|
||||
SPI3_CS0 = 76,
|
||||
SPI3_CS1 = 77,
|
||||
SPI3_CS2 = 78,
|
||||
LEDC_LS_SIG0 = 79,
|
||||
LEDC_LS_SIG1 = 80,
|
||||
LEDC_LS_SIG2 = 81,
|
||||
LEDC_LS_SIG3 = 82,
|
||||
LEDC_LS_SIG4 = 83,
|
||||
LEDC_LS_SIG5 = 84,
|
||||
LEDC_LS_SIG6 = 85,
|
||||
LEDC_LS_SIG7 = 86,
|
||||
RMT_SIG_0 = 87,
|
||||
RMT_SIG_1 = 88,
|
||||
RMT_SIG_2 = 89,
|
||||
RMT_SIG_3 = 90,
|
||||
I2CEXT1_SCL = 95,
|
||||
I2CEXT1_SDA = 96,
|
||||
GPIO_SD0 = 100,
|
||||
GPIO_SD1 = 101,
|
||||
GPIO_SD2 = 102,
|
||||
GPIO_SD3 = 103,
|
||||
GPIO_SD4 = 104,
|
||||
GPIO_SD5 = 105,
|
||||
GPIO_SD6 = 106,
|
||||
GPIO_SD7 = 107,
|
||||
FSPICLK = 108,
|
||||
FSPIQ = 109,
|
||||
FSPID = 110,
|
||||
FSPIHD = 111,
|
||||
FSPIWP = 112,
|
||||
FSPIIO4 = 113,
|
||||
FSPIIO5 = 114,
|
||||
FSPIIO6 = 115,
|
||||
FSPIIO7 = 116,
|
||||
FSPICS0 = 117,
|
||||
FSPICS1 = 118,
|
||||
FSPICS2 = 119,
|
||||
FSPICS3 = 120,
|
||||
FSPICS4 = 121,
|
||||
FSPICS5 = 122,
|
||||
TWAI_TX = 123,
|
||||
SUBSPICLK = 126,
|
||||
SUBSPIQ = 127,
|
||||
SUBSPID = 128,
|
||||
SUBSPIHD = 129,
|
||||
SUBSPIWP = 130,
|
||||
SUBSPICS0 = 131,
|
||||
SUBSPICS1 = 132,
|
||||
FSPIDQS = 133,
|
||||
FSPI_HSYNC = 134,
|
||||
FSPI_VSYNC = 135,
|
||||
FSPI_DE = 136,
|
||||
FSPICD = 137,
|
||||
SPI3_CD = 139,
|
||||
SPI3_DQS = 140,
|
||||
I2S0O_DATA_OUT23 = 166,
|
||||
SUBSPID4 = 167,
|
||||
SUBSPID5 = 168,
|
||||
SUBSPID6 = 169,
|
||||
SUBSPID7 = 170,
|
||||
SUBSPIDQS = 171,
|
||||
PCMFSYNC = 209,
|
||||
PCMCLK = 210,
|
||||
CLK_I2S = 251,
|
||||
GPIO = 256,
|
||||
SPIQ = 0,
|
||||
SPID = 1,
|
||||
SPIHD = 2,
|
||||
SPIWP = 3,
|
||||
SPICLK = 4,
|
||||
SPICS0 = 5,
|
||||
SPICS1 = 6,
|
||||
SPID4 = 7,
|
||||
SPID5 = 8,
|
||||
SPID6 = 9,
|
||||
SPID7 = 10,
|
||||
SPIDQS = 11,
|
||||
U0TXD = 14,
|
||||
U0RTS = 15,
|
||||
U0DTR = 16,
|
||||
U1TXD = 17,
|
||||
U1RTS = 18,
|
||||
U1DTR = 21,
|
||||
I2S0O_BCK = 23,
|
||||
I2S0O_WS = 25,
|
||||
I2S0I_BCK = 27,
|
||||
I2S0I_WS = 28,
|
||||
I2CEXT0_SCL = 29,
|
||||
I2CEXT0_SDA = 30,
|
||||
SDIO_TOHOST_INT = 31,
|
||||
USB_EXTPHY_OEN = 61,
|
||||
USB_EXTPHY_VPO = 63,
|
||||
USB_EXTPHY_VMO = 64,
|
||||
SPI3_CLK = 72,
|
||||
SPI3_Q = 73,
|
||||
SPI3_D = 74,
|
||||
SPI3_HD = 75,
|
||||
SPI3_CS0 = 76,
|
||||
SPI3_CS1 = 77,
|
||||
SPI3_CS2 = 78,
|
||||
LEDC_LS_SIG0 = 79,
|
||||
LEDC_LS_SIG1 = 80,
|
||||
LEDC_LS_SIG2 = 81,
|
||||
LEDC_LS_SIG3 = 82,
|
||||
LEDC_LS_SIG4 = 83,
|
||||
LEDC_LS_SIG5 = 84,
|
||||
LEDC_LS_SIG6 = 85,
|
||||
LEDC_LS_SIG7 = 86,
|
||||
RMT_SIG_0 = 87,
|
||||
RMT_SIG_1 = 88,
|
||||
RMT_SIG_2 = 89,
|
||||
RMT_SIG_3 = 90,
|
||||
I2CEXT1_SCL = 95,
|
||||
I2CEXT1_SDA = 96,
|
||||
GPIO_SD0 = 100,
|
||||
GPIO_SD1 = 101,
|
||||
GPIO_SD2 = 102,
|
||||
GPIO_SD3 = 103,
|
||||
GPIO_SD4 = 104,
|
||||
GPIO_SD5 = 105,
|
||||
GPIO_SD6 = 106,
|
||||
GPIO_SD7 = 107,
|
||||
FSPICLK = 108,
|
||||
FSPIQ = 109,
|
||||
FSPID = 110,
|
||||
FSPIHD = 111,
|
||||
FSPIWP = 112,
|
||||
FSPIIO4 = 113,
|
||||
FSPIIO5 = 114,
|
||||
FSPIIO6 = 115,
|
||||
FSPIIO7 = 116,
|
||||
FSPICS0 = 117,
|
||||
FSPICS1 = 118,
|
||||
FSPICS2 = 119,
|
||||
FSPICS3 = 120,
|
||||
FSPICS4 = 121,
|
||||
FSPICS5 = 122,
|
||||
TWAI_TX = 123,
|
||||
SUBSPICLK = 126,
|
||||
SUBSPIQ = 127,
|
||||
SUBSPID = 128,
|
||||
SUBSPIHD = 129,
|
||||
SUBSPIWP = 130,
|
||||
SUBSPICS0 = 131,
|
||||
SUBSPICS1 = 132,
|
||||
FSPIDQS = 133,
|
||||
FSPI_HSYNC = 134,
|
||||
FSPI_VSYNC = 135,
|
||||
FSPI_DE = 136,
|
||||
FSPICD = 137,
|
||||
SPI3_CD = 139,
|
||||
SPI3_DQS = 140,
|
||||
I2S0O_DATA_OUT23 = 166,
|
||||
SUBSPID4 = 167,
|
||||
SUBSPID5 = 168,
|
||||
SUBSPID6 = 169,
|
||||
SUBSPID7 = 170,
|
||||
SUBSPIDQS = 171,
|
||||
PCMFSYNC = 209,
|
||||
PCMCLK = 210,
|
||||
PRO_ALONEGPIO_OUT0 = 235,
|
||||
PRO_ALONEGPIO_OUT1 = 236,
|
||||
PRO_ALONEGPIO_OUT2 = 237,
|
||||
PRO_ALONEGPIO_OUT3 = 238,
|
||||
PRO_ALONEGPIO_OUT4 = 239,
|
||||
PRO_ALONEGPIO_OUT5 = 240,
|
||||
PRO_ALONEGPIO_OUT6 = 241,
|
||||
PRO_ALONEGPIO_OUT7 = 242,
|
||||
CLK_I2S = 251,
|
||||
GPIO = 256,
|
||||
CLK_OUT1,
|
||||
CLK_OUT2,
|
||||
CLK_OUT3,
|
||||
|
@ -38,18 +38,6 @@ macro_rules! property {
|
||||
("gpio.gpio_function", str) => {
|
||||
stringify!(1)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
189
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(189)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
256
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(256)
|
||||
};
|
||||
("gpio.constant_0_input") => {
|
||||
60
|
||||
};
|
||||
@ -71,6 +59,18 @@ macro_rules! property {
|
||||
("gpio.func_in_sel_offset", str) => {
|
||||
stringify!(0)
|
||||
};
|
||||
("gpio.input_signal_max") => {
|
||||
255
|
||||
};
|
||||
("gpio.input_signal_max", str) => {
|
||||
stringify!(255)
|
||||
};
|
||||
("gpio.output_signal_max") => {
|
||||
256
|
||||
};
|
||||
("gpio.output_signal_max", str) => {
|
||||
stringify!(256)
|
||||
};
|
||||
("i2c_master.has_fsm_timeouts") => {
|
||||
true
|
||||
};
|
||||
@ -1368,6 +1368,19 @@ macro_rules! define_io_mux_signals {
|
||||
SDHOST_CDATA_IN_25 = 218,
|
||||
SDHOST_CDATA_IN_26 = 219,
|
||||
SDHOST_CDATA_IN_27 = 220,
|
||||
PRO_ALONEGPIO_IN0 = 221,
|
||||
PRO_ALONEGPIO_IN1 = 222,
|
||||
PRO_ALONEGPIO_IN2 = 223,
|
||||
PRO_ALONEGPIO_IN3 = 224,
|
||||
PRO_ALONEGPIO_IN4 = 225,
|
||||
PRO_ALONEGPIO_IN5 = 226,
|
||||
PRO_ALONEGPIO_IN6 = 227,
|
||||
PRO_ALONEGPIO_IN7 = 228,
|
||||
USB_JTAG_TDO_BRIDGE = 251,
|
||||
CORE1_GPIO_IN3 = 252,
|
||||
CORE1_GPIO_IN4 = 253,
|
||||
CORE1_GPIO_IN5 = 254,
|
||||
CORE1_GPIO_IN6 = 255,
|
||||
SPIIO4,
|
||||
SPIIO5,
|
||||
SPIIO6,
|
||||
@ -1538,6 +1551,19 @@ macro_rules! define_io_mux_signals {
|
||||
SDHOST_CDATA_OUT_25 = 218,
|
||||
SDHOST_CDATA_OUT_26 = 219,
|
||||
SDHOST_CDATA_OUT_27 = 220,
|
||||
PRO_ALONEGPIO_OUT0 = 221,
|
||||
PRO_ALONEGPIO_OUT1 = 222,
|
||||
PRO_ALONEGPIO_OUT2 = 223,
|
||||
PRO_ALONEGPIO_OUT3 = 224,
|
||||
PRO_ALONEGPIO_OUT4 = 225,
|
||||
PRO_ALONEGPIO_OUT5 = 226,
|
||||
PRO_ALONEGPIO_OUT6 = 227,
|
||||
PRO_ALONEGPIO_OUT7 = 228,
|
||||
USB_JTAG_TRST = 251,
|
||||
CORE1_GPIO_OUT3 = 252,
|
||||
CORE1_GPIO_OUT4 = 253,
|
||||
CORE1_GPIO_OUT5 = 254,
|
||||
CORE1_GPIO_OUT6 = 255,
|
||||
GPIO = 256,
|
||||
SPIIO4,
|
||||
SPIIO5,
|
||||
|
@ -118,8 +118,6 @@ instances = [
|
||||
support_status = "supported"
|
||||
has_bank_1 = true
|
||||
gpio_function = 2
|
||||
input_signal_max = 206
|
||||
output_signal_max = 256
|
||||
constant_0_input = 0x30
|
||||
constant_1_input = 0x38
|
||||
remap_iomux_pin_registers = true
|
||||
|
@ -91,8 +91,6 @@ has_sp_monitor = true
|
||||
[device.gpio]
|
||||
support_status = "supported"
|
||||
gpio_function = 1
|
||||
input_signal_max = 100
|
||||
output_signal_max = 128
|
||||
constant_0_input = 0x1f
|
||||
constant_1_input = 0x1e
|
||||
pins = [
|
||||
|
@ -102,8 +102,6 @@ has_region_monitor = true
|
||||
[device.gpio]
|
||||
support_status = "supported"
|
||||
gpio_function = 1
|
||||
input_signal_max = 100
|
||||
output_signal_max = 128
|
||||
constant_0_input = 0x1f
|
||||
constant_1_input = 0x1e
|
||||
pins = [
|
||||
|
@ -142,8 +142,6 @@ has_region_monitor = true
|
||||
[device.gpio]
|
||||
support_status = "supported"
|
||||
gpio_function = 1
|
||||
input_signal_max = 124
|
||||
output_signal_max = 128
|
||||
constant_0_input = 0x3c
|
||||
constant_1_input = 0x38
|
||||
pins = [
|
||||
|
@ -121,8 +121,6 @@ has_region_monitor = true
|
||||
[device.gpio]
|
||||
support_status = "supported"
|
||||
gpio_function = 1
|
||||
input_signal_max = 124
|
||||
output_signal_max = 128
|
||||
constant_0_input = 0x3c
|
||||
constant_1_input = 0x38
|
||||
pins = [
|
||||
|
@ -251,6 +251,15 @@ input_signals = [
|
||||
{ name = "PCMFSYNC", id = 203 },
|
||||
{ name = "PCMCLK", id = 204 },
|
||||
|
||||
{ name = "PRO_ALONEGPIO_IN0", id = 235 },
|
||||
{ name = "PRO_ALONEGPIO_IN1", id = 236 },
|
||||
{ name = "PRO_ALONEGPIO_IN2", id = 237 },
|
||||
{ name = "PRO_ALONEGPIO_IN3", id = 238 },
|
||||
{ name = "PRO_ALONEGPIO_IN4", id = 239 },
|
||||
{ name = "PRO_ALONEGPIO_IN5", id = 240 },
|
||||
{ name = "PRO_ALONEGPIO_IN6", id = 241 },
|
||||
{ name = "PRO_ALONEGPIO_IN7", id = 242 },
|
||||
|
||||
{ name = "MTDI" },
|
||||
{ name = "MTCK" },
|
||||
{ name = "MTMS" },
|
||||
@ -351,7 +360,18 @@ output_signals = [
|
||||
{ name = "SUBSPIDQS", id = 171 },
|
||||
{ name = "PCMFSYNC", id = 209 },
|
||||
{ name = "PCMCLK", id = 210 },
|
||||
|
||||
{ name = "PRO_ALONEGPIO_OUT0", id = 235 },
|
||||
{ name = "PRO_ALONEGPIO_OUT1", id = 236 },
|
||||
{ name = "PRO_ALONEGPIO_OUT2", id = 237 },
|
||||
{ name = "PRO_ALONEGPIO_OUT3", id = 238 },
|
||||
{ name = "PRO_ALONEGPIO_OUT4", id = 239 },
|
||||
{ name = "PRO_ALONEGPIO_OUT5", id = 240 },
|
||||
{ name = "PRO_ALONEGPIO_OUT6", id = 241 },
|
||||
{ name = "PRO_ALONEGPIO_OUT7", id = 242 },
|
||||
|
||||
{ name = "CLK_I2S", id = 251 },
|
||||
|
||||
{ name = "GPIO", id = 256 },
|
||||
|
||||
{ name = "CLK_OUT1" },
|
||||
|
@ -127,8 +127,6 @@ has_region_monitor = true
|
||||
support_status = "supported"
|
||||
has_bank_1 = true
|
||||
gpio_function = 1
|
||||
input_signal_max = 189
|
||||
output_signal_max = 256
|
||||
constant_0_input = 0x3c
|
||||
constant_1_input = 0x38
|
||||
pins = [
|
||||
@ -335,6 +333,21 @@ input_signals = [
|
||||
{ name = "SDHOST_CDATA_IN_25", id = 218 },
|
||||
{ name = "SDHOST_CDATA_IN_26", id = 219 },
|
||||
{ name = "SDHOST_CDATA_IN_27", id = 220 },
|
||||
|
||||
{ name = "PRO_ALONEGPIO_IN0", id = 221 },
|
||||
{ name = "PRO_ALONEGPIO_IN1", id = 222 },
|
||||
{ name = "PRO_ALONEGPIO_IN2", id = 223 },
|
||||
{ name = "PRO_ALONEGPIO_IN3", id = 224 },
|
||||
{ name = "PRO_ALONEGPIO_IN4", id = 225 },
|
||||
{ name = "PRO_ALONEGPIO_IN5", id = 226 },
|
||||
{ name = "PRO_ALONEGPIO_IN6", id = 227 },
|
||||
{ name = "PRO_ALONEGPIO_IN7", id = 228 },
|
||||
|
||||
{ name = "USB_JTAG_TDO_BRIDGE", id = 251 },
|
||||
{ name = "CORE1_GPIO_IN3", id = 252 },
|
||||
{ name = "CORE1_GPIO_IN4", id = 253 },
|
||||
{ name = "CORE1_GPIO_IN5", id = 254 },
|
||||
{ name = "CORE1_GPIO_IN6", id = 255 },
|
||||
|
||||
{ name = "SPIIO4" },
|
||||
{ name = "SPIIO5" },
|
||||
@ -503,6 +516,22 @@ output_signals = [
|
||||
{ name = "SDHOST_CDATA_OUT_25", id = 218 },
|
||||
{ name = "SDHOST_CDATA_OUT_26", id = 219 },
|
||||
{ name = "SDHOST_CDATA_OUT_27", id = 220 },
|
||||
|
||||
{ name = "PRO_ALONEGPIO_OUT0", id = 221 },
|
||||
{ name = "PRO_ALONEGPIO_OUT1", id = 222 },
|
||||
{ name = "PRO_ALONEGPIO_OUT2", id = 223 },
|
||||
{ name = "PRO_ALONEGPIO_OUT3", id = 224 },
|
||||
{ name = "PRO_ALONEGPIO_OUT4", id = 225 },
|
||||
{ name = "PRO_ALONEGPIO_OUT5", id = 226 },
|
||||
{ name = "PRO_ALONEGPIO_OUT6", id = 227 },
|
||||
{ name = "PRO_ALONEGPIO_OUT7", id = 228 },
|
||||
|
||||
{ name = "USB_JTAG_TRST", id = 251 },
|
||||
{ name = "CORE1_GPIO_OUT3", id = 252 },
|
||||
{ name = "CORE1_GPIO_OUT4", id = 253 },
|
||||
{ name = "CORE1_GPIO_OUT5", id = 254 },
|
||||
{ name = "CORE1_GPIO_OUT6", id = 255 },
|
||||
|
||||
{ name = "GPIO", id = 256 },
|
||||
|
||||
{ name = "SPIIO4" },
|
||||
|
@ -82,7 +82,7 @@ pub(crate) struct SupportItem {
|
||||
/// Define driver configuration structs, and a PeriConfig struct
|
||||
/// that contains all of them.
|
||||
macro_rules! driver_configs {
|
||||
(@reify $t:tt) => { $t };
|
||||
(@ignore $t:tt) => {};
|
||||
(@property (u32) $self:ident, $config:ident) => { Value::Number($self.$config) };
|
||||
(@property (bool) $self:ident, $config:ident) => { Value::Boolean($self.$config) };
|
||||
(@property (Option<u32>) $self:ident, $config:ident) => { Value::from($self.$config) };
|
||||
@ -129,6 +129,7 @@ macro_rules! driver_configs {
|
||||
driver: $driver:ident,
|
||||
// Driver name, used in the generated documentation.
|
||||
name: $name:literal,
|
||||
$(has_computed_properties: $computed:literal,)?
|
||||
properties: $tokens:tt
|
||||
},
|
||||
)+) => {
|
||||
@ -193,6 +194,10 @@ macro_rules! driver_configs {
|
||||
$(
|
||||
if let Some(driver) = &self.$driver {
|
||||
properties.extend(driver.properties());
|
||||
$(
|
||||
driver_configs!(@ignore $computed);
|
||||
properties.extend(driver.computed_properties());
|
||||
)?
|
||||
}
|
||||
)*
|
||||
properties.into_iter()
|
||||
@ -272,12 +277,11 @@ driver_configs![
|
||||
GpioProperties {
|
||||
driver: gpio,
|
||||
name: "GPIO",
|
||||
has_computed_properties: true,
|
||||
properties: {
|
||||
#[serde(default)]
|
||||
has_bank_1: bool,
|
||||
gpio_function: u32,
|
||||
input_signal_max: u32,
|
||||
output_signal_max: u32,
|
||||
constant_0_input: u32,
|
||||
constant_1_input: u32,
|
||||
#[serde(default)]
|
||||
|
@ -6,7 +6,7 @@ use std::str::FromStr;
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::format_ident;
|
||||
|
||||
use crate::{generate_for_each_macro, number};
|
||||
use crate::{cfg::Value, generate_for_each_macro, number};
|
||||
|
||||
/// Additional properties (besides those defined in cfg.rs) for [device.gpio].
|
||||
/// These don't get turned into symbols, but are used to generate code.
|
||||
@ -117,6 +117,31 @@ pub(crate) struct IoMuxSignal {
|
||||
pub id: Option<usize>,
|
||||
}
|
||||
|
||||
impl super::GpioProperties {
|
||||
pub(super) fn computed_properties(&self) -> impl Iterator<Item = (&str, Value)> {
|
||||
let input_max = self
|
||||
.pins_and_signals
|
||||
.input_signals
|
||||
.iter()
|
||||
.filter_map(|s| s.id)
|
||||
.max()
|
||||
.unwrap_or(0) as u32;
|
||||
let output_max = self
|
||||
.pins_and_signals
|
||||
.output_signals
|
||||
.iter()
|
||||
.filter_map(|s| s.id)
|
||||
.max()
|
||||
.unwrap_or(0) as u32;
|
||||
|
||||
[
|
||||
("gpio.input_signal_max", Value::Number(input_max)),
|
||||
("gpio.output_signal_max", Value::Number(output_max)),
|
||||
]
|
||||
.into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn generate_gpios(gpio: &super::GpioProperties) -> TokenStream {
|
||||
let pin_numbers = gpio
|
||||
.pins_and_signals
|
||||
|
Loading…
x
Reference in New Issue
Block a user