pub struct MoonbootManager<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> { /* private fields */ }Expand description
Implementations for use in the firmware Instantiate this in your application to enable mutation of the State specified in this and jump to the bootloader to apply any updates.
Implementations§
Source§impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
pub fn new( config: Config, internal_memory: InternalMemory, state: HardwareState, processor: CPU, ) -> MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Sourcepub fn destroy(self) -> (InternalMemory, HardwareState, CPU)
pub fn destroy(self) -> (InternalMemory, HardwareState, CPU)
Destroy this instance of the boot manager and return access to the hardware peripheral
Sourcepub fn mark_boot_successful(&mut self) -> Result<(), ()>
pub fn mark_boot_successful(&mut self) -> Result<(), ()>
Run this immediately after booting your new image successfully to mark the boot as succesful. If you do not do this, any reset will cause the bootloader to restore to the previous firmware image.
pub fn update(&mut self) -> Result<Void, ()>
Trait Implementations§
Source§impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> AsRef<[u8]> for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Easily get read access to the update bank
impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> AsRef<[u8]> for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Easily get read access to the update bank
Source§impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> ReadStorage for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Read Access to the current update target slot
impl<InternalMemory: Storage, HardwareState: State, CPU: Processor, const INTERNAL_PAGE_SIZE: usize> ReadStorage for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
Read Access to the current update target slot
Auto Trait Implementations§
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Freeze for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> RefUnwindSafe for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Send for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Sync for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> Unpin for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
impl<InternalMemory, HardwareState, CPU, const INTERNAL_PAGE_SIZE: usize> UnwindSafe for MoonbootManager<InternalMemory, HardwareState, CPU, INTERNAL_PAGE_SIZE>
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