Header file containing functions prototypes of USB HAL library. More...
Go to the source code of this file.
Classes | |
struct | hw_enum_parm |
USB hardware enumeration Structure definition. More... | |
struct | _usb_init |
USB init Structure definition. More... | |
struct | _usb_handle |
USB handle Structure definition. More... | |
struct | _usb_callback |
HAL_USB Callback function definition. More... | |
Typedefs | |
typedef struct hw_enum_parm | hw_enum_parm_t |
USB hardware enumeration Structure definition. More... | |
typedef struct _usb_init | usb_init_t |
USB init Structure definition. More... | |
typedef struct _usb_handle | usb_handle_t |
USB handle Structure definition. More... | |
typedef struct _usb_callback | usb_callback_t |
HAL_USB Callback function definition. More... | |
Enumerations | |
enum | hal_usb_state_t { HAL_USB_STATE_RESET = 0x00, HAL_USB_STATE_READY = 0x01, HAL_USB_STATE_BUSY = 0x02, HAL_USB_STATE_BUSY_HOST_REST = 0x12, HAL_USB_STATE_BUSY_ADDR = 0x22, HAL_USB_STATE_BUSY_CFG = 0x32, HAL_USB_STATE_ERROR = 0x04, HAL_USB_STATE_ERROR_CRC16 = 0x14, HAL_USB_STATE_ERROR_UPID = 0x24, HAL_USB_STATE_ERROR_TIMEOUT = 0x34, HAL_USB_STATE_ERROR_SEQ = 0x44, HAL_USB_STATE_ERROR_PID_CKS = 0x54, HAL_USB_STATE_ERROR_PID_CRC = 0x64, HAL_USB_STATE_ERROR_DMA_RX = 0x74, HAL_USB_STATE_ERROR_NSE = 0x84, HAL_USB_STATE_ERROR_SYNC = 0x94, HAL_USB_STATE_ERROR_BIT_STUFF = 0xA4, HAL_USB_STATE_ERROR_BYTE = 0xB4, HAL_USB_STATE_ERROR_EP5_TIMER = 0xC4, HAL_USB_STATE_ABORT = 0x08, HAL_USB_STATE_SUSPEND = 0x10 } |
HAL USB State Enumerations definition. More... | |
enum | hal_usb_ep_t { HAL_USB_EP0 = 0x00, HAL_USB_EP1 = 0x01, HAL_USB_EP2 = 0x02, HAL_USB_EP3 = 0x03, HAL_USB_EP4 = 0x04, HAL_USB_EP5 = 0x05 } |
HAL USB EP. More... | |
Functions | |
hal_status_t | hal_usb_init (usb_handle_t *p_usb) |
Initialize the USB according to the specified parameters in the usb_init_t and initialize the associated handle. More... | |
hal_status_t | hal_usb_deinit (usb_handle_t *p_usb) |
De-initialize the USB peripheral. More... | |
void | hal_usb_msp_init (usb_handle_t *p_usb) |
Initialize the USB MSP. More... | |
void | hal_usb_msp_deinit (usb_handle_t *p_usb) |
De-initialize the USB MSP. More... | |
hal_status_t | hal_usb_reset (usb_handle_t *p_usb) |
usb modlue reset the basic configuration during host reset More... | |
uint8_t | hal_usb_get_connect_state (void) |
usb module gets whether the device is connected to the host. More... | |
hal_status_t | hal_usb_ep_write_start (usb_handle_t *p_usb, hal_usb_ep_t ep) |
usb ep start transmit data. More... | |
hal_status_t | hal_usb_ep_write_end (usb_handle_t *p_usb, hal_usb_ep_t ep) |
usbd inform host transmit data end. More... | |
hal_status_t | hal_usb_ep_read_start (usb_handle_t *p_usb, hal_usb_ep_t ep) |
usb ep start receive data. More... | |
hal_status_t | hal_usb_ep_read_end (usb_handle_t *p_usb, hal_usb_ep_t ep) |
usbd inform host receive data end. More... | |
hal_status_t | hal_usb_ep_transmit_dma (usb_handle_t *p_usb, hal_usb_ep_t ep, uint8_t *p_data, uint32_t length) |
Transmit an amount of data to USB endpoint in dma mode. More... | |
hal_status_t | hal_usb_ep_receive_dma (usb_handle_t *p_usb, hal_usb_ep_t ep, uint8_t *p_data, uint32_t length) |
Receive an amount of data to USB endpoint in dma mode. More... | |
hal_status_t | hal_usb_set_addr (usb_handle_t *p_usb, uint32_t addr) |
set USB devcice address. More... | |
uint32_t | hal_usb_get_addr (usb_handle_t *p_usb) |
get USB devcice address More... | |
hal_status_t | hal_usb_write_ep_fifo (usb_handle_t *p_usb, hal_usb_ep_t ep, uint32_t value, uint32_t ep4_wr_byte) |
write 32bit value to USB endpoit FIFO. More... | |
uint32_t | hal_usb_read_ep_fifo (usb_handle_t *p_usb, hal_usb_ep_t ep) |
read 32bit value from USB endpoit FIFO. More... | |
hal_status_t | hal_usb_set_ep_attr (usb_handle_t *p_usb, hal_usb_ep_t ep, uint32_t attr) |
set USB EP attribute. More... | |
uint32_t | hal_usb_get_ep_attr (usb_handle_t *p_usb, hal_usb_ep_t ep) |
get USB EP attribute setting. More... | |
hal_status_t | hal_usb_halt_ep (usb_handle_t *p_usb, hal_usb_ep_t ep) |
USB halt the endpoint. More... | |
hal_status_t | hal_usb_un_halt_ep (usb_handle_t *p_usb, hal_usb_ep_t ep) |
USB un halt the endpoint. More... | |
hal_status_t | hal_usb_set_and_unhalt_ep (usb_handle_t *p_usb, hal_usb_ep_t ep, uint32_t attr) |
USB un halt the endpoint and set the endpoint attribute. More... | |
uint32_t | hal_usb_get_ep0_rx_data_sum (usb_handle_t *p_usb) |
get USB EP0 received data sum. More... | |
uint32_t | hal_usb_get_it_flag (usb_handle_t *p_usb) |
get USB all interrupt status. More... | |
uint32_t | hal_usb_get_ep1_rx_data_sum (usb_handle_t *p_usb) |
get USB EP1 received data sum. More... | |
uint32_t | hal_usb_get_ep5_rx_data_sum (usb_handle_t *p_usb) |
get USB EP5 received data sum. More... | |
hal_status_t | hal_usb_set_cmd_ok (usb_handle_t *p_usb) |
send ok command to USB host(EP0). More... | |
hal_status_t | hal_usb_set_cmd_err (usb_handle_t *p_usb) |
send error command to USB host(EP0). More... | |
void | hal_usb_irq_handler (usb_handle_t *p_usb) |
Handle USB interrupt request. More... | |
void | hal_usb_attach_irq_handler (usb_handle_t *p_usb) |
Handle USB attach interrupt request. More... | |
void | hal_usb_detach_irq_handler (usb_handle_t *p_usb) |
Handle USB detach interrupt request. More... | |
void | hal_usb_attach_callback (usb_handle_t *p_usb) |
USB attach callback. More... | |
void | hal_usb_detach_callback (usb_handle_t *p_usb) |
USB detach callback. More... | |
void | hal_usb_suspend_callback (usb_handle_t *p_usb) |
usb suspend callback. More... | |
void | hal_usb_ep0_out_ready_callback (usb_handle_t *p_usb) |
usb EP0 output ready callback. More... | |
void | hal_usb_ep1_out_ready_callback (usb_handle_t *p_usb) |
usb EP1 output ready callback. More... | |
void | hal_usb_crc16_err_callback (usb_handle_t *p_usb) |
usb receive CRC error data callback. More... | |
void | hal_usb_upid_err_callback (usb_handle_t *p_usb) |
usb receive unsupported PID callback. More... | |
void | hal_usb_time_out_callback (usb_handle_t *p_usb) |
usb rx/tx timeout error callback. More... | |
void | hal_usb_seq_err_callback (usb_handle_t *p_usb) |
usb DATA0/DATA1 PID sequence error callback. More... | |
void | hal_usb_pid_cks_err_callback (usb_handle_t *p_usb) |
usb PID checksum error callback. More... | |
void | hal_usb_pid_crc_err_callback (usb_handle_t *p_usb) |
usb PID CRC error callback. More... | |
void | hal_usb_host_reset_callback (usb_handle_t *p_usb) |
usb host reset callback. More... | |
void | hal_usb_ahb_xfer_err_callback (usb_handle_t *p_usb) |
usb EP3 and EP4 AHB master receive ERROR response callback. More... | |
void | hal_usb_nse_err_callback (usb_handle_t *p_usb) |
usb no such endpoint error callback. More... | |
void | hal_usb_ep3_ahb_xfer_done_callback (usb_handle_t *p_usb) |
usb ep3 AHB master transfer done callback. More... | |
void | hal_usb_sync_err_callback (usb_handle_t *p_usb) |
usb SYNC error callback. More... | |
void | hal_usb_bit_stuff_err_callback (usb_handle_t *p_usb) |
usb bit stuff error callback. More... | |
void | hal_usb_byte_err_callback (usb_handle_t *p_usb) |
usb byte error callback. More... | |
void | hal_usb_sof_callback (usb_handle_t *p_usb) |
usb SOF interrupt callback. More... | |
void | hal_usb_ep0_tx_done_callback (usb_handle_t *p_usb) |
usb EP0 IN FIFO data has sent to host callback. More... | |
void | hal_usb_ep2_tx_done_callback (usb_handle_t *p_usb) |
usb EP2 IN FIFO data has sent to host callback. More... | |
void | hal_usb_ep3_tx_done_callback (usb_handle_t *p_usb) |
usb EP3 IN FIFO data has sent to host callback. More... | |
void | hal_usb_into_config_callback (usb_handle_t *p_usb) |
usb hardware enumeration into config status callback. More... | |
void | hal_usb_ep5_out_ready_callback (usb_handle_t *p_usb) |
usb EP5 output ready callback. More... | |
void | hal_usb_ep4_ahb_xfer_done_callback (usb_handle_t *p_usb) |
usb ep4 AHB master transfer done callback. More... | |
void | hal_usb_ep4_tx_done_callback (usb_handle_t *p_usb) |
usb EP4 IN FIFO data has sent to host callback. More... | |
void | hal_usb_ep5_ahb_xfer_done_callback (usb_handle_t *p_usb) |
usb ep5 AHB master transfer done callback. More... | |
void | hal_usb_ep5_timer_out_err_callback (usb_handle_t *p_usb) |
usb ep5 timer out error callback. More... | |
hal_usb_state_t | hal_usb_get_state (usb_handle_t *p_usb) |
Return the USB handle state. More... | |
uint32_t | hal_usb_get_error (usb_handle_t *p_usb) |
Return the USB error code. More... | |
hal_status_t | hal_usb_suspend_reg (usb_handle_t *p_usb) |
Suspend some registers related to USB configuration before sleep. More... | |
hal_status_t | hal_usb_resume_reg (usb_handle_t *p_usb) |
Restore some registers related to USB configuration after sleep. This function must be used in conjunction with the hal_usb_suspend_reg(). More... | |
Header file containing functions prototypes of USB HAL library.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file gr55xx_hal_usb.h.