379 #endif // _TN_DQUEUE_H
A link to event group: used when event group can be connected to some kernel object, such as queue.
enum TN_RCode tn_queue_receive_polling(struct TN_DQueue *dque, void **pp_data)
The same as tn_queue_receive() with zero timeout.
struct TN_ListItem wait_receive_list
list of tasks waiting to receive data
struct TN_ListItem wait_send_list
list of tasks waiting to send data
enum TN_ObjId id_dque
id for object validity verification
Circular doubly linked list, for internal kernel usage.
enum TN_RCode tn_queue_ireceive_polling(struct TN_DQueue *dque, void **pp_data)
The same as tn_queue_receive() with zero timeout, but for using in the ISR.
Structure representing data queue object.
TN_RCode
Result code returned by kernel services.
enum TN_RCode tn_queue_send(struct TN_DQueue *dque, void *p_data, TN_Timeout timeout)
Send the data element specified by the p_data to the data queue specified by the dque.
void ** data_fifo
array of void * to store data queue items. Can be TN_NULL.
DQueue-specific fields related to waiting task, to be included in struct TN_Task. ...
TN_ObjId
Magic number for object validity verification TODO: use TN_UWord here instead of unsigned int...
unsigned long TN_Timeout
The value representing maximum number of system ticks to wait.
enum TN_RCode tn_queue_eventgrp_connect(struct TN_DQueue *dque, struct TN_EventGrp *eventgrp, TN_UWord pattern)
Connect an event group to the queue.
Definitions used through the whole kernel.
int head_idx
index of the item which will be written next time
int filled_items_cnt
count of non-free items in data_fifo
int items_cnt
capacity (total items count). Can be 0.
void * data_elem
if task tries to send the data to the data queue, and there's no space in the queue, value to put to queue is stored in this field
int tail_idx
index of the item which will be read next time
enum TN_RCode tn_queue_eventgrp_disconnect(struct TN_DQueue *dque)
Disconnect a connected event group from the queue.
enum TN_RCode tn_queue_create(struct TN_DQueue *dque, void **data_fifo, int items_cnt)
Construct data queue.
enum TN_RCode tn_queue_receive(struct TN_DQueue *dque, void **pp_data, TN_Timeout timeout)
Receive the data element from the data queue specified by the dque and place it into the address spec...
struct TN_EGrpLink eventgrp_link
connected event group
enum TN_RCode tn_queue_send_polling(struct TN_DQueue *dque, void *p_data)
The same as tn_queue_send() with zero timeout.
enum TN_RCode tn_queue_isend_polling(struct TN_DQueue *dque, void *p_data)
The same as tn_queue_send() with zero timeout, but for using in the ISR.
Circular doubly linked list item, for internal kernel usage.
unsigned int TN_UWord
Unsigned integer type whose size is equal to the size of CPU register.
enum TN_RCode tn_queue_delete(struct TN_DQueue *dque)
Destruct data queue.