- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# USB device controller drivers
[USB low level drivers module]

Collaboration diagram for USB device controller drivers:

These macros manage the USB Device controller. More...

## Defines
#define | Usb_initiate_remote_wake_up() (UDCON |= (1<<RMWKUP))
| initiates a remote wake-up
#define | Usb_detach() (UDCON |= (1<<DETACH))
| detaches from USB bus
#define | Usb_attach() (UDCON &= ~(1<<DETACH))
| attaches to USB bus
#define | Is_usb_pending_remote_wake_up() ((UDCON & (1<<RMWKUP)) ? TRUE : FALSE)
| test if remote wake-up still running
#define | Is_usb_detached() ((UDCON & (1<<DETACH)) ? TRUE : FALSE)
| test if the device is detached
#define | Usb_get_device_interrupt() (UDINT & (1<<UDIEN))
| returns the USB device interrupts (interrupt enabled)
#define | Usb_ack_all_device_interrupt() (UDINT = ~(1<<UDIEN))
| acks the USB device interrupts (interrupt enabled)
#define | Usb_enable_remote_wake_up_interrupt() (UDIEN |= (1<<UPRSME))
| enables remote wake-up interrupt
#define | Usb_disable_remote_wake_up_interrupt() (UDIEN &= ~(1<<UPRSME))
| disables remote wake-up interrupt
#define | Is_remote_wake_up_interrupt_enabled() ((UDIEN & (1<<UPRSME)) ? TRUE : FALSE)
#define | Usb_ack_remote_wake_up_start() (UDINT = ~(1<<UPRSMI))
| acks remote wake-up
#define | Is_usb_remote_wake_up_start() ((UDINT & (1<<UPRSMI)) ? TRUE : FALSE)
| tests if remote wake-up still running
#define | Usb_enable_resume_interrupt() (UDIEN |= (1<<EORSME))
| enables resume interrupt
#define | Usb_disable_resume_interrupt() (UDIEN &= ~(1<<EORSME))
| disables resume interrupt
#define | Is_resume_interrupt_enabled() ((UDIEN & (1<<EORSME)) ? TRUE : FALSE)
#define | Usb_ack_resume() (UDINT = ~(1<<EORSMI))
| acks resume
#define | Is_usb_resume() ((UDINT & (1<<EORSMI)) ? TRUE : FALSE)
| tests if resume occurs
#define | Usb_enable_wake_up_interrupt() (UDIEN |= (1<<WAKEUPE))
| enables wake-up interrupt
#define | Usb_disable_wake_up_interrupt() (UDIEN &= ~(1<<WAKEUPE))
| disables wake-up interrupt
#define | Is_swake_up_interrupt_enabled() ((UDIEN & (1<<WAKEUPE)) ? TRUE : FALSE)
#define | Usb_ack_wake_up() (UDINT = ~(1<<WAKEUPI))
| acks wake-up
#define | Is_usb_wake_up() ((UDINT & (1<<WAKEUPI)) ? TRUE : FALSE)
| tests if wake-up occurs
#define | Usb_enable_reset_interrupt() (UDIEN |= (1<<EORSTE))
| enables USB reset interrupt
#define | Usb_disable_reset_interrupt() (UDIEN &= ~(1<<EORSTE))
| disables USB reset interrupt
#define | Is_reset_interrupt_enabled() ((UDIEN & (1<<EORSTE)) ? TRUE : FALSE)
#define | Usb_ack_reset() (UDINT = ~(1<<EORSTI))
| acks USB reset
#define | Is_usb_reset() ((UDINT & (1<<EORSTI)) ? TRUE : FALSE)
| tests if USB reset occurs
#define | Usb_enable_sof_interrupt() (UDIEN |= (1<<SOFE))
| enables Start Of Frame Interrupt
#define | Usb_disable_sof_interrupt() (UDIEN &= ~(1<<SOFE))
| disables Start Of Frame Interrupt
#define | Is_sof_interrupt_enabled() ((UDIEN & (1<<SOFE)) ? TRUE : FALSE)
#define | Usb_ack_sof() (UDINT = ~(1<<SOFI))
| acks Start Of Frame
#define | Is_usb_sof() ((UDINT & (1<<SOFI)) ? TRUE : FALSE)
| tests if Start Of Frame occurs
#define | Usb_enable_suspend_interrupt() (UDIEN |= (1<<SUSPE))
| enables suspend state interrupt
#define | Usb_disable_suspend_interrupt() (UDIEN &= ~(1<<SUSPE))
| disables suspend state interrupt
#define | Is_suspend_interrupt_enabled() ((UDIEN & (1<<SUSPE)) ? TRUE : FALSE)
| test if suspend interrupt is enabled
#define | Usb_ack_suspend() (UDINT = ~(1<<SUSPI))
| acks Suspend
#define | Is_usb_suspend() ((UDINT & (1<<SUSPI)) ? TRUE : FALSE)
| tests if Suspend state detected
#define | Usb_enable_address() (UDADDR |= (1<<ADDEN))
| enables USB device address
#define | Usb_disable_address() (UDADDR &= ~(1<<ADDEN))
| disables USB device address
#define | Is_usb_addressed() ((UDADDR & (1<<ADDEN)) ? TRUE : FALSE)
| test if device is adressed
#define | Usb_configure_address(addr) (UDADDR = (UDADDR & (1<<ADDEN)) | ((U8)addr & MSK_UADD))
| sets the USB device address
#define | Usb_frame_number() ((U16)((((U16)UDFNUMH) << 8) | ((U16)UDFNUML)))
| returns the last frame number
#define | Is_usb_frame_number_crc_error() ((UDMFN & (1<<FNCERR)) ? TRUE : FALSE)
| tests if a crc error occurs in frame number

