HPM SDK
HPMicro Software Development Kit
USB driver APIs

USB driver APIs. More...

Data Structures

struct  usb_endpoint_config_t
 Endpoint config structure. More...
 

Macros

#define USB_PHY_INIT_DELAY_COUNT   (100U)
 
#define USB_HOST_FRAMELIST_SIZE   (8U)
 

Enumerations

enum  usb_dir_t { usb_dir_out = 0 , usb_dir_in = 1 , usb_dir_in_mask = 0x80 }
 USB transfer direction types. More...
 
enum  usb_xfer_type_t { usb_xfer_control = 0 , usb_xfer_isochronous , usb_xfer_bulk , usb_xfer_interrupt }
 USB transfer types. More...
 
enum  usb_controller_mode_t { usb_ctrl_mode_otg = 0 , usb_ctrl_mode_device = 2 , usb_ctrl_mode_host = 3 }
 USB controller work modes. More...
 
enum  usb_line_state_t { usb_line_state0 = 0 , usb_line_state1 = 1 , usb_line_state2 = 2 }
 USB line state. More...
 
enum  usb_transceiver_t { usb_tran_parallel = 0 , usb_tran_serial = 1 }
 USB transceiver. More...
 
enum  usb_test_mode_t {
  usb_test_mode_disable = 0 , usb_test_j_state , usb_test_k_state , usb_test_se0_nak ,
  usb_test_packet , usb_test_force_hs , usb_test_force_fs , usb_test_force_ls
}
 USB test modes. More...
 
enum  usb_vbus_wakeup_source_t { usb_vbus_wakeup_vbus_valid = 0 , usb_vbus_wakeup_session_valid }
 USB vbus wakeup source. More...
 

Functions

static uint32_t usb_get_interrupts (USB_Type *ptr)
 Get the mask of all enabled interrupts. More...
 
static void usb_enable_interrupts (USB_Type *ptr, uint32_t mask)
 Enable interrupts. More...
 
static void usb_disable_interrupts (USB_Type *ptr, uint32_t mask)
 Disable interrupts. More...
 
static uint32_t usb_get_status_flags (USB_Type *ptr)
 Get all USB status flags. More...
 
static void usb_clear_status_flags (USB_Type *ptr, uint32_t mask)
 Clear status flags. More...
 
static void usb_otg_enable_dpdm_wakeup (USB_Type *ptr)
 Enable otg dp/dm change wakeup. More...
 
static void usb_otg_disable_dpdm_wakeup (USB_Type *ptr)
 Disbable otg dp/dm change wakeup. More...
 
static void usb_otg_enable_id_wakeup (USB_Type *ptr)
 Enable otg id change wakeup. More...
 
static void usb_otg_disable_id_wakeup (USB_Type *ptr)
 Disbable otg id change wakeup. More...
 
static void usb_otg_enable_vbus_wakeup (USB_Type *ptr)
 Enable otg vbus change wakeup. More...
 
static void usb_otg_disable_vbus_wakeup (USB_Type *ptr)
 Disbable otg vbus change wakeup. More...
 
static void usb_otg_set_vbus_wakeup_source (USB_Type *ptr, usb_vbus_wakeup_source_t src)
 Set otg vbus wakeup source. More...
 
static void usb_otg_enable_wakeup_int (USB_Type *ptr)
 Enable otg wakeup interrupt. More...
 
static void usb_otg_disable_wakeup_int (USB_Type *ptr)
 Disable otg wakeup interrupt. More...
 
static bool usb_get_otg_wakeup_int_flag (USB_Type *ptr)
 Get otg wakeup status flags. More...
 
static uint8_t usb_get_suspend_status (USB_Type *ptr)
 Get USB suspend status. More...
 
static bool usb_get_port_reset_status (USB_Type *ptr)
 Get USB reset status. More...
 
static bool usb_get_port_ccs (USB_Type *ptr)
 Get USB current connect status. More...
 
static uint8_t usb_get_port_speed (USB_Type *ptr)
 Get USB port speed status. More...
 
static void usb_set_port_test_mode (USB_Type *ptr, usb_test_mode_t test_mode)
 Set port test control mode. More...
 
