LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_iic.h File Reference

Go to the source code of this file.

Data Structures

struct  IIC_data_package
 
struct  IIC_control_t
 

Macros

#define IIC_MAGIC   'i'
 
#define IIC_PORT_CONFIG_IOC   _IOW(IIC_MAGIC,0, int)
 
#define IIC_READ_WRITE_IOC   _IOWR(IIC_MAGIC,1, struct IIC_data_package)
 
#define IIC_INPUTS   4
 
#define PINInput(port, pin)   { (*IicPortPin[port][pin].pGpio).dir |= IicPortPin[port][pin].Mask; }
 
#define PINOutput(port, pin)   { (*IicPortPin[port][pin].pGpio).dir &= ~IicPortPin[port][pin].Mask; }
 
#define PINRead(port, pin)   (((*IicPortPin[port][pin].pGpio).in_data & IicPortPin[port][pin].Mask)?1:0)
 
#define PINHigh(port, pin)   { (*IicPortPin[port][pin].pGpio).set_data = IicPortPin[port][pin].Mask; }
 
#define PINLow(port, pin)   { (*IicPortPin[port][pin].pGpio).clr_data = IicPortPin[port][pin].Mask; }
 

Enumerations

enum  TransferState {
  TRANSFER_IDLE, TRANSFER_START, TRANSFER_START2, TRANSFER_ADDR,
  TRANSFER_DATA, TRANSFER_WRITE, TRANSFER_READ, TRANSFER_WBIT,
  TRANSFER_RBIT, TRANSFER_WACK, TRANSFER_RACK, TRANSFER_STOP,
  TRANSFER_STOP2, TRANSFER_STOP3, TRANSFER_RESTART, TRANSFER_WAIT,
  TRANSFER_TESTING
}
 
enum  IicPortPins { IIC_PORT_BUFFER_CTRL, IIC_PORT_CLOCK, IIC_PORT_DATA, IIC_PORT_PINS }
 

Macro Definition Documentation

#define IIC_INPUTS   4

Definition at line 73 of file d_iic.h.

#define IIC_MAGIC   'i'

Definition at line 66 of file d_iic.h.

#define IIC_PORT_CONFIG_IOC   _IOW(IIC_MAGIC,0, int)

Definition at line 67 of file d_iic.h.

#define IIC_READ_WRITE_IOC   _IOWR(IIC_MAGIC,1, struct IIC_data_package)

Definition at line 68 of file d_iic.h.

#define PINHigh (   port,
  pin 
)    { (*IicPortPin[port][pin].pGpio).set_data = IicPortPin[port][pin].Mask; }

Definition at line 93 of file d_iic.h.

#define PINInput (   port,
  pin 
)    { (*IicPortPin[port][pin].pGpio).dir |= IicPortPin[port][pin].Mask; }

Definition at line 90 of file d_iic.h.

#define PINLow (   port,
  pin 
)    { (*IicPortPin[port][pin].pGpio).clr_data = IicPortPin[port][pin].Mask; }

Definition at line 94 of file d_iic.h.

#define PINOutput (   port,
  pin 
)    { (*IicPortPin[port][pin].pGpio).dir &= ~IicPortPin[port][pin].Mask; }

Definition at line 91 of file d_iic.h.

#define PINRead (   port,
  pin 
)    (((*IicPortPin[port][pin].pGpio).in_data & IicPortPin[port][pin].Mask)?1:0)

Definition at line 92 of file d_iic.h.

Enumeration Type Documentation

Enumerator
IIC_PORT_BUFFER_CTRL 
IIC_PORT_CLOCK 
IIC_PORT_DATA 
IIC_PORT_PINS 

Definition at line 82 of file d_iic.h.

Enumerator
TRANSFER_IDLE 
TRANSFER_START 
TRANSFER_START2 
TRANSFER_ADDR 
TRANSFER_DATA 
TRANSFER_WRITE 
TRANSFER_READ 
TRANSFER_WBIT 
TRANSFER_RBIT 
TRANSFER_WACK 
TRANSFER_RACK 
TRANSFER_STOP 
TRANSFER_STOP2 
TRANSFER_STOP3 
TRANSFER_RESTART 
TRANSFER_WAIT 
TRANSFER_TESTING 

Definition at line 29 of file d_iic.h.