U2C-11 USB-I2C/SPI/GPIO Interface Adapter

 
Main Page   Modules   Compound List   File List   Compound Members   File Members  

i2cbridge.h File Reference

Go to the source code of this file.

Compounds

struct  _U2C_SLAVE_ADDR_LIST
struct  _U2C_TRANSACTION
 I2C Transaction Descriptor. More...

struct  _U2C_TRANSACTION_PACK
 I2C Transactions pack element. More...

struct  _U2C_VERSION_INFO

Defines

#define I2C_BRIDGE_H_10DF0DED_E85F_4f14_88D9_610BEA2211F7
#define U2C_I2C_FREQ_FAST   0
#define U2C_I2C_FREQ_STD   1
#define U2C_I2C_FREQ_83KHZ   2
#define U2C_I2C_FREQ_71KHZ   3
#define U2C_I2C_FREQ_62KHZ   4
#define U2C_I2C_FREQ_50KHZ   6
#define U2C_I2C_FREQ_25KHZ   16
#define U2C_I2C_FREQ_10KHZ   46
#define U2C_I2C_FREQ_5KHZ   96
#define U2C_I2C_FREQ_2KHZ   242
#define U2C_SPI_FREQ_200KHZ   0
#define U2C_SPI_FREQ_100KHZ   1
#define U2C_SPI_FREQ_83KHZ   2
#define U2C_SPI_FREQ_71KHZ   3
#define U2C_SPI_FREQ_62KHZ   4
#define U2C_SPI_FREQ_50KHZ   6
#define U2C_SPI_FREQ_25KHZ   16
#define U2C_SPI_FREQ_10KHZ   46
#define U2C_SPI_FREQ_5KHZ   96
#define U2C_SPI_FREQ_2KHZ   242

Typedefs

typedef struct _U2C_TRANSACTION  U2C_TRANSACTION
 I2C Transaction Descriptor. More...

typedef struct _U2C_TRANSACTIONPU2C_TRANSACTION
 I2C Transaction Descriptor. More...

typedef struct _U2C_TRANSACTION_PACK  U2C_TRANSACTION_PACK
 I2C Transactions pack element. More...

typedef struct _U2C_TRANSACTION_PACKPU2C_TRANSACTION_PACK
 I2C Transactions pack element. More...

typedef struct _U2C_SLAVE_ADDR_LIST  U2C_SLAVE_ADDR_LIST
typedef struct _U2C_SLAVE_ADDR_LISTPU2C_SLAVE_ADDR_LIST
typedef struct _U2C_VERSION_INFO  U2C_VERSION_INFO
typedef struct _U2C_VERSION_INFOPU2C_VERSION_INFO

Enumerations

enum  U2C_RESULT {
  U2C_SUCCESS, U2C_BAD_PARAMETER, U2C_HARDWARE_NOT_FOUND, U2C_SLAVE_DEVICE_NOT_FOUND,
  U2C_TRANSACTION_FAILED, U2C_SLAVE_OPENNING_FOR_WRITE_FAILED, U2C_SLAVE_OPENNING_FOR_READ_FAILED, U2C_SENDING_MEMORY_ADDRESS_FAILED,
  U2C_SENDING_DATA_FAILED, U2C_NOT_IMPLEMENTED, U2C_NO_ACK, U2C_DEVICE_BUSY,
  U2C_MEMORY_ERROR, U2C_UNKNOWN_ERROR
}
enum  U2C_LINE_STATE { LS_RELEASED, LS_DROPPED_BY_I2C_BRIDGE, LS_DROPPED_BY_SLAVE, LS_RAISED_BY_I2C_BRIDGE }

Functions