## Detailed Description

These macros manage the USB Device controller.

## Define Documentation

#define Usb_initiate_remote_wake_up | ( |  | ) | (UDCON |= (1<<RMWKUP))

initiates a remote wake-up

Definition at line 220 of file usb_drv.h.

#define Usb_detach | ( |  | ) | (UDCON |= (1<<DETACH))

detaches from USB bus

Definition at line 222 of file usb_drv.h.

Referenced by usb_device_task().

#define Usb_attach | ( |  | ) | (UDCON &= ~(1<<DETACH))

attaches to USB bus

Definition at line 224 of file usb_drv.h.

Referenced by usb_start_device().

#define Is_usb_pending_remote_wake_up | ( |  | ) | ((UDCON & (1<<RMWKUP)) ? TRUE : FALSE)

test if remote wake-up still running

Definition at line 226 of file usb_drv.h.

#define Is_usb_detached | ( |  | ) | ((UDCON & (1<<DETACH)) ? TRUE : FALSE)

test if the device is detached

Definition at line 228 of file usb_drv.h.

#define Usb_get_device_interrupt | ( |  | ) | (UDINT & (1<<UDIEN))

returns the USB device interrupts (interrupt enabled)

Definition at line 231 of file usb_drv.h.

#define Usb_ack_all_device_interrupt | ( |  | ) | (UDINT = ~(1<<UDIEN))

acks the USB device interrupts (interrupt enabled)

Definition at line 233 of file usb_drv.h.

#define Usb_enable_remote_wake_up_interrupt | ( |  | ) | (UDIEN |= (1<<UPRSME))

enables remote wake-up interrupt

Definition at line 236 of file usb_drv.h.

#define Usb_disable_remote_wake_up_interrupt | ( |  | ) | (UDIEN &= ~(1<<UPRSME))

disables remote wake-up interrupt

Definition at line 238 of file usb_drv.h.

#define Is_remote_wake_up_interrupt_enabled | ( |  | ) | ((UDIEN & (1<<UPRSME)) ? TRUE : FALSE)

Definition at line 239 of file usb_drv.h.

#define Usb_ack_remote_wake_up_start | ( |  | ) | (UDINT = ~(1<<UPRSMI))

acks remote wake-up

Definition at line 241 of file usb_drv.h.

#define Is_usb_remote_wake_up_start | ( |  | ) | ((UDINT & (1<<UPRSMI)) ? TRUE : FALSE)

tests if remote wake-up still running

Definition at line 243 of file usb_drv.h.

#define Usb_enable_resume_interrupt | ( |  | ) | (UDIEN |= (1<<EORSME))

enables resume interrupt

Definition at line 246 of file usb_drv.h.

#define Usb_disable_resume_interrupt | ( |  | ) | (UDIEN &= ~(1<<EORSME))

disables resume interrupt

Definition at line 248 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_resume_interrupt_enabled | ( |  | ) | ((UDIEN & (1<<EORSME)) ? TRUE : FALSE)

Definition at line 249 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_ack_resume | ( |  | ) | (UDINT = ~(1<<EORSMI))

acks resume

Definition at line 251 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_usb_resume | ( |  | ) | ((UDINT & (1<<EORSMI)) ? TRUE : FALSE)

tests if resume occurs

Definition at line 253 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_enable_wake_up_interrupt | ( |  | ) | (UDIEN |= (1<<WAKEUPE))

enables wake-up interrupt

