ecg6 2.0.0.0
ecg6.h File Reference

This file contains API for Ecg 6 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  ecg6_int_status_t
 
struct  ecg6_element_t
 
struct  ecg6_fifo_t
 
struct  ecg6_cfg_element_t
 
struct  ecg6_t
 Click ctx object definition. More...
 
struct  ecg6_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ECG6_MAP_MIKROBUS(cfg, mikrobus)
 
#define ECG6_RETVAL   uint8_t
 
#define ECG6_OK   0x00
 
#define ECG6_INIT_ERROR   0xFF
 
#define ECG6_REG_INTERRUPT_STATUS_1   0x00
 
#define ECG6_REG_INTERRUPT_STATUS_2   0x01
 
#define ECG6_REG_INTERRUPT_ENABLE_1   0x02
 
#define ECG6_REG_INTERRUPT_ENABLE_2   0x03
 
#define ECG6_REG_FIFO_WRITE   0x04
 
#define ECG6_REG_OVERFLOW_CNT   0x05
 
#define ECG6_REG_FIFO_READ   0x06
 
#define ECG6_REG_FIFO_DATA   0x07
 
#define ECG6_REG_FIFO_CFG   0x08
 
#define ECG6_REG_FIFO_DATA_CTRL_1   0x09
 
#define ECG6_REG_FIFO_DATA_CTRL_2   0x0A
 
#define ECG6_REG_SYSTEM_CTRL   0x0D
 
#define ECG6_REG_PPG_CFG_1   0x0E
 
#define ECG6_REG_PPG_CFG_2   0x0F
 
#define ECG6_REG_PROX_INT_THR   0x10
 
#define ECG6_REG_LED_PULSE_AMPLITUDE_1   0x11
 
#define ECG6_REG_LED_PULSE_AMPLITUDE_2   0x12
 
#define ECG6_REG_LED_RANGE   0x14
 
#define ECG6_REG_LED_PILOT_PULSE_AMPLITUDE   0x15
 
#define ECG6_REG_CONFIG_1   0x3C
 
#define ECG6_REG_CONFIG_3   0x3E
 
#define ECG6_REG_PART_ID   0xFF
 
#define ECG6_INTS1_A_FULL_ON   0x80
 
#define ECG6_INTS1_A_FULL_OFF   0x00
 
#define ECG6_INTS1_PPG_RDY_ON   0x40
 
#define ECG6_INTS1_PPG_RDY_OFF   0x00
 
#define ECG6_INTS1_ALC_OVF_ON   0x20
 
#define ECG6_INTS1_ALC_OVF_OFF   0x00
 
#define ECG6_INTS1_PROX_INIT_ON   0x10
 
#define ECG6_INTS1_PROX_INIT_OFF   0x00
 
#define ECG6_INTS1_PWR_RDY_ON   0x01
 
#define ECG6_INTS1_PWR_RDY_OFF   0x00
 
#define ECG6_INTS2_VDD_OOR_ON   0x80
 
#define ECG6_INTS2_VDD_OOR_OFF   0x00
 
#define ECG6_INTS2_DRDY_ON   0x04
 
#define ECG6_INTS2_DRDY_OFF   0x00
 
#define ECG6_INTE1_A_FULL_ENABLE   0x80
 
#define ECG6_INTE1_A_FULL_DISABLE   0x00
 
#define ECG6_INTE1_PPG_RDY_ENABLE   0x40
 
#define ECG6_INTE1_PPG_RDY_DISABLE   0x00
 
#define ECG6_INTE1_ALC_OVF_ENABLE   0x20
 
#define ECG6_INTE1_ALC_OVF_DISABLE   0x00
 
#define ECG6_INTE1_PROX_INT_ENABLE   0x10
 
#define ECG6_INTE1_PROX_INT_DISABLE   0x00
 
#define ECG6_INTS2_VDD_OOR_ENABLE   0x80
 
#define ECG6_INTS2_VDD_OOR_DISABLE   0x00
 
#define ECG6_INTS2_DRDY_ENABLE   0x04
 
#define ECG6_INTS2_DRDY_DISABLE   0x00
 
#define ECG6_FCFG_A_FULL_CLR   0x40
 
#define ECG6_FCFG_A_FULL_NO_CLR   0x00
 
#define ECG6_FCFG_A_FULL_TYPE_RPT   0x00
 
#define ECG6_FCFG_A_FULL_TYPE_ONCE   0x20
 
#define ECG6_FCFG_FIFO_ROLLS_ON_FULL_ON   0x10
 
#define ECG6_FCFG_FIFO_ROLLS_ON_FULL_OFF   0x00
 
#define ECG6_SYSCTRL_FIFO_ENABLE   0x04
 
#define ECG6_SYSCTRL_FIFO_DISABLE   0x00
 
#define ECG6_SYSCTRL_SHUTDOWN_ENABLE   0x02
 
#define ECG6_SYSCTRL_SHUTDOWN_DISABLE   0x00
 
#define ECG6_SYSCTRL_RESET_ENABLE   0x01
 
#define ECG6_SYSCTRL_RESET_DISABLE   0x00
 
#define ECG6_PPGCFG1_PPG_ADC_RGE_4096nA   0x00
 
#define ECG6_PPGCFG1_PPG_ADC_RGE_8192nA   0x40
 
#define ECG6_PPGCFG1_PPG_ADC_RGE_16384nA   0x80
 
#define ECG6_PPGCFG1_PPG_ADC_RGE_32768nA   0xC0
 
