C API for BALTECH SDK
usbhost.h
Go to the documentation of this file.
1 
11 #ifndef __BRP_BALTECH_API_CMDS_USBHOST_H__
12 #define __BRP_BALTECH_API_CMDS_USBHOST_H__
13 #include "../typedefs.h"
17 #define BRP_UsbHost_UsbhstErrNotconnected BRP_ERR_STATUS(0x4400, 0x01)
18 
21 #define BRP_UsbHost_UsbhstErrTimeout BRP_ERR_STATUS(0x4400, 0x02)
22 
25 #define BRP_UsbHost_UsbhstErrNack BRP_ERR_STATUS(0x4400, 0x03)
26 
29 #define BRP_UsbHost_UsbhstErrStall BRP_ERR_STATUS(0x4400, 0x04)
30 
33 #define BRP_UsbHost_UsbhstErrTransfer BRP_ERR_STATUS(0x4400, 0x05)
34 
37 #define BRP_UsbHost_UsbhstErrUnexpectedPkt BRP_ERR_STATUS(0x4400, 0x06)
38 
41 #define BRP_UsbHost_UsbhstErrBufferoverflow BRP_ERR_STATUS(0x4400, 0x07)
42 
45 #define BRP_UsbHost_UsbhstErrSetupPipes BRP_ERR_STATUS(0x4400, 0x20)
46 
52 brp_errcode brp_UsbHost_Enable(brp_protocol protocol, bool Enable);
59 brp_errcode brp_UsbHost_IsConnected(brp_protocol protocol, bool* Connected);
74 brp_errcode brp_UsbHost_SetAddr(brp_protocol protocol, unsigned Address);
92 brp_errcode brp_UsbHost_TransRawSetup(brp_protocol protocol, brp_buf SetupData, unsigned PipeNo, unsigned Timeout);
104 brp_errcode brp_UsbHost_TransSetupIn(brp_protocol protocol, brp_buf SetupData, unsigned PipeNo, unsigned Timeout, brp_buf* InData, size_t* InData_len, brp_mempool *mempool);
115 brp_errcode brp_UsbHost_TransSetupOut(brp_protocol protocol, brp_buf SetupData, brp_buf OutData, size_t OutData_len, unsigned PipeNo, unsigned Timeout);
126 brp_errcode brp_UsbHost_TransIn(brp_protocol protocol, unsigned PipeNo, unsigned Timeout, brp_buf* InData, size_t* InData_len, brp_mempool *mempool);
137 brp_errcode brp_UsbHost_TransOut(brp_protocol protocol, brp_buf OutData, size_t OutData_len, unsigned PipeNo, bool Continue, unsigned Timeout);
150 #endif
151 
brp_errcode brp_UsbHost_Suspend(brp_protocol protocol)
Send a Suspend via USB interface.
brp_errcode brp_UsbHost_TransSetupOut(brp_protocol protocol, brp_buf SetupData, brp_buf OutData, size_t OutData_len, unsigned PipeNo, unsigned Timeout)
Transfers a SETUP transaction with a OUT DATA stage.
brp_errcode brp_UsbHost_TransOut(brp_protocol protocol, brp_buf OutData, size_t OutData_len, unsigned PipeNo, bool Continue, unsigned Timeout)
Transfers an OUT transaction.
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
brp_errcode brp_UsbHost_IsConnected(brp_protocol protocol, bool *Connected)
Check if a device is connected.
brp_errcode brp_UsbHost_SetAddr(brp_protocol protocol, unsigned Address)
Set Address of device.
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:27
brp_errcode brp_UsbHost_SetupPipes(brp_protocol protocol, brp_UsbHost_SetupPipes_Pipes_Entry *Pipes, size_t Pipes_len)
Setup all Pipes Definitions (uC's internal configuration).
brp_errcode brp_UsbHost_TransRawSetup(brp_protocol protocol, brp_buf SetupData, unsigned PipeNo, unsigned Timeout)
Transfers a raw SETUP packet.
brp_errcode brp_UsbHost_TransIn(brp_protocol protocol, unsigned PipeNo, unsigned Timeout, brp_buf *InData, size_t *InData_len, brp_mempool *mempool)
Transfers an IN transaction.
Definition: typedefs.h:2438
brp_errcode brp_UsbHost_TransSetupIn(brp_protocol protocol, brp_buf SetupData, unsigned PipeNo, unsigned Timeout, brp_buf *InData, size_t *InData_len, brp_mempool *mempool)
Transfers a SETUP transaction with a IN DATA stage.
brp_errcode brp_UsbHost_Resume(brp_protocol protocol)
Send a Resume via USB interface.
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61
brp_errcode brp_UsbHost_Reset(brp_protocol protocol)
Send a Reset via USB interface, Remove all Pipes Definitions and reset address of device to 0...
brp_errcode brp_UsbHost_Enable(brp_protocol protocol, bool Enable)
Enable/Disable the USB-Host-Interface of the uC.