USB host controller drivers
[USB low level drivers module]

Collaboration diagram for USB host controller drivers:


Defines

#define Host_allocate_memory()   (UPCFG1X |= (1<<ALLOC))
 allocates the current configuration in DPRAM memory
#define Host_unallocate_memory()   (UPCFG1X &= ~(1<<ALLOC))
 un-allocates the current configuration in DPRAM memory
#define Host_enable()   (USBCON |= (1<<HOST))
 enables USB Host function
#define SOFEN   0
#define Host_enable_sof()   (UHCON |= (1<<SOFEN))
 enables SOF generation
#define Host_disable_sof()   (UHCON &= ~(1<<SOFEN))
 disables SOF generation
#define Host_send_reset()   (UHCON |= (1<<RESET))
 sends a USB Reset to the device
#define Host_is_reset()   ((UHCON & (1<<RESET)) ? TRUE : FALSE)
 tests if USB Reset running
#define Host_send_resume()   (UHCON |= (1<<RESUME))
 sends a USB Resume to the device
#define Host_is_resume()   ((UHCON & (1<<RESUME)) ? TRUE : FALSE)
 tests if USB Resume running
#define Host_enable_sof_interrupt()   (UHIEN |= (1<<HSOFE))
 enables host start of frame interrupt
#define Host_disable_sof_interrupt()   (UHIEN &= ~(1<<HSOFE))
 enables host start of frame interrupt
#define Is_host_sof_interrupt_enabled()   ((UHIEN & (1<<HSOFE)) ? TRUE : FALSE)
#define Host_is_sof()   ((UHINT & (1<<HSOFI)) ? TRUE : FALSE)
 tests if SOF detected
#define Is_host_sof()   ((UHINT & (1<<HSOFI)) ? TRUE : FALSE)
#define Host_ack_sof()   (UHINT &= ~(1<<HSOFI))
#define Host_enable_hwup_interrupt()   (UHIEN |= (1<<HWUPE))
 enables host wake up interrupt detection
#define Host_disable_hwup_interrupt()   (UHIEN &= ~(1<<HWUPE))
 disables host wake up interrupt detection
#define Is_host_hwup_interrupt_enabled()   ((UHIEN & (1<<HWUPE)) ? TRUE : FALSE)
#define Host_is_hwup()   ((UHINT & (1<<HWUPI)) ? TRUE : FALSE)
 tests if host wake up detected
#define Is_host_hwup()   ((UHINT & (1<<HWUPI)) ? TRUE : FALSE)
 Ack host wake up detection.
#define Host_ack_hwup()   (UHINT &= ~(1<<HWUPI))
#define Host_enable_down_stream_resume_interrupt()   (UHIEN |= (1<<RSMEDE))
 enables host down stream rsm sent interrupt detection
#define Host_disable_down_stream_resume_interrupt()   (UHIEN &= ~(1<<RSMEDE))
 disables host down stream rsm sent interrupt detection
#define Is_host_down_stream_resume_interrupt_enabled()   ((UHIEN & (1<<RSMEDE)) ? TRUE : FALSE)
#define Is_host_down_stream_resume()   ((UHINT & (1<<RSMEDI)) ? TRUE : FALSE)
 Ack host down stream resume sent.
#define Host_ack_down_stream_resume()   (UHINT &= ~(1<<RSMEDI))
#define Host_enable_remote_wakeup_interrupt()   (UHIEN |= (1<<RXRSME))
 enables host remote wake up interrupt detection
#define Host_disable_remote_wakeup_interrupt()   (UHIEN &= ~(1<<RXRSME))
 disables host remote wake up interrupt detection
#define Is_host_remote_wakeup_interrupt_enabled()   ((UHIEN & (1<<RXRSME)) ? TRUE : FALSE)
#define Host_is_remote_wakeup()   ((UHINT & (1<<RXRSMI)) ? TRUE : FALSE)
 tests if host wake up detected
#define Is_host_remote_wakeup()   ((UHINT & (1<<RXRSMI)) ? TRUE : FALSE)
 Ack host wake up detection.
#define Host_ack_remote_wakeup()   (UHINT &= ~(1<<RXRSMI))
#define Host_enable_device_connection_interrupt()   (UHIEN |= (1<<DCONNE))
 enables host device connection interrupt
#define Host_disable_device_connection_interrupt()   (UHIEN &= ~(1<<DCONNE))
 disables USB device connection interrupt
#define Is_host_device_connection_interrupt_enabled()   ((UHIEN & (1<<DCONNE)) ? TRUE : FALSE)
#define Is_device_connection()   (UHINT & (1<<DCONNI))
 tests if a USB device has been detected
#define Host_ack_device_connection()   (UHINT = ~(1<<DCONNI))
 acks device connection
#define Host_enable_device_disconnection_interrupt()   (UHIEN |= (1<<DDISCE))
 enables host device disconnection interrupt
#define Host_disable_device_disconnection_interrupt()   (UHIEN &= ~(1<<DDISCE))
 disables USB device connection interrupt
#define Is_host_device_disconnection_interrupt_enabled()   ((UHIEN & (1<<DDISCE)) ? TRUE : FALSE)
#define Is_device_disconnection()   (UHINT & (1<<DDISCI) ? TRUE : FALSE)
 tests if a USB device has been removed
#define Host_ack_device_disconnection()   (UHINT = ~(1<<DDISCI))
 acks device disconnection
#define Host_enable_reset_interrupt()   (UHIEN |= (1<<RSTE))
 enables host USB reset interrupt
#define Host_disable_reset_interrupt()   (UHIEN &= ~(1<<RSTE))
 disables host USB reset interrupt
#define Is_host_reset_interrupt_enabled()   ((UHIEN & (1<<RSTE)) ? TRUE : FALSE)
#define Host_ack_reset()   (UHINT = ~(1<<RSTI))
 acks host USB reset sent
#define Is_host_reset()   Host_is_reset()
 tests if USB reset has been sent
#define Host_vbus_request()   (OTGCON |= (1<<VBUSREQ))
 switches on VBus
#define Host_clear_vbus_request()   (OTGCON |= (1<<VBUSRQC))
 switches off VBus
#define Host_configure_address(addr)   (UHADDR = addr & MSK_HADDR)
 configures the address to use for the device
#define Is_host_full_speed()   ((USBSTA & (1<<SPEED)) ? TRUE : FALSE)
 Get connected device speed, returns TRUE when in full speed mode.

Detailed Description

These macros manage the USB Host controller.

Define Documentation

 
#define Host_allocate_memory (  )     (UPCFG1X |= (1<<ALLOC))

allocates the current configuration in DPRAM memory

Definition at line 579 of file usb_drv.h.

Referenced by host_config_pipe().

 
#define Host_unallocate_memory (  )     (UPCFG1X &= ~(1<<ALLOC))

un-allocates the current configuration in DPRAM memory

Definition at line 581 of file usb_drv.h.

Referenced by host_disable_all_pipe().

 
#define Host_enable (  )     (USBCON |= (1<<HOST))

enables USB Host function

Definition at line 584 of file usb_drv.h.

#define SOFEN   0

Definition at line 587 of file usb_drv.h.

 
#define Host_enable_sof (  )     (UHCON |= (1<<SOFEN))

enables SOF generation

Definition at line 590 of file usb_drv.h.

 
#define Host_disable_sof (  )     (UHCON &= ~(1<<SOFEN))

disables SOF generation

Definition at line 592 of file usb_drv.h.

 
#define Host_send_reset (  )     (UHCON |= (1<<RESET))

sends a USB Reset to the device

Definition at line 594 of file usb_drv.h.

 
#define Host_is_reset (  )     ((UHCON & (1<<RESET)) ? TRUE : FALSE)

