ChibiOS
19.1.4
|
![]() |
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 accelerometer subsystem data structures and types. | |
| |
typedef struct LSM303DLHCDriver | LSM303DLHCDriver |
Structure representing a LSM303DLHC driver. More... | |
LSM303DLHC compass subsystem data structures and types. |
LSM303DLHC main system data structures and types. | |
#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 |
#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.
Referenced by acc_get_axes_number(), acc_read_cooked(), acc_read_raw(), acc_reset_bias(), acc_reset_sensivity(), acc_set_bias(), acc_set_full_scale(), acc_set_sensivity(), lsm303dlhcObjectInit(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_NUMBER_OF_AXES 3U |
LSM303DLHC compass subsystem characteristics.
Definition at line 94 of file lsm303dlhc.h.
Referenced by comp_get_axes_number(), comp_read_cooked(), comp_read_raw(), comp_reset_bias(), comp_reset_sensivity(), comp_set_bias(), comp_set_full_scale(), comp_set_sensivity(), lsm303dlhcObjectInit(), and lsm303dlhcStart().
#define LSM303DLHC_USE_SPI FALSE |
LSM303DLHC SPI interface switch.
If set to TRUE
the support for SPI is included.
FALSE
. Definition at line 313 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 323 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 332 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 342 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 351 of file lsm303dlhc.h.
#define _lsm303dlhc_methods_alone |
LSM303DLHC
specific methods.
Definition at line 597 of file lsm303dlhc.h.
#define _lsm303dlhc_methods |
LSM303DLHC
specific methods with inherited ones.
Definition at line 608 of file lsm303dlhc.h.
#define _lsm303dlhc_data |
LSM303DLHCDriver
specific data.
Definition at line 624 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 674 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 695 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 717 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 734 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 749 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 766 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 781 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 799 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 811 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 832 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 854 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 871 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 886 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 903 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 918 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 936 of file lsm303dlhc.h.
typedef struct LSM303DLHCDriver LSM303DLHCDriver |
Structure representing a LSM303DLHC driver.
Definition at line 397 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 402 of file lsm303dlhc.h.
enum lsm303dlhc_acc_odr_t |
LSM303DLHC accelerometer subsystem output data rate.
Definition at line 412 of file lsm303dlhc.h.
enum lsm303dlhc_acc_ae_t |
LSM303DLHC accelerometer subsystem axes enabling.
Definition at line 428 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 442 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 450 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 458 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 466 of file lsm303dlhc.h.
enum lsm303dlhc_comp_fs_t |
LSM303DLHC compass subsystem full scale.
Definition at line 478 of file lsm303dlhc.h.
LSM303DLHC compass subsystem output data rate.
Definition at line 491 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 505 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 518 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.
References i2cMasterTransmitTimeout(), and TIME_INFINITE.
Referenced by acc_read_raw(), acc_set_full_scale(), comp_read_raw(), and comp_set_full_scale().
|
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.
References i2cMasterTransmitTimeout(), and TIME_INFINITE.
Referenced by acc_set_full_scale(), comp_set_full_scale(), lsm303dlhcStart(), and lsm303dlhcStop().
|
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.
Referenced by comp_set_full_scale().
|
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(), i2cReleaseBus(), i2cStart(), LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, lsm303dlhcI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by acc_read_cooked(), and comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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 FALSE, LSM303DLHC_ACC_FS_16G, LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_FS_8G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by comp_set_full_scale().
|
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, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM303DLHC_ACC_FS_16G, LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_FS_8G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, lsm303dlhcI2CReadRegister(), lsm303dlhcI2CWriteRegister(), MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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(), i2cReleaseBus(), i2cStart(), LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_COMP, lsm303dlhcI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by comp_read_cooked(), and comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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.
Referenced by comp_set_full_scale().
|
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 FALSE, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_FS_1P9GA, LSM303DLHC_COMP_FS_2P5GA, LSM303DLHC_COMP_FS_4P0GA, LSM303DLHC_COMP_FS_4P7GA, LSM303DLHC_COMP_FS_5P6GA, LSM303DLHC_COMP_FS_8P1GA, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by comp_set_full_scale().
|
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 acc_get_axes_number(), acc_read_cooked(), acc_read_raw(), acc_reset_bias(), acc_reset_sensivity(), acc_set_bias(), acc_set_full_scale(), acc_set_sensivity(), comp_get_axes_number(), comp_read_cooked(), comp_read_raw(), comp_reset_bias(), comp_reset_sensivity(), comp_set_bias(), comp_set_sensivity(), I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_FS_1P9GA, LSM303DLHC_COMP_FS_2P5GA, LSM303DLHC_COMP_FS_4P0GA, LSM303DLHC_COMP_FS_4P7GA, LSM303DLHC_COMP_FS_5P6GA, LSM303DLHC_COMP_FS_8P1GA, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_COMP, lsm303dlhcI2CReadRegister(), lsm303dlhcI2CWriteRegister(), MSG_OK, MSG_RESET, 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::acc_if, LSM303DLHCDriver::comp_if, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_STOP, BaseAccelerometer::vmt, BaseCompass::vmt, and 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 I2CDriver::config, FALSE, i2cAcquireBus(), LSM303DLHCConfig::i2cp, i2cReleaseBus(), i2cStart(), LSM303DLHC_ACC_FS_16G, LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_FS_8G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_FS_1P9GA, LSM303DLHC_COMP_FS_2P5GA, LSM303DLHC_COMP_FS_4P0GA, LSM303DLHC_COMP_FS_4P7GA, LSM303DLHC_COMP_FS_5P6GA, LSM303DLHC_COMP_FS_8P1GA, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, LSM303DLHC_SAD_COMP, LSM303DLHC_STOP, lsm303dlhcI2CWriteRegister(), osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.
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(), i2cReleaseBus(), i2cStart(), i2cStop(), LSM303DLHC_ACC_AE_DISABLED, LSM303DLHC_ACC_ODR_PD, LSM303DLHC_COMP_MD_SLEEP, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, LSM303DLHC_SAD_COMP, LSM303DLHC_STOP, lsm303dlhcI2CWriteRegister(), osalDbgAssert, and osalDbgCheck.