LibDriver BMP390
Loading...
Searching...
No Matches
driver_bmp390.h File Reference

driver bmp390 header file More...

#include <stdint.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for driver_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_frame_s
 bmp390 frame structure definition More...
struct  bmp390_handle_s
 bmp390 handle structure definition More...
struct  bmp390_info_s
 bmp390 information structure definition More...

Macros

#define DRIVER_BMP390_LINK_INIT(HANDLE, STRUCTURE)
 initialize bmp390_handle_t structure
#define DRIVER_BMP390_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_BMP390_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_BMP390_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_BMP390_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_BMP390_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_BMP390_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_BMP390_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_BMP390_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_BMP390_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_BMP390_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_BMP390_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

Typedefs

typedef struct bmp390_frame_s bmp390_frame_t
 bmp390 frame structure definition
typedef struct bmp390_handle_s bmp390_handle_t
 bmp390 handle structure definition
typedef struct bmp390_info_s bmp390_info_t
 bmp390 information structure definition

Enumerations

enum  bmp390_interface_t { BMP390_INTERFACE_IIC = 0x00 , BMP390_INTERFACE_SPI = 0x01 }
 bmp390 interface enumeration definition More...
enum  bmp390_address_t { BMP390_ADDRESS_ADO_LOW = (0x76 << 1) , BMP390_ADDRESS_ADO_HIGH = (0x77 << 1) }
 bmp390 address enumeration definition More...
enum  bmp390_bool_t { BMP390_BOOL_FALSE = 0x00 , BMP390_BOOL_TRUE = 0x01 }
 bmp390 bool enumeration definition More...
enum  bmp390_error_t { BMP390_ERROR_FATAL = (1 << 0) , BMP390_ERROR_CMD = (1 << 1) , BMP390_ERROR_CONF = (1 << 2) }
 bmp390 error enumeration definition More...
enum  bmp390_status_t { BMP390_STATUS_COMMAND_READY = (1 << 4) , BMP390_STATUS_PRESS_READY = (1 << 5) , BMP390_STATUS_TEMP_READY = (1 << 6) }
 bmp390 status enumeration definition More...
enum  bmp390_event_t { BMP390_EVENT_NONE = (0 << 0) , BMP390_EVENT_POWER_UP_OR_SOFTRESET = (1 << 0) , BMP390_EVENT_ITF_ACT_PT = (1 << 1) , BMP390_EVENT_BOTH = (3 << 0) }
 bmp390 event enumeration definition More...
enum  bmp390_fifo_data_source_t { BMP390_FIFO_DATA_SOURCE_UNFILTERED = 0 , BMP390_FIFO_DATA_SOURCE_FILTERED = 1 }
 bmp390 fifo data source enumeration definition More...
enum  bmp390_interrupt_status_t { BMP390_INTERRUPT_STATUS_FIFO_WATERMARK = (1 << 0) , BMP390_INTERRUPT_STATUS_FIFO_FULL = (1 << 1) , BMP390_INTERRUPT_STATUS_DATA_READY = (1 << 3) }
 bmp390 interrupt status enumeration definition More...
enum  bmp390_interrupt_active_level_t { BMP390_INTERRUPT_ACTIVE_LEVEL_LOWER = 0x00 , BMP390_INTERRUPT_ACTIVE_LEVEL_HIGHER = 0x01 }
 bmp390 interrupt active level enumeration definition More...
enum  bmp390_interrupt_pin_type_t { BMP390_INTERRUPT_PIN_TYPE_PUSH_PULL = 0x00 , BMP390_INTERRUPT_PIN_TYPE_OPEN_DRAIN = 0x01 }
 bmp390 interrupt pin type enumeration definition More...
enum  bmp390_spi_wire_t { BMP390_SPI_WIRE_4 = 0x00 , BMP390_SPI_WIRE_3 = 0x01 }
 bmp390 spi wire enumeration definition More...
enum  bmp390_iic_watchdog_period_t { BMP390_IIC_WATCHDOG_PERIOD_1P25_MS = 0x00 , BMP390_IIC_WATCHDOG_PERIOD_40_MS = 0x01 }
 bmp390 iic watchdog period enumeration definition More...
enum  bmp390_mode_t { BMP390_MODE_SLEEP_MODE = 0x00 , BMP390_MODE_FORCED_MODE = 0x01 , BMP390_MODE_NORMAL_MODE = 0x03 }
 bmp390 mode enumeration definition More...
enum  bmp390_oversampling_t {
  BMP390_OVERSAMPLING_x1 = 0x00 , BMP390_OVERSAMPLING_x2 = 0x01 , BMP390_OVERSAMPLING_x4 = 0x02 , BMP390_OVERSAMPLING_x8 = 0x03 ,
  BMP390_OVERSAMPLING_x16 = 0x04 , BMP390_OVERSAMPLING_x32 = 0x05
}
 bmp390 oversampling enumeration definition More...
enum  bmp390_odr_t {
  BMP390_ODR_200_HZ = 0x00 , BMP390_ODR_100_HZ = 0x01 , BMP390_ODR_50_HZ = 0x02 , BMP390_ODR_25_HZ = 0x03 ,
  BMP390_ODR_12P5_HZ = 0x04 , BMP390_ODR_6P25_HZ = 0x05 , BMP390_ODR_3P1_HZ = 0x06 , BMP390_ODR_1P5_HZ = 0x07 ,
  BMP390_ODR_0P78_HZ = 0x08 , BMP390_ODR_0P39_HZ = 0x09 , BMP390_ODR_0P2_HZ = 0x0A , BMP390_ODR_0P1_HZ = 0x0B ,
  BMP390_ODR_0P05_HZ = 0x0C , BMP390_ODR_0P02_HZ = 0x0D , BMP390_ODR_0P01_HZ = 0x0E , BMP390_ODR_0P006_HZ = 0x0F ,
  BMP390_ODR_0P003_HZ = 0x10 , BMP390_ODR_0P0015_HZ = 0x11
}
 bmp390 output data rate enumeration definition More...
enum  bmp390_filter_coefficient_t {
  BMP390_FILTER_COEFFICIENT_0 = 0x00 , BMP390_FILTER_COEFFICIENT_1 = 0x01 , BMP390_FILTER_COEFFICIENT_3 = 0x02 , BMP390_FILTER_COEFFICIENT_7 = 0x03 ,
  BMP390_FILTER_COEFFICIENT_15 = 0x04 , BMP390_FILTER_COEFFICIENT_31 = 0x05 , BMP390_FILTER_COEFFICIENT_63 = 0x06 , BMP390_FILTER_COEFFICIENT_127 = 0x07
}
 bmp390 filter coefficient enumeration definition More...
enum  bmp390_frame_type_t { BMP390_FRAME_TYPE_TEMPERATURE = 0x01 , BMP390_FRAME_TYPE_PRESSURE = 0x02 , BMP390_FRAME_TYPE_SENSORTIME = 0x03 }
 bmp390 frame type enumeration definition More...

Functions

uint8_t bmp390_info (bmp390_info_t *info)
 get chip's information
uint8_t bmp390_set_addr_pin (bmp390_handle_t *handle, bmp390_address_t addr_pin)
 set the iic address pin
uint8_t bmp390_get_addr_pin (bmp390_handle_t *handle, bmp390_address_t *addr_pin)
 get the iic address pin
uint8_t bmp390_set_interface (bmp390_handle_t *handle, bmp390_interface_t interface)
 set the interface
uint8_t bmp390_get_interface (bmp390_handle_t *handle, bmp390_interface_t *interface)
 get the interface
uint8_t bmp390_irq_handler (bmp390_handle_t *handle)
 irq handler
uint8_t bmp390_init (bmp390_handle_t *handle)
 initialize the chip
uint8_t bmp390_deinit (bmp390_handle_t *handle)
 close the chip
uint8_t bmp390_read_temperature_pressure (bmp390_handle_t *handle, uint32_t *temperature_raw, float *temperature_c, uint32_t *pressure_raw, float *pressure_pa)
 read the temperature and pressure
uint8_t bmp390_read_temperature (bmp390_handle_t *handle, uint32_t *raw, float *c)
 read the temperature
uint8_t bmp390_read_pressure (bmp390_handle_t *handle, uint32_t *raw, float *pa)
 read the pressure
uint8_t bmp390_get_revision_id (bmp390_handle_t *handle, uint8_t *id)
 get the revision id
uint8_t bmp390_get_error (bmp390_handle_t *handle, uint8_t *err)
 get the error
uint8_t bmp390_get_status (bmp390_handle_t *handle, uint8_t *status)
 get the status
uint8_t bmp390_get_sensortime (bmp390_handle_t *handle, uint32_t *t)
 get the sensor time
uint8_t bmp390_get_event (bmp390_handle_t *handle, bmp390_event_t *event)
 get the event
uint8_t bmp390_set_spi_wire (bmp390_handle_t *handle, bmp390_spi_wire_t wire)
 set the spi wire
uint8_t bmp390_get_spi_wire (bmp390_handle_t *handle, bmp390_spi_wire_t *wire)
 get the spi wire
