/* Read SFH7770 light level data. 
This function reads the ambient light level data from the sensor and places it in the user-provided sensor_data_t structure. */
static bool sfh7770_get_light(sensor_hal_t *hal, sensor_data_t *data)
/* Read SFH7770 light level data. 
This function reads the ambient light level data from the sensor and places it in the user-provided sensor_data_t structure. */
static bool sfh7770_get_light(sensor_hal_t *hal, sensor_data_t *data)
{
	struct {
		uint8_t lsb;
		uint8_t msb;
	}
	light_data;
	size_t const count = sensor_bus_read(hal, SFH7770_ALS_DATA_LSB,
			(uint8_t *)&light_data, sizeof(light_data));
	data->light.value = (uint32_t)((light_data.msb << 8) | light_data.lsb);
	return (count == sizeof(light_data));
}