Defines

# USB common management drivers
[USB low level drivers]

These macros manage the USB controller. More...

## 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)

## Detailed Description

These macros manage the USB controller.

## Define Documentation

#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))

Use device full speed mode (default mode)

Definition at line 196 of file usb_drv.h.

#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)

Definition at line 200 of file usb_drv.h.

#define Usb_enable_device | ( | ) | (USBCON |= (1<<USBE))

Definition at line 202 of file usb_drv.h.

#define Usb_disable_device | ( | ) | (USBCON &= ~(1<<USBE))

Definition at line 203 of file usb_drv.h.

#define Usb_reset_macro_only | ( | ) | (UDCON &= ~(1<<RSTCPU))

Definition at line 204 of file usb_drv.h.

Referenced by usb_start_device().

#define Usb_reset_all_system | ( | ) | (UDCON |= (1<<RSTCPU))

Definition at line 205 of file usb_drv.h.

Referenced by usb_start_device().

#define Usb_enable_vbus_pad | ( | ) | (USBCON |= (1<<OTGPADE))

Enable VBUS pad.

Definition at line 208 of file usb_drv.h.

Referenced by usb_device_task_init().

#define Usb_disable_vbus_pad | ( | ) | (USBCON &= ~(1<<OTGPADE))

Disable VBUS pad.

Definition at line 210 of file usb_drv.h.

#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_device_task(), usb_general_interrupt(), usb_generate_remote_wakeup(), and usb_start_device().

#define Is_usb_clock_freezed | ( | ) | ((USBCON & (1<<FRZCLK)) ? TRUE : FALSE)

Definition at line 215 of file usb_drv.h.

#define MSK_IDTE_VBUSTE ((1<<IDTE)|(1<<VBUSTE))

Definition at line 218 of file usb_drv.h.

#define Usb_get_general_interrupt | ( | ) | (USBINT & (USBCON & MSK_IDTE_VBUSTE))

returns the USB general interrupts (interrupt enabled)

Definition at line 220 of file usb_drv.h.

#define Usb_ack_all_general_interrupt | ( | ) | (USBINT = ~(USBCON & MSK_IDTE_VBUSTE))

acks the general interrupts (interrupt enabled)

Definition at line 222 of file usb_drv.h.

#define Usb_ack_cache_id_transition | ( |  | x ) | ((x) &= ~(1<<IDTI))

Definition at line 223 of file usb_drv.h.

#define Usb_ack_cache_vbus_transition | ( |  | x ) | ((x) &= ~(1<<VBUSTI))

Definition at line 224 of file usb_drv.h.

#define Is_usb_cache_id_transition | ( |  | x ) | (((x) & (1<<IDTI)) )

Definition at line 225 of file usb_drv.h.

#define Is_usb_cache_vbus_transition | ( |  | x ) | (((x) & (1<<VBUSTI)))

Definition at line 226 of file usb_drv.h.

#define Usb_enable_vbus_interrupt | ( | ) | (USBCON |= (1<<VBUSTE))

Definition at line 228 of file usb_drv.h.

#define Usb_disable_vbus_interrupt | ( | ) | (USBCON &= ~(1<<VBUSTE))

Definition at line 229 of file usb_drv.h.

#define Is_usb_vbus_interrupt_enabled | ( | ) | ((USBCON & (1<<VBUSTE)) ? TRUE : FALSE)

Definition at line 230 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_usb_vbus_high | ( | ) | ((USBSTA & (1<<VBUS)) ? TRUE : FALSE)

Definition at line 231 of file usb_drv.h.

Referenced by usb_device_task().

#define Is_usb_vbus_low | ( | ) | ((USBSTA & (1<<VBUS)) ? FALSE : TRUE)

Definition at line 232 of file usb_drv.h.

Referenced by usb_device_task().

#define Usb_ack_vbus_transition | ( | ) | (USBINT = ~(1<<VBUSTI))

Definition at line 233 of file usb_drv.h.

#define Is_usb_vbus_transition | ( | ) | ((USBINT & (1<<VBUSTI)) ? TRUE : FALSE)

Definition at line 234 of file usb_drv.h.

Referenced by usb_general_interrupt().