|
@@ -30,16 +30,15 @@
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
*
|
|
*
|
|
|
-* @file bmi160.h
|
|
|
|
|
-* @date 10/01/2020
|
|
|
|
|
-* @version 3.8.1
|
|
|
|
|
|
|
+* @file bmi160.h
|
|
|
|
|
+* @date 2021-03-12
|
|
|
|
|
+* @version v3.9.1
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @defgroup bmi160
|
|
|
|
|
- * @brief
|
|
|
|
|
- * @{*/
|
|
|
|
|
|
|
+ * @defgroup bmi160 BMI160
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
#ifndef BMI160_H_
|
|
#ifndef BMI160_H_
|
|
|
#define BMI160_H_
|
|
#define BMI160_H_
|
|
@@ -60,8 +59,19 @@ extern "C" {
|
|
|
|
|
|
|
|
/*********************** User function prototypes ************************/
|
|
/*********************** User function prototypes ************************/
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiInit Initialization
|
|
|
|
|
+ * @brief Initialize the sensor and device structure
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API is the entry point for sensor.It performs
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiInit
|
|
|
|
|
+ * \page bmi160_api_bmi160_init bmi160_init
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_init(struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API is the entry point for sensor.It performs
|
|
|
* the selection of I2C/SPI read mechanism according to the
|
|
* the selection of I2C/SPI read mechanism according to the
|
|
|
* selected interface and reads the chip-id of bmi160 sensor.
|
|
* selected interface and reads the chip-id of bmi160 sensor.
|
|
|
*
|
|
*
|
|
@@ -69,12 +79,24 @@ extern "C" {
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_init(struct bmi160_dev *dev);
|
|
int8_t bmi160_init(struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiRegs Registers
|
|
|
|
|
+ * @brief Read data from the given register address of sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API reads the data from the given register address of sensor.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiRegs
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_regs bmi160_get_regs
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API reads the data from the given register address of sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] reg_addr : Register address from where the data to be read
|
|
* @param[in] reg_addr : Register address from where the data to be read
|
|
|
* @param[out] data : Pointer to data buffer to store the read data.
|
|
* @param[out] data : Pointer to data buffer to store the read data.
|
|
@@ -86,12 +108,18 @@ int8_t bmi160_init(struct bmi160_dev *dev);
|
|
|
* Register address - 0x24(BMI160_FIFO_DATA_ADDR)
|
|
* Register address - 0x24(BMI160_FIFO_DATA_ADDR)
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_get_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const struct bmi160_dev *dev);
|
|
int8_t bmi160_get_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API writes the given data to the register address
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiRegs
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_regs bmi160_set_regs
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API writes the given data to the register address
|
|
|
* of sensor.
|
|
* of sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] reg_addr : Register address from where the data to be written.
|
|
* @param[in] reg_addr : Register address from where the data to be written.
|
|
@@ -101,45 +129,104 @@ int8_t bmi160_get_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const stru
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const struct bmi160_dev *dev);
|
|
int8_t bmi160_set_regs(uint8_t reg_addr, uint8_t *data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiSoftreset Soft reset
|
|
|
|
|
+ * @brief Perform soft reset of the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API resets and restarts the device.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiSoftreset
|
|
|
|
|
+ * \page bmi160_api_bmi160_soft_reset bmi160_soft_reset
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_soft_reset(struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API resets and restarts the device.
|
|
|
* All register values are overwritten with default parameters.
|
|
* All register values are overwritten with default parameters.
|
|
|
*
|
|
*
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error.
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_soft_reset(struct bmi160_dev *dev);
|
|
int8_t bmi160_soft_reset(struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiConfig Configuration
|
|
|
|
|
+ * @brief Configuration of the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API configures the power mode, range and bandwidth
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiConfig
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_sens_conf bmi160_set_sens_conf
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_sens_conf(struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API configures the power mode, range and bandwidth
|
|
|
* of sensor.
|
|
* of sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error.
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_sens_conf(struct bmi160_dev *dev);
|
|
int8_t bmi160_set_sens_conf(struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API sets the power mode of the sensor.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiConfig
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_sens_conf bmi160_get_sens_conf
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_sens_conf(struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API gets accel and gyro configurations.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param[out] dev : Structure instance of bmi160_dev.
|
|
|
|
|
+ * @note : Refer user guide for detailed info.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return Result of API execution status
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
|
|
+ */
|
|
|
|
|
+int8_t bmi160_get_sens_conf(struct bmi160_dev *dev);
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiPowermode Power mode
|
|
|
|
|
+ * @brief Set / Get power mode of the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+/*!
|
|
|
|
|
+ * \ingroup bmi160ApiPowermode
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_power_mode bmi160_set_power_mode
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_power_mode(struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API sets the power mode of the sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error.
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_power_mode(struct bmi160_dev *dev);
|
|
int8_t bmi160_set_power_mode(struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API gets the power mode of the sensor.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiPowermode
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_power_mode bmi160_get_power_mode
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_power_mode(struct bmi160_pmu_status *pmu_status, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API gets the power mode of the sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] power_mode : Power mode of the sensor
|
|
* @param[in] power_mode : Power mode of the sensor
|
|
|
* @param[in] dev : Structure instance of bmi160_dev
|
|
* @param[in] dev : Structure instance of bmi160_dev
|
|
@@ -160,12 +247,28 @@ int8_t bmi160_set_power_mode(struct bmi160_dev *dev);
|
|
|
* - BMI160_ACCEL_PMU_LOW_POWER
|
|
* - BMI160_ACCEL_PMU_LOW_POWER
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error.
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_get_power_mode(struct bmi160_pmu_status *pmu_status, const struct bmi160_dev *dev);
|
|
int8_t bmi160_get_power_mode(struct bmi160_pmu_status *pmu_status, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiData Sensor Data
|
|
|
|
|
+ * @brief Read sensor data
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API reads sensor data, stores it in
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiData
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_sensor_data bmi160_get_sensor_data
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_sensor_data(uint8_t select_sensor,
|
|
|
|
|
+ * struct bmi160_sensor_data *accel,
|
|
|
|
|
+ * struct bmi160_sensor_data *gyro,
|
|
|
|
|
+ * const struct bmi160_dev *dev);
|
|
|
|
|
+ *
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API reads sensor data, stores it in
|
|
|
* the bmi160_sensor_data structure pointer passed by the user.
|
|
* the bmi160_sensor_data structure pointer passed by the user.
|
|
|
* The user can ask for accel data ,gyro data or both sensor
|
|
* The user can ask for accel data ,gyro data or both sensor
|
|
|
* data using bmi160_select_sensor enum
|
|
* data using bmi160_select_sensor enum
|
|
@@ -177,15 +280,27 @@ int8_t bmi160_get_power_mode(struct bmi160_pmu_status *pmu_status, const struct
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_get_sensor_data(uint8_t select_sensor,
|
|
int8_t bmi160_get_sensor_data(uint8_t select_sensor,
|
|
|
struct bmi160_sensor_data *accel,
|
|
struct bmi160_sensor_data *accel,
|
|
|
struct bmi160_sensor_data *gyro,
|
|
struct bmi160_sensor_data *gyro,
|
|
|
const struct bmi160_dev *dev);
|
|
const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiInt Interrupt configuration
|
|
|
|
|
+ * @brief Set interrupt configuration of the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API configures the necessary interrupt based on
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiInt
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_int_config bmi160_set_int_config
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_int_config(struct bmi160_int_settg *int_config, struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API configures the necessary interrupt based on
|
|
|
* the user settings in the bmi160_int_settg structure instance.
|
|
* the user settings in the bmi160_int_settg structure instance.
|
|
|
*
|
|
*
|
|
|
* @param[in] int_config : Structure instance of bmi160_int_settg.
|
|
* @param[in] int_config : Structure instance of bmi160_int_settg.
|
|
@@ -193,36 +308,66 @@ int8_t bmi160_get_sensor_data(uint8_t select_sensor,
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_int_config(struct bmi160_int_settg *int_config, struct bmi160_dev *dev);
|
|
int8_t bmi160_set_int_config(struct bmi160_int_settg *int_config, struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiStepC Step counter
|
|
|
|
|
+ * @brief Step counter operations
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API enables the step counter feature.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiStepC
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_step_counter bmi160_set_step_counter
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_step_counter(uint8_t step_cnt_enable, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API enables the step counter feature.
|
|
|
*
|
|
*
|
|
|
* @param[in] step_cnt_enable : value to enable or disable
|
|
* @param[in] step_cnt_enable : value to enable or disable
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_step_counter(uint8_t step_cnt_enable, const struct bmi160_dev *dev);
|
|
int8_t bmi160_set_step_counter(uint8_t step_cnt_enable, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API reads the step counter value.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiStepC
|
|
|
|
|
+ * \page bmi160_api_bmi160_read_step_counter bmi160_read_step_counter
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_read_step_counter(uint16_t *step_val, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API reads the step counter value.
|
|
|
*
|
|
*
|
|
|
* @param[in] step_val : Pointer to store the step counter value.
|
|
* @param[in] step_val : Pointer to store the step counter value.
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_read_step_counter(uint16_t *step_val, const struct bmi160_dev *dev);
|
|
int8_t bmi160_read_step_counter(uint16_t *step_val, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiAux Auxiliary sensor
|
|
|
|
|
+ * @brief Auxiliary sensor operations
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API reads the mention no of byte of data from the given
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiAux
|
|
|
|
|
+ * \page bmi160_api_bmi160_aux_read bmi160_aux_read
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_aux_read(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API reads the mention no of byte of data from the given
|
|
|
* register address of auxiliary sensor.
|
|
* register address of auxiliary sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] reg_addr : Address of register to read.
|
|
* @param[in] reg_addr : Address of register to read.
|
|
@@ -232,12 +377,18 @@ int8_t bmi160_read_step_counter(uint16_t *step_val, const struct bmi160_dev *dev
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_aux_read(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const struct bmi160_dev *dev);
|
|
int8_t bmi160_aux_read(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API writes the mention no of byte of data to the given
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiAux
|
|
|
|
|
+ * \page bmi160_api_bmi160_aux_write bmi160_aux_write
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_aux_write(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API writes the mention no of byte of data to the given
|
|
|
* register address of auxiliary sensor.
|
|
* register address of auxiliary sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] reg_addr : Address of register to write.
|
|
* @param[in] reg_addr : Address of register to write.
|
|
@@ -247,24 +398,36 @@ int8_t bmi160_aux_read(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_aux_write(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const struct bmi160_dev *dev);
|
|
int8_t bmi160_aux_write(uint8_t reg_addr, uint8_t *aux_data, uint16_t len, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API initialize the auxiliary sensor
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiAux
|
|
|
|
|
+ * \page bmi160_api_bmi160_aux_init bmi160_aux_init
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_aux_init(const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API initialize the auxiliary sensor
|
|
|
* in order to access it.
|
|
* in order to access it.
|
|
|
*
|
|
*
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
* @note : Refer user guide for detailed info.
|
|
* @note : Refer user guide for detailed info.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_aux_init(const struct bmi160_dev *dev);
|
|
int8_t bmi160_aux_init(const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API is used to setup the auxiliary sensor of bmi160 in auto mode
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiAux
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_aux_auto_mode bmi160_set_aux_auto_mode
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_aux_auto_mode(uint8_t *data_addr, struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API is used to setup the auxiliary sensor of bmi160 in auto mode
|
|
|
* Thus enabling the auto update of 8 bytes of data from auxiliary sensor
|
|
* Thus enabling the auto update of 8 bytes of data from auxiliary sensor
|
|
|
* to BMI160 register address 0x04 to 0x0B
|
|
* to BMI160 register address 0x04 to 0x0B
|
|
|
*
|
|
*
|
|
@@ -278,6 +441,7 @@ int8_t bmi160_aux_init(const struct bmi160_dev *dev);
|
|
|
* dev->aux_cfg.aux_odr to the required value from the table
|
|
* dev->aux_cfg.aux_odr to the required value from the table
|
|
|
* before calling this API
|
|
* before calling this API
|
|
|
*
|
|
*
|
|
|
|
|
+ *@verbatim
|
|
|
* dev->aux_cfg.aux_odr | Auxiliary ODR (Hz)
|
|
* dev->aux_cfg.aux_odr | Auxiliary ODR (Hz)
|
|
|
* -----------------------|-----------------------
|
|
* -----------------------|-----------------------
|
|
|
* BMI160_AUX_ODR_0_78HZ | 25/32
|
|
* BMI160_AUX_ODR_0_78HZ | 25/32
|
|
@@ -291,27 +455,40 @@ int8_t bmi160_aux_init(const struct bmi160_dev *dev);
|
|
|
* BMI160_AUX_ODR_200HZ | 200
|
|
* BMI160_AUX_ODR_200HZ | 200
|
|
|
* BMI160_AUX_ODR_400HZ | 400
|
|
* BMI160_AUX_ODR_400HZ | 400
|
|
|
* BMI160_AUX_ODR_800HZ | 800
|
|
* BMI160_AUX_ODR_800HZ | 800
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @note : Other values of dev->aux_cfg.aux_odr are reserved and not for use
|
|
* @note : Other values of dev->aux_cfg.aux_odr are reserved and not for use
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_aux_auto_mode(uint8_t *data_addr, struct bmi160_dev *dev);
|
|
int8_t bmi160_set_aux_auto_mode(uint8_t *data_addr, struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API configures the 0x4C register and settings like
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiAux
|
|
|
|
|
+ * \page bmi160_api_bmi160_config_aux_mode bmi160_config_aux_mode
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_config_aux_mode(const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API configures the 0x4C register and settings like
|
|
|
* Auxiliary sensor manual enable/ disable and aux burst read length.
|
|
* Auxiliary sensor manual enable/ disable and aux burst read length.
|
|
|
*
|
|
*
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_config_aux_mode(const struct bmi160_dev *dev);
|
|
int8_t bmi160_config_aux_mode(const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API is used to read the raw uncompensated auxiliary sensor
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiAux
|
|
|
|
|
+ * \page bmi160_api_bmi160_read_aux_data_auto_mode bmi160_read_aux_data_auto_mode
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_read_aux_data_auto_mode(uint8_t *aux_data, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API is used to read the raw uncompensated auxiliary sensor
|
|
|
* data of 8 bytes from BMI160 register address 0x04 to 0x0B
|
|
* data of 8 bytes from BMI160 register address 0x04 to 0x0B
|
|
|
*
|
|
*
|
|
|
* @param[in] aux_data : Pointer to user array of length 8 bytes
|
|
* @param[in] aux_data : Pointer to user array of length 8 bytes
|
|
@@ -319,24 +496,38 @@ int8_t bmi160_config_aux_mode(const struct bmi160_dev *dev);
|
|
|
* length 8 bytes
|
|
* length 8 bytes
|
|
|
* @param[in] dev : Structure instance of bmi160_dev
|
|
* @param[in] dev : Structure instance of bmi160_dev
|
|
|
*
|
|
*
|
|
|
- * @return Result of API execution status
|
|
|
|
|
* @retval zero -> Success / -ve value -> Error
|
|
* @retval zero -> Success / -ve value -> Error
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_read_aux_data_auto_mode(uint8_t *aux_data, const struct bmi160_dev *dev);
|
|
int8_t bmi160_read_aux_data_auto_mode(uint8_t *aux_data, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiSelfTest Self test
|
|
|
|
|
+ * @brief Perform self test of the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This is used to perform self test of accel/gyro of the BMI160 sensor
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiSelfTest
|
|
|
|
|
+ * \page bmi160_api_bmi160_perform_self_test bmi160_perform_self_test
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_perform_self_test(uint8_t select_sensor, struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This is used to perform self test of accel/gyro of the BMI160 sensor
|
|
|
*
|
|
*
|
|
|
* @param[in] select_sensor : enum to choose accel or gyro for self test
|
|
* @param[in] select_sensor : enum to choose accel or gyro for self test
|
|
|
* @param[in] dev : Structure instance of bmi160_dev
|
|
* @param[in] dev : Structure instance of bmi160_dev
|
|
|
*
|
|
*
|
|
|
* @note self test can be performed either for accel/gyro at any instant.
|
|
* @note self test can be performed either for accel/gyro at any instant.
|
|
|
*
|
|
*
|
|
|
|
|
+ *@verbatim
|
|
|
* value of select_sensor | Inference
|
|
* value of select_sensor | Inference
|
|
|
*----------------------------------|--------------------------------
|
|
*----------------------------------|--------------------------------
|
|
|
* BMI160_ACCEL_ONLY | Accel self test enabled
|
|
* BMI160_ACCEL_ONLY | Accel self test enabled
|
|
|
* BMI160_GYRO_ONLY | Gyro self test enabled
|
|
* BMI160_GYRO_ONLY | Gyro self test enabled
|
|
|
* BMI160_BOTH_ACCEL_AND_GYRO | NOT TO BE USED
|
|
* BMI160_BOTH_ACCEL_AND_GYRO | NOT TO BE USED
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @note The return value of this API gives us the result of self test.
|
|
* @note The return value of this API gives us the result of self test.
|
|
|
*
|
|
*
|
|
@@ -344,18 +535,25 @@ int8_t bmi160_read_aux_data_auto_mode(uint8_t *aux_data, const struct bmi160_dev
|
|
|
* set the desired settings after performing the self test.
|
|
* set the desired settings after performing the self test.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error / +ve value -> Self-test fail
|
|
|
|
|
- *
|
|
|
|
|
- * Return value | Result of self test
|
|
|
|
|
- * --------------------------------|---------------------------------
|
|
|
|
|
- * BMI160_OK | Self test success
|
|
|
|
|
- * BMI160_W_GYRO_SELF_TEST_FAIL | Gyro self test fail
|
|
|
|
|
- * BMI160_W_ACCEl_SELF_TEST_FAIL | Accel self test fail
|
|
|
|
|
|
|
+ * @retval BMI160_OK Self test success
|
|
|
|
|
+ * @retval BMI160_W_GYRO_SELF_TEST_FAIL Gyro self test fail
|
|
|
|
|
+ * @retval BMI160_W_ACCEl_SELF_TEST_FAIL Accel self test fail
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_perform_self_test(uint8_t select_sensor, struct bmi160_dev *dev);
|
|
int8_t bmi160_perform_self_test(uint8_t select_sensor, struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiFIFO FIFO
|
|
|
|
|
+ * @brief FIFO operations of the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API reads data from the fifo buffer.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_fifo_data bmi160_get_fifo_data
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_fifo_data(struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API reads data from the fifo buffer.
|
|
|
*
|
|
*
|
|
|
* @note User has to allocate the FIFO buffer along with
|
|
* @note User has to allocate the FIFO buffer along with
|
|
|
* corresponding fifo length from his side before calling this API
|
|
* corresponding fifo length from his side before calling this API
|
|
@@ -368,13 +566,18 @@ int8_t bmi160_perform_self_test(uint8_t select_sensor, struct bmi160_dev *dev);
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
|
*
|
|
*
|
|
|
* @return Result of API execution status
|
|
* @return Result of API execution status
|
|
|
- * @retval zero -> Success / -ve value -> Error
|
|
|
|
|
- *
|
|
|
|
|
|
|
+ * @retval Zero Success
|
|
|
|
|
+ * @retval Negative Error
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_get_fifo_data(struct bmi160_dev const *dev);
|
|
int8_t bmi160_get_fifo_data(struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API writes fifo_flush command to command register.This
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_fifo_flush bmi160_set_fifo_flush
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_fifo_flush(const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API writes fifo_flush command to command register.This
|
|
|
* action clears all data in the Fifo without changing fifo configuration
|
|
* action clears all data in the Fifo without changing fifo configuration
|
|
|
* settings.
|
|
* settings.
|
|
|
*
|
|
*
|
|
@@ -387,13 +590,21 @@ int8_t bmi160_get_fifo_data(struct bmi160_dev const *dev);
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_fifo_flush(const struct bmi160_dev *dev);
|
|
int8_t bmi160_set_fifo_flush(const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
-/*! @brief This API sets the FIFO configuration in the sensor.
|
|
|
|
|
|
|
+/*!
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_fifo_config bmi160_set_fifo_config
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API sets the FIFO configuration in the sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] config : variable used to specify the FIFO
|
|
* @param[in] config : variable used to specify the FIFO
|
|
|
* configurations which are to be enabled or disabled in the sensor.
|
|
* configurations which are to be enabled or disabled in the sensor.
|
|
|
*
|
|
*
|
|
|
* @note : User can set either set one or more or all FIFO configurations
|
|
* @note : User can set either set one or more or all FIFO configurations
|
|
|
* by ORing the below mentioned macros.
|
|
* by ORing the below mentioned macros.
|
|
|
|
|
+ *
|
|
|
|
|
+ *@verbatim
|
|
|
* config | Value
|
|
* config | Value
|
|
|
* ------------------------|---------------------------
|
|
* ------------------------|---------------------------
|
|
|
* BMI160_FIFO_TIME | 0x02
|
|
* BMI160_FIFO_TIME | 0x02
|
|
@@ -401,8 +612,9 @@ int8_t bmi160_set_fifo_flush(const struct bmi160_dev *dev);
|
|
|
* BMI160_FIFO_TAG_INT1 | 0x08
|
|
* BMI160_FIFO_TAG_INT1 | 0x08
|
|
|
* BMI160_FIFO_HEADER | 0x10
|
|
* BMI160_FIFO_HEADER | 0x10
|
|
|
* BMI160_FIFO_AUX | 0x20
|
|
* BMI160_FIFO_AUX | 0x20
|
|
|
- * BMI160_FIFO_ACCEL | 0x40
|
|
|
|
|
|
|
+ * BMI160_FIFO_ACCEL | 0x40
|
|
|
* BMI160_FIFO_GYRO | 0x80
|
|
* BMI160_FIFO_GYRO | 0x80
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @param[in] enable : Parameter used to enable or disable the above
|
|
* @param[in] enable : Parameter used to enable or disable the above
|
|
|
* FIFO configuration
|
|
* FIFO configuration
|
|
@@ -415,7 +627,13 @@ int8_t bmi160_set_fifo_flush(const struct bmi160_dev *dev);
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev const *dev);
|
|
int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
-/*! @brief This API is used to configure the down sampling ratios of
|
|
|
|
|
|
|
+/*!
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_fifo_down bmi160_set_fifo_down
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_fifo_down(uint8_t fifo_down, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API is used to configure the down sampling ratios of
|
|
|
* the accel and gyro data for FIFO.Also, it configures filtered or
|
|
* the accel and gyro data for FIFO.Also, it configures filtered or
|
|
|
* pre-filtered data for the fifo for accel and gyro.
|
|
* pre-filtered data for the fifo for accel and gyro.
|
|
|
*
|
|
*
|
|
@@ -424,6 +642,8 @@ int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev
|
|
|
*
|
|
*
|
|
|
* @note The user must select one among the following macros to
|
|
* @note The user must select one among the following macros to
|
|
|
* select down-sampling ratio for accel
|
|
* select down-sampling ratio for accel
|
|
|
|
|
+ *
|
|
|
|
|
+ *@verbatim
|
|
|
* config | Value
|
|
* config | Value
|
|
|
* -------------------------------------|---------------------------
|
|
* -------------------------------------|---------------------------
|
|
|
* BMI160_ACCEL_FIFO_DOWN_ZERO | 0x00
|
|
* BMI160_ACCEL_FIFO_DOWN_ZERO | 0x00
|
|
@@ -434,10 +654,12 @@ int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev
|
|
|
* BMI160_ACCEL_FIFO_DOWN_FIVE | 0x50
|
|
* BMI160_ACCEL_FIFO_DOWN_FIVE | 0x50
|
|
|
* BMI160_ACCEL_FIFO_DOWN_SIX | 0x60
|
|
* BMI160_ACCEL_FIFO_DOWN_SIX | 0x60
|
|
|
* BMI160_ACCEL_FIFO_DOWN_SEVEN | 0x70
|
|
* BMI160_ACCEL_FIFO_DOWN_SEVEN | 0x70
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @note The user must select one among the following macros to
|
|
* @note The user must select one among the following macros to
|
|
|
* select down-sampling ratio for gyro
|
|
* select down-sampling ratio for gyro
|
|
|
*
|
|
*
|
|
|
|
|
+ *@verbatim
|
|
|
* config | Value
|
|
* config | Value
|
|
|
* -------------------------------------|---------------------------
|
|
* -------------------------------------|---------------------------
|
|
|
* BMI160_GYRO_FIFO_DOWN_ZERO | 0x00
|
|
* BMI160_GYRO_FIFO_DOWN_ZERO | 0x00
|
|
@@ -448,16 +670,23 @@ int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev
|
|
|
* BMI160_GYRO_FIFO_DOWN_FIVE | 0x05
|
|
* BMI160_GYRO_FIFO_DOWN_FIVE | 0x05
|
|
|
* BMI160_GYRO_FIFO_DOWN_SIX | 0x06
|
|
* BMI160_GYRO_FIFO_DOWN_SIX | 0x06
|
|
|
* BMI160_GYRO_FIFO_DOWN_SEVEN | 0x07
|
|
* BMI160_GYRO_FIFO_DOWN_SEVEN | 0x07
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @note The user can enable filtered accel data by the following macro
|
|
* @note The user can enable filtered accel data by the following macro
|
|
|
|
|
+ *
|
|
|
|
|
+ *@verbatim
|
|
|
* config | Value
|
|
* config | Value
|
|
|
* -------------------------------------|---------------------------
|
|
* -------------------------------------|---------------------------
|
|
|
* BMI160_ACCEL_FIFO_FILT_EN | 0x80
|
|
* BMI160_ACCEL_FIFO_FILT_EN | 0x80
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @note The user can enable filtered gyro data by the following macro
|
|
* @note The user can enable filtered gyro data by the following macro
|
|
|
|
|
+ *
|
|
|
|
|
+ *@verbatim
|
|
|
* config | Value
|
|
* config | Value
|
|
|
* -------------------------------------|---------------------------
|
|
* -------------------------------------|---------------------------
|
|
|
* BMI160_GYRO_FIFO_FILT_EN | 0x08
|
|
* BMI160_GYRO_FIFO_FILT_EN | 0x08
|
|
|
|
|
+ *@endverbatim
|
|
|
*
|
|
*
|
|
|
* @note : By ORing the above mentioned macros, the user can select
|
|
* @note : By ORing the above mentioned macros, the user can select
|
|
|
* the required FIFO down config settings
|
|
* the required FIFO down config settings
|
|
@@ -472,7 +701,12 @@ int8_t bmi160_set_fifo_config(uint8_t config, uint8_t enable, struct bmi160_dev
|
|
|
int8_t bmi160_set_fifo_down(uint8_t fifo_down, const struct bmi160_dev *dev);
|
|
int8_t bmi160_set_fifo_down(uint8_t fifo_down, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API sets the FIFO watermark level in the sensor.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_fifo_wm bmi160_set_fifo_wm
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_fifo_wm(uint8_t fifo_wm, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API sets the FIFO watermark level in the sensor.
|
|
|
*
|
|
*
|
|
|
* @note The FIFO watermark is issued when the FIFO fill level is
|
|
* @note The FIFO watermark is issued when the FIFO fill level is
|
|
|
* equal or above the watermark level and units of watermark is 4 bytes.
|
|
* equal or above the watermark level and units of watermark is 4 bytes.
|
|
@@ -488,7 +722,13 @@ int8_t bmi160_set_fifo_down(uint8_t fifo_down, const struct bmi160_dev *dev);
|
|
|
int8_t bmi160_set_fifo_wm(uint8_t fifo_wm, const struct bmi160_dev *dev);
|
|
int8_t bmi160_set_fifo_wm(uint8_t fifo_wm, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API parses and extracts the accelerometer frames from
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_extract_accel bmi160_extract_accel
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_extract_accel(struct bmi160_sensor_data *accel_data, uint8_t *accel_length, struct bmi160_dev const
|
|
|
|
|
+ **dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API parses and extracts the accelerometer frames from
|
|
|
* FIFO data read by the "bmi160_get_fifo_data" API and stores it in
|
|
* FIFO data read by the "bmi160_get_fifo_data" API and stores it in
|
|
|
* the "accel_data" structure instance.
|
|
* the "accel_data" structure instance.
|
|
|
*
|
|
*
|
|
@@ -513,7 +753,12 @@ int8_t bmi160_set_fifo_wm(uint8_t fifo_wm, const struct bmi160_dev *dev);
|
|
|
int8_t bmi160_extract_accel(struct bmi160_sensor_data *accel_data, uint8_t *accel_length, struct bmi160_dev const *dev);
|
|
int8_t bmi160_extract_accel(struct bmi160_sensor_data *accel_data, uint8_t *accel_length, struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API parses and extracts the gyro frames from
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_extract_gyro bmi160_extract_gyro
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_extract_gyro(struct bmi160_sensor_data *gyro_data, uint8_t *gyro_length, struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API parses and extracts the gyro frames from
|
|
|
* FIFO data read by the "bmi160_get_fifo_data" API and stores it in
|
|
* FIFO data read by the "bmi160_get_fifo_data" API and stores it in
|
|
|
* the "gyro_data" structure instance.
|
|
* the "gyro_data" structure instance.
|
|
|
*
|
|
*
|
|
@@ -538,7 +783,12 @@ int8_t bmi160_extract_accel(struct bmi160_sensor_data *accel_data, uint8_t *acce
|
|
|
int8_t bmi160_extract_gyro(struct bmi160_sensor_data *gyro_data, uint8_t *gyro_length, struct bmi160_dev const *dev);
|
|
int8_t bmi160_extract_gyro(struct bmi160_sensor_data *gyro_data, uint8_t *gyro_length, struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API parses and extracts the aux frames from
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFIFO
|
|
|
|
|
+ * \page bmi160_api_bmi160_extract_aux bmi160_extract_aux
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_extract_aux(struct bmi160_aux_data *aux_data, uint8_t *aux_len, struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API parses and extracts the aux frames from
|
|
|
* FIFO data read by the "bmi160_get_fifo_data" API and stores it in
|
|
* FIFO data read by the "bmi160_get_fifo_data" API and stores it in
|
|
|
* the bmi160_aux_data structure instance.
|
|
* the bmi160_aux_data structure instance.
|
|
|
*
|
|
*
|
|
@@ -562,8 +812,19 @@ int8_t bmi160_extract_gyro(struct bmi160_sensor_data *gyro_data, uint8_t *gyro_l
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_extract_aux(struct bmi160_aux_data *aux_data, uint8_t *aux_len, struct bmi160_dev const *dev);
|
|
int8_t bmi160_extract_aux(struct bmi160_aux_data *aux_data, uint8_t *aux_len, struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiFOC FOC
|
|
|
|
|
+ * @brief Start FOC of accel and gyro sensors
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API starts the FOC of accel and gyro
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiFOC
|
|
|
|
|
+ * \page bmi160_api_bmi160_start_foc bmi160_start_foc
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_start_foc(const struct bmi160_foc_conf *foc_conf,
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API starts the FOC of accel and gyro
|
|
|
*
|
|
*
|
|
|
* @note FOC should not be used in low-power mode of sensor
|
|
* @note FOC should not be used in low-power mode of sensor
|
|
|
*
|
|
*
|
|
@@ -605,8 +866,19 @@ int8_t bmi160_start_foc(const struct bmi160_foc_conf *foc_conf,
|
|
|
struct bmi160_offsets *offset,
|
|
struct bmi160_offsets *offset,
|
|
|
struct bmi160_dev const *dev);
|
|
struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiOffsets Offsets
|
|
|
|
|
+ * @brief Set / Get offset values of accel and gyro sensors
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API reads and stores the offset values of accel and gyro
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiOffsets
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_offsets bmi160_get_offsets
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_offsets(struct bmi160_offsets *offset, const struct bmi160_dev *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API reads and stores the offset values of accel and gyro
|
|
|
*
|
|
*
|
|
|
* @param[in,out] offset : Structure instance of bmi160_offsets in which
|
|
* @param[in,out] offset : Structure instance of bmi160_offsets in which
|
|
|
* the offset values are read and stored
|
|
* the offset values are read and stored
|
|
@@ -619,7 +891,14 @@ int8_t bmi160_start_foc(const struct bmi160_foc_conf *foc_conf,
|
|
|
int8_t bmi160_get_offsets(struct bmi160_offsets *offset, const struct bmi160_dev *dev);
|
|
int8_t bmi160_get_offsets(struct bmi160_offsets *offset, const struct bmi160_dev *dev);
|
|
|
|
|
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API writes the offset values of accel and gyro to
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiOffsets
|
|
|
|
|
+ * \page bmi160_api_bmi160_set_offsets bmi160_set_offsets
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_set_offsets(const struct bmi160_foc_conf *foc_conf,
|
|
|
|
|
+ * const struct bmi160_offsets *offset,
|
|
|
|
|
+ * struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API writes the offset values of accel and gyro to
|
|
|
* the sensor but these values will be reset on POR or soft reset.
|
|
* the sensor but these values will be reset on POR or soft reset.
|
|
|
*
|
|
*
|
|
|
* @param[in] foc_conf : Structure instance of bmi160_foc_conf which
|
|
* @param[in] foc_conf : Structure instance of bmi160_foc_conf which
|
|
@@ -645,8 +924,19 @@ int8_t bmi160_set_offsets(const struct bmi160_foc_conf *foc_conf,
|
|
|
const struct bmi160_offsets *offset,
|
|
const struct bmi160_offsets *offset,
|
|
|
struct bmi160_dev const *dev);
|
|
struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiNVM NVM
|
|
|
|
|
+ * @brief Write image registers values to NVM
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API writes the image registers values to NVM which is
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiNVM
|
|
|
|
|
+ * \page bmi160_api_bmi160_update_nvm bmi160_update_nvm
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_update_nvm(struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API writes the image registers values to NVM which is
|
|
|
* stored even after POR or soft reset
|
|
* stored even after POR or soft reset
|
|
|
*
|
|
*
|
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
* @param[in] dev : Structure instance of bmi160_dev.
|
|
@@ -657,8 +947,21 @@ int8_t bmi160_set_offsets(const struct bmi160_foc_conf *foc_conf,
|
|
|
*/
|
|
*/
|
|
|
int8_t bmi160_update_nvm(struct bmi160_dev const *dev);
|
|
int8_t bmi160_update_nvm(struct bmi160_dev const *dev);
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * \ingroup bmi160
|
|
|
|
|
+ * \defgroup bmi160ApiInts Interrupt status
|
|
|
|
|
+ * @brief Read interrupt status from the sensor
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
/*!
|
|
/*!
|
|
|
- * @brief This API gets the interrupt status from the sensor.
|
|
|
|
|
|
|
+ * \ingroup bmi160ApiInts
|
|
|
|
|
+ * \page bmi160_api_bmi160_get_int_status bmi160_get_int_status
|
|
|
|
|
+ * \code
|
|
|
|
|
+ * int8_t bmi160_get_int_status(enum bmi160_int_status_sel int_status_sel,
|
|
|
|
|
+ * union bmi160_int_status *int_status,
|
|
|
|
|
+ * struct bmi160_dev const *dev);
|
|
|
|
|
+ * \endcode
|
|
|
|
|
+ * @details This API gets the interrupt status from the sensor.
|
|
|
*
|
|
*
|
|
|
* @param[in] int_status_sel : Enum variable to select either individual or all the
|
|
* @param[in] int_status_sel : Enum variable to select either individual or all the
|
|
|
* interrupt status bits.
|
|
* interrupt status bits.
|
|
@@ -680,4 +983,3 @@ int8_t bmi160_get_int_status(enum bmi160_int_status_sel int_status_sel,
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* BMI160_H_ */
|
|
#endif /* BMI160_H_ */
|
|
|
-/** @}*/
|
|
|