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

结构体 | |
| struct | tagEvent |
宏定义 | |
| #define | LOS_WAITMODE_AND 4U |
| #define | LOS_WAITMODE_OR 2U |
| #define | LOS_WAITMODE_CLR 1U |
| #define | LOS_ERRNO_EVENT_SETBIT_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x00) |
| #define | LOS_ERRNO_EVENT_READ_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x01) |
| #define | LOS_ERRNO_EVENT_EVENTMASK_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x02) |
| #define | LOS_ERRNO_EVENT_READ_IN_INTERRUPT LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x03) |
| #define | LOS_ERRNO_EVENT_FLAGS_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x04) |
| #define | LOS_ERRNO_EVENT_READ_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x05) |
| #define | LOS_ERRNO_EVENT_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x06) |
| #define | LOS_ERRNO_EVENT_READ_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x07) |
| #define | LOS_ERRNO_EVENT_SHOULD_NOT_DESTORY LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x08) |
| #define | LOS_EventCondRead(eventCB, eventCond, timeout) |
| Read an event by condition. | |
类型定义 | |
| typedef struct tagEvent | EVENT_CB_S |
| typedef struct tagEvent * | PEVENT_CB_S |
函数 | |
| UINT32 | LOS_EventInit (PEVENT_CB_S eventCB) |
| Initialize an event control block. | |
| UINT32 | LOS_EventPoll (UINT32 *eventId, UINT32 eventMask, UINT32 mode) |
| Obtain an event specified by the event ID. | |
| UINT32 | LOS_EventRead (PEVENT_CB_S eventCB, UINT32 eventMask, UINT32 mode, UINT32 timeout) |
| Read an event. | |
| UINT32 | LOS_EventWrite (PEVENT_CB_S eventCB, UINT32 events) |
| Write an event. | |
| UINT32 | LOS_EventClear (PEVENT_CB_S eventCB, UINT32 events) |
| Clear the event occurring in a specified task. | |
| UINT32 | LOS_EventDestroy (PEVENT_CB_S eventCB) |
| Destroy an event. | |
| UINT32 | LOS_EventCondWrite (PEVENT_CB_S eventCB) |
| Write an event by condition.. | |
| #define LOS_ERRNO_EVENT_EVENTMASK_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x02) |
Event reading error code: The EVENTMASK input parameter value is valid. The input parameter value must not be 0.
Value: 0x02001c02.
Solution: Pass in a valid EVENTMASK value.
| #define LOS_ERRNO_EVENT_FLAGS_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x04) |
Event reading error code: The flag input parameter value used in the event reading API is invalid. This input parameter value is obtained by performing an OR operation on corresponding bits of either OS_EVENT_ANY or OS_EVENT_ANY and corresponding bits of either OS_EVENT_WAIT or OS_EVENT_NOWAIT. The waiting time must be set to a nonzero value when an event is read in the mode of OS_EVENT_WAIT.
Value: 0x02001c04.
Solution: Pass in a valid flag value.
| #define LOS_ERRNO_EVENT_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x06) |
Event reading error code: Null pointer.
Value: 0x02001c06.
Solution: Check whether the input parameter is null.
| #define LOS_ERRNO_EVENT_READ_IN_INTERRUPT LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x03) |
Event reading error code: The event is being read during an interrupt.
Value: 0x02001c03.
Solution: Read the event in a task.
| #define LOS_ERRNO_EVENT_READ_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x05) |
Event reading error code: The task is locked and is unable to read the event.
Value: 0x02001c05.
Solution: Unlock the task and read the event.
| #define LOS_ERRNO_EVENT_READ_IN_SYSTEM_TASK LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x07) |
| #define LOS_ERRNO_EVENT_READ_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x01) |
| #define LOS_ERRNO_EVENT_SETBIT_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x00) |
Event error code: Bit 25 of the event mask cannot be set to an event because it is set to an error code.
Value: 0x02001c00.
Solution: Set bits excluding bit 25 of the event mask to events.
| #define LOS_ERRNO_EVENT_SHOULD_NOT_DESTORY LOS_ERRNO_OS_ERROR(LOS_MOD_EVENT, 0x08) |
Event reading error code: should not be distory.
Value: 0x02001c08.
Solution: Check whether the event list is not empty.
| #define LOS_EventCondRead | ( | eventCB, | |
| eventCond, | |||
| timeout | |||
| ) |
Read an event by condition.
| eventCB | [IN/OUT] Type PEVENT_CB_S. Pointer to the event control block to be checked. This parameter must point to a valid memory. |
| eventCond | [IN] Type BOOL. The condition used to measure whether an event is completed. |
| timeout | [IN] Type UINT32. Timeout interval of event reading (unit: Tick). |
| Type | UINT32. LOS_ERRNO_EVENT_PTR_NULL The passed-in pointer is null. |
| Type | UINT32. LOS_ERRNO_EVENT_READ_IN_INTERRUPT The event is being read during an interrupt. |
| Type | UINT32. LOS_ERRNO_EVENT_READ_TIMEOUT The event reading times out. |
| Type | UINT32. LOS_ERRNO_EVENT_READ_IN_LOCK The event reading task is locked. |
| Type | UINT32. LOS_OK The event expected to occur by the user. |
| #define LOS_WAITMODE_AND 4U |
Event reading mode: The task waits for all its expected events to occur.
| #define LOS_WAITMODE_CLR 1U |
Event reading mode: The event flag is immediately cleared after the event is read.
| #define LOS_WAITMODE_OR 2U |
Event reading mode: The task waits for any of its expected events to occur.
| typedef struct tagEvent EVENT_CB_S |
Event control structure
| typedef struct tagEvent * PEVENT_CB_S |
|
extern |
Clear the event occurring in a specified task.
| eventCB | [IN/OUT] Pointer to the event control block to be cleared. |
| events | [IN] Mask of the event to be cleared. |
| LOS_ERRNO_EVENT_PTR_NULL | Null pointer. |
| LOS_OK | The event is successfully cleared. |
|
extern |
Write an event by condition..
| eventCB | [IN/OUT] Pointer to the control block to which the event is to be written. This parameter must point to a valid memory. |
| LOS_ERRNO_EVENT_PTR_NULL | Null pointer. |
| LOS_OK | The event is successfully written. |
|
extern |
Destroy an event.
| eventCB | [IN/OUT] Pointer to the event control block to be destroyed. |
| LOS_ERRNO_EVENT_PTR_NULL | Null pointer. |
| LOS_ERRNO_EVENT_SHOULD_NOT_DESTORY | The event should not be destroyed because the event list is not empty. |
| LOS_OK | The event is successfully cleared. |
|
extern |
Initialize an event control block.
| eventCB | [IN/OUT] Pointer to the event control block to be initialized. |
| LOS_ERRNO_EVENT_PTR_NULL | Null pointer. |
| LOS_OK | The event control block is successfully initialized. |
Obtain an event specified by the event ID.
| eventId | [IN/OUT] Pointer to the ID of the event to be checked. |
| eventMask | [IN] Mask of the event expected to occur by the user, indicating the event obtained after it is logically processed that matches the ID pointed to by eventId. |
| mode | [IN] Event reading mode. The modes include LOS_WAITMODE_AND, LOS_WAITMODE_OR, LOS_WAITMODE_CLR. |
| LOS_ERRNO_EVENT_SETBIT_INVALID | Bit 25 of the event mask cannot be set because it is set to an error number. |
| LOS_ERRNO_EVENT_EVENTMASK_INVALID | The passed-in event mask is incorrect. |
| LOS_ERRNO_EVENT_FLAGS_INVALID | The passed-in event mode is invalid. |
| LOS_ERRNO_EVENT_PTR_NULL | The passed-in pointer is null. |
| 0 | The event expected by the user does not occur. |
| UINT32 | The event expected by the user occurs. |
|
extern |
Read an event.
| eventCB | [IN/OUT] Pointer to the event control block to be checked. This parameter must point to valid memory. |
| eventMask | [IN] Mask of the event expected to occur by the user, indicating the event obtained after it is logically processed that matches the ID pointed to by eventId. |
| mode | [IN] Event reading mode. |
| timeout | [IN] Timeout interval of event reading (unit: Tick). |
| LOS_ERRNO_EVENT_SETBIT_INVALID | Bit 25 of the event mask cannot be set because it is set to an error number. |
| LOS_ERRNO_EVENT_EVENTMASK_INVALID | The passed-in event reading mode is incorrect. |
| LOS_ERRNO_EVENT_READ_IN_INTERRUPT | The event is being read during an interrupt. |
| LOS_ERRNO_EVENT_FLAGS_INVALID | The event mode is invalid. |
| LOS_ERRNO_EVENT_READ_IN_LOCK | The event reading task is locked. |
| LOS_ERRNO_EVENT_PTR_NULL | The passed-in pointer is null. |
| LOS_ERRNO_EVENT_READ_TIMEOUT | The event reading times out. |
| 0 | The event expected by the user does not occur. |
| UINT32 | The event expected to occur by the user. |
|
extern |
Write an event.
| eventCB | [IN/OUT] Pointer to the control block to which the event is to be written. This parameter must point to a valid memory. |
| events | [IN] Event mask to be written. |
| LOS_ERRNO_EVENT_SETBIT_INVALID | Bit 25 of the event mask cannot be set to an event because it is set to an error code. |
| LOS_ERRNO_EVENT_PTR_NULL | Null pointer. |
| LOS_OK | The event is successfully written. |