altitude2 2.0.0.0
altitude2.h File Reference

This file contains API for Altitude 2 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  altitude2_s
 Click ctx object definition. More...
 
struct  altitude2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ALTITUDE2_MAP_MIKROBUS(cfg, mikrobus)
 
#define ALTITUDE2_MASTER_I2C   0
 
#define ALTITUDE2_MASTER_SPI   1
 
#define ALTITUDE2_OK   0
 
#define ALTITUDE2_ERROR   -1
 
#define ALTITUDE2_DEVICE_ADDR_0   0x76
 
#define ALTITUDE2_DEVICE_ADDR_1   0x77
 
#define ALTITUDE2_RATIO_256   0x00
 
#define ALTITUDE2_RATIO_512   0x01
 
#define ALTITUDE2_RATIO_1024   0x02
 
#define ALTITUDE2_RATIO_2048   0x03
 
#define ALTITUDE2_RATIO_4096   0x04
 
#define ALTITUDE2_MANUFACTURER_RESERVED   0x00
 
#define ALTITUDE2_C1_SENS   0x01
 
#define ALTITUDE2_C2_OFF   0x02
 
#define ALTITUDE2_C3_TCS   0x03
 
#define ALTITUDE2_C4_TCO   0x04
 
#define ALTITUDE2_C5_TREF   0x05
 
#define ALTITUDE2_C6_TEMPSENS   0x06
 
#define ALTITUDE2_CRC   0x07
 

Typedefs

typedef uint8_t altitude2_select_t
 Communication type.
 
typedef void(* altitude2_master_in_t) (struct altitude2_s *, uint8_t)
 Master Input/Output type.
 
typedef void(* altitude2_master_out_t) (struct altitude2_s *, uint8_t, uint8_t *, uint8_t)
 
typedef struct altitude2_s altitude2_t
 Click ctx object definition.
 

Functions

void altitude2_cfg_setup (altitude2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t altitude2_init (altitude2_t *ctx, altitude2_cfg_t *cfg)
 Initialization function.
 
uint8_t altitude2_read_prom (altitude2_t *ctx, uint8_t select_data, uint16_t *data_out)
 Calibration data read function.
 
void altitude2_reset (altitude2_t *ctx)
 Reset function.
 
uint8_t altitude2_set_ratio (altitude2_t *ctx, uint8_t temp_ratio, uint8_t press_ratio)
 Set ratio function.
 
void altitude2_read_data (altitude2_t *ctx, float *temp_data, float *press_data, float *altitude_data)
 Data read function.
 

Detailed Description

This file contains API for Altitude 2 Click driver.