tests if USB Reset running

Definition at line 596 of file usb_drv.h.

 
#define Host_send_resume (  )     (UHCON |= (1<<RESUME))

sends a USB Resume to the device

Definition at line 598 of file usb_drv.h.

 
#define Host_is_resume (  )     ((UHCON & (1<<RESUME)) ? TRUE : FALSE)

tests if USB Resume running

Definition at line 600 of file usb_drv.h.

 
#define Host_enable_sof_interrupt (  )     (UHIEN |= (1<<HSOFE))

enables host start of frame interrupt

Definition at line 603 of file usb_drv.h.

 
#define Host_disable_sof_interrupt (  )     (UHIEN &= ~(1<<HSOFE))

enables host start of frame interrupt

Definition at line 605 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Is_host_sof_interrupt_enabled (  )     ((UHIEN & (1<<HSOFE)) ? TRUE : FALSE)

Definition at line 606 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_is_sof (  )     ((UHINT & (1<<HSOFI)) ? TRUE : FALSE)

tests if SOF detected

Definition at line 608 of file usb_drv.h.

 
#define Is_host_sof (  )     ((UHINT & (1<<HSOFI)) ? TRUE : FALSE)

Definition at line 609 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_ack_sof (  )     (UHINT &= ~(1<<HSOFI))

Definition at line 610 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_enable_hwup_interrupt (  )     (UHIEN |= (1<<HWUPE))

enables host wake up interrupt detection

Definition at line 613 of file usb_drv.h.

 
#define Host_disable_hwup_interrupt (  )     (UHIEN &= ~(1<<HWUPE))

disables host wake up interrupt detection

Definition at line 615 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Is_host_hwup_interrupt_enabled (  )     ((UHIEN & (1<<HWUPE)) ? TRUE : FALSE)

Definition at line 616 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_is_hwup (  )     ((UHINT & (1<<HWUPI)) ? TRUE : FALSE)

tests if host wake up detected

Definition at line 618 of file usb_drv.h.

 
#define Is_host_hwup (  )     ((UHINT & (1<<HWUPI)) ? TRUE : FALSE)

Ack host wake up detection.

Definition at line 620 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_ack_hwup (  )     (UHINT &= ~(1<<HWUPI))

Definition at line 621 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_enable_down_stream_resume_interrupt (  )     (UHIEN |= (1<<RSMEDE))

enables host down stream rsm sent interrupt detection

Definition at line 624 of file usb_drv.h.

 
#define Host_disable_down_stream_resume_interrupt (  )     (UHIEN &= ~(1<<RSMEDE))

disables host down stream rsm sent interrupt detection

Definition at line 626 of file usb_drv.h.

 
#define Is_host_down_stream_resume_interrupt_enabled (  )     ((UHIEN & (1<<RSMEDE)) ? TRUE : FALSE)

Definition at line 627 of file usb_drv.h.

 
#define Is_host_down_stream_resume (  )     ((UHINT & (1<<RSMEDI)) ? TRUE : FALSE)

Ack host down stream resume sent.

Definition at line 629 of file usb_drv.h.

 
#define Host_ack_down_stream_resume (  )     (UHINT &= ~(1<<RSMEDI))

Definition at line 630 of file usb_drv.h.

 
#define Host_enable_remote_wakeup_interrupt (  )     (UHIEN |= (1<<RXRSME))

enables host remote wake up interrupt detection

Definition at line 633 of file usb_drv.h.

 
#define Host_disable_remote_wakeup_interrupt (  )     (UHIEN &= ~(1<<RXRSME))

disables host remote wake up interrupt detection

Definition at line 635 of file usb_drv.h.

 
#define Is_host_remote_wakeup_interrupt_enabled (  )     ((UHIEN & (1<<RXRSME)) ? TRUE : FALSE)

