/* This API writes the 8-bit data to the given register in the sensor.  */
static uint16_t write_regs(uint8_t addr, uint8_t *data, uint8_t len, const struct bma4_dev *dev)
/* This API writes the 8-bit data to the given register in the sensor.  */
static uint16_t write_regs(uint8_t addr, uint8_t *data, uint8_t len, const struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        if (dev->interface == BMA4_SPI_INTERFACE)
            addr = addr & BMA4_SPI_WR_MASK;
        rslt |= dev->bus_write(dev->dev_addr, addr, data, len);
    }
    return rslt;
}