LUFA Library

USB OTG definitions for the AVR8 microcontrollers. More...

Macros

#define USB_OTG_SRP_VBUS   (1 << SRPSEL)
 
#define USB_OTG_STP_DATA   0
 

Functions

static void USB_OTG_Device_CancelHNPRequest (void) ATTR_ALWAYS_INLINE
 
static void USB_OTG_Device_InitiateSRP (const uint8_t SRPTypeMask) ATTR_ALWAYS_INLINE
 
static bool USB_OTG_Device_IsSendingHNP (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static void USB_OTG_Device_RequestHNP (void) ATTR_ALWAYS_INLINE
 
static void USB_OTG_Host_AcceptHNP (void) ATTR_ALWAYS_INLINE
 
static bool USB_OTG_Host_IsHNPReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static void USB_OTG_Host_RejectHNP (void) ATTR_ALWAYS_INLINE
 

Detailed Description

Architecture specific USB OTG definitions for the Atmel 8-bit AVR microcontrollers.

Macro Definition Documentation

◆ USB_OTG_SRP_VBUS

#define USB_OTG_SRP_VBUS   (1 << SRPSEL)

Mask for the VBUS pulsing method of SRP, supported by some OTG devices.

See also
USB_OTG_Device_InitiateSRP().

◆ USB_OTG_STP_DATA

#define USB_OTG_STP_DATA   0

Mask for the Data + pulsing method of SRP, supported by some OTG devices.

See also
USB_OTG_Device_InitiateSRP().

Function Documentation

◆ USB_OTG_Device_CancelHNPRequest()

static void USB_OTG_Device_CancelHNPRequest ( void  )
inlinestatic

Cancel a Host Negotiation Protocol request. This stops a pending HNP request to the other connected device.

◆ USB_OTG_Device_InitiateSRP()

static void USB_OTG_Device_InitiateSRP ( const uint8_t  SRPTypeMask)
inlinestatic

Initiates a Session Request Protocol request. Most OTG devices turn off VBUS when the USB interface is not in use, to conserve power. Sending a SRP to a USB OTG device running in host mode indicates that VBUS should be applied and a session started.

There are two different methods of sending a SRP - either pulses on the VBUS line, or by pulsing the Data + line via the internal pull-up resistor.

Parameters
[in]SRPTypeMaskMask indicating the type of SRP to use, either USB_OTG_SRP_VBUS or USB_OTG_STP_DATA.

◆ USB_OTG_Device_IsSendingHNP()

static bool USB_OTG_Device_IsSendingHNP ( void  )
inlinestatic

Determines if the device is currently sending a HNP to an attached host.

Returns
Boolean true if currently sending a HNP to the other connected device, false otherwise

◆ USB_OTG_Device_RequestHNP()

static void USB_OTG_Device_RequestHNP ( void  )
inlinestatic

Initiate a Host Negotiation Protocol request. This indicates to the other connected device that the device wishes to change device/host roles.

◆ USB_OTG_Host_AcceptHNP()

static void USB_OTG_Host_AcceptHNP ( void  )
inlinestatic

Accepts a HNP from a connected device, indicating that both devices should exchange device/host roles.

◆ USB_OTG_Host_IsHNPReceived()

static bool USB_OTG_Host_IsHNPReceived ( void  )
inlinestatic

Indicates if the connected device is currently sending a HNP request.

Returns
Boolean true if a HNP is currently being issued by the connected device, false otherwise.

◆ USB_OTG_Host_RejectHNP()

static void USB_OTG_Host_RejectHNP ( void  )
inlinestatic

Rejects a HNP from a connected device, indicating that both devices should remain in their current device/host roles.