LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Pipe Packet Management (LPC)

Pipe packet management definitions for the NXP LPC architecture. More...

Functions

static uint8_t Pipe_GetBusyBanks (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 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.
 
bool Pipe_IsINReceived (const uint8_t corenum) ATTR_WARN_UNUSED_RESULT
 Determines if a packet has been received on the currently selected IN pipe from the attached device.
 
static bool Pipe_IsOUTReady (const uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 Determines if the currently selected OUT pipe is ready to send an OUT packet to the attached device.
 
static bool Pipe_IsReadWriteAllowed (const uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 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.
 
static bool Pipe_IsSETUPSent (void) ATTR_DEPRECATED ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 Determines if no SETUP request is currently being sent to the attached device on the selected CONTROL type pipe.
 
static void Pipe_ClearSETUP (void) ATTR_DEPRECATED ATTR_ALWAYS_INLINE
 
static void Pipe_ClearIN (const uint8_t corenum) ATTR_ALWAYS_INLINE
 
static void Pipe_ClearOUT (const uint8_t corenum) ATTR_ALWAYS_INLINE
 
static bool Pipe_IsNAKReceived (void) ATTR_DEPRECATED ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 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.
 
static void Pipe_ClearNAKReceived (void) ATTR_DEPRECATED ATTR_ALWAYS_INLINE
 
static bool Pipe_IsStalled (const uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 Determines if the currently selected pipe has had the STALL condition set by the attached device.
 
static void Pipe_ClearStall (const uint8_t corenum) ATTR_ALWAYS_INLINE
 

Detailed Description

Pipe packet management definitions for the NXP LPC architecture.

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

Function Documentation

static void Pipe_ClearIN ( const uint8_t  corenum)
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.

Parameters
corenum: USB port number

Definition at line 574 of file Pipe_LPC.h.

static void Pipe_ClearNAKReceived ( void  )
inlinestatic

Clears the NAK condition on the currently selected pipe.

See Also
Pipe_IsNAKReceived() for more details.

Definition at line 622 of file Pipe_LPC.h.

static void Pipe_ClearOUT ( const uint8_t  corenum)
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.

Parameters
corenum: USB port number

Definition at line 587 of file Pipe_LPC.h.

static void Pipe_ClearSETUP ( void  )
inlinestatic

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

Definition at line 563 of file Pipe_LPC.h.

static void Pipe_ClearStall ( const uint8_t  corenum)
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).

Parameters
corenum: USB port number

Definition at line 648 of file Pipe_LPC.h.

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.

Definition at line 481 of file Pipe_LPC.h.

bool Pipe_IsINReceived ( const uint8_t  corenum)

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

Parameters
corenum: USB port number
Returns
Boolean true if the current pipe has received an IN packet, false otherwise.

Definition at line 137 of file Pipe_LPC.c.

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.

Definition at line 609 of file Pipe_LPC.h.

static bool Pipe_IsOUTReady ( const uint8_t  corenum)
inlinestatic

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

Parameters
corenum: USB port number
Returns
Boolean true if the current pipe is ready for an OUT packet, false otherwise.

Definition at line 507 of file Pipe_LPC.h.

static bool Pipe_IsReadWriteAllowed ( const uint8_t  corenum)
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.
Parameters
corenum: USB port number
Returns
Boolean true if the currently selected pipe may be read from or written to, depending on its direction.

Definition at line 531 of file Pipe_LPC.h.

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.

Definition at line 552 of file Pipe_LPC.h.

static bool Pipe_IsStalled ( const uint8_t  corenum)
inlinestatic

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

Parameters
corenum: USB port number
Returns
Boolean true if the current pipe has been stalled by the attached device, false otherwise.

Definition at line 635 of file Pipe_LPC.h.