Add HAL for SubGhz peripheral for STM32 WL series
Based on the HAL from stm32wl, the peripheral driver has been modified to fit into embassy, using the embassy APIs, providing operation of the radio peripheral. The initial version does not offer any async APIs, but the example shows how the radio IRQ can be used to perform async TX of the radio.
This commit is contained in:
37
embassy-stm32/src/subghz/fallback_mode.rs
Normal file
37
embassy-stm32/src/subghz/fallback_mode.rs
Normal file
@ -0,0 +1,37 @@
|
||||
/// Fallback mode after successful packet transmission or packet reception.
|
||||
///
|
||||
/// Argument of [`set_tx_rx_fallback_mode`].
|
||||
///
|
||||
/// [`set_tx_rx_fallback_mode`]: crate::subghz::SubGhz::set_tx_rx_fallback_mode.
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
#[repr(u8)]
|
||||
pub enum FallbackMode {
|
||||
/// Standby mode entry.
|
||||
Standby = 0x20,
|
||||
/// Standby with HSE32 enabled.
|
||||
StandbyHse = 0x30,
|
||||
/// Frequency synthesizer entry.
|
||||
Fs = 0x40,
|
||||
}
|
||||
|
||||
impl From<FallbackMode> for u8 {
|
||||
fn from(fm: FallbackMode) -> Self {
|
||||
fm as u8
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for FallbackMode {
|
||||
/// Default fallback mode after power-on reset.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// use stm32wl_hal::subghz::FallbackMode;
|
||||
///
|
||||
/// assert_eq!(FallbackMode::default(), FallbackMode::Standby);
|
||||
/// ```
|
||||
fn default() -> Self {
|
||||
FallbackMode::Standby
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user