Defines | |
#define | Usb_enable() (USBCON |= ((1<<USBE) )) |
Enable USB interface. | |
#define | Usb_disable() (USBCON &= ~((1<<USBE))) |
Disable USB interface. | |
#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_vbus_sense_init() |
Init vbus sensing i/o. | |
#define | Is_usb_vbus_on() (((VBUS_SENSE_PIN&(1<<VBUS_SENSE_IO)) != 0) ? TRUE : FALSE) |
test if vbus is present | |
#define | Is_usb_vbus_off() (((VBUS_SENSE_PIN&(1<<VBUS_SENSE_IO)) == 0) ? TRUE : FALSE) |
test if vbus is not present | |
#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 | Ps2_enable_device() (PS2CON |= (1<<PS2EN)) |
#define | Ps2_disable_device() (PS2CON &= ~(1<<PS2EN)) |
#define | Usb_direct_drive_usb_enable() (UPOE |= (1<<UPWE1), UPOE &= ~(1<<UPWE0)) |
#define | Usb_direct_drive_ps2_enable() (UPOE |= ((1<<UPWE1) | (1<<UPWE0))) |
#define | Usb_direct_drive_disable() (UPOE &= ~((1<<UPWE1) | (1<<UPWE0))) |
#define | Usb_drive_dp_high() (UPOE |= (1<<UPDRV1)) |
#define | Usb_drive_dp_low() (UPOE &= ~(1<<UPDRV1)) |
#define | Usb_drive_dm_high() (UPOE |= (1<<UPDRV0)) |
#define | Usb_drive_dm_low() (UPOE &= ~(1<<UPDRV0)) |
#define | Ps2_drive_sck_high() (UPOE |= (1<<UPDRV1)) |
#define | Ps2_drive_sck_low() (UPOE &= ~(1<<UPDRV1)) |
#define | Ps2_drive_data_high() (UPOE |= (1<<UPDRV0)) |
#define | Ps2_drive_data_low() (UPOE &= ~(1<<UPDRV0)) |
#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 | ( | ) | (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(), and 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_vbus_sense_init | ( | ) |
Value:
(VBUS_SENSE_DDR &= ~(1<<VBUS_SENSE_IO), \ VBUS_SENSE_PORT &= ~(1<<VBUS_SENSE_IO))
Definition at line 204 of file usb_drv.h.
Referenced by usb_device_task_init().
#define Is_usb_vbus_on | ( | ) | (((VBUS_SENSE_PIN&(1<<VBUS_SENSE_IO)) != 0) ? TRUE : FALSE) |
#define Is_usb_vbus_off | ( | ) | (((VBUS_SENSE_PIN&(1<<VBUS_SENSE_IO)) == 0) ? TRUE : FALSE) |
test if vbus is not present
Definition at line 209 of file usb_drv.h.
Referenced by usb_device_task().
#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_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_direct_drive_usb_enable | ( | ) | (UPOE |= (1<<UPWE1), UPOE &= ~(1<<UPWE0)) |
#define Usb_direct_drive_ps2_enable | ( | ) | (UPOE |= ((1<<UPWE1) | (1<<UPWE0))) |
#define Usb_direct_drive_disable | ( | ) | (UPOE &= ~((1<<UPWE1) | (1<<UPWE0))) |
#define Usb_drive_dp_low | ( | ) | (UPOE &= ~(1<<UPDRV1)) |
#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))) |