LUFA Library  140302
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Pipe Packet Management (AVR8)

Pipe packet management definitions for the Atmel AVR8 architecture. More...

Functions

static void Pipe_ClearIN (void) ATTR_ALWAYS_INLINE
 
static void Pipe_ClearNAKReceived (void) ATTR_ALWAYS_INLINE
 
static void Pipe_ClearOUT (void) ATTR_ALWAYS_INLINE
 
static void Pipe_ClearSETUP (void) ATTR_ALWAYS_INLINE
 
static void Pipe_ClearStall (void) ATTR_ALWAYS_INLINE
 
static uint8_t Pipe_GetBusyBanks (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static bool Pipe_IsINReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static bool Pipe_IsNAKReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static bool Pipe_IsOUTReady (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static bool Pipe_IsReadWriteAllowed (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static bool Pipe_IsSETUPSent (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static bool Pipe_IsStalled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 

Detailed Description

Functions, macros, variables, enums and types related to packet management of pipes.

Function Documentation

static void Pipe_ClearIN ( void  )
inlinestatic

Acknowledges the reception of a setup IN request from the attached device on the currently selected pipe, freeing the bank ready for the next packet.

static void Pipe_ClearNAKReceived ( void  )
inlinestatic

Clears the NAK condition on the currently selected pipe.

See Also
Pipe_IsNAKReceived() for more details.
static void Pipe_ClearOUT ( void  )
inlinestatic

Sends the currently selected pipe's contents to the device as an OUT packet on the selected pipe, freeing the bank ready for the next packet.

static void Pipe_ClearSETUP ( void  )
inlinestatic

Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.

static void Pipe_ClearStall ( void  )
inlinestatic

Clears the STALL condition detection flag on the currently selected pipe, but does not clear the STALL condition itself (this must be done via a ClearFeature control request to the device).

static uint8_t Pipe_GetBusyBanks ( void  )
inlinestatic

Retrieves the number of busy banks in the currently selected pipe, which have been queued for transmission via the Pipe_ClearOUT() command, or are awaiting acknowledgement via the Pipe_ClearIN() command.

Returns
Total number of busy banks in the selected pipe.
static bool Pipe_IsINReceived ( void  )
inlinestatic

Determines if a packet has been received on the currently selected IN pipe from the attached device.

Returns
Boolean true if the current pipe has received an IN packet, false otherwise.
static bool Pipe_IsNAKReceived ( void  )
inlinestatic

Determines if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on the currently selected pipe. This occurs when the host sends a packet to the device, but the device is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been received, it must be cleared using Pipe_ClearNAKReceived() before the previous (or any other) packet can be re-sent.

Returns
Boolean true if an NAK has been received on the current pipe, false otherwise.
static bool Pipe_IsOUTReady ( void  )
inlinestatic

Determines if the currently selected OUT pipe is ready to send an OUT packet to the attached device.

Returns
Boolean true if the current pipe is ready for an OUT packet, false otherwise.
static bool Pipe_IsReadWriteAllowed ( void  )
inlinestatic

Determines if the currently selected pipe may be read from (if data is waiting in the pipe bank and the pipe is an IN direction, or if the bank is not yet full if the pipe is an OUT direction). This function will return false if an error has occurred in the pipe, or if the pipe is an IN direction and no packet (or an empty packet) has been received, or if the pipe is an OUT direction and the pipe bank is full.

Note
This function is not valid on CONTROL type pipes.
Returns
Boolean true if the currently selected pipe may be read from or written to, depending on its direction.
static bool Pipe_IsSETUPSent ( void  )
inlinestatic

Determines if no SETUP request is currently being sent to the attached device on the selected CONTROL type pipe.

Returns
Boolean true if the current pipe is ready for a SETUP packet, false otherwise.
static bool Pipe_IsStalled ( void  )
inlinestatic

Determines if the currently selected pipe has had the STALL condition set by the attached device.

Returns
Boolean true if the current pipe has been stalled by the attached device, false otherwise.