oximeter3 2.0.0.0
oximeter3.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  oximeter3_t
 Click ctx object definition. More...
 
struct  oximeter3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define OXIMETER3_MAP_MIKROBUS(cfg, mikrobus)
 
#define OXIMETER3_RETVAL   uint8_t
 
#define OXIMETER3_OK   0x00
 
#define OXIMETER3_INIT_ERROR   0xFF
 
#define OXIMETER3_ERROR   0xFF
 
#define OXIMETER3_SLAVE_ADDRESS   0x13
 
#define OXIMETER3_REG_COMMAND   0x80
 
#define OXIMETER3_REG_PRODUCT_ID   0x81
 
#define OXIMETER3_REG_PROX_RATE   0x82
 
#define OXIMETER3_REG_LED_CURRENT   0x83
 
#define OXIMETER3_REG_ALS_PARAMETER   0x84
 
#define OXIMETER3_REG_ALS_RESULT_MSB   0x85
 
#define OXIMETER3_REG_ALS_RESULT_LSB   0x86
 
#define OXIMETER3_REG_PROX_RESULT_MSB   0x87
 
#define OXIMETER3_REG_PROX_RESULT_LSB   0x88
 
#define OXIMETER3_REG_INTERRUPT_CTRL   0x89
 
#define OXIMETER3_REG_LOW_THRESHOLD_MSB   0x8A
 
#define OXIMETER3_REG_LOW_THRESHOLD_LSB   0x8B
 
#define OXIMETER3_REG_HIGH_THRESHOLD_MSB   0x8C
 
#define OXIMETER3_REG_HIGH_THRESHOLD_LSB   0x8D
 
#define OXIMETER3_REG_INTERRUPT_STATUS   0x8E
 
#define OXIMETER3_REG_PROX_MODULATOR_TIMING   0x8F
 
#define OXIMETER3_CMD_ALS_SINGLE_MEASUREMENT_ENABLE   0x10
 
#define OXIMETER3_CMD_ALS_SINGLE_MEASUREMENT_DISABLE   0x00
 
#define OXIMETER3_CMD_PROX_SINGLE_MEASUREMENT_ENABLE   0x08
 
#define OXIMETER3_CMD_PROX_SINGLE_MEASUREMENT_DISABLE   0x00
 
#define OXIMETER3_CMD_ALS_PERIODIC_MEASUREMENT_ENABLE   0x04
 
#define OXIMETER3_CMD_ALS_PERIODIC_MEASUREMENT_DISABLE   0x00
 
#define OXIMETER3_CMD_PROX_PERIODIC_MEASUREMENT_ENABLE   0x02
 
#define OXIMETER3_CMD_PROX_PERIODIC_MEASUREMENT_DISABLE   0x00
 
#define OXIMETER3_CMD_MEASUREMENT_ENABLE   0x01
 
#define OXIMETER3_CMD_MEASUREMENT_DISABLE   0x00
 
#define OXIMETER3_CMD_ALS_DATA_READY   0x40
 
#define OXIMETER3_CMD_PROX_DATA_READY   0x20
 
#define OXIMETER3_PROX_RATE_1p95_MPS   0x00
 
#define OXIMETER3_PROX_RATE_3p90625_MPS   0x01
 
#define OXIMETER3_PROX_RATE_7p8125_MPS   0x02
 
#define OXIMETER3_PROX_RATE_16p625_MPS   0x03
 
#define OXIMETER3_PROX_RATE_31p25_MPS   0x04
 
#define OXIMETER3_PROX_RATE_62p5_MPS   0x05
 
#define OXIMETER3_PROX_RATE_125_MPS   0x06
 
#define OXIMETER3_PROX_RATE_250_MPS   0x07
 
#define OXIMETER3_LED_CURR_MIN   1
 
#define OXIMETER3_LED_CURR_MID   12
 
#define OXIMETER3_LED_CURR_MAX   20
 
#define OXIMETER3_ALS_PARAM_CONT_CONVERSION_ENABLE   0x80
 
