SAM USB Dual Role driver file.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | _usb_is_id_device() port_pin_get_input_level(USB_ID_PIN) |
#define | uhc_start(void) |
#define | uhc_stop(b_id_stop) |
Functions | |
void | usb_dual_disable (void) |
Deinitialize the dual role driver. More... | |
bool | usb_dual_enable (void) |
Initialize the USB peripheral and set right role according to ID pin. More... | |
USB ID PAD management | |
static void | usb_id_handler (void) |
USB ID pin change handler. More... | |
static void | usb_id_config (void) |
USB ID pin configuration. More... | |
Variables | |
static bool | _initialized = false |
#define _usb_is_id_device | ( | ) | port_pin_get_input_level(USB_ID_PIN) |
Referenced by usb_dual_enable(), and usb_id_handler().
#define uhc_start | ( | void | ) |
Referenced by usb_dual_enable(), and usb_id_handler().
#define uhc_stop | ( | b_id_stop | ) |
Referenced by usb_id_handler().
|
static |
USB ID pin configuration.
References extint_chan_conf::detection_criteria, EXTINT_CALLBACK_TYPE_DETECT, extint_chan_disable_callback(), extint_chan_enable_callback(), extint_chan_get_config_defaults(), extint_chan_set_config(), EXTINT_DETECT_BOTH, extint_register_callback(), extint_chan_conf::filter_input_signal, extint_chan_conf::gpio_pin, extint_chan_conf::gpio_pin_mux, USB_ID_EIC_LINE, USB_ID_EIC_MUX, usb_id_handler(), and USB_ID_PIN.
Referenced by usb_dual_enable().
|
static |
USB ID pin change handler.
References _usb_is_id_device, EXTINT_CALLBACK_TYPE_DETECT, extint_chan_disable_callback(), extint_chan_enable_callback(), udc_start(), udc_stop(), uhc_start, uhc_stop, and USB_ID_EIC_LINE.
Referenced by usb_id_config().
Referenced by usb_dual_disable(), and usb_dual_enable().