uint8_t bmp390_set_iic_watchdog_timer (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the iic watchdog timer
uint8_t bmp390_get_iic_watchdog_timer (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the iic watchdog timer status
uint8_t bmp390_set_iic_watchdog_period (bmp390_handle_t *handle, bmp390_iic_watchdog_period_t period)
 set the iic watchdog period
uint8_t bmp390_get_iic_watchdog_period (bmp390_handle_t *handle, bmp390_iic_watchdog_period_t *period)
 get the iic watchdog period
uint8_t bmp390_set_pressure (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the pressure
uint8_t bmp390_get_pressure (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the pressure status
uint8_t bmp390_set_temperature (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the temperature
uint8_t bmp390_get_temperature (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the temperature status
uint8_t bmp390_set_mode (bmp390_handle_t *handle, bmp390_mode_t mode)
 set the chip mode
uint8_t bmp390_get_mode (bmp390_handle_t *handle, bmp390_mode_t *mode)
 get the chip mode
uint8_t bmp390_set_pressure_oversampling (bmp390_handle_t *handle, bmp390_oversampling_t oversampling)
 set the pressure oversampling
uint8_t bmp390_get_pressure_oversampling (bmp390_handle_t *handle, bmp390_oversampling_t *oversampling)
 get the pressure oversampling
uint8_t bmp390_set_temperature_oversampling (bmp390_handle_t *handle, bmp390_oversampling_t oversampling)
 set the temperature oversampling
uint8_t bmp390_get_temperature_oversampling (bmp390_handle_t *handle, bmp390_oversampling_t *oversampling)
 get the temperature oversampling
uint8_t bmp390_set_odr (bmp390_handle_t *handle, bmp390_odr_t odr)
 set the output data rate
uint8_t bmp390_get_odr (bmp390_handle_t *handle, bmp390_odr_t *odr)
 get the output data rate
uint8_t bmp390_set_filter_coefficient (bmp390_handle_t *handle, bmp390_filter_coefficient_t coefficient)
 set the filter coefficient
uint8_t bmp390_get_filter_coefficient (bmp390_handle_t *handle, bmp390_filter_coefficient_t *coefficient)
 get the filter coefficient
uint8_t bmp390_softreset (bmp390_handle_t *handle)
 soft reset
uint8_t bmp390_get_interrupt_status (bmp390_handle_t *handle, uint8_t *status)
 get the interrupt status
uint8_t bmp390_set_interrupt_pin_type (bmp390_handle_t *handle, bmp390_interrupt_pin_type_t pin_type)
 set the interrupt pin type
uint8_t bmp390_get_interrupt_pin_type (bmp390_handle_t *handle, bmp390_interrupt_pin_type_t *pin_type)
 get the interrupt pin type
uint8_t bmp390_set_interrupt_active_level (bmp390_handle_t *handle, bmp390_interrupt_active_level_t level)
 set the interrupt active level
uint8_t bmp390_get_interrupt_active_level (bmp390_handle_t *handle, bmp390_interrupt_active_level_t *level)
 get the interrupt active level
uint8_t bmp390_set_latch_interrupt_pin_and_interrupt_status (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable latching interrupt pin and interrupt status
uint8_t bmp390_get_latch_interrupt_pin_and_interrupt_status (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get latching interrupt pin and interrupt status
uint8_t bmp390_set_interrupt_fifo_watermark (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo watermark interrupt
uint8_t bmp390_get_interrupt_fifo_watermark (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the interrupt fifo watermark
uint8_t bmp390_set_interrupt_fifo_full (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo full interrupt
uint8_t bmp390_get_interrupt_fifo_full (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the interrupt fifo full
uint8_t bmp390_set_interrupt_data_ready (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the data ready interrupt
uint8_t bmp390_get_interrupt_data_ready (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the interrupt data ready status
uint8_t bmp390_get_fifo_length (bmp390_handle_t *handle, uint16_t *length)
 get the fifo length
uint8_t bmp390_get_fifo_data (bmp390_handle_t *handle, uint8_t *data, uint16_t length)
 get the fifo data
uint8_t bmp390_set_fifo_watermark (bmp390_handle_t *handle, uint16_t watermark)
 set the fifo watermark
uint8_t bmp390_get_fifo_watermark (bmp390_handle_t *handle, uint16_t *watermark)
 get the fifo watermark
uint8_t bmp390_set_fifo (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo
uint8_t bmp390_get_fifo (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the fifo status
uint8_t bmp390_set_fifo_stop_on_full (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo stopping on full
uint8_t bmp390_get_fifo_stop_on_full (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the fifo stopping on full status
uint8_t bmp390_set_fifo_sensortime_on (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo sensor time on
uint8_t bmp390_get_fifo_sensortime_on (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the fifo sensor time on status
uint8_t bmp390_set_fifo_pressure_on (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo pressure on
uint8_t bmp390_get_fifo_pressure_on (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the fifo pressure on status
uint8_t bmp390_set_fifo_temperature_on (bmp390_handle_t *handle, bmp390_bool_t enable)
 enable or disable the fifo temperature on
uint8_t bmp390_get_fifo_temperature_on (bmp390_handle_t *handle, bmp390_bool_t *enable)
 get the fifo temperature on status
uint8_t bmp390_set_fifo_subsampling (bmp390_handle_t *handle, uint8_t subsample)
 set the fifo subsampling
uint8_t bmp390_get_fifo_subsampling (bmp390_handle_t *handle, uint8_t *subsample)
 get the fifo subsampling
uint8_t bmp390_set_fifo_data_source (bmp390_handle_t *handle, bmp390_fifo_data_source_t source)
 set the fifo data source
uint8_t bmp390_get_fifo_data_source (bmp390_handle_t *handle, bmp390_fifo_data_source_t *source)
 get the fifo data source
uint8_t bmp390_flush_fifo (bmp390_handle_t *handle)
 flush the fifo
uint8_t bmp390_read_fifo (bmp390_handle_t *handle, uint8_t *buf, uint16_t *len)
 read the fifo
uint8_t bmp390_fifo_parse (bmp390_handle_t *handle, uint8_t *buf, uint16_t buf_len, bmp390_frame_t *frame, uint16_t *frame_len)
 parse the fifo data
uint8_t bmp390_set_reg (bmp390_handle_t *handle, uint8_t reg, uint8_t value)
 set the chip register
uint8_t bmp390_get_reg (bmp390_handle_t *handle, uint8_t reg, uint8_t *value)
 get the chip register

Detailed Description

driver bmp390 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2022-05-15

history

Date Version Author Description
2022/05/15 1.0 Shifeng Li first upload

Definition in file driver_bmp390.h.