This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

52810, LIS3DH, i2c using TWI, got NRF_ERROR_DRV_TWI_ERR_ANACK while calling nrf_drv_twi_tx

52810, LIS3DH, I call nrf_drv_twi_tx got NRF_ERROR_DRV_TWI_ERR_ANACK return using  either TWI/ or  TWIM . Here is my code:

const nrf_drv_twi_config_t config = {
.scl = TWI_MASTER_CONFIG_CLOCK_PIN_NUMBER,
.sda = TWI_MASTER_CONFIG_DATA_PIN_NUMBER,
.frequency = NRF_DRV_TWI_FREQ_100K,
.interrupt_priority = APP_IRQ_PRIORITY_HIGH, 
.clear_bus_init = true
};

err_code = nrf_drv_twi_init(&m_twi, &config, NULL, NULL);
APP_ERROR_CHECK(err_code);

nrf_drv_twi_enable(&m_twi);

uint8_t buf[7];

buf[0] = WHO_AM_I;

nrf_drv_twi_tx(&m_twi, LIS3DH_ACC_I2C_SAD_H, buf[0], 1, false);

Please help me out, thanks a lot.