USBB low-level driver for USB host mode.
USBB 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() USBB_CLR_BITS(USBCON,VBUSHWC) |
#define | uhd_disable_vbus_error_hw_control() USBB_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() USBB_CLR_BITS(USBCON,VBUSPO) |
Set USB_VBOF output pin polarity. More... | |
#define | uhd_set_vbof_active_low() USBB_SET_BITS(USBCON,VBUSPO) |
#define | uhd_enable_vbus() USBB_REG_SET(USBSTA,VBUSRQ) |
Requests VBus activation. More... | |
#define | uhd_disable_vbus() USBB_REG_CLR(USBSTA,VBUSRQ) |
Requests VBus deactivation. More... | |
#define | Is_uhd_vbus_enabled() USBB_TST_BITS(USBSTA,VBUSRQ) |
Tests if VBus activation has been requested. More... | |
Host Vbus line monitoring | |
#define | uhd_enable_vbus_error_interrupt() USBB_SET_BITS(USBCON,VBERRE) |
#define | uhd_disable_vbus_error_interrupt() USBB_CLR_BITS(USBCON,VBERRE) |
#define | Is_uhd_vbus_error_interrupt_enabled() USBB_TST_BITS(USBCON,VBERRE) |
#define | uhd_ack_vbus_error_interrupt() USBB_REG_CLR(USBSTA,VBERRI) |
#define | Is_uhd_vbus_error_interrupt() USBB_TST_BITS(USBSTA,VBERRI) |
USB device connection/disconnection monitoring | |
#define | uhd_enable_connection_int() USBB_REG_SET(UHINTE,DCONNIE) |
#define | uhd_disable_connection_int() USBB_REG_CLR(UHINTE,DCONNIE) |
#define | Is_uhd_connection_int_enabled() USBB_TST_BITS(UHINTE,DCONNIE) |
#define | uhd_ack_connection() USBB_REG_CLR(UHINT,DCONNI) |
#define | Is_uhd_connection() USBB_TST_BITS(UHINT,DCONNI) |
#define | uhd_enable_disconnection_int() USBB_REG_SET(UHINTE,DDISCIE) |
#define | uhd_disable_disconnection_int() USBB_REG_CLR(UHINTE,DDISCIE) |
#define | Is_uhd_disconnection_int_enabled() USBB_TST_BITS(UHINTE,DDISCIE) |
#define | uhd_ack_disconnection() USBB_REG_CLR(UHINT,DDISCI) |
#define | Is_uhd_disconnection() USBB_TST_BITS(UHINT,DDISCI) |
USB device speed control | |
#define | uhd_get_speed_mode() USBB_RD_BITFIELD(USBSTA,SPEED) |
#define | Is_uhd_low_speed_mode() (USBB_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBB_USBSTA_SPEED_LOW) |
#define | Is_uhd_full_speed_mode() (USBB_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBB_USBSTA_SPEED_FULL) |
#define | Is_uhd_high_speed_mode() false |
#define Is_uhd_connection | ( | ) | USBB_TST_BITS(UHINT,DCONNI) |
#define Is_uhd_connection_int_enabled | ( | ) | USBB_TST_BITS(UHINTE,DCONNIE) |
#define Is_uhd_disconnection | ( | ) | USBB_TST_BITS(UHINT,DDISCI) |
#define Is_uhd_disconnection_int_enabled | ( | ) | USBB_TST_BITS(UHINTE,DDISCIE) |
#define Is_uhd_downstream_resume | ( | ) | USBB_TST_BITS(UHINT,RSMEDI) |
#define Is_uhd_downstream_resume_interrupt_enabled | ( | ) | USBB_TST_BITS(UHINTE,RSMEDIE) |
#define Is_uhd_full_speed_mode | ( | ) | (USBB_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBB_USBSTA_SPEED_FULL) |
#define Is_uhd_high_speed_mode | ( | ) | false |
#define Is_uhd_low_speed_mode | ( | ) | (USBB_RD_BITFIELD(USBSTA,SPEED) == AVR32_USBB_USBSTA_SPEED_LOW) |
#define Is_uhd_reset_sent | ( | ) | USBB_TST_BITS(UHINT,RSTI) |
#define Is_uhd_reset_sent_interrupt_enabled | ( | ) | USBB_TST_BITS(UHINTE,RSTIE) |
#define Is_uhd_sending_resume | ( | ) | USBB_TST_BITS(UHCON,RESUME) |
#define Is_uhd_sof | ( | ) | USBB_TST_BITS(UHINT,HSOFI) |
#define Is_uhd_sof_enabled | ( | ) | USBB_TST_BITS(UHCON,SOFE) |
#define Is_uhd_sof_interrupt_enabled | ( | ) | USBB_TST_BITS(UHINTE,HSOFIE) |
#define Is_uhd_starting_reset | ( | ) | USBB_TST_BITS(UHCON,RESET) |
#define Is_uhd_upstream_resume | ( | ) | USBB_TST_BITS(UHINT,RXRSMI) |
#define Is_uhd_upstream_resume_interrupt_enabled | ( | ) | USBB_TST_BITS(UHINTE,RXRSMIE) |
#define Is_uhd_vbus_enabled | ( | ) | USBB_TST_BITS(USBSTA,VBUSRQ) |
Tests if VBus activation has been requested.
#define Is_uhd_vbus_error_interrupt | ( | ) | USBB_TST_BITS(USBSTA,VBERRI) |
#define Is_uhd_vbus_error_interrupt_enabled | ( | ) | USBB_TST_BITS(USBCON,VBERRE) |
#define Is_uhd_wakeup | ( | ) | USBB_TST_BITS(UHINT,HWUPI) |
#define Is_uhd_wakeup_interrupt_enabled | ( | ) | USBB_TST_BITS(UHINTE,HWUPIE) |
#define uhd_ack_connection | ( | ) | USBB_REG_CLR(UHINT,DCONNI) |
#define uhd_ack_disconnection | ( | ) | USBB_REG_CLR(UHINT,DDISCI) |
#define uhd_ack_downstream_resume | ( | ) | USBB_REG_CLR(UHINT,RSMEDI) |
#define uhd_ack_reset_sent | ( | ) | USBB_REG_CLR(UHINT,RSTI) |
#define uhd_ack_sof | ( | ) | USBB_REG_CLR(UHINT,HSOFI) |
#define uhd_ack_upstream_resume | ( | ) | USBB_REG_CLR(UHINT,RXRSMI) |
#define uhd_ack_vbus_error_interrupt | ( | ) | USBB_REG_CLR(USBSTA,VBERRI) |
#define uhd_ack_wakeup | ( | ) | USBB_REG_CLR(UHINT,HWUPI) |
#define uhd_disable_connection_int | ( | ) | USBB_REG_CLR(UHINTE,DCONNIE) |
#define uhd_disable_disconnection_int | ( | ) | USBB_REG_CLR(UHINTE,DDISCIE) |
#define uhd_disable_downstream_resume_interrupt | ( | ) | USBB_REG_CLR(UHINTE,RSMEDIE) |
#define uhd_disable_reset_sent_interrupt | ( | ) | USBB_REG_CLR(UHINTE,RSTIE) |
#define uhd_disable_sof | ( | ) | USBB_CLR_BITS(UHCON,SOFE) |
#define uhd_disable_sof_interrupt | ( | ) | USBB_REG_CLR(UHINTE,HSOFIE) |
#define uhd_disable_upstream_resume_interrupt | ( | ) | USBB_REG_CLR(UHINTE,RXRSMIE) |
#define uhd_disable_vbus | ( | ) | USBB_REG_CLR(USBSTA,VBUSRQ) |
Requests VBus deactivation.
#define uhd_disable_vbus_error_hw_control | ( | ) | USBB_SET_BITS(USBCON,VBUSHWC) |
Disables hardware control of USB_VBOF output pin when a Vbus error occur.
#define uhd_disable_vbus_error_interrupt | ( | ) | USBB_CLR_BITS(USBCON,VBERRE) |
#define uhd_disable_wakeup_interrupt | ( | ) | USBB_REG_CLR(UHINTE,HWUPIE) |
#define uhd_enable_connection_int | ( | ) | USBB_REG_SET(UHINTE,DCONNIE) |
#define uhd_enable_disconnection_int | ( | ) | USBB_REG_SET(UHINTE,DDISCIE) |
#define uhd_enable_downstream_resume_interrupt | ( | ) | USBB_REG_SET(UHINTE,RSMEDIE) |
#define uhd_enable_reset_sent_interrupt | ( | ) | USBB_REG_SET(UHINTE,RSTIE) |
#define uhd_enable_sof | ( | ) | USBB_SET_BITS(UHCON,SOFE) |
Initiates a SOF events.
#define uhd_enable_sof_interrupt | ( | ) | USBB_REG_SET(UHINTE,HSOFIE) |
#define uhd_enable_upstream_resume_interrupt | ( | ) | USBB_REG_SET(UHINTE,RXRSMIE) |
#define uhd_enable_vbus | ( | ) | USBB_REG_SET(USBSTA,VBUSRQ) |
Requests VBus activation.
#define uhd_enable_vbus_error_hw_control | ( | ) | USBB_CLR_BITS(USBCON,VBUSHWC) |
#define uhd_enable_vbus_error_interrupt | ( | ) | USBB_SET_BITS(USBCON,VBERRE) |
#define uhd_enable_wakeup_interrupt | ( | ) | USBB_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 | ( | ) | USBB_RD_BITFIELD(UHFNUM,FLENHIGH) |
#define uhd_get_microsof_number | ( | ) |
#define uhd_get_pipe_max_nbr | ( | ) |
#define uhd_get_sof_number | ( | ) | USBB_RD_BITFIELD(UHFNUM,FNUM) |
#define uhd_get_speed_mode | ( | ) | USBB_RD_BITFIELD(USBSTA,SPEED) |
#define uhd_output_vbof_pin | ( | ) |
Output USB_VBOF onto its pin.
#define uhd_send_resume | ( | ) | USBB_SET_BITS(UHCON,RESUME) |
Initiates a resume event It is called downstream resume event.
#define uhd_set_vbof_active_high | ( | ) | USBB_CLR_BITS(USBCON,VBUSPO) |
Set USB_VBOF output pin polarity.
#define uhd_set_vbof_active_low | ( | ) | USBB_SET_BITS(USBCON,VBUSPO) |
#define uhd_start_reset | ( | ) | USBB_SET_BITS(UHCON,RESET) |
Initiates a reset event.
#define uhd_stop_reset | ( | ) | USBB_CLR_BITS(UHCON,RESET) |