KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
Driver for the ST lsm303Agr Compass sensor, which unlike the name suggests quite incompable to the LSM303D.... More...
Go to the source code of this file.
Data Structures | |
struct | Lsm303AgrMagCfg_ |
Magnet configuration. More... | |
struct | Lsm303AgrAccCfg_ |
Accelerator configuration structure. More... | |
Macros | |
#define | LSM303AGR_ACC_PM_LOW_8BIT 0x1 |
#define | LSM303AGR_ACC_PM_NORM_10BIT 0x0 |
#define | LSM303AGR_ACC_PM_HIGH_12BIT 0x2 |
#define | LSM303AGR_ACC_RATE_POWERDOWN 0x00 |
#define | LSM303AGR_ACC_RATE_1HZ 0x01 |
#define | LSM303AGR_ACC_RATE_10HZ 0x02 |
#define | LSM303AGR_ACC_RATE_25HZ 0x03 |
#define | LSM303AGR_ACC_RATE_50HZ 0x04 |
#define | LSM303AGR_ACC_RATE_100HZ 0x05 |
#define | LSM303AGR_ACC_RATE_200HZ 0x06 |
#define | LSM303AGR_ACC_RATE_400HZ 0x07 |
#define | LSM303AGR_ACC_RATE_LP_1620HZ 0x08 |
#define | LSM303AGR_ACC_RATE_1344_LP5376HZ 0x09 |
#define | LSM303AGR_ACC_FS_2G 0x00 |
#define | LSM303AGR_ACC_FS_4G 0x01 |
#define | LSM303AGR_ACC_FS_8G 0x02 |
#define | LSM303AGR_ACC_FS_16G 0x03 |
#define | LSM303AGR_MAG_RATE_10HZ 0x00 |
#define | LSM303AGR_MAG_RATE_20HZ 0x01 |
#define | LSM303AGR_MAG_RATE_50HZ 0x02 |
#define | LSM303AGR_MAG_RATE_100HZ 0x03 |
#define | LSM303AGR_MAG_MODE_CONTINUOUS 0x00 |
#define | LSM303AGR_MAG_MODE_SINGLE 0x01 |
#define | LSM303AGR_MAG_MODE_IDLE 0x02 |
#define | LSM303AGR_ACC_HPCF_AGRESSIVE 0x0 |
Highpass filter. | |
#define | LSM303AGR_ACC_HPCF_STRONG 0x1 |
#define | LSM303AGR_ACC_HPCF_MEDIUM 0x2 |
#define | LSM303AGR_ACC_HPCF_LIGHT 0x3 |
#define | LSM303AGR_MAG_CFG_DEFAULT |
DEfault magnet configuration. More... | |
#define | LSM303AGR_ACC_CFG_DEFAULT |
Default accelerometer configuration. More... | |
Typedefs | |
typedef struct Lsm303AgrMagCfg_ | Lsm303AgrMagCfg |
Magnet configuration. | |
typedef struct Lsm303AgrAccCfg_ | Lsm303AgrAccCfg |
Accelerator configuration structure. | |
Functions | |
bool | lsm303AgrMagRead (I2C_Device *dev, Lsm303Axis *result) |
Read the magnet information. More... | |
bool | lsm303AgrMagCfg (I2C_Device *dev, Lsm303AgrMagCfg config) |
Set the Magnet configuration. More... | |
bool | lsm303AgrTempRead (I2C_Device *dev, int16_t *result) |
Reads the temperature. More... | |
bool | lsm303AgrHasTemp (I2C_Device *dev, bool *hasData) |
bool | lsm303AgrAccRead (I2C_Device *dev, Lsm303Axis *result) |
Read the accelerometer information. More... | |
bool | lsm303AgrAccCfg (I2C_Device *dev, Lsm303AgrAccCfg config) |
Set the accelerometer configuration. More... | |
bool | lsm303AgrValid (I2C_Device *dev, bool *isLSM303Agr) |
Checks whether or not the lsm303Agr is valid. More... | |
Driver for the ST lsm303Agr Compass sensor, which unlike the name suggests quite incompable to the LSM303D....
IRQ / Fifo modes not supported.
Definition in file lsm303agr.h.
#define LSM303AGR_ACC_CFG_DEFAULT |
Default accelerometer configuration.
Definition at line 127 of file lsm303agr.h.
#define LSM303AGR_MAG_CFG_DEFAULT |
DEfault magnet configuration.
Definition at line 101 of file lsm303agr.h.
bool lsm303AgrAccCfg | ( | I2C_Device * | dev, |
Lsm303AgrAccCfg | config | ||
) |
Set the accelerometer configuration.
dev | I2C WB device |
config | The configuration structure. |
true | Procedure was a success. |
false | Procedure failed |
Definition at line 223 of file lsm303agr.c.
bool lsm303AgrAccRead | ( | I2C_Device * | dev, |
Lsm303Axis * | result | ||
) |
Read the accelerometer information.
dev | I2C WB device |
addr | I2C address |
result | The 3D accelerometer information |
true | Procedure was a success. |
false | Procedure failed |
Definition at line 188 of file lsm303agr.c.
bool lsm303AgrMagCfg | ( | I2C_Device * | dev, |
Lsm303AgrMagCfg | config | ||
) |
Set the Magnet configuration.
dev | I2C WB device |
config | The configuration structure. |
true | Procedure was a success. |
false | Procedure failed |
Definition at line 200 of file lsm303agr.c.
bool lsm303AgrMagRead | ( | I2C_Device * | dev, |
Lsm303Axis * | result | ||
) |
Read the magnet information.
dev | I2C WB device |
result | The 3D magnet information |
true | Procedure was a success. |
false | Procedure failed |
Definition at line 176 of file lsm303agr.c.
bool lsm303AgrTempRead | ( | I2C_Device * | dev, |
int16_t * | result | ||
) |
Reads the temperature.
dev | I2C WB device |
result | The temperature. |
true | Procedure was a success. |
false | Procedure failed |
Definition at line 146 of file lsm303agr.c.
bool lsm303AgrValid | ( | I2C_Device * | dev, |
bool * | isLSM303Agr | ||
) |
Checks whether or not the lsm303Agr is valid.
dev | I2C WB device |
isLSM303Agr | Pointer to boolean to be filled with true or false. true indicates the lsm303Agr was found and is valid. false indicates a device was found, but not an lsm303Agr |
true | Procedure was a success. |
false | Procedure failed |
Definition at line 163 of file lsm303agr.c.