/* Reads a block of data from the Si1133 sensor.  */
uint32_t SI1133_registerBlockRead(uint8_t reg, uint8_t length, uint8_t *data)
/* Reads a block of data from the Si1133 sensor.  */
uint32_t SI1133_registerBlockRead(uint8_t reg, uint8_t length, uint8_t *data)
{
   I2C_TransferSeq_TypeDef seq;
   I2C_TransferReturn_TypeDef ret;
   uint8_t i2c_write_data[1];
   uint32_t retval;
   retval = SI1133_OK;
   seq.addr = SI1133_I2C_DEVICE_BUS_ADDRESS;
   seq.flags = I2C_FLAG_WRITE_READ;
   i2c_write_data[0] = reg;
   seq.buf[0].data = i2c_write_data;
   seq.buf[0].len = 1;
   seq.buf[1].data = data;
   seq.buf[1].len = length;
   ret = I2CSPM_Transfer( SI1133_I2C_DEVICE, &seq );
   if( ret != i2cTransferDone ) {
      retval = SI1133_ERROR_I2C_TRANSACTION_FAILED;
   }
   return retval;
}