soc: esp32: partial code standardization
Replaces the prefixes of gpio_matrix_in and gpio_matrix_out to unify those function calls on all supported socs. Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
This commit is contained in:
parent
e231d50535
commit
fb1632925e
5 changed files with 11 additions and 11 deletions
|
@ -120,8 +120,8 @@ static int i2c_esp32_configure_pins(int pin, int matrix_out, int matrix_in)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp32_rom_gpio_matrix_out(pin, matrix_out, false, false);
|
esp_rom_gpio_matrix_out(pin, matrix_out, false, false);
|
||||||
esp32_rom_gpio_matrix_in(pin, matrix_in, false);
|
esp_rom_gpio_matrix_in(pin, matrix_in, false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ static int pwm_led_esp32_channel_set(int pin, bool speed_mode, int channel,
|
||||||
} else {
|
} else {
|
||||||
sig_out_idx = LEDC_LS_SIG_OUT0_IDX + channel;
|
sig_out_idx = LEDC_LS_SIG_OUT0_IDX + channel;
|
||||||
}
|
}
|
||||||
esp32_rom_gpio_matrix_out(pin, sig_out_idx, 0, 0);
|
esp_rom_gpio_matrix_out(pin, sig_out_idx, 0, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,24 +221,24 @@ static int uart_esp32_configure_pins(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct uart_esp32_config *const cfg = DEV_CFG(dev);
|
const struct uart_esp32_config *const cfg = DEV_CFG(dev);
|
||||||
|
|
||||||
esp32_rom_gpio_matrix_out(cfg->pins.tx,
|
esp_rom_gpio_matrix_out(cfg->pins.tx,
|
||||||
cfg->signals.tx_out,
|
cfg->signals.tx_out,
|
||||||
false,
|
false,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
esp32_rom_gpio_matrix_in(cfg->pins.rx,
|
esp_rom_gpio_matrix_in(cfg->pins.rx,
|
||||||
cfg->signals.rx_in,
|
cfg->signals.rx_in,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if (cfg->pins.cts) {
|
if (cfg->pins.cts) {
|
||||||
esp32_rom_gpio_matrix_out(cfg->pins.cts,
|
esp_rom_gpio_matrix_out(cfg->pins.cts,
|
||||||
cfg->signals.cts_in,
|
cfg->signals.cts_in,
|
||||||
false,
|
false,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg->pins.rts) {
|
if (cfg->pins.rts) {
|
||||||
esp32_rom_gpio_matrix_in(cfg->pins.rts,
|
esp_rom_gpio_matrix_in(cfg->pins.rts,
|
||||||
cfg->signals.rts_out,
|
cfg->signals.rts_out,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,9 +149,9 @@ static int spi_esp32_configure_pin(gpio_pin_t pin, int pin_sig,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pin_mode == GPIO_INPUT) {
|
if (pin_mode == GPIO_INPUT) {
|
||||||
esp32_rom_gpio_matrix_in(pin, pin_sig, false);
|
esp_rom_gpio_matrix_in(pin, pin_sig, false);
|
||||||
} else {
|
} else {
|
||||||
esp32_rom_gpio_matrix_out(pin, pin_sig, false, false);
|
esp_rom_gpio_matrix_out(pin, pin_sig, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -31,9 +31,9 @@ static inline void esp32_clear_mask32(uint32_t v, uint32_t mem_addr)
|
||||||
|
|
||||||
extern void esp32_rom_intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num);
|
extern void esp32_rom_intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num);
|
||||||
|
|
||||||
extern int esp32_rom_gpio_matrix_in(uint32_t gpio, uint32_t signal_index,
|
extern int esp_rom_gpio_matrix_in(uint32_t gpio, uint32_t signal_index,
|
||||||
bool inverted);
|
bool inverted);
|
||||||
extern int esp32_rom_gpio_matrix_out(uint32_t gpio, uint32_t signal_index,
|
extern int esp_rom_gpio_matrix_out(uint32_t gpio, uint32_t signal_index,
|
||||||
bool out_inverted,
|
bool out_inverted,
|
||||||
bool out_enabled_inverted);
|
bool out_enabled_inverted);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue