BALTECH SDK wrapper functions reference
usbhost.h
Go to the documentation of this file.
1 
10 #ifndef __BRP_BALTECH_SDK_CMDS_USBHOST_H__
11 #define __BRP_BALTECH_SDK_CMDS_USBHOST_H__
12 #include "../typedefs.h"
13 #ifdef BALTECH_SDK_INTERNAL
14 
17 #define BRP_UsbHost_UsbhstErrNotconnected BRP_ERR_STATUS(0x4400, 0x01)
18 #endif // BALTECH_SDK_INTERNAL
19 #ifdef BALTECH_SDK_INTERNAL
20 
23 #define BRP_UsbHost_UsbhstErrTimeout BRP_ERR_STATUS(0x4400, 0x02)
24 #endif // BALTECH_SDK_INTERNAL
25 #ifdef BALTECH_SDK_INTERNAL
26 
29 #define BRP_UsbHost_UsbhstErrNack BRP_ERR_STATUS(0x4400, 0x03)
30 #endif // BALTECH_SDK_INTERNAL
31 #ifdef BALTECH_SDK_INTERNAL
32 
35 #define BRP_UsbHost_UsbhstErrStall BRP_ERR_STATUS(0x4400, 0x04)
36 #endif // BALTECH_SDK_INTERNAL
37 #ifdef BALTECH_SDK_INTERNAL
38 
41 #define BRP_UsbHost_UsbhstErrTransfer BRP_ERR_STATUS(0x4400, 0x05)
42 #endif // BALTECH_SDK_INTERNAL
43 #ifdef BALTECH_SDK_INTERNAL
44 
47 #define BRP_UsbHost_UsbhstErrUnexpectedPkt BRP_ERR_STATUS(0x4400, 0x06)
48 #endif // BALTECH_SDK_INTERNAL
49 #ifdef BALTECH_SDK_INTERNAL
50 
53 #define BRP_UsbHost_UsbhstErrBufferoverflow BRP_ERR_STATUS(0x4400, 0x07)
54 #endif // BALTECH_SDK_INTERNAL
55 #ifdef BALTECH_SDK_INTERNAL
56 
59 #define BRP_UsbHost_UsbhstErrSetupPipes BRP_ERR_STATUS(0x4400, 0x20)
60 #endif // BALTECH_SDK_INTERNAL
61 #ifdef BALTECH_SDK_INTERNAL
62 typedef struct {
63  brp_protocol protocol;
64  bool Enable;
65 } brp_UsbHost_Enable_t;
73 #ifdef BRP_SUPPORT_LEGACY_METHODS
74 brp_errcode brp_UsbHost_Enable(brp_protocol protocol, bool _input_Enable);
75 #else
76 brp_errcode brp_UsbHost_Enable(brp_UsbHost_Enable_t params);
77 #endif
78 typedef struct {
79  brp_protocol protocol;
80  bool* Connected;
81 } brp_UsbHost_IsConnected_t;
89 #ifdef BRP_SUPPORT_LEGACY_METHODS
90 brp_errcode brp_UsbHost_IsConnected(brp_protocol protocol, bool* Connected);
91 #else
92 brp_errcode brp_UsbHost_IsConnected(brp_UsbHost_IsConnected_t params);
93 #endif
94 typedef struct {
95  brp_protocol protocol;
96  brp_UsbHost_SetupPipes_Pipes_Entry* Pipes;
97  size_t Pipes_len;
98 } brp_UsbHost_SetupPipes_t;
107 #ifdef BRP_SUPPORT_LEGACY_METHODS
108 brp_errcode brp_UsbHost_SetupPipes(brp_protocol protocol, brp_UsbHost_SetupPipes_Pipes_Entry* _input_Pipes, size_t _input_Pipes_len);
109 #else
110 brp_errcode brp_UsbHost_SetupPipes(brp_UsbHost_SetupPipes_t params);
111 #endif
112 typedef struct {
113  brp_protocol protocol;
114  unsigned Address;
115 } brp_UsbHost_SetAddr_t;
123 #ifdef BRP_SUPPORT_LEGACY_METHODS
124 brp_errcode brp_UsbHost_SetAddr(brp_protocol protocol, unsigned _input_Address);
125 #else
126 brp_errcode brp_UsbHost_SetAddr(brp_UsbHost_SetAddr_t params);
127 #endif
128 typedef struct {
129  brp_protocol protocol;
130 } brp_UsbHost_Reset_t;
137 #ifdef BRP_SUPPORT_LEGACY_METHODS
138 brp_errcode brp_UsbHost_Reset(brp_protocol protocol);
139 #else
140 brp_errcode brp_UsbHost_Reset(brp_UsbHost_Reset_t params);
141 #endif
142 typedef struct {
143  brp_protocol protocol;
144  brp_buf SetupData;
145  unsigned PipeNo;
146  unsigned Timeout;
147 } brp_UsbHost_TransRawSetup_t;
157 #ifdef BRP_SUPPORT_LEGACY_METHODS
158 brp_errcode brp_UsbHost_TransRawSetup(brp_protocol protocol, brp_buf _input_SetupData, unsigned _input_PipeNo, unsigned _input_Timeout);
159 #else
160 brp_errcode brp_UsbHost_TransRawSetup(brp_UsbHost_TransRawSetup_t params);
161 #endif
162 typedef struct {
163  brp_protocol protocol;
164  brp_buf SetupData;
165  unsigned PipeNo;
166  unsigned Timeout;
167  brp_buf* InData;
168  size_t* InData_len;
169  brp_mempool *mempool;
170 } brp_UsbHost_TransSetupIn_t;
183 #ifdef BRP_SUPPORT_LEGACY_METHODS
184 brp_errcode brp_UsbHost_TransSetupIn(brp_protocol protocol, brp_buf _input_SetupData, unsigned _input_PipeNo, unsigned _input_Timeout, brp_buf* InData, size_t* InData_len, brp_mempool *mempool);
185 #else
186 brp_errcode brp_UsbHost_TransSetupIn(brp_UsbHost_TransSetupIn_t params);
187 #endif
188 typedef struct {
189  brp_protocol protocol;
190  brp_buf SetupData;
191  brp_buf OutData;
192  size_t OutData_len;
193  unsigned PipeNo;
194  unsigned Timeout;
195 } brp_UsbHost_TransSetupOut_t;
207 #ifdef BRP_SUPPORT_LEGACY_METHODS
208 brp_errcode brp_UsbHost_TransSetupOut(brp_protocol protocol, brp_buf _input_SetupData, brp_buf _input_OutData, size_t _input_OutData_len, unsigned _input_PipeNo, unsigned _input_Timeout);
209 #else
210 brp_errcode brp_UsbHost_TransSetupOut(brp_UsbHost_TransSetupOut_t params);
211 #endif
212 typedef struct {
213  brp_protocol protocol;
214  unsigned PipeNo;
215  unsigned Timeout;
216  brp_buf* InData;
217  size_t* InData_len;
218  brp_mempool *mempool;
219 } brp_UsbHost_TransIn_t;
231 #ifdef BRP_SUPPORT_LEGACY_METHODS
232 brp_errcode brp_UsbHost_TransIn(brp_protocol protocol, unsigned _input_PipeNo, unsigned _input_Timeout, brp_buf* InData, size_t* InData_len, brp_mempool *mempool);
233 #else
234 brp_errcode brp_UsbHost_TransIn(brp_UsbHost_TransIn_t params);
235 #endif
236 typedef struct {
237  brp_protocol protocol;
238  brp_buf OutData;
239  size_t OutData_len;
240  unsigned PipeNo;
241  bool Continue;
242  unsigned Timeout;
243 } brp_UsbHost_TransOut_t;
255 #ifdef BRP_SUPPORT_LEGACY_METHODS
256 brp_errcode brp_UsbHost_TransOut(brp_protocol protocol, brp_buf _input_OutData, size_t _input_OutData_len, unsigned _input_PipeNo, bool _input_Continue, unsigned _input_Timeout);
257 #else
258 brp_errcode brp_UsbHost_TransOut(brp_UsbHost_TransOut_t params);
259 #endif
260 typedef struct {
261  brp_protocol protocol;
262 } brp_UsbHost_Suspend_t;
269 #ifdef BRP_SUPPORT_LEGACY_METHODS
270 brp_errcode brp_UsbHost_Suspend(brp_protocol protocol);
271 #else
272 brp_errcode brp_UsbHost_Suspend(brp_UsbHost_Suspend_t params);
273 #endif
274 typedef struct {
275  brp_protocol protocol;
276 } brp_UsbHost_Resume_t;
283 #ifdef BRP_SUPPORT_LEGACY_METHODS
284 brp_errcode brp_UsbHost_Resume(brp_protocol protocol);
285 #else
286 brp_errcode brp_UsbHost_Resume(brp_UsbHost_Resume_t params);
287 #endif
288 #endif // BALTECH_SDK_INTERNAL
289 #endif
290 
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
Definition: protocol.h:34
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:29
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61