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: TaskHandle_t) -> Self
pub unsafe fn from_raw_handle(handle: TaskHandle_t) -> Self
§Safety
handle must be a valid FreeRTOS task handle.
pub fn raw_handle(&self) -> TaskHandle_t
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 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(
&self,
clear_bits_enter: u32,
clear_bits_exit: u32,
wait_for: Duration,
) -> Result<u32, FreeRtosError>
pub fn wait_for_notification( &self, clear_bits_enter: u32, clear_bits_exit: u32, wait_for: Duration, ) -> Result<u32, FreeRtosError>
Wait for a notification to be posted.
Sourcepub fn get_stack_high_water_mark(&self) -> UBaseType_t
pub fn get_stack_high_water_mark(&self) -> UBaseType_t
Get the minimum amount of stack that was ever left on this task.
Sourcepub unsafe fn get_id(&self) -> UBaseType_t
pub unsafe fn get_id(&self) -> UBaseType_t
§Safety
This function is not thread safe, you must synchronize all usage of it, Task::set_id, and
vTaskSetTaskNumber called with the same task handle manually.
Sourcepub unsafe fn set_id(&self, value: UBaseType_t)
pub unsafe fn set_id(&self, value: UBaseType_t)
§Safety
This function is not thread safe, you must synchronize all usage of it, Task::get_id, uxTaskGetTaskNumber
and vTaskSetTaskNumber called with the same task handle manually.
Trait Implementations§
impl Send for Task
impl Sync for Task
Auto Trait Implementations§
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