30 #ifndef USB_HOST_H_INCLUDED 31 #define USB_HOST_H_INCLUDED 35 #define tokSETUP UOTGHS_HSTPIPCFG_PTOKEN_SETUP 36 #define tokIN UOTGHS_HSTPIPCFG_PTOKEN_IN 37 #define tokOUT UOTGHS_HSTPIPCFG_PTOKEN_OUT 38 #define tokINHS UOTGHS_HSTPIPCFG_PTOKEN_IN 39 #define tokOUTHS UOTGHS_HSTPIPCFG_PTOKEN_OUT 50 UHD_STATE_NO_VBUS = 0,
51 UHD_STATE_DISCONNECTED = 1,
52 UHD_STATE_CONNECTED = 2,
58 extern void UHD_SetStack(
void (*pf_isr)(
void));
59 extern void UHD_Init(
void);
60 extern void UHD_BusReset(
void);
61 extern uhd_vbus_state_t UHD_GetVBUSState(
void);
62 extern uint32_t UHD_Pipe0_Alloc(uint32_t ul_add, uint32_t ul_ep_size);
63 extern uint32_t UHD_Pipe_Alloc(uint32_t ul_dev_addr, uint32_t ul_dev_ep, uint32_t ul_type, uint32_t ul_dir, uint32_t ul_maxsize, uint32_t ul_interval, uint32_t ul_nb_bank);
64 extern void UHD_Pipe_Free(uint32_t ul_pipe);
65 extern uint32_t UHD_Pipe_Read(uint32_t ul_pipe, uint32_t ul_size, uint8_t* data);
66 extern void UHD_Pipe_Write(uint32_t ul_pipe, uint32_t ul_size, uint8_t* data);
67 extern void UHD_Pipe_Send(uint32_t ul_pipe, uint32_t ul_token_type);
68 extern uint32_t UHD_Pipe_Is_Transfer_Complete(uint32_t ul_pipe, uint32_t ul_token_type);