📄 atl_mix.h
字号:
#ifndef _ATL_MNG_H
#define _ATL_MNG_H
/****************************************************************************/
/* includes */
/****************************************************************************/
#include "..\_hc_core\dev_ep.h"
#include "..\_hc_core\transfer.h"
/****************************************************************************/
/* constants */
/****************************************************************************/
#define CompletionCode_NoEror 0x0
#define CompletionCode_CRC 0x1
#define CompletionCode_BitStuffing 0x2
#define CompletionCode_DataToggleMismatch 0x3
#define CompletionCode_Stall 0x4
#define CompletionCode_DeviceNotResponding 0x5
#define CompletionCode_PIDCheckFailure 0x6
#define CompletionCode_UnexpectedPID 0x7
#define CompletionCode_DataOverrun 0x8
#define CompletionCode_DataUnderrun 0x9
#define CompletionCode_BufferOverrun 0xC
#define CompletionCode_BufferUnderrun 0xD
#define Speed_Full 0
#define Speed_Low 1
#define DirectionPID_SETUP 0
#define DirectionPID_OUT 1
#define DirectionPID_IN 2
#define NoDirection_Just_Hold 3
#define SETUP DirectionPID_SETUP
#define OUT DirectionPID_OUT
#define IN DirectionPID_IN
#define HOLD NoDirection_Just_Hold
#define ATL_FULL_RW 0x0
#define ATL_SHORT_READ 0x1
#define ATL_SHORT_WRITE 0x2
#define NO_OPEN_ATL_TRANSFER (void *)0xFFFFFFFF
#define ATL_ENDPOINT_ERR NO_OPEN_ATL_TRANSFER
#define Format_Async 0
#define Format_Iso 1
#define MAX_DATA_SIZE_IN_A_FRAME 512
/****************************************************************************/
/* types */
/****************************************************************************/
typedef struct PTD_h{
unsigned char byte[ 8 ];
}PTD_header;
typedef struct PTD_h_p{
unsigned short ActualBytes;
unsigned char CompletionCode;
unsigned char Active;
unsigned char Toggle;
unsigned short MaxPacketSize;
unsigned char EndpointNumber;
unsigned char Last;
unsigned char Speed;
unsigned short TotalBytes;
unsigned char DirectionPID;
unsigned char Format;
unsigned char FunctionAddress;
unsigned char test;
}PTD_header_param;
/****************************************************************************/
/* function prototypes */
/****************************************************************************/
void atl_initialize( void );
transfer_instance *atl_open_transfer_instance( endpoint_info * epi_ptr);
unsigned char atl_set_transfer( transfer_instance *tr_inst_ptr,
unsigned char *buffer_ptr, // 数据缓冲区指针
unsigned short length, // 传输数据长度
unsigned char direction, // 传输方向
void (*callback)(transfer_instance *tr_inst_ptr));// 传输完成回调函数
void atl_close_transfer_instance( transfer_instance *tr_instance_ptr );
void re_enable_interrupt_transfer( transfer_instance *tr_inst_ptr );
void atl_SOF_interrupt_service( void );
void atl_ATL_transfer_mixer( void );
unsigned char is_fatal_error( transfer_instance *tr_inst_ptr );
#endif //_ATL_MNG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -