Cat
|
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ftd2xx.h"
Go to the source code of this file.
Classes | |
struct | _int_frame_info |
struct | _ml_frame |
Macros | |
#define | LALUSB_API |
#define | _cstmcall |
#define | USB_NoErr FT_OK |
#define | FrameNoErr FT_OK |
#define | FRAME_HEADER 0x000000AA |
#define | FRAME_TRAILER 0x00000055 |
#define | IS_INTERRUPT 0x0000007F |
#define | DATA_READ 0x00000080 |
#define | DATA_WRITE 0x0000007F |
#define | USER_IRQ_FLAG 0x00000080 |
#define | MAXLAYER 8 |
Typedefs | |
typedef void(* | PrintfFunc) (char *format,...) |
typedef void(* | PerrorFunc) (char *msg) |
typedef FT_STATUS | USB_Error |
typedef enum _frame_error_constants | FrameError |
typedef enum _extended_usb_errors | Ext_USB_Error |
typedef struct _int_frame_info | InterruptFrameInfo |
typedef struct _int_frame_info * | InterruptFrameInfoPtr |
typedef enum _fake_errors | FakeErrorType |
typedef struct _ml_frame | ML_Frame |
Enumerations | |
enum | TXRX_STATUS { RXSTATUS, TXSTATUS, RXSTATUS, TXSTATUS } |
enum | _frame_error_constants { FE_NONE, FE_DEVICE, FE_SOFTWARE, FE_USER, FE_ERROR, FE_HEADER, FE_TRAILER, MaxFrameError, FE_NONE, FE_DEVICE, FE_SOFTWARE, FE_USER, FE_ERROR, FE_HEADER, FE_TRAILER, MaxFrameError } |
enum | _extended_usb_errors { USB_INT_FRAME = FT_OTHER_ERROR + 2, IO_TIMEOUT_WRITE, IO_TIMEOUT_READ, BAD_HEADER_ERROR, BAD_TRAILER_ERROR, BAD_SUBADDR_ERROR, NULL_DESCSTR_PTR, NULL_SERNUM_PTR, BAD_TARGET_PATH, MAXLAYER_NULL_PTR, SUB_ADDRR_0x40_ERROR, Max_USB_Errors, USB_INT_FRAME = FT_OTHER_ERROR + 2, IO_TIMEOUT_WRITE, IO_TIMEOUT_READ, BAD_HEADER_ERROR, BAD_TRAILER_ERROR, BAD_SUBADDR_ERROR, NULL_DESCSTR_PTR, NULL_SERNUM_PTR, Max_USB_Errors } |
enum | _fake_errors { FK_LETSBETRUE = 1, FK_HEADER = 2, FK_TRAILER = 4, FK_COUNT = 8, MaxFakeErrors = 16, FK_LETSBETRUE = 1, FK_HEADER = 2, FK_TRAILER = 4, FK_COUNT = 8, MaxFakeErrors = 16 } |
Variables | |
LALUSB_API PerrorFunc | pfError |
#define _cstmcall |
Definition at line 31 of file LALUsbML.h.
#define DATA_READ 0x00000080 |
Definition at line 166 of file LALUsbML.h.
#define DATA_WRITE 0x0000007F |
Definition at line 167 of file LALUsbML.h.
#define FRAME_HEADER 0x000000AA |
Definition at line 162 of file LALUsbML.h.
#define FRAME_TRAILER 0x00000055 |
Definition at line 163 of file LALUsbML.h.
#define FrameNoErr FT_OK |
Definition at line 70 of file LALUsbML.h.
#define IS_INTERRUPT 0x0000007F |
Definition at line 164 of file LALUsbML.h.
#define LALUSB_API |
Definition at line 30 of file LALUsbML.h.
#define MAXLAYER 8 |
Definition at line 236 of file LALUsbML.h.
#define USB_NoErr FT_OK |
Definition at line 69 of file LALUsbML.h.
Referenced by UsbFTInterface::usbReadU16(), UsbFTMLInterface::usbReadU16(), UsbFTMLInterface::usbReadU32(), UsbFTInterface::usbReadU32(), UsbFTInterface::usbReadU8(), UsbFTMLInterface::usbReadU8(), UsbFTMLInterface::usbWriteRead(), UsbFTInterface::usbWriteRead(), UsbFTInterface::usbWriteU16(), UsbFTMLInterface::usbWriteU16(), UsbFTInterface::usbWriteU32(), UsbFTMLInterface::usbWriteU32(), UsbFTInterface::usbWriteU8(), and UsbFTMLInterface::usbWriteU8().
#define USER_IRQ_FLAG 0x00000080 |
Definition at line 169 of file LALUsbML.h.
typedef enum _extended_usb_errors Ext_USB_Error |
typedef enum _fake_errors FakeErrorType |
typedef enum _frame_error_constants FrameError |
typedef struct _int_frame_info InterruptFrameInfo |
typedef struct _int_frame_info * InterruptFrameInfoPtr |
typedef void(* PerrorFunc) (char *msg) |
Definition at line 64 of file LALUsbML.h.
typedef void(* PrintfFunc) (char *format,...) |
Definition at line 58 of file LALUsbML.h.
Definition at line 72 of file LALUsbML.h.
enum _extended_usb_errors |
Definition at line 199 of file LALUsbML.h.
enum _fake_errors |
Enumerator | |
---|---|
FK_LETSBETRUE | |
FK_HEADER | |
FK_TRAILER | |
FK_COUNT | |
MaxFakeErrors | |
FK_LETSBETRUE | |
FK_HEADER | |
FK_TRAILER | |
FK_COUNT | |
MaxFakeErrors |
Definition at line 227 of file LALUsbML.h.
Enumerator | |
---|---|
FE_NONE | |
FE_DEVICE | |
FE_SOFTWARE | |
FE_USER | |
FE_ERROR | |
FE_HEADER | |
FE_TRAILER | |
MaxFrameError | |
FE_NONE | |
FE_DEVICE | |
FE_SOFTWARE | |
FE_USER | |
FE_ERROR | |
FE_HEADER | |
FE_TRAILER | |
MaxFrameError |
Definition at line 186 of file LALUsbML.h.
enum TXRX_STATUS |
Enumerator | |
---|---|
RXSTATUS | |
TXSTATUS | |
RXSTATUS | |
TXSTATUS |
Definition at line 47 of file LALUsbML.h.
LALUSB_API void _cstmcall CloseUsbDevice | ( | int | id | ) |
Referenced by UsbFTInterface::close(), and UsbFTMLInterface::close().
LALUSB_API void _cstmcall dbg_CloseLogFile | ( | void | ) |
LALUSB_API void _cstmcall dbg_OpenLogFile | ( | void | ) |
LALUSB_API FT_STATUS _cstmcall GetDeviceDesc | ( | char * | buffer, |
int | index | ||
) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API FT_STATUS _cstmcall GetDeviceSerNum | ( | char * | buffer, |
int | index | ||
) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API char* _cstmcall GetErrMsg | ( | USB_Error | err_code | ) |
LALUSB_API ULONG _cstmcall GetHeaderErrors | ( | void | ) |
LALUSB_API InterruptFrameInfoPtr _cstmcall GetLastFrame | ( | void | ) |
LALUSB_API int _cstmcall GetLastFrameStatus | ( | void | ) |
LALUSB_API ULONG _cstmcall GetLostFrames | ( | void | ) |
LALUSB_API ULONG _cstmcall GetTotalByteCount | ( | void | ) |
LALUSB_API ULONG _cstmcall GetTrailerErrors | ( | void | ) |
USB_Error GetUSB_Errno | ( | void | ) |
LALUSB_API int _cstmcall OpenUsbDevice | ( | char * | sernumstr | ) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API void _cstmcall PrintFrameInfo | ( | void | ) |
Referenced by UsbFTInterface::usbReadU16(), UsbFTMLInterface::usbReadU16(), UsbFTMLInterface::usbReadU32(), UsbFTInterface::usbReadU32(), UsbFTInterface::usbReadU8(), UsbFTMLInterface::usbReadU8(), UsbFTMLInterface::usbWriteRead(), UsbFTInterface::usbWriteRead(), UsbFTInterface::usbWriteU16(), UsbFTMLInterface::usbWriteU16(), UsbFTInterface::usbWriteU32(), UsbFTMLInterface::usbWriteU32(), UsbFTInterface::usbWriteU8(), and UsbFTMLInterface::usbWriteU8().
LALUSB_API void _cstmcall ResetFrameErrors | ( | void | ) |
LALUSB_API void _cstmcall ResetLostFrames | ( | void | ) |
LALUSB_API void _cstmcall ResetTotalByteCount | ( | void | ) |
LALUSB_API void _cstmcall USB_CloseAll | ( | void | ) |
LALUSB_API BOOL _cstmcall USB_EraseEEpromData | ( | int | id | ) |
LALUSB_API BOOL _cstmcall USB_FindDevices | ( | char * | DeviceDescriptionStr | ) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API char* _cstmcall USB_GetDefaultDeviceDesc | ( | void | ) |
LALUSB_API char* _cstmcall USB_GetDefaultSerialNum | ( | void | ) |
LALUSB_API char* _cstmcall USB_GetEpromDeviceDesc | ( | void | ) |
LALUSB_API char* _cstmcall USB_GetEpromSerialNum | ( | void | ) |
LALUSB_API USB_Error _cstmcall USB_GetLastError | ( | void | ) |
Referenced by UsbFTInterface::init(), UsbFTMLInterface::init(), UsbFTMLInterface::usbReadU16(), UsbFTInterface::usbReadU16(), UsbFTInterface::usbReadU32(), UsbFTMLInterface::usbReadU32(), UsbFTInterface::usbReadU8(), UsbFTMLInterface::usbReadU8(), UsbFTInterface::usbWriteRead(), UsbFTMLInterface::usbWriteRead(), UsbFTMLInterface::usbWriteU16(), UsbFTInterface::usbWriteU16(), UsbFTMLInterface::usbWriteU32(), UsbFTInterface::usbWriteU32(), UsbFTMLInterface::usbWriteU8(), and UsbFTInterface::usbWriteU8().
LALUSB_API BOOL _cstmcall USB_GetLatencyTimer | ( | int | id, |
PUCHAR | msecs | ||
) |
LALUSB_API int _cstmcall USB_GetNumberOfDevs | ( | void | ) |
LALUSB_API int _cstmcall USB_GetStatus | ( | int | id, |
TXRX_STATUS | |||
) |
LALUSB_API BOOL _cstmcall USB_Init | ( | int | id, |
BOOL | verbose | ||
) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API void _cstmcall USB_Perror | ( | USB_Error | err_code | ) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API void _cstmcall USB_PrintErrMsg | ( | char * | msg | ) |
void USB_Printf | ( | char * | format, |
... | |||
) |
LALUSB_API BOOL _cstmcall USB_PurgeBuffers | ( | int | id | ) |
Referenced by UsbFTMLInterface::init(), and UsbFTMLInterface::purgeBuffers().
LALUSB_API BOOL _cstmcall USB_Read | ( | int | id, |
void * | buf, | ||
int | maxcnt, | ||
int * | rdcount | ||
) |
LALUSB_API BOOL _cstmcall USB_ReadEEpromData | ( | int | id, |
BOOL | verbose | ||
) |
LALUSB_API BOOL _cstmcall USB_ResetDevice | ( | int | id | ) |
Referenced by UsbFTMLInterface::init(), and UsbFTMLInterface::reset().
LALUSB_API BOOL _cstmcall USB_ResetMode | ( | int | id | ) |
Referenced by UsbFTMLInterface::init(), and UsbFTMLInterface::resetMode().
LALUSB_API BOOL _cstmcall USB_SetBaudRate | ( | int | id, |
int | baud | ||
) |
LALUSB_API BOOL _cstmcall USB_SetDescStr | ( | int | id, |
char * | desc_str | ||
) |
LALUSB_API BOOL _cstmcall USB_SetFlowControlToHardware | ( | int | id | ) |
LALUSB_API BOOL _cstmcall USB_SetLatencyTimer | ( | int | id, |
UCHAR | msecs | ||
) |
LALUSB_API BOOL _cstmcall USB_SetMaxPower | ( | int | id, |
unsigned short | current | ||
) |
LALUSB_API void _cstmcall USB_SetPerrorFunc | ( | PerrorFunc | func | ) |
LALUSB_API BOOL _cstmcall USB_SetPowerSource | ( | int | id, |
unsigned short | powersrc | ||
) |
LALUSB_API void _cstmcall USB_SetPrintfFunc | ( | PrintfFunc | func | ) |
LALUSB_API BOOL _cstmcall USB_SetSerialNumber | ( | int | id, |
char * | sernum | ||
) |
LALUSB_API BOOL _cstmcall USB_SetSynchronousMode | ( | int | id, |
int | sleep_time | ||
) |
Referenced by UsbFTMLInterface::init(), and UsbFTMLInterface::setSynchronousMode().
LALUSB_API BOOL _cstmcall USB_SetTimeouts | ( | int | id, |
int | tx_timeout, | ||
int | rx_timeout | ||
) |
LALUSB_API BOOL _cstmcall USB_SetXferSize | ( | int | id, |
unsigned long | txsize, | ||
unsigned long | rxsize | ||
) |
LALUSB_API BOOL _cstmcall USB_Write | ( | int | id, |
void * | buf, | ||
int | count, | ||
int * | written | ||
) |
LALUSB_API BOOL _cstmcall USB_WriteEEpromData | ( | int | id | ) |
LALUSB_API int _cstmcall UsbGetMaxLayer | ( | int | id, |
int * | num_layers | ||
) |
LALUSB_API int _cstmcall UsbGetNlayers | ( | int | id | ) |
LALUSB_API int* _cstmcall UsbGetTargetPathArray | ( | int | id | ) |
LALUSB_API int _cstmcall UsbRd | ( | int | id, |
char | sub_addr, | ||
void * | array, | ||
int | count | ||
) |
LALUSB_API int _cstmcall UsbRdEx | ( | int | id, |
void * | array, | ||
int | maxcnt, | ||
int * | frames | ||
) |
LALUSB_API int _cstmcall UsbReadEx | ( | int | id, |
void * | array, | ||
int | maxcnt, | ||
int * | frames, | ||
int * | frame_size | ||
) |
LALUSB_API int _cstmcall UsbReadExML | ( | int | id, |
int * | target_path_array, | ||
void * | array, | ||
int | maxcnt, | ||
int * | frames, | ||
int * | frame_size, | ||
int * | sub_add_array | ||
) |
LALUSB_API int _cstmcall UsbReadExML_New | ( | int | id, |
void * | array, | ||
ML_Frame * | mf_array, | ||
int | max_num_bytes, | ||
int * | frames | ||
) |
LALUSB_API int _cstmcall UsbReadML | ( | int | id, |
int * | target_path_array, | ||
char | sub_addr, | ||
void * | buffer, | ||
int | usercount | ||
) |
LALUSB_API int _cstmcall UsbRequestForReadML | ( | int | id, |
int * | target_path_array, | ||
char | sub_addr, | ||
void * | buffer, | ||
int | count | ||
) |
LALUSB_API void _cstmcall UsbSetIntCheckingState | ( | BOOL | truefalse | ) |
Referenced by UsbFTInterface::init(), and UsbFTMLInterface::init().
LALUSB_API int _cstmcall UsbSetMaxLayer | ( | int | id, |
int | num_layers | ||
) |
LALUSB_API int _cstmcall UsbWrt | ( | int | id, |
char | sub_addr, | ||
void * | buffer, | ||
int | count | ||
) |
LALUSB_API int _cstmcall UsbWrtML | ( | int | id, |
int * | target_path_array, | ||
char | sub_addr, | ||
void * | buffer, | ||
int | count | ||
) |
LALUSB_API PerrorFunc pfError |