/* This API reads the sensor time of Sensor time gets updated with every update of data register or FIFO.  */
uint16_t bma4_get_sensor_time(uint32_t *sensor_time, struct bma4_dev *dev)
/* This API reads the sensor time of Sensor time gets updated with every update of data register or FIFO.  */
uint16_t bma4_get_sensor_time(uint32_t *sensor_time, struct bma4_dev *dev)
{
    uint16_t rslt = 0;
    uint8_t data[BMA4_SENSOR_TIME_LENGTH] = {0};
    uint8_t msb = 0;
    uint8_t xlsb = 0;
    uint8_t lsb = 0;
    if (dev == NULL) {
        rslt |= BMA4_E_NULL_PTR;
    } else {
        rslt |= bma4_read_regs(BMA4_SENSORTIME_0_ADDR, data, BMA4_SENSOR_TIME_LENGTH, dev);
        if (rslt == BMA4_OK) {
            msb = data[BMA4_SENSOR_TIME_MSB_BYTE];
            xlsb = data[BMA4_SENSOR_TIME_XLSB_BYTE];
            lsb = data[BMA4_SENSOR_TIME_LSB_BYTE];
            *sensor_time = (uint32_t)((msb << 16) | (xlsb << 8) | lsb);
        }
    }
    return rslt;
}