pub struct HAL { /* private fields */ }Expand description
A struct that defines a platform specific HAL(Hardware Abstraction Layer) using a Driver.
Using a HAL allows for significant platform changes without having to rewrite much code. HALs are also useful for testing/sim as they can be mocked.
HALs also allow for easier community support for exotic platforms.
Implementations§
Source§impl HAL
impl HAL
Sourcepub fn init<Driver: HALDriver>()
pub fn init<Driver: HALDriver>()
Initializes the HAL, can only be called once across every HAL.
§Panics
If HAL has already been initialized this will panic If the used driver is not zero sized this will panic
Sourcepub fn init_sim<Driver: SimHALDriver>()
pub fn init_sim<Driver: SimHALDriver>()
Initializes the HAL with support for sim, can only be called once across every HAL.
§Panics
If HAL has already been initialized this will panic. If the used driver is not zero sized this will panic.
Sourcepub const fn driver_name(&self) -> &'static str
pub const fn driver_name(&self) -> &'static str
Returns the name of the current HALDriver.
Sourcepub const fn notifier_api(&self) -> NotifierVTable
pub const fn notifier_api(&self) -> NotifierVTable
Returns the NotifierVTable for the current HALDriver.
Sourcepub const fn watchdog_api(&self) -> WatchdogVTable
pub const fn watchdog_api(&self) -> WatchdogVTable
Returns the WatchdogVTable for the current HALDriver.
Sourcepub const fn gpio_api(&self) -> GPIOVTable
pub const fn gpio_api(&self) -> GPIOVTable
Returns the GPIOVTable for the current HALDriver.
Sourcepub const fn station_interface_api(&self) -> StationInterfaceVTable
pub const fn station_interface_api(&self) -> StationInterfaceVTable
Returns the StationInterfaceVTable for the current HALDriver.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HAL
impl RefUnwindSafe for HAL
impl Send for HAL
impl Sync for HAL
impl Unpin for HAL
impl UnsafeUnpin for HAL
impl UnwindSafe for HAL
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.