Overview

Interfaces to a variety of common sensor classes.

The types and functions in <ctl_sensors.h> provide a high-level set of services for a variety of common sensor classes such as motion sensors, environmental sensors, and so on.

Each sensor class is abstracted to the essential set of features that all sensors of that class provide:

The appropriate interface is initialized by calling the device-specific initialization code, for a particular sensor, in the sensor library. For instance, to initialize an accelerometer interface that uses an ADXL345 acceleration sensor, you would call adxl345_initialize_i2c. Once initialized, you can use the accelerometer-related functions in your own code.

API Summary

Accelerometer
CTL_ACCELEROMETER_t An abstract accelerometer
ctl_accelerometer_measure Sample accelerometer axes
ctl_accelerometer_set_bandwidth Set accelerometer bandwidth
ctl_accelerometer_set_range Set accelerometer range
Gyroscope
CTL_GYROSCOPE_t An abstract gyroscope
ctl_gyroscope_measure Sample gyroscope axes
ctl_gyroscope_set_bandwidth Set gyroscope bandwidth
ctl_gyroscope_set_range Set gyroscope range
Magnetometer
CTL_MAGNETOMETER_t An abstract magnetometer
ctl_magnetometer_measure Sample magnetometer axes
ctl_magnetometer_set_bandwidth Set magnetometer bandwidth
IMU
CTL_IMU_t An abstract IMU sensor collection
Temperature
CTL_TEMPERATURE_SENSOR_t An abstract temperature sensor
ctl_temperature_sensor_measure Sample temperature sensor
ctl_temperature_sensor_set_resolution Set temperature sensor resolution
Pressure Light
Humidity
CTL_HUMIDITY_SENSOR_t An abstract humidity sensor
ctl_humidity_sensor_measure Sample relative humidity
Utility
CTL_AXIS_TRANSFORMATION Single axis transformation
ctl_forward_transform_axes Apply axis transformation
ctl_generate_axis_transform Generate an axis transform from components
Pressure
CTL_PRESSURE_SENSOR_t An abstract pressure sensor
ctl_pressure_sensor_measure Sample barometric pressure
Light
CTL_LIGHT_SENSOR_t An abstract light sensor
ctl_light_sensor_measure Sample ambient light level