ChibiOS
21.6.0
|
Macros | |
#define | lsm303dlhcAccelerometerGetAxesNumber(devp) accelerometerGetAxesNumber(&((devp)->acc_if)) |
Return the number of axes of the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerReadRaw(devp, axes) accelerometerReadRaw(&((devp)->acc_if), axes) |
Retrieves raw data from the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerReadCooked(devp, axes) accelerometerReadCooked(&((devp)->acc_if), axes) |
Retrieves cooked data from the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerSetBias(devp, bp) accelerometerSetBias(&((devp)->acc_if), bp) |
Set bias values for the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerResetBias(devp) accelerometerResetBias(&((devp)->acc_if)) |
Reset bias values for the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerSetSensitivity(devp, sp) accelerometerSetSensitivity(&((devp)->acc_if), sp) |
Set sensitivity values for the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerResetSensitivity(devp) accelerometerResetSensitivity(&((devp)->acc_if)) |
Reset sensitivity values for the BaseAccelerometer. More... | |
#define | lsm303dlhcAccelerometerSetFullScale(devp, fs) (devp)->vmt->acc_set_full_scale(devp, fs) |
Changes the LSM303DLHCDriver accelerometer fullscale value. More... | |
#define | lsm303dlhcCompassGetAxesNumber(devp) compassGetAxesNumber(&((devp)->comp_if)) |
Return the number of axes of the BaseCompass. More... | |
#define | lsm303dlhcCompassReadRaw(devp, axes) compassReadRaw(&((devp)->comp_if), axes) |
Retrieves raw data from the BaseCompass. More... | |
#define | lsm303dlhcCompassReadCooked(devp, axes) compassReadCooked(&((devp)->comp_if), axes) |
Retrieves cooked data from the BaseCompass. More... | |
#define | lsm303dlhcCompassSetBias(devp, bp) compassSetBias(&((devp)->comp_if), bp) |
Set bias values for the BaseCompass. More... | |
#define | lsm303dlhcCompassResetBias(devp) compassResetBias(&((devp)->comp_if)) |
Reset bias values for the BaseCompass. More... | |
#define | lsm303dlhcCompassSetSensitivity(devp, sp) compassSetSensitivity(&((devp)->comp_if), sp) |
Set sensitivity values for the BaseCompass. More... | |
#define | lsm303dlhcCompassResetSensitivity(devp) compassResetSensitivity(&((devp)->comp_if)) |
Reset sensitivity values for the BaseCompass. More... | |
#define | lsm303dlhcCompassSetFullScale(devp, fs) (devp)->vmt->comp_set_full_scale(devp, fs) |
Changes the LSM303DLHCDriver compass fullscale value. More... | |
Version identification | |
#define | EX_LSM303DLHC_VERSION "1.1.2" |
LSM303DLHC driver version string. More... | |
#define | EX_LSM303DLHC_MAJOR 1 |
LSM303DLHC driver version major number. More... | |
#define | EX_LSM303DLHC_MINOR 1 |
LSM303DLHC driver version minor number. More... | |
#define | EX_LSM303DLHC_PATCH 2 |
LSM303DLHC driver version patch number. More... | |
#define | LSM303DLHC_ACC_NUMBER_OF_AXES 3U |
LSM303DLHC accelerometer subsystem characteristics. More... | |
#define | LSM303DLHC_COMP_NUMBER_OF_AXES 3U |
LSM303DLHC compass subsystem characteristics. More... | |
Configuration options | |
#define | LSM303DLHC_USE_SPI FALSE |
LSM303DLHC SPI interface switch. More... | |
#define | LSM303DLHC_SHARED_SPI FALSE |
LSM303DLHC shared SPI switch. More... | |
#define | LSM303DLHC_USE_I2C TRUE |
LSM303DLHC I2C interface switch. More... | |
#define | LSM303DLHC_SHARED_I2C FALSE |
LSM303DLHC shared I2C switch. More... | |
#define | LSM303DLHC_USE_ADVANCED FALSE |
LSM303DLHC advanced configurations switch. More... | |
LSM303DLHC compass subsystem data structures and types. | |
enum | lsm303dlhc_comp_fs_t { LSM303DLHC_COMP_FS_1P3GA = 0x20, LSM303DLHC_COMP_FS_1P9GA = 0x40, LSM303DLHC_COMP_FS_2P5GA = 0x60, LSM303DLHC_COMP_FS_4P0GA = 0x80, LSM303DLHC_COMP_FS_4P7GA = 0xA0, LSM303DLHC_COMP_FS_5P6GA = 0xC0, LSM303DLHC_COMP_FS_8P1GA = 0xE0 } |
LSM303DLHC compass subsystem full scale. More... | |
enum | lsm303dlhc_comp_odr_t { LSM303DLHC_COMP_ODR_0P75HZ = 0x00, LSM303DLHC_COMP_ODR_1P5HZ = 0x04, LSM303DLHC_COMP_ODR_3P0HZ = 0x08, LSM303DLHC_COMP_ODR_7P5HZ = 0x0C, LSM303DLHC_COMP_ODR_15HZ = 0x10, LSM303DLHC_COMP_ODR_30HZ = 0x14, LSM303DLHC_COMP_ODR_75HZ = 0x18, LSM303DLHC_COMP_ODR_220HZ = 0x1C } |
LSM303DLHC compass subsystem output data rate. More... | |
enum | lsm303dlhc_comp_md_t { LSM303DLHC_COMP_MD_CONT = 0x00, LSM303DLHC_COMP_MD_BLOCK = 0x01, LSM303DLHC_COMP_MD_SLEEP = 0x02 } |
LSM303DLHC compass subsystem working mode. More... | |
LSM303DLHC main system data structures and types. | |
enum | lsm303dlhc_state_t { LSM303DLHC_UNINIT = 0, LSM303DLHC_STOP = 1, LSM303DLHC_READY = 2 } |
Driver state machine possible states. More... | |
#define | _lsm303dlhc_methods_alone |
LSM303DLHC specific methods. More... | |
#define | _lsm303dlhc_methods |
LSM303DLHC specific methods with inherited ones. More... | |
#define | _lsm303dlhc_data |
LSM303DLHCDriver specific data. More... | |
Data Structures | |
struct | LSM303DLHCConfig |
LSM303DLHC configuration structure. More... | |
struct | LSM303DLHCVMT |
LSM303DLHC virtual methods table. More... | |
struct | LSM303DLHCDriver |
LSM303DLHC 6-axis accelerometer/compass class. More... | |
Functions | |
static msg_t | lsm303dlhcI2CReadRegister (I2CDriver *i2cp, lsm303dlhc_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n) |
Reads registers value using I2C. More... | |
static msg_t | lsm303dlhcI2CWriteRegister (I2CDriver *i2cp, lsm303dlhc_sad_t sad, uint8_t *txbuf, size_t n) |
Writes a value into a register using I2C. More... | |
static size_t | acc_get_axes_number (void *ip) |
Return the number of axes of the BaseAccelerometer. More... | |
static msg_t | acc_read_raw (void *ip, int32_t axes[]) |
Retrieves raw data from the BaseAccelerometer. More... | |
static msg_t | acc_read_cooked (void *ip, float axes[]) |
Retrieves cooked data from the BaseAccelerometer. More... | |
static msg_t | acc_set_bias (void *ip, float *bp) |
Set bias values for the BaseAccelerometer. More... | |
static msg_t | acc_reset_bias (void *ip) |
Reset bias values for the BaseAccelerometer. More... | |
static msg_t | acc_set_sensivity (void *ip, float *sp) |
Set sensitivity values for the BaseAccelerometer. More... | |
static msg_t | acc_reset_sensivity (void *ip) |
Reset sensitivity values for the BaseAccelerometer. More... | |
static msg_t | acc_set_full_scale (LSM303DLHCDriver *devp, lsm303dlhc_acc_fs_t fs) |
Changes the LSM303DLHCDriver accelerometer fullscale value. More... | |
static size_t | comp_get_axes_number (void *ip) |
Return the number of axes of the BaseCompass. More... | |
static msg_t | comp_read_raw (void *ip, int32_t axes[]) |
Retrieves raw data from the BaseCompass. More... | |
static msg_t | comp_read_cooked (void *ip, float axes[]) |
Retrieves cooked data from the BaseCompass. More... | |
static msg_t | comp_set_bias (void *ip, float *bp) |
Set bias values for the BaseCompass. More... | |
static msg_t | comp_reset_bias (void *ip) |
Reset bias values for the BaseCompass. More... | |
static msg_t | comp_set_sensivity (void *ip, float *sp) |
Set sensitivity values for the BaseCompass. More... | |
static msg_t | comp_reset_sensivity (void *ip) |
Reset sensitivity values for the BaseCompass. More... | |
static msg_t | comp_set_full_scale (LSM303DLHCDriver *devp, lsm303dlhc_comp_fs_t fs) |
Changes the LSM303DLHCDriver compass fullscale value. More... | |
void | lsm303dlhcObjectInit (LSM303DLHCDriver *devp) |
Initializes an instance. More... | |
void | lsm303dlhcStart (LSM303DLHCDriver *devp, const LSM303DLHCConfig *config) |
Configures and activates LSM303DLHC Complex Driver peripheral. More... | |
void | lsm303dlhcStop (LSM303DLHCDriver *devp) |
Deactivates the LSM303DLHC Complex Driver peripheral. More... | |
Enumerations | |
enum | lsm303dlhc_sad_t { LSM303DLHC_SAD_ACC = 0x19, LSM303DLHC_SAD_COMP = 0x1E } |
Accelerometer and Compass Slave Address. More... | |
#define EX_LSM303DLHC_VERSION "1.1.2" |
LSM303DLHC driver version string.
Definition at line 46 of file lsm303dlhc.h.
#define EX_LSM303DLHC_MAJOR 1 |
LSM303DLHC driver version major number.
Definition at line 51 of file lsm303dlhc.h.
#define EX_LSM303DLHC_MINOR 1 |
LSM303DLHC driver version minor number.
Definition at line 56 of file lsm303dlhc.h.
#define EX_LSM303DLHC_PATCH 2 |
LSM303DLHC driver version patch number.
Definition at line 61 of file lsm303dlhc.h.
#define LSM303DLHC_ACC_NUMBER_OF_AXES 3U |
LSM303DLHC accelerometer subsystem characteristics.
Definition at line 72 of file lsm303dlhc.h.
#define LSM303DLHC_COMP_NUMBER_OF_AXES 3U |
LSM303DLHC compass subsystem characteristics.
Definition at line 94 of file lsm303dlhc.h.
#define LSM303DLHC_USE_SPI FALSE |
LSM303DLHC SPI interface switch.
If set to TRUE
the support for SPI is included.
FALSE
. Definition at line 314 of file lsm303dlhc.h.
#define LSM303DLHC_SHARED_SPI FALSE |
LSM303DLHC shared SPI switch.
If set to TRUE
the device acquires SPI bus ownership on each transaction.
FALSE
. Requires SPI_USE_MUTUAL_EXCLUSION. Definition at line 324 of file lsm303dlhc.h.
#define LSM303DLHC_USE_I2C TRUE |
LSM303DLHC I2C interface switch.
If set to TRUE
the support for I2C is included.
TRUE
. Definition at line 333 of file lsm303dlhc.h.
#define LSM303DLHC_SHARED_I2C FALSE |
LSM303DLHC shared I2C switch.
If set to TRUE
the device acquires I2C bus ownership on each transaction.
FALSE
. Requires I2C_USE_MUTUAL_EXCLUSION. Definition at line 343 of file lsm303dlhc.h.
#define LSM303DLHC_USE_ADVANCED FALSE |
LSM303DLHC advanced configurations switch.
If set to TRUE
more configurations are available.
FALSE
. Definition at line 352 of file lsm303dlhc.h.
#define _lsm303dlhc_methods_alone |
LSM303DLHC
specific methods.
Definition at line 600 of file lsm303dlhc.h.
#define _lsm303dlhc_methods |
LSM303DLHC
specific methods with inherited ones.
Definition at line 611 of file lsm303dlhc.h.
#define _lsm303dlhc_data |
LSM303DLHCDriver
specific data.
Definition at line 627 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerGetAxesNumber | ( | devp | ) | accelerometerGetAxesNumber(&((devp)->acc_if)) |
Return the number of axes of the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
Definition at line 677 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerReadRaw | ( | devp, | |
axes | |||
) | accelerometerReadRaw(&((devp)->acc_if), axes) |
Retrieves raw data from the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 698 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerReadCooked | ( | devp, | |
axes | |||
) | accelerometerReadCooked(&((devp)->acc_if), axes) |
Retrieves cooked data from the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 720 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerSetBias | ( | devp, | |
bp | |||
) | accelerometerSetBias(&((devp)->acc_if), bp) |
Set bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 737 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerResetBias | ( | devp | ) | accelerometerResetBias(&((devp)->acc_if)) |
Reset bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
Definition at line 752 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerSetSensitivity | ( | devp, | |
sp | |||
) | accelerometerSetSensitivity(&((devp)->acc_if), sp) |
Set sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 769 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerResetSensitivity | ( | devp | ) | accelerometerResetSensitivity(&((devp)->acc_if)) |
Reset sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 784 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerSetFullScale | ( | devp, | |
fs | |||
) | (devp)->vmt->acc_set_full_scale(devp, fs) |
Changes the LSM303DLHCDriver accelerometer fullscale value.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 802 of file lsm303dlhc.h.
#define lsm303dlhcCompassGetAxesNumber | ( | devp | ) | compassGetAxesNumber(&((devp)->comp_if)) |
Return the number of axes of the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
Definition at line 814 of file lsm303dlhc.h.
#define lsm303dlhcCompassReadRaw | ( | devp, | |
axes | |||
) | compassReadRaw(&((devp)->comp_if), axes) |
Retrieves raw data from the BaseCompass.
[in] | devp | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 835 of file lsm303dlhc.h.
#define lsm303dlhcCompassReadCooked | ( | devp, | |
axes | |||
) | compassReadCooked(&((devp)->comp_if), axes) |
Retrieves cooked data from the BaseCompass.
[in] | devp | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 857 of file lsm303dlhc.h.
#define lsm303dlhcCompassSetBias | ( | devp, | |
bp | |||
) | compassSetBias(&((devp)->comp_if), bp) |
Set bias values for the BaseCompass.
[in] | devp | pointer to BaseCompass interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 874 of file lsm303dlhc.h.
#define lsm303dlhcCompassResetBias | ( | devp | ) | compassResetBias(&((devp)->comp_if)) |
Reset bias values for the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
Definition at line 889 of file lsm303dlhc.h.
#define lsm303dlhcCompassSetSensitivity | ( | devp, | |
sp | |||
) | compassSetSensitivity(&((devp)->comp_if), sp) |
Set sensitivity values for the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 906 of file lsm303dlhc.h.
#define lsm303dlhcCompassResetSensitivity | ( | devp | ) | compassResetSensitivity(&((devp)->comp_if)) |
Reset sensitivity values for the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 921 of file lsm303dlhc.h.
#define lsm303dlhcCompassSetFullScale | ( | devp, | |
fs | |||
) | (devp)->vmt->comp_set_full_scale(devp, fs) |
Changes the LSM303DLHCDriver compass fullscale value.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 939 of file lsm303dlhc.h.
typedef struct LSM303DLHCDriver LSM303DLHCDriver |
Structure representing a LSM303DLHC driver.
Definition at line 398 of file lsm303dlhc.h.
enum lsm303dlhc_sad_t |
Accelerometer and Compass Slave Address.
Enumerator | |
---|---|
LSM303DLHC_SAD_ACC | SAD for accelerometer. |
LSM303DLHC_SAD_COMP | SAD for compass. |
Definition at line 48 of file lsm303dlhc.c.
enum lsm303dlhc_acc_fs_t |
LSM303DLHC accelerometer subsystem full scale.
Enumerator | |
---|---|
LSM303DLHC_ACC_FS_2G | Full scale �2g. |
LSM303DLHC_ACC_FS_4G | Full scale �4g. |
LSM303DLHC_ACC_FS_8G | Full scale �8g. |
LSM303DLHC_ACC_FS_16G | Full scale �16g. |
Definition at line 403 of file lsm303dlhc.h.
enum lsm303dlhc_acc_odr_t |
LSM303DLHC accelerometer subsystem output data rate.
Definition at line 413 of file lsm303dlhc.h.
enum lsm303dlhc_acc_ae_t |
LSM303DLHC accelerometer subsystem axes enabling.
Definition at line 429 of file lsm303dlhc.h.
enum lsm303dlhc_acc_lp_t |
LSM303DLHC accelerometer subsystem low power mode.
Enumerator | |
---|---|
LSM303DLHC_ACC_LP_DISABLED | Low power mode disabled. |
LSM303DLHC_ACC_LP_ENABLED | Low power mode enabled. |
Definition at line 443 of file lsm303dlhc.h.
enum lsm303dlhc_acc_hr_t |
LSM303DLHC accelerometer subsystem high resolution mode.
Enumerator | |
---|---|
LSM303DLHC_ACC_HR_DISABLED | High resolution mode disabled. |
LSM303DLHC_ACC_HR_ENABLED | High resolution mode enabled. |
Definition at line 451 of file lsm303dlhc.h.
enum lsm303dlhc_acc_bdu_t |
LSM303DLHC accelerometer subsystem block data update.
Enumerator | |
---|---|
LSM303DLHC_ACC_BDU_CONT | Continuous update |
LSM303DLHC_ACC_BDU_BLOCK | Update blocked |
Definition at line 459 of file lsm303dlhc.h.
enum lsm303dlhc_acc_end_t |
LSM303DLHC accelerometer endianness.
Enumerator | |
---|---|
LSM303DLHC_ACC_END_LITTLE | Little Endian |
LSM303DLHC_ACC_END_BIG | Big Endian |
Definition at line 467 of file lsm303dlhc.h.
enum lsm303dlhc_comp_fs_t |
LSM303DLHC compass subsystem full scale.
Definition at line 480 of file lsm303dlhc.h.
LSM303DLHC compass subsystem output data rate.
Definition at line 493 of file lsm303dlhc.h.
enum lsm303dlhc_comp_md_t |
LSM303DLHC compass subsystem working mode.
Enumerator | |
---|---|
LSM303DLHC_COMP_MD_CONT | Continuous-Conversion Mode |
LSM303DLHC_COMP_MD_BLOCK | Single-Conversion Mode |
LSM303DLHC_COMP_MD_SLEEP | Sleep Mode |
Definition at line 507 of file lsm303dlhc.h.
enum lsm303dlhc_state_t |
Driver state machine possible states.
Enumerator | |
---|---|
LSM303DLHC_UNINIT | Not initialized. |
LSM303DLHC_STOP | Stopped. |
LSM303DLHC_READY | Ready. |
Definition at line 521 of file lsm303dlhc.h.
|
static |
Reads registers value using I2C.
[in] | i2cp | pointer to the I2C interface. |
[in] | sad | slave address without R bit. |
[in] | reg | first sub-register address. |
[in] | rxbuf | receiving buffer. |
[in] | n | size of rxbuf. |
Definition at line 69 of file lsm303dlhc.c.
Referenced by acc_read_raw(), and comp_read_raw().
|
static |
Writes a value into a register using I2C.
[in] | i2cp | pointer to the I2C interface. |
[in] | sad | slave address without R bit. |
[in] | txbuf | buffer containing sub-address value in first position and values to write. |
[in] | n | size of txbuf less one (not considering the first element). |
Definition at line 89 of file lsm303dlhc.c.
|
static |
Return the number of axes of the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
Definition at line 104 of file lsm303dlhc.c.
References LSM303DLHC_ACC_NUMBER_OF_AXES.
|
static |
Retrieves raw data from the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 126 of file lsm303dlhc.c.
References I2C_READY, i2cAcquireBus(), i2cStart(), LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, lsm303dlhcI2CReadRegister(), objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by acc_read_cooked().
|
static |
Retrieves cooked data from the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 181 of file lsm303dlhc.c.
References acc_read_raw(), LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set bias values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 214 of file lsm303dlhc.c.
References LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset bias values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
MSG_OK | if the function succeeded. |
Definition at line 243 of file lsm303dlhc.c.
References LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set sensitivity values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 273 of file lsm303dlhc.c.
References LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset sensitivity values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 302 of file lsm303dlhc.c.
References LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Changes the LSM303DLHCDriver accelerometer fullscale value.
[in] | devp | pointer to LSM303DLHCDriver interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 347 of file lsm303dlhc.c.
References I2C_READY, LSM303DLHC_ACC_FS_2G, LSM303DLHC_READY, osalDbgAssert, and osalDbgCheck.
|
static |
Return the number of axes of the BaseCompass.
[in] | ip | pointer to BaseCompass interface |
Definition at line 437 of file lsm303dlhc.c.
References LSM303DLHC_COMP_NUMBER_OF_AXES, and osalDbgCheck.
|
static |
Retrieves raw data from the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 459 of file lsm303dlhc.c.
References I2C_READY, i2cAcquireBus(), i2cStart(), LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_COMP, lsm303dlhcI2CReadRegister(), objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by comp_read_cooked().
|
static |
Retrieves cooked data from the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 513 of file lsm303dlhc.c.
References comp_read_raw(), LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set bias values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 547 of file lsm303dlhc.c.
References LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset bias values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
MSG_OK | if the function succeeded. |
Definition at line 576 of file lsm303dlhc.c.
References LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set sensitivity values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 606 of file lsm303dlhc.c.
References LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset sensitivity values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 635 of file lsm303dlhc.c.
References LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Changes the LSM303DLHCDriver compass fullscale value.
[in] | devp | pointer to LSM303DLHCDriver interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 731 of file lsm303dlhc.c.
References I2C_READY, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_READY, osalDbgAssert, and osalDbgCheck.
void lsm303dlhcObjectInit | ( | LSM303DLHCDriver * | devp | ) |
Initializes an instance.
[out] | devp | pointer to the LSM303DLHCDriver object |
Definition at line 847 of file lsm303dlhc.c.
References LSM303DLHCDriver::vmt.
void lsm303dlhcStart | ( | LSM303DLHCDriver * | devp, |
const LSM303DLHCConfig * | config | ||
) |
Configures and activates LSM303DLHC Complex Driver peripheral.
[in] | devp | pointer to the LSM303DLHCDriver object |
[in] | config | pointer to the LSM303DLHCConfig object |
Definition at line 868 of file lsm303dlhc.c.
References LSM303DLHC_READY, LSM303DLHC_STOP, osalDbgAssert, and osalDbgCheck.
void lsm303dlhcStop | ( | LSM303DLHCDriver * | devp | ) |
Deactivates the LSM303DLHC Complex Driver peripheral.
[in] | devp | pointer to the LSM303DLHCDriver object |
Definition at line 1142 of file lsm303dlhc.c.
References i2cAcquireBus(), i2cStart(), LSM303DLHC_READY, LSM303DLHC_STOP, osalDbgAssert, and osalDbgCheck.