Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ pub mod config {
/// UART source clock from `XTAL`
#[cfg(esp_idf_soc_uart_support_xtal_clk)]
Crystal,
/// UART source clock from `XTAL`
#[cfg(esp_idf_soc_uart_support_pll_f80m_clk)]
PLL_F80M,
/// UART source clock from `REF_TICK`
#[cfg(esp_idf_soc_uart_support_ref_tick)]
RefTick,
Expand All @@ -242,6 +245,8 @@ pub mod config {
RTC_SCLK => SourceClock::RTC,
#[cfg(esp_idf_soc_uart_support_xtal_clk)]
XTAL_SCLK => SourceClock::Crystal,
#[cfg(esp_idf_soc_uart_support_pll_f80m_clk)]
PLL_F80M => SourceClock::PLL_F80M,
#[cfg(esp_idf_soc_uart_support_ref_tick)]
REF_TICK_SCLK => SourceClock::RefTick,
_ => unreachable!(),
Expand Down Expand Up @@ -279,6 +284,11 @@ pub mod config {
#[cfg(all(esp_idf_version_major = "4", esp_idf_soc_uart_support_xtal_clk))]
const XTAL_SCLK: uart_sclk_t = uart_sclk_t_UART_SCLK_XTAL;

#[cfg(all(not(esp_idf_version_major = "4"), esp_idf_soc_uart_support_pll_f80m_clk))]
const PLL_F80M_SCLK: uart_sclk_t = soc_periph_uart_clk_src_legacy_t_UART_SCLK_PLL_F80M;
#[cfg(all(esp_idf_version_major = "4", esp_idf_soc_uart_support_pll_f80m_clk))]
const PLL_F80M_SCLK: uart_sclk_t = uart_sclk_t_UART_SCLK_PLL_F80M;

#[cfg(all(not(esp_idf_version_major = "4"), esp_idf_soc_uart_support_ref_tick))]
const REF_TICK_SCLK: uart_sclk_t = soc_periph_uart_clk_src_legacy_t_UART_SCLK_REF_TICK;
#[cfg(all(esp_idf_version_major = "4", esp_idf_soc_uart_support_ref_tick))]
Expand All @@ -303,6 +313,8 @@ pub mod config {
SourceClock::RTC => RTC_SCLK,
#[cfg(esp_idf_soc_uart_support_xtal_clk)]
SourceClock::Crystal => XTAL_SCLK,
#[cfg(esp_idf_soc_uart_support_pll_f80m_clk)]
SourceClock::PLL_F80M => PLL_F80M_SCLK,
#[cfg(esp_idf_soc_uart_support_ref_tick)]
SourceClock::RefTick => REF_TICK_SCLK,
}
Expand Down