Atmel Software Framework

sensor_dev.h File Reference

Sensor API device definitions.

Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.

#include "sensor.h"

Macros

Sensor Device Bus Addresses

Each driver must have a bus address _bus_addr defined here, where is the same prefix used for the driver _init function.

The bus address definitions are keyed off build constants and will vary by application. If the bus does not assign particular addresses, then define the address as (0). If, as is the case with TWI/I2C, the device responds to a specific address, then define the constant bus address value.

The default values provided here may be modified or redefined by specific board and bus implementations.

#define ak8975_bus_addr   (0)
 
#define kxtf9_bus_addr   (0)
 
#define hmc5883l_bus_addr   (0)
 
#define bma020_bus_addr   (0)
 
#define bma150_bus_addr   (0)
 
#define bma180_bus_addr   (0)
 
#define bma220_bus_addr   (0)
 
#define bma222_bus_addr   (0)
 
#define bma250_bus_addr   (0)
 
#define bmp085_bus_addr   (0)
 
#define bmp180_bus_addr   (0)
 
#define imu3000_bus_addr   (0)
 
#define itg3200_bus_addr   (0)
 
#define sfh5712_bus_addr   (0)
 
#define sfh7770_bus_addr   (0)
 

Functions

Sensor Driver Initialization Entry Points
bool ak8975_init (sensor_t *, int)
 AKM AK8975 magnetometer driver initialization. More...
 
bool bma020_init (sensor_t *, int)
 Bosch BMA020 accelerometer driver initialization. More...
 
bool bma150_init (sensor_t *, int)
 Bosch BMA150 accelerometer driver initialization. More...
 
bool bma180_init (sensor_t *, int)
 Bosch BMA180 accelerometer driver initialization. More...
 
bool bma220_init (sensor_t *, int)
 Bosch BMA220 accelerometer driver initialization. More...
 
bool bma222_init (sensor_t *, int)
 Bosch BMA222 accelerometer driver initialization. More...
 
bool bma250_init (sensor_t *, int)
 Bosch BMA250 accelerometer driver initialization. More...
 
bool bmp085_init (sensor_t *, int)
 Bosch BMP085 barometric sensor driver initialization. More...
 
bool bmp180_init (sensor_t *, int)
 Bosch BMP180 barometric sensor driver initialization. More...
 
bool hmc5883l_init (sensor_t *, int)
 Honeywell HMC5883L magnetometer driver initialization. More...
 
bool imu3000_init (sensor_t *, int)
 InvenSense IMU-3000 motion processor driver initialization. More...
 
bool itg3200_init (sensor_t *, int)
 InvenSense ITG-3200 gyroscope driver initialization. More...
 
bool kxtf9_init (sensor_t *, int)
 Kionix KXTF9 accelerometer driver initialization. More...
 
bool sfh5712_init (sensor_t *, int)
 Osram SFH5712 light sensor driver initialization. More...
 
bool sfh7770_init (sensor_t *, int)
 Osram SFH7770 light & proximity sensor driver initialization. More...
 

#define ak8975_bus_addr   (0)
#define bma020_bus_addr   (0)
#define bma150_bus_addr   (0)
#define bma180_bus_addr   (0)
#define bma220_bus_addr   (0)
#define bma222_bus_addr   (0)
#define bma250_bus_addr   (0)
#define bmp085_bus_addr   (0)
#define bmp180_bus_addr   (0)
#define hmc5883l_bus_addr   (0)
#define imu3000_bus_addr   (0)
#define itg3200_bus_addr   (0)
#define kxtf9_bus_addr   (0)
#define sfh5712_bus_addr   (0)
#define sfh7770_bus_addr   (0)

bool ak8975_init ( sensor_t sensor,
int  resvd 
)

AKM AK8975 magnetometer driver initialization.

This is the main initialization function for the AK8975 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.

References ak8975_calibrate(), AK8975_DATA_RESOLUTION, ak8975_ioctl(), ak8975_read(), AK8975_REG_WIA, ak8975_selftest(), AK8975_WIA_VALUE, sensor_device_t::func, nvram_read(), sensor_funcs_t::read, sensor_hal::resolution, sensor_bus_get, SENSOR_CAPS_3_AXIS, SENSOR_CAPS_SELFTEST, SENSOR_SCALE_micro, SENSOR_UNITS_tesla, SENSOR_VENDOR_AKM, vector3_t::x, vector3_t::y, and vector3_t::z.

bool bma020_init ( sensor_t sensor,
int  resvd 
)

Bosch BMA020 accelerometer driver initialization.

This is the main initialization function for the BMA020 device. The accelerometer range and bandwidth are set based on user-specified values from the system configuration.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool bma150_init ( sensor_t sensor,
int  resvd 
)

Bosch BMA150 accelerometer driver initialization.

This is the main initialization function for the BMA150 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool bma180_init ( sensor_t sensor,
int  resvd 
)

Bosch BMA180 accelerometer driver initialization.

This is the main initialization function for the BMA180 device. The accelerometer range and bandwidth are set based on user-specified values from the system configuration.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool bma220_init ( sensor_t sensor,
int  resvd 
)

Bosch BMA220 accelerometer driver initialization.

This is the main initialization function for the BMA220 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool bma222_init ( sensor_t sensor,
int  resvd 
)

Bosch BMA222 accelerometer driver initialization.

This is the main initialization function for the BMA222 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool bma250_init ( sensor_t sensor,
int  resvd 
)

Bosch BMA250 accelerometer driver initialization.

This is the main initialization function for the BMA250 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool bmp085_init ( sensor_t sensor,
int  resvd 
)

Bosch BMP085 barometric sensor driver initialization.

This is the main initialization function for the BMP085 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the sensor is ready for use, else false.
bool bmp180_init ( sensor_t sensor,
int  resvd 
)

Bosch BMP180 barometric sensor driver initialization.

This is the main initialization function for the BMP180 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the sensor is ready for use, else false.
bool hmc5883l_init ( sensor_t sensor,
int  resvd 
)

Honeywell HMC5883L magnetometer driver initialization.

This is the main initialization function for the HMC5883L device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool imu3000_init ( sensor_t sensor,
int  resvd 
)

InvenSense IMU-3000 motion processor driver initialization.

This is the main initialization function for the IMU-3000 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the sensor is ready for use, else false.
bool itg3200_init ( sensor_t sensor,
int  resvd 
)

InvenSense ITG-3200 gyroscope driver initialization.

This is the main initialization function for the ITG-3200 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the sensor is ready for use, else false.
bool kxtf9_init ( sensor_t sensor,
int  resvd 
)

Kionix KXTF9 accelerometer driver initialization.

This is the main initialization function for the KXTF9 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool sfh5712_init ( sensor_t sensor,
int  resvd 
)

Osram SFH5712 light sensor driver initialization.

This is the main initialization function for the SFH5712 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.
bool sfh7770_init ( sensor_t sensor,
int  resvd 
)

Osram SFH7770 light & proximity sensor driver initialization.

This is the main initialization function for the SFH7770 device.

Parameters
sensorAddress of a sensor device descriptor.
resvdReserved value.
Returns
bool true if the call succeeds, else false is returned.