LibDriver BMP280
Loading...
Searching...
No Matches
driver_bmp280.h File Reference

driver bmp280 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_bmp280.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bmp280_handle_s
 bmp280 handle structure definition More...
struct  bmp280_info_s
 bmp280 information structure definition More...

Macros

#define DRIVER_BMP280_LINK_INIT(HANDLE, STRUCTURE)
 initialize bmp280_handle_t structure
#define DRIVER_BMP280_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_BMP280_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_BMP280_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_BMP280_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_BMP280_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_BMP280_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_BMP280_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_BMP280_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_BMP280_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_BMP280_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct bmp280_handle_s bmp280_handle_t
 bmp280 handle structure definition
typedef struct bmp280_info_s bmp280_info_t
 bmp280 information structure definition

Enumerations

enum  bmp280_interface_t { BMP280_INTERFACE_IIC = 0x00 , BMP280_INTERFACE_SPI = 0x01 }
 bmp280 interface enumeration definition More...
enum  bmp280_address_t { BMP280_ADDRESS_ADO_LOW = (0x76 << 1) , BMP280_ADDRESS_ADO_HIGH = (0x77 << 1) }
 bmp280 address enumeration definition More...
enum  bmp280_status_t { BMP280_STATUS_MEASURING = (1 << 3) , BMP280_STATUS_IM_UPDATE = (1 << 0) }
 bmp280 status enumeration definition More...
enum  bmp280_oversampling_t {
  BMP280_OVERSAMPLING_SKIP = 0x00 , BMP280_OVERSAMPLING_x1 = 0x01 , BMP280_OVERSAMPLING_x2 = 0x02 , BMP280_OVERSAMPLING_x4 = 0x03 ,
  BMP280_OVERSAMPLING_x8 = 0x04 , BMP280_OVERSAMPLING_x16 = 0x05
}
 bmp280 oversampling enumeration definition More...
enum  bmp280_mode_t { BMP280_MODE_SLEEP = 0x00 , BMP280_MODE_FORCED = 0x01 , BMP280_MODE_NORMAL = 0x03 }
 bmp280 mode enumeration definition More...
enum  bmp280_standby_time_t {
  BMP280_STANDBY_TIME_0P5_MS = 0x00 , BMP280_STANDBY_TIME_62P5_MS = 0x01 , BMP280_STANDBY_TIME_125_MS = 0x02 , BMP280_STANDBY_TIME_250_MS = 0x03 ,
  BMP280_STANDBY_TIME_500_MS = 0x04 , BMP280_STANDBY_TIME_1000_MS = 0x05 , BMP280_STANDBY_TIME_2000_MS = 0x06 , BMP280_STANDBY_TIME_4000_MS = 0x07
}
 bmp280 standby time enumeration definition More...
enum  bmp280_filter_t {
  BMP280_FILTER_OFF = 0x00 , BMP280_FILTER_COEFF_2 = 0x01 , BMP280_FILTER_COEFF_4 = 0x02 , BMP280_FILTER_COEFF_8 = 0x03 ,
  BMP280_FILTER_COEFF_16 = 0x04
}
 bmp280 filter enumeration definition More...
enum  bmp280_spi_wire_t { BMP280_SPI_WIRE_4 = 0x00 , BMP280_SPI_WIRE_3 = 0x01 }
 bmp280 spi wire enumeration definition More...

Functions

uint8_t bmp280_info (bmp280_info_t *info)
 get chip's information
uint8_t bmp280_set_interface (bmp280_handle_t *handle, bmp280_interface_t interface)
 set the interface
uint8_t bmp280_get_interface (bmp280_handle_t *handle, bmp280_interface_t *interface)
 get the interface
uint8_t bmp280_set_addr_pin (bmp280_handle_t *handle, bmp280_address_t addr_pin)
 set the iic address pin
uint8_t bmp280_get_addr_pin (bmp280_handle_t *handle, bmp280_address_t *addr_pin)
 get the iic address pin
uint8_t bmp280_init (bmp280_handle_t *handle)
 initialize the chip
uint8_t bmp280_deinit (bmp280_handle_t *handle)
 close the chip
uint8_t bmp280_read_temperature_pressure (bmp280_handle_t *handle, uint32_t *temperature_raw, float *temperature_c, uint32_t *pressure_raw, float *pressure_pa)
 read the temperature and pressure data
uint8_t bmp280_read_pressure (bmp280_handle_t *handle, uint32_t *pressure_raw, float *pressure_pa)
 read the pressure data
uint8_t bmp280_read_temperature (bmp280_handle_t *handle, uint32_t *temperature_raw, float *temperature_c)
 read the temperature data
uint8_t bmp280_soft_reset (bmp280_handle_t *handle)
 soft reset
uint8_t bmp280_get_status (bmp280_handle_t *handle, uint8_t *status)
 get status
uint8_t bmp280_set_temperatue_oversampling (bmp280_handle_t *handle, bmp280_oversampling_t oversampling)
 set temperatue oversampling
uint8_t bmp280_get_temperatue_oversampling (bmp280_handle_t *handle, bmp280_oversampling_t *oversampling)
 get temperatue oversampling
uint8_t bmp280_set_pressure_oversampling (bmp280_handle_t *handle, bmp280_oversampling_t oversampling)
 set pressure oversampling
uint8_t bmp280_get_pressure_oversampling (bmp280_handle_t *handle, bmp280_oversampling_t *oversampling)
 get pressure oversampling
uint8_t bmp280_set_mode (bmp280_handle_t *handle, bmp280_mode_t mode)
 set mode
uint8_t bmp280_get_mode (bmp280_handle_t *handle, bmp280_mode_t *mode)
 get mode
uint8_t bmp280_set_standby_time (bmp280_handle_t *handle, bmp280_standby_time_t standby_time)
 set standby time
uint8_t bmp280_get_standby_time (bmp280_handle_t *handle, bmp280_standby_time_t *standby_time)
 get standby time
uint8_t bmp280_set_filter (bmp280_handle_t *handle, bmp280_filter_t filter)
 set filter
uint8_t bmp280_get_filter (bmp280_handle_t *handle, bmp280_filter_t *filter)
 get filter
uint8_t bmp280_set_spi_wire (bmp280_handle_t *handle, bmp280_spi_wire_t spi)
 set spi wire
uint8_t bmp280_get_spi_wire (bmp280_handle_t *handle, bmp280_spi_wire_t *spi)
 get spi wire
uint8_t bmp280_set_reg (bmp280_handle_t *handle, uint8_t reg, uint8_t value)
 set the chip register
uint8_t bmp280_get_reg (bmp280_handle_t *handle, uint8_t reg, uint8_t *value)
 get the chip register

Detailed Description

driver bmp280 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
2024-01-15

history

Date Version Author Description
2024/01/15 1.0 Shifeng Li first upload

Definition in file driver_bmp280.h.