Initial commit of fifo and i2c headers
This commit is contained in:
45
i2cspi_BaS_gcc/include/i2c_firebee.h
Normal file
45
i2cspi_BaS_gcc/include/i2c_firebee.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* i2c.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef I2CFIREBEE_h
|
||||
#define I2CFIREBEE_h
|
||||
|
||||
#include <fifo.h>
|
||||
|
||||
#ifndef BUFSIZ
|
||||
#define BUFSIZ 512
|
||||
#endif
|
||||
|
||||
#define I2CTLREAD (('i'<<8) | 1)
|
||||
#define I2CTLWRITE (('i'<<8) | 2)
|
||||
#define I2CTLSBUF (('i'<<8) | 3)
|
||||
#define I2CTLINIT (('i'<<8) | 4)
|
||||
#define I2CTLDEV (('i'<<8) | 5)
|
||||
|
||||
// Set a specific bit
|
||||
#define set_bit(p,bit) p |= bit
|
||||
// Clear a specific bit
|
||||
#define clear_bit(p,bit) p &= ~bit
|
||||
|
||||
#define ELAPSED(t) (t - ReadTimer())
|
||||
|
||||
#define I2C_BUFFER_LENGTH 32
|
||||
|
||||
#define I2C_READY 0
|
||||
#define I2C_MXRX 1
|
||||
#define I2C_MXTX 2
|
||||
|
||||
#define I2C_ADDR 6
|
||||
|
||||
#define I2C_READ 1
|
||||
#define I2C_WRITE 0
|
||||
|
||||
unsigned long ReadTimer();
|
||||
void DelayMicroSec(unsigned long);
|
||||
|
||||
void I2C_Init();
|
||||
int I2C_ioctl(unsigned int, unsigned long);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user