barometer6 2.0.0.0
barometer6.h File Reference

This file contains API for Barometer 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  barometer6_s
 Barometer 6 Click context object. More...
 
struct  barometer6_cfg_t
 Barometer 6 Click configuration object. More...
 

Macros

#define BAROMETER6_TEMP_TXD0   0xFC
 Barometer 6 description register.
 
#define BAROMETER6_TEMP_TXD1   0xFB
 
#define BAROMETER6_TEMP_TXD2   0xFA
 
#define BAROMETER6_PRESS_TXD0   0xF9
 
#define BAROMETER6_PRESS_TXD1   0xF8
 
#define BAROMETER6_PRESS_TXD2   0xF7
 
#define BAROMETER6_IO_SETUP   0xF5
 
#define BAROMETER6_CTRL_MESS   0xF4
 
#define BAROMETER6_DEVICE_STAT   0xF3
 
#define BAROMETER6_I2C_SET   0xF2
 
#define BAROMETER6_IIR_CNT   0XF1
 
#define BAROMETER6_RESET   0XE0
 
#define BAROMETER6_CHIP_ID   0XD1
 
#define BAROMETER6_COE_B00_A0_EX   0XB8
 
#define BAROMETER6_COE_A2_0   0XB7
 
#define BAROMETER6_COE_A2_1   0XB6
 
#define BAROMETER6_COE_A1_0   0XB5
 
#define BAROMETER6_COE_A1_1   0XB4
 
#define BAROMETER6_COE_A0_0   0XB3
 
#define BAROMETER6_COE_A0_1   0XB2
 
#define BAROMETER6_COE_BP3_0   0XB1
 
#define BAROMETER6_COE_BP3_1   0XB0
 
#define BAROMETER6_COE_B21_0   0XAF
 
#define BAROMETER6_COE_B21_1   0XAE
 
#define BAROMETER6_COE_B12_0   0XAD
 
#define BAROMETER6_COE_B12_1   0XAC
 
#define BAROMETER6_COE_BP2_0   0XAB
 
#define BAROMETER6_COE_BP2_1   0XAA
 
#define BAROMETER6_COE_B11_0   0XA9
 
#define BAROMETER6_COE_B11_1   0XA8
 
#define BAROMETER6_COE_BP1_0   0XA7
 
#define BAROMETER6_COE_BP1_1   0XA6
 
#define BAROMETER6_COE_BT2_0   0XA5
 
#define BAROMETER6_COE_BT2_1   0XA4
 
#define BAROMETER6_COE_BT1_0   0XA3
 
#define BAROMETER6_COE_BT1_1   0XA2
 
#define BAROMETER6_COE_B00_0   0XA1
 
#define BAROMETER6_COE_B00_1   0XA0
 
#define BAROMETER6_CMD_RESET   0xE6
 Barometer 6 description setting.
 
#define BAROMETER6_AVG_SKIP   0x00
 Barometer 6 average time for measurments.
 
#define BAROMETER6_AVG_1   0x01
 
#define BAROMETER6_AVG_2   0x02
 
#define BAROMETER6_AVG_4   0x03
 
#define BAROMETER6_AVG_8   0x04
 
#define BAROMETER6_AVG_16   0x05
 
#define BAROMETER6_AVG_32   0x06
 
#define BAROMETER6_AVG_64   0x07
 
#define BAROMETER6_SLEEP_MODE   0x00
 Barometer 6 operating mode.
 
#define BAROMETER6_FORCED_MODE_1   0x01
 
#define BAROMETER6_FORCED_MODE_2   0x02
 
#define BAROMETER6_NORMAL_MODE   0x03
 
#define BAROMETER6_DATA_NOT_READY   0x00
 Barometer 6 data ready oprions.
 
#define BAROMETER6_DATA_READY   0x01
 
#define BAROMETER6_STANDBY_1ms   0x00
 Barometer 6 standby time.
 
#define BAROMETER6_STANDBY_5ms   0x01
 
#define BAROMETER6_STANDBY_50ms   0x02
 
#define BAROMETER6_STANDBY_250ms   0x03
 
#define BAROMETER6_STANDBY_500ms   0x04
 
#define BAROMETER6_STANDBY_1s   0x05
 
#define BAROMETER6_STANDBY_2s   0x06
 
#define BAROMETER6_STANDBY_4s   0x07
 
#define BAROMETER6_ID_VALUE   0x5C
 Barometer 6 ID register value.
 
#define BAROMETER6_SET_DEV_ADDR_LOW   0x70
 Barometer 6 device address setting.
 
#define BAROMETER6_SET_DEV_ADDR_HIGH   0x56
 
#define BAROMETER6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define BAROMETER6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define BAROMETER6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* barometer6_master_io_t) (struct barometer6_s *, uint8_t, uint8_t *, uint8_t)
 Barometer 6 Click driver interface.
 
