/* Private function to read luminosity on both channels.  */
err_t tsl2561GetData(uint16_t *broadband, uint16_t *ir)
/* Private function to read luminosity on both channels.  */
err_t tsl2561GetData(uint16_t *broadband, uint16_t *ir)
{
  ASSERT_STATUS(tsl2561Enable());
  switch (_tsl2561IntegrationTime)
  {
    case TSL2561_INTEGRATIONTIME_13MS:
      delay(14);
      break;
    case TSL2561_INTEGRATIONTIME_101MS:
      delay(102);
      break;
    default:
      delay(403);
      break;
  }
  ASSERT_STATUS(tsl2561Read16(TSL2561_COMMAND_BIT | TSL2561_WORD_BIT | TSL2561_REGISTER_CHAN0_LOW, broadband));
  ASSERT_STATUS(tsl2561Read16(TSL2561_COMMAND_BIT | TSL2561_WORD_BIT | TSL2561_REGISTER_CHAN1_LOW, ir));
  ASSERT_STATUS(tsl2561Disable());
  return ERROR_NONE;
}