46 uint8_t i2c_write_data[1];
51 i2c_write_data[0] = reg;
52 seq.
buf[0].
data = i2c_write_data;
86 uint8_t i2c_write_data[2];
87 uint8_t i2c_read_data[1];
92 i2c_write_data[0] = reg;
93 i2c_write_data[1] = data;
94 seq.
buf[0].
data = i2c_write_data;
96 seq.
buf[1].
data = i2c_read_data;
102 return (uint32_t)ret;
128 uint8_t i2c_write_data[10];
129 uint8_t i2c_read_data[1];
135 i2c_write_data[0] = reg;
136 for (i=0; i<length;i++)
138 i2c_write_data[i+1] = data[i];
140 seq.
buf[0].
data = i2c_write_data;
141 seq.
buf[0].
len = 1+length;
142 seq.
buf[1].
data = i2c_read_data;
148 return (uint32_t)ret;
174 uint8_t i2c_write_data[1];
179 i2c_write_data[0] = reg;
180 seq.
buf[0].
data = i2c_write_data;
189 return (uint32_t)ret;
207 return Si1147_Write_Register(((si114x_i2c_t*)si114x_handle)->i2c,((si114x_i2c_t*)si114x_handle)->addr, address, data);
222 Si1147_Read_Register(((si114x_i2c_t*)si114x_handle)->i2c,((si114x_i2c_t*)si114x_handle)->addr, address, &data);
240 uint8_t address, uint8_t length, uint8_t *values)
242 return Si1147_Write_Block_Register(((si114x_i2c_t*)si114x_handle)->i2c,((si114x_i2c_t*)si114x_handle)->addr, address, length, values);
259 uint8_t address, uint8_t length, uint8_t *values)
261 return Si1147_Read_Block_Register(((si114x_i2c_t*)si114x_handle)->i2c,((si114x_i2c_t*)si114x_handle)->addr, address, length, values);
void delay_10ms()
Implements 10ms delay.
I2C_TransferReturn_TypeDef I2CSPM_Transfer(I2C_TypeDef *i2c, I2C_TransferSeq_TypeDef *seq)
Perform I2C transfer.
Si114x function prototypes, structure and bit definitions.
uint32_t Si1147_Read_Block_Register(I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t length, uint8_t *data)
Reads a block of data from the Si1147 sensor.
uint32_t Si1147_Write_Register(I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t data)
Writes register in the Si1147 sensor.
Driver for the Si1147 Proximity sensor.
uint32_t Si1147_Read_Register(I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t *data)
Reads register from the Si1147 sensor.
int16_t Si114xBlockWrite(HANDLE si114x_handle, uint8_t address, uint8_t length, uint8_t *values)
Writes block of Si114x registers.
#define I2C_FLAG_WRITE
Indicate plain write sequence: S+ADDR(W)+DATA0+P.
RTCDRV timer API definition.
I2C_TransferReturn_TypeDef
int16_t Si114xWriteToRegister(HANDLE si114x_handle, uint8_t address, uint8_t data)
Writes to Si114x Register.
void delay_1ms()
Implements 1ms delay.
I2C simple poll-based master mode driver for the DK/STK.
Ecode_t RTCDRV_Delay(uint32_t ms)
Millisecond delay function.
uint32_t Si1147_Write_Block_Register(I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t length, uint8_t const *data)
Writes a block of data to the Si1147 sensor.
struct I2C_TransferSeq_TypeDef::@0 buf[2]
int16_t Si114xReadFromRegister(HANDLE si114x_handle, uint8_t address)
Reads from Si114x register.
Master mode transfer message structure used to define a complete I2C transfer sequence (from start to...
int16_t Si114xBlockRead(HANDLE si114x_handle, uint8_t address, uint8_t length, uint8_t *values)
Reads block of Si114x registers.
static void * si114x_handle
Si114x PGM toolkit functions uses a void* to pass hardware parameters through to the lower level i2c ...
#define I2C_FLAG_WRITE_READ
Indicate combined write/read sequence: S+ADDR(W)+DATA0+Sr+ADDR(R)+DATA1+P.
uint16_t addr
Address to use after (repeated) start.