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

Endpoint packet management definitions for the ilabs EFM32 Giant Gecko architecture. More...

Functions

static INLINENON void Endpoint_AbortPendingIN (void)
 
static INLINENON void Endpoint_ClearIN (void) ATTR_ALWAYS_INLINE2
 
static INLINENON void Endpoint_ClearOUT (void) ATTR_ALWAYS_INLINE2
 
static INLINENON void Endpoint_ClearSETUP (void) ATTR_ALWAYS_INLINE2
 
static INLINENON void Endpoint_ClearStall (void) ATTR_ALWAYS_INLINE2
 
static INLINENON uint8_t Endpoint_GetBusyBanks (void) ATTR_ALWAYS_INLINE2 ATTR_WARN_UNUSED_RESULT
 
static INLINENON bool Endpoint_IsINReady (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE2
 
static INLINENON bool Endpoint_IsOUTReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE2
 
static INLINENON bool Endpoint_IsReadWriteAllowed (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE2
 
static INLINENON bool Endpoint_IsSETUPReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE2
 
static INLINENON bool Endpoint_IsStalled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE2
 
static INLINENON void Endpoint_StallTransaction (void) ATTR_ALWAYS_INLINE2
 

Detailed Description

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

Function Documentation

static INLINENON void Endpoint_AbortPendingIN ( void  )
static

Aborts all pending IN transactions on the currently selected endpoint, once the bank has been queued for transmission to the host via Endpoint_ClearIN(). This function will terminate all queued transactions, resetting the endpoint banks ready for a new packet.

static INLINENON void Endpoint_ClearIN ( void  )
static

Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet.

static INLINENON void Endpoint_ClearOUT ( void  )
static

Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint for the next packet.

static INLINENON void Endpoint_ClearSETUP ( void  )
static

Clears a received SETUP packet on the currently selected CONTROL type endpoint, freeing up the endpoint for the next packet.

Note
This is not applicable for non CONTROL type endpoints.
static INLINENON void Endpoint_ClearStall ( void  )
static

Clears the STALL condition on the currently selected endpoint.

static INLINENON uint8_t Endpoint_GetBusyBanks ( void  )
static

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

Returns
Total number of busy banks in the selected endpoint.
static INLINENON bool Endpoint_IsINReady ( void  )
static

Determines if the selected IN endpoint is ready for a new packet to be sent to the host.

Returns
Boolean true if the current endpoint is ready for an IN packet, false otherwise.
static INLINENON bool Endpoint_IsOUTReceived ( void  )
static

Determines if the selected OUT endpoint has received new packet from the host.

Returns
Boolean true if current endpoint is has received an OUT packet, false otherwise.
static INLINENON bool Endpoint_IsReadWriteAllowed ( void  )
static

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

Returns
Boolean true if the currently selected endpoint may be read from or written to, depending on its direction.
static INLINENON bool Endpoint_IsSETUPReceived ( void  )
static

Determines if the current CONTROL type endpoint has received a SETUP packet.

Returns
Boolean true if the selected endpoint has received a SETUP packet, false otherwise.
static INLINENON bool Endpoint_IsStalled ( void  )
static

Determines if the currently selected endpoint is stalled, false otherwise.

Returns
Boolean true if the currently selected endpoint is stalled, false otherwise.
static INLINENON void Endpoint_StallTransaction ( void  )
static

Stalls the current endpoint, indicating to the host that a logical problem occurred with the indicated endpoint and that the current transfer sequence should be aborted. This provides a way for devices to indicate invalid commands to the host so that the current transfer can be aborted and the host can begin its own recovery sequence.

The currently selected endpoint remains stalled until either the Endpoint_ClearStall() macro is called, or the host issues a CLEAR FEATURE request to the device for the currently selected endpoint.