typedef struct barometer6_s barometer6_t
 Barometer 6 Click context object.
 

Enumerations

enum  barometer6_drv_t { BAROMETER6_DRV_SEL_SPI , BAROMETER6_DRV_SEL_I2C }
 Barometer 6 Click driver selector. More...
 
enum  barometer6_return_value_t { BAROMETER6_OK = 0 , BAROMETER6_ERROR = -1 }
 Barometer 6 Click return value data. More...
 

Functions

void barometer6_cfg_setup (barometer6_cfg_t *cfg)
 Barometer 6 configuration object setup function.
 
void barometer6_drv_interface_selection (barometer6_cfg_t *cfg, barometer6_drv_t drv_sel)
 Barometer 6 driver interface setup function.
 
err_t barometer6_init (barometer6_t *ctx, barometer6_cfg_t *cfg)
 Barometer 6 initialization function.
 
void barometer6_default_cfg (barometer6_t *ctx)
 Barometer 6 default configuration function.
 
err_t barometer6_generic_write (barometer6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Barometer 6 data writing function.
 
err_t barometer6_generic_read (barometer6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Barometer 6 data reading function.
 
void barometer6_write_register (barometer6_t *ctx, uint8_t reg, uint8_t data_in)
 Barometer 6 data writing function.
 
void barometer6_read_register (barometer6_t *ctx, uint8_t reg, uint16_t *data_out)
 Barometer 6 data reading function.
 
void barometer6_read_id (barometer6_t *ctx, uint8_t *data_out)
 Barometer 6 Id reading function.
 
void barometer6_software_reset (barometer6_t *ctx)
 Barometer 6 software reset function.
 
void barometer6_hardware_reset (barometer6_t *ctx)
 Barometer 6 hardware reset function.
 
void barometer6_set_avrege (barometer6_t *ctx, uint8_t temp_avg, uint8_t pressure_avg)
 Barometer 6 set average data function.
 
void barometer6_set_mode (barometer6_t *ctx, uint8_t mode)
 Barometer 6 set operation mode function.
 
void barometer6_set_standby_time (barometer6_t *ctx, uint8_t t_standby)
 Barometer 6 set standby time function.
 
uint8_t barometer6_check_ready (barometer6_t *ctx)
 Barometer 6 check if data is ready function.
 
void barometer6_read_raw_temp (barometer6_t *ctx, int32_t *data_out)
 Barometer 6 read raw temperature function.
 
void barometer6_read_raw_pressure (barometer6_t *ctx, float *data_out)
 Barometer 6 read raw pressure function.
 
void barometer6_read_conp_coef (barometer6_t *ctx, uint8_t reg, int16_t *data_out)
 Barometer 6 read conpensation coefficients data function.
 
void barometer6_get_conp_coef (barometer6_t *ctx, uint8_t reg, float a_coef, float s_coef, float *data_out)
 Barometer 6 calculate conpensation coefficients data function.
 
void barometer6_get_a0_b00_coef (barometer6_t *ctx, float *coef_a0, float *coef_b00)
 Barometer 6 calculate a0 and b00 conpensation coefficients data function.
 
void barometer6_get_conpesation_coe (barometer6_t *ctx)
 Barometer 6 get all conpensation coefficients data function.
 
void barometer6_get_temperature_data (barometer6_t *ctx, float *temp_out)
 Barometer 6 get temperature data function.
 
void barometer6_read_temperature_value (barometer6_t *ctx, float *temp_out)
 Barometer 6 get temperature value function.
 
void barometer6_read_preassure_data (barometer6_t *ctx, float *press_out)
 Barometer 6 get preassure data function.
 
void barometer6_read_preassure_value (barometer6_t *ctx, float *press_out)
 Barometer 6 get preassure mBar function.
 

Detailed Description

This file contains API for Barometer 6 Click Driver.

Typedef Documentation

◆ barometer6_master_io_t

typedef err_t(* barometer6_master_io_t) (struct barometer6_s *, uint8_t, uint8_t *, uint8_t)

Barometer 6 Click driver interface.

Definition of driver interface of Barometer 6 Click driver. Driver serial interface.

◆ barometer6_t

typedef struct barometer6_s barometer6_t

Barometer 6 Click context object.

Context object definition of Barometer 6 Click driver.

Enumeration Type Documentation

◆ barometer6_drv_t

Barometer 6 Click driver selector.

Selects target driver interface of Barometer 6 Click driver.

Enumerator
BAROMETER6_DRV_SEL_SPI 

SPI driver descriptor.

BAROMETER6_DRV_SEL_I2C 

I2C driver descriptor.

◆ barometer6_return_value_t

Barometer 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
BAROMETER6_OK 
BAROMETER6_ERROR