I am trying to integrate code on hts221 with an nrf52832. I am using sdk15a for referring the .h and .c of hts221.
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);
HTS221_INSTANCE_DEF(m_hts221, &m_twi_sensor, HTS221_ADDR );
how to call this macros( in hts221.c) into the main file
I am not sure this is correct ?
HTS221_WRITE(m_hts221, msg);
also problem in how to call this function into main file
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 trying but getting errror.
If anyone knows please help me.(anyone having code hts221 twi interfacing please provide)
