VSF Documented
vsf_pbuf_queue.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_PBUF_QUEUE_H__
19#define __VSF_PBUF_QUEUE_H__
20
21/*============================ INCLUDES ======================================*/
23
24#if VSF_USE_STREAM == ENABLED
25
26#include "../interface.h"
27
28#include "../pbuf/vsf_pbuf.h"
29
34#define __PLOOC_CLASS_USE_STRICT_TEMPLATE__
35
36#if defined(__VSF_PBUF_QUEUE_CLASS_IMPLEMENT)
37# define __PLOOC_CLASS_IMPLEMENT__
38# undef __VSF_PBUF_QUEUE_CLASS_IMPLEMENT
39#elif defined(__VSF_PBUF_QUEUE_CLASS_INHERIT__)
40# define __PLOOC_CLASS_INHERIT__
41# undef __VSF_PBUF_QUEUE_CLASS_INHERIT__
42#endif
43
44#include "utilities/ooc_class.h"
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/*============================ MACROS ========================================*/
51/*============================ MACROFIED FUNCTIONS ===========================*/
52/*============================ TYPES =========================================*/
53
54declare_class(vsf_stream_fifo_t)
55
56typedef struct vsf_stream_fifo_cfg_t {
57 vsf_stream_dat_rdy_evt_t tDataReadyEventHandling;
58 vsf_stream_dat_drn_evt_t tDataDrainEventHandling;
59 struct {
60 uint32_t : 16;
61 uint32_t chDataReadyThreshold : 8;
62 uint32_t chDataDrainThreshold : 8;
63 };
64#if !defined(VSF_PBUF_QUEUE_CFG_ATOM_ACCESS)
65 vsf_protect_region_t *pregion;
66#endif
68
69
70def_class(vsf_stream_fifo_t,
71 which(
74 ),
75 private_member(
76 implement(vsf_slist_queue_t)
77 union {
79 struct {
80 vsf_stream_dat_rdy_evt_t tDataReadyEventHandling;
81 vsf_stream_dat_drn_evt_t tDataDrainEventHandling;
82
84
85 #if !defined(VSF_PBUF_QUEUE_CFG_ATOM_ACCESS)
86 vsf_protect_region_t *pregion;
87 #endif
88 };
89 };
90 )
91)
92
93end_def_class(vsf_stream_fifo_t)
94
95
96/*============================ GLOBAL VARIABLES ==============================*/
97/*============================ PROTOTYPES ====================================*/
98extern
99vsf_err_t vsf_stream_fifo_init( vsf_stream_fifo_t *obj_ptr,
101
102extern
103vsf_err_t vsf_pbuf_queue_enqueue(vsf_stream_fifo_t *obj_ptr, vsf_pbuf_t *pblock);
104
105extern
106vsf_pbuf_t * vsf_pbuf_queue_dequeue(vsf_stream_fifo_t *obj_ptr);
107
108VSF_CAL_SECTION(".text.vsf.service.stream.pbuf_queue.vsf_pbuf_queue_peek")
109extern
110vsf_pbuf_t * vsf_pbuf_queue_peek(vsf_stream_fifo_t *obj_ptr);
111
112extern
114 vsf_stream_fifo_t *obj_ptr, vsf_stream_dat_rdy_evt_t tEventHandling);
115
116extern
118 vsf_stream_fifo_t *obj_ptr, vsf_stream_dat_drn_evt_t tEventHandling);
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif
125#endif
126/* EOF */
#define VSF_CAL_SECTION(__SEC)
Definition __compiler.h:181
vsf_err_t
Definition __type.h:42
i_stream_pbuf_tx_t TX
Definition interface.h:99
struct vsf_stream_tx_t vsf_stream_tx_t
Definition interface.h:34
vsf_pbuf_t * pblock
Definition interface.h:90
unsigned uint32_t
Definition stdint.h:9
Definition vsf_arch_abstraction.h:54
Definition vsf_list.h:896
Definition interface.h:55
Definition interface.h:44
Definition interface.h:108
Definition interface.h:60
vsf_err_t vsf_stream_fifo_init(vsf_stream_fifo_t *obj_ptr, vsf_stream_fifo_cfg_t *cfg_ptr)
Definition vsf_pbuf_queue.c:109
vsf_stream_fifo_cfg_t
Definition vsf_pbuf_queue.h:67
vsf_err_t vsf_pbuf_queue_data_available_event_register(vsf_stream_fifo_t *obj_ptr, vsf_stream_dat_rdy_evt_t tEventHandling)
Definition vsf_pbuf_queue.c:243
vsf_pbuf_t * vsf_pbuf_queue_peek(vsf_stream_fifo_t *obj_ptr)
Definition vsf_pbuf_queue.c:189
vsf_err_t vsf_pbuf_queue_data_drain_event_register(vsf_stream_fifo_t *obj_ptr, vsf_stream_dat_drn_evt_t tEventHandling)
Definition vsf_pbuf_queue.c:252
declare_class(vsf_stream_fifo_t) typedef struct vsf_stream_fifo_cfg_t
Definition vsf_pbuf_queue.h:54
vsf_stream_fifo_cfg_t * cfg_ptr
Definition vsf_pbuf_queue.h:100
def_class(vsf_stream_fifo_t, which(vsf_stream_tx_t TX;vsf_stream_rx_t RX;), private:vsf_slist_queue_t union { vsf_stream_fifo_cfg_t cfg;struct { vsf_stream_dat_rdy_evt_t tDataReadyEventHandling;vsf_stream_dat_drn_evt_t tDataDrainEventHandling;vsf_stream_status_t Status;#if !defined(VSF_PBUF_QUEUE_CFG_ATOM_ACCESS) vsf_protect_region_t *pregion;#endif };};) end_def_class(vsf_stream_fifo_t) extern vsf_err_t vsf_stream_fifo_init(vsf_stream_fifo_t *obj_ptr
vsf_pbuf_t * vsf_pbuf_queue_dequeue(vsf_stream_fifo_t *obj_ptr)
Definition vsf_pbuf_queue.c:203
vsf_err_t vsf_pbuf_queue_enqueue(vsf_stream_fifo_t *obj_ptr, vsf_pbuf_t *pblock)
Definition vsf_pbuf_queue.c:137
which(union { inherit(vsf_msgt_container_t) vsf_tgui_control_t };vsf_tgui_v_container_t) implement_ex(struct
Definition vsf_tgui_control.h:540