barometer 2.0.0.0
barometer.h File Reference

This file contains API for Barometer Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  barometer_s
 Click ctx object definition. More...
 
struct  barometer_cfg_t
 Click configuration structure definition. More...
 

Macros

#define BAROMETER_MAP_MIKROBUS(cfg, mikrobus)
 
#define BAROMETER_MASTER_I2C   0
 
#define BAROMETER_MASTER_SPI   1
 
#define BAROMETER_RETVAL   uint8_t
 
#define BAROMETER_OK   0x00
 
#define BAROMETER_INIT_ERROR   0xFF
 
#define BAROMETER_I2C_ADDRESS_0   0x5C
 
#define BAROMETER_I2C_ADDRESS_1   0x5D
 
#define BAROMETER_REF_P_XL   0x08
 
#define BAROMETER_REF_P_L   0x09
 
#define BAROMETER_REF_P_H   0x0A
 
#define BAROMETER_WHO_AM_I   0x0F
 
#define BAROMETER_RES_CONF   0x10
 
#define BAROMETER_CTRL_REG1   0x20
 
#define BAROMETER_CTRL_REG2   0x21
 
#define BAROMETER_CTRL_REG3   0x22
 
#define BAROMETER_CTRL_REG4   0x23
 
#define BAROMETER_INTERRUPT_CFG   0x24
 
#define BAROMETER_INT_SOURCE   0x25
 
#define BAROMETER_STATUS_REG   0x27
 
#define BAROMETER_PRESS_OUT_XL   0x28
 
#define BAROMETER_PRESS_OUT_L   0x29
 
#define BAROMETER_PRESS_OUT_H   0x2A
 
#define BAROMETER_TEMP_OUT_L   0x2B
 
#define BAROMETER_TEMP_OUT_H   0x2C
 
#define BAROMETER_FIFO_CTRL   0x2E
 
#define BAROMETER_FIFO_STATUS   0x2F
 
#define BAROMETER_THS_P_L   0x30
 
#define BAROMETER_THS_P_H   0x31
 
#define BAROMETER_RPDS_L   0x39
 
#define BAROMETER_RPDS_H   0x3A
 
#define BAROMETER_DEVICE_ID   0xBD
 
#define BAROMETER_DEFAULT_CONFIG   0xB0
 
#define BAROMETER_CONFIG_ACTIVE_MODE   0x80
 

Typedefs

typedef uint8_t barometer_select_t
 Communication type.
 
typedef void(* barometer_master_io_t) (struct barometer_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct barometer_s barometer_t
 Click ctx object definition.
 

Functions

void barometer_cfg_setup (barometer_cfg_t *cfg)
 Config Object Initialization function.
 
BAROMETER_RETVAL barometer_init (barometer_t *ctx, barometer_cfg_t *cfg)
 Initialization function.
 
void barometer_default_cfg (barometer_t *ctx)
 Click Default Configuration function.
 
void barometer_generic_write (barometer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void barometer_generic_read (barometer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t barometer_read_data (barometer_t *ctx, uint8_t address)
 Generic read 8-bit data function.
 
void barometer_set_active (barometer_t *ctx)
 Sets the module active function.
 
float barometer_get_temperature_c (barometer_t *ctx)
 Read temperature in degrees Celsius function.
 
float barometer_get_temperature_f (barometer_t *ctx)
 Read temperature in degrees of Fahrenheit function.
 
float barometer_get_pressure (barometer_t *ctx)
 Read pressure in milibars function.
 
uint8_t barometer_check_id (barometer_t *ctx)
 Check sensor id - Who Am I function.
 
uint8_t barometer_check_status (barometer_t *ctx)
 Check sensor status function.
 
uint8_t barometer_check_interrupt (barometer_t *ctx)
 State of interrupt pin function.
 

Detailed Description

This file contains API for Barometer Click driver.