|
aos_status_t | aos_event_create (aos_event_t *event, uint32_t value, uint32_t options) |
|
void | aos_event_free (aos_event_t *event) |
|
aos_status_t | aos_event_get (aos_event_t *event, uint32_t value, uint32_t opt, uint32_t *actl_value, uint32_t timeout) |
|
aos_status_t | aos_event_set (aos_event_t *event, uint32_t value, uint32_t opt) |
|
aos_status_t | aos_event_new (aos_event_t *event, uint32_t value) |
|
bool | aos_event_is_valid (aos_event_t *event) |
|
aos_status_t | aos_queue_new (aos_queue_t *queue, void *buf, size_t size, size_t max_msg) |
|
bool | aos_queue_is_valid (aos_queue_t *queue) |
|
void * | aos_queue_buf_ptr (aos_queue_t *queue) |
|
提供AliOS Things系统内核事件功能的基础API.
◆ AOS_EVENT_AND
#define AOS_EVENT_AND 0x02u |
期望事件标志位均为1时,即等待所有事件均发生时,任务解除阻塞
在文件 kernel.h 第 53 行定义.
◆ AOS_EVENT_AND_CLEAR
#define AOS_EVENT_AND_CLEAR 0x03u |
期望事件标志位均为1时,即等待所有事件均发生时,任务解除阻塞且将事件标志位清零
在文件 kernel.h 第 54 行定义.
◆ AOS_EVENT_OR
#define AOS_EVENT_OR 0x00u |
期望任意事件标志位为1时,即等待的任意事件发生,任务解除阻塞
在文件 kernel.h 第 55 行定义.
◆ AOS_EVENT_OR_CLEAR
#define AOS_EVENT_OR_CLEAR 0x01u |
期望任意事件标志位为1时,即等待的任意事件发生,任务解除阻塞且将事件标志位清零
在文件 kernel.h 第 56 行定义.
◆ aos_event_t
◆ aos_event_create()
Alloc a event.
- 参数
-
[out] | sem | pointer of event object, event object must be alloced, hdl pointer in aos_sem_t will refer a kernel obj internally. |
[in] | value | initial event value. |
[in] | options | reserved. |
- 返回
- 0:success.
◆ aos_event_free()
Destroy a event.
- 参数
-
[in] | event | pointer of event object, mem refered by hdl pointer in aos_hdl_t will be freed internally. |
◆ aos_event_get()
aos_status_t aos_event_get |
( |
aos_event_t * |
event, |
|
|
uint32_t |
value, |
|
|
uint32_t |
opt, |
|
|
uint32_t * |
actl_value, |
|
|
uint32_t |
timeout |
|
) |
| |
Get a event.
- 参数
-
[in] | event | event object. |
[in] | value | Expect value. |
[in] | opt | Mode of operation, one of AND/AND_CLEAR/OR/OR_CLEAR |
| [OUT] | actl_value Actual acquired value |
[in] | timeout | waiting until timeout in milliseconds. |
◆ aos_event_is_valid()
This function will check if event is valid. Deprecated, not Recommended.
- 参数
-
[in] | event | pointer to the event. |
- 返回
- false: invalid, true: valid.
◆ aos_event_new()
Alloc a event. Deprecated, not Recommended.
- 参数
-
[out] | event | pointer of event object, event object must be alloced, hdl pointer in aos_hdl_t will refer a kernel obj internally. |
[in] | value | initial event value. |
- 返回
- 0:success.
◆ aos_event_set()
Set a event.
- 参数
-
[in] | event | event object. |
[in] | value | The value to set. |
[in] | opt | Mode of operation, one of AND/AND_CLEAR/OR/OR_CLEAR |
[in] | timeout | waiting until timeout in milliseconds. |
- 返回
- 0:success.
◆ aos_queue_buf_ptr()
This function will return buf start ptr if queue is inited. Deprecated, not Recommended.
- 参数
-
[in] | queue | pointer to the queue. |
- 返回
- NULL: error.
◆ aos_queue_is_valid()
This function will check if queue is valid. Deprecated, not Recommended.
- 参数
-
[in] | queue | pointer to the queue. |
- 返回
- false: invalid, true: valid.
◆ aos_queue_new()
This function will create a queue. Deprecated, not Recommended.
- 参数
-
[in] | queue | pointer to the queue(the space is provided by user). |
[in] | buf | buf of the queue(provided by user). |
[in] | size | the bytes of the buf. |
[in] | max_msg | the max size of the msg. |
- 返回
- 0: success.