ChibiOS
21.6.0
|
Macros | |
#define | lps25hBarometerGetAxesNumber(devp) barometerGetAxesNumber(&((devp)->baro_if)) |
Return the number of axes of the BaseBarometer. More... | |
#define | lps25hBarometerReadRaw(devp, axes) barometerReadRaw(&((devp)->baro_if), axes) |
Retrieves raw data from the BaseBarometer. More... | |
#define | lps25hBarometerReadCooked(devp, axes) barometerReadCooked(&((devp)->baro_if), axes) |
Retrieves cooked data from the BaseBarometer. More... | |
#define | lps25hBarometerSetBias(devp, bp) barometerSetBias(&((devp)->baro_if), bp) |
Set bias values for the BaseBarometer. More... | |
#define | lps25hBarometerResetBias(devp) barometerResetBias(&((devp)->baro_if)) |
Reset bias values for the BaseBarometer. More... | |
#define | lps25hBarometerSetSensitivity(devp, sp) barometerSetSensitivity(&((devp)->baro_if), sp) |
Set sensitivity values for the BaseBarometer. More... | |
#define | lps25hBarometerResetSensitivity(devp) barometerResetSensitivity(&((devp)->baro_if)) |
Reset sensitivity values for the BaseBarometer. More... | |
#define | lps25hThermometerGetAxesNumber(devp) thermometerGetAxesNumber(&((devp)->thermo_if)) |
Return the number of axes of the BaseThermometer. More... | |
#define | lps25hThermometerReadRaw(devp, axes) thermometerReadRaw(&((devp)->thermo_if), axes) |
Retrieves raw data from the BaseThermometer. More... | |
#define | lps25hThermometerReadCooked(devp, axes) thermometerReadCooked(&((devp)->thermo_if), axes) |
Retrieves cooked data from the BaseThermometer. More... | |
#define | lps25hThermometerSetBias(devp, bp) thermometerSetBias(&((devp)->thermo_if), bp) |
Set bias values for the BaseThermometer. More... | |
#define | lps25hThermometerResetBias(devp) thermometerResetBias(&((devp)->thermo_if)) |
Reset bias values for the BaseThermometer. More... | |
#define | lps25hThermometerSetSensitivity(devp, sp) thermometerSetSensitivity(&((devp)->thermo_if), sp) |
Set sensitivity values for the BaseThermometer. More... | |
#define | lps25hThermometerResetSensitivity(devp) thermometerResetSensitivity(&((devp)->thermo_if)) |
Reset sensitivity values for the BaseThermometer. More... | |
Version identification | |
#define | EX_LPS25H_VERSION "1.1.2" |
LPS25H driver version string. More... | |
#define | EX_LPS25H_MAJOR 1 |
LPS25H driver version major number. More... | |
#define | EX_LPS25H_MINOR 1 |
LPS25H driver version minor number. More... | |
#define | EX_LPS25H_PATCH 2 |
LPS25H driver version patch number. More... | |
#define | LPS25H_BARO_NUMBER_OF_AXES 1U |
LPS25H barometer subsystem characteristics. More... | |
#define | LPS25H_THERMO_NUMBER_OF_AXES 1U |
LPS25H thermometer subsystem characteristics. More... | |
LPS25H_INT1_CFG register bits definitions | |
#define | LPS25H_INT1_CFG_MASK 0x07 |
#define | LPS25H_INT1_CFG_PH_E (1 << 0) |
#define | LPS25H_INT1_CFG_PL_E (1 << 1) |
#define | LPS25H_INT1_CFG_LIR (1 << 2) |
LPS25H_INT1_SRC register bits definitions | |
#define | LPS25H_INT1_SRC_MASK 0x07 |
#define | LPS25H_INT1_SRC_PH (1 << 0) |
#define | LPS25H_INT1_SRC_PL (1 << 1) |
#define | LPS25H_INT1_SRC_IA (1 << 2) |
Configuration options | |
#define | LPS25H_USE_SPI FALSE |
LPS25H SPI interface switch. More... | |
#define | LPS25H_SHARED_SPI FALSE |
LPS25H shared SPI switch. More... | |
#define | LPS25H_USE_I2C TRUE |
LPS25H I2C interface switch. More... | |
#define | LPS25H_SHARED_I2C FALSE |
LPS25H shared I2C switch. More... | |
#define | LPS25H_USE_ADVANCED FALSE |
LPS25H advanced configurations switch. More... | |
LPS25H data structures and types. | |
enum | lps25h_sad_t { LPS25H_SAD_GND = 0x5C, LPS25H_SAD_VCC = 0x5D } |
LPS25H slave address. More... | |
enum | lps25h_odr_t { LPS25H_ODR_ONE_SHOT = 0x00, LPS25H_ODR_1HZ = 0x10, LPS25H_ODR_7HZ = 0x20, LPS25H_ODR_12P5HZ = 0x30, LPS25H_ODR_25HZ = 0x40 } |
LPS25H output data rate and bandwidth. More... | |
enum | lps25h_avgp_t { LPS25H_AVGP_8 = 0x00, LPS25H_AVGP_32 = 0x01, LPS25H_AVGP_128 = 0x02, LPS25H_AVGP_512 = 0x03 } |
LPS25H pressure resolution. More... | |
enum | lps25h_avgt_t { LPS25H_AVGT_8 = 0x00, LPS25H_AVGT_32 = 0x04, LPS25H_AVGT_128 = 0x08, LPS25H_AVGT_512 = 0x0C } |
LPS25H temperature resolution. More... | |
enum | lps25h_bdu_t { LPS25H_BDU_CONTINUOUS = 0x00, LPS25H_BDU_BLOCKED = 0x40 } |
LPS25H block data update. More... | |
enum | lps25h_state_t { LPS25H_UNINIT = 0, LPS25H_STOP = 1, LPS25H_READY = 2 } |
Driver state machine possible states. More... | |
typedef struct LPS25HDriver | LPS25HDriver |
Structure representing a LPS25H driver. More... | |
#define | _lps25h_methods_alone |
LPS25H specific methods. More... | |
#define | _lps25h_methods |
LPS25H specific methods with inherited ones. More... | |
#define | _lps25h_data |
LPS25HDriver specific data. More... | |
Data Structures | |
struct | LPS25HConfig |
LPS25H configuration structure. More... | |
struct | LPS25HVMT |
LPS25H virtual methods table. More... | |
struct | LPS25HDriver |
LPS25H 2-axis barometer/thermometer class. More... | |
Functions | |
static msg_t | lps25hI2CReadRegister (I2CDriver *i2cp, lps25h_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n) |
Reads registers value using I2C. More... | |
static msg_t | lps25hI2CWriteRegister (I2CDriver *i2cp, lps25h_sad_t sad, uint8_t *txbuf, size_t n) |
Writes a value into a register using I2C. More... | |
static size_t | baro_get_axes_number (void *ip) |
Return the number of axes of the BaseBarometer. More... | |
static msg_t | baro_read_raw (void *ip, int32_t axes[]) |
Retrieves raw data from the BaseBarometer. More... | |
static msg_t | baro_read_cooked (void *ip, float axes[]) |
Retrieves cooked data from the BaseBarometer. More... | |
static msg_t | baro_set_bias (void *ip, float *bp) |
Set bias values for the BaseBarometer. More... | |
static msg_t | baro_reset_bias (void *ip) |
Reset bias values for the BaseBarometer. More... | |
static msg_t | baro_set_sensitivity (void *ip, float *sp) |
Set sensitivity values for the BaseBarometer. More... | |
static msg_t | baro_reset_sensitivity (void *ip) |
Reset sensitivity values for the BaseBarometer. More... | |
static size_t | thermo_get_axes_number (void *ip) |
Return the number of axes of the BaseThermometer. More... | |
static msg_t | thermo_read_raw (void *ip, int32_t axes[]) |
Retrieves raw data from the BaseThermometer. More... | |
static msg_t | thermo_read_cooked (void *ip, float *axis) |
Retrieves cooked data from the BaseThermometer. More... | |
static msg_t | thermo_set_bias (void *ip, float *bp) |
Set bias values for the BaseThermometer. More... | |
static msg_t | thermo_reset_bias (void *ip) |
Reset bias values for the BaseThermometer. More... | |
static msg_t | thermo_set_sensitivity (void *ip, float *sp) |
Set sensitivity values for the BaseThermometer. More... | |
static msg_t | thermo_reset_sensitivity (void *ip) |
Reset sensitivity values for the BaseThermometer. More... | |
void | lps25hObjectInit (LPS25HDriver *devp) |
Initializes an instance. More... | |
void | lps25hStart (LPS25HDriver *devp, const LPS25HConfig *config) |
Configures and activates LPS25H Complex Driver peripheral. More... | |
void | lps25hStop (LPS25HDriver *devp) |
Deactivates the LPS25H Complex Driver peripheral. More... | |
#define EX_LPS25H_VERSION "1.1.2" |
#define EX_LPS25H_MAJOR 1 |
#define EX_LPS25H_MINOR 1 |
#define EX_LPS25H_PATCH 2 |
#define LPS25H_BARO_NUMBER_OF_AXES 1U |
#define LPS25H_THERMO_NUMBER_OF_AXES 1U |
#define LPS25H_USE_SPI FALSE |
#define LPS25H_SHARED_SPI FALSE |
#define LPS25H_USE_I2C TRUE |
#define LPS25H_SHARED_I2C FALSE |
#define LPS25H_USE_ADVANCED FALSE |
#define _lps25h_methods_alone |
#define _lps25h_methods |
#define _lps25h_data |
LPS25HDriver
specific data.
#define lps25hBarometerGetAxesNumber | ( | devp | ) | barometerGetAxesNumber(&((devp)->baro_if)) |
Return the number of axes of the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
#define lps25hBarometerReadRaw | ( | devp, | |
axes | |||
) | barometerReadRaw(&((devp)->baro_if), axes) |
Retrieves raw data from the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
[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. |
#define lps25hBarometerReadCooked | ( | devp, | |
axes | |||
) | barometerReadCooked(&((devp)->baro_if), axes) |
Retrieves cooked data from the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
[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. |
#define lps25hBarometerSetBias | ( | devp, | |
bp | |||
) | barometerSetBias(&((devp)->baro_if), bp) |
Set bias values for the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
#define lps25hBarometerResetBias | ( | devp | ) | barometerResetBias(&((devp)->baro_if)) |
Reset bias values for the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
MSG_OK | if the function succeeded. |
#define lps25hBarometerSetSensitivity | ( | devp, | |
sp | |||
) | barometerSetSensitivity(&((devp)->baro_if), sp) |
Set sensitivity values for the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
#define lps25hBarometerResetSensitivity | ( | devp | ) | barometerResetSensitivity(&((devp)->baro_if)) |
Reset sensitivity values for the BaseBarometer.
[in] | devp | pointer to LPS25HDriver . |
MSG_OK | if the function succeeded. |
#define lps25hThermometerGetAxesNumber | ( | devp | ) | thermometerGetAxesNumber(&((devp)->thermo_if)) |
Return the number of axes of the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
#define lps25hThermometerReadRaw | ( | devp, | |
axes | |||
) | thermometerReadRaw(&((devp)->thermo_if), axes) |
Retrieves raw data from the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
[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. |
#define lps25hThermometerReadCooked | ( | devp, | |
axes | |||
) | thermometerReadCooked(&((devp)->thermo_if), axes) |
Retrieves cooked data from the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
[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. |
#define lps25hThermometerSetBias | ( | devp, | |
bp | |||
) | thermometerSetBias(&((devp)->thermo_if), bp) |
Set bias values for the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
#define lps25hThermometerResetBias | ( | devp | ) | thermometerResetBias(&((devp)->thermo_if)) |
Reset bias values for the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
MSG_OK | if the function succeeded. |
#define lps25hThermometerSetSensitivity | ( | devp, | |
sp | |||
) | thermometerSetSensitivity(&((devp)->thermo_if), sp) |
Set sensitivity values for the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
#define lps25hThermometerResetSensitivity | ( | devp | ) | thermometerResetSensitivity(&((devp)->thermo_if)) |
Reset sensitivity values for the BaseThermometer.
[in] | devp | pointer to LPS25HDriver . |
MSG_OK | if the function succeeded. |
typedef struct LPS25HDriver LPS25HDriver |
enum lps25h_sad_t |
enum lps25h_odr_t |
enum lps25h_avgp_t |
enum lps25h_avgt_t |
enum lps25h_bdu_t |
enum lps25h_state_t |
|
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 |
[out] | rxbuf | pointer to an output buffer |
[in] | n | number of consecutive register to read |
Definition at line 63 of file lps25h.c.
Referenced by baro_read_raw(), and thermo_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) |
|
static |
Return the number of axes of the BaseBarometer.
[in] | ip | pointer to BaseBarometer interface. |
Definition at line 103 of file lps25h.c.
References LPS25H_BARO_NUMBER_OF_AXES.
|
static |
Retrieves raw data from the BaseBarometer.
[in] | ip | pointer to BaseBarometer 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 125 of file lps25h.c.
References I2C_READY, i2cAcquireBus(), i2cStart(), LPS25H_READY, lps25hI2CReadRegister(), objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by baro_read_cooked().
|
static |
Retrieves cooked data from the BaseBarometer.
[in] | ip | pointer to BaseBarometer 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 177 of file lps25h.c.
References baro_read_raw(), LPS25H_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set bias values for the BaseBarometer.
[in] | ip | pointer to BaseBarometer interface. |
[in] | bp | a buffer which contains biases. |
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 212 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset bias values for the BaseBarometer.
[in] | ip | pointer to BaseBarometer interface. |
MSG_OK | if the function succeeded. |
Definition at line 238 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set sensitivity values for the BaseBarometer.
[in] | ip | pointer to BaseBarometer interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 266 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset sensitivity values for the BaseBarometer.
[in] | ip | pointer to BaseBarometer interface. |
MSG_OK | if the function succeeded. |
Definition at line 291 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Return the number of axes of the BaseThermometer.
[in] | ip | pointer to BaseThermometer interface. |
Definition at line 314 of file lps25h.c.
References LPS25H_THERMO_NUMBER_OF_AXES.
|
static |
Retrieves raw data from the BaseThermometer.
[in] | ip | pointer to BaseThermometer 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 336 of file lps25h.c.
References I2C_READY, i2cAcquireBus(), i2cStart(), LPS25H_READY, lps25hI2CReadRegister(), objGetInstance, osalDbgAssert, and osalDbgCheck.
Referenced by thermo_read_cooked().
|
static |
Retrieves cooked data from the BaseThermometer.
[in] | ip | pointer to BaseThermometer interface. |
[out] | axis | 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 390 of file lps25h.c.
References LPS25H_READY, objGetInstance, osalDbgAssert, osalDbgCheck, and thermo_read_raw().
|
static |
Set bias values for the BaseThermometer.
[in] | ip | pointer to BaseThermometer interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 422 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset bias values for the BaseThermometer.
[in] | ip | pointer to BaseThermometer interface. |
MSG_OK | if the function succeeded. |
Definition at line 449 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Set sensitivity values for the BaseThermometer.
[in] | ip | pointer to BaseThermometer interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 478 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Reset sensitivity values for the BaseThermometer.
[in] | ip | pointer to BaseThermometer interface. |
MSG_OK | if the function succeeded. |
Definition at line 504 of file lps25h.c.
References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.
void lps25hObjectInit | ( | LPS25HDriver * | devp | ) |
Initializes an instance.
[out] | devp | pointer to the LPS25HDriver object |
Definition at line 550 of file lps25h.c.
References LPS25HDriver::vmt.
void lps25hStart | ( | LPS25HDriver * | devp, |
const LPS25HConfig * | config | ||
) |
Configures and activates LPS25H Complex Driver peripheral.
[in] | devp | pointer to the LPS25HDriver object |
[in] | config | pointer to the LPS25HConfig object |
Definition at line 572 of file lps25h.c.
References LPS25H_READY, LPS25H_STOP, osalDbgAssert, and osalDbgCheck.
void lps25hStop | ( | LPS25HDriver * | devp | ) |
Deactivates the LPS25H Complex Driver peripheral.
[in] | devp | pointer to the LPS25HDriver object |
Definition at line 669 of file lps25h.c.
References i2cAcquireBus(), i2cStart(), LPS25H_READY, LPS25H_STOP, osalDbgAssert, and osalDbgCheck.