/* regAdress: Address that has to be read length: Length of data block buffer: Buffer where data will be stored returns: number of bytes that have been read successfully NOTE! This is not always equal to length due to rx-Buffer overflow etc.  */
int16_t readBlock(uint8_t regAddress, uint8_t length, uint8_t *buffer)
/* regAdress: Address that has to be read length: Length of data block buffer: Buffer where data will be stored returns: number of bytes that have been read successfully NOTE! This is not always equal to length due to rx-Buffer overflow etc.  */
int16_t readBlock(uint8_t regAddress, uint8_t length, uint8_t *buffer)
{
    int ret;
    if (buffer == NULL) {
        return 0;
    }
    ret = sensor_i2c_read(&(dps310_ctx.i2c), regAddress, buffer, length,
                          I2C_OP_RETRIES);
    if (ret != 0) {
        return 0;
    }
    return length;
}