/* This API enables the offset compensation for filtered and unfiltered Accel data.  */
uint16_t bma4_set_offset_comp(uint8_t offset_en, struct bma4_dev *dev)
/* This API enables the offset compensation for filtered and unfiltered Accel data.  */
uint16_t bma4_set_offset_comp(uint8_t offset_en, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        rslt |= bma4_read_regs(BMA4_NV_CONFIG_ADDR, &data, 1, dev);
        if (rslt == BMA4_OK) {
            data = BMA4_SET_BITSLICE(data, BMA4_NV_ACCEL_OFFSET, offset_en);
            rslt |= bma4_write_regs(BMA4_NV_CONFIG_ADDR, &data, 1, dev);
        }
    }
    return rslt;
}