altitude6 2.0.0.0
altitude6.h File Reference

This file contains API for Altitude 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  altitude6_s
 Altitude 6 Click context object. More...
 
struct  altitude6_cfg_t
 Altitude 6 Click configuration object. More...
 

Macros

#define ALTITUDE6_CMD_RESET   0x1E
 Altitude 6 description register.
 
#define ALTITUDE6_CMD_CONV_D1_OSR_256   0x40
 
#define ALTITUDE6_CMD_CONV_D1_OSR_512   0x42
 
#define ALTITUDE6_CMD_CONV_D1_OSR_1024   0x44
 
#define ALTITUDE6_CMD_CONV_D1_OSR_2048   0x46
 
#define ALTITUDE6_CMD_CONV_D1_OSR_4096   0x48
 
#define ALTITUDE6_CMD_CONV_D2_OSR_256   0x50
 
#define ALTITUDE6_CMD_CONV_D2_OSR_512   0x52
 
#define ALTITUDE6_CMD_CONV_D2_OSR_1024   0x54
 
#define ALTITUDE6_CMD_CONV_D2_OSR_2048   0x56
 
#define ALTITUDE6_CMD_CONV_D2_OSR_4096   0x58
 
#define ALTITUDE6_CMD_ADC_READ   0x00
 
#define ALTITUDE6_CMD_PROM_READ_START   0xA0
 
#define ALTITUDE6_RATIO_256   0x00
 Altitude 6 description setting.
 
#define ALTITUDE6_RATIO_512   0x01
 
#define ALTITUDE6_RATIO_1024   0x02
 
#define ALTITUDE6_RATIO_2048   0x03
 
#define ALTITUDE6_RATIO_4096   0x04
 
#define ALTITUDE6_SET_DEV_ADDR_1   0x76
 Altitude 6 device address setting.
 
#define ALTITUDE6_SET_DEV_ADDR_0   0x77
 
#define ALTITUDE6_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define ALTITUDE6_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define ALTITUDE6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* altitude6_master_io_t) (struct altitude6_s *, uint8_t, uint8_t *, uint8_t)
 Altitude 6 Click driver interface.
 
typedef struct altitude6_s altitude6_t
 Altitude 6 Click context object.
 

Enumerations

enum  altitude6_drv_t { ALTITUDE6_DRV_SEL_SPI , ALTITUDE6_DRV_SEL_I2C }
 Altitude 6 Click driver selector. More...
 
enum  altitude6_return_value_t { ALTITUDE6_OK = 0 , ALTITUDE6_ERROR = -1 }
 Altitude 6 Click return value data. More...
 

Functions

void altitude6_cfg_setup (altitude6_cfg_t *cfg)
 Altitude 6 configuration object setup function.
 
void altitude6_drv_interface_selection (altitude6_cfg_t *cfg, altitude6_drv_t drv_sel)
 Altitude 6 driver interface setup function.
 
err_t altitude6_init (altitude6_t *ctx, altitude6_cfg_t *cfg)
 Altitude 6 initialization function.
 
err_t altitude6_default_cfg (altitude6_t *ctx)
 Altitude 6 default configuration function.
 
err_t altitude6_set_command (altitude6_t *ctx, uint8_t cmd)
 Altitude 6 set command function.
 
err_t altitude6_generic_read (altitude6_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Altitude 6 data reading function.
 
err_t altitude6_set_ratio (altitude6_t *ctx, uint8_t temp_ratio, uint8_t press_ratio)
 Altitude 6 set data ratio function.
 
err_t altitude6_sw_reset (altitude6_t *ctx)
 Altitude 6 software reset function.
 
err_t altitude6_get_calibration_data (altitude6_t *ctx)
 Altitude 6 get calibration data function.
 
err_t altitude6_get_raw_data (altitude6_t *ctx, uint32_t *temp_data, uint32_t *press_data)
 Altitude 6 get raw data function.
 
err_t altitude6_get_temperature (altitude6_t *ctx, float *temperature)
 Altitude 6 get temperature data function.
 
err_t altitude6_get_pressure (altitude6_t *ctx, float *pressure)
 Altitude 6 get pressure data function.
 
err_t altitude6_get_data (altitude6_t *ctx, float *temperature, float *pressure, float *altitude)
 Altitude 6 get data function.
 

Detailed Description

This file contains API for Altitude 6 Click Driver.

Typedef Documentation

◆ altitude6_master_io_t

typedef err_t(* altitude6_master_io_t) (struct altitude6_s *, uint8_t, uint8_t *, uint8_t)

Altitude 6 Click driver interface.

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

◆ altitude6_t

typedef struct altitude6_s altitude6_t

Altitude 6 Click context object.

Context object definition of Altitude 6 Click driver.

Enumeration Type Documentation

◆ altitude6_drv_t

Altitude 6 Click driver selector.

Selects target driver interface of Altitude 6 Click driver.

Enumerator
ALTITUDE6_DRV_SEL_SPI 

SPI driver descriptor.

ALTITUDE6_DRV_SEL_I2C 

I2C driver descriptor.

◆ altitude6_return_value_t

Altitude 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
ALTITUDE6_OK 
ALTITUDE6_ERROR