| 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
Macros | Functions | Variables
Endpoint Management (LPC11Uxx, LPC1347)
Endpoint Management

## Detailed Description

Endpoint management definitions for the NXP LPC11Uxx and LPC1347 architecture.

Functions, macros and enums related to endpoint management when in USB Device mode. This module contains the endpoint management macros, as well as endpoint interrupt and data send/receive functions for various data types.

## Macros
#define | USED_PHYSICAL_ENDPOINTS (ENDPOINT_DETAILS_MAXEP * 2)/* This macro effect memory size of the DCD */
#define | USB_EN (0x1 << 7) /* Device Enable */
#define | USB_SETUP_RCVD (0x1 << 8) /* SETUP token received */
#define | USB_PLL_ON (0x1 << 9) /* PLL is always ON */
#define | USB_LPM (0x1 << 11) /* LPM is supported */
#define | USB_IntOnNAK_AO (0x1 << 12) /* Device Interrupt on NAK BULK OUT */
#define | USB_IntOnNAK_AI (0x1 << 13) /* Device Interrupt on NAK BULK IN */
#define | USB_IntOnNAK_CO (0x1 << 14) /* Device Interrupt on NAK CTRL OUT */
#define | USB_IntOnNAK_CI (0x1 << 15) /* Device Interrupt on NAK CTRL IN */
#define | USB_DCON (0x1 << 16) /* Device connect */
#define | USB_DSUS (0x1 << 17) /* Device Suspend */
#define | USB_LPM_SUS (0x1 << 19) /* LPM suspend */
#define | USB_REMOTE_WAKE (0x1 << 20) /* LPM Remote Wakeup */
#define | USB_DCON_C (0x1 << 24) /* Device connection change */
#define | USB_DSUS_C (0x1 << 25) /* Device SUSPEND change */
#define | USB_DRESET_C (0x1 << 26) /* Device RESET */
#define | USB_VBUS_DBOUNCE (0x1 << 28) /* Device VBUS detect */
#define | EP0_INT (0x1 << 0)
#define | EP1_INT (0x1 << 1)
#define | EP2_INT (0x1 << 2)
#define | EP3_INT (0x1 << 3)
#define | EP4_INT (0x1 << 4)
#define | EP5_INT (0x1 << 5)
#define | EP6_INT (0x1 << 6)
#define | EP7_INT (0x1 << 7)
#define | EP8_INT (0x1 << 8)
#define | EP9_INT (0x1 << 9)
#define | FRAME_INT (0x1 << 30)
#define | DEV_STAT_INT (0x80000000)
#define | PKT_LNGTH_MASK 0x000003FF
#define | ERR_NOERROR 0x00
#define | ERR_PID_ENCODE 0x01
#define | ERR_UNKNOWN_PID 0x02
#define | ERR_UNEXPECT_PKT 0x03
#define | ERR_TCRC 0x04
#define | ERR_DCRC 0x05
#define | ERR_TIMEOUT 0x06
#define | ERR_BABBIE 0x07
#define | ERR_EOF_PKT 0x08
#define | ERR_TX_RX_NAK 0x09
#define | ERR_SENT_STALL 0x0A
#define | ERR_BUF_OVERRUN 0x0B
#define | ERR_SENT_EPT_PKT 0x0C
#define | ERR_BIT_STUFF 0x0D
#define | ERR_SYNC 0x0E
#define | ERR_TOGGLE_BIT 0x0F