#define ECG6_PPGCFG1_PPG_SR_10n1   0x00
 
#define ECG6_PPGCFG1_PPG_SR_20n1   0x04
 
#define ECG6_PPGCFG1_PPG_SR_50n1   0x08
 
#define ECG6_PPGCFG1_PPG_SR_84n1   0x0C
 
#define ECG6_PPGCFG1_PPG_SR_100n1   0x10
 
#define ECG6_PPGCFG1_PPG_SR_200   0x14
 
#define ECG6_PPGCFG1_PPG_SR_400   0x18
 
#define ECG6_PPGCFG1_PPG_SR_800   0x1C
 
#define ECG6_PPGCFG1_PPG_SR_1000   0x20
 
#define ECG6_PPGCFG1_PPG_SR_1600   0x24
 
#define ECG6_PPGCFG1_PPG_SR_3200   0x28
 
#define ECG6_PPGCFG1_PPG_SR_10n2   0x2C
 
#define ECG6_PPGCFG1_PPG_SR_20n2   0x30
 
#define ECG6_PPGCFG1_PPG_SR_50n2   0x34
 
#define ECG6_PPGCFG1_PPG_SR_84n2   0x38
 
#define ECG6_PPGCFG1_PPG_SR_100n2   0x3C
 
#define ECG6_PPGCFG1_PPG_PW_50us   0x00
 
#define ECG6_PPGCFG1_PPG_PW_100us   0x01
 
#define ECG6_PPGCFG1_PPG_PW_200us   0x02
 
#define ECG6_PPGCFG1_PPG_PW_400us   0x03
 
#define ECG6_PPGCFG2_SMP_AVE_1   0x00
 
#define ECG6_PPGCFG2_SMP_AVE_2   0x01
 
#define ECG6_PPGCFG2_SMP_AVE_4   0x02
 
#define ECG6_PPGCFG2_SMP_AVE_8   0x03
 
#define ECG6_PPGCFG2_SMP_AVE_16   0x04
 
#define ECG6_PPGCFG2_SMP_AVE_32   0x05
 
#define ECG6_LRANG_LED2_SMP_AVE_50   0x00
 
#define ECG6_LRANG_LED2_SMP_AVE_100   0x04
 
#define ECG6_LRANG_LED1_SMP_AVE_50   0x00
 
#define ECG6_LRANG_LED1_SMP_AVE_100   0x01
 
#define ECG6_CFG1_ADC_OSR_1600   0x00
 
#define ECG6_CFG1_ADC_OSR_800   0x01
 
#define ECG6_CFG1_ADC_OSR_400   0x02
 
#define ECG6_CFG1_ADC_OSR_200   0x03
 
#define ECG6_CFG1_ADC_OSR_3200   0x04
 
#define ECG6_CFG3_PGA_GAIN_1   0x00
 
#define ECG6_CFG3_PGA_GAIN_2   0x04
 
#define ECG6_CFG3_PGA_GAIN_4   0x08
 
#define ECG6_CFG3_PGA_GAIN_8   0x0C
 
#define ECG6_CFG3_IA_GAIN_5   0x00
 
#define ECG6_CFG3_IA_GAIN_9p5   0x01
 
#define ECG6_CFG3_IA_GAIN_20   0x02
 
#define ECG6_CFG3_IA_GAIN_50   0x03
 
#define ECG6_DEF_PART_ID   0x1E
 
#define ECG6_DEVICE_SLAVE_ADDRESS   0x5E
 
#define ECG6_SENSOR_PPG_LED_1   0x01
 
#define ECG6_SENSOR_PPG_LED_2   0x02
 
#define ECG6_SENSOR_PPG_PILOT_LED_1   0x05
 
#define ECG6_SENSOR_PPG_PILOT_LED_2   0x06
 
#define ECG6_SENSOR_ECG   0x09
 
#define ECG6_SENSOR_NONE   0x00
 

Functions

void ecg6_cfg_setup (ecg6_cfg_t *cfg)
 Config Object Initialization function.
 
ECG6_RETVAL ecg6_init (ecg6_t *ctx, ecg6_cfg_t *cfg)
 Initialization function.
 
void ecg6_default_cfg (ecg6_t *ctx)
 Default configuration for ECG sensor.
 
void ecg6_write_data (ecg6_t *ctx, uint8_t reg, uint8_t in_data)
 Generic Write function.
 
void ecg6_write_data_buf (ecg6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic Write buffer function.
 
uint8_t ecg6_read_data (ecg6_t *ctx, uint8_t reg)
 Generic Read function.
 
void ecg6_read_data_buf (ecg6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic Read buffer function.
 
uint8_t ecg6_check_path_id (ecg6_t *ctx)
 Function for check path ID.
 
uint8_t ecg6_ppg_default_config (ecg6_t *ctx)
 Function for configuration sensors to element.
 
void ecg6_get_sample_data (ecg6_t *ctx, ecg6_element_t *element, uint8_t num_sample)
 Get one sample from FIFO.
 
void ecg6_get_all_samples (ecg6_t *ctx, ecg6_fifo_t *fifo_data)
 Get all samples from FIFO.
 
void ecg6_get_interrupt_status (ecg6_t *ctx, ecg6_int_status_t *status)
 Get Interrupt registers status.
 
uint8_t ecg6_int_pin_state (ecg6_t *ctx)
 Get Interrupt pin state.
 

Detailed Description

This file contains API for Ecg 6 Click driver.