/* Reads the sensor and returns the data as a sensors_event_t.  */
err_t tsl2561GetSensorEvent(sensors_event_t *event)
/* Reads the sensor and returns the data as a sensors_event_t.  */
err_t tsl2561GetSensorEvent(sensors_event_t *event)
{
  uint16_t broadband, ir;
  memset(event, 0, sizeof(sensors_event_t));
  event->version   = sizeof(sensors_event_t);
  event->sensor_id = _tsl2561SensorID;
  event->type      = SENSOR_TYPE_LIGHT;
  event->timestamp = delayGetTicks();
  ASSERT_STATUS(tsl2561GetLuminosity(&broadband, &ir));
  event->light = tsl2561CalculateLux(broadband, ir);
  return ERROR_NONE;
}