USBC low-level driver for USB host mode.
USBC Host IP properties | |
These macros give access to IP properties Get maximal number of endpoints | |
#define | uhd_get_pipe_max_nbr() |
Host Vbus line control | |
VBOF is an optional output pin which allows to enable or disable the external VBus generator. Enables hardware control of USB_VBOF output pin when a Vbus error occur | |
#define | uhd_enable_vbus_error_hw_control() USBC_CLR_BITS(USBCON,VBUSHWC) |
#define | uhd_disable_vbus_error_hw_control() USBC_SET_BITS(USBCON,VBUSHWC) |
Disables hardware control of USB_VBOF output pin when a Vbus error occur. More... | |
#define | USB_VBOF_PIN ATPASTE2(USB_VBOF, _PIN) |
Pin and function for USB_VBOF according to configuration from USB_VBOF. More... | |
#define | USB_VBOF_FUNCTION ATPASTE2(USB_VBOF, _FUNCTION) |
#define | uhd_output_vbof_pin() |
Output USB_VBOF onto its pin. More... | |
#define | uhd_set_vbof_active_high() USBC_CLR_BITS(USBCON,VBUSPO) |
Set USB_VBOF output pin polarity. More... | |
#define | uhd_set_vbof_active_low() USBC_SET_BITS(USBCON,VBUSPO) |
#define | uhd_enable_vbus() USBC_REG_SET(USBSTA,VBUSRQ) |
Requests VBus activation. More... | |
#define | uhd_disable_vbus() USBC_REG_CLR(USBSTA,VBUSRQ) |
Requests VBus deactivation. More... | |
#define | Is_uhd_vbus_enabled() USBC_TST_BITS(USBSTA,VBUSRQ) |
Tests if VBus activation has been requested. More... | |
Host Vbus line monitoring | |
#define | uhd_enable_vbus_error_interrupt() USBC_SET_BITS(USBCON,VBERRE) |
#define | uhd_disable_vbus_error_interrupt() USBC_CLR_BITS(USBCON,VBERRE) |
#define | Is_uhd_vbus_error_interrupt_enabled() USBC_TST_BITS(USBCON,VBERRE) |
#define | uhd_ack_vbus_error_interrupt() USBC_REG_CLR(USBSTA,VBERRI) |
#define | Is_uhd_vbus_error_interrupt() USBC_TST_BITS(USBSTA,VBERRI) |
USB device connection/disconnection monitoring | |
#define | uhd_enable_connection_int() USBC_REG_SET(UHINTE,DCONNIE) |
#define | uhd_disable_connection_int() USBC_REG_CLR(UHINTE,DCONNIE) |
#define | Is_uhd_connection_int_enabled() USBC_TST_BITS(UHINTE,DCONNIE) |
#define | uhd_ack_connection() USBC_REG_CLR(UHINT,DCONNI) |
#define | Is_uhd_connection() USBC_TST_BITS(UHINT,DCONNI) |
#define | uhd_enable_disconnection_int() USBC_REG_SET(UHINTE,DDISCIE) |
#define | uhd_disable_disconnection_int() USBC_REG_CLR(UHINTE,DDISCIE) |
#define | Is_uhd_disconnection_int_enabled() USBC_TST_BITS(UHINTE,DDISCIE) |
#define | uhd_ack_disconnection() USBC_REG_CLR(UHINT,DDISCI) |
#define | Is_uhd_disconnection() USBC_TST_BITS(UHINT,DDISCI) |
USB device speed control | |
#define | uhd_get_speed_mode() USBC_RD_BITFIELD(USBSTA,SPEED) |
#define | Is_uhd_low_speed_mode() (USBC_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBC_USBSTA_SPEED_LOW) |
#define | Is_uhd_full_speed_mode() (USBC_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBC_USBSTA_SPEED_FULL) |
#define | Is_uhd_high_speed_mode() false |
#define Is_uhd_connection | ( | ) | USBC_TST_BITS(UHINT,DCONNI) |
Referenced by uhd_interrupt().
#define Is_uhd_connection_int_enabled | ( | ) | USBC_TST_BITS(UHINTE,DCONNIE) |
Referenced by uhd_interrupt().
#define Is_uhd_disconnection | ( | ) | USBC_TST_BITS(UHINT,DDISCI) |
Referenced by uhd_interrupt(), and uhd_sof_interrupt().
#define Is_uhd_disconnection_int_enabled | ( | ) | USBC_TST_BITS(UHINTE,DDISCIE) |
Referenced by uhd_interrupt().
#define Is_uhd_downstream_resume | ( | ) | USBC_TST_BITS(UHINT,RSMEDI) |
Referenced by uhd_interrupt().
#define Is_uhd_downstream_resume_interrupt_enabled | ( | ) | USBC_TST_BITS(UHINTE,RSMEDIE) |
#define Is_uhd_full_speed_mode | ( | ) | (USBC_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBC_USBSTA_SPEED_FULL) |
#define Is_uhd_high_speed_mode | ( | ) | false |
Referenced by uhd_interrupt().
#define Is_uhd_low_speed_mode | ( | ) | (USBC_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBC_USBSTA_SPEED_LOW) |
Referenced by uhd_sof_interrupt().
#define Is_uhd_reset_sent | ( | ) | USBC_TST_BITS(UHINT,RSTI) |
Referenced by uhd_interrupt().
#define Is_uhd_reset_sent_interrupt_enabled | ( | ) | USBC_TST_BITS(UHINTE,RSTIE) |
#define Is_uhd_sending_resume | ( | ) | USBC_TST_BITS(UHCON,RESUME) |
#define Is_uhd_sof | ( | ) | USBC_TST_BITS(UHINT,HSOFI) |
Referenced by uhd_interrupt().
#define Is_uhd_sof_enabled | ( | ) | USBC_TST_BITS(UHCON,SOFE) |
Referenced by uhd_is_suspend(), and uhd_resume().
#define Is_uhd_sof_interrupt_enabled | ( | ) | USBC_TST_BITS(UHINTE,HSOFIE) |
#define Is_uhd_starting_reset | ( | ) | USBC_TST_BITS(UHCON,RESET) |
#define Is_uhd_upstream_resume | ( | ) | USBC_TST_BITS(UHINT,RXRSMI) |
Referenced by uhd_interrupt().
#define Is_uhd_upstream_resume_interrupt_enabled | ( | ) | USBC_TST_BITS(UHINTE,RXRSMIE) |
#define Is_uhd_vbus_enabled | ( | ) | USBC_TST_BITS(USBSTA,VBUSRQ) |
Tests if VBus activation has been requested.
#define Is_uhd_vbus_error_interrupt | ( | ) | USBC_TST_BITS(USBSTA,VBERRI) |
Referenced by uhd_interrupt().
#define Is_uhd_vbus_error_interrupt_enabled | ( | ) | USBC_TST_BITS(USBCON,VBERRE) |
#define Is_uhd_wakeup | ( | ) | USBC_TST_BITS(UHINT,HWUPI) |
Referenced by uhd_interrupt().
#define Is_uhd_wakeup_interrupt_enabled | ( | ) | USBC_TST_BITS(UHINTE,HWUPIE) |
Referenced by uhd_interrupt().
#define uhd_ack_connection | ( | ) | USBC_REG_CLR(UHINT,DCONNI) |
Referenced by uhd_interrupt().
#define uhd_ack_disconnection | ( | ) | USBC_REG_CLR(UHINT,DDISCI) |
Referenced by uhd_interrupt().
#define uhd_ack_downstream_resume | ( | ) | USBC_REG_CLR(UHINT,RSMEDI) |
#define uhd_ack_reset_sent | ( | ) | USBC_REG_CLR(UHINT,RSTI) |
Referenced by uhd_interrupt().
#define uhd_ack_sof | ( | ) | USBC_REG_CLR(UHINT,HSOFI) |
Referenced by uhd_interrupt().
#define uhd_ack_upstream_resume | ( | ) | USBC_REG_CLR(UHINT,RXRSMI) |
#define uhd_ack_vbus_error_interrupt | ( | ) | USBC_REG_CLR(USBSTA,VBERRI) |
Referenced by uhd_interrupt().
#define uhd_ack_wakeup | ( | ) | USBC_REG_CLR(UHINT,HWUPI) |
#define uhd_disable_connection_int | ( | ) | USBC_REG_CLR(UHINTE,DCONNIE) |
Referenced by uhd_interrupt().
#define uhd_disable_disconnection_int | ( | ) | USBC_REG_CLR(UHINTE,DDISCIE) |
Referenced by uhd_interrupt().
#define uhd_disable_downstream_resume_interrupt | ( | ) | USBC_REG_CLR(UHINTE,RSMEDIE) |
#define uhd_disable_reset_sent_interrupt | ( | ) | USBC_REG_CLR(UHINTE,RSTIE) |
#define uhd_disable_sof | ( | ) | USBC_CLR_BITS(UHCON,SOFE) |
Referenced by uhd_disable(), and uhd_sof_interrupt().
#define uhd_disable_sof_interrupt | ( | ) | USBC_REG_CLR(UHINTE,HSOFIE) |
#define uhd_disable_upstream_resume_interrupt | ( | ) | USBC_REG_CLR(UHINTE,RXRSMIE) |
#define uhd_disable_vbus | ( | ) | USBC_REG_CLR(USBSTA,VBUSRQ) |
Requests VBus deactivation.
Referenced by uhd_disable().
#define uhd_disable_vbus_error_hw_control | ( | ) | USBC_SET_BITS(USBCON,VBUSHWC) |
Disables hardware control of USB_VBOF output pin when a Vbus error occur.
#define uhd_disable_vbus_error_interrupt | ( | ) | USBC_CLR_BITS(USBCON,VBERRE) |
#define uhd_disable_wakeup_interrupt | ( | ) | USBC_REG_CLR(UHINTE,HWUPIE) |
#define uhd_enable_connection_int | ( | ) | USBC_REG_SET(UHINTE,DCONNIE) |
Referenced by uhd_interrupt().
#define uhd_enable_disconnection_int | ( | ) | USBC_REG_SET(UHINTE,DDISCIE) |
Referenced by uhd_interrupt().
#define uhd_enable_downstream_resume_interrupt | ( | ) | USBC_REG_SET(UHINTE,RSMEDIE) |
#define uhd_enable_reset_sent_interrupt | ( | ) | USBC_REG_SET(UHINTE,RSTIE) |
#define uhd_enable_sof | ( | ) | USBC_SET_BITS(UHCON,SOFE) |
Initiates a SOF events.
Referenced by uhd_interrupt(), and uhd_resume().
#define uhd_enable_sof_interrupt | ( | ) | USBC_REG_SET(UHINTE,HSOFIE) |
#define uhd_enable_upstream_resume_interrupt | ( | ) | USBC_REG_SET(UHINTE,RXRSMIE) |
#define uhd_enable_vbus | ( | ) | USBC_REG_SET(USBSTA,VBUSRQ) |
Requests VBus activation.
Referenced by uhd_enable(), and uhd_interrupt().
#define uhd_enable_vbus_error_hw_control | ( | ) | USBC_CLR_BITS(USBCON,VBUSHWC) |
#define uhd_enable_vbus_error_interrupt | ( | ) | USBC_SET_BITS(USBCON,VBERRE) |
#define uhd_enable_wakeup_interrupt | ( | ) | USBC_REG_SET(UHINTE,HWUPIE) |
Detection of a wake-up event A wake-up event is received when the host controller is in the suspend mode:
#define uhd_get_frame_position | ( | ) | USBC_RD_BITFIELD(UHFNUM,FLENHIGH) |
Referenced by uhd_sof_interrupt().
#define uhd_get_microsof_number | ( | ) |
Referenced by uhd_get_microframe_number().
#define uhd_get_pipe_max_nbr | ( | ) |
#define uhd_get_sof_number | ( | ) | USBC_RD_BITFIELD(UHFNUM,FNUM) |
Referenced by uhd_get_frame_number().
#define uhd_get_speed_mode | ( | ) | USBC_RD_BITFIELD(USBSTA,SPEED) |
Referenced by uhd_get_speed().
#define uhd_output_vbof_pin | ( | ) |
Output USB_VBOF onto its pin.
Referenced by uhd_enable().
#define uhd_send_resume | ( | ) | USBC_SET_BITS(UHCON,RESUME) |
Initiates a resume event It is called downstream resume event.
Referenced by uhd_interrupt(), and uhd_resume().
#define uhd_set_vbof_active_high | ( | ) | USBC_CLR_BITS(USBCON,VBUSPO) |
Set USB_VBOF output pin polarity.
Referenced by uhd_enable().
#define uhd_set_vbof_active_low | ( | ) | USBC_SET_BITS(USBCON,VBUSPO) |
Referenced by uhd_enable().
#define uhd_start_reset | ( | ) | USBC_SET_BITS(UHCON,RESET) |
Initiates a reset event.
Referenced by uhd_send_reset().
#define uhd_stop_reset | ( | ) | USBC_CLR_BITS(UHCON,RESET) |
Referenced by uhd_interrupt().
#define USB_VBOF_FUNCTION ATPASTE2(USB_VBOF, _FUNCTION) |
#define USB_VBOF_PIN ATPASTE2(USB_VBOF, _PIN) |
Pin and function for USB_VBOF according to configuration from USB_VBOF.