Defines | Enumerations | Functions | Variables

Endpoint.h File Reference

USB device endpoint management definitions. More...

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <stdbool.h>
#include "../../../Common/Common.h"
#include "../HighLevel/USBTask.h"
#include "USBInterrupt.h"
#include "../HighLevel/StreamCallbacks.h"
#include "../HighLevel/StreamCallbacks.h"

Defines

#define ENDPOINT_DIR_OUT   (0 << EPDIR)
#define ENDPOINT_DIR_IN   (1 << EPDIR)
#define ENDPOINT_BANK_SINGLE   (0 << EPBK0)
#define ENDPOINT_BANK_DOUBLE   (1 << EPBK0)
#define ENDPOINT_CONTROLEP   0
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE   8
#define ENDPOINT_EPNUM_MASK   0x07
#define ENDPOINT_EPDIR_MASK   0x80
#define ENDPOINT_EPSIZE_MASK   0x7F
#define ENDPOINT_MAX_SIZE(n)   _ENDPOINT_GET_MAXSIZE(n)
#define ENDPOINT_DOUBLEBANK_SUPPORTED(n)   _ENDPOINT_GET_DOUBLEBANK(n)
#define ENDPOINT_TOTAL_ENDPOINTS   7

Enumerations

enum  Endpoint_WaitUntilReady_ErrorCodes_t {
  ENDPOINT_READYWAIT_NoError = 0,
  ENDPOINT_READYWAIT_EndpointStalled = 1,
  ENDPOINT_READYWAIT_DeviceDisconnected = 2,
  ENDPOINT_READYWAIT_BusSuspended = 3,
  ENDPOINT_READYWAIT_Timeout = 4
}
enum  Endpoint_Stream_RW_ErrorCodes_t {
  ENDPOINT_RWSTREAM_NoError = 0,
  ENDPOINT_RWSTREAM_EndpointStalled = 1,
  ENDPOINT_RWSTREAM_DeviceDisconnected = 2,
  ENDPOINT_RWSTREAM_BusSuspended = 3,
  ENDPOINT_RWSTREAM_Timeout = 4,
  ENDPOINT_RWSTREAM_CallbackAborted = 5
}
enum  Endpoint_ControlStream_RW_ErrorCodes_t {
  ENDPOINT_RWCSTREAM_NoError = 0,
  ENDPOINT_RWCSTREAM_HostAborted = 1,
  ENDPOINT_RWCSTREAM_DeviceDisconnected = 2,
  ENDPOINT_RWCSTREAM_BusSuspended = 3
}

Functions

static uint16_t Endpoint_BytesInEndpoint (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint8_t Endpoint_GetCurrentEndpoint (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_SelectEndpoint (const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE
static void Endpoint_ResetFIFO (const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE
static void Endpoint_EnableEndpoint (void) ATTR_ALWAYS_INLINE
static void Endpoint_DisableEndpoint (void) ATTR_ALWAYS_INLINE
static bool Endpoint_IsEnabled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Endpoint_IsReadWriteAllowed (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Endpoint_IsConfigured (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint8_t Endpoint_GetEndpointInterrupts (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Endpoint_HasEndpointInterrupted (const uint8_t EndpointNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Endpoint_IsINReady (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Endpoint_IsOUTReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Endpoint_IsSETUPReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_ClearSETUP (void) ATTR_ALWAYS_INLINE
static void Endpoint_ClearIN (void) ATTR_ALWAYS_INLINE
static void Endpoint_ClearOUT (void) ATTR_ALWAYS_INLINE
static void Endpoint_StallTransaction (void) ATTR_ALWAYS_INLINE
static void Endpoint_ClearStall (void) ATTR_ALWAYS_INLINE
static bool Endpoint_IsStalled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_ResetDataToggle (void) ATTR_ALWAYS_INLINE
static uint8_t Endpoint_GetEndpointDirection (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_SetEndpointDirection (const uint8_t DirectionMask) ATTR_ALWAYS_INLINE
static uint8_t Endpoint_Read_Byte (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_Write_Byte (const uint8_t Byte) ATTR_ALWAYS_INLINE
static void Endpoint_Discard_Byte (void) ATTR_ALWAYS_INLINE
static uint16_t Endpoint_Read_Word_LE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint16_t Endpoint_Read_Word_BE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_Write_Word_LE (const uint16_t Word) ATTR_ALWAYS_INLINE
static void Endpoint_Write_Word_BE (const uint16_t Word) ATTR_ALWAYS_INLINE
static void Endpoint_Discard_Word (void) ATTR_ALWAYS_INLINE
static uint32_t Endpoint_Read_DWord_LE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint32_t Endpoint_Read_DWord_BE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Endpoint_Write_DWord_LE (const uint32_t DWord) ATTR_ALWAYS_INLINE
static void Endpoint_Write_DWord_BE (const uint32_t DWord) ATTR_ALWAYS_INLINE
static void Endpoint_Discard_DWord (void) ATTR_ALWAYS_INLINE
bool Endpoint_ConfigureEndpoint (const uint8_t Number, const uint8_t Type, const uint8_t Direction, const uint16_t Size, const uint8_t Banks)
uint8_t Endpoint_WaitUntilReady (void)
void Endpoint_ClearStatusStage (void)
uint8_t Endpoint_Discard_Stream (uint16_t Length, StreamCallbackPtr_t Callback)
uint8_t Endpoint_Write_Stream_LE (const void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_EStream_LE (const void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_PStream_LE (const void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Stream_BE (const void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_EStream_BE (const void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_PStream_BE (const void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_Stream_LE (void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_EStream_LE (void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_Stream_BE (void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_EStream_BE (void *Buffer, uint16_t Length, StreamCallbackPtr_t Callback) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Control_Stream_LE (const void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Control_EStream_LE (const void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Control_PStream_LE (const void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Control_Stream_BE (const void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Control_EStream_BE (const void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Write_Control_PStream_BE (const void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_Control_Stream_LE (void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_Control_EStream_LE (void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_Control_Stream_BE (void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
uint8_t Endpoint_Read_Control_EStream_BE (void *Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)

Variables

uint8_t USB_ControlEndpointSize

Detailed Description

This file contains structures, function prototypes and macros related to the management of the device's data endpoints when the library is initialized in USB device mode.

Note:
This file should not be included directly. It is automatically included as needed by the USB driver dispatch header located in LUFA/Drivers/USB/USB.h.