Configuration macros for endpoints
[USB low level drivers]


Módulos

 USB device controller drivers
 USB endpoint drivers

Definiciones

#define Usb_build_ep_config0(type, dir, nyet)   ((type<<6) | (nyet<<1) | (dir))
#define Usb_build_ep_config1(size, bank)   ((size<<4) | (bank<<2) )
#define usb_configure_endpoint(num, type, dir, size, bank, nyet)
#define Usb_enable_regulator()   (UHWCON |= (1<<UVREGE))
#define Usb_disable_uid_pin()   (UHWCON &= ~(1<<UIDE))
#define Usb_force_device_mode()   (Usb_disable_uid_pin(), UHWCON |= (1<<UIMOD))
#define Usb_enable()   (USBCON |= ((1<<USBE) | (1<<OTGPADE)))
#define Usb_disable()   (USBCON &= ~((1<<USBE) | (1<<OTGPADE)))
#define Usb_select_device()   (USBCON &= ~(1<<HOST))
#define Usb_freeze_clock()   (USBCON |= (1<<FRZCLK))
#define Usb_unfreeze_clock()   (USBCON &= ~(1<<FRZCLK))
#define Is_usb_id_device()   ((USBSTA & (1<<ID)) ? TRUE : FALSE)
#define Is_usb_vbus_high()   ((USBSTA & (1<<VBUS)) ? TRUE : FALSE)
#define Is_usb_vbus_low()   ((USBSTA & (1<<VBUS)) ? FALSE : TRUE)
#define Usb_write_word_enum_struc(x)   (wSWAP(x))

Descripción detallada

List of the standard macro used to configure pipes and endpoints

Documentación de las definiciones

 
#define Is_usb_id_device (  )     ((USBSTA & (1<<ID)) ? TRUE : FALSE)

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

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

#define Usb_build_ep_config0 ( type,
dir,
nyet   )     ((type<<6) | (nyet<<1) | (dir))

#define Usb_build_ep_config1 ( size,
bank   )     ((size<<4) | (bank<<2) )

#define usb_configure_endpoint ( num,
type,
dir,
size,
bank,
nyet   ) 

Valor:

( Usb_select_endpoint(num),              \
                                      usb_config_ep(Usb_build_ep_config0(type, dir, nyet),\
                                                    Usb_build_ep_config1(size, bank)    ))

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

Disable both USB interface and Vbus pad.

 
#define Usb_disable_uid_pin (  )     (UHWCON &= ~(1<<UIDE))

Disable external UID pin.

 
#define Usb_enable (  )     (USBCON |= ((1<<USBE) | (1<<OTGPADE)))

Enable both USB interface and Vbus pad.

 
#define Usb_enable_regulator (  )     (UHWCON |= (1<<UVREGE))

Enable internal USB pads regulator.

 
#define Usb_force_device_mode (  )     (Usb_disable_uid_pin(), UHWCON |= (1<<UIMOD))

Disable external UID pin and force device mode.

 
#define Usb_freeze_clock (  )     (USBCON |= (1<<FRZCLK))

Stop internal USB clock in interface (freeze the interface register).

 
#define Usb_select_device (  )     (USBCON &= ~(1<<HOST))

 
#define Usb_unfreeze_clock (  )     (USBCON &= ~(1<<FRZCLK))

#define Usb_write_word_enum_struc (  )     (wSWAP(x))

Usb_write_word_enum_struc This macro help to fill the U16 fill in USB enumeration struct. Depending on the CPU architecture, the macro swap or not the nibbles

Parámetros:
x (U16) the 16 bit word to be written
Devuelve:
(U16) the 16 bit word written


Generado el Sun Jun 21 23:52:37 2009 para CursorControl por  doxygen 1.5.9