Functions | |
| rt_err_t | rt_sem_init (rt_sem_t sem, const char *name, rt_uint32_t value, rt_uint8_t flag) |
| rt_err_t | rt_sem_detach (rt_sem_t sem) |
| rt_sem_t | rt_sem_create (const char *name, rt_uint32_t value, rt_uint8_t flag) |
| rt_err_t | rt_sem_delete (rt_sem_t sem) |
| rt_err_t | rt_sem_take (rt_sem_t sem, rt_int32_t time) |
| rt_err_t | rt_sem_trytake (rt_sem_t sem) |
| rt_err_t | rt_sem_release (rt_sem_t sem) |
| rt_err_t | rt_sem_control (rt_sem_t sem, rt_uint8_t cmd, void *arg) |
| rt_err_t | rt_mutex_init (rt_mutex_t mutex, const char *name, rt_uint8_t flag) |
| rt_err_t | rt_mutex_detach (rt_mutex_t mutex) |
| rt_mutex_t | rt_mutex_create (const char *name, rt_uint8_t flag) |
| rt_err_t | rt_mutex_delete (rt_mutex_t mutex) |
| rt_err_t | rt_mutex_take (rt_mutex_t mutex, rt_int32_t time) |
| rt_err_t | rt_mutex_release (rt_mutex_t mutex) |
| rt_err_t | rt_mutex_control (rt_mutex_t mutex, rt_uint8_t cmd, void *arg) |
| rt_err_t | rt_fast_event_init (rt_fast_event_t event, const char *name, rt_uint8_t flag) |
| rt_err_t | rt_fast_event_detach (rt_fast_event_t event) |
| rt_fast_event_t | rt_fast_event_create (const char *name, rt_uint8_t flag) |
| rt_err_t | rt_fast_event_delete (rt_fast_event_t event) |
| rt_err_t | rt_fast_event_send (rt_fast_event_t event, rt_uint8_t bit) |
| rt_err_t | rt_fast_event_recv (rt_fast_event_t event, rt_uint8_t bit, rt_uint8_t opt, rt_int32_t timeout) |
| rt_err_t | rt_fast_event_control (rt_fast_event_t event, rt_uint8_t cmd, void *arg) |
| rt_err_t | rt_event_init (rt_event_t event, const char *name, rt_uint8_t flag) |
| rt_err_t | rt_event_detach (rt_event_t event) |
| rt_event_t | rt_event_create (const char *name, rt_uint8_t flag) |
| rt_err_t | rt_event_delete (rt_event_t event) |
| rt_err_t | rt_event_send (rt_event_t event, rt_uint32_t set) |
| rt_err_t | rt_event_recv (rt_event_t event, rt_uint32_t set, rt_uint8_t opt, rt_int32_t timeout, rt_uint32_t *recved) |
| rt_err_t | rt_event_control (rt_event_t event, rt_uint8_t cmd, void *arg) |
| rt_err_t | rt_mb_init (rt_mailbox_t mb, const char *name, void *msgpool, rt_size_t size, rt_uint8_t flag) |
| rt_err_t | rt_mb_detach (rt_mailbox_t mb) |
| rt_mailbox_t | rt_mb_create (const char *name, rt_size_t size, rt_uint8_t flag) |
| rt_err_t | rt_mb_delete (rt_mailbox_t mb) |
| rt_err_t | rt_mb_send (rt_mailbox_t mb, rt_uint32_t value) |
| rt_err_t | rt_mb_recv (rt_mailbox_t mb, rt_uint32_t *value, rt_int32_t timeout) |
| rt_err_t | rt_mb_control (rt_mailbox_t mb, rt_uint8_t cmd, void *arg) |
| rt_err_t | rt_mq_init (rt_mq_t mq, const char *name, void *msgpool, rt_size_t msg_size, rt_size_t pool_size, rt_uint8_t flag) |
| rt_err_t | rt_mq_detach (rt_mq_t mq) |
| rt_mq_t | rt_mq_create (const char *name, rt_size_t msg_size, rt_size_t max_msgs, rt_uint8_t flag) |
| rt_err_t | rt_mq_delete (rt_mq_t mq) |
| rt_err_t | rt_mq_send (rt_mq_t mq, void *buffer, rt_size_t size) |
| rt_err_t | rt_mq_urgent (rt_mq_t mq, void *buffer, rt_size_t size) |
| rt_err_t | rt_mq_recv (rt_mq_t mq, void *buffer, rt_size_t size, rt_int32_t timeout) |
| rt_err_t | rt_mq_control (rt_mq_t mq, rt_uint8_t cmd, void *arg) |
| rt_inline rt_err_t | rt_ipc_object_init (struct rt_ipc_object *ipc) |
| rt_inline rt_err_t | rt_ipc_object_suspend (struct rt_ipc_object *ipc, struct rt_thread *thread) |
| rt_inline rt_err_t | rt_ipc_object_resume (struct rt_ipc_object *ipc) |
| rt_inline rt_err_t | rt_ipc_object_resume_all (struct rt_ipc_object *ipc) |
Moreover, the blocked queue for thread to obtain semaphore or mutex can be sorted by priority or FIFO. There are two flags to indicate this mechanism.
RT-Thread operating systems supports event/fast event, mail box and message queue.
| rt_err_t rt_event_control | ( | rt_event_t | event, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function can get or set some extra attributions of an event object.
| event | the event object | |
| cmd | the execution command | |
| arg | the execution argument |
| rt_event_t rt_event_create | ( | const char * | name, | |
| rt_uint8_t | flag | |||
| ) |
This function will create an event object from system resource
| name | the name of event | |
| flag | the flag of event |
| rt_err_t rt_event_delete | ( | rt_event_t | event | ) |
This function will delete an event object and release the memory
| event | the event object |
| rt_err_t rt_event_detach | ( | rt_event_t | event | ) |
This function will detach an event object from resource management
| event | the event object |
| rt_err_t rt_event_init | ( | rt_event_t | event, | |
| const char * | name, | |||
| rt_uint8_t | flag | |||
| ) |
This function will initialize an event and put it under control of resource management.
| event | the event object | |
| name | the name of event | |
| flag | the flag of event |
| rt_err_t rt_event_recv | ( | rt_event_t | event, | |
| rt_uint32_t | set, | |||
| rt_uint8_t | option, | |||
| rt_int32_t | timeout, | |||
| rt_uint32_t * | recved | |||
| ) |
This function will receive an event from event object, if the event is unavailable, the thread shall wait for a specified time.
| event | the fast event object | |
| set | the interested event set | |
| option | the receive option | |
| timeout | the waiting time | |
| recved | the received event |
| rt_err_t rt_event_send | ( | rt_event_t | event, | |
| rt_uint32_t | set | |||
| ) |
This function will send an event to the event object, if there are threads suspended on event object, it will be waked up.
| event | the event object | |
| set | the event set |
| rt_err_t rt_fast_event_control | ( | rt_fast_event_t | event, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function can get or set some extra attributions of a fast event object.
| event | the event object | |
| cmd | the execution command | |
| arg | the execution argument |
| rt_fast_event_t rt_fast_event_create | ( | const char * | name, | |
| rt_uint8_t | flag | |||
| ) |
This function will create a fast event object from system resource
| name | the name of fast event | |
| flag | the flag of fast event |
| rt_err_t rt_fast_event_delete | ( | rt_fast_event_t | event | ) |
This function will delete a fast event object and release the memory
| event | the fast event object |
| rt_err_t rt_fast_event_detach | ( | rt_fast_event_t | event | ) |
This function will detach a fast event from resource management
| event | the fast event object |
| rt_err_t rt_fast_event_init | ( | rt_fast_event_t | event, | |
| const char * | name, | |||
| rt_uint8_t | flag | |||
| ) |
This function will initialize a fast event and put it under control of resource management.
| event | the fast event object | |
| name | the name of fast event | |
| flag | the flag of fast event |
| rt_err_t rt_fast_event_recv | ( | rt_fast_event_t | event, | |
| rt_uint8_t | bit, | |||
| rt_uint8_t | option, | |||
| rt_int32_t | timeout | |||
| ) |
This function will receive an event from fast event object, if the event is unavailable, the thread shall wait for a specified time.
| event | the fast event object | |
| bit | the interested event | |
| option | the receive option | |
| timeout | the waiting time |
| rt_err_t rt_fast_event_send | ( | rt_fast_event_t | event, | |
| rt_uint8_t | bit | |||
| ) |
This function will send an event to the fast event object, if there are threads suspended on fast event object, it will be waked up.
| event | the fast event object | |
| bit | the event bit |
| rt_inline rt_err_t rt_ipc_object_init | ( | struct rt_ipc_object * | ipc | ) |
This function will initialize an IPC object
| ipc | the IPC object |
| rt_inline rt_err_t rt_ipc_object_resume | ( | struct rt_ipc_object * | ipc | ) |
This function will resume a thread from an IPC object:
| ipc | the IPC object |
| rt_inline rt_err_t rt_ipc_object_resume_all | ( | struct rt_ipc_object * | ipc | ) |
This function will resume all suspended threads in an IPC object.
| ipc | the IPC object |
| rt_inline rt_err_t rt_ipc_object_suspend | ( | struct rt_ipc_object * | ipc, | |
| struct rt_thread * | thread | |||
| ) |
This function will suspend a thread for a specified IPC object and put the thread into suspend queue of IPC object
| ipc | the IPC object | |
| thread | the thread object to be suspended |
| rt_err_t rt_mb_control | ( | rt_mailbox_t | mb, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function can get or set some extra attributions of a mailbox object.
| mb | the mailbox object | |
| cmd | the execution command | |
| arg | the execution argument |
| rt_mailbox_t rt_mb_create | ( | const char * | name, | |
| rt_size_t | size, | |||
| rt_uint8_t | flag | |||
| ) |
This function will create a mailbox object from system resource
| name | the name of mailbox | |
| size | the size of mailbox | |
| flag | the flag of mailbox |
| rt_err_t rt_mb_delete | ( | rt_mailbox_t | mb | ) |
This function will delete a mailbox object and release the memory
| mb | the mailbox object |
| rt_err_t rt_mb_detach | ( | rt_mailbox_t | mb | ) |
This function will detach a mailbox from resource management
| mb | the mailbox object |
| rt_err_t rt_mb_init | ( | rt_mailbox_t | mb, | |
| const char * | name, | |||
| void * | msgpool, | |||
| rt_size_t | size, | |||
| rt_uint8_t | flag | |||
| ) |
This function will initialize a mailbox and put it under control of resource management.
| mb | the mailbox object | |
| name | the name of mailbox | |
| msgpool | the begin address of buffer to save received mail | |
| size | the size of mailbox | |
| flag | the flag of mailbox |
| rt_err_t rt_mb_recv | ( | rt_mailbox_t | mb, | |
| rt_uint32_t * | value, | |||
| rt_int32_t | timeout | |||
| ) |
This function will receive a mail from mailbox object, if there is no mail in mailbox object, the thread shall wait for a specified time.
| mb | the mailbox object | |
| value | the received mail will be saved in | |
| timeout | the waiting time |
| rt_err_t rt_mb_send | ( | rt_mailbox_t | mb, | |
| rt_uint32_t | value | |||
| ) |
This function will send a mail to mailbox object, if there are threads suspended on mailbox object, it will be waked up.
| mb | the mailbox object | |
| value | the mail |
| rt_err_t rt_mq_control | ( | rt_mq_t | mq, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function can get or set some extra attributions of a message queue object.
| mq | the message queue object | |
| cmd | the execution command | |
| arg | the execution argument |
| rt_mq_t rt_mq_create | ( | const char * | name, | |
| rt_size_t | msg_size, | |||
| rt_size_t | max_msgs, | |||
| rt_uint8_t | flag | |||
| ) |
This function will create a message queue object from system resource
| name | the name of message queue | |
| msg_size | the size of message | |
| max_msgs | the maximum number of message in queue | |
| flag | the flag of message queue |
| rt_err_t rt_mq_delete | ( | rt_mq_t | mq | ) |
This function will delete a message queue object and release the memory
| mq | the message queue object |
| rt_err_t rt_mq_detach | ( | rt_mq_t | mq | ) |
This function will detach a message queue object from resource management
| mq | the message queue object |
| rt_err_t rt_mq_init | ( | rt_mq_t | mq, | |
| const char * | name, | |||
| void * | msgpool, | |||
| rt_size_t | msg_size, | |||
| rt_size_t | pool_size, | |||
| rt_uint8_t | flag | |||
| ) |
This function will initialize a message queue and put it under control of resource management.
| mq | the message object | |
| name | the name of message queue | |
| msgpool | the beginning address of buffer to save messages | |
| msg_size | the maximum size of message | |
| pool_size | the size of buffer to save messages | |
| flag | the flag of message queue |
| rt_err_t rt_mq_recv | ( | rt_mq_t | mq, | |
| void * | buffer, | |||
| rt_size_t | size, | |||
| rt_int32_t | timeout | |||
| ) |
This function will receive a message from message queue object, if there is no message in message queue object, the thread shall wait for a specified time.
| mq | the message queue object | |
| buffer | the received message will be saved in | |
| size | the size of buffer | |
| timeout | the waiting time |
| rt_err_t rt_mq_send | ( | rt_mq_t | mq, | |
| void * | buffer, | |||
| rt_size_t | size | |||
| ) |
This function will send a message to message queue object, if there are threads suspended on message queue object, it will be waked up.
| mq | the message queue object | |
| buffer | the message | |
| size | the size of buffer |
| rt_err_t rt_mq_urgent | ( | rt_mq_t | mq, | |
| void * | buffer, | |||
| rt_size_t | size | |||
| ) |
This function will send urgently a message to message queue object, which means the message will be inserted to the head of message queue. If there are threads suspended on message queue object, it will be waked up.
| mq | the message queue object | |
| buffer | the message | |
| size | the size of buffer |
| rt_err_t rt_mutex_control | ( | rt_mutex_t | mutex, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function can get or set some extra attributions of a mutex object.
| mutex | the mutex object | |
| cmd | the execution command | |
| arg | the execution argument |
| rt_mutex_t rt_mutex_create | ( | const char * | name, | |
| rt_uint8_t | flag | |||
| ) |
This function will create a mutex from system resource
| name | the name of mutex | |
| flag | the flag of mutex |
| rt_err_t rt_mutex_delete | ( | rt_mutex_t | mutex | ) |
This function will delete a mutex object and release the memory
| mutex | the mutex object |
| rt_err_t rt_mutex_detach | ( | rt_mutex_t | mutex | ) |
This function will detach a mutex from resource management
| mutex | the mutex object |
| rt_err_t rt_mutex_init | ( | rt_mutex_t | mutex, | |
| const char * | name, | |||
| rt_uint8_t | flag | |||
| ) |
This function will initialize a mutex and put it under control of resource management.
| mutex | the mutex object | |
| name | the name of mutex | |
| flag | the flag of mutex |
| rt_err_t rt_mutex_release | ( | rt_mutex_t | mutex | ) |
This function will release a mutex, if there are threads suspended on mutex, it will be waked up.
| mutex | the mutex object |
| rt_err_t rt_mutex_take | ( | rt_mutex_t | mutex, | |
| rt_int32_t | time | |||
| ) |
This function will take a mutex, if the mutex is unavailable, the thread shall wait for a specified time.
| mutex | the mutex object | |
| time | the waiting time |
| rt_err_t rt_sem_control | ( | rt_sem_t | sem, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function can get or set some extra attributions of a semaphore object.
| sem | the semaphore object | |
| cmd | the execution command | |
| arg | the execution argument |
| rt_sem_t rt_sem_create | ( | const char * | name, | |
| rt_uint32_t | value, | |||
| rt_uint8_t | flag | |||
| ) |
This function will create a semaphore from system resource
| name | the name of semaphore | |
| value | the init value of semaphore | |
| flag | the flag of semaphore |
| rt_err_t rt_sem_delete | ( | rt_sem_t | sem | ) |
This function will delete a semaphore object and release the memory
| sem | the semaphore object |
| rt_err_t rt_sem_detach | ( | rt_sem_t | sem | ) |
This function will detach a semaphore from resource management
| sem | the semaphore object |
| rt_err_t rt_sem_init | ( | rt_sem_t | sem, | |
| const char * | name, | |||
| rt_uint32_t | value, | |||
| rt_uint8_t | flag | |||
| ) |
This function will initialize a semaphore and put it under control of resource management.
| sem | the semaphore object | |
| name | the name of semaphore | |
| value | the init value of semaphore | |
| flag | the flag of semaphore |
| rt_err_t rt_sem_release | ( | rt_sem_t | sem | ) |
This function will release a semaphore, if there are threads suspended on semaphore, it will be waked up.
| sem | the semaphore object |
| rt_err_t rt_sem_take | ( | rt_sem_t | sem, | |
| rt_int32_t | time | |||
| ) |
This function will take a semaphore, if the semaphore is unavailable, the thread shall wait for a specified time.
| sem | the semaphore object | |
| time | the waiting time |
| rt_err_t rt_sem_trytake | ( | rt_sem_t | sem | ) |
This function will try to take a semaphore and immediately return
| sem | the semaphore object |
1.5.7