VSF Documented
interface.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_SERVICE_STREAM_INTERFACE_H__
19#define __VSF_SERVICE_STREAM_INTERFACE_H__
20
21/*============================ INCLUDES ======================================*/
23
24#include "./pbuf/vsf_pbuf.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/*============================ MACROS ========================================*/
31/*============================ MACROFIED FUNCTIONS ===========================*/
32/*============================ TYPES =========================================*/
33
37
38typedef void vsf_stream_dat_rdy_evt_handler_t( void *target_ptr,
40 vsf_stream_status_t Status);
41
44{
47};
48
49typedef void vsf_stream_dat_drn_evt_handler_t( void *target_ptr,
51 vsf_stream_status_t Status);
52
55{
58};
59
61 struct {
63 #if VSF_STREAM_CFG_SUPPORT_OPEN_CLOSE == ENABLED
65 #else
66 uint32_t : 1;
67 #endif
73 };
75};
76
77def_interface(i_stream_pbuf_rx_t)
78 vsf_pbuf_t * (*Fetch)(vsf_stream_rx_t *);
79 struct {
83#if VSF_STREAM_CFG_SUPPORT_OPEN_CLOSE == ENABLED
84 void (*Open)(vsf_stream_rx_t *obj_ptr);
85 void (*Close)(vsf_stream_rx_t *obj_ptr);
86#endif
87end_def_interface(i_stream_pbuf_rx_t)
88
89def_interface(i_stream_pbuf_tx_t)
90 vsf_err_t (*Send)(vsf_stream_tx_t *obj_ptr, vsf_pbuf_t *pblock);
91 struct {
95end_def_interface(i_stream_pbuf_tx_t)
96
97def_interface(i_stream_pbuf_t)
98 i_stream_pbuf_rx_t RX;
99 i_stream_pbuf_tx_t TX;
100end_def_interface(i_stream_pbuf_t)
101
102
103
104struct vsf_stream_tx_t {
105 const i_stream_pbuf_tx_t *piMethod;
106};
107
109 const i_stream_pbuf_rx_t *piMethod;
110};
111
112
113/*============================ GLOBAL VARIABLES ==============================*/
114
115
116/*============================ PROTOTYPES ====================================*/
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif
123/* EOF */
vsf_err_t
Definition __type.h:42
def_interface(i_stream_pbuf_rx_t) vsf_pbuf_t *(*Fetch)(vsf_stream_rx_t *)
void vsf_stream_dat_rdy_evt_handler_t(void *target_ptr, vsf_stream_rx_t *, vsf_stream_status_t Status)
Definition interface.h:38
vsf_stream_status_t(* GetStatus)(vsf_stream_rx_t *)
Definition interface.h:82
void(* Open)(vsf_stream_rx_t *obj_ptr)
Definition interface.h:84
i_stream_pbuf_tx_t TX
Definition interface.h:99
void vsf_stream_dat_drn_evt_handler_t(void *target_ptr, vsf_stream_tx_t *, vsf_stream_status_t Status)
Definition interface.h:49
struct @768 DataReadyEvent
vsf_err_t(* Register)(vsf_stream_rx_t *, vsf_stream_dat_rdy_evt_t)
Definition interface.h:80
struct vsf_stream_tx_t vsf_stream_tx_t
Definition interface.h:34
end_def_interface(i_stream_pbuf_rx_t) def_interface(i_stream_pbuf_tx_t) vsf_err_t(*Send)(vsf_stream_tx_t *obj_ptr
struct @769 DataDrainEvent
vsf_pbuf_t * pblock
Definition interface.h:90
void(* Close)(vsf_stream_rx_t *obj_ptr)
Definition interface.h:85
unsigned uint32_t
Definition stdint.h:9
Definition interface.h:55
vsf_stream_dat_drn_evt_handler_t * handler_fn
Definition interface.h:56
void * target_ptr
Definition interface.h:57
Definition interface.h:44
vsf_stream_dat_rdy_evt_handler_t * handler_fn
Definition interface.h:45
void * target_ptr
Definition interface.h:46
Definition interface.h:108
const i_stream_pbuf_rx_t * piMethod
Definition interface.h:109
Definition interface.h:60
uint32_t IsDataReady
Definition interface.h:69
uint32_t u8DataDrainThreshold
Definition interface.h:72
uint32_t IsDataFull
Definition interface.h:68
uint32_t IsOpen
Definition interface.h:64
uint32_t IsDataDrain
Definition interface.h:70
uint32_t wStatus
Definition interface.h:74
uint32_t u14Count
Definition interface.h:62
uint32_t u8DataReadyThreshold
Definition interface.h:71
vsf_err_t(* Send)(uint_fast8_t ep, uint8_t *buffer, uint_fast32_t size, bool zlp)
Definition vsf_template_usb.h:380