Hello Eason,
Which example code did you refer? In struct bmi2_dev, it has no dev_id member:
bmi2_defs.h
/*! Structure to define BMI2 sensor configurations */ struct bmi2_dev { /*! Chip id of BMI2 */ uint8_t chip_id;
/*! The interface pointer is used to enable the user * to link their interface descriptors for reference during the * implementation of the read and write interfaces to the * hardware. */ void *intf_ptr;
/*! To store warnings */ uint8_t info;
/*! Type of Interface */ enum bmi2_intf intf;
/*! To store interface pointer error */ BMI2_INTF_RETURN_TYPE intf_rslt;
/*! For switching from I2C to SPI */ uint8_t dummy_byte;
/*! Resolution for FOC */ uint8_t resolution;
/*! User set read/write length */ uint16_t read_write_len;
/*! Pointer to the configuration data buffer address */ const uint8_t *config_file_ptr;
/*! To define maximum page number */ uint8_t page_max;
/*! To define maximum number of input sensors/features */ uint8_t input_sens;
/*! To define maximum number of output sensors/features */ uint8_t out_sens;
/*! Indicate manual enable for auxiliary communication */ uint8_t aux_man_en;
/*! Defines manual read burst length for auxiliary communication */ uint8_t aux_man_rd_burst_len;
/*! Array of feature input configuration structure */ const struct bmi2_feature_config *feat_config;
/*! Array of feature output configuration structure */ const struct bmi2_feature_config *feat_output;
/*! Structure to maintain a copy of feature out_conf values */ struct bmi2_int_map int_map;
/*! Structure to maintain a copy of the re-mapped axis */ struct bmi2_axes_remap remap;
/*! Flag to hold enable status of sensors */ uint64_t sens_en_stat;
/*! Read function pointer */ bmi2_read_fptr_t read;
/*! Write function pointer */ bmi2_write_fptr_t write;
/*! Delay function pointer */ bmi2_delay_fptr_t delay_us;
/*! To store the gyroscope cross sensitivity value */ int16_t gyr_cross_sens_zx;
/* gyro enable status, used as a flag in CRT enabling and aborting */ uint8_t gyro_en : 1;
/* advance power saving mode status, used as a flag in CRT enabling and aborting */ uint8_t aps_status;
/* used as a flag to enable variant specific features like crt */ uint16_t variant_feature;
/* To store hold the size of config file */ uint16_t config_size;
/*! Function pointer to get wakeup configurations */ bmi2_wake_up_fptr_t get_wakeup_config;
/*! Function pointer to set wakeup configurations */ bmi2_wake_up_fptr_t set_wakeup_config; };
... View more