BYTE _stdcall U2C_GetDeviceCount ()
U2C_RESULT _stdcall U2C_GetSerialNum (HANDLE hDevice, long *pSerialNum)
U2C_RESULT _stdcall U2C_IsHandleValid (HANDLE hDevice)
HANDLE _stdcall U2C_OpenDevice (BYTE nDevice)
HANDLE _stdcall U2C_OpenDeviceBySerialNum (long nSerialNum)
U2C_RESULT _stdcall U2C_CloseDevice (HANDLE hDevice)
U2C_RESULT _stdcall U2C_GetFirmwareVersion (HANDLE hDevice, PU2C_VERSION_INFO pVersion)
U2C_RESULT _stdcall U2C_GetDriverVersion (HANDLE hDevice, PU2C_VERSION_INFO pVersion)
U2C_VERSION_INFO _stdcall U2C_GetDllVersion ()
U2C_RESULT _stdcall U2C_SetI2cFreq (HANDLE hDevice, BYTE Frequency)
U2C_RESULT _stdcall U2C_GetI2cFreq (HANDLE hDevice, BYTE *pFrequency)
U2C_RESULT _stdcall U2C_Read (HANDLE hDevice, PU2C_TRANSACTION pTransaction)
U2C_RESULT _stdcall U2C_Write (HANDLE hDevice, PU2C_TRANSACTION pTransaction)
U2C_RESULT _stdcall U2C_RW_Pack (HANDLE hDevice, PU2C_TRANSACTION_PACK pTransaction, int count)
U2C_RESULT _stdcall U2C_ScanDevices (HANDLE hDevice, PU2C_SLAVE_ADDR_LIST pList)
U2C_RESULT _stdcall U2C_Start (HANDLE hDevice)
U2C_RESULT _stdcall U2C_RepeatedStart (HANDLE hDevice)
U2C_RESULT _stdcall U2C_Stop (HANDLE hDevice)
U2C_RESULT _stdcall U2C_PutByte (HANDLE hDevice, BYTE Data)
U2C_RESULT _stdcall U2C_GetByte (HANDLE hDevice, BYTE *pData)
U2C_RESULT _stdcall U2C_PutByteWithAck (HANDLE hDevice, BYTE Data)
U2C_RESULT _stdcall U2C_GetByteWithAck (HANDLE hDevice, BYTE *pData, BOOL bAck)
U2C_RESULT _stdcall U2C_PutAck (HANDLE hDevice, BOOL bAck)
U2C_RESULT _stdcall U2C_GetAck (HANDLE hDevice)
U2C_RESULT _stdcall U2C_ReadScl (HANDLE hDevice, U2C_LINE_STATE *pState)
U2C_RESULT _stdcall U2C_ReadSda (HANDLE hDevice, U2C_LINE_STATE *pState)
U2C_RESULT _stdcall U2C_ReleaseScl (HANDLE hDevice)
U2C_RESULT _stdcall U2C_ReleaseSda (HANDLE hDevice)
U2C_RESULT _stdcall U2C_DropScl (HANDLE hDevice)
U2C_RESULT _stdcall U2C_DropSda (HANDLE hDevice)
U2C_RESULT _stdcall U2C_SetIoDirection (HANDLE hDevice, ULONG Value, ULONG Mask)
U2C_RESULT _stdcall U2C_GetIoDirection (HANDLE hDevice, ULONG *pValue)
U2C_RESULT _stdcall U2C_IoWrite (HANDLE hDevice, ULONG Value, ULONG Mask)
U2C_RESULT _stdcall U2C_IoRead (HANDLE hDevice, ULONG *pValue)
U2C_RESULT _stdcall U2C_SetSingleIoDirection (HANDLE hDevice, ULONG IoNumber, BOOL bOutput)
U2C_RESULT _stdcall U2C_GetSingleIoDirection (HANDLE hDevice, ULONG IoNumber, BOOL *pbOutput)
U2C_RESULT _stdcall U2C_SingleIoWrite (HANDLE hDevice, ULONG IoNumber, BOOL Value)
U2C_RESULT _stdcall U2C_SingleIoRead (HANDLE hDevice, ULONG IoNumber, BOOL *pValue)
U2C_RESULT _stdcall U2C_SpiSetConfig (HANDLE hDevice, BYTE CPOL, BYTE CPHA)
U2C_RESULT _stdcall U2C_SpiGetConfig (HANDLE hDevice, BYTE *pCPOL, BYTE *pCPHA)
U2C_RESULT _stdcall U2C_SpiSetFreq (HANDLE hDevice, BYTE Frequency)
U2C_RESULT _stdcall U2C_SpiGetFreq (HANDLE hDevice, BYTE *pFrequency)
U2C_RESULT _stdcall U2C_SpiReadWrite (HANDLE hDevice, BYTE *pOutBuffer, BYTE *pInBuffer, WORD Length)
U2C_RESULT _stdcall U2C_SpiWrite (HANDLE hDevice, BYTE *pOutBuffer, WORD Length)
U2C_RESULT _stdcall U2C_SpiRead (HANDLE hDevice, BYTE *pInBuffer, WORD Length)


Define Documentation

#define I2C_BRIDGE_H_10DF0DED_E85F_4f14_88D9_610BEA2211F7
 

