/* This API reads the Output data rate, Bandwidth, perf_mode and Range of accel.  */
uint16_t bma4_get_accel_config(struct bma4_accel_config *accel, struct bma4_dev *dev)
/* This API reads the Output data rate, Bandwidth, perf_mode and Range of accel.  */
uint16_t bma4_get_accel_config(struct bma4_accel_config *accel, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data[2] = {0};
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        rslt |= bma4_read_regs(BMA4_ACCEL_CONFIG_ADDR, data, BMA4_ACCEL_CONFIG_LENGTH, dev);
        if (rslt == BMA4_OK) {
            accel->odr =  BMA4_GET_BITS_POS_0(data[0], BMA4_ACCEL_ODR);
            accel->bandwidth = BMA4_GET_BITSLICE(data[0], BMA4_ACCEL_BW);
            accel->perf_mode = BMA4_GET_BITSLICE(data[0], BMA4_ACCEL_PERFMODE);
            accel->range = BMA4_GET_BITS_POS_0(data[1], BMA4_ACCEL_RANGE);
        }
    }
    return rslt;
}