## Functions
void | WrCmdDat (uint32_t cmd, uint32_t val)
void | WrCmd (uint32_t cmd)
void | HAL11UXX_WriteEndPoint (uint8_t EPNum, uint8_t *pData, uint32_t cnt)
void | DcdDataTransfer (uint8_t EPNum, uint8_t *pData, uint32_t length)
void | Endpoint_Streaming (uint8_t corenum, uint8_t *buffer, uint16_t packetsize, uint16_t totalpackets, uint16_t dummypackets)
bool | Endpoint_ConfigureEndpoint (uint8_t corenum, const uint8_t Number, const uint8_t Type, const uint8_t Direction, const uint16_t Size, const uint8_t Banks)
static PRAGMA_ALWAYS_INLINE void | Endpoint_ResetEndpoint (const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_EnableEndpoint (void) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_DisableEndpoint (void) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE bool | Endpoint_IsEnabled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE uint8_t | Endpoint_GetBusyBanks (void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT
static void | Endpoint_AbortPendingIN (void)
static PRAGMA_ALWAYS_INLINE bool | Endpoint_IsConfigured (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE uint8_t | Endpoint_GetEndpointInterrupts (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE bool | Endpoint_HasEndpointInterrupted (const uint8_t EndpointNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE uint16_t | Endpoint_BytesInEndpoint (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE bool | Endpoint_IsINReady (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE bool | Endpoint_IsOUTReceived (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE bool | Endpoint_IsSETUPReceived (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_ClearSETUP (uint8_t corenum) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_ClearIN (uint8_t corenum) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_ClearOUT (uint8_t corenum) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_StallTransaction (uint8_t corenum) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_ClearStall (uint8_t corenum) ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE bool | Endpoint_IsStalled (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static PRAGMA_ALWAYS_INLINE void | Endpoint_ResetDataToggle (uint8_t corenum) ATTR_ALWAYS_INLINE
void | Endpoint_ClearStatusStage (uint8_t corenum)
uint8_t | Endpoint_WaitUntilReady (void)

## Variables
USB_CMD_STAT | EndPointCmdStsList [10][2]
uint8_t | USB_Device_ControlEndpointSize

## Macro Definition Documentation

#define DEV_STAT_INT (0x80000000)

Definition at line 170 of file Endpoint_LPC11Uxx.h.

#define EP0_INT (0x1 << 0)

Definition at line 159 of file Endpoint_LPC11Uxx.h.

#define EP1_INT (0x1 << 1)

Definition at line 160 of file Endpoint_LPC11Uxx.h.

#define EP2_INT (0x1 << 2)

Definition at line 161 of file Endpoint_LPC11Uxx.h.

#define EP3_INT (0x1 << 3)

Definition at line 162 of file Endpoint_LPC11Uxx.h.

#define EP4_INT (0x1 << 4)

Definition at line 163 of file Endpoint_LPC11Uxx.h.

#define EP5_INT (0x1 << 5)

Definition at line 164 of file Endpoint_LPC11Uxx.h.

#define EP6_INT (0x1 << 6)

Definition at line 165 of file Endpoint_LPC11Uxx.h.

#define EP7_INT (0x1 << 7)

Definition at line 166 of file Endpoint_LPC11Uxx.h.

#define EP8_INT (0x1 << 8)

Definition at line 167 of file Endpoint_LPC11Uxx.h.

#define EP9_INT (0x1 << 9)

Definition at line 168 of file Endpoint_LPC11Uxx.h.

#define ERR_BABBIE 0x07

Definition at line 181 of file Endpoint_LPC11Uxx.h.

#define ERR_BIT_STUFF 0x0D

Definition at line 187 of file Endpoint_LPC11Uxx.h.

#define ERR_BUF_OVERRUN 0x0B

Definition at line 185 of file Endpoint_LPC11Uxx.h.

#define ERR_DCRC 0x05

Definition at line 179 of file Endpoint_LPC11Uxx.h.

#define ERR_EOF_PKT 0x08

Definition at line 182 of file Endpoint_LPC11Uxx.h.

#define ERR_NOERROR 0x00

Definition at line 174 of file Endpoint_LPC11Uxx.h.

#define ERR_PID_ENCODE 0x01

Definition at line 175 of file Endpoint_LPC11Uxx.h.

#define ERR_SENT_EPT_PKT 0x0C

Definition at line 186 of file Endpoint_LPC11Uxx.h.

#define ERR_SENT_STALL 0x0A

Definition at line 184 of file Endpoint_LPC11Uxx.h.

#define ERR_SYNC 0x0E

Definition at line 188 of file Endpoint_LPC11Uxx.h.

#define ERR_TCRC 0x04

Definition at line 178 of file Endpoint_LPC11Uxx.h.

#define ERR_TIMEOUT 0x06

Definition at line 180 of file Endpoint_LPC11Uxx.h.

#define ERR_TOGGLE_BIT 0x0F

Definition at line 189 of file Endpoint_LPC11Uxx.h.

#define ERR_TX_RX_NAK 0x09

Definition at line 183 of file Endpoint_LPC11Uxx.h.

#define ERR_UNEXPECT_PKT 0x03

Definition at line 177 of file Endpoint_LPC11Uxx.h.

#define ERR_UNKNOWN_PID 0x02

Definition at line 176 of file Endpoint_LPC11Uxx.h.

#define FRAME_INT (0x1 << 30)

Definition at line 169 of file Endpoint_LPC11Uxx.h.

#define PKT_LNGTH_MASK 0x000003FF

Definition at line 172 of file Endpoint_LPC11Uxx.h.

#define USB_DCON (0x1 << 16) /* Device connect */

Definition at line 150 of file Endpoint_LPC11Uxx.h.

#define USB_DCON_C (0x1 << 24) /* Device connection change */

Definition at line 154 of file Endpoint_LPC11Uxx.h.

#define USB_DRESET_C (0x1 << 26) /* Device RESET */

Definition at line 156 of file Endpoint_LPC11Uxx.h.

#define USB_DSUS (0x1 << 17) /* Device Suspend */

Definition at line 151 of file Endpoint_LPC11Uxx.h.

#define USB_DSUS_C (0x1 << 25) /* Device SUSPEND change */

Definition at line 155 of file Endpoint_LPC11Uxx.h.

#define USB_EN (0x1 << 7) /* Device Enable */

Definition at line 142 of file Endpoint_LPC11Uxx.h.

#define USB_IntOnNAK_AI (0x1 << 13) /* Device Interrupt on NAK BULK IN */

Definition at line 147 of file Endpoint_LPC11Uxx.h.

#define USB_IntOnNAK_AO (0x1 << 12) /* Device Interrupt on NAK BULK OUT */

Definition at line 146 of file Endpoint_LPC11Uxx.h.

#define USB_IntOnNAK_CI (0x1 << 15) /* Device Interrupt on NAK CTRL IN */

Definition at line 149 of file Endpoint_LPC11Uxx.h.

#define USB_IntOnNAK_CO (0x1 << 14) /* Device Interrupt on NAK CTRL OUT */

Definition at line 148 of file Endpoint_LPC11Uxx.h.

#define USB_LPM (0x1 << 11) /* LPM is supported */

Definition at line 145 of file Endpoint_LPC11Uxx.h.

#define USB_LPM_SUS (0x1 << 19) /* LPM suspend */

Definition at line 152 of file Endpoint_LPC11Uxx.h.

#define USB_PLL_ON (0x1 << 9) /* PLL is always ON */

Definition at line 144 of file Endpoint_LPC11Uxx.h.

#define USB_REMOTE_WAKE (0x1 << 20) /* LPM Remote Wakeup */

Definition at line 153 of file Endpoint_LPC11Uxx.h.

#define USB_SETUP_RCVD (0x1 << 8) /* SETUP token received */

Definition at line 143 of file Endpoint_LPC11Uxx.h.

#define USB_VBUS_DBOUNCE (0x1 << 28) /* Device VBUS detect */

Definition at line 157 of file Endpoint_LPC11Uxx.h.

#define USED_PHYSICAL_ENDPOINTS (ENDPOINT_DETAILS_MAXEP * 2)/* This macro effect memory size of the DCD */

Definition at line 140 of file Endpoint_LPC11Uxx.h.

## Function Documentation

void DcdDataTransfer | ( | uint8_t | EPNum,
|  | uint8_t * | pData,
|  | uint32_t | length
| ) |  |

static void Endpoint_AbortPendingIN | ( | void |  | ) |
| inline static

Definition at line 244 of file Endpoint_LPC11Uxx.h.

static uint16_t Endpoint_BytesInEndpoint | ( | uint8_t | corenum | ) |
| inline static

Definition at line 276 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearIN | ( | uint8_t | corenum | ) |
| inline static

Definition at line 325 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearOUT | ( | uint8_t | corenum | ) |
| inline static

Definition at line 341 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearSETUP | ( | uint8_t | corenum | ) |
| inline static

Definition at line 316 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearStall | ( | uint8_t | corenum | ) |
| inline static

Definition at line 365 of file Endpoint_LPC11Uxx.h.

void Endpoint_ClearStatusStage | ( | uint8_t | corenum | ) |

Definition at line 124 of file Endpoint.c.

bool Endpoint_ConfigureEndpoint | ( | uint8_t | corenum,
|  | const uint8_t | Number,
|  | const uint8_t | Type,
|  | const uint8_t | Direction,
|  | const uint16_t | Size,
|  | const uint8_t | Banks
| ) |  |

static void Endpoint_DisableEndpoint | ( | void |  | ) |
| inline static

Definition at line 225 of file Endpoint_LPC11Uxx.h.

static void Endpoint_EnableEndpoint | ( | void |  | ) |
| inline static

Definition at line 219 of file Endpoint_LPC11Uxx.h.

static uint8_t Endpoint_GetBusyBanks | ( | void |  | ) |
| inline static

Definition at line 239 of file Endpoint_LPC11Uxx.h.

static uint8_t Endpoint_GetEndpointInterrupts | ( | void |  | ) |
| inline static

Definition at line 259 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_HasEndpointInterrupted | ( | const uint8_t | EndpointNumber | ) |
| inline static

Definition at line 268 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsConfigured | ( | void |  | ) |
| inline static

Definition at line 250 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsEnabled | ( | void |  | ) |
| inline static

Definition at line 231 of file Endpoint_LPC11Uxx.h.

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

Definition at line 289 of file Endpoint_LPC11Uxx.h.

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

Definition at line 299 of file Endpoint_LPC11Uxx.h.

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

Definition at line 308 of file Endpoint_LPC11Uxx.h.

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

Definition at line 373 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ResetDataToggle | ( | uint8_t | corenum | ) |
| inline static

Definition at line 381 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ResetEndpoint | ( | const uint8_t | EndpointNumber | ) |
| inline static

Definition at line 213 of file Endpoint_LPC11Uxx.h.

static void Endpoint_StallTransaction | ( | uint8_t | corenum | ) |
| inline static

Definition at line 354 of file Endpoint_LPC11Uxx.h.

void Endpoint_Streaming | ( | uint8_t | corenum,
|  | uint8_t * | buffer,
|  | uint16_t | packetsize,
|  | uint16_t | totalpackets,
|  | uint16_t | dummypackets
| ) |  |

uint8_t Endpoint_WaitUntilReady | ( | void |  | ) |

Definition at line 135 of file Endpoint.c.

void HAL11UXX_WriteEndPoint | ( | uint8_t | EPNum,
|  | uint8_t * | pData,
|  | uint32_t | cnt
| ) |  |

void WrCmd | ( | uint32_t | cmd | ) |

void WrCmdDat | ( | uint32_t | cmd,
|  | uint32_t | val
| ) |  |

## Variable Documentation

USB_CMD_STAT EndPointCmdStsList[10][2]

uint8_t USB_Device_ControlEndpointSize