static void usb_set_port_suspend (USB_Type *ptr)
 USB set port suspend. More...
 
static void usb_force_port_resume (USB_Type *ptr)
 USB force port resume. More...
 
static void usb_phy_enter_low_power_suspend (USB_Type *ptr)
 USB phy enter low power suspend. More...
 
static void usb_phy_exit_low_power_suspend (USB_Type *ptr)
 USB phy exit low power suspend. More...
 
static bool usb_phy_get_session_valid_flag (USB_Type *ptr)
 Get phy session valid flag. More...
 
static void usb_otgsc_enable_session_valid_chg_int (USB_Type *ptr)
 enable otgsc session valid change interrupt More...
 
static void usb_otgsc_disable_session_valid_chg_int (USB_Type *ptr)
 disable otgsc session valid change interrupt More...
 
static bool usb_otgsc_session_valid_chg_int_is_enable (USB_Type *ptr)
 check otgsc session valid change interrupt is enable More...
 
static bool usb_otgsc_get_session_valid_chg_flag (USB_Type *ptr)
 get otgsc session valid change flag More...
 
static void usb_otgsc_clear_session_valid_chg_flag (USB_Type *ptr)
 clear otgsc session valid change flag More...
 
static bool usb_otgsc_get_session_valid_flag (USB_Type *ptr)
 Get otgsc session valid flag. More...
 
void usb_phy_init (USB_Type *ptr, bool host)
 Initialize USB phy. More...
 
static uint8_t usb_phy_get_line_state (USB_Type *ptr)
 USB phy get line status. More...
 
static void usb_phy_using_internal_vbus (USB_Type *ptr)
 USB phy using internal vbus. More...
 
static void usb_phy_using_external_vbus (USB_Type *ptr)
 USB phy using external vbus. More...
 
static void usb_phy_disable_dp_dm_pulldown (USB_Type *ptr)
 USB phy disconnect dp/dm pins pulldown resistance. More...
 
static void usb_phy_enable_dp_dm_pulldown (USB_Type *ptr)
 USB phy connect dp/dm pins pulldown resistance. More...
 
static void usb_phyctrl1_set_not_utmi_suspend (USB_Type *ptr)
 Set phyctrl1 not utmi suspend. More...
 
void usb_dcd_bus_reset (USB_Type *ptr, uint16_t ep0_max_packet_size)
 USB device bus reset. More...
 
void usb_dcd_init (USB_Type *ptr)
 Initialize controller to device mode. More...
 
void usb_dcd_deinit (USB_Type *ptr)
 Deinitialize controller to device. More...
 
void usb_dcd_remote_wakeup (USB_Type *ptr)
 Wakeup from host. More...
 
void usb_dcd_edpt_open (USB_Type *ptr, usb_endpoint_config_t *config)
 Open an endpoint. More...
 
uint8_t usb_dcd_edpt_get_type (USB_Type *ptr, uint8_t ep_addr)
 get a specified endpoint type More...
 
void usb_dcd_edpt_xfer (USB_Type *ptr, uint8_t ep_idx)
 Submit a transfer. More...
 
void usb_dcd_edpt_stall (USB_Type *ptr, uint8_t ep_addr)
 Stall endpoint. More...
 
void usb_dcd_edpt_clear_stall (USB_Type *ptr, uint8_t ep_addr)
 Clear stall. More...
 
bool usb_dcd_edpt_check_stall (USB_Type *ptr, uint8_t ep_addr)
 Clear stall. More...
 
void usb_dcd_edpt_close (USB_Type *ptr, uint8_t ep_addr)
 Close a specified endpoint. More...
 
void usb_dcd_connect (USB_Type *ptr)
 Connect by enabling internal pull-up resistor on D+/D-. More...
 
void usb_dcd_disconnect (USB_Type *ptr)
 Disconnect by disabling internal pull-up resistor on D+/D-. More...
 
static uint32_t usb_dcd_get_edpt_setup_status (USB_Type *ptr)
 Get setup status of endpoint. More...
 
