[−][src]Struct minimult_cortex_m::Minimult
Multitasking API
Methods
impl<'a> Minimult<'a>[src]
pub const fn mem<B>() -> MTMemBlk<B>[src]
Reserves a memory block to be used by Minimult instance.
- Any type
Bspecifies a size of the memory block. Typically use[u8; N]forNbytes. - Returns the reserved memory block.
pub fn new<B>(mem: &mut MTMemBlk<B>, num_tasks: MTTaskId) -> Minimult[src]
Creates Minimult instance.
mem- reserved memory block.num_tasks- number of tasks.- Returns the created instance.
- (
num_tasks* (32 + 6)) bytes of the memory block is consumed.
pub fn msgq<M>(&mut self, len: usize) -> MTMsgQueue<'a, M>[src]
Creates a message queue.
M- type of the message element.len- length of the message queue array.- Returns the created message queue.
- (
len* (size ofM)) bytes of the memory block is consumed.
pub fn share<M>(&mut self, m: M) -> MTShared<'a, M>[src]
Creates a shared variable.
m: M- the variable to be shared.- Returns the created shared variable.
pub fn register<T>(
&mut self,
tid: MTTaskId,
pri: MTTaskPri,
stack_len: usize,
task: T
) where
T: FnOnce() + Send + 'a, [src]
&mut self,
tid: MTTaskId,
pri: MTTaskPri,
stack_len: usize,
task: T
) where
T: FnOnce() + Send + 'a,
Registers a closure as a task.
tid- task identifier.0tonum_tasks - 1.pri- task priority. The lower value is the higher priority.stack_len- length of a stack used by the task.task: T- task closure.- (
stack_len* size ofusize) bytes of the memory block is consumed.
pub fn run(self) -> ![src]
Runs into a loop to dispatch the registered tasks.
- Never returns.
pub fn idle()[src]
Brings a current running task into an idle state.
pub fn dispatch()[src]
Makes a service call to request dispatching.
pub fn kick(tid: MTTaskId)[src]
Wakes up a task in an idle state.
tid- task identifier.0tonum_tasks - 1.
pub fn curr_tid() -> Option<MTTaskId>[src]
Gets task identifier of a current running task if any.
- Returns task identifier in
Option.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self