01-26-2023 12:22 PM - edited 01-26-2023 12:23 PM
Hi, jimit here, I built my own BMI270 API for Arduino boards, and I have a question regarding the BMI270 interrupt function, I want to generate an interrupt Acceleration sensor data. but to us, a surprise interrupt generates without attaching an interrupt pin attach, and I don't know how? can you guide me? here is my code.
01-29-2023 03:31 PM
Hi jimit007,
The official BMI270 API is written in C language. You can refer to the code on github: https://github.com/boschsensortec/BMI270-Sensor-API/blob/master/bmi270_examples/accel/accel.c
For the interrupt part of acceleration data ready, you can refer to the following code:
int8_t Open_BMI270_RDRY_INT(struct bmi2_dev *dev)
{
int8_t rslt = BMI2_OK;
struct bmi2_int_pin_config int_cfg;
/* Map data ready interrupt to interrupt pin. */
rslt = bmi2_map_data_int(BMI2_DRDY_INT, BMI2_INT1, dev);
bmi2_error_codes_print_result(rslt);
bmi2_get_int_pin_config(&int_cfg, dev);
int_cfg.pin_type = BMI2_INT1;
int_cfg.pin_cfg[0].lvl = BMI2_INT_ACTIVE_HIGH;/*Config INT1 rising edge trigging*/
int_cfg.pin_cfg[0].od = BMI2_INT_PUSH_PULL;
int_cfg.pin_cfg[0].output_en= BMI2_INT_OUTPUT_ENABLE;
bmi2_set_int_pin_config(&int_cfg, dev);
bmi2_error_codes_print_result(rslt);
return rslt;
}