Value:

#define U2C_I2C_FREQ_10KHZ   46
 

#define U2C_I2C_FREQ_25KHZ   16
 

#define U2C_I2C_FREQ_2KHZ   242
 

#define U2C_I2C_FREQ_50KHZ   6
 

#define U2C_I2C_FREQ_5KHZ   96
 

#define U2C_I2C_FREQ_62KHZ   4
 

#define U2C_I2C_FREQ_71KHZ   3
 

#define U2C_I2C_FREQ_83KHZ   2
 

#define U2C_I2C_FREQ_FAST   0
 

#define U2C_I2C_FREQ_STD   1
 

#define U2C_SPI_FREQ_100KHZ   1
 

#define U2C_SPI_FREQ_10KHZ   46
 

#define U2C_SPI_FREQ_200KHZ   0
 

#define U2C_SPI_FREQ_25KHZ   16
 

#define U2C_SPI_FREQ_2KHZ   242
 

#define U2C_SPI_FREQ_50KHZ   6
 

#define U2C_SPI_FREQ_5KHZ   96
 

#define U2C_SPI_FREQ_62KHZ   4
 

#define U2C_SPI_FREQ_71KHZ   3
 

#define U2C_SPI_FREQ_83KHZ   2
 


Typedef Documentation

typedef struct _U2C_SLAVE_ADDR_LIST * PU2C_SLAVE_ADDR_LIST
 

typedef struct _U2C_TRANSACTION * PU2C_TRANSACTION
 

I2C Transaction Descriptor.

This structure contains all required information to perform I2C transaction

typedef struct _U2C_TRANSACTION_PACK * PU2C_TRANSACTION_PACK
 

I2C Transactions pack element.

typedef struct _U2C_VERSION_INFO * PU2C_VERSION_INFO
 

typedef struct _U2C_SLAVE_ADDR_LIST U2C_SLAVE_ADDR_LIST
 

typedef struct _U2C_TRANSACTION U2C_TRANSACTION
 

I2C Transaction Descriptor.

This structure contains all required information to perform I2C transaction

typedef struct _U2C_TRANSACTION_PACK U2C_TRANSACTION_PACK
 

I2C Transactions pack element.

typedef struct _U2C_VERSION_INFO U2C_VERSION_INFO
 


Enumeration Type Documentation

enum U2C_LINE_STATE
 

Enumeration values:
LS_RELEASED  
LS_DROPPED_BY_I2C_BRIDGE  
LS_DROPPED_BY_SLAVE  
LS_RAISED_BY_I2C_BRIDGE  

enum U2C_RESULT
 

Enumeration values:
U2C_SUCCESS   API Function was successfull
U2C_BAD_PARAMETER   API Function got bad input parameter
U2C_HARDWARE_NOT_FOUND   U2C-11 Device not found
U2C_SLAVE_DEVICE_NOT_FOUND   I2C Slave device not found
U2C_TRANSACTION_FAILED   I2C or SPI transaction failed
U2C_SLAVE_OPENNING_FOR_WRITE_FAILED   I2C Slave did not acknowledge write slave address
U2C_SLAVE_OPENNING_FOR_READ_FAILED   I2C Slave did not acknowledge read slave address
U2C_SENDING_MEMORY_ADDRESS_FAILED   I2C Slave did not acknowledge internal address output
U2C_SENDING_DATA_FAILED   I2C Slave did not acknowledge data output
U2C_NOT_IMPLEMENTED   Operation is not implemented by U2C API
U2C_NO_ACK   Got no ACK from Slave
U2C_DEVICE_BUSY   U2C Device Busy
U2C_MEMORY_ERROR   Memory operation (like malloc) failed
U2C_UNKNOWN_ERROR   Undocumented error


Function Documentation

U2C_RESULT _stdcall U2C_GetFirmwareVersion ( HANDLE hDevice,
PU2C_VERSION_INFO pVersion )
 

U2C_RESULT _stdcall U2C_SpiRead ( HANDLE hDevice,
BYTE * pInBuffer,
WORD Length )
 

U2C_RESULT _stdcall U2C_SpiReadWrite ( HANDLE hDevice,
BYTE * pOutBuffer,
BYTE * pInBuffer,
WORD Length )
 

U2C_RESULT _stdcall U2C_SpiWrite ( HANDLE hDevice,
BYTE * pOutBuffer,
WORD Length )
 

Copyright DiMAX 2002-2004