Definition at line 636 of file usb_drv.h.

 
#define Host_is_remote_wakeup (  )     ((UHINT & (1<<RXRSMI)) ? TRUE : FALSE)

tests if host wake up detected

Definition at line 638 of file usb_drv.h.

 
#define Is_host_remote_wakeup (  )     ((UHINT & (1<<RXRSMI)) ? TRUE : FALSE)

Ack host wake up detection.

Definition at line 640 of file usb_drv.h.

 
#define Host_ack_remote_wakeup (  )     (UHINT &= ~(1<<RXRSMI))

Definition at line 641 of file usb_drv.h.

 
#define Host_enable_device_connection_interrupt (  )     (UHIEN |= (1<<DCONNE))

enables host device connection interrupt

Definition at line 644 of file usb_drv.h.

 
#define Host_disable_device_connection_interrupt (  )     (UHIEN &= ~(1<<DCONNE))

disables USB device connection interrupt

Definition at line 646 of file usb_drv.h.

 
#define Is_host_device_connection_interrupt_enabled (  )     ((UHIEN & (1<<DCONNE)) ? TRUE : FALSE)

Definition at line 647 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Is_device_connection (  )     (UHINT & (1<<DCONNI))

tests if a USB device has been detected

Definition at line 649 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_ack_device_connection (  )     (UHINT = ~(1<<DCONNI))

acks device connection

Definition at line 651 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_enable_device_disconnection_interrupt (  )     (UHIEN |= (1<<DDISCE))

enables host device disconnection interrupt

Definition at line 654 of file usb_drv.h.

 
#define Host_disable_device_disconnection_interrupt (  )     (UHIEN &= ~(1<<DDISCE))

disables USB device connection interrupt

Definition at line 656 of file usb_drv.h.

 
#define Is_host_device_disconnection_interrupt_enabled (  )     ((UHIEN & (1<<DDISCE)) ? TRUE : FALSE)

Definition at line 657 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Is_device_disconnection (  )     (UHINT & (1<<DDISCI) ? TRUE : FALSE)

tests if a USB device has been removed

Definition at line 659 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_ack_device_disconnection (  )     (UHINT = ~(1<<DDISCI))

acks device disconnection

Definition at line 661 of file usb_drv.h.

Referenced by usb_general_interrupt().

 
#define Host_enable_reset_interrupt (  )     (UHIEN |= (1<<RSTE))

enables host USB reset interrupt

Definition at line 664 of file usb_drv.h.

 
#define Host_disable_reset_interrupt (  )     (UHIEN &= ~(1<<RSTE))

disables host USB reset interrupt

Definition at line 666 of file usb_drv.h.

 
#define Is_host_reset_interrupt_enabled (  )     ((UHIEN & (1<<RSTE)) ? TRUE : FALSE)

Definition at line 667 of file usb_drv.h.

 
#define Host_ack_reset (  )     (UHINT = ~(1<<RSTI))

acks host USB reset sent

Definition at line 669 of file usb_drv.h.

 
#define Is_host_reset (  )     Host_is_reset()

tests if USB reset has been sent

Definition at line 671 of file usb_drv.h.

 
#define Host_vbus_request (  )     (OTGCON |= (1<<VBUSREQ))

switches on VBus

Definition at line 675 of file usb_drv.h.

 
#define Host_clear_vbus_request (  )     (OTGCON |= (1<<VBUSRQC))

switches off VBus

Definition at line 677 of file usb_drv.h.

#define Host_configure_address ( addr   )     (UHADDR = addr & MSK_HADDR)

configures the address to use for the device

Definition at line 679 of file usb_drv.h.

 
#define Is_host_full_speed (  )     ((USBSTA & (1<<SPEED)) ? TRUE : FALSE)

Get connected device speed, returns TRUE when in full speed mode.

Definition at line 682 of file usb_drv.h.


Generated on Fri Jan 26 17:33:09 2007 for Atmel by  doxygen 1.5.1-p1