[][src]Crate rttrust

rttrust

Rust wrapper for rt-thread

TODO

  1. communication
    1. rt_mailbox
    2. rt_messagequeue
    3. rt_signal

Use Unique?

Modules

allocator

RT-Thread allows static memory pool management and dynamic memory heap management. When static memory pool has available memory, the time allocated to the memory block will be constant; when the static memory pool is empty, the system will then request for suspending or blocking the thread of the memory block. (that is, the thread will abandon the request and return, if after waiting for a while, the memory block is not obtained or the thread will abandon and return immediately. The waiting time depends on the waiting time parameter set when the memory block is applied). When other threads release the memory block to the memory pool, if there is threads that are suspending and waiting to be allocated of memory blocks, the system will wake up the thread.

cstr
device
ffi
fmt
ipc

RT-Thread uses thread semaphores, mutexes, and event sets to achieve inter-thread synchronization. Thread synchronizes through the acquisition and release of semaphore and mutexes; the mutex uses priority inheritance to solve the common priority inversion problem in the real-time system. The thread synchronization mechanism allows threads to wait according to priorities or to acquire semaphores or mutexes following the first-in first-out method. Threads synchronize through sending and receiving of events; event sets allows "or trigger" and "and trigger" for multiple events, suitable for situations where threads are waiting for multiple events. The concepts of semaphores, mutexes, and event sets are detailed in the "Inter-Thread Synchronization" chapter.

object
thread

Thread is the smallest scheduling unit in the RT-Thread operating system. Thread scheduling algorithm is a priority-based full preemptive multi-thread scheduling algorithm, that is, except the interrupt handler, the code of the scheduler's locked part, and the code that prohibits the interrupt, other parts of the system can be preempted, including the thread scheduler itself. The system supports 256 thread priorities (can also be changed to a maximum of 32 or 8 thread priority via configuration file; for STM32 default configuration, it is set as 32 thread priorities), 0 priority represents highest priority, and lowest priority is reserved for idle threads; at the same time, it also supports creating multiple threads with the same priority. The same priority threads are scheduled with a time slice rotation scheduling algorithm, so that each thread runs for the same time; in addition, when the scheduler is looking for threads that are at the highest priority thread and ready, the elapsed time is constant. The system does not limit the number of threads, the number of threads is only related to the specific memory of the hardware platform.

timer

Timer refers to triggering an event after a certain specified time from a specified moment, for example, setting a timer to wake up yourself the next morning. Timer includes hardware timer and software timer

Macros

kprintf
print
println

Structs

Box

A pointer type for heap allocation.

Rc

A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'.

Vec

A contiguous growable array type, written Vec<T> but pronounced 'vector'.

Enums

RtError

Type Definitions

Result