static void usb_dcd_clear_edpt_setup_status (USB_Type *ptr, uint32_t mask)
 Clear the setup status of all specified endpoints. More...
 
static void usb_dcd_set_address (USB_Type *ptr, uint8_t dev_addr)
 Set address. More...
 
static void usb_dcd_set_edpt_list_addr (USB_Type *ptr, uint32_t addr)
 Set endpoint list address. More...
 
static uint8_t usb_dcd_get_device_addr (USB_Type *ptr)
 Get device address. More...
 
static uint32_t usb_dcd_get_edpt_complete_status (USB_Type *ptr)
 Get complete status of endpoint. More...
 
static void usb_dcd_clear_edpt_complete_status (USB_Type *ptr, uint32_t mask)
 Clear complete status of endpoint. More...
 
bool usb_hcd_init (USB_Type *ptr, uint32_t int_mask, uint16_t framelist_size)
 Initialize controller to host mode. More...
 
void usb_hcd_port_reset (USB_Type *ptr)
 Initialize controller to host modeHost Reset port. More...
 
static void usb_hcd_set_command (USB_Type *ptr, uint32_t mask)
 Initialize controller to host modeHost set command register. More...
 
static uint32_t usb_hcd_get_frame_index (USB_Type *ptr)
 Get frame index. More...
 
static bool usb_hcd_get_port_csc (USB_Type *ptr)
 Get port connect status change. More...
 
static void usb_hcd_set_power_ctrl_polarity (USB_Type *ptr, bool high)
 Set power ctrl polarity. More...
 
static void usb_hcd_enable_port_power (USB_Type *ptr)
 Enable port power. More...
 
static void usb_hcd_set_async_list_addr (USB_Type *ptr, uint32_t addr)
 Get port connect status changeSet async list address. More...
 
static void usb_hcd_set_periodic_list_addr (USB_Type *ptr, uint32_t addr)
 Set periodic list address. More...
 
static void usb_hcd_run (USB_Type *ptr)
 Start hcd controller. More...
 
static void usb_hcd_stop (USB_Type *ptr)
 Stop hcd controller. More...
 
static void usb_hcd_disable_ase_pse (USB_Type *ptr)
 Disable hcd controller Asynchronous Schedule and Periodic Schedule. More...
 
static void usb_hcd_enable_ase_pse (USB_Type *ptr)
 Enable hcd controller Asynchronous Schedule and Periodic Schedule. More...
 

Variables

 usb_control_request_t
 

Detailed Description

USB driver APIs.

Macro Definition Documentation

◆ USB_HOST_FRAMELIST_SIZE

#define USB_HOST_FRAMELIST_SIZE   (8U)

#include <drivers/inc/hpm_usb_drv.h>

a frame list size in USB host mode

◆ USB_PHY_INIT_DELAY_COUNT

#define USB_PHY_INIT_DELAY_COUNT   (100U)

#include <drivers/inc/hpm_usb_drv.h>

a delay count for USB phy initialization

Enumeration Type Documentation

◆ usb_controller_mode_t

#include <drivers/inc/hpm_usb_drv.h>

USB controller work modes.

Enumerator
usb_ctrl_mode_otg 
usb_ctrl_mode_device 
usb_ctrl_mode_host 

◆ usb_dir_t

enum usb_dir_t

#include <drivers/inc/hpm_usb_drv.h>

USB transfer direction types.

Enumerator
usb_dir_out 
usb_dir_in 
usb_dir_in_mask 

◆ usb_line_state_t

#include <drivers/inc/hpm_usb_drv.h>

USB line state.

Enumerator
usb_line_state0 
usb_line_state1 
usb_line_state2 

◆ usb_test_mode_t

#include <drivers/inc/hpm_usb_drv.h>

USB test modes.

Enumerator
usb_test_mode_disable 
usb_test_j_state 
usb_test_k_state 
usb_test_se0_nak 
usb_test_packet 
usb_test_force_hs 
usb_test_force_fs 
usb_test_force_ls 

◆ usb_transceiver_t

#include <drivers/inc/hpm_usb_drv.h>

USB transceiver.

Enumerator
usb_tran_parallel 
usb_tran_serial 

