/* This API sets the auxiliary interface configuration in the sensor.  */
uint16_t bma4_set_if_mode(uint8_t if_mode, struct bma4_dev *dev)
/* This API sets the auxiliary interface configuration in the sensor.  */
uint16_t bma4_set_if_mode(uint8_t if_mode, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        if (if_mode <= BMA4_MAX_IF_MODE) {
            rslt |= bma4_read_regs(BMA4_IF_CONFIG_ADDR, &data, 1, dev);
            if (rslt == BMA4_OK) {
                data = BMA4_SET_BITSLICE(data, BMA4_IF_CONFIG_IF_MODE, if_mode);
                rslt |= bma4_write_regs(BMA4_IF_CONFIG_ADDR, &data, 1, dev);
            }
        } else {
            rslt |= BMA4_E_OUT_OF_RANGE;
        }
    }
    return rslt;
}