📄 rtos.h
字号:
#ifndef __RTOS_H__
#define __RTOS_H__
#include "includes.h"
typedef void (*task)(void *p_arg);
#ifdef __cplusplus
extern "C" {
#endif
RTOS_Thread create_thread(task func, void *arg, u8 prio, void *stack, u32 size);
//mutex api
RTOS_Mutex RTOS_MutexCreate( void );
void RTOS_MutexDestroy( RTOS_Mutex mutex );
int RTOS_MutexLock( RTOS_Mutex mutex, bool suspend );
int RTOS_MutexLockTimeout( RTOS_Mutex mutex, INT16U msecs );
int RTOS_MutexUnlock( RTOS_Mutex mutex );
//mailbox api
RTOS_Mailbox RTOS_MailboxCreate( RTOS_Message message );
int RTOS_MailboxDestroy( RTOS_Mailbox mailbox );
RTOS_Message RTOS_MailboxQuery( RTOS_Mailbox mailbox );
RTOS_Message RTOS_MailboxWait( RTOS_Mailbox mailbox, bool suspend );
RTOS_Message RTOS_MailboxWaitTimeout( RTOS_Mailbox mailbox, INT16U msecs );
int RTOS_MailboxSend( RTOS_Mailbox mailbox, RTOS_Message message );
//sem api
RTOS_Semaphore RTOS_SemaphoreCreate( U32 init );
int RTOS_SemaphoreDestroy( RTOS_Semaphore semaphore );
int RTOS_SemaphoreQuery( RTOS_Semaphore semaphore );
int RTOS_SemaphoreWait( RTOS_Semaphore semaphore, bool suspend );
int RTOS_SemaphoreWaitTimeout( RTOS_Semaphore semaphore, INT16U msecs );
int RTOS_SemaphoreRelease( RTOS_Semaphore semaphore );
void sem_lock(RTOS_Semaphore semaphore );
void sem_unlock(RTOS_Semaphore semaphore );
#ifdef __cplusplus
}
#endif
#endif //__RTOS_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -