ChibiOS
20.3.4
|
Version identification | |
#define | EX_BMP085_VERSION "1.0.1" |
BMP085 driver version string. More... | |
#define | EX_BMP085_MAJOR 1 |
BMP085 driver version major number. More... | |
#define | EX_BMP085_MINOR 0 |
BMP085 driver version minor number. More... | |
#define | EX_BMP085_PATCH 1 |
BMP085 driver version patch number. More... | |
#define | BMP085_BARO_NUMBER_OF_AXES 1U |
BMP085 barometer subsystem characteristics. More... | |
#define | BMP085_P_RES 0.01 |
#define | BMP085_THERMO_NUMBER_OF_AXES 1U |
BMP085 thermometer subsystem characteristics. More... | |
#define | BMP085_T_RES 0.1 |
BMP085 Registers addresses. | |
#define | BMP085_AD_CR 0xF4 |
#define | BMP085_AD_T_DR_MSB 0xF6 |
#define | BMP085_AD_T_DR_LSB 0xF7 |
#define | BMP085_AD_P_DR_MSB 0xF6 |
#define | BMP085_AD_P_DR_LSB 0xF7 |
#define | BMP085_AD_P_DR_XLSB 0xF8 |
#define | BMP085_AD_CC_AC1_MSB 0xAA |
#define | BMP085_AD_CC_AC1_LSB 0xAB |
#define | BMP085_AD_CC_AC2_MSB 0xAC |
#define | BMP085_AD_CC_AC2_LSB 0xAD |
#define | BMP085_AD_CC_AC3_MSB 0xAE |
#define | BMP085_AD_CC_AC3_LSB 0xAF |
#define | BMP085_AD_CC_AC4_MSB 0xB0 |
#define | BMP085_AD_CC_AC4_LSB 0xB1 |
#define | BMP085_AD_CC_AC5_MSB 0xB2 |
#define | BMP085_AD_CC_AC5_LSB 0xB3 |
#define | BMP085_AD_CC_AC6_MSB 0xB4 |
#define | BMP085_AD_CC_AC6_LSB 0xB5 |
#define | BMP085_AD_CC_B1_MSB 0xB6 |
#define | BMP085_AD_CC_B1_LSB 0xB7 |
#define | BMP085_AD_CC_B2_MSB 0xB8 |
#define | BMP085_AD_CC_B2_LSB 0xB9 |
#define | BMP085_AD_CC_MB_MSB 0xBA |
#define | BMP085_AD_CC_MB_LSB 0xBB |
#define | BMP085_AD_CC_MC_MSB 0xBC |
#define | BMP085_AD_CC_MC_LSB 0xBD |
#define | BMP085_AD_CC_MD_MSB 0xBE |
#define | BMP085_AD_CC_MD_LSB 0xBF |
Configuration options | |
#define | BMP085_USE_I2C TRUE |
BMP085 I2C interface selector. More... | |
#define | BMP085_USE_ADVANCED TRUE |
BMP085 sensor subsystem advanced configurations switch. More... | |
#define | BMP085_SHARED_I2C FALSE |
BMP085 shared I2C switch. More... | |
BMP085 barometer subsystem data structures and types. | |
enum | bmp085_baro_ct_t { BMP085_BARO_CT_LOW = 0x05, BMP085_BARO_CT_STD = 0x18, BMP085_BARO_CT_HR = 0x0E, BMP085_BARO_CT_LUHR = 0x1A } |
BMP085 barometer subsystem pressure conversion time. More... | |
enum | bmp085_baro_mode_t { BMP085_BARO_MODE_LOW = 0x00, BMP085_BARO_MODE_STD = 0x01, BMP085_BARO_MODE_HR = 0x02, BMP085_BARO_MODE_LUHR = 0x03 } |
BMP085 barometer subsystem mode. More... | |
enum | bmp085_baro_oss_t { BMP085_BARO_OSS_0 = 0x00, BMP085_BARO_OSS_1 = 0x01, BMP085_BARO_OSS_2 = 0x02, BMP085_BARO_OSS_3 = 0x04 } |
BMP085 barometer oversampling setting. More... | |
BMP085 thermometer subsystem data structures and types. | |
enum | bmp085_thermo_ct_t { BMP085_THERMO_CT_LOW = 0x05, BMP085_THERMO_CT_STD = 0x18, BMP085_THERMO_CT_HR = 0x0E, BMP085_THERMO_CT_LUHR = 0x1A } |
BMP085 thermometer subsystem temperature conversion time. More... | |
BMP085 main system data structures and types. | |
enum | bmp085_state_t { BMP085_UNINIT = 0, BMP085_STOP = 1, BMP085_READY = 2 } |
Driver state machine possible states. More... | |
typedef struct BMP085Driver | BMP085Driver |
Structure representing a BMP085 driver. More... | |
#define | _bmp085_baro_methods _base_barometer_methods |
BMP085 barometer subsystem specific methods. More... | |
#define | _bmp085_thermo_methods _base_thermometer_methods |
BMP085 thermometer subsystem specific methods. More... | |
#define | _bmp085_data |
BMP085Driver specific data. More... | |
Data Structures | |
struct | bmp085_cd_t |
BMP085 barometer subsystem calibration data. More... | |
struct | BMP085Config |
BMP085 configuration structure. More... | |
struct | BMP085BAROVMT |
BMP085 barometer virtual methods table. More... | |
struct | BMP085THERMOVMT |
BMP085 thermometer virtual methods table. More... | |
struct | BMP085Driver |
BMP085 driver structure. More... | |
Functions | |
msg_t | bmp085I2CReadRegister (I2CDriver *i2cp, uint8_t reg, uint8_t *rxbufp, size_t n) |
Reads registers value using I2C. More... | |
msg_t | bmp085I2CWriteRegister (I2CDriver *i2cp, uint8_t *txbufp, size_t n) |
Writes a value into a register using I2C. More... | |
static msg_t | bmp085ReadCoefficient (BMP085Driver *devp, uint8_t reg) |
Read all the calibration data from the BMP085 EEPROM. More... | |
static void | calcul_t (BMP085Driver *devp, int32_t ut, float *ctp) |
Calcul the true temperature. More... | |
static void | calcul_p (BMP085Driver *devp, int32_t up, uint8_t oss, float *cpp) |
Calcul the true pressure. More... | |
static msg_t | start_t_measurement (BMP085Driver *devp) |
Start temperature measurement. More... | |
static msg_t | start_p_measurement (BMP085Driver *devp) |
Start the pressure measurment. More... | |
static msg_t | acquire_ut (BMP085Driver *devp, int32_t *utemp) |
Read the uncompensated temperature from the BMP085 register. More... | |
static msg_t | acquire_up (BMP085Driver *devp, int32_t *upress) |
Read the uncompensated pressure from the BMP085 register. More... | |
static size_t | baro_get_axes_number (void *ip) |
Get the barometer number of axes. More... | |
static size_t | thermo_get_axes_number (void *ip) |
Get the thermometer number of axes. More... | |
static size_t | sens_get_axes_number (void *ip) |
Get the sensor number of axes. More... | |
static msg_t | baro_read_raw (void *ip, int32_t axes[]) |
Read baromether raw data. More... | |
static msg_t | thermo_read_raw (void *ip, int32_t axes[]) |
Read thermometer raw data. More... | |
static msg_t | sens_read_raw (void *ip, int32_t axes[]) |
Read BMP085 sensor raw data. More... | |
static msg_t | baro_read_cooked (void *ip, float axes[]) |
Read barometer cooked data. More... | |
static msg_t | thermo_read_cooked (void *ip, float axes[]) |
Read thermometer cooked data. More... | |
static msg_t | sens_read_cooked (void *ip, float axes[]) |
Read BMP085 sensor cooked data. More... | |
static msg_t | baro_set_bias (void *ip, float *bp) |
Set the barometer bias. More... | |
static msg_t | thermo_set_bias (void *ip, float *bp) |
Set the thermometer bias. More... | |
static msg_t | baro_reset_bias (void *ip) |
Reset the barometer bias. More... | |
static msg_t | thermo_reset_bias (void *ip) |
Reset the thermometer bias. More... | |
static msg_t | baro_set_sensivity (void *ip, float *sp) |
Set the barometer sensivity. More... | |
static msg_t | thermo_set_sensivity (void *ip, float *sp) |
Set the thermometer sensivity. More... | |
static msg_t | baro_reset_sensivity (void *ip) |
Reset the barometer sensivity. More... | |
static msg_t | thermo_reset_sensivity (void *ip) |
Reset the thermometer sensivity. More... | |
void | bmp085ObjectInit (BMP085Driver *devp) |
Initializes an instance. More... | |
void | bmp085Start (BMP085Driver *devp, const BMP085Config *config) |
Configures and activates BMP085 Complex Driver peripheral. More... | |
void | bmp085Stop (BMP085Driver *devp) |
Deactivates the BMP085 Complex Driver peripheral. More... | |
#define EX_BMP085_VERSION "1.0.1" |
#define EX_BMP085_MAJOR 1 |
#define EX_BMP085_MINOR 0 |
#define EX_BMP085_PATCH 1 |
#define BMP085_BARO_NUMBER_OF_AXES 1U |
#define BMP085_THERMO_NUMBER_OF_AXES 1U |
#define BMP085_AD_T_DR_MSB 0xF6 |
#define BMP085_AD_T_DR_LSB 0xF7 |
#define BMP085_AD_P_DR_MSB 0xF6 |
#define BMP085_AD_P_DR_LSB 0xF7 |
#define BMP085_AD_P_DR_XLSB 0xF8 |
#define BMP085_AD_CC_AC1_MSB 0xAA |
#define BMP085_AD_CC_AC1_LSB 0xAB |
#define BMP085_AD_CC_AC2_MSB 0xAC |
#define BMP085_AD_CC_AC2_LSB 0xAD |
#define BMP085_AD_CC_AC3_MSB 0xAE |
#define BMP085_AD_CC_AC3_LSB 0xAF |
#define BMP085_AD_CC_AC4_MSB 0xB0 |
#define BMP085_AD_CC_AC4_LSB 0xB1 |
#define BMP085_AD_CC_AC5_MSB 0xB2 |
#define BMP085_AD_CC_AC5_LSB 0xB3 |
#define BMP085_AD_CC_AC6_MSB 0xB4 |
#define BMP085_AD_CC_AC6_LSB 0xB5 |
#define BMP085_AD_CC_B1_MSB 0xB6 |
#define BMP085_AD_CC_B1_LSB 0xB7 |
#define BMP085_AD_CC_B2_MSB 0xB8 |
#define BMP085_AD_CC_B2_LSB 0xB9 |
#define BMP085_AD_CC_MB_MSB 0xBA |
#define BMP085_AD_CC_MB_LSB 0xBB |
#define BMP085_AD_CC_MC_MSB 0xBC |
#define BMP085_AD_CC_MC_LSB 0xBD |
#define BMP085_AD_CC_MD_MSB 0xBE |
#define BMP085_AD_CC_MD_LSB 0xBF |
#define BMP085_USE_I2C TRUE |
#define BMP085_USE_ADVANCED TRUE |
#define BMP085_SHARED_I2C FALSE |
#define _bmp085_baro_methods _base_barometer_methods |
#define _bmp085_thermo_methods _base_thermometer_methods |
#define _bmp085_data |
BMP085Driver
specific data.
typedef struct BMP085Driver BMP085Driver |
enum bmp085_baro_ct_t |
enum bmp085_baro_mode_t |
enum bmp085_baro_oss_t |
enum bmp085_thermo_ct_t |
enum bmp085_state_t |
Reads registers value using I2C.
[in] | i2cp | pointer to the I2C interface |
[in] | reg | first sub-register address |
[out] | rxbufp | pointer to an output buffer |
[in] | n | number of consecutive register to read |
Definition at line 71 of file bmp085.c.
References i2cMasterTransmitTimeout().
Referenced by acquire_up(), acquire_ut(), and bmp085ReadCoefficient().
Writes a value into a register using I2C.
[in] | i2cp | pointer to the I2C interface |
[in] | txbufp | 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 92 of file bmp085.c.
References i2cMasterTransmitTimeout().
|
static |
Read all the calibration data from the BMP085 EEPROM.
[in] | devp | pointer to the BMP085 device driver sensor |
[in] | reg | first calibration coefficient register to read |
Definition at line 108 of file bmp085.c.
References bmp085I2CReadRegister(), i2cAcquireBus(), i2cReleaseBus(), and MSG_OK.
Referenced by bmp085Start().
|
static |
Calcul the true temperature.
[in] | devp | pointer to the BMP085 device driver sensor |
[in] | ut | uncompensated temperature |
[out] | ctp | pointer of the compensated temperature |
Definition at line 146 of file bmp085.c.
References BMP085_T_RES.
Referenced by thermo_read_cooked().
|
static |
Calcul the true pressure.
[in] | devp | pointer to the BMP085 device driver sensor |
[in] | up | uncompensated pressure |
[in] | oss | over sampling setting |
[out] | cpp | pointer of the compensated pressure |
Definition at line 165 of file bmp085.c.
References BMP085_P_RES.
Referenced by baro_read_cooked().
|
static |
Start temperature measurement.
[in] | devp | pointer to the BMP085 device driver |
Definition at line 202 of file bmp085.c.
References BMP085_AD_CR.
Referenced by acquire_ut().
|
static |
Start the pressure measurment.
[in] | devp | pointer to the BMP085 driver |
Definition at line 223 of file bmp085.c.
References BMP085_AD_CR, and BMP085_BARO_OSS_0.
Referenced by acquire_up().
|
static |
Read the uncompensated temperature from the BMP085 register.
[in] | devp | pointer to the BMP085 driver |
[out] | utemp | uncompensated temperature read from the sensor register |
Definition at line 274 of file bmp085.c.
References BMP085_AD_T_DR_MSB, bmp085I2CReadRegister(), i2cAcquireBus(), i2cReleaseBus(), MSG_OK, and start_t_measurement().
Referenced by thermo_read_raw().
|
static |
Read the uncompensated pressure from the BMP085 register.
[in] | devp | pointer to the BMP085 driver |
[out] | upress | uncompensated pressure read from the sensor register |
Definition at line 311 of file bmp085.c.
References BMP085_AD_P_DR_MSB, bmp085I2CReadRegister(), i2cAcquireBus(), i2cReleaseBus(), MSG_OK, and start_p_measurement().
Referenced by baro_read_raw().
|
static |
Get the barometer number of axes.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 356 of file bmp085.c.
References BMP085_BARO_NUMBER_OF_AXES, and osalDbgCheck.
Referenced by sens_get_axes_number().
|
static |
Get the thermometer number of axes.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 370 of file bmp085.c.
References BMP085_THERMO_NUMBER_OF_AXES, and osalDbgCheck.
Referenced by sens_get_axes_number().
|
static |
Get the sensor number of axes.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 384 of file bmp085.c.
References baro_get_axes_number(), osalDbgCheck, and thermo_get_axes_number().
|
static |
Read baromether raw data.
[in] | ip | interface pointer of the sensor |
[in] | axes | buffer for various axes data |
Definition at line 399 of file bmp085.c.
References acquire_up(), BMP085_READY, I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), osalDbgAssert, and osalDbgCheck.
Referenced by baro_read_cooked(), and sens_read_raw().
|
static |
Read thermometer raw data.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | axes | buffer for various axes data |
Definition at line 433 of file bmp085.c.
References acquire_ut(), BMP085_READY, I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), osalDbgAssert, and osalDbgCheck.
Referenced by sens_read_raw(), and thermo_read_cooked().
|
static |
Read BMP085 sensor raw data.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | axes | buffer for various axes data |
Definition at line 467 of file bmp085.c.
References baro_read_raw(), BMP085_BARO_NUMBER_OF_AXES, MSG_OK, and thermo_read_raw().
|
static |
Read barometer cooked data.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | axes | buffer for various axes data |
Definition at line 492 of file bmp085.c.
References baro_read_raw(), BMP085_BARO_NUMBER_OF_AXES, BMP085_READY, calcul_p(), osalDbgAssert, and osalDbgCheck.
Referenced by sens_read_cooked().
|
static |
Read thermometer cooked data.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | axes | buffer for various axes data |
Definition at line 520 of file bmp085.c.
References BMP085_READY, BMP085_THERMO_NUMBER_OF_AXES, calcul_t(), osalDbgAssert, osalDbgCheck, and thermo_read_raw().
Referenced by sens_read_cooked().
|
static |
Read BMP085 sensor cooked data.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | axes | buffer for various axes data |
Definition at line 545 of file bmp085.c.
References baro_read_cooked(), BMP085_BARO_NUMBER_OF_AXES, MSG_OK, and thermo_read_cooked().
|
static |
Set the barometer bias.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | bp | pointer to the bias value |
Definition at line 569 of file bmp085.c.
References BMP085_READY, BMP085_STOP, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Set the thermometer bias.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | bp | pointer to the bias value |
Definition at line 586 of file bmp085.c.
References BMP085_READY, BMP085_STOP, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Reset the barometer bias.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 602 of file bmp085.c.
References BMP085_READY, BMP085_STOP, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Reset the thermometer bias.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 619 of file bmp085.c.
References BMP085_READY, BMP085_STOP, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Set the barometer sensivity.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | sp | pointer to the sensivity value |
Definition at line 637 of file bmp085.c.
References BMP085_READY, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Set the thermometer sensivity.
[in] | ip | interface pointer of the BMP085 sensor |
[in] | sp | pointer to the sensivity value |
Definition at line 654 of file bmp085.c.
References BMP085_READY, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Reset the barometer sensivity.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 670 of file bmp085.c.
References BMP085_READY, MSG_OK, osalDbgAssert, and osalDbgCheck.
|
static |
Reset the thermometer sensivity.
[in] | ip | interface pointer of the BMP085 sensor |
Definition at line 686 of file bmp085.c.
References BMP085_READY, MSG_OK, osalDbgAssert, and osalDbgCheck.
void bmp085ObjectInit | ( | BMP085Driver * | devp | ) |
Initializes an instance.
[out] | devp | pointer to the BMP085Driver object |
Definition at line 722 of file bmp085.c.
References BMP085Driver::vmt_basesensor.
void bmp085Start | ( | BMP085Driver * | devp, |
const BMP085Config * | config | ||
) |
Configures and activates BMP085 Complex Driver peripheral.
[in] | devp | pointer to the BMP085Driver object |
[in] | config | pointer to the BMP085Config object |
Definition at line 739 of file bmp085.c.
References BMP085_AD_CC_AC1_MSB, BMP085_READY, BMP085_STOP, bmp085ReadCoefficient(), I2CDriver::config, i2cAcquireBus(), BMP085Config::i2cp, i2cReleaseBus(), i2cStart(), osalDbgAssert, and osalDbgCheck.
void bmp085Stop | ( | BMP085Driver * | devp | ) |
Deactivates the BMP085 Complex Driver peripheral.
[in] | devp | pointer to the BMP085Driver object |
Definition at line 768 of file bmp085.c.
References BMP085_READY, BMP085_STOP, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), osalDbgAssert, and osalDbgCheck.