#define DEVICE_AVAIL_FREQ_PATH BASE_PATH "sampling_frequency_available"
#define ILLUMINATION_CALIBPATH BASE_PATH "in_illuminance_calibscale"
#define SENSOR_CALIB_BIAS_PATH BASE_PATH "in_%s_calibbias"
+#define MOUNTING_MATRIX_PATH BASE_PATH "mounting_matrix"
+
+#define CONFIGFS_TRIGGER_PATH "/config/iio/triggers/"
#define PROP_BASE "ro.iio.%s.%s" /* Note: PROPERTY_KEY_MAX is small */
#define MODE_TRIGGER 2
#define MODE_EVENT 3
+
typedef struct
{
const char *type; /* event type; e.g: transition */
typedef struct
{
const char *tag; /* Prefix such as "accel", "gyro", "temp"... */
+ const char *shorthand;
const int type; /* Sensor type ; ex: SENSOR_TYPE_ACCELEROMETER */
const int num_channels; /* Expected iio channels for this sensor */
const int is_virtual; /* Is the sensor virtual or not */
char vendor_name[MAX_NAME_SIZE]; /* ex: Intel */
char init_trigger_name[MAX_NAME_SIZE]; /* ex: accel-name-dev1 */
char motion_trigger_name[MAX_NAME_SIZE];/* ex: accel-any-motion-dev1 */
+ char hrtimer_trigger_name[MAX_NAME_SIZE]; /*ex: accel-hr-dev1 */
float max_range;
float resolution;
float power;
* more than one at a later time.
*/
sensors_event_t sample;
+ uint64_t event_id;
/*
* If the QUIRK_FIELD_ORDERING bit is set in quirks, the contents of this array are used in the finalization stage to swap sample fields
unsigned char order[MAX_CHANNELS];
/*
+ * If the QUIRK_MOUNTING_MATRIX bit is set in quirks, the contents of this matrix is used to correct the sample values so that it takes
+ * into account the way the sensor has been mounted on the PCB.
+ */
+ float mounting_matrix[9];
+
+ /*
* Event counter - will be used to check if we have a significant sample for noisy sensors. We want to make sure we do not send any wrong
* events before filtering kicks in. We can also use it for statistics.
*/
*/
int needs_enable;
- int semi_arbitrated_rate; /* Arbitrated sampling rate before we considered other sensors co-located on the same iio device */
+ float semi_arbitrated_rate; /* Arbitrated sampling rate before we considered other sensors co-located on the same iio device */
}
sensor_info_t;