Библиотека LUFA (раннее название MyUSB) версия 101122
Pipe.h File Reference

Определения для поддержки канала хоста USB. More...

#include <avr/io.h>
#include <stdbool.h>
#include "../../../Common/Common.h"
#include "../HighLevel/USBTask.h"

Defines

#define PIPE_CONTROLPIPE   0
#define PIPE_CONTROLPIPE_DEFAULT_SIZE   64
#define PIPE_PIPENUM_MASK   0x07
#define PIPE_TOTAL_PIPES   7
#define PIPE_MAX_SIZE   256
#define PIPE_EPNUM_MASK   0x0F
#define PIPE_EPDIR_MASK   0x80
Маски флагов ошибки канала
#define PIPE_ERRORFLAG_OVERFLOW   (1 << 6)
#define PIPE_ERRORFLAG_UNDERFLOW   (1 << 5)
#define PIPE_ERRORFLAG_CRC16   (1 << 4)
#define PIPE_ERRORFLAG_TIMEOUT   (1 << 3)
#define PIPE_ERRORFLAG_PID   (1 << 2)
#define PIPE_ERRORFLAG_DATAPID   (1 << 1)
#define PIPE_ERRORFLAG_DATATGL   (1 << 0)
Маски токенов канала
#define PIPE_TOKEN_SETUP   (0 << PTOKEN0)
#define PIPE_TOKEN_IN   (1 << PTOKEN0)
#define PIPE_TOKEN_OUT   (2 << PTOKEN0)
Маски режима банка канала
#define PIPE_BANK_SINGLE   (0 << EPBK0)
#define PIPE_BANK_DOUBLE   (1 << EPBK0)

Enumerations

enum  Pipe_WaitUntilReady_ErrorCodes_t {
  PIPE_READYWAIT_NoError = 0,
  PIPE_READYWAIT_PipeStalled = 1,
  PIPE_READYWAIT_DeviceDisconnected = 2,
  PIPE_READYWAIT_Timeout = 3
}

Functions

static uint16_t Pipe_BytesInPipe (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint8_t Pipe_GetCurrentPipe (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_SelectPipe (const uint8_t PipeNumber) ATTR_ALWAYS_INLINE
static void Pipe_ResetPipe (const uint8_t PipeNumber) ATTR_ALWAYS_INLINE
static void Pipe_EnablePipe (void) ATTR_ALWAYS_INLINE
static void Pipe_DisablePipe (void) ATTR_ALWAYS_INLINE
static bool Pipe_IsEnabled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint8_t Pipe_GetPipeToken (void) ATTR_ALWAYS_INLINE
static void Pipe_SetPipeToken (const uint8_t Token) ATTR_ALWAYS_INLINE
static void Pipe_SetInfiniteINRequests (void) ATTR_ALWAYS_INLINE
static void Pipe_SetFiniteINRequests (const uint8_t TotalINRequests) ATTR_ALWAYS_INLINE
static bool Pipe_IsConfigured (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint8_t Pipe_BoundEndpointNumber (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_SetInterruptPeriod (const uint8_t Milliseconds) ATTR_ALWAYS_INLINE
static uint8_t Pipe_GetPipeInterrupts (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Pipe_HasPipeInterrupted (const uint8_t PipeNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_Unfreeze (void) ATTR_ALWAYS_INLINE
static void Pipe_Freeze (void) ATTR_ALWAYS_INLINE
static bool Pipe_IsFrozen (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_ClearError (void) ATTR_ALWAYS_INLINE
static bool Pipe_IsError (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_ClearErrorFlags (void) ATTR_ALWAYS_INLINE
static uint8_t Pipe_GetErrorFlags (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint8_t Pipe_GetBusyBanks (void)
static bool Pipe_IsReadWriteAllowed (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Pipe_IsINReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Pipe_IsOUTReady (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static bool Pipe_IsSETUPSent (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_ClearSETUP (void) ATTR_ALWAYS_INLINE
static void Pipe_ClearIN (void) ATTR_ALWAYS_INLINE
static void Pipe_ClearOUT (void) ATTR_ALWAYS_INLINE
static bool Pipe_IsNAKReceived (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_ClearNAKReceived (void) ATTR_ALWAYS_INLINE
static bool Pipe_IsStalled (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_ClearStall (void) ATTR_ALWAYS_INLINE
static uint8_t Pipe_Read_Byte (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_Write_Byte (const uint8_t Byte) ATTR_ALWAYS_INLINE
static void Pipe_Discard_Byte (void) ATTR_ALWAYS_INLINE
static uint16_t Pipe_Read_Word_LE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint16_t Pipe_Read_Word_BE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_Write_Word_LE (const uint16_t Word) ATTR_ALWAYS_INLINE
static void Pipe_Write_Word_BE (const uint16_t Word) ATTR_ALWAYS_INLINE
static void Pipe_Discard_Word (void) ATTR_ALWAYS_INLINE
static uint32_t Pipe_Read_DWord_LE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static uint32_t Pipe_Read_DWord_BE (void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE
static void Pipe_Write_DWord_LE (const uint32_t DWord) ATTR_ALWAYS_INLINE
static void Pipe_Write_DWord_BE (const uint32_t DWord) ATTR_ALWAYS_INLINE
static void Pipe_Discard_DWord (void) ATTR_ALWAYS_INLINE
bool Pipe_ConfigurePipe (const uint8_t Number, const uint8_t Type, const uint8_t Token, const uint8_t EndpointNumber, const uint16_t Size, const uint8_t Banks)
uint8_t Pipe_WaitUntilReady (void)
bool Pipe_IsEndpointBound (const uint8_t EndpointAddress)

Variables

uint8_t USB_ControlPipeSize

Detailed Description

Этот файл содержит структуры, прототипы функций и макросы, связанные с обработкой каналов данных USB-устройства, когда библиотека инициализирована в режиме хоста USB.

Note:
Этот файл не должен включаться (include) самостоятельно. Он автоматически подключается при необходимости диспетчером заголовков драйвера USB, находящемся в LUFA/Drivers/USB/USB.h.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines