| NUC472_NUC442_BSP V3.04.000 The Board Support Package for NUC472/NUC442

lw_usbh.h
Go to the documentation of this file.
1
2#ifndef _LW_USBH_H_
3#define _LW_USBH_H_
4
5#ifdef __cplusplus
6extern "C"
7{
8#endif
9
23#define USBH_INTR_BUFF_SIZE 256
26
27extern uint8_t _transfer_buffer[USBH_INTR_BUFF_SIZE];
28
30
31
32
33/*---------------------------------------------------------------------------------------------------------*/
34/* Return Code */
35/*---------------------------------------------------------------------------------------------------------*/
36#define USBH_RET_NO_ERR 0
37#define USBH_RET_ERR_PARM -1
38#define USBH_RET_INIT -2
39#define USBH_RET_NO_DEVICE -11
40#define USBH_RET_DEV_CONN_KEEP -12
41#define USBH_RET_DEV_REMOVED -13
42#define USBH_RET_XFER_TIMEOUT -21
43#define USBH_RET_STALL -22
44#define USBH_RET_XFER_ERR -23
45#define USBH_RET_UNSUPPORT -31
46#define USBH_RET_DEV_NOT_READY -35
47#define USBH_RET_ERR_CLASS_CMD -41
48#define USBH_RET_ERR_DEV_INIT -42
49#define USBH_RET_ERR_PORT_RST -101
50#define USBH_RET_ERR_PORT_ENABLE -102 /* end of group NUC472_442_LWHCD_EXPORTED_CONSTANTS */
53
54
58int usbh_init(void);
59int usbh_probe_port(uint32_t port);
60int usbh_get_device_descriptor(uint8_t *desc_buff);
61int get_config_descriptor(uint8_t *desc_buff);
62int usbh_set_configuration(int conf_val);
63int usbh_clear_halt(uint16_t ep_addr);
64int usbh_drv_ctrl_req(uint8_t requesttype, uint8_t request, uint16_t value, uint16_t index, uint16_t length, int data_len, uint8_t *buffer, int dir);
65int usbh_drv_bulk_xfer(uint16_t ep_addr, uint8_t *toggle, uint8_t *data_buff, int data_len, int timeout);
66
67 /* end of group NUC472_442_LWHCD_EXPORTED_FUNCTIONS */
69 /* end of group NUC472_442_LWHCD_Driver */
71 /* end of group NUC472_442_Device_Driver */
73
74/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
75
76
77
78#endif /* _LW_USBH_H_ */
USBH_INTR_BUFF_SIZE
#define USBH_INTR_BUFF_SIZE
Definition: lw_usbh.h:23
usbh_init
int usbh_init(void)
Initialized USB host controller driver.
Definition: lw_usbh.c:767
usbh_probe_port
int usbh_probe_port(uint32_t port)
Probe USB root-hub port connect/disconnect status. A newly connected device will be initialized in th...
Definition: lw_usbh.c:590
usbh_set_configuration
int usbh_set_configuration(int conf_val)
Issue a standard request SET_CONFIGURATION to USB device.
Definition: lw_usbh.c:528
usbh_drv_ctrl_req
int usbh_drv_ctrl_req(uint8_t requesttype, uint8_t request, uint16_t value, uint16_t index, uint16_t length, int data_len, uint8_t *buffer, int dir)
Execute a control transfer request.
Definition: lw_usbh.c:305
usbh_get_device_descriptor
int usbh_get_device_descriptor(uint8_t *desc_buff)
Get device descriptor from the USB device.
Definition: lw_usbh.c:456
usbh_clear_halt
int usbh_clear_halt(uint16_t ep_addr)
Issue a standard request SET_FEATURE to clear USB device endpoint halt state.
Definition: lw_usbh.c:542
usbh_drv_bulk_xfer
int usbh_drv_bulk_xfer(uint16_t ep_addr, uint8_t *toggle, uint8_t *data_buff, int data_len, int timeout)
Execute a control transfer request.
Definition: lw_usbh.c:389
get_config_descriptor
int get_config_descriptor(uint8_t *desc_buff)
Get configuration descriptor from the USB device.
Definition: lw_usbh.c:493
value
return value
Definition: semihosting.h:98