Solaris Software
Loading...
Searching...
No Matches
bmp390.h File Reference

BMP390 barometric sensor driver and SPP producer. More...

#include <stdint.h>
#include "spp/core/returnTypes.h"
#include "spp/core/types.h"
#include "spp/hal/gpio/gpio.h"
#include "spp/services/service.h"
Include dependency graph for bmp390.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BMP390_temp_calib_t
 Raw temperature calibration coefficients (as read from sensor). More...
struct  BMP390_temp_params_t
 Scaled temperature calibration parameters. More...
struct  BMP390_press_calib_t
 Raw pressure calibration coefficients. More...
struct  BMP390_press_params_t
 Scaled pressure calibration parameters. More...
struct  BMP390_SpiConfig_t
struct  BMP390_GpioConfig_t
struct  BMP390_t
 BMP390 sensor instance. More...

Macros

#define K_BMP_SERVICE_PAYLOAD_LEN   (12U)
#define K_BMP390_SPI_READ   0x80U
#define K_BMP390_SPI_WRITE   0x00U
#define K_BMP390_PIN_NUM_CS   18U
#define K_BMP390_SPI_BUS_IDX   0U
#define K_BMP390_CHIP_ID_REG   0x00
#define K_BMP390_CHIP_ID_VALUE   0x60
#define K_BMP390_SOFT_RESET_REG   0x7E
#define BMP390_SOFT_RESET_CMD   0xB6
#define K_BMP390_IF_CONF_REG   0x1A
#define BMP390_IF_CONF_SPI   0x00
#define K_BMP390_REG_PWRCTRL   0x1B
#define BMP390_VALUE_PWRCTRL   0x33
#define K_BMP390_REG_OSR   0x1C
#define BMP390_VALUE_OSR   0x00
#define K_BMP390_REG_ODR   0x1D
#define BMP390_VALUE_ODR   0x01
#define K_BMP390_REG_IIR   0x1F
#define BMP390_VALUE_IIR   0x02
#define K_BMP390_REG_STATUS   0x03
#define K_BMP390_STATUS_DRDY_TEMP   0x40
#define BMP390_STATUS_DRDY_PRES   0x20
#define K_BMP390_TEMP_CALIB_REG_START   0x31
#define K_BMP390_TEMP_RAW_REG   0x07
#define K_BMP390_DRDY_TIMEOUT_MS   5000U
#define K_BMP390_PRESS_CALIB_REG_START   0x36
#define K_BMP390_PRESS_RAW_REG   0x04
#define K_BMP390_REG_INT_CTRL   0x19
#define K_BMP390_INT_CTRL_DRDY_EN   0x40
#define K_BMP390_INT_CTRL_LEVEL   0x02
#define K_BMP390_INT_PIN_NUM   3U
#define K_BMP390_INT_INTR_TYPE   1U
#define K_BMP390_INT_PULL   0U

Functions

const SPP_SERVICE_ProducerContract_t * SPP_SERVICES_BMP390_getProducerContract (void)
 Returns the BMP390 producer contract for PUBSUB registration.

Detailed Description

BMP390 barometric sensor driver and SPP producer.

Provides SPI-based pressure, temperature and altitude acquisition using GPIO data-ready interrupts. Sensor data is published through PUBSUB.

Definition in file bmp390.h.

Macro Definition Documentation

◆ K_BMP_SERVICE_PAYLOAD_LEN

#define K_BMP_SERVICE_PAYLOAD_LEN   (12U)

Payload length in bytes (temp + press + alt).

Definition at line 23 of file bmp390.h.

◆ K_BMP390_SPI_READ

#define K_BMP390_SPI_READ   0x80U

◆ K_BMP390_SPI_WRITE

#define K_BMP390_SPI_WRITE   0x00U

◆ K_BMP390_PIN_NUM_CS

#define K_BMP390_PIN_NUM_CS   18U

Chip-select GPIO pin (informational; set by HAL).

Definition at line 28 of file bmp390.h.

◆ K_BMP390_SPI_BUS_IDX

#define K_BMP390_SPI_BUS_IDX   0U

SPI bus index (informational; set by HAL).

Definition at line 29 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_init().

◆ K_BMP390_CHIP_ID_REG

#define K_BMP390_CHIP_ID_REG   0x00

Chip ID register address.

Definition at line 32 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_configCheck().

◆ K_BMP390_CHIP_ID_VALUE

#define K_BMP390_CHIP_ID_VALUE   0x60

Expected chip ID value.

Definition at line 33 of file bmp390.h.

◆ K_BMP390_SOFT_RESET_REG

#define K_BMP390_SOFT_RESET_REG   0x7E

Soft-reset register address.

Definition at line 34 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_configCheck(), and SPP_SERVICES_BMP390_softReset().

◆ BMP390_SOFT_RESET_CMD

#define BMP390_SOFT_RESET_CMD   0xB6

Soft-reset command byte.

Definition at line 35 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_softReset().

◆ K_BMP390_IF_CONF_REG

#define K_BMP390_IF_CONF_REG   0x1A

Interface configuration register address.

Definition at line 36 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_configCheck(), and SPP_SERVICES_BMP390_enableSpiMode().

◆ BMP390_IF_CONF_SPI

#define BMP390_IF_CONF_SPI   0x00

SPI interface mode value.

Definition at line 37 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_enableSpiMode().

◆ K_BMP390_REG_PWRCTRL

#define K_BMP390_REG_PWRCTRL   0x1B

Power control register address.

Definition at line 40 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ BMP390_VALUE_PWRCTRL

#define BMP390_VALUE_PWRCTRL   0x33

Power control value (temp+press on, normal mode).

Definition at line 41 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ K_BMP390_REG_OSR

#define K_BMP390_REG_OSR   0x1C

Oversampling register address.

Definition at line 42 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ BMP390_VALUE_OSR

#define BMP390_VALUE_OSR   0x00

Oversampling value (no oversampling).

Definition at line 43 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ K_BMP390_REG_ODR

#define K_BMP390_REG_ODR   0x1D

Output data rate register address.

Definition at line 44 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ BMP390_VALUE_ODR

#define BMP390_VALUE_ODR   0x01

Output data rate value.

Definition at line 45 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ K_BMP390_REG_IIR

#define K_BMP390_REG_IIR   0x1F

IIR filter register address.

Definition at line 46 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ BMP390_VALUE_IIR

#define BMP390_VALUE_IIR   0x02

IIR filter coefficient value.

Definition at line 47 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_prepareMeasure().

◆ K_BMP390_REG_STATUS

#define K_BMP390_REG_STATUS   0x03

Status register address.

Definition at line 50 of file bmp390.h.

◆ K_BMP390_STATUS_DRDY_TEMP

#define K_BMP390_STATUS_DRDY_TEMP   0x40

Status bit: temperature data ready.

Definition at line 51 of file bmp390.h.

◆ BMP390_STATUS_DRDY_PRES

#define BMP390_STATUS_DRDY_PRES   0x20

Status bit: pressure data ready.

Definition at line 52 of file bmp390.h.

◆ K_BMP390_TEMP_CALIB_REG_START

#define K_BMP390_TEMP_CALIB_REG_START   0x31

Start address of temperature calibration regs.

Definition at line 55 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_readRawTempCoeffs().

◆ K_BMP390_TEMP_RAW_REG

#define K_BMP390_TEMP_RAW_REG   0x07

Start address of raw temperature data regs.

Definition at line 56 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_readRawTemp().

◆ K_BMP390_DRDY_TIMEOUT_MS

#define K_BMP390_DRDY_TIMEOUT_MS   5000U

Timeout in ms for the data-ready interrupt wait.

Definition at line 57 of file bmp390.h.

◆ K_BMP390_PRESS_CALIB_REG_START

#define K_BMP390_PRESS_CALIB_REG_START   0x36

Start address of pressure calibration regs.

Definition at line 60 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_readRawPressCoeffs().

◆ K_BMP390_PRESS_RAW_REG

#define K_BMP390_PRESS_RAW_REG   0x04

Start address of raw pressure data regs.

Definition at line 61 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_readRawPress().

◆ K_BMP390_REG_INT_CTRL

#define K_BMP390_REG_INT_CTRL   0x19

Interrupt control register address.

Definition at line 64 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_intEnableDrdy().

◆ K_BMP390_INT_CTRL_DRDY_EN

#define K_BMP390_INT_CTRL_DRDY_EN   0x40

Interrupt control: enable data-ready interrupt.

Definition at line 65 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_intEnableDrdy().

◆ K_BMP390_INT_CTRL_LEVEL

#define K_BMP390_INT_CTRL_LEVEL   0x02

Interrupt control: active-high level.

Definition at line 66 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_intEnableDrdy().

◆ K_BMP390_INT_PIN_NUM

#define K_BMP390_INT_PIN_NUM   3U

Interrupt GPIO pin

Definition at line 67 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_init().

◆ K_BMP390_INT_INTR_TYPE

#define K_BMP390_INT_INTR_TYPE   1U

Interrupt trigger type (1=rising).

Definition at line 68 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_init().

◆ K_BMP390_INT_PULL

#define K_BMP390_INT_PULL   0U

Pull resistor: 0=none 1=up 2=down.

Definition at line 69 of file bmp390.h.

Referenced by SPP_SERVICES_BMP390_init().

Function Documentation

◆ SPP_SERVICES_BMP390_getProducerContract()

const SPP_SERVICE_ProducerContract_t * SPP_SERVICES_BMP390_getProducerContract ( void )

Returns the BMP390 producer contract for PUBSUB registration.

Returns
Pointer to the static producer contract.

Definition at line 101 of file bmp390.c.

References g_bmp390ProducerContract, and SPP_SERVICES_BMP390_getProducerContract().

Referenced by CUSTOM_registerConsumerProducer(), guard_startInitializationOfModules(), and SPP_SERVICES_BMP390_getProducerContract().

Here is the call graph for this function:
Here is the caller graph for this function: