Skip to content

Commit

Permalink
Add Mcpwm0 and Mcpwm1 to system::Peripheral
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpolo authored and jessebraham committed Nov 7, 2022
1 parent da3cbca commit ece70e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions esp-hal-common/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub enum Peripheral {
#[cfg(not(esp32c2))]
Rmt,
Ledc,
#[cfg(any(esp32, esp32s3))]
Mcpwm0,
#[cfg(any(esp32, esp32s3))]
Mcpwm1,
#[cfg(any(esp32c2, esp32c3))]
ApbSarAdc,
#[cfg(any(esp32c2, esp32c3, esp32s3))]
Expand Down Expand Up @@ -86,6 +90,16 @@ impl PeripheralClockControl {
perip_clk_en0.modify(|_, w| w.ledc_clk_en().set_bit());
perip_rst_en0.modify(|_, w| w.ledc_rst().clear_bit());
}
#[cfg(any(esp32, esp32s3))]
Peripheral::Mcpwm0 => {
perip_clk_en0.modify(|_, w| w.pwm0_clk_en().set_bit());
perip_rst_en0.modify(|_, w| w.pwm0_rst().clear_bit());
}
#[cfg(any(esp32, esp32s3))]
Peripheral::Mcpwm1 => {
perip_clk_en0.modify(|_, w| w.pwm1_clk_en().set_bit());
perip_rst_en0.modify(|_, w| w.pwm1_rst().clear_bit());
}
#[cfg(any(esp32c2, esp32c3))]
Peripheral::ApbSarAdc => {
perip_clk_en0.modify(|_, w| w.apb_saradc_clk_en().set_bit());
Expand Down

0 comments on commit ece70e9

Please sign in to comment.