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

Endpoint management definitions for the NXP LPC11Uxx architecture. More...

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 *buffer, uint16_t packetsize, uint16_t totalpackets, uint16_t dummypackets)
 
bool Endpoint_ConfigureEndpoint (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 (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE bool Endpoint_IsINReady (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE bool Endpoint_IsOUTReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE bool Endpoint_IsSETUPReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE void Endpoint_ClearSETUP (void) ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE void Endpoint_ClearIN (void) ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE void Endpoint_ClearOUT (void) ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE void Endpoint_StallTransaction (void) ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE void Endpoint_ClearStall (void) ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE bool Endpoint_IsStalled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 
static PRAGMA_ALWAYS_INLINE void Endpoint_ResetDataToggle (void) ATTR_ALWAYS_INLINE
 
void Endpoint_ClearStatusStage (void)
 
uint8_t Endpoint_WaitUntilReady (void)
 

Variables

USB_CMD_STAT EndPointCmdStsList [10][2]
 
uint8_t USB_Device_ControlEndpointSize
 

Detailed Description

Endpoint management definitions for the NXP LPC11Uxx 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.

Macro Definition Documentation

#define DEV_STAT_INT   (0x80000000)

Definition at line 167 of file Endpoint_LPC11Uxx.h.

#define EP0_INT   (0x1 << 0)

Definition at line 156 of file Endpoint_LPC11Uxx.h.

#define EP1_INT   (0x1 << 1)

Definition at line 157 of file Endpoint_LPC11Uxx.h.

#define EP2_INT   (0x1 << 2)

Definition at line 158 of file Endpoint_LPC11Uxx.h.

#define EP3_INT   (0x1 << 3)

Definition at line 159 of file Endpoint_LPC11Uxx.h.

#define EP4_INT   (0x1 << 4)

Definition at line 160 of file Endpoint_LPC11Uxx.h.

#define EP5_INT   (0x1 << 5)

Definition at line 161 of file Endpoint_LPC11Uxx.h.

#define EP6_INT   (0x1 << 6)

Definition at line 162 of file Endpoint_LPC11Uxx.h.

#define EP7_INT   (0x1 << 7)

Definition at line 163 of file Endpoint_LPC11Uxx.h.

#define EP8_INT   (0x1 << 8)

Definition at line 164 of file Endpoint_LPC11Uxx.h.

#define EP9_INT   (0x1 << 9)

Definition at line 165 of file Endpoint_LPC11Uxx.h.

#define ERR_BABBIE   0x07

Definition at line 178 of file Endpoint_LPC11Uxx.h.

#define ERR_BIT_STUFF   0x0D

Definition at line 184 of file Endpoint_LPC11Uxx.h.

#define ERR_BUF_OVERRUN   0x0B

Definition at line 182 of file Endpoint_LPC11Uxx.h.

#define ERR_DCRC   0x05

Definition at line 176 of file Endpoint_LPC11Uxx.h.

#define ERR_EOF_PKT   0x08

Definition at line 179 of file Endpoint_LPC11Uxx.h.

#define ERR_NOERROR   0x00

Definition at line 171 of file Endpoint_LPC11Uxx.h.

#define ERR_PID_ENCODE   0x01

Definition at line 172 of file Endpoint_LPC11Uxx.h.

#define ERR_SENT_EPT_PKT   0x0C

Definition at line 183 of file Endpoint_LPC11Uxx.h.

#define ERR_SENT_STALL   0x0A

Definition at line 181 of file Endpoint_LPC11Uxx.h.

#define ERR_SYNC   0x0E

Definition at line 185 of file Endpoint_LPC11Uxx.h.

#define ERR_TCRC   0x04

Definition at line 175 of file Endpoint_LPC11Uxx.h.

#define ERR_TIMEOUT   0x06

Definition at line 177 of file Endpoint_LPC11Uxx.h.

#define ERR_TOGGLE_BIT   0x0F

Definition at line 186 of file Endpoint_LPC11Uxx.h.

#define ERR_TX_RX_NAK   0x09

Definition at line 180 of file Endpoint_LPC11Uxx.h.

#define ERR_UNEXPECT_PKT   0x03

Definition at line 174 of file Endpoint_LPC11Uxx.h.

#define ERR_UNKNOWN_PID   0x02

Definition at line 173 of file Endpoint_LPC11Uxx.h.

#define FRAME_INT   (0x1 << 30)

Definition at line 166 of file Endpoint_LPC11Uxx.h.

#define PKT_LNGTH_MASK   0x000003FF

Definition at line 169 of file Endpoint_LPC11Uxx.h.

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

Definition at line 147 of file Endpoint_LPC11Uxx.h.

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

Definition at line 151 of file Endpoint_LPC11Uxx.h.

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

Definition at line 153 of file Endpoint_LPC11Uxx.h.

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

Definition at line 148 of file Endpoint_LPC11Uxx.h.

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

Definition at line 152 of file Endpoint_LPC11Uxx.h.

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

Definition at line 139 of file Endpoint_LPC11Uxx.h.

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

Definition at line 144 of file Endpoint_LPC11Uxx.h.

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

Definition at line 143 of file Endpoint_LPC11Uxx.h.

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

Definition at line 146 of file Endpoint_LPC11Uxx.h.

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

Definition at line 145 of file Endpoint_LPC11Uxx.h.

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

Definition at line 142 of file Endpoint_LPC11Uxx.h.

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

Definition at line 149 of file Endpoint_LPC11Uxx.h.

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

Definition at line 141 of file Endpoint_LPC11Uxx.h.

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

Definition at line 150 of file Endpoint_LPC11Uxx.h.

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

Definition at line 140 of file Endpoint_LPC11Uxx.h.

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

Definition at line 154 of file Endpoint_LPC11Uxx.h.

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

Definition at line 137 of file Endpoint_LPC11Uxx.h.

Function Documentation

void DcdDataTransfer ( uint8_t  EPNum,
uint8_t *  pData,
uint32_t  length 
)
static void Endpoint_AbortPendingIN ( void  )
inlinestatic

Definition at line 240 of file Endpoint_LPC11Uxx.h.

static uint16_t Endpoint_BytesInEndpoint ( void  )
inlinestatic

Definition at line 272 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearIN ( void  )
inlinestatic

Definition at line 321 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearOUT ( void  )
inlinestatic

Definition at line 337 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearSETUP ( void  )
inlinestatic

Definition at line 312 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ClearStall ( void  )
inlinestatic

Definition at line 361 of file Endpoint_LPC11Uxx.h.

void Endpoint_ClearStatusStage ( void  )

Definition at line 122 of file Endpoint_LPC.c.

bool Endpoint_ConfigureEndpoint ( 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  )
inlinestatic

Definition at line 221 of file Endpoint_LPC11Uxx.h.

static void Endpoint_EnableEndpoint ( void  )
inlinestatic

Definition at line 215 of file Endpoint_LPC11Uxx.h.

static uint8_t Endpoint_GetBusyBanks ( void  )
inlinestatic

Definition at line 235 of file Endpoint_LPC11Uxx.h.

static uint8_t Endpoint_GetEndpointInterrupts ( void  )
inlinestatic

Definition at line 255 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_HasEndpointInterrupted ( const uint8_t  EndpointNumber)
inlinestatic

Definition at line 264 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsConfigured ( void  )
inlinestatic

Definition at line 246 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsEnabled ( void  )
inlinestatic

Definition at line 227 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsINReady ( void  )
inlinestatic

Definition at line 285 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsOUTReceived ( void  )
inlinestatic

Definition at line 295 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsSETUPReceived ( void  )
inlinestatic

Definition at line 304 of file Endpoint_LPC11Uxx.h.

static bool Endpoint_IsStalled ( void  )
inlinestatic

Definition at line 369 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ResetDataToggle ( void  )
inlinestatic

Definition at line 377 of file Endpoint_LPC11Uxx.h.

static void Endpoint_ResetEndpoint ( const uint8_t  EndpointNumber)
inlinestatic

Definition at line 209 of file Endpoint_LPC11Uxx.h.

static void Endpoint_StallTransaction ( void  )
inlinestatic

Definition at line 350 of file Endpoint_LPC11Uxx.h.

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

Definition at line 133 of file Endpoint_LPC.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