Functions | |
| rt_err_t | rt_thread_init (struct rt_thread *thread, const char *name, void(*entry)(void *parameter), void *parameter, void *stack_start, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick) |
| rt_err_t | rt_thread_detach (rt_thread_t thread) |
| rt_thread_t | rt_thread_create (const char *name, void(*entry)(void *parameter), void *parameter, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick) |
| rt_thread_t | rt_thread_self (void) |
| rt_err_t | rt_thread_startup (rt_thread_t thread) |
| rt_err_t | rt_thread_delete (rt_thread_t thread) |
| rt_err_t | rt_thread_yield (void) |
| rt_err_t | rt_thread_delay (rt_tick_t tick) |
| rt_err_t | rt_thread_suspend (rt_thread_t thread) |
| rt_err_t | rt_thread_resume (rt_thread_t thread) |
| void | rt_thread_timeout (void *parameter) |
| void | rt_thread_idle_init (void) |
| void | rt_thread_idle_sethook (void(*hook)()) |
| void | rt_system_scheduler_init (void) |
| void | rt_system_scheduler_start (void) |
| void | rt_schedule (void) |
| void | rt_schedule_insert_thread (struct rt_thread *thread) |
| void | rt_schedule_remove_thread (struct rt_thread *thread) |
| void | rt_enter_critical (void) |
| void | rt_exit_critical (void) |
| rt_err_t | rt_thread_sleep (rt_tick_t tick) |
| void rt_enter_critical | ( | ) |
This function will lock the thread scheduler.
| void rt_exit_critical | ( | ) |
This function will unlock the thread scheduler.
| void rt_schedule | ( | ) |
This function will perform one schedule. It will select one thread with the highest priority level, then switch to it.
| void rt_schedule_insert_thread | ( | struct rt_thread * | thread | ) |
This function will insert a thread to system ready queue. The state of thread will be set as READY and remove from suspend queue.
| thread | the thread to be inserted |
| void rt_schedule_remove_thread | ( | struct rt_thread * | thread | ) |
This function will remove a thread from system ready queue.
| thread | the thread to be removed |
| void rt_system_scheduler_init | ( | void | ) |
This function will init the system scheduler
| void rt_system_scheduler_start | ( | void | ) |
This function will startup scheduler. It will select one thread with the highest priority level, then switch to it.
| rt_thread_t rt_thread_create | ( | const char * | name, | |
| void(*)(void *parameter) | entry, | |||
| void * | parameter, | |||
| rt_uint32_t | stack_size, | |||
| rt_uint8_t | priority, | |||
| rt_uint32_t | tick | |||
| ) |
This function will create a thread object and allocate thread object memory and stack.
| name | the name of thread, which shall be unique | |
| entry | the entry function of thread | |
| parameter | the parameter of thread enter function | |
| stack_size | the size of thread stack | |
| priority | the priority of thread | |
| tick | the time slice if there are same priority thread |
| rt_err_t rt_thread_delay | ( | rt_tick_t | tick | ) |
This function will let current thread delay for some ticks.
| tick | the delay ticks |
| rt_err_t rt_thread_delete | ( | rt_thread_t | thread | ) |
This function will delete a thread. The thread object will be remove from thread queue and detached/deleted from system object management.
| thread | the thread to be deleted |
| rt_err_t rt_thread_detach | ( | rt_thread_t | thread | ) |
This function will detach a thread. The thread object will be remove from thread queue and detached/deleted from system object management.
| thread | the thread to be deleted |
| void rt_thread_idle_init | ( | ) |
This function will initialize idle thread, then start it.
| void rt_thread_idle_sethook | ( | void(*)() | hook | ) |
This function will set a hook function to idle thread loop.
| hook | the specified hook function |
| rt_err_t rt_thread_init | ( | struct rt_thread * | thread, | |
| const char * | name, | |||
| void(*)(void *parameter) | entry, | |||
| void * | parameter, | |||
| void * | stack_start, | |||
| rt_uint32_t | stack_size, | |||
| rt_uint8_t | priority, | |||
| rt_uint32_t | tick | |||
| ) |
This function will init a thread, normally it's used to initialize a static thread object.
| thread | the static thread object | |
| name | the name of thread, which shall be unique | |
| entry | the entry function of thread | |
| parameter | the parameter of thread enter function | |
| stack_start | the start address of thread stack | |
| stack_size | the size of thread stack | |
| priority | the priority of thread | |
| tick | the time slice if there are same priority thread |
| rt_err_t rt_thread_resume | ( | rt_thread_t | thread | ) |
This function will resume a thread and put it to system ready queue.
| thread | the thread to be resumed |
| rt_thread_t rt_thread_self | ( | void | ) |
This function will return self thread object
| rt_err_t rt_thread_sleep | ( | rt_tick_t | tick | ) |
This function will let current thread sleep for some ticks.
| tick | the sleep ticks |
| rt_err_t rt_thread_startup | ( | rt_thread_t | thread | ) |
This function will start a thread and put it to system ready queue
| thread | the thread to be started |
| rt_err_t rt_thread_suspend | ( | rt_thread_t | thread | ) |
This function will suspend the specified thread.
| thread | the thread to be suspended |
| void rt_thread_timeout | ( | void * | parameter | ) |
This function is the timeout function for thread, normally which will be invoked when thread is timeout to wait some recourse.
| parameter | the parameter of thread timeout function |
| rt_err_t rt_thread_yield | ( | ) |
This function will let current thread yield processor, and scheduler will get a highest thread to run. After yield processor, the current thread is still in READY state.
1.5.7