File nut/include/dev/i2cbus.h


Included Files


Preprocessor definitions

#define DEV_I2CBUS_H

#define I2C_CURRENT_RATE -1L

#define I2C_CURRENT_TIMEOUT

#define I2C_SLA_NONE -1

#define I2C_BF_INITIALIZED 0x01


Typedef NUTI2C_BUS

typedef struct _NUTI2C_BUS NUTI2C_BUS
See: Type struct _NUTI2C_BUS

Typedef NUTI2C_SLAVE

typedef struct _NUTI2C_SLAVE NUTI2C_SLAVE
See: Type struct _NUTI2C_SLAVE

Typedef NUTI2C_MSG

typedef struct _NUTI2C_MSG NUTI2C_MSG
See: Type struct _NUTI2C_MSG

Type struct _NUTI2C_MSG

struct _NUTI2C_MSG
struct _NUTI2C_MSG  
   {  
      const uint8_t* msg_wdat;  
      int msg_wlen;  
      volatile int msg_widx;  
      uint8_t* msg_rdat;  
      int msg_rsiz;  
      volatile int msg_ridx;  
   }  

Type struct _NUTI2C_BUS

struct _NUTI2C_BUS
struct _NUTI2C_BUS  
   {  
      void* bus_icb;  
      int (*bus_init)(NUTI2C_BUS*);  
      int (*bus_configure)(NUTI2C_BUS*);  
      int (*bus_probe)(NUTI2C_BUS*,int sla);  
      int (*bus_transceive)(NUTI2C_SLAVE*,NUTI2C_MSG*);  
      uint32_t bus_timeout;  
      long bus_rate;  
      uint_fast8_t bus_flags;  
      HANDLE bus_mutex;  
   }  

Type struct _NUTI2C_SLAVE

struct _NUTI2C_SLAVE
struct _NUTI2C_SLAVE  
   {  
      NUTI2C_BUS* slave_bus;  
      int slave_address;  
      uint32_t slave_timeout;  
      NUTI2C_MSG* slave_msg;  
   }