Definition at line 256 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_disable_wake_up_interrupt | ( |  | ) | (UDIEN &= ~(1<<WAKEUPE))

disables wake-up interrupt

Definition at line 258 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_swake_up_interrupt_enabled | ( |  | ) | ((UDIEN & (1<<WAKEUPE)) ? TRUE : FALSE)

Definition at line 259 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_ack_wake_up | ( |  | ) | (UDINT = ~(1<<WAKEUPI))

acks wake-up

Definition at line 261 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_usb_wake_up | ( |  | ) | ((UDINT & (1<<WAKEUPI)) ? TRUE : FALSE)

tests if wake-up occurs

Definition at line 263 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_enable_reset_interrupt | ( |  | ) | (UDIEN |= (1<<EORSTE))

enables USB reset interrupt

Definition at line 266 of file usb_drv.h.

Referenced by usb_start_device().

#define Usb_disable_reset_interrupt | ( |  | ) | (UDIEN &= ~(1<<EORSTE))

disables USB reset interrupt

Definition at line 268 of file usb_drv.h.

#define Is_reset_interrupt_enabled | ( |  | ) | ((UDIEN & (1<<EORSTE)) ? TRUE : FALSE)

Definition at line 269 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_ack_reset | ( |  | ) | (UDINT = ~(1<<EORSTI))

acks USB reset

Definition at line 271 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_usb_reset | ( |  | ) | ((UDINT & (1<<EORSTI)) ? TRUE : FALSE)

tests if USB reset occurs

Definition at line 273 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_enable_sof_interrupt | ( |  | ) | (UDIEN |= (1<<SOFE))

enables Start Of Frame Interrupt

Definition at line 276 of file usb_drv.h.

Referenced by mouse_task_init().

#define Usb_disable_sof_interrupt | ( |  | ) | (UDIEN &= ~(1<<SOFE))

disables Start Of Frame Interrupt

Definition at line 278 of file usb_drv.h.

#define Is_sof_interrupt_enabled | ( |  | ) | ((UDIEN & (1<<SOFE)) ? TRUE : FALSE)

Definition at line 279 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_ack_sof | ( |  | ) | (UDINT = ~(1<<SOFI))

acks Start Of Frame

Definition at line 281 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_usb_sof | ( |  | ) | ((UDINT & (1<<SOFI)) ? TRUE : FALSE)

tests if Start Of Frame occurs

Definition at line 283 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_enable_suspend_interrupt | ( |  | ) | (UDIEN |= (1<<SUSPE))

enables suspend state interrupt

Definition at line 286 of file usb_drv.h.

Referenced by usb_start_device().

#define Usb_disable_suspend_interrupt | ( |  | ) | (UDIEN &= ~(1<<SUSPE))

disables suspend state interrupt

Definition at line 288 of file usb_drv.h.

#define Is_suspend_interrupt_enabled | ( |  | ) | ((UDIEN & (1<<SUSPE)) ? TRUE : FALSE)

test if suspend interrupt is enabled

Definition at line 290 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_ack_suspend | ( |  | ) | (UDINT = ~(1<<SUSPI))

acks Suspend

Definition at line 292 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Is_usb_suspend | ( |  | ) | ((UDINT & (1<<SUSPI)) ? TRUE : FALSE)

tests if Suspend state detected

Definition at line 294 of file usb_drv.h.

Referenced by usb_general_interrupt().

#define Usb_enable_address | ( |  | ) | (UDADDR |= (1<<ADDEN))

enables USB device address

Definition at line 297 of file usb_drv.h.

Referenced by usb_set_address().

#define Usb_disable_address | ( |  | ) | (UDADDR &= ~(1<<ADDEN))

disables USB device address

Definition at line 299 of file usb_drv.h.

#define Is_usb_addressed | ( |  | ) | ((UDADDR & (1<<ADDEN)) ? TRUE : FALSE)

test if device is adressed

Definition at line 301 of file usb_drv.h.

#define Usb_configure_address | ( | addr |  | ) | (UDADDR = (UDADDR & (1<<ADDEN)) | ((U8)addr & MSK_UADD))

sets the USB device address

Definition at line 303 of file usb_drv.h.

Referenced by usb_set_address().

#define Usb_frame_number | ( |  | ) | ((U16)((((U16)UDFNUMH) << 8) | ((U16)UDFNUML)))

returns the last frame number

Definition at line 306 of file usb_drv.h.

#define Is_usb_frame_number_crc_error | ( |  | ) | ((UDMFN & (1<<FNCERR)) ? TRUE : FALSE)

tests if a crc error occurs in frame number

Definition at line 308 of file usb_drv.h.