110 #define Int16FromBuf(_buf,_idx) ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8)))
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
uint8_t slave_addr
Slave address.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
void ist8310_read(struct IST8310 *ist)
void ist8310_event(struct IST8310 *ist)
void ist8310_init(struct IST8310 *ist, struct i2c_periph *i2c_p, uint8_t addr)
Initialize IST8310 struct.
void ist8310_configure(struct IST8310 *ist)
#define Int16FromBuf(_buf, _idx)
struct i2c_transaction i2c_trans
i2c transaction used for communication with the ist8310
bool initialized
config done flag
enum IST8310ConfStatus init_status
init status
enum IST8310Status status
main status
struct i2c_periph * i2c_p
peripheral used for communcation
volatile bool data_available
data ready flag
Default IST8310 structure.
#define IST8310_REG_CNTL3
#define IST8310_REG_CNTL4
#define IST8310_CNTL1_ODR_SINGLE
#define IST8310_REG_DATA_XL
#define IST8310_CNTL3_SAMPAVG_16
#define IST8310_REG_CNTL1
#define IST8310_CNTL4_SRPD
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.