◆ usb_vbus_wakeup_source_t

#include <drivers/inc/hpm_usb_drv.h>

USB vbus wakeup source.

Enumerator
usb_vbus_wakeup_vbus_valid 
usb_vbus_wakeup_session_valid 

◆ usb_xfer_type_t

#include <drivers/inc/hpm_usb_drv.h>

USB transfer types.

Enumerator
usb_xfer_control 
usb_xfer_isochronous 
usb_xfer_bulk 
usb_xfer_interrupt 

Function Documentation

◆ usb_clear_status_flags()

static void usb_clear_status_flags ( USB_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Clear status flags.

Only the specified flags can be cleared by writing USBSTS register.

Parameters
[in]ptrA USB peripheral base address
[in]maskMask value for flags to be cleared.

◆ usb_dcd_bus_reset()

void usb_dcd_bus_reset ( USB_Type ptr,
uint16_t  ep0_max_packet_size 
)

#include <drivers/inc/hpm_usb_drv.h>

USB device bus reset.

Parameters
[in]ptrA USB peripheral base address
[in]ep0_max_packet_sizeThe maximum packet size of endpoint 0

◆ usb_dcd_clear_edpt_complete_status()

static void usb_dcd_clear_edpt_complete_status ( USB_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Clear complete status of endpoint.

Parameters
[in]ptrA USB peripheral base address
[in]maskA mask of the specified endpoints

◆ usb_dcd_clear_edpt_setup_status()

static void usb_dcd_clear_edpt_setup_status ( USB_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Clear the setup status of all specified endpoints.

Parameters
[in]ptrA USB peripheral base address
[in]maskA mask of all specified endpoints

◆ usb_dcd_connect()

void usb_dcd_connect ( USB_Type ptr)

#include <drivers/inc/hpm_usb_drv.h>

Connect by enabling internal pull-up resistor on D+/D-.

Parameters
[in]ptrA USB peripheral base address

◆ usb_dcd_deinit()

void usb_dcd_deinit ( USB_Type ptr)

#include <drivers/inc/hpm_usb_drv.h>

Deinitialize controller to device.

Parameters
[in]ptrA USB peripheral base address

◆ usb_dcd_disconnect()

void usb_dcd_disconnect ( USB_Type ptr)

#include <drivers/inc/hpm_usb_drv.h>

Disconnect by disabling internal pull-up resistor on D+/D-.

Parameters
[in]ptrA USB peripheral base address

◆ usb_dcd_edpt_check_stall()

bool usb_dcd_edpt_check_stall ( USB_Type ptr,
uint8_t  ep_addr 
)

#include <drivers/inc/hpm_usb_drv.h>

Clear stall.

Parameters
[in]ptrA USB peripheral base address
[in]ep_addrAn address of the specified endpoint
Return values
Thestatus of endpoint stall, true is stall, false is not stall

◆ usb_dcd_edpt_clear_stall()

void usb_dcd_edpt_clear_stall ( USB_Type ptr,
uint8_t  ep_addr 
)

#include <drivers/inc/hpm_usb_drv.h>

Clear stall.

Parameters
[in]ptrA USB peripheral base address
[in]ep_addrAn address of the specified endpoint

◆ usb_dcd_edpt_close()

void usb_dcd_edpt_close ( USB_Type ptr,
uint8_t  ep_addr 
)

#include <drivers/inc/hpm_usb_drv.h>

Close a specified endpoint.

Parameters
[in]ptrA USB peripheral base address
[in]ep_addrAn address of the specified endpoint

◆ usb_dcd_edpt_get_type()

uint8_t usb_dcd_edpt_get_type ( USB_Type ptr,
uint8_t  ep_addr 
)

#include <drivers/inc/hpm_usb_drv.h>

get a specified endpoint type

Parameters
[in]ptrA USB peripheral base address
[in]ep_addrEndpoint address

◆ usb_dcd_edpt_open()

void usb_dcd_edpt_open ( USB_Type ptr,
usb_endpoint_config_t config 
)

#include <drivers/inc/hpm_usb_drv.h>

Open an endpoint.

Parameters
[in]ptrA USB peripheral base address
[in]configA pointer to the specified endpoint config struct

◆ usb_dcd_edpt_stall()

void usb_dcd_edpt_stall ( USB_Type ptr,
uint8_t  ep_addr 
)

#include <drivers/inc/hpm_usb_drv.h>

Stall endpoint.

Parameters
[in]ptrA USB peripheral base address
[in]ep_addrAn address of the specified endpoint

◆ usb_dcd_edpt_xfer()

void usb_dcd_edpt_xfer ( USB_Type ptr,
uint8_t  ep_idx 
)

#include <drivers/inc/hpm_usb_drv.h>

Submit a transfer.

Parameters
[in]ptrA USB peripheral base address
[in]ep_idxAn index of the specified endpoint

◆ usb_dcd_get_device_addr()

static uint8_t usb_dcd_get_device_addr ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get device address.

Parameters
[in]ptrA USB peripheral base address
Return values
Theendpoint address

◆ usb_dcd_get_edpt_complete_status()

static uint32_t usb_dcd_get_edpt_complete_status ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get complete status of endpoint.

Parameters
[in]ptrA USB peripheral base address
Return values
Thecomplete status od endpoint

◆ usb_dcd_get_edpt_setup_status()

static uint32_t usb_dcd_get_edpt_setup_status ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get setup status of endpoint.

Parameters
[in]ptrA USB peripheral base address
Return values
Thestatus of setup endpoint

◆ usb_dcd_init()

void usb_dcd_init ( USB_Type ptr)

#include <drivers/inc/hpm_usb_drv.h>

Initialize controller to device mode.

Parameters
[in]ptrA USB peripheral base address

◆ usb_dcd_remote_wakeup()

void usb_dcd_remote_wakeup ( USB_Type ptr)

#include <drivers/inc/hpm_usb_drv.h>

Wakeup from host.

Parameters
[in]ptrA USB peripheral base address

◆ usb_dcd_set_address()

static void usb_dcd_set_address ( USB_Type ptr,
uint8_t  dev_addr 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set address.

Parameters
[in]ptrA USB peripheral base address
[in]dev_addrAn assigned endpoint address from USB host

◆ usb_dcd_set_edpt_list_addr()

static void usb_dcd_set_edpt_list_addr ( USB_Type ptr,
uint32_t  addr 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set endpoint list address.

Parameters
[in]ptrA USB peripheral base address
[in]addrA start address of the endpoint qtd list

◆ usb_disable_interrupts()

static void usb_disable_interrupts ( USB_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Disable interrupts.

Parameters
[in]ptrA USB peripheral base address
[in]maskMask value for interrupt events

◆ usb_enable_interrupts()

static void usb_enable_interrupts ( USB_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable interrupts.

Parameters
[in]ptrA USB peripheral base address
[in]maskMask value for interrupt events

◆ usb_force_port_resume()

static void usb_force_port_resume ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB force port resume.

Parameters
[in]ptrA USB peripheral base address

◆ usb_get_interrupts()

static uint32_t usb_get_interrupts ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get the mask of all enabled interrupts.

Parameters
[in]ptrA USB peripheral base address.
Return values
Maskof all enabled interrupts.

◆ usb_get_otg_wakeup_int_flag()

static bool usb_get_otg_wakeup_int_flag ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get otg wakeup status flags.

Parameters
[in]ptrA USB peripheral base address
Return values
TheUSB otg wakeup interrupt status flag

◆ usb_get_port_ccs()

static bool usb_get_port_ccs ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get USB current connect status.

Parameters
[in]ptrA USB peripheral base address
Return values
TheUSB controller reset status

◆ usb_get_port_reset_status()

static bool usb_get_port_reset_status ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get USB reset status.

Parameters
[in]ptrA USB peripheral base address
Return values
TheUSB controller reset status

◆ usb_get_port_speed()

static uint8_t usb_get_port_speed ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get USB port speed status.

Parameters
[in]ptrA USB peripheral base address
Return values
TheUSB controller port speed status

◆ usb_get_status_flags()

static uint32_t usb_get_status_flags ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get all USB status flags.

Parameters
[in]ptrA USB peripheral base address
Return values
TheUSB interrupt status flags

◆ usb_get_suspend_status()

static uint8_t usb_get_suspend_status ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get USB suspend status.

Parameters
[in]ptrA USB peripheral base address
Return values
TheUSB controller suspend status

◆ usb_hcd_disable_ase_pse()

static void usb_hcd_disable_ase_pse ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Disable hcd controller Asynchronous Schedule and Periodic Schedule.

Parameters
[in]ptrA USB peripheral base address

◆ usb_hcd_enable_ase_pse()

static void usb_hcd_enable_ase_pse ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable hcd controller Asynchronous Schedule and Periodic Schedule.

Parameters
[in]ptrA USB peripheral base address

◆ usb_hcd_enable_port_power()

static void usb_hcd_enable_port_power ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable port power.

Parameters
[in]ptrA USB peripheral base address

◆ usb_hcd_get_frame_index()

static uint32_t usb_hcd_get_frame_index ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get frame index.

Parameters
[in]ptrA USB peripheral base address
Return values
Aindex of the current frame list

◆ usb_hcd_get_port_csc()

static bool usb_hcd_get_port_csc ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get port connect status change.

Parameters
[in]ptrA USB peripheral base address
Return values
Aconnect status change

◆ usb_hcd_init()

bool usb_hcd_init ( USB_Type ptr,
uint32_t  int_mask,
uint16_t  framelist_size 
)

#include <drivers/inc/hpm_usb_drv.h>

Initialize controller to host mode.

Parameters
[in]ptrA USB peripheral base address
[in]int_maskA mask of all required interrupts
[in]framelist_sizeA size of the frame list

◆ usb_hcd_port_reset()

void usb_hcd_port_reset ( USB_Type ptr)

#include <drivers/inc/hpm_usb_drv.h>

Initialize controller to host modeHost Reset port.

Parameters
[in]ptrA USB peripheral base address

◆ usb_hcd_run()

static void usb_hcd_run ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Start hcd controller.

Parameters
[in]ptrA USB peripheral base address

◆ usb_hcd_set_async_list_addr()

static void usb_hcd_set_async_list_addr ( USB_Type ptr,
uint32_t  addr 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get port connect status changeSet async list address.

Parameters
[in]ptrA USB peripheral base address
[in]addrAn the start address of the async endpoint list

◆ usb_hcd_set_command()

static void usb_hcd_set_command ( USB_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Initialize controller to host modeHost set command register.

Parameters
[in]ptrA USB peripheral base address
[in]maskA mask of all required commands

◆ usb_hcd_set_periodic_list_addr()

static void usb_hcd_set_periodic_list_addr ( USB_Type ptr,
uint32_t  addr 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set periodic list address.

Parameters
[in]ptrA USB peripheral base address
[in]addrAn start address of the periodic endpoint list

◆ usb_hcd_set_power_ctrl_polarity()

static void usb_hcd_set_power_ctrl_polarity ( USB_Type ptr,
bool  high 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set power ctrl polarity.

Parameters
[in]ptrA USB peripheral base address
[in]hightrue - vbus high level enable, false - vbus low level enable

◆ usb_hcd_stop()

static void usb_hcd_stop ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Stop hcd controller.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_disable_dpdm_wakeup()

static void usb_otg_disable_dpdm_wakeup ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Disbable otg dp/dm change wakeup.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_disable_id_wakeup()

static void usb_otg_disable_id_wakeup ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Disbable otg id change wakeup.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_disable_vbus_wakeup()

static void usb_otg_disable_vbus_wakeup ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Disbable otg vbus change wakeup.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_disable_wakeup_int()

static void usb_otg_disable_wakeup_int ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Disable otg wakeup interrupt.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_enable_dpdm_wakeup()

static void usb_otg_enable_dpdm_wakeup ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable otg dp/dm change wakeup.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_enable_id_wakeup()

static void usb_otg_enable_id_wakeup ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable otg id change wakeup.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_enable_vbus_wakeup()

static void usb_otg_enable_vbus_wakeup ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable otg vbus change wakeup.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_enable_wakeup_int()

static void usb_otg_enable_wakeup_int ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Enable otg wakeup interrupt.

Parameters
[in]ptrA USB peripheral base address

◆ usb_otg_set_vbus_wakeup_source()

static void usb_otg_set_vbus_wakeup_source ( USB_Type ptr,
usb_vbus_wakeup_source_t  src 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set otg vbus wakeup source.

Parameters
[in]ptrA USB peripheral base address
[in]srcwakeup source, usb_vbus_wakeup_source_t

◆ usb_otgsc_clear_session_valid_chg_flag()

static void usb_otgsc_clear_session_valid_chg_flag ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

clear otgsc session valid change flag

Parameters
[in]ptrA USB peripheral base address

◆ usb_otgsc_disable_session_valid_chg_int()

static void usb_otgsc_disable_session_valid_chg_int ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

disable otgsc session valid change interrupt

Parameters
[in]ptrA USB peripheral base address

◆ usb_otgsc_enable_session_valid_chg_int()

static void usb_otgsc_enable_session_valid_chg_int ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

enable otgsc session valid change interrupt

Parameters
[in]ptrA USB peripheral base address

◆ usb_otgsc_get_session_valid_chg_flag()

static bool usb_otgsc_get_session_valid_chg_flag ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

get otgsc session valid change flag

Parameters
[in]ptrA USB peripheral base address
Return values
Theotgsc session valid flag

◆ usb_otgsc_get_session_valid_flag()

static bool usb_otgsc_get_session_valid_flag ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get otgsc session valid flag.

Parameters
[in]ptrA USB peripheral base address
Return values
Theotgsc session valid flag

◆ usb_otgsc_session_valid_chg_int_is_enable()

static bool usb_otgsc_session_valid_chg_int_is_enable ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

check otgsc session valid change interrupt is enable

Parameters
[in]ptrA USB peripheral base address
Return values
trueinterrupt is enable, false interrupt is disable

◆ usb_phy_disable_dp_dm_pulldown()

static void usb_phy_disable_dp_dm_pulldown ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy disconnect dp/dm pins pulldown resistance.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phy_enable_dp_dm_pulldown()

static void usb_phy_enable_dp_dm_pulldown ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy connect dp/dm pins pulldown resistance.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phy_enter_low_power_suspend()

static void usb_phy_enter_low_power_suspend ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy enter low power suspend.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phy_exit_low_power_suspend()

static void usb_phy_exit_low_power_suspend ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy exit low power suspend.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phy_get_line_state()

static uint8_t usb_phy_get_line_state ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy get line status.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phy_get_session_valid_flag()

static bool usb_phy_get_session_valid_flag ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Get phy session valid flag.

Parameters
[in]ptrA USB peripheral base address
Return values
Thephy session valid flag

◆ usb_phy_init()

void usb_phy_init ( USB_Type ptr,
bool  host 
)

#include <drivers/inc/hpm_usb_drv.h>

Initialize USB phy.

Parameters
[in]ptrA USB peripheral base address
[in]hosttrue is host, false is device

◆ usb_phy_using_external_vbus()

static void usb_phy_using_external_vbus ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy using external vbus.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phy_using_internal_vbus()

static void usb_phy_using_internal_vbus ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB phy using internal vbus.

Parameters
[in]ptrA USB peripheral base address

◆ usb_phyctrl1_set_not_utmi_suspend()

static void usb_phyctrl1_set_not_utmi_suspend ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set phyctrl1 not utmi suspend.

Parameters
[in]ptrA USB peripheral base address

◆ usb_set_port_suspend()

static void usb_set_port_suspend ( USB_Type ptr)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

USB set port suspend.

Parameters
[in]ptrA USB peripheral base address

◆ usb_set_port_test_mode()

static void usb_set_port_test_mode ( USB_Type ptr,
usb_test_mode_t  test_mode 
)
inlinestatic

#include <drivers/inc/hpm_usb_drv.h>

Set port test control mode.

Parameters
[in]ptrA USB peripheral base address
[in]test_modeusb test mode, usb_test_mode_t

Variable Documentation

◆ usb_control_request_t

usb_control_request_t