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

# USB device controller drivers
[USB low level 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_wake_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)
#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 | 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 400 of file usb_drv.h.

Referenced by usb_generate_remote_wakeup().

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

detaches from USB bus

Definition at line 402 of file usb_drv.h.

Referenced by usb_device_task(), and usb_task().

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

attaches to USB bus

Definition at line 404 of file usb_drv.h.

Referenced by usb_device_task(), usb_host_task_init(), and 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 406 of file usb_drv.h.

Referenced by usb_device_task().

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

test if the device is detached

Definition at line 408 of file usb_drv.h.

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

returns the USB device interrupts (interrupt enabled)

Definition at line 411 of file usb_drv.h.

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

acks the USB device interrupts (interrupt enabled)

Definition at line 413 of file usb_drv.h.

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

enables remote wake-up interrupt

Definition at line 416 of file usb_drv.h.

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

disables remote wake-up interrupt

Definition at line 418 of file usb_drv.h.

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

Definition at line 419 of file usb_drv.h.

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

acks remote wake-up

Definition at line 421 of file usb_drv.h.

Referenced by usb_device_task().

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

tests if remote wake-up still running

Definition at line 423 of file usb_drv.h.

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

enables resume interrupt

Definition at line 426 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

disables resume interrupt

Definition at line 428 of file usb_drv.h.

Referenced by usb_general_interrupt(), and usb_task().

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

Definition at line 429 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

acks resume

Definition at line 431 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 433 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 436 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 438 of file usb_drv.h.

Referenced by usb_general_interrupt(), and usb_task().

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

Definition at line 439 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

acks wake-up

Definition at line 441 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 443 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 446 of file usb_drv.h.

Referenced by usb_general_interrupt(), and usb_start_device().

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

disables USB reset interrupt

Definition at line 448 of file usb_drv.h.

Referenced by usb_task().

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

Definition at line 449 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

acks USB reset

Definition at line 451 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 453 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 456 of file usb_drv.h.

Referenced by storage_task(), storage_task_init(), and usb_device_task().

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

disables Start Of Frame Interrupt

Definition at line 458 of file usb_drv.h.

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

Definition at line 459 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

acks Start Of Frame

Definition at line 461 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 463 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 466 of file usb_drv.h.

Referenced by usb_device_task(), usb_general_interrupt(), and usb_start_device().

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

disables suspend state interrupt

Definition at line 468 of file usb_drv.h.

Referenced by usb_general_interrupt(), and usb_task().

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

Definition at line 469 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

acks Suspend

Definition at line 471 of file usb_drv.h.

Referenced by usb_device_task(), and usb_general_interrupt().

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

tests if Suspend state detected

Definition at line 473 of file usb_drv.h.

Referenced by usb_general_interrupt().

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

enables USB device address

Definition at line 476 of file usb_drv.h.

Referenced by usb_set_address().

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

disables USB device address

Definition at line 478 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 480 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 483 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 485 of file usb_drv.h.