#define OXIMETER3_ALS_PARAM_CONT_CONVERSION_DISABLE   0x00
 
#define OXIMETER3_ALS_PARAM_AUTO_OFSEN_ENABLE   0x08
 
#define OXIMETER3_ALS_PARAM_AUTO_OFSEN_DISABLE   0x00
 
#define OXIMETER3_ALS_PARAM_1_SAMPEL_PER_S   0x00
 
#define OXIMETER3_ALS_PARAM_2_SAMPEL_PER_S   0x10
 
#define OXIMETER3_ALS_PARAM_3_SAMPEL_PER_S   0x20
 
#define OXIMETER3_ALS_PARAM_4_SAMPEL_PER_S   0x30
 
#define OXIMETER3_ALS_PARAM_5_SAMPEL_PER_S   0x40
 
#define OXIMETER3_ALS_PARAM_6_SAMPEL_PER_S   0x50
 
#define OXIMETER3_ALS_PARAM_8_SAMPEL_PER_S   0x60
 
#define OXIMETER3_ALS_PARAM_10_SAMPEL_PER_S   0x70
 
#define OXIMETER3_INT_CTRL_1_CNT   0x00
 
#define OXIMETER3_INT_CTRL_2_CNT   0x20
 
#define OXIMETER3_INT_CTRL_4_CNT   0x40
 
#define OXIMETER3_INT_CTRL_8_CNT   0x60
 
#define OXIMETER3_INT_CTRL_16_CNT   0x80
 
#define OXIMETER3_INT_CTRL_32_CNT   0xA0
 
#define OXIMETER3_INT_CTRL_64_CNT   0xC0
 
#define OXIMETER3_INT_CTRL_128_CNT   0xE0
 
#define OXIMETER3_INT_CTRL_INT_ON_PROX_RDY   0x08
 
#define OXIMETER3_INT_CTRL_INT_ON_ALS_RDY   0x04
 
#define OXIMETER3_INT_CTRL_INT_ON_THRESHOLD   0x02
 
#define OXIMETER3_INT_CTRL_INT_ON_THRESHOLD_PROX   0x00
 
#define OXIMETER3_INT_CTRL_INT_ON_THRESHOLD_ALS   0x01
 
#define OXIMETER3_INT_STATUS_PROX   0x08
 
#define OXIMETER3_INT_STATUS_ALS   0x04
 
#define OXIMETER3_INT_STATUS_LOW_THRESHOLD   0x02
 
#define OXIMETER3_INT_STATUS_HIGH_THRESHOLD   0x01
 
#define OXIMETER3_PROX_TIMING_FREQ_390p625_KHZ   0x00
 
#define OXIMETER3_PROX_TIMING_FREQ_781p25_KHZ   0x01
 
#define OXIMETER3_PROX_TIMING_FREQ_1p5625_MHZ   0x10
 
#define OXIMETER3_PROX_TIMING_FREQ_3p125_MHZ   0x11
 
#define OXIMETER3_ID_VAL   0x21
 
#define OXIMETER3_ALS   0x11
 
#define OXIMETER3_PROX   0x22
 
#define OXIMETER3_HEART_RATE   0x33
 
#define SHIFT_VALUE   8
 

Functions

void oximeter3_cfg_setup (oximeter3_cfg_t *cfg)
 Config Object Initialization function.
 
OXIMETER3_RETVAL oximeter3_init (oximeter3_t *ctx, oximeter3_cfg_t *cfg)
 Initialization function.
 
void oximeter3_generic_write (oximeter3_t *ctx, uint8_t reg, uint8_t data_buf)
 Generic write function.
 
uint8_t oximeter3_generic_read (oximeter3_t *ctx, uint8_t reg)
 Generic read function.
 
uint8_t oximeter3_get_int_status (oximeter3_t *ctx)
 Gets state of the int pin.
 
uint16_t oximeter3_read_value (oximeter3_t *ctx, uint8_t type_macro)
 Generic function for reading als and proximity values.
 

Detailed Description

This file contains API for Oximeter3 Click driver.