Struct stm32wlxx_hal::subghz::Status
source · pub struct Status(/* private fields */);
Expand description
Radio status.
This is returned by status
.
Implementations§
source§impl Status
impl Status
sourcepub const fn from_raw(value: u8) -> Status
pub const fn from_raw(value: u8) -> Status
Create a new Status
from a raw u8
value.
This is the same as Status::from(u8)
, but in a const
function.
Example
use stm32wlxx_hal::subghz::{CmdStatus, Status, StatusMode};
const STATUS: Status = Status::from_raw(0x54_u8);
assert_eq!(STATUS.mode(), Ok(StatusMode::Rx));
assert_eq!(STATUS.cmd(), Ok(CmdStatus::Available));
sourcepub const fn mode(&self) -> Result<StatusMode, u8>
pub const fn mode(&self) -> Result<StatusMode, u8>
sub-GHz radio operating mode.
Example
use stm32wlxx_hal::subghz::{Status, StatusMode};
let status: Status = 0xACu8.into();
assert_eq!(status.mode(), Ok(StatusMode::StandbyRc));
sourcepub const fn cmd(&self) -> Result<CmdStatus, u8>
pub const fn cmd(&self) -> Result<CmdStatus, u8>
Command status.
This method frequently returns reserved values such as Err(1)
.
ST support has confirmed that this is normal and should be ignored.
Example
use stm32wlxx_hal::subghz::{CmdStatus, Status};
let status: Status = 0xACu8.into();
assert_eq!(status.cmd(), Ok(CmdStatus::Complete));
Trait Implementations§
source§impl PartialEq for Status
impl PartialEq for Status
impl Copy for Status
impl Eq for Status
impl StructuralEq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more