|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|

结构体 | |
| struct | MuxBaseCB |
宏定义 | |
| #define | LOS_ERRNO_MUX_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x00) |
| #define | LOS_ERRNO_MUX_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x01) |
| #define | LOS_ERRNO_MUX_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x02) |
| #define | LOS_ERRNO_MUX_ALL_BUSY LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x03) |
| #define | LOS_ERRNO_MUX_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x04) |
| #define | LOS_ERRNO_MUX_PEND_INTERR LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x05) |
| #define | LOS_ERRNO_MUX_PEND_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x06) |
| #define | LOS_ERRNO_MUX_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x07) |
| #define | LOS_ERRNO_MUX_OVERFLOW LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x08) |
| #define | LOS_ERRNO_MUX_PENDED LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x09) |
| #define | LOS_ERRNO_MUX_GET_COUNT_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0A) |
| #define | LOS_ERRNO_MUX_REG_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0B) |
| #define | LOS_ERRNO_MUX_PEND_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0C) |
函数 | |
| UINT32 | LOS_MuxCreate (UINT32 *muxHandle) |
| Create a mutex. | |
| UINT32 | LOS_MuxDelete (UINT32 muxHandle) |
| Delete a mutex. | |
| UINT32 | LOS_MuxPend (UINT32 muxHandle, UINT32 timeout) |
| Wait to lock a mutex. | |
| UINT32 | LOS_MuxPost (UINT32 muxHandle) |
| Release a mutex. | |
| #define LOS_ERRNO_MUX_ALL_BUSY LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x03) |
Mutex error code: No mutex is available and the mutex request fails.
Value: 0x02001d03.
Solution: Increase the number of mutexes defined by LOSCFG_BASE_IPC_MUX_LIMIT.
| #define LOS_ERRNO_MUX_GET_COUNT_ERR LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0A) |
The error code is not in use temporarily.
Value: 0x02001d0A
| #define LOS_ERRNO_MUX_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x01) |
Mutex error code: The mutex is not usable.
Value: 0x02001d01.
Solution: Check whether the mutex ID and the mutex state are applicable for the current operation.
| #define LOS_ERRNO_MUX_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x00) |
Mutex error code: The memory request fails.
Value: 0x02001d00.
Solution: Decrease the number of mutexes defined by LOSCFG_BASE_IPC_MUX_LIMIT.
| #define LOS_ERRNO_MUX_OVERFLOW LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x08) |
The error code is not in use temporarily.
Value: 0x02001d08
| #define LOS_ERRNO_MUX_PEND_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x06) |
Mutex error code: A thread locks a mutex after waiting for the mutex to be unlocked by another thread when the task scheduling is disabled.
Value: 0x02001d06.
Solution: Check whether the task scheduling is disabled, or set timeout to 0, which means that the thread will not wait for the mutex to become available.
| #define LOS_ERRNO_MUX_PEND_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0C) |
Mutex error code: The mutex is being locked in system-level task. old usage: The mutex is being locked in software timer task(LOS_ERRNO_MUX_PEND_IN_SWTMR_TSK).
Value: 0x02001d0C.
Solution: Pend the mutex in a valid task.
| #define LOS_ERRNO_MUX_PEND_INTERR LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x05) |
Mutex error code: The mutex is being locked during an interrupt.
Value: 0x02001d05.
Solution: Check whether the mutex is being locked during an interrupt.
| #define LOS_ERRNO_MUX_PENDED LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x09) |
Mutex error code: The mutex to be deleted is being locked.
Value: 0x02001d09.
Solution: Delete the mutex after it is unlocked.
| #define LOS_ERRNO_MUX_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x02) |
Mutex error code: Null pointer.
Value: 0x02001d02.
Solution: Check whether the input parameter is usable.
| #define LOS_ERRNO_MUX_REG_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x0B) |
The error code is not in use temporarily.
Value: 0x02001d0B
| #define LOS_ERRNO_MUX_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x07) |
Mutex error code: The mutex locking times out.
Value: 0x02001d07.
Solution: Increase the waiting time or set the waiting time to LOS_WAIT_FOREVER (forever-blocking mode).
| #define LOS_ERRNO_MUX_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_MUX, 0x04) |
Mutex error code: The mutex fails to be locked in non-blocking mode because it is locked by another thread.
Value: 0x02001d04.
Solution: Lock the mutex after it is unlocked by the thread that owns it, or set a waiting time.
Create a mutex.
| muxHandle | [OUT] Handle pointer of the successfully created mutex. The value of handle should be in [0, LOSCFG_BASE_IPC_MUX_LIMIT - 1]. |
| LOS_ERRNO_MUX_PTR_NULL | The muxHandle pointer is NULL. |
| LOS_ERRNO_MUX_ALL_BUSY | No available mutex. |
| LOS_OK | The mutex is successfully created. |
Delete a mutex.
| muxHandle | [IN] The mutex handle to be deleted. The value of handle should be in [0, LOSCFG_BASE_IPC_MUX_LIMIT - 1]. |
| LOS_ERRNO_MUX_INVALID | Invalid handle or mutex in use. |
| LOS_ERRNO_MUX_PENDED | Tasks pended on this mutex. |
| LOS_OK | The mutex is successfully deleted. |
Wait to lock a mutex.
| muxHandle | [IN] The mutex handle to be waited for. The value of handle should be in [0, LOSCFG_BASE_IPC_MUX_LIMIT - 1]. |
| timeout | [IN] Waiting time. The value range is [0, LOS_WAIT_FOREVER](unit: Tick). |
| LOS_ERRNO_MUX_INVALID | The mutex state (for example, the mutex does not exist or is not in use) is not applicable for the current operation. |
| LOS_ERRNO_MUX_UNAVAILABLE | The mutex fails to be locked because it is locked by another thread and a period of time is not set for waiting for the mutex to become available. |
| LOS_ERRNO_MUX_PEND_INTERR | The mutex is being locked during an interrupt. |
| LOS_ERRNO_MUX_PEND_IN_LOCK | The mutex is waited on when the task scheduling is disabled. |
| LOS_ERRNO_MUX_TIMEOUT | The mutex waiting times out. |
| LOS_OK | The mutex is successfully locked. |
Release a mutex.
| muxHandle | [IN] The mutex handle to be released. The value of handle should be in [0, LOSCFG_BASE_IPC_MUX_LIMIT - 1]. |
| LOS_ERRNO_MUX_INVALID | The mutex state (for example, the mutex does not exist or is not in use or owned by other thread) is not applicable for the current operation. |
| LOS_ERRNO_MUX_PEND_INTERR | The mutex is being released during an interrupt. |
| LOS_OK | The mutex is successfully released. |