LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Endpoint Management

Detailed Description

Endpoint management definitions.

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.

Modules

 Endpoint Buffer for Writing and Reading
 Endpoint Buffer for Writing and Reading.
 
 Endpoint Data Reading and Writing
 Endpoint data read/write definitions.
 
 Endpoint Management (LPC11Uxx, LPC1347)
 Endpoint management definitions for the NXP LPC11Uxx and LPC1347 architecture.
 
 Endpoint Management (LPC17xx)
 Endpoint management definitions for the LPC17xx architecture.
 
 Endpoint Management (LPC18xx)
 Endpoint management definitions for the LPC18xx architecture.
 
 Endpoint Packet Management
 USB Endpoint package management definitions.
 

Macros

#define ENDPOINT_EPNUM_MASK   0x0F
 
#define ENDPOINT_CONTROLEP   0
 
#define ENDPOINT_BANK_SINGLE   (0 << 1)
 
#define ENDPOINT_BANK_DOUBLE   (1 << 1)
 
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE   64
 
#define ENDPOINT_MAX_SIZE(EPIndex)   512
 
#define ENDPOINT_TOTAL_ENDPOINTS0   ENDPOINT_DETAILS_MAXEP0
 
#define ENDPOINT_TOTAL_ENDPOINTS1   ENDPOINT_DETAILS_MAXEP1
 
#define ENDPOINT_TOTAL_ENDPOINTS(corenum)   ((corenum) ? ENDPOINT_DETAILS_MAXEP1 : ENDPOINT_DETAILS_MAXEP0)
 

Functions

static PRAGMA_ALWAYS_INLINE uint8_t Endpoint_GetCurrentEndpoint (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 Get the endpoint address of the currently selected endpoint. This is typically used to save the currently selected endpoint number so that it can be restored after another endpoint has been manipulated.
 
static PRAGMA_ALWAYS_INLINE void Endpoint_SelectEndpoint (uint8_t corenum, const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE
 Selects the given endpoint number. If the address from the device descriptors is used, the value should be masked with the ENDPOINT_EPNUM_MASK constant to extract only the endpoint number (and discarding the endpoint direction bit).
 
static PRAGMA_ALWAYS_INLINE uint8_t Endpoint_GetEndpointDirection (uint8_t corenum) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
 Determines the currently selected endpoint's direction.
 
void Endpoint_GetSetupPackage (uint8_t corenum, uint8_t *pData)
 

Macro Definition Documentation

#define ENDPOINT_BANK_DOUBLE   (1 << 1)

Mask for the bank mode selection for the Endpoint_ConfigureEndpoint() macro. This indicates that the endpoint should have two banks, which requires more USB FIFO memory but results in faster transfers as one USB device (the LPC or the host) can access one bank while the other accesses the second bank.

Definition at line 119 of file Endpoint.h.

#define ENDPOINT_BANK_SINGLE   (0 << 1)

Mask for the bank mode selection for the Endpoint_ConfigureEndpoint() macro. This indicates that the endpoint should have one single bank, which requires less USB FIFO memory but results in slower transfers as only one USB device (the LPC or the host) can access the endpoint's bank at the one time.

Definition at line 112 of file Endpoint.h.

#define ENDPOINT_CONTROLEP   0

Endpoint address for the default control endpoint, which always resides in address 0. This is defined for convenience to give more readable code when used with the endpoint macros.

Definition at line 95 of file Endpoint.h.

#define ENDPOINT_CONTROLEP_DEFAULT_SIZE   64

Default size of the default control endpoint's bank, until altered by the control endpoint bank size value in the device descriptor. Not available if the FIXED_CONTROL_ENDPOINT_SIZE token is defined.

Definition at line 125 of file Endpoint.h.

#define ENDPOINT_EPNUM_MASK   0x0F

Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's numerical address in the device.

Definition at line 90 of file Endpoint.h.

#define ENDPOINT_MAX_SIZE (   EPIndex)    512

Retrieves the maximum bank size in bytes of a given endpoint.

Note
This macro will only work correctly on endpoint indexes that are compile-time constants defined by the preprocessor.
Parameters
EPIndexEndpoint number, a value between 0 and (ENDPOINT_TOTAL_ENDPOINTS - 1)

Definition at line 135 of file Endpoint.h.

#define ENDPOINT_TOTAL_ENDPOINTS (   corenum)    ((corenum) ? ENDPOINT_DETAILS_MAXEP1 : ENDPOINT_DETAILS_MAXEP0)

Definition at line 144 of file Endpoint.h.

#define ENDPOINT_TOTAL_ENDPOINTS0   ENDPOINT_DETAILS_MAXEP0

Total number of endpoints (including the default control endpoint at address 0) which may be used in the device. Different USB LPC models support different amounts of endpoints, this value reflects the maximum number of endpoints for the currently selected LPC model.

Definition at line 142 of file Endpoint.h.

#define ENDPOINT_TOTAL_ENDPOINTS1   ENDPOINT_DETAILS_MAXEP1

Definition at line 143 of file Endpoint.h.

Function Documentation

static uint8_t Endpoint_GetCurrentEndpoint ( uint8_t  corenum)
inlinestatic

Get the endpoint address of the currently selected endpoint. This is typically used to save the currently selected endpoint number so that it can be restored after another endpoint has been manipulated.

Parameters
corenum: ID Number of USB Core to be processed.
Returns
Index of the currently selected endpoint

Definition at line 182 of file Endpoint.h.

static uint8_t Endpoint_GetEndpointDirection ( uint8_t  corenum)
inlinestatic

Determines the currently selected endpoint's direction.

Parameters
corenum: ID Number of USB Core to be processed.
Returns
The currently selected endpoint's direction, as a ENDPOINT_DIR_* mask.

Definition at line 243 of file Endpoint.h.

void Endpoint_GetSetupPackage ( uint8_t  corenum,
uint8_t *  pData 
)
static void Endpoint_SelectEndpoint ( uint8_t  corenum,
const uint8_t  EndpointNumber 
)
inlinestatic

Selects the given endpoint number. If the address from the device descriptors is used, the value should be masked with the ENDPOINT_EPNUM_MASK constant to extract only the endpoint number (and discarding the endpoint direction bit).

Any endpoint operations which do not require the endpoint number to be indicated will operate on the currently selected endpoint.

Parameters
corenum: ID Number of USB Core to be processed.
EndpointNumber: Endpoint number to select
Returns
Nothing

Definition at line 202 of file Endpoint.h.