/* Read sensor data. 
This routine calls the appropriate internal data function to obtain the specified type of data from the sensor device. */
static bool kxtf9_read(sensor_t *sensor, sensor_read_t type, sensor_data_t *data)
/* Read sensor data. 
This routine calls the appropriate internal data function to obtain the specified type of data from the sensor device. */
static bool kxtf9_read(sensor_t *sensor, sensor_read_t type, sensor_data_t *data)
{
	sensor_hal_t *const hal = sensor->hal;
	switch (type) {
	case SENSOR_READ_ACCELERATION:
		return kxtf9_get_accel(hal, data);
	case SENSOR_READ_ID:
		return kxtf9_device_id(hal, data);
	default:
		sensor->err = SENSOR_ERR_FUNCTION;
		return false;
	}
}