Macros | |
#define | tokSETUP USB_HOST_PCFG_PTOKEN_SETUP |
#define | tokIN USB_HOST_PCFG_PTOKEN_IN |
#define | tokOUT USB_HOST_PCFG_PTOKEN_OUT |
#define | tokINHS USB_HOST_PCFG_PTOKEN_IN |
#define | tokOUTHS USB_HOST_PCFG_PTOKEN_OUT |
Énumérations | |
enum | uhd_vbus_state_t { UHD_STATE_NO_VBUS = 0, UHD_STATE_DISCONNECTED = 1, UHD_STATE_CONNECTED = 2, UHD_STATE_ERROR = 3 } |
Device speed. Plus de détails... | |
Fonctions | |
void | UHD_Init (void) |
void | UHD_Handler (void) |
Interrupt sub routine for USB Host state machine management. Plus de détails... | |
void | USB_SetHandler (void(*pf_isr)(void)) |
uhd_vbus_state_t | UHD_GetVBUSState (void) |
Get VBUS state. Plus de détails... | |
uint32_t | UHD_Pipe0_Alloc (uint32_t ul_add, uint32_t ul_ep_size) |
Allocate FIFO for pipe 0. Plus de détails... | |
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) |
Allocate a new pipe. Plus de détails... | |
void | UHD_Pipe_CountZero (uint32_t ul_pipe) |
void | UHD_Pipe_Free (uint32_t ul_pipe) |
Free a pipe. Plus de détails... | |
uint32_t | UHD_Pipe_Read (uint32_t ul_pipe, uint32_t ul_size, uint8_t *data) |
Read from a pipe. Plus de détails... | |
void | UHD_Pipe_Write (uint32_t ul_pipe, uint32_t ul_size, uint8_t *data) |
Write into a pipe. Plus de détails... | |
void | UHD_Pipe_Send (uint32_t ul_pipe, uint32_t ul_token_type) |
Send a pipe content. Plus de détails... | |
uint32_t | UHD_Pipe_Is_Transfer_Complete (uint32_t ul_pipe, uint32_t ul_token_type) |
Check for pipe transfer completion. Plus de détails... | |
#define tokIN USB_HOST_PCFG_PTOKEN_IN |
#define tokINHS USB_HOST_PCFG_PTOKEN_IN |
#define tokOUT USB_HOST_PCFG_PTOKEN_OUT |
#define tokOUTHS USB_HOST_PCFG_PTOKEN_OUT |
#define tokSETUP USB_HOST_PCFG_PTOKEN_SETUP |
enum uhd_vbus_state_t |
uhd_vbus_state_t UHD_GetVBUSState | ( | void | ) |
Get VBUS state.
void UHD_Handler | ( | void | ) |
Interrupt sub routine for USB Host state machine management.
void UHD_Init | ( | void | ) |
uint32_t UHD_Pipe0_Alloc | ( | uint32_t | ul_add, |
uint32_t | ul_ep_size | ||
) |
Allocate FIFO for pipe 0.
ul_add | Address of remote device for pipe 0. |
ul_ep_size | Actual size of the FIFO in bytes. |
0 | success. |
1 | error. |
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 | ||
) |
Allocate a new pipe.
ul_dev_addr | Address of remote device. |
ul_dev_ep | Targeted endpoint of remote device. |
ul_type | Pipe type. |
ul_dir | Pipe direction. |
ul_maxsize | Pipe size. |
ul_interval | Polling interval (if applicable to pipe type). |
ul_nb_bank | Number of banks associated with this pipe. |
void UHD_Pipe_CountZero | ( | uint32_t | ul_pipe | ) |
void UHD_Pipe_Free | ( | uint32_t | ul_pipe | ) |
Free a pipe.
ul_pipe | Pipe number to free. |
uint32_t UHD_Pipe_Is_Transfer_Complete | ( | uint32_t | ul_pipe, |
uint32_t | ul_token_type | ||
) |
Check for pipe transfer completion.
ul_pipe | Pipe number. |
ul_token_type | Token type. |
0 | transfer is not complete. |
1 | transfer is complete. |
uint32_t UHD_Pipe_Read | ( | uint32_t | pipe_num, |
uint32_t | buf_size, | ||
uint8_t * | buf | ||
) |
Read from a pipe.
ul_pipe | Pipe number. |
ul_size | Maximum number of data to read. |
data | Buffer to store the data. |
void UHD_Pipe_Send | ( | uint32_t | ul_pipe, |
uint32_t | ul_token_type | ||
) |
Send a pipe content.
ul_pipe | Pipe number. |
ul_token_type | Token type. |
void UHD_Pipe_Write | ( | uint32_t | ul_pipe, |
uint32_t | ul_size, | ||
uint8_t * | buf | ||
) |
Write into a pipe.
ul_pipe | Pipe number. |
ul_size | Maximum number of data to read. |
data | Buffer containing data to write. |
void USB_SetHandler | ( | void(*)(void) | pf_isr | ) |