pub struct Task { /* private fields */ }Expand description
Handle for a FreeRTOS task
Implementations§
Source§impl Task
impl Task
Sourcepub fn new() -> TaskBuilder
pub fn new() -> TaskBuilder
Prepare a builder object for the new task.
Sourcepub unsafe fn from_raw_handle(handle: FreeRtosTaskHandle) -> Self
pub unsafe fn from_raw_handle(handle: FreeRtosTaskHandle) -> Self
§Safety
handle must be a valid FreeRTOS task handle.
pub fn raw_handle(&self) -> FreeRtosTaskHandle
pub fn suspend_all()
Sourcepub unsafe fn resume_all()
pub unsafe fn resume_all()
§Safety
For every call to this method there must be a matching previous call to
Task::suspend_all.
Sourcepub fn current() -> Result<Task, FreeRtosError>
pub fn current() -> Result<Task, FreeRtosError>
Try to find the task of the current execution context.
Sourcepub fn set_notification_value(&self, val: u32)
pub fn set_notification_value(&self, val: u32)
Forcibly set the notification value for this task.
Sourcepub fn abort_delay(&self)
pub fn abort_delay(&self)
Aborts the delay this task is currently blocked on, if any. Has no effect if the task is not in the Blocked state.
Sourcepub fn notify(&self, notification: TaskNotification)
pub fn notify(&self, notification: TaskNotification)
Notify this task.
Sourcepub fn notify_from_isr(
&self,
context: &mut InterruptContext,
notification: TaskNotification,
) -> Result<(), FreeRtosError>
pub fn notify_from_isr( &self, context: &mut InterruptContext, notification: TaskNotification, ) -> Result<(), FreeRtosError>
Notify this task from an interrupt.
Sourcepub fn wait_for_notification<D: DurationTicks>(
&self,
clear_bits_enter: u32,
clear_bits_exit: u32,
wait_for: D,
) -> Result<u32, FreeRtosError>
pub fn wait_for_notification<D: DurationTicks>( &self, clear_bits_enter: u32, clear_bits_exit: u32, wait_for: D, ) -> Result<u32, FreeRtosError>
Wait for a notification to be posted.
Sourcepub fn get_stack_high_water_mark(&self) -> u32
pub fn get_stack_high_water_mark(&self) -> u32
Get the minimum amount of stack that was ever left on this task.
pub fn get_id(&self) -> Result<FreeRtosBaseType, FreeRtosError>
pub fn set_id(&mut self, value: FreeRtosUBaseType)
Sourcepub fn set_core_affinity(&self, mask: u32)
pub fn set_core_affinity(&self, mask: u32)
Set the core affinity bitmask for this task (SMP only).
Bitmask: 0b01 = core 0 only, 0b10 = core 1 only, 0b11 = any core.
Has no effect when configUSE_CORE_AFFINITY is not enabled in FreeRTOSConfig.h.
Sourcepub fn get_core_affinity(&self) -> u32
pub fn get_core_affinity(&self) -> u32
Get the core affinity bitmask for this task (SMP only).