| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Pipe Packet Management
Pipe Management

## Detailed Description

Pipe packet management definitions.

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

## 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_IsStatusOK (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
| Determines if pipe's status is OK.
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

## Function Documentation

static void Pipe_ClearIN | ( | const uint8_t | corenum | ) |
| inline static

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 623 of file Pipe.h.

static void Pipe_ClearNAKReceived | ( | void |  | ) |
| inline static

Clears the NAK condition on the currently selected pipe.

See Also
  Pipe_IsNAKReceived() for more details.

Definition at line 671 of file Pipe.h.

static void Pipe_ClearOUT | ( | const uint8_t | corenum | ) |
| inline static

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 636 of file Pipe.h.

static void Pipe_ClearSETUP | ( | void |  | ) |
| inline static

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

Definition at line 612 of file Pipe.h.

static void Pipe_ClearStall | ( | const uint8_t | corenum | ) |
| inline static

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 697 of file Pipe.h.

static uint8_t Pipe_GetBusyBanks | ( | void |  | ) |
| inline static

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 517 of file Pipe.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.c.

static bool Pipe_IsNAKReceived | ( | void |  | ) |
| inline static

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 658 of file Pipe.h.

static bool Pipe_IsOUTReady | ( | const uint8_t | corenum | ) |
| inline static

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 543 of file Pipe.h.

static bool Pipe_IsReadWriteAllowed | ( | const uint8_t | corenum | ) |
| inline static

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 567 of file Pipe.h.

static bool Pipe_IsSETUPSent | ( | void |  | ) |
| inline static

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 601 of file Pipe.h.

static bool Pipe_IsStalled | ( | const uint8_t | corenum | ) |
| inline static

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 684 of file Pipe.h.

static bool Pipe_IsStatusOK | ( | uint8_t | corenum | ) |
| inline static

Determines if pipe's status is OK.

Returns
  Boolean `true` if the current pipe's status is OK , `false` otherwise.

Definition at line 586 of file Pipe.h.