oximeter5 2.0.0.0
oximeter5.h File Reference

This file contains API for Oximeter 5 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  oximeter5_t
 Oximeter 5 Click context object. More...
 
struct  oximeter5_cfg_t
 Oximeter 5 Click configuration object. More...
 

Macros

#define OXIMETER5_REG_INTR_STATUS_1   0x00
 Oximeter 5 description register.
 
#define OXIMETER5_REG_INTR_STATUS_2   0x01
 
#define OXIMETER5_REG_INTR_ENABLE_1   0x02
 
#define OXIMETER5_REG_INTR_ENABLE_2   0x03
 
#define OXIMETER5_REG_FIFO_WR_PTR   0x04
 
#define OXIMETER5_REG_OVF_COUNTER   0x05
 
#define OXIMETER5_REG_FIFO_RD_PTR   0x06
 
#define OXIMETER5_REG_FIFO_DATA   0x07
 
#define OXIMETER5_REG_FIFO_CONFIG   0x08
 
#define OXIMETER5_REG_MODE_CONFIG   0x09
 
#define OXIMETER5_REG_SPO2_CONFIG   0x0A
 
#define OXIMETER5_REG_LED1_PA   0x0C
 
#define OXIMETER5_REG_LED2_PA   0x0D
 
#define OXIMETER5_REG_MULTI_LED_CTRL1   0x11
 
#define OXIMETER5_REG_MULTI_LED_CTRL2   0x12
 
#define OXIMETER5_REG_TEMP_INTR   0x1F
 
#define OXIMETER5_REG_TEMP_FRAC   0x20
 
#define OXIMETER5_REG_TEMP_CONFIG   0x21
 
#define OXIMETER5_REG_PROX_INT_THRESH   0x30
 
#define OXIMETER5_REG_REV_ID   0xFE
 
#define OXIMETER5_REG_PART_ID   0xFF
 
#define OXIMETER5_SET_INTR_EN_1_FULL_EN   0x80
 Oximeter 5 description setting.
 
#define OXIMETER5_SET_INTR_EN_1_PPG_RDY_EN   0x40
 
#define OXIMETER5_SET_INTR_EN_1_ALC_OVF_EN   0x20
 
#define OXIMETER5_SET_INTR_EN_2_TEMP_EN   0x80
 
#define OXIMETER5_SET_INTR_EN_2_TEMP_DIS   0x00
 
#define OXIMETER5_SET_FIFO_PTR_RESET   0x00
 
#define OXIMETER5_SET_FIFO_COUNTER_RESET   0x00
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_BIT_MASK   0xC0
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_1   0x00
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_2   0x20
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_3   0x40
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_8   0x60
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_16   0x80
 
#define OXIMETER5_SET_FIFO_CFG_SMP_AVE_32   0xC0
 
#define OXIMETER5_SET_FIFO_CFG_FIFO_RL_BIT_MASK   0x10
 
#define OXIMETER5_SET_FIFO_CFG_FIFO_RL_EN   0x10
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_BIT_MASK   0x0F
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_0   0x00
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_1   0x01
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_2   0x02
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_3   0x03
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_4   0x04
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_5   0x05
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_6   0x06
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_7   0x07
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_8   0x08
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_9   0x09
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_10   0x0A
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_11   0x0B
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_12   0x0C
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_13   0x0D
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_14   0x0E
 
#define OXIMETER5_SET_FIFO_CFG_DATA_SAMP_15   0x0F
 
#define OXIMETER5_SET_CFG_MODE_BIT_MASK   0x07
 
#define OXIMETER5_SW_RESET   0x40
 
#define OXIMETER5_SET_CFG_MODE_HEART_RATE   0x02
 
#define OXIMETER5_SET_CFG_MODE_SpO2   0x03
 
#define OXIMETER5_SET_CFG_MODE_MULTI_LED   0x07
 
#define OXIMETER5_SET_SPO2_CFG_ADC_RGE_BIT_MASK   0x60
 
#define OXIMETER5_SET_SPO2_CFG_ADC_RGE_2048   0x00
 
#define OXIMETER5_SET_SPO2_CFG_ADC_RGE_4096   0x20
 
#define OXIMETER5_SET_SPO2_CFG_ADC_RGE_8192   0x40
 
#define OXIMETER5_SET_SPO2_CFG_ADC_RGE_16384   0x60
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_BIT_MASK   0x1C
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_50   0x00
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_100   0x04
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_200   0x08
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_400   0x0C
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_800   0x10
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_1000   0x12
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_1600   0x14
 
#define OXIMETER5_SET_SPO2_CFG_SR_SEC_3200   0x1C
 
#define OXIMETER5_SET_SPO2_CFG_LED_PW_BIT_MASK   0x03
 
#define OXIMETER5_SET_SPO2_CFG_LED_PW_15_bit   0x00
 
#define OXIMETER5_SET_SPO2_CFG_LED_PW_16_bit   0x01
 
#define OXIMETER5_SET_SPO2_CFG_LED_PW_17_bit   0x02
 
#define OXIMETER5_SET_SPO2_CFG_LED_PW_18_bit   0x03
 
#define OXIMETER5_SET_LED_PULSE_AMPL_7_2_mA   0x24
 
#define OXIMETER5_SET_CFG_TEMP_DISABLE   0x00
 
#define OXIMETER5_SET_CFG_TEMP_ENABLE   0x01
 
#define MAX_BRIGHTNESS   255
 
#define OXIMETER5_PN_SPO2_ERROR_DATA   255
 
#define OXIMETER5_HEART_RATE_ERROR_DATA   -999
 
#define OXIMETER5_INTERRUPT_INACTIVE   0x00
 
#define OXIMETER5_INTERRUPT_ACTIVE   0x01
 
#define OXIMETER5_SET_DEV_ADDR   0x57
 Oximeter 5 device address setting.
 
#define OXIMETER5_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  oximeter5_return_value_t { OXIMETER5_OK = 0 , OXIMETER5_ERROR = -1 }
 Oximeter 5 Click return value data. More...
 

Functions

void oximeter5_cfg_setup (oximeter5_cfg_t *cfg)
 Oximeter 5 configuration object setup function.
 
err_t oximeter5_init (oximeter5_t *ctx, oximeter5_cfg_t *cfg)
 Oximeter 5 initialization function.
 
err_t oximeter5_default_cfg (oximeter5_t *ctx)
 Oximeter 5 default configuration function.
 
err_t oximeter5_generic_write (oximeter5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Oximeter 5 I2C writing function.
 
err_t oximeter5_generic_read (oximeter5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Oximeter 5 I2C reading function.
 
uint8_t oximeter5_check_interrupt (oximeter5_t *ctx)
 Oximeter 5 check interrupt function.
 
err_t oximeter5_sw_reset (oximeter5_t *ctx)
 Oximeter 5 soft reset function.
 
err_t oximeter5_read_temperature (oximeter5_t *ctx, float *temperature)
 Oximeter 5 read temperature function.
 
err_t oximeter5_set_fifo_wr_pointer (oximeter5_t *ctx, uint8_t fifo_wr_p)
 Oximeter 5 set FIFO write pointer function.
 
err_t oximeter5_set_fifo_rd_pointer (oximeter5_t *ctx, uint8_t fifo_rd_p)
 Oximeter 5 set FIFO read pointer function.
 
err_t oximeter5_set_fifo_cfg (oximeter5_t *ctx, uint8_t smp_ave, uint8_t fifo_ro_en, uint8_t fifo_a_full)
 Oximeter 5 set FIFO config function.
 
err_t oximeter5_set_mode_cfg (oximeter5_t *ctx, uint8_t mode)
 Oximeter 5 set mode config function.
 
err_t oximeter5_set_spo2_cfg (oximeter5_t *ctx, uint8_t spo2_adc_rge, uint8_t spo2_sr, uint8_t led_pw)
 Oximeter 5 set SpO2 config function.
 
err_t oximeter5_read_sensor_data (oximeter5_t *ctx, uint32_t *ir, uint32_t *red)
 Oximeter 5 get sensor data function.
 
err_t oximeter5_get_oxygen_saturation (uint32_t *pun_ir_buffer, int32_t n_ir_buffer_length, uint32_t *pun_red_buffer, uint8_t *pn_spo2)
 Oximeter 5 get oxygen saturation function.
 
err_t oximeter5_get_heart_rate (uint32_t *pun_ir_buffer, int32_t n_ir_buffer_length, uint32_t *pun_red_buffer, int32_t *pn_heart_rate)
 Oximeter 5 get heart rate function.
 

Detailed Description

This file contains API for Oximeter 5 Click Driver.

Enumeration Type Documentation

◆ oximeter5_return_value_t

Oximeter 5 Click return value data.

Predefined enum values for driver return values.

Enumerator
OXIMETER5_OK 
OXIMETER5_ERROR