mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-02 14:44:42 +00:00
H2: prepare modem clocks for BLE (#953)
* H2: prepare modem clocks for BLE * changelog
This commit is contained in:
parent
8c5fda2d53
commit
4d87e75d71
@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Improve DMA documentation & clean up module (#915)
|
- Improve DMA documentation & clean up module (#915)
|
||||||
- Only allow a single version of `esp-hal-common` to be present in an application (#934)
|
- Only allow a single version of `esp-hal-common` to be present in an application (#934)
|
||||||
- C3, C6 and H2 can now use the `zero-rtc-bss` feature to enable `esp-hal-common/rv-zero-rtc-bss` (#867)
|
- C3, C6 and H2 can now use the `zero-rtc-bss` feature to enable `esp-hal-common/rv-zero-rtc-bss` (#867)
|
||||||
|
- Reuse `ieee802154_clock_enable/disable()` functions for BLE and rename `ble_ieee802154_clock_enable()` (#953)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -17,16 +17,14 @@ impl RadioClockController for RadioClockControl {
|
|||||||
fn enable(&mut self, peripheral: RadioPeripherals) {
|
fn enable(&mut self, peripheral: RadioPeripherals) {
|
||||||
match peripheral {
|
match peripheral {
|
||||||
RadioPeripherals::Phy => enable_phy(),
|
RadioPeripherals::Phy => enable_phy(),
|
||||||
RadioPeripherals::Bt => todo!("BLE not yet supported"),
|
RadioPeripherals::Bt | RadioPeripherals::Ieee802154 => ble_ieee802154_clock_enable(),
|
||||||
RadioPeripherals::Ieee802154 => ieee802154_clock_enable(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn disable(&mut self, peripheral: RadioPeripherals) {
|
fn disable(&mut self, peripheral: RadioPeripherals) {
|
||||||
match peripheral {
|
match peripheral {
|
||||||
RadioPeripherals::Phy => disable_phy(),
|
RadioPeripherals::Phy => disable_phy(),
|
||||||
RadioPeripherals::Bt => todo!("BLE not yet supported"),
|
RadioPeripherals::Bt | RadioPeripherals::Ieee802154 => ble_ieee802154_clock_disable(),
|
||||||
RadioPeripherals::Ieee802154 => ieee802154_clock_disable(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +57,7 @@ fn disable_phy() {
|
|||||||
.modify(|_, w| w.clk_i2c_mst_en().clear_bit());
|
.modify(|_, w| w.clk_i2c_mst_en().clear_bit());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ieee802154_clock_enable() {
|
fn ble_ieee802154_clock_enable() {
|
||||||
let modem_lpcon = unsafe { &*esp32h2::MODEM_LPCON::PTR };
|
let modem_lpcon = unsafe { &*esp32h2::MODEM_LPCON::PTR };
|
||||||
let modem_syscon = unsafe { &*esp32h2::MODEM_SYSCON::PTR };
|
let modem_syscon = unsafe { &*esp32h2::MODEM_SYSCON::PTR };
|
||||||
|
|
||||||
@ -89,7 +87,7 @@ fn ieee802154_clock_enable() {
|
|||||||
.modify(|_, w| w.clk_coex_en().set_bit());
|
.modify(|_, w| w.clk_coex_en().set_bit());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ieee802154_clock_disable() {
|
fn ble_ieee802154_clock_disable() {
|
||||||
let modem_lpcon = unsafe { &*esp32h2::MODEM_LPCON::PTR };
|
let modem_lpcon = unsafe { &*esp32h2::MODEM_LPCON::PTR };
|
||||||
let modem_syscon = unsafe { &*esp32h2::MODEM_SYSCON::PTR };
|
let modem_syscon = unsafe { &*esp32h2::MODEM_SYSCON::PTR };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user