/* This API sets the interrupt mode in the sensor.  */
uint16_t bma4_set_interrupt_mode(uint8_t mode, struct bma4_dev *dev)
/* This API sets the interrupt mode in the sensor.  */
uint16_t bma4_set_interrupt_mode(uint8_t mode, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        if (mode == BMA4_NON_LATCH_MODE || mode == BMA4_LATCH_MODE)
            rslt |= bma4_write_regs(BMA4_INTR_LATCH_ADDR, &mode, 1, dev);
        else
            rslt |= BMA4_E_OUT_OF_RANGE;
    }
    return rslt;
}