UOTGHS low-level driver for OTG features.
|
The ID pin come from the USB OTG connector (A and B receptable) and allows to select the USB mode host or device.
The UOTGHS hardware can manage it automatically. This feature is optional. When USB_ID_GPIO is defined (in board.h), this feature is enabled.
|
#define | otg_enable_id_pin() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) |
| Enable external OTG_ID pin (listened to by USB) More...
|
|
#define | otg_disable_id_pin() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) |
| Disable external OTG_ID pin (ignored by USB) More...
|
|
#define | Is_otg_id_pin_enabled() (Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) |
| Test if external OTG_ID pin enabled (listened to by USB) More...
|
|
#define | otg_force_device_mode() (Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD), otg_disable_id_pin()) |
| Disable external OTG_ID pin and force device mode. More...
|
|
#define | Is_otg_device_mode_forced() (!Is_otg_id_pin_enabled() && Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD)) |
| Test if device mode is forced. More...
|
|
#define | otg_force_host_mode() (Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD), otg_disable_id_pin()) |
| Disable external OTG_ID pin and force host mode. More...
|
|
#define | Is_otg_host_mode_forced() (!Is_otg_id_pin_enabled() && !Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIMOD)) |
| Test if host mode is forced. More...
|
|
Test if device mode is forced.
#define Is_otg_id_device |
( |
| ) |
(Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_ID)) |
#define Is_otg_id_interrupt_enabled |
( |
| ) |
(Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_IDTE)) |
#define Is_otg_id_pin_enabled |
( |
| ) |
(Tst_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) |
Test if external OTG_ID pin enabled (listened to by USB)
#define Is_otg_id_transition |
( |
| ) |
(Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_IDTI)) |
#define otg_ack_id_transition |
( |
| ) |
(UOTGHS->UOTGHS_SCR = UOTGHS_SCR_IDTIC) |
#define otg_disable_id_interrupt |
( |
| ) |
(Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_IDTE)) |
#define otg_disable_id_pin |
( |
| ) |
(Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) |
Disable external OTG_ID pin (ignored by USB)
Referenced by udd_enable().
#define otg_enable_id_interrupt |
( |
| ) |
(Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_IDTE)) |
#define otg_enable_id_pin |
( |
| ) |
(Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_UIDE)) |
Enable external OTG_ID pin (listened to by USB)
Disable external OTG_ID pin and force device mode.
Referenced by udd_enable().
Disable external OTG_ID pin and force host mode.
#define otg_raise_id_transition |
( |
| ) |
(UOTGHS->UOTGHS_SFR = UOTGHS_SFR_IDTIS) |
void otg_dual_disable |
( |
void |
| ) |
|
Uninitialize the dual role This function is implemented in uotghs_host.c file.
bool otg_dual_enable |
( |
void |
| ) |
|
Initialize the dual role This function is implemented in uotghs_host.c file.
- Returns
true
if the ID pin management has been started, otherwise false
.
Referenced by udd_enable().