Defines | |
#define | Usb_enable() (USBCON |= ((1<<USBE) )) |
Enable USB interface. | |
#define | Usb_disable() (USBCON &= ~((1<<USBE))) |
Disable USB interface. | |
#define | Usb_full_speed_mode() (UDCON &= ~(1<<LSM)) |
Use device full speed mode (default mode). | |
#define | Usb_low_speed_mode() (UDCON |= (1<<LSM)) |
For device mode, force low speed mode. | |
#define | Is_usb_enabled() ((USBCON & (1<<USBE)) ? TRUE : FALSE) |
#define | Usb_enable_device() (USBCON |= (1<<USBE)) |
#define | Usb_disable_device() (USBCON &= ~(1<<USBE)) |
#define | Usb_reset_macro_only() (UDCON &= ~(1<<RSTCPU)) |
#define | Usb_reset_all_system() (UDCON |= (1<<RSTCPU)) |
#define | Usb_enable_vbus_pad() (USBCON |= (1<<OTGPADE)) |
Enable VBUS pad. | |
#define | Usb_disable_vbus_pad() (USBCON &= ~(1<<OTGPADE)) |
Disable VBUS pad. | |
#define | Usb_freeze_clock() (USBCON |= (1<<FRZCLK)) |
Stop internal USB clock in interface (freeze the interface register). | |
#define | Usb_unfreeze_clock() (USBCON &= ~(1<<FRZCLK)) |
#define | Is_usb_clock_freezed() ((USBCON & (1<<FRZCLK)) ? TRUE : FALSE) |
#define | MSK_IDTE_VBUSTE ((1<<IDTE)|(1<<VBUSTE)) |
#define | Usb_get_general_interrupt() (USBINT & (USBCON & MSK_IDTE_VBUSTE)) |
returns the USB general interrupts (interrupt enabled) | |
#define | Usb_ack_all_general_interrupt() (USBINT = ~(USBCON & MSK_IDTE_VBUSTE)) |
acks the general interrupts (interrupt enabled) | |
#define | Usb_ack_cache_id_transition(x) ((x) &= ~(1<<IDTI)) |
#define | Usb_ack_cache_vbus_transition(x) ((x) &= ~(1<<VBUSTI)) |
#define | Is_usb_cache_id_transition(x) (((x) & (1<<IDTI)) ) |
#define | Is_usb_cache_vbus_transition(x) (((x) & (1<<VBUSTI))) |
#define | Usb_enable_vbus_interrupt() (USBCON |= (1<<VBUSTE)) |
#define | Usb_disable_vbus_interrupt() (USBCON &= ~(1<<VBUSTE)) |
#define | Is_usb_vbus_interrupt_enabled() ((USBCON & (1<<VBUSTE)) ? TRUE : FALSE) |
#define | Is_usb_vbus_high() ((USBSTA & (1<<VBUS)) ? TRUE : FALSE) |
#define | Is_usb_vbus_low() ((USBSTA & (1<<VBUS)) ? FALSE : TRUE) |
#define | Usb_ack_vbus_transition() (USBINT = ~(1<<VBUSTI)) |
#define | Is_usb_vbus_transition() ((USBINT & (1<<VBUSTI)) ? TRUE : FALSE) |
#define Usb_enable | ( | ) | (USBCON |= ((1<<USBE) )) |
Enable USB interface.
Definition at line 192 of file usb_drv.h.
Referenced by usb_device_task(), and usb_device_task_init().
#define Usb_disable | ( | ) | (USBCON &= ~((1<<USBE))) |
Disable USB interface.
Definition at line 194 of file usb_drv.h.
Referenced by usb_device_task_init().
#define Usb_full_speed_mode | ( | ) | (UDCON &= ~(1<<LSM)) |
#define Usb_low_speed_mode | ( | ) | (UDCON |= (1<<LSM)) |
For device mode, force low speed mode.
Definition at line 198 of file usb_drv.h.
Referenced by usb_device_task_init().
#define Is_usb_enabled | ( | ) | ((USBCON & (1<<USBE)) ? TRUE : FALSE) |
#define Usb_reset_macro_only | ( | ) | (UDCON &= ~(1<<RSTCPU)) |
#define Usb_reset_all_system | ( | ) | (UDCON |= (1<<RSTCPU)) |
#define Usb_enable_vbus_pad | ( | ) | (USBCON |= (1<<OTGPADE)) |
#define Usb_disable_vbus_pad | ( | ) | (USBCON &= ~(1<<OTGPADE)) |
#define Usb_freeze_clock | ( | ) | (USBCON |= (1<<FRZCLK)) |
Stop internal USB clock in interface (freeze the interface register).
Definition at line 213 of file usb_drv.h.
Referenced by usb_device_task(), usb_general_interrupt(), and usb_start_device().
#define Usb_unfreeze_clock | ( | ) | (USBCON &= ~(1<<FRZCLK)) |
Definition at line 214 of file usb_drv.h.
Referenced by usb_general_interrupt(), usb_generate_remote_wakeup(), and usb_start_device().
#define Is_usb_clock_freezed | ( | ) | ((USBCON & (1<<FRZCLK)) ? TRUE : FALSE) |
#define Usb_get_general_interrupt | ( | ) | (USBINT & (USBCON & MSK_IDTE_VBUSTE)) |
#define Usb_ack_all_general_interrupt | ( | ) | (USBINT = ~(USBCON & MSK_IDTE_VBUSTE)) |
#define Usb_ack_cache_id_transition | ( | x | ) | ((x) &= ~(1<<IDTI)) |
#define Usb_ack_cache_vbus_transition | ( | x | ) | ((x) &= ~(1<<VBUSTI)) |
#define Is_usb_cache_id_transition | ( | x | ) | (((x) & (1<<IDTI)) ) |
#define Is_usb_cache_vbus_transition | ( | x | ) | (((x) & (1<<VBUSTI))) |
#define Usb_enable_vbus_interrupt | ( | ) | (USBCON |= (1<<VBUSTE)) |
#define Usb_disable_vbus_interrupt | ( | ) | (USBCON &= ~(1<<VBUSTE)) |
#define Is_usb_vbus_interrupt_enabled | ( | ) | ((USBCON & (1<<VBUSTE)) ? TRUE : FALSE) |
#define Is_usb_vbus_high | ( | ) | ((USBSTA & (1<<VBUS)) ? TRUE : FALSE) |
#define Is_usb_vbus_low | ( | ) | ((USBSTA & (1<<VBUS)) ? FALSE : TRUE) |
#define Usb_ack_vbus_transition | ( | ) | (USBINT = ~(1<<VBUSTI)) |
#define Is_usb_vbus_transition | ( | ) | ((USBINT & (1<<VBUSTI)) ? TRUE : FALSE) |