USBHS low-level driver for OTG features.
|
These macros allows to enable/disable pad and USBHS hardware
|
#define | otg_reset() |
| Reset USB macro. More...
|
|
#define | otg_enable() (Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_USBE)) |
| Enable USB macro. More...
|
|
#define | otg_disable() (Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_USBE)) |
| Disable USB macro. More...
|
|
#define | Is_otg_enabled() (Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_USBE)) |
|
#define | Is_otg_clock_usable() (Tst_bits(USBHS->USBHS_SR, USBHS_SR_CLKUSABLE)) |
| Check Clock Usable. More...
|
|
#define | otg_freeze_clock() (Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_FRZCLK)) |
| Stop (freeze) internal USB clock. More...
|
|
#define | otg_unfreeze_clock() (Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_FRZCLK)) |
|
#define | Is_otg_clock_frozen() (Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_FRZCLK)) |
|
#define | otg_enable_rderr_interrupt() (Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_RDERRE)) |
| Enables RDERR interrupt. More...
|
|
#define | otg_disable_rderr_interrupt() (Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_RDERRE)) |
| Disables RDERR interrupt. More...
|
|
#define | Is_otg_rderr_interrupt_enabled() (Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_RDERRE)) |
|
#define | otg_ack_rderr_interrupt() (USBHS->USBHS_SCR = USBHS_SCR_RDERRIC) |
| ACKs RDERR interrupt. More...
|
|
#define | otg_raise_rderr_interrupt() (USBHS->USBHS_SFR = USBHS_SFR_RDERRIS) |
| Raises RDERR interrupt. More...
|
|
#define | Is_otg_rderr_interrupt() (Tst_bits(USBHS->USBHS_SR, USBHS_SR_RDERRI)) |
| Tests if a RDERR occurs. More...
|
|
#define Is_otg_clock_frozen |
( |
| ) |
(Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_FRZCLK)) |
#define Is_otg_clock_usable |
( |
| ) |
(Tst_bits(USBHS->USBHS_SR, USBHS_SR_CLKUSABLE)) |
#define Is_otg_device_mode_forced |
( |
| ) |
(Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_UIMOD)) |
Test if device mode is forced.
#define Is_otg_enabled |
( |
| ) |
(Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_USBE)) |
#define Is_otg_host_mode_forced |
( |
| ) |
(!Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_UIMOD)) |
#define Is_otg_rderr_interrupt |
( |
| ) |
(Tst_bits(USBHS->USBHS_SR, USBHS_SR_RDERRI)) |
#define Is_otg_rderr_interrupt_enabled |
( |
| ) |
(Tst_bits(USBHS->USBHS_CTRL, USBHS_CTRL_RDERRE)) |
#define otg_ack_rderr_interrupt |
( |
| ) |
(USBHS->USBHS_SCR = USBHS_SCR_RDERRIC) |
#define otg_disable |
( |
| ) |
(Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_USBE)) |
#define otg_disable_rderr_interrupt |
( |
| ) |
(Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_RDERRE)) |
Disables RDERR interrupt.
#define otg_enable |
( |
| ) |
(Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_USBE)) |
#define otg_enable_rderr_interrupt |
( |
| ) |
(Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_RDERRE)) |
#define otg_force_device_mode |
( |
| ) |
(Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_UIMOD)) |
#define otg_force_host_mode |
( |
| ) |
(Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_UIMOD)) |
Disable external OTG_ID pin and force host mode.
#define otg_freeze_clock |
( |
| ) |
(Set_bits(USBHS->USBHS_CTRL, USBHS_CTRL_FRZCLK)) |
Value:(defined(CONF_BOARD_USB_PORT) && \
defined(CONF_BOARD_USB_ID_DETECT))
#define otg_id_init |
( |
|
handler | ) |
|
Value:
static __always_inline void otg_io_pin_init(uint32_t pin, uint32_t flags, IRQn_Type port_irqn, uint8_t irq_level, void(*handler)(uint32_t, uint32_t), uint32_t wkup)
Definition: usbhs_otg.h:53
#define USB_ID_PIN_IRQn
Definition: same70_xplained.h:528
#define USB_ID_FLAGS
Definition: same70_xplained.h:526
#define USB_INT_LEVEL
USB interrupt level By default USB interrupt have low priority.
Definition: usbhs_otg.h:79
#define USB_ID_PIN
Definition: same70_xplained.h:527
#define otg_raise_rderr_interrupt |
( |
| ) |
(USBHS->USBHS_SFR = USBHS_SFR_RDERRIS) |
Value:do { \
USBHS->USBHS_CTRL = 0; \
while( USBHS->USBHS_SR & 0x3FFF) {\
USBHS->USBHS_SCR = 0xFFFFFFFF;\
} \
} while (0)
Reset USB macro.
#define otg_unfreeze_clock |
( |
| ) |
(Clr_bits(USBHS->USBHS_CTRL, USBHS_CTRL_FRZCLK)) |
Value:(defined(CONF_BOARD_USB_PORT) && \
defined(CONF_BOARD_USB_VBUS_DETECT))
#define otg_vbus_init |
( |
|
handler | ) |
|
Value:
static __always_inline void otg_io_pin_init(uint32_t pin, uint32_t flags, IRQn_Type port_irqn, uint8_t irq_level, void(*handler)(uint32_t, uint32_t), uint32_t wkup)
Definition: usbhs_otg.h:53
#define USB_VBUS_PIN_IRQn
Definition: same70_xplained.h:518
#define USB_VBUS_WKUP
Definition: usbhs_otg.h:143
#define USB_INT_LEVEL
USB interrupt level By default USB interrupt have low priority.
Definition: usbhs_otg.h:79
#define USB_VBUS_PIN
Definition: same70_xplained.h:517
#define USB_VBUS_FLAGS
Definition: same70_xplained.h:516
Referenced by udd_enable().
USB interrupt level By default USB interrupt have low priority.
void otg_dual_disable |
( |
void |
| ) |
|
Uninitialize the dual role This function is implemented in usbhs_host.c file.
bool otg_dual_enable |
( |
void |
| ) |
|
Initialize the dual role This function is implemented in usbhs_host.c file.
- Returns
true
if the ID pin management has been started, otherwise false
.
Referenced by udd_enable().