I am trying to integrate LPS22hb sensor n nrf52832. I am starting with twi_master_using_nrf_twi_mngr example(sdk15a->compents->drivers_ext->lps22hb)
I have added lps22hb.c,lps22hb.h and lps22hb_internal.h to my the twi_master_using_nrf_twi_mngr example.
ret_code_t hts221_temp_read(hts221_instance_t * p_instance,
hts221_data_callback_t user_callback,
int16_t * p_temp)
{
ASSERT(p_instance != NULL);
return nrf_twi_sensor_reg_read(p_instance->p_sensor_data,
p_instance->sensor_addr,
HTS221_REG_TEMP_OUT_L | HTS221_INCR_REG_MASK,
(nrf_twi_sensor_reg_cb_t) user_callback,
(uint8_t *) p_temp,
2);
}
I am not sure that what argument use when I call the function. i created the instance and know the sensor address.give below
/* TWI instance ID. */
#define TWI_INSTANCE_ID 0
#define TWI_ADDRESS 0x5B
#define MAX_PENDING_TRANSACTIONS 5
NRF_TWI_MNGR_DEF(m_nrf_twi_mngr, MAX_PENDING_TRANSACTIONS, TWI_INSTANCE_ID);
NRF_TWI_SENSOR_DEF(m_twi_sensor, &m_nrf_twi_mngr, 128);
LPS22HB_INSTANCE_DEF(m_lps22hb, &m_twi_sensor, TWI_ADDRESS);
i anyone could give me some pointers calling f this sensor that would be great.
thanks
