no-OS
Loading...
Searching...
No Matches
max30009.h File Reference

Header file for MAX30009 driver. More...

#include <stdint.h>
#include <stdbool.h>
#include "no_os_gpio.h"
#include "no_os_i2c.h"
#include "no_os_spi.h"
#include "no_os_util.h"
Include dependency graph for max30009.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  max30009_pll_config
 
struct  max30009_fifo_config
 
struct  max30009_bioz_config
 
struct  max30009_bioz_mux_config
 
struct  max30009_lead_detect_config
 
struct  max30009_dev
 
struct  max30009_init_param
 
struct  max30009_bioz_data
 
struct  max30009_status
 
struct  max30009_cal_coeffs
 
struct  max30009_lead_status
 
struct  max30009_fifo_sample
 

Macros

#define MAX30009_REG_STATUS1   0x00
 
#define MAX30009_STATUS1_A_FULL_MSK   NO_OS_BIT(7)
 
#define MAX30009_STATUS1_FIFO_DATA_RDY_MSK   NO_OS_BIT(5)
 
#define MAX30009_STATUS1_FREQ_UNLOCK_MSK   NO_OS_BIT(4)
 
#define MAX30009_STATUS1_FREQ_LOCK_MSK   NO_OS_BIT(3)
 
#define MAX30009_STATUS1_PHASE_UNLOCK_MSK   NO_OS_BIT(2)
 
#define MAX30009_STATUS1_PHASE_LOCK_MSK   NO_OS_BIT(1)
 
#define MAX30009_STATUS1_PWR_RDY_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_STATUS2   0x01
 
#define MAX30009_STATUS2_LON_MSK   NO_OS_BIT(7)
 
#define MAX30009_STATUS2_BIOZ_OVER_MSK   NO_OS_BIT(6)
 
#define MAX30009_STATUS2_BIOZ_UNDR_MSK   NO_OS_BIT(5)
 
#define MAX30009_STATUS2_DRV_OOR_MSK   NO_OS_BIT(4)
 
#define MAX30009_STATUS2_DC_LOFF_PH_MSK   NO_OS_BIT(3)
 
#define MAX30009_STATUS2_DC_LOFF_PL_MSK   NO_OS_BIT(2)
 
#define MAX30009_STATUS2_DC_LOFF_NH_MSK   NO_OS_BIT(1)
 
#define MAX30009_STATUS2_DC_LOFF_NL_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_FIFO_WRITE_POINTER   0x08
 
#define MAX30009_REG_FIFO_READ_POINTER   0x09
 
#define MAX30009_REG_FIFO_COUNTER1   0x0A
 
#define MAX30009_FIFO_DATA_COUNT_MSB_MSK   NO_OS_BIT(7)
 
#define MAX30009_OVF_COUNTER_MSK   NO_OS_GENMASK(6, 0)
 
#define MAX30009_REG_FIFO_COUNTER2   0x0B
 
#define MAX30009_FIFO_DATA_COUNT_LSB_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_FIFO_DATA_REGISTER   0x0C
 
#define MAX30009_FIFO_DATA_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_FIFO_CONFIGURATION1   0x0D
 
#define MAX30009_FIFO_A_FULL_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_FIFO_CONFIGURATION2   0x0E
 
#define MAX30009_FIFO_MARK_MSK   NO_OS_BIT(5)
 
#define MAX30009_FLUSH_FIFO_MSK   NO_OS_BIT(4)
 
#define MAX30009_FIFO_STAT_CLR_MSK   NO_OS_BIT(3)
 
#define MAX30009_A_FULL_TYPE_MSK   NO_OS_BIT(2)
 
#define MAX30009_FIFO_RO_MSK   NO_OS_BIT(1)
 
#define MAX30009_REG_SYSTEM_SYNC   0x10
 
#define MAX30009_TIMING_SYS_RESET_MSK   NO_OS_BIT(7)
 
#define MAX30009_REG_SYSTEM_CONFIGURATION1   0x11
 
#define MAX30009_MASTER_MSK   NO_OS_BIT(7)
 
#define MAX30009_DISABLE_I2C_MSK   NO_OS_BIT(6)
 
#define MAX30009_SHDN_MSK   NO_OS_BIT(1)
 
#define MAX30009_RESET_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_PIN_FUNC_CONFIGURATION   0x12
 
#define MAX30009_INT_FCFG_MSK   NO_OS_GENMASK(3, 2)
 
#define MAX30009_TRIG_ICFG_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_OUTPUT_PIN_CONFIGURATION   0x13
 
#define MAX30009_INT_OCFG_MSK   NO_OS_GENMASK(3, 2)
 
#define MAX30009_TRIG_OCFG_MSK   NO_OS_GENMASK(1, 0)
 
#define MAX30009_REG_I2C_BROADCAST_ADDRESS   0x14
 
#define MAX30009_I2C_BCAST_ADDR_MSK   NO_OS_GENMASK(6, 1)
 
#define MAX30009_I2C_BCAST_EN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_PLL_CONFIGURATION1   0x17
 
#define MAX30009_MDIV_MSB_MSK   NO_OS_GENMASK(7, 6)
 
#define MAX30009_NDIV_MSK   NO_OS_BIT(5)
 
#define MAX30009_KDIV_MSK   NO_OS_GENMASK(4, 1)
 
#define MAX30009_PLL_EN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_PLL_CONFIGURATION2   0x18
 
#define MAX30009_MDIV_LSB_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_PLL_CONFIGURATION3   0x19
 
#define MAX30009_PLL_LOCK_WNDW_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_PLL_CONFIGURATION4   0x1A
 
#define MAX30009_REF_CLK_SEL_MSK   NO_OS_BIT(6)
 
#define MAX30009_CLK_FREQ_SEL_MSK   NO_OS_BIT(5)
 
#define MAX30009_CLK_FINE_TUNE_MSK   NO_OS_GENMASK(4, 0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION1   0x20
 
#define MAX30009_BIOZ_DAC_OSR_MSK   NO_OS_GENMASK(7, 6)
 
#define MAX30009_BIOZ_ADC_OSR_MSK   NO_OS_GENMASK(5, 3)
 
#define MAX30009_BIOZ_BG_EN_MSK   NO_OS_BIT(2)
 
#define MAX30009_BIOZ_Q_EN_MSK   NO_OS_BIT(1)
 
#define MAX30009_BIOZ_I_EN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION2   0x21
 
#define MAX30009_BIOZ_DHPF_MSK   NO_OS_GENMASK(7, 6)
 
#define MAX30009_BIOZ_DLPF_MSK   NO_OS_GENMASK(5, 3)
 
#define MAX30009_BIOZ_CMP_MSK   NO_OS_GENMASK(2, 1)
 
#define MAX30009_EN_BIOZ_THRESH_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION3   0x22
 
#define MAX30009_BIOZ_EXT_RES_MSK   NO_OS_BIT(7)
 
#define MAX30009_LOFF_RAPID_MSK   NO_OS_BIT(6)
 
#define MAX30009_BIOZ_VDRV_MAG_MSK   NO_OS_GENMASK(5, 4)
 
#define MAX30009_BIOZ_IDRV_RGE_MSK   NO_OS_GENMASK(3, 2)
 
#define MAX30009_BIOZ_DRV_MODE_MSK   NO_OS_GENMASK(1, 0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION4   0x23
 
#define MAX30009_BIOZ_FAST_MANUAL_MSK   NO_OS_BIT(1)
 
#define MAX30009_BIOZ_FAST_START_EN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION5   0x24
 
#define MAX30009_BIOZ_AHPF_MSK   NO_OS_GENMASK(7, 4)
 
#define MAX30009_BIOZ_INA_MODE_MSK   NO_OS_BIT(3)
 
#define MAX30009_BIOZ_DM_DIS_MSK   NO_OS_BIT(2)
 
#define MAX30009_BIOZ_GAIN_MSK   NO_OS_GENMASK(1, 0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION6   0x25
 
#define MAX30009_BIOZ_EXT_CAP_MSK   NO_OS_BIT(7)
 
#define MAX30009_BIOZ_DC_RESTORE_MSK   NO_OS_BIT(6)
 
#define MAX30009_BIOZ_DRV_RESET_MSK   NO_OS_BIT(5)
 
#define MAX30009_BIOZ_DAC_RESET_MSK   NO_OS_BIT(4)
 
#define MAX30009_BIOZ_AMP_RGE_MSK   NO_OS_GENMASK(3, 2)
 
#define MAX30009_BIOZ_AMP_BW_MSK   NO_OS_GENMASK(1, 0)
 
#define MAX30009_REG_BIOZ_LOW_THRESHOLD   0x26
 
#define MAX30009_BIOZ_LO_THRESH_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_BIOZ_HIGH_THRESHOLD   0x27
 
#define MAX30009_BIOZ_HI_THRESH_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_BIOZ_CONFIGURATION7   0x28
 
#define MAX30009_BIOZ_STBYON_MSK   NO_OS_BIT(4)
 
#define MAX30009_BIOZ_Q_CLK_PHASE_MSK   NO_OS_BIT(3)
 
#define MAX30009_BIOZ_I_CLK_PHASE_MSK   NO_OS_BIT(2)
 
#define MAX30009_BIOZ_INA_CHOP_EN_MSK   NO_OS_BIT(1)
 
#define MAX30009_BIOZ_CH_FSEL_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_BIOZ_MUX_CONFIGURATION1   0x41
 
#define MAX30009_BMUX_RSEL_MSK   NO_OS_GENMASK(7, 6)
 
#define MAX30009_BMUX_BIST_EN_MSK   NO_OS_BIT(5)
 
#define MAX30009_CONNECT_CAL_ONLY_MSK   NO_OS_BIT(2)
 
#define MAX30009_MUX_EN_MSK   NO_OS_BIT(1)
 
#define MAX30009_CAL_EN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_BIOZ_MUX_CONFIGURATION2   0x42
 
#define MAX30009_GSR_RSEL_MSK   NO_OS_GENMASK(7, 6)
 
#define MAX30009_GSR_LOAD_EN_MSK   NO_OS_BIT(5)
 
#define MAX30009_EN_EXT_INLOAD_MSK   NO_OS_BIT(1)
 
#define MAX30009_EN_INT_INLOAD_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_BIOZ_MUX_CONFIGURATION3   0x43
 
#define MAX30009_BIP_ASSIGN_MSK   NO_OS_GENMASK(7, 6)
 
#define MAX30009_BIN_ASSIGN_MSK   NO_OS_GENMASK(5, 4)
 
#define MAX30009_DRVP_ASSIGN_MSK   NO_OS_GENMASK(3, 2)
 
#define MAX30009_DRVN_ASSIGN_MSK   NO_OS_GENMASK(1, 0)
 
#define MAX30009_REG_BIOZ_MUX_CONFIGURATION4   0x44
 
#define MAX30009_BIST_R_ERR_MSK   NO_OS_GENMASK(7, 0)
 
#define MAX30009_REG_DC_LEADS_CONFIGURATION   0x50
 
#define MAX30009_EN_LON_DET_MSK   NO_OS_BIT(7)
 
#define MAX30009_EN_LOFF_DET_MSK   NO_OS_BIT(6)
 
#define MAX30009_EN_EXT_LOFF_MSK   NO_OS_BIT(5)
 
#define MAX30009_EN_DRV_OOR_MSK   NO_OS_BIT(4)
 
#define MAX30009_LOFF_IPOL_MSK   NO_OS_BIT(3)
 
#define MAX30009_LOFF_IMAG_MSK   NO_OS_GENMASK(2, 0)
 
#define MAX30009_REG_DC_LEAD_DETECT_THRESHOLD   0x51
 
#define MAX30009_LOFF_THRESH_MSK   NO_OS_GENMASK(3, 0)
 
#define MAX30009_REG_LEAD_BIAS_CONFIGURATION1   0x58
 
#define MAX30009_RBIAS_VAL_MSK   NO_OS_GENMASK(3, 2)
 
#define MAX30009_EN_RBIAS_BIP_MSK   NO_OS_BIT(1)
 
#define MAX30009_EN_RBIAS_BIN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_INTERRUPT_ENABLE1   0x80
 
#define MAX30009_A_FULL_EN_MSK   NO_OS_BIT(7)
 
#define MAX30009_FIFO_DATA_RDY_EN_MSK   NO_OS_BIT(5)
 
#define MAX30009_FREQ_UNLOCK_EN_MSK   NO_OS_BIT(4)
 
#define MAX30009_FREQ_LOCK_EN_MSK   NO_OS_BIT(3)
 
#define MAX30009_PHASE_UNLOCK_EN_MSK   NO_OS_BIT(2)
 
#define MAX30009_PHASE_LOCK_EN_MSK   NO_OS_BIT(1)
 
#define MAX30009_REG_INTERRUPT_ENABLE2   0x81
 
#define MAX30009_LON_EN_MSK   NO_OS_BIT(7)
 
#define MAX30009_BIOZ_OVER_EN_MSK   NO_OS_BIT(6)
 
#define MAX30009_BIOZ_UNDR_EN_MSK   NO_OS_BIT(5)
 
#define MAX30009_DRV_OOR_EN_MSK   NO_OS_BIT(4)
 
#define MAX30009_DC_LOFF_PH_EN_MSK   NO_OS_BIT(3)
 
#define MAX30009_DC_LOFF_PL_EN_MSK   NO_OS_BIT(2)
 
#define MAX30009_DC_LOFF_NH_EN_MSK   NO_OS_BIT(1)
 
#define MAX30009_DC_LOFF_NL_EN_MSK   NO_OS_BIT(0)
 
#define MAX30009_REG_PART_ID   0xFF
 
#define MAX30009_I2C_ADDRESS   0x68
 
#define MAX30009_PART_ID_VALUE   0x42
 
#define MAX30009_FIFO_DEPTH   256
 
#define MAX30009_FIFO_DATA_SIZE   3
 
#define MAX30009_PLL_LOCK_TIMEOUT_MS   1000
 
#define MAX30009_REF_CLK_32768_HZ   32768
 
#define MAX30009_REF_CLK_32000_HZ   32000
 
#define MAX30009_FIFO_TAG_SHIFT   20
 
#define MAX30009_FIFO_TAG_MASK   NO_OS_GENMASK(3, 0)
 
#define MAX30009_FIFO_DATA_MASK   NO_OS_GENMASK(19, 0)
 
#define MAX30009_FIFO_SIGN_BIT   NO_OS_BIT(19)
 
#define MAX30009_FIFO_SIGN_EXT   0xFFF00000UL
 

Enumerations

enum  max30009_bioz_gain {
  MAX30009_BIOZ_GAIN_1 ,
  MAX30009_BIOZ_GAIN_2 ,
  MAX30009_BIOZ_GAIN_5 ,
  MAX30009_BIOZ_GAIN_10
}
 
enum  max30009_bioz_drv_mode {
  MAX30009_CURRENT_DRV_MODE ,
  MAX30009_VOLTAGE_DRV_MODE ,
  MAX30009_H_BRIDGE_DRV_MODE ,
  MAX30009_STANDBY_MODE
}
 
enum  max30009_bioz_bw {
  MAX30009_BIOZ_LOW_BW ,
  MAX30009_BIOZ_MEDIUM_LOW_BW ,
  MAX30009_BIOZ_MEDIUM_HIGH_BW ,
  MAX30009_BIOZ_HIGH_BW
}
 
enum  max30009_dac_osr {
  MAX30009_DAC_OSR_32 ,
  MAX30009_DAC_OSR_64 ,
  MAX30009_DAC_OSR_128 ,
  MAX30009_DAC_OSR_256
}
 
enum  max30009_adc_osr {
  MAX30009_ADC_OSR_8 ,
  MAX30009_ADC_OSR_16 ,
  MAX30009_ADC_OSR_32 ,
  MAX30009_ADC_OSR_64 ,
  MAX30009_ADC_OSR_128 ,
  MAX30009_ADC_OSR_256 ,
  MAX30009_ADC_OSR_512 ,
  MAX30009_ADC_OSR_1024
}
 
enum  max30009_dhpf {
  MAX30009_DHPF_BYPASS ,
  MAX30009_DHPF_0_00025_SR ,
  MAX30009_DHPF_0_002_SR
}
 
enum  max30009_dlpf {
  MAX30009_DLPF_BYPASS ,
  MAX30009_DLPF_0_005_SR ,
  MAX30009_DLPF_0_02_SR ,
  MAX30009_DLPF_0_08_SR ,
  MAX30009_DLPF_0_25_SR
}
 
enum  max30009_ahpf {
  MAX30009_AHPF_100HZ ,
  MAX30009_AHPF_200HZ ,
  MAX30009_AHPF_500HZ ,
  MAX30009_AHPF_1KHZ ,
  MAX30009_AHPF_2KHZ ,
  MAX30009_AHPF_5KHZ ,
  MAX30009_AHPF_10KHZ ,
  MAX30009_AHPF_BYPASS ,
  MAX30009_AHPF_42M4K_OHM ,
  MAX30009_AHPF_21M2K_OHM ,
  MAX30009_AHPF_8M4K_OHM ,
  MAX30009_AHPF_4M2K_OHM ,
  MAX30009_AHPF_2M2K_OHM ,
  MAX30009_AHPF_848K_OHM
}
 
enum  max30009_drive_mode {
  MAX30009_DRIVE_SINE_CURRENT ,
  MAX30009_DRIVE_SINE_VOLTAGE ,
  MAX30009_DRIVE_HBRIDGE ,
  MAX30009_DRIVE_STANDBY
}
 
enum  max30009_bia_rsel {
  MAX30009_BIA_5100_OHM ,
  MAX30009_BIA_900_OHM ,
  MAX30009_BIA_600_OHM ,
  MAX30009_BIA_280_OHM
}
 
enum  max30009_gsr_rsel {
  MAX30009_GSR_25K7_OHM ,
  MAX30009_GSR_101K_OHM ,
  MAX30009_GSR_505K_OHM ,
  MAX30009_GSR_1M_OHM
}
 
enum  max30009_loff_current {
  MAX30009_LOFF_DISABLE ,
  MAX30009_LOFF_5NA ,
  MAX30009_LOFF_10NA ,
  MAX30009_LOFF_20NA ,
  MAX30009_LOFF_50NA ,
  MAX30009_LOFF_100NA
}
 
enum  max30009_rbias_val {
  MAX30009_RBIAS_50M_OHM ,
  MAX30009_RBIAS_100M_OHM ,
  MAX30009_RBIAS_200M_OHM ,
  MAX30009_RBIAS_RESERVED
}
 
enum  max30009_pll_ndiv {
  MAX30009_NDIV_512 ,
  MAX30009_NDIV_1024
}
 
enum  max30009_pll_kdiv {
  MAX30009_KDIV_1 ,
  MAX30009_KDIV_2 ,
  MAX30009_KDIV_4 ,
  MAX30009_KDIV_8 ,
  MAX30009_KDIV_16 ,
  MAX30009_KDIV_32 ,
  MAX30009_KDIV_64 ,
  MAX30009_KDIV_128 ,
  MAX30009_KDIV_256 ,
  MAX30009_KDIV_512 ,
  MAX30009_KDIV_1024 ,
  MAX30009_KDIV_2048 ,
  MAX30009_KDIV_4096 ,
  MAX30009_KDIV_8192
}
 
enum  max30009_interrupt {
  MAX30009_INT_A_FULL ,
  MAX30009_INT_FIFO_DATA_RDY ,
  MAX30009_INT_FREQ_UNLOCK ,
  MAX30009_INT_FREQ_LOCK ,
  MAX30009_INT_PHASE_UNLOCK ,
  MAX30009_INT_PHASE_LOCK ,
  MAX30009_INT_LON ,
  MAX30009_INT_BIOZ_OVER ,
  MAX30009_INT_BIOZ_UNDR ,
  MAX30009_INT_DRV_OOR ,
  MAX30009_INT_DC_LOFF_PH ,
  MAX30009_INT_DC_LOFF_PL ,
  MAX30009_INT_DC_LOFF_NH ,
  MAX30009_INT_DC_LOFF_NL
}
 
enum  max30009_fifo_sample_type {
  MAX30009_FIFO_SAMPLE_IN_PHASE = 0x1 ,
  MAX30009_FIFO_SAMPLE_QUADRATURE = 0x2 ,
  MAX30009_FIFO_SAMPLE_MARKER = 0xE ,
  MAX30009_FIFO_SAMPLE_INVALID = 0xF
}
 

Functions

int max30009_init (struct max30009_dev **device, struct max30009_init_param *init_param)
 Initialize the MAX30009 device.
 
int max30009_remove (struct max30009_dev *device)
 Remove the MAX30009 device and free resources.
 
int max30009_reg_read_multiple (struct max30009_dev *device, uint8_t reg_addr, uint8_t *data, uint32_t len)
 Read multiple bytes from register.
 
int max30009_reg_read (struct max30009_dev *device, uint8_t reg_addr, uint8_t *data)
 Read a single byte from register.
 
int max30009_reg_write_multiple (struct max30009_dev *device, uint8_t reg_addr, uint8_t *data, uint32_t len)
 Write multiple bytes to register.
 
int max30009_reg_write (struct max30009_dev *device, uint8_t reg_addr, uint8_t data)
 Write a single byte to register.
 
int max30009_reg_update (struct max30009_dev *device, uint8_t reg_addr, uint8_t mask, uint8_t value)
 Update specific bits in a register.
 
int max30009_soft_reset (struct max30009_dev *device)
 Perform software reset.
 
int max30009_verify_part_id (struct max30009_dev *device)
 Read device part ID.
 
int max30009_set_power_mode (struct max30009_dev *device, bool shutdown)
 Set power mode (shutdown or active)
 
int max30009_get_status (struct max30009_dev *device, struct max30009_status *status)
 Get device status.
 
int max30009_check_lead_off (struct max30009_dev *device, bool *leads_on)
 Check lead-off detection status.
 
int max30009_fifo_flush (struct max30009_dev *device)
 Flush FIFO contents.
 
int max30009_fifo_get_count (struct max30009_dev *device, uint16_t *count)
 Get FIFO data count.
 
int max30009_fifo_get_ovf_count (struct max30009_dev *device, uint16_t *count)
 Get FIFO overflow data count.
 
int max30009_read_fifo_data (struct max30009_dev *device, uint8_t *data, uint32_t len)
 Read data from FIFO.
 
int max30009_fifo_decode_sample (uint8_t *raw_data, struct max30009_fifo_sample *sample)
 Decode a 3-byte FIFO sample into type and data.
 
int max30009_get_fifo_pointers (struct max30009_dev *device, uint8_t *write_ptr, uint8_t *read_ptr)
 Get FIFO read and write pointers.
 
int max30009_set_fifo_watermark (struct max30009_dev *device, uint8_t watermark)
 Set FIFO watermark level.
 
int max30009_get_fifo_watermark (struct max30009_dev *desc, uint8_t *watermark)
 Gets the FIFO watermark level of the device.
 
int max30009_set_fifo_rollover (struct max30009_dev *device, bool rollover)
 Set FIFO rollover mode.
 
int max30009_set_a_full_type (struct max30009_dev *device, bool type)
 Set almost-full interrupt type.
 
int max30009_insert_fifo_marker (struct max30009_dev *device)
 Insert marker into FIFO data stream.
 
int max30009_clear_fifo_status (struct max30009_dev *device)
 Clear FIFO status flags.
 
int max30009_timing_system_reset (struct max30009_dev *device)
 Trigger timing system reset for PLL synchronization.
 
int max30009_set_master_mode (struct max30009_dev *device, bool is_master)
 Set master/slave mode for PLL synchronization.
 
int max30009_configure_int_pin (struct max30009_dev *device, uint8_t func_cfg, uint8_t out_cfg)
 Configure INT pin function and output.
 
int max30009_configure_trig_pin (struct max30009_dev *device, uint8_t input_cfg, uint8_t output_cfg)
 Configure TRIG pin input and output.
 
int max30009_configure_i2c_broadcast (struct max30009_dev *device, bool enable, uint8_t broadcast_addr)
 Configure I2C broadcast address.
 
int max30009_disable_i2c (struct max30009_dev *device)
 Disable I2C interface (SPI only mode)
 
int max30009_pll_set_dividers (struct max30009_dev *device, uint16_t mdiv, enum max30009_pll_ndiv ndiv, enum max30009_pll_kdiv kdiv)
 Configure PLL dividers.
 
int max30009_pll_enable (struct max30009_dev *device, bool enable)
 Enable or disable PLL.
 
int max30009_pll_set_lock_window (struct max30009_dev *device, bool lock_window)
 Set PLL lock window.
 
int max30009_set_clock_source (struct max30009_dev *device, bool use_external, bool use_32768_hz)
 Configure clock source.
 
int max30009_clock_fine_tune (struct max30009_dev *device, uint8_t tune_val)
 Fine tune internal clock frequency.
 
int max30009_bioz_enable (struct max30009_dev *device, bool enable)
 Enable or disable BioZ measurement.
 
int max30009_bioz_i_enable (struct max30009_dev *device, bool enable)
 Enable or disable BioZ I channel.
 
int max30009_bioz_q_enable (struct max30009_dev *device, bool enable)
 Enable or disable BioZ Q channel.
 
int max30009_bioz_bg_enable (struct max30009_dev *device, bool enable)
 Enable or disable BioZ bandgap.
 
int max30009_set_dac_osr (struct max30009_dev *device, enum max30009_dac_osr osr)
 Set DAC oversampling ratio.
 
int max30009_set_adc_osr (struct max30009_dev *device, enum max30009_adc_osr osr)
 Set ADC oversampling ratio.
 
int max30009_set_digital_hpf (struct max30009_dev *device, enum max30009_dhpf dhpf)
 Set digital high-pass filter.
 
int max30009_set_digital_lpf (struct max30009_dev *device, enum max30009_dlpf dlpf)
 Set digital low-pass filter.
 
int max30009_set_analog_hpf (struct max30009_dev *device, enum max30009_ahpf ahpf)
 Set analog high-pass filter.
 
int max30009_set_drive_mode (struct max30009_dev *device, enum max30009_drive_mode mode)
 Set drive mode (current, voltage, H-bridge, or standby)
 
int max30009_set_drive_current_detailed (struct max30009_dev *device, uint8_t idrv_range, uint8_t vdrv_mag)
 Set drive current with detailed control.
 
int max30009_enable_external_resistor (struct max30009_dev *device, bool enable)
 Enable or disable external resistor for current drive.
 
int max30009_enable_rapid_lead_off (struct max30009_dev *device, bool enable)
 Enable or disable rapid lead-off detection.
 
int max30009_enable_fast_start (struct max30009_dev *device, bool enable, bool manual)
 Enable or disable fast start mode.
 
int max30009_set_ina_mode (struct max30009_dev *device, bool low_power)
 Set INA (Instrumentation Amplifier) mode.
 
int max30009_disable_differential_mode (struct max30009_dev *device, bool disable)
 Disable differential mode (enable single-ended)
 
int max30009_set_amp_range (struct max30009_dev *device, uint8_t amp_range)
 Set amplifier range.
 
int max30009_set_amp_bandwidth (struct max30009_dev *device, uint8_t amp_bw)
 Set amplifier bandwidth.
 
int max30009_enable_external_cap (struct max30009_dev *device, bool enable)
 Enable or disable external capacitor.
 
int max30009_enable_dc_restore (struct max30009_dev *device, bool enable)
 Enable or disable DC restore circuit.
 
int max30009_enable_drive_reset (struct max30009_dev *device, bool enable)
 Enable or disable drive reset.
 
int max30009_enable_dac_reset (struct max30009_dev *device, bool enable)
 Enable or disable DAC reset.
 
int max30009_set_comparison_mode (struct max30009_dev *device, uint8_t cmp_mode)
 Set comparison mode for threshold detection.
 
int max30009_enable_bioz_threshold (struct max30009_dev *device, bool enable)
 Enable or disable BioZ threshold detection.
 
int max30009_set_bioz_thresholds (struct max30009_dev *device, uint8_t low_thresh, uint8_t high_thresh)
 Set BioZ threshold values.
 
int max30009_set_demod_clk_phases (struct max30009_dev *device, bool i_clk_phase, bool q_clk_phase)
 Set demodulation clock phases.
 
int max30009_enable_ina_chopping (struct max30009_dev *device, bool enable)
 Enable or disable INA chopping.
 
int max30009_set_channel_freq_select (struct max30009_dev *device, bool fsel)
 Set channel frequency select.
 
int max30009_enable_standby_mode (struct max30009_dev *device, bool keep_rx_on)
 Enable or disable standby mode.
 
int max30009_enable_calibration (struct max30009_dev *device, bool enable)
 Enable or disable calibration mode.
 
int max30009_enable_calibration_mux (struct max30009_dev *device, bool enable)
 Enable or disable calibration MUX.
 
int max30009_calibration_connect_only (struct max30009_dev *device, bool cal_only)
 Set calibration connect-only mode.
 
int max30009_set_bia_load_resistor (struct max30009_dev *device, enum max30009_bia_rsel rsel)
 Set BIA (Body Impedance Analysis) load resistor.
 
int max30009_enable_bia_bist (struct max30009_dev *device, bool enable)
 Enable or disable BIA BIST (Built-In Self Test)
 
int max30009_set_gsr_load_resistor (struct max30009_dev *device, enum max30009_gsr_rsel rsel)
 Set GSR (Galvanic Skin Response) load resistor.
 
int max30009_enable_gsr_load (struct max30009_dev *device, bool enable)
 Enable or disable GSR load resistor.
 
int max30009_enable_internal_load (struct max30009_dev *device, bool enable)
 Enable or disable internal load resistor.
 
int max30009_enable_external_load (struct max30009_dev *device, bool enable)
 Enable or disable external load connection.
 
int max30009_assign_electrodes (struct max30009_dev *device, uint8_t bip_assign, uint8_t bin_assign, uint8_t drvp_assign, uint8_t drvn_assign)
 Assign electrodes to measurement channels.
 
int max30009_read_bist_error (struct max30009_dev *device, uint8_t *error)
 Read BIST error value.
 
int max30009_lead_off_config (struct max30009_dev *device, bool enable, uint8_t threshold)
 Configure lead-off detection.
 
int max30009_set_lead_off_current (struct max30009_dev *device, enum max30009_loff_current current)
 Set lead-off detection current magnitude.
 
int max30009_set_lead_off_polarity (struct max30009_dev *device, bool positive)
 Set lead-off detection current polarity.
 
int max30009_enable_external_lead_off (struct max30009_dev *device, bool enable)
 Enable or disable external lead-off detection.
 
int max30009_enable_drive_oor_detect (struct max30009_dev *device, bool enable)
 Enable or disable drive out-of-range detection.
 
int max30009_enable_ultra_low_power_lead_on (struct max30009_dev *device, bool enable)
 Enable or disable ultra-low-power lead-on detection.
 
int max30009_get_detailed_lead_status (struct max30009_dev *device, struct max30009_lead_status *status)
 Get detailed lead detection status.
 
int max30009_set_lead_bias (struct max30009_dev *device, enum max30009_rbias_val rbias_value, bool enable_bip, bool enable_bin)
 Configure lead bias resistor and enable for receive electrodes.
 
int max30009_set_pll_config (struct max30009_dev *device, struct max30009_pll_config *pll_config)
 Set complete PLL configuration.
 
int max30009_get_pll_config (struct max30009_dev *device, struct max30009_pll_config *pll_config)
 Get complete PLL configuration.
 
int max30009_set_fifo_config (struct max30009_dev *device, struct max30009_fifo_config *fifo_config)
 Set complete FIFO configuration.
 
int max30009_get_fifo_config (struct max30009_dev *device, struct max30009_fifo_config *fifo_config)
 Get complete FIFO configuration.
 
int max30009_set_bioz_config (struct max30009_dev *device, struct max30009_bioz_config *bioz_config)
 Set complete BioZ configuration.
 
int max30009_get_bioz_config (struct max30009_dev *device, struct max30009_bioz_config *bioz_config)
 Get complete BioZ configuration.
 
int max30009_set_bioz_mux_config (struct max30009_dev *device, struct max30009_bioz_mux_config *mux_config)
 Set complete BioZ MUX configuration.
 
int max30009_get_bioz_mux_config (struct max30009_dev *device, struct max30009_bioz_mux_config *mux_config)
 Get complete BioZ MUX configuration.
 
int max30009_set_lead_detect_config (struct max30009_dev *device, struct max30009_lead_detect_config *lead_config)
 Set complete lead detection configuration.
 
int max30009_get_lead_detect_config (struct max30009_dev *device, struct max30009_lead_detect_config *lead_config)
 Get complete lead detection configuration.
 
int max30009_interrupt_config (struct max30009_dev *device, uint8_t int1_mask, uint8_t int2_mask)
 Configure interrupt enables.
 
int max30009_enable_interrupt (struct max30009_dev *device, enum max30009_interrupt interrupt, bool enable)
 Enable or disable a specific interrupt.
 
int max30009_clear_status (struct max30009_dev *device)
 Clear interrupt status registers.
 

Detailed Description

Header file for MAX30009 driver.

Author
Edelweise Escala (edelw.nosp@m.eise.nosp@m..esca.nosp@m.la@a.nosp@m.nalog.nosp@m..com)

Copyright 2026(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ MAX30009_A_FULL_EN_MSK

#define MAX30009_A_FULL_EN_MSK   NO_OS_BIT(7)

◆ MAX30009_A_FULL_TYPE_MSK

#define MAX30009_A_FULL_TYPE_MSK   NO_OS_BIT(2)

◆ MAX30009_BIN_ASSIGN_MSK

#define MAX30009_BIN_ASSIGN_MSK   NO_OS_GENMASK(5, 4)

◆ MAX30009_BIOZ_ADC_OSR_MSK

#define MAX30009_BIOZ_ADC_OSR_MSK   NO_OS_GENMASK(5, 3)

◆ MAX30009_BIOZ_AHPF_MSK

#define MAX30009_BIOZ_AHPF_MSK   NO_OS_GENMASK(7, 4)

◆ MAX30009_BIOZ_AMP_BW_MSK

#define MAX30009_BIOZ_AMP_BW_MSK   NO_OS_GENMASK(1, 0)

◆ MAX30009_BIOZ_AMP_RGE_MSK

#define MAX30009_BIOZ_AMP_RGE_MSK   NO_OS_GENMASK(3, 2)

◆ MAX30009_BIOZ_BG_EN_MSK

#define MAX30009_BIOZ_BG_EN_MSK   NO_OS_BIT(2)

◆ MAX30009_BIOZ_CH_FSEL_MSK

#define MAX30009_BIOZ_CH_FSEL_MSK   NO_OS_BIT(0)

◆ MAX30009_BIOZ_CMP_MSK

#define MAX30009_BIOZ_CMP_MSK   NO_OS_GENMASK(2, 1)

◆ MAX30009_BIOZ_DAC_OSR_MSK

#define MAX30009_BIOZ_DAC_OSR_MSK   NO_OS_GENMASK(7, 6)

◆ MAX30009_BIOZ_DAC_RESET_MSK

#define MAX30009_BIOZ_DAC_RESET_MSK   NO_OS_BIT(4)

◆ MAX30009_BIOZ_DC_RESTORE_MSK

#define MAX30009_BIOZ_DC_RESTORE_MSK   NO_OS_BIT(6)

◆ MAX30009_BIOZ_DHPF_MSK

#define MAX30009_BIOZ_DHPF_MSK   NO_OS_GENMASK(7, 6)

◆ MAX30009_BIOZ_DLPF_MSK

#define MAX30009_BIOZ_DLPF_MSK   NO_OS_GENMASK(5, 3)

◆ MAX30009_BIOZ_DM_DIS_MSK

#define MAX30009_BIOZ_DM_DIS_MSK   NO_OS_BIT(2)

◆ MAX30009_BIOZ_DRV_MODE_MSK

#define MAX30009_BIOZ_DRV_MODE_MSK   NO_OS_GENMASK(1, 0)

◆ MAX30009_BIOZ_DRV_RESET_MSK

#define MAX30009_BIOZ_DRV_RESET_MSK   NO_OS_BIT(5)

◆ MAX30009_BIOZ_EXT_CAP_MSK

#define MAX30009_BIOZ_EXT_CAP_MSK   NO_OS_BIT(7)

◆ MAX30009_BIOZ_EXT_RES_MSK

#define MAX30009_BIOZ_EXT_RES_MSK   NO_OS_BIT(7)

◆ MAX30009_BIOZ_FAST_MANUAL_MSK

#define MAX30009_BIOZ_FAST_MANUAL_MSK   NO_OS_BIT(1)

◆ MAX30009_BIOZ_FAST_START_EN_MSK

#define MAX30009_BIOZ_FAST_START_EN_MSK   NO_OS_BIT(0)

◆ MAX30009_BIOZ_GAIN_MSK

#define MAX30009_BIOZ_GAIN_MSK   NO_OS_GENMASK(1, 0)

◆ MAX30009_BIOZ_HI_THRESH_MSK

#define MAX30009_BIOZ_HI_THRESH_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_BIOZ_I_CLK_PHASE_MSK

#define MAX30009_BIOZ_I_CLK_PHASE_MSK   NO_OS_BIT(2)

◆ MAX30009_BIOZ_I_EN_MSK

#define MAX30009_BIOZ_I_EN_MSK   NO_OS_BIT(0)

◆ MAX30009_BIOZ_IDRV_RGE_MSK

#define MAX30009_BIOZ_IDRV_RGE_MSK   NO_OS_GENMASK(3, 2)

◆ MAX30009_BIOZ_INA_CHOP_EN_MSK

#define MAX30009_BIOZ_INA_CHOP_EN_MSK   NO_OS_BIT(1)

◆ MAX30009_BIOZ_INA_MODE_MSK

#define MAX30009_BIOZ_INA_MODE_MSK   NO_OS_BIT(3)

◆ MAX30009_BIOZ_LO_THRESH_MSK

#define MAX30009_BIOZ_LO_THRESH_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_BIOZ_OVER_EN_MSK

#define MAX30009_BIOZ_OVER_EN_MSK   NO_OS_BIT(6)

◆ MAX30009_BIOZ_Q_CLK_PHASE_MSK

#define MAX30009_BIOZ_Q_CLK_PHASE_MSK   NO_OS_BIT(3)

◆ MAX30009_BIOZ_Q_EN_MSK

#define MAX30009_BIOZ_Q_EN_MSK   NO_OS_BIT(1)

◆ MAX30009_BIOZ_STBYON_MSK

#define MAX30009_BIOZ_STBYON_MSK   NO_OS_BIT(4)

◆ MAX30009_BIOZ_UNDR_EN_MSK

#define MAX30009_BIOZ_UNDR_EN_MSK   NO_OS_BIT(5)

◆ MAX30009_BIOZ_VDRV_MAG_MSK

#define MAX30009_BIOZ_VDRV_MAG_MSK   NO_OS_GENMASK(5, 4)

◆ MAX30009_BIP_ASSIGN_MSK

#define MAX30009_BIP_ASSIGN_MSK   NO_OS_GENMASK(7, 6)

◆ MAX30009_BIST_R_ERR_MSK

#define MAX30009_BIST_R_ERR_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_BMUX_BIST_EN_MSK

#define MAX30009_BMUX_BIST_EN_MSK   NO_OS_BIT(5)

◆ MAX30009_BMUX_RSEL_MSK

#define MAX30009_BMUX_RSEL_MSK   NO_OS_GENMASK(7, 6)

◆ MAX30009_CAL_EN_MSK

#define MAX30009_CAL_EN_MSK   NO_OS_BIT(0)

◆ MAX30009_CLK_FINE_TUNE_MSK

#define MAX30009_CLK_FINE_TUNE_MSK   NO_OS_GENMASK(4, 0)

◆ MAX30009_CLK_FREQ_SEL_MSK

#define MAX30009_CLK_FREQ_SEL_MSK   NO_OS_BIT(5)

◆ MAX30009_CONNECT_CAL_ONLY_MSK

#define MAX30009_CONNECT_CAL_ONLY_MSK   NO_OS_BIT(2)

◆ MAX30009_DC_LOFF_NH_EN_MSK

#define MAX30009_DC_LOFF_NH_EN_MSK   NO_OS_BIT(1)

◆ MAX30009_DC_LOFF_NL_EN_MSK

#define MAX30009_DC_LOFF_NL_EN_MSK   NO_OS_BIT(0)

◆ MAX30009_DC_LOFF_PH_EN_MSK

#define MAX30009_DC_LOFF_PH_EN_MSK   NO_OS_BIT(3)

◆ MAX30009_DC_LOFF_PL_EN_MSK

#define MAX30009_DC_LOFF_PL_EN_MSK   NO_OS_BIT(2)

◆ MAX30009_DISABLE_I2C_MSK

#define MAX30009_DISABLE_I2C_MSK   NO_OS_BIT(6)

◆ MAX30009_DRV_OOR_EN_MSK

#define MAX30009_DRV_OOR_EN_MSK   NO_OS_BIT(4)

◆ MAX30009_DRVN_ASSIGN_MSK

#define MAX30009_DRVN_ASSIGN_MSK   NO_OS_GENMASK(1, 0)

◆ MAX30009_DRVP_ASSIGN_MSK

#define MAX30009_DRVP_ASSIGN_MSK   NO_OS_GENMASK(3, 2)

◆ MAX30009_EN_BIOZ_THRESH_MSK

#define MAX30009_EN_BIOZ_THRESH_MSK   NO_OS_BIT(0)

◆ MAX30009_EN_DRV_OOR_MSK

#define MAX30009_EN_DRV_OOR_MSK   NO_OS_BIT(4)

◆ MAX30009_EN_EXT_INLOAD_MSK

#define MAX30009_EN_EXT_INLOAD_MSK   NO_OS_BIT(1)

◆ MAX30009_EN_EXT_LOFF_MSK

#define MAX30009_EN_EXT_LOFF_MSK   NO_OS_BIT(5)

◆ MAX30009_EN_INT_INLOAD_MSK

#define MAX30009_EN_INT_INLOAD_MSK   NO_OS_BIT(0)

◆ MAX30009_EN_LOFF_DET_MSK

#define MAX30009_EN_LOFF_DET_MSK   NO_OS_BIT(6)

◆ MAX30009_EN_LON_DET_MSK

#define MAX30009_EN_LON_DET_MSK   NO_OS_BIT(7)

◆ MAX30009_EN_RBIAS_BIN_MSK

#define MAX30009_EN_RBIAS_BIN_MSK   NO_OS_BIT(0)

◆ MAX30009_EN_RBIAS_BIP_MSK

#define MAX30009_EN_RBIAS_BIP_MSK   NO_OS_BIT(1)

◆ MAX30009_FIFO_A_FULL_MSK

#define MAX30009_FIFO_A_FULL_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_FIFO_DATA_COUNT_LSB_MSK

#define MAX30009_FIFO_DATA_COUNT_LSB_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_FIFO_DATA_COUNT_MSB_MSK

#define MAX30009_FIFO_DATA_COUNT_MSB_MSK   NO_OS_BIT(7)

◆ MAX30009_FIFO_DATA_MASK

#define MAX30009_FIFO_DATA_MASK   NO_OS_GENMASK(19, 0)

◆ MAX30009_FIFO_DATA_MSK

#define MAX30009_FIFO_DATA_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_FIFO_DATA_RDY_EN_MSK

#define MAX30009_FIFO_DATA_RDY_EN_MSK   NO_OS_BIT(5)

◆ MAX30009_FIFO_DATA_SIZE

#define MAX30009_FIFO_DATA_SIZE   3

◆ MAX30009_FIFO_DEPTH

#define MAX30009_FIFO_DEPTH   256

◆ MAX30009_FIFO_MARK_MSK

#define MAX30009_FIFO_MARK_MSK   NO_OS_BIT(5)

◆ MAX30009_FIFO_RO_MSK

#define MAX30009_FIFO_RO_MSK   NO_OS_BIT(1)

◆ MAX30009_FIFO_SIGN_BIT

#define MAX30009_FIFO_SIGN_BIT   NO_OS_BIT(19)

◆ MAX30009_FIFO_SIGN_EXT

#define MAX30009_FIFO_SIGN_EXT   0xFFF00000UL

◆ MAX30009_FIFO_STAT_CLR_MSK

#define MAX30009_FIFO_STAT_CLR_MSK   NO_OS_BIT(3)

◆ MAX30009_FIFO_TAG_MASK

#define MAX30009_FIFO_TAG_MASK   NO_OS_GENMASK(3, 0)

◆ MAX30009_FIFO_TAG_SHIFT

#define MAX30009_FIFO_TAG_SHIFT   20

◆ MAX30009_FLUSH_FIFO_MSK

#define MAX30009_FLUSH_FIFO_MSK   NO_OS_BIT(4)

◆ MAX30009_FREQ_LOCK_EN_MSK

#define MAX30009_FREQ_LOCK_EN_MSK   NO_OS_BIT(3)

◆ MAX30009_FREQ_UNLOCK_EN_MSK

#define MAX30009_FREQ_UNLOCK_EN_MSK   NO_OS_BIT(4)

◆ MAX30009_GSR_LOAD_EN_MSK

#define MAX30009_GSR_LOAD_EN_MSK   NO_OS_BIT(5)

◆ MAX30009_GSR_RSEL_MSK

#define MAX30009_GSR_RSEL_MSK   NO_OS_GENMASK(7, 6)

◆ MAX30009_I2C_ADDRESS

#define MAX30009_I2C_ADDRESS   0x68

◆ MAX30009_I2C_BCAST_ADDR_MSK

#define MAX30009_I2C_BCAST_ADDR_MSK   NO_OS_GENMASK(6, 1)

◆ MAX30009_I2C_BCAST_EN_MSK

#define MAX30009_I2C_BCAST_EN_MSK   NO_OS_BIT(0)

◆ MAX30009_INT_FCFG_MSK

#define MAX30009_INT_FCFG_MSK   NO_OS_GENMASK(3, 2)

◆ MAX30009_INT_OCFG_MSK

#define MAX30009_INT_OCFG_MSK   NO_OS_GENMASK(3, 2)

◆ MAX30009_KDIV_MSK

#define MAX30009_KDIV_MSK   NO_OS_GENMASK(4, 1)

◆ MAX30009_LOFF_IMAG_MSK

#define MAX30009_LOFF_IMAG_MSK   NO_OS_GENMASK(2, 0)

◆ MAX30009_LOFF_IPOL_MSK

#define MAX30009_LOFF_IPOL_MSK   NO_OS_BIT(3)

◆ MAX30009_LOFF_RAPID_MSK

#define MAX30009_LOFF_RAPID_MSK   NO_OS_BIT(6)

◆ MAX30009_LOFF_THRESH_MSK

#define MAX30009_LOFF_THRESH_MSK   NO_OS_GENMASK(3, 0)

◆ MAX30009_LON_EN_MSK

#define MAX30009_LON_EN_MSK   NO_OS_BIT(7)

◆ MAX30009_MASTER_MSK

#define MAX30009_MASTER_MSK   NO_OS_BIT(7)

◆ MAX30009_MDIV_LSB_MSK

#define MAX30009_MDIV_LSB_MSK   NO_OS_GENMASK(7, 0)

◆ MAX30009_MDIV_MSB_MSK

#define MAX30009_MDIV_MSB_MSK   NO_OS_GENMASK(7, 6)

◆ MAX30009_MUX_EN_MSK

#define MAX30009_MUX_EN_MSK   NO_OS_BIT(1)

◆ MAX30009_NDIV_MSK

#define MAX30009_NDIV_MSK   NO_OS_BIT(5)

◆ MAX30009_OVF_COUNTER_MSK

#define MAX30009_OVF_COUNTER_MSK   NO_OS_GENMASK(6, 0)

◆ MAX30009_PART_ID_VALUE

#define MAX30009_PART_ID_VALUE   0x42

◆ MAX30009_PHASE_LOCK_EN_MSK

#define MAX30009_PHASE_LOCK_EN_MSK   NO_OS_BIT(1)

◆ MAX30009_PHASE_UNLOCK_EN_MSK

#define MAX30009_PHASE_UNLOCK_EN_MSK   NO_OS_BIT(2)

◆ MAX30009_PLL_EN_MSK

#define MAX30009_PLL_EN_MSK   NO_OS_BIT(0)

◆ MAX30009_PLL_LOCK_TIMEOUT_MS

#define MAX30009_PLL_LOCK_TIMEOUT_MS   1000

◆ MAX30009_PLL_LOCK_WNDW_MSK

#define MAX30009_PLL_LOCK_WNDW_MSK   NO_OS_BIT(0)

◆ MAX30009_RBIAS_VAL_MSK

#define MAX30009_RBIAS_VAL_MSK   NO_OS_GENMASK(3, 2)

◆ MAX30009_REF_CLK_32000_HZ

#define MAX30009_REF_CLK_32000_HZ   32000

◆ MAX30009_REF_CLK_32768_HZ

#define MAX30009_REF_CLK_32768_HZ   32768

◆ MAX30009_REF_CLK_SEL_MSK

#define MAX30009_REF_CLK_SEL_MSK   NO_OS_BIT(6)

◆ MAX30009_REG_BIOZ_CONFIGURATION1

#define MAX30009_REG_BIOZ_CONFIGURATION1   0x20

◆ MAX30009_REG_BIOZ_CONFIGURATION2

#define MAX30009_REG_BIOZ_CONFIGURATION2   0x21

◆ MAX30009_REG_BIOZ_CONFIGURATION3

#define MAX30009_REG_BIOZ_CONFIGURATION3   0x22

◆ MAX30009_REG_BIOZ_CONFIGURATION4

#define MAX30009_REG_BIOZ_CONFIGURATION4   0x23

◆ MAX30009_REG_BIOZ_CONFIGURATION5

#define MAX30009_REG_BIOZ_CONFIGURATION5   0x24

◆ MAX30009_REG_BIOZ_CONFIGURATION6

#define MAX30009_REG_BIOZ_CONFIGURATION6   0x25

◆ MAX30009_REG_BIOZ_CONFIGURATION7

#define MAX30009_REG_BIOZ_CONFIGURATION7   0x28

◆ MAX30009_REG_BIOZ_HIGH_THRESHOLD

#define MAX30009_REG_BIOZ_HIGH_THRESHOLD   0x27

◆ MAX30009_REG_BIOZ_LOW_THRESHOLD

#define MAX30009_REG_BIOZ_LOW_THRESHOLD   0x26

◆ MAX30009_REG_BIOZ_MUX_CONFIGURATION1

#define MAX30009_REG_BIOZ_MUX_CONFIGURATION1   0x41

◆ MAX30009_REG_BIOZ_MUX_CONFIGURATION2

#define MAX30009_REG_BIOZ_MUX_CONFIGURATION2   0x42

◆ MAX30009_REG_BIOZ_MUX_CONFIGURATION3

#define MAX30009_REG_BIOZ_MUX_CONFIGURATION3   0x43

◆ MAX30009_REG_BIOZ_MUX_CONFIGURATION4

#define MAX30009_REG_BIOZ_MUX_CONFIGURATION4   0x44

◆ MAX30009_REG_DC_LEAD_DETECT_THRESHOLD

#define MAX30009_REG_DC_LEAD_DETECT_THRESHOLD   0x51

◆ MAX30009_REG_DC_LEADS_CONFIGURATION

#define MAX30009_REG_DC_LEADS_CONFIGURATION   0x50

◆ MAX30009_REG_FIFO_CONFIGURATION1

#define MAX30009_REG_FIFO_CONFIGURATION1   0x0D

◆ MAX30009_REG_FIFO_CONFIGURATION2

#define MAX30009_REG_FIFO_CONFIGURATION2   0x0E

◆ MAX30009_REG_FIFO_COUNTER1

#define MAX30009_REG_FIFO_COUNTER1   0x0A

◆ MAX30009_REG_FIFO_COUNTER2

#define MAX30009_REG_FIFO_COUNTER2   0x0B

◆ MAX30009_REG_FIFO_DATA_REGISTER

#define MAX30009_REG_FIFO_DATA_REGISTER   0x0C

◆ MAX30009_REG_FIFO_READ_POINTER

#define MAX30009_REG_FIFO_READ_POINTER   0x09

◆ MAX30009_REG_FIFO_WRITE_POINTER

#define MAX30009_REG_FIFO_WRITE_POINTER   0x08

◆ MAX30009_REG_I2C_BROADCAST_ADDRESS

#define MAX30009_REG_I2C_BROADCAST_ADDRESS   0x14

◆ MAX30009_REG_INTERRUPT_ENABLE1

#define MAX30009_REG_INTERRUPT_ENABLE1   0x80

◆ MAX30009_REG_INTERRUPT_ENABLE2

#define MAX30009_REG_INTERRUPT_ENABLE2   0x81

◆ MAX30009_REG_LEAD_BIAS_CONFIGURATION1

#define MAX30009_REG_LEAD_BIAS_CONFIGURATION1   0x58

◆ MAX30009_REG_OUTPUT_PIN_CONFIGURATION

#define MAX30009_REG_OUTPUT_PIN_CONFIGURATION   0x13

◆ MAX30009_REG_PART_ID

#define MAX30009_REG_PART_ID   0xFF

◆ MAX30009_REG_PIN_FUNC_CONFIGURATION

#define MAX30009_REG_PIN_FUNC_CONFIGURATION   0x12

◆ MAX30009_REG_PLL_CONFIGURATION1

#define MAX30009_REG_PLL_CONFIGURATION1   0x17

◆ MAX30009_REG_PLL_CONFIGURATION2

#define MAX30009_REG_PLL_CONFIGURATION2   0x18

◆ MAX30009_REG_PLL_CONFIGURATION3

#define MAX30009_REG_PLL_CONFIGURATION3   0x19

◆ MAX30009_REG_PLL_CONFIGURATION4

#define MAX30009_REG_PLL_CONFIGURATION4   0x1A

◆ MAX30009_REG_STATUS1

#define MAX30009_REG_STATUS1   0x00

◆ MAX30009_REG_STATUS2

#define MAX30009_REG_STATUS2   0x01

◆ MAX30009_REG_SYSTEM_CONFIGURATION1

#define MAX30009_REG_SYSTEM_CONFIGURATION1   0x11

◆ MAX30009_REG_SYSTEM_SYNC

#define MAX30009_REG_SYSTEM_SYNC   0x10

◆ MAX30009_RESET_MSK

#define MAX30009_RESET_MSK   NO_OS_BIT(0)

◆ MAX30009_SHDN_MSK

#define MAX30009_SHDN_MSK   NO_OS_BIT(1)

◆ MAX30009_STATUS1_A_FULL_MSK

#define MAX30009_STATUS1_A_FULL_MSK   NO_OS_BIT(7)

◆ MAX30009_STATUS1_FIFO_DATA_RDY_MSK

#define MAX30009_STATUS1_FIFO_DATA_RDY_MSK   NO_OS_BIT(5)

◆ MAX30009_STATUS1_FREQ_LOCK_MSK

#define MAX30009_STATUS1_FREQ_LOCK_MSK   NO_OS_BIT(3)

◆ MAX30009_STATUS1_FREQ_UNLOCK_MSK

#define MAX30009_STATUS1_FREQ_UNLOCK_MSK   NO_OS_BIT(4)

◆ MAX30009_STATUS1_PHASE_LOCK_MSK

#define MAX30009_STATUS1_PHASE_LOCK_MSK   NO_OS_BIT(1)

◆ MAX30009_STATUS1_PHASE_UNLOCK_MSK

#define MAX30009_STATUS1_PHASE_UNLOCK_MSK   NO_OS_BIT(2)

◆ MAX30009_STATUS1_PWR_RDY_MSK

#define MAX30009_STATUS1_PWR_RDY_MSK   NO_OS_BIT(0)

◆ MAX30009_STATUS2_BIOZ_OVER_MSK

#define MAX30009_STATUS2_BIOZ_OVER_MSK   NO_OS_BIT(6)

◆ MAX30009_STATUS2_BIOZ_UNDR_MSK

#define MAX30009_STATUS2_BIOZ_UNDR_MSK   NO_OS_BIT(5)

◆ MAX30009_STATUS2_DC_LOFF_NH_MSK

#define MAX30009_STATUS2_DC_LOFF_NH_MSK   NO_OS_BIT(1)

◆ MAX30009_STATUS2_DC_LOFF_NL_MSK

#define MAX30009_STATUS2_DC_LOFF_NL_MSK   NO_OS_BIT(0)

◆ MAX30009_STATUS2_DC_LOFF_PH_MSK

#define MAX30009_STATUS2_DC_LOFF_PH_MSK   NO_OS_BIT(3)

◆ MAX30009_STATUS2_DC_LOFF_PL_MSK

#define MAX30009_STATUS2_DC_LOFF_PL_MSK   NO_OS_BIT(2)

◆ MAX30009_STATUS2_DRV_OOR_MSK

#define MAX30009_STATUS2_DRV_OOR_MSK   NO_OS_BIT(4)

◆ MAX30009_STATUS2_LON_MSK

#define MAX30009_STATUS2_LON_MSK   NO_OS_BIT(7)

◆ MAX30009_TIMING_SYS_RESET_MSK

#define MAX30009_TIMING_SYS_RESET_MSK   NO_OS_BIT(7)

◆ MAX30009_TRIG_ICFG_MSK

#define MAX30009_TRIG_ICFG_MSK   NO_OS_BIT(0)

◆ MAX30009_TRIG_OCFG_MSK

#define MAX30009_TRIG_OCFG_MSK   NO_OS_GENMASK(1, 0)

Enumeration Type Documentation

◆ max30009_adc_osr

Enumerator
MAX30009_ADC_OSR_8 
MAX30009_ADC_OSR_16 
MAX30009_ADC_OSR_32 
MAX30009_ADC_OSR_64 
MAX30009_ADC_OSR_128 
MAX30009_ADC_OSR_256 
MAX30009_ADC_OSR_512 
MAX30009_ADC_OSR_1024 

◆ max30009_ahpf

Enumerator
MAX30009_AHPF_100HZ 
MAX30009_AHPF_200HZ 
MAX30009_AHPF_500HZ 
MAX30009_AHPF_1KHZ 
MAX30009_AHPF_2KHZ 
MAX30009_AHPF_5KHZ 
MAX30009_AHPF_10KHZ 
MAX30009_AHPF_BYPASS 
MAX30009_AHPF_42M4K_OHM 
MAX30009_AHPF_21M2K_OHM 
MAX30009_AHPF_8M4K_OHM 
MAX30009_AHPF_4M2K_OHM 
MAX30009_AHPF_2M2K_OHM 
MAX30009_AHPF_848K_OHM 

◆ max30009_bia_rsel

Enumerator
MAX30009_BIA_5100_OHM 
MAX30009_BIA_900_OHM 
MAX30009_BIA_600_OHM 
MAX30009_BIA_280_OHM 

◆ max30009_bioz_bw

Enumerator
MAX30009_BIOZ_LOW_BW 
MAX30009_BIOZ_MEDIUM_LOW_BW 
MAX30009_BIOZ_MEDIUM_HIGH_BW 
MAX30009_BIOZ_HIGH_BW 

◆ max30009_bioz_drv_mode

Enumerator
MAX30009_CURRENT_DRV_MODE 
MAX30009_VOLTAGE_DRV_MODE 
MAX30009_H_BRIDGE_DRV_MODE 
MAX30009_STANDBY_MODE 

◆ max30009_bioz_gain

Enumerator
MAX30009_BIOZ_GAIN_1 
MAX30009_BIOZ_GAIN_2 
MAX30009_BIOZ_GAIN_5 
MAX30009_BIOZ_GAIN_10 

◆ max30009_dac_osr

Enumerator
MAX30009_DAC_OSR_32 
MAX30009_DAC_OSR_64 
MAX30009_DAC_OSR_128 
MAX30009_DAC_OSR_256 

◆ max30009_dhpf

Enumerator
MAX30009_DHPF_BYPASS 
MAX30009_DHPF_0_00025_SR 
MAX30009_DHPF_0_002_SR 

◆ max30009_dlpf

Enumerator
MAX30009_DLPF_BYPASS 
MAX30009_DLPF_0_005_SR 
MAX30009_DLPF_0_02_SR 
MAX30009_DLPF_0_08_SR 
MAX30009_DLPF_0_25_SR 

◆ max30009_drive_mode

Enumerator
MAX30009_DRIVE_SINE_CURRENT 
MAX30009_DRIVE_SINE_VOLTAGE 
MAX30009_DRIVE_HBRIDGE 
MAX30009_DRIVE_STANDBY 

◆ max30009_fifo_sample_type

Enumerator
MAX30009_FIFO_SAMPLE_IN_PHASE 
MAX30009_FIFO_SAMPLE_QUADRATURE 
MAX30009_FIFO_SAMPLE_MARKER 
MAX30009_FIFO_SAMPLE_INVALID 

◆ max30009_gsr_rsel

Enumerator
MAX30009_GSR_25K7_OHM 
MAX30009_GSR_101K_OHM 
MAX30009_GSR_505K_OHM 
MAX30009_GSR_1M_OHM 

◆ max30009_interrupt

Enumerator
MAX30009_INT_A_FULL 
MAX30009_INT_FIFO_DATA_RDY 
MAX30009_INT_FREQ_UNLOCK 
MAX30009_INT_FREQ_LOCK 
MAX30009_INT_PHASE_UNLOCK 
MAX30009_INT_PHASE_LOCK 
MAX30009_INT_LON 
MAX30009_INT_BIOZ_OVER 
MAX30009_INT_BIOZ_UNDR 
MAX30009_INT_DRV_OOR 
MAX30009_INT_DC_LOFF_PH 
MAX30009_INT_DC_LOFF_PL 
MAX30009_INT_DC_LOFF_NH 
MAX30009_INT_DC_LOFF_NL 

◆ max30009_loff_current

Enumerator
MAX30009_LOFF_DISABLE 
MAX30009_LOFF_5NA 
MAX30009_LOFF_10NA 
MAX30009_LOFF_20NA 
MAX30009_LOFF_50NA 
MAX30009_LOFF_100NA 

◆ max30009_pll_kdiv

Enumerator
MAX30009_KDIV_1 
MAX30009_KDIV_2 
MAX30009_KDIV_4 
MAX30009_KDIV_8 
MAX30009_KDIV_16 
MAX30009_KDIV_32 
MAX30009_KDIV_64 
MAX30009_KDIV_128 
MAX30009_KDIV_256 
MAX30009_KDIV_512 
MAX30009_KDIV_1024 
MAX30009_KDIV_2048 
MAX30009_KDIV_4096 
MAX30009_KDIV_8192 

◆ max30009_pll_ndiv

Enumerator
MAX30009_NDIV_512 
MAX30009_NDIV_1024 

◆ max30009_rbias_val

Enumerator
MAX30009_RBIAS_50M_OHM 
MAX30009_RBIAS_100M_OHM 
MAX30009_RBIAS_200M_OHM 
MAX30009_RBIAS_RESERVED 

Function Documentation

◆ max30009_assign_electrodes()

int max30009_assign_electrodes ( struct max30009_dev * device,
uint8_t bip_assign,
uint8_t bin_assign,
uint8_t drvp_assign,
uint8_t drvn_assign )

Assign electrodes to measurement channels.

Assign electrodes to measurement channels

Parameters
device- Device descriptor
bip_assign- BIP (positive receive) electrode assignment
bin_assign- BIN (negative receive) electrode assignment
drvp_assign- DRVP (positive drive) electrode assignment
drvn_assign- DRVN (negative drive) electrode assignment
Returns
0 in case of success, negative error code otherwise

◆ max30009_bioz_bg_enable()

int max30009_bioz_bg_enable ( struct max30009_dev * device,
bool enable )

Enable or disable BioZ bandgap.

Enable or disable BioZ bandgap

Parameters
device- MAX30009 device descriptor
enable- True to enable bandgap, false to disable
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_bioz_enable()

int max30009_bioz_enable ( struct max30009_dev * device,
bool enable )

Enable or disable BioZ measurement.

Enable or disable BioZ measurement

Parameters
device- MAX30009 device descriptor
enable- True to enable BioZ, false to disable
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_bioz_i_enable()

int max30009_bioz_i_enable ( struct max30009_dev * device,
bool enable )

Enable or disable BioZ I channel.

Enable or disable BioZ I channel

Parameters
device- MAX30009 device descriptor
enable- True to enable I channel, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_bioz_q_enable()

int max30009_bioz_q_enable ( struct max30009_dev * device,
bool enable )

Enable or disable BioZ Q channel.

Enable or disable BioZ Q channel

Parameters
device- MAX30009 device descriptor
enable- True to enable Q channel, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_calibration_connect_only()

int max30009_calibration_connect_only ( struct max30009_dev * device,
bool cal_only )

Set calibration connect-only mode.

Set calibration connect-only mode

Parameters
device- Device descriptor
cal_only- True for connect-only mode, false for normal
Returns
0 in case of success, negative error code otherwise

◆ max30009_check_lead_off()

int max30009_check_lead_off ( struct max30009_dev * device,
bool * leads_on )

Check lead-off detection status.

Check lead-off detection status

Parameters
device- MAX30009 device descriptor
leads_on- True if leads connected
Returns
0 in case of success, negative error code otherwise

◆ max30009_clear_fifo_status()

int max30009_clear_fifo_status ( struct max30009_dev * device)

Clear FIFO status flags.

Clear FIFO status flags

Parameters
device- Device descriptor
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_clear_status()

int max30009_clear_status ( struct max30009_dev * device)

Clear interrupt status registers.

Clear interrupt status registers

Parameters
device- MAX30009 device descriptor
Returns
0 in case of success, negative error code otherwise
Note
Reading the status registers clears them
Here is the caller graph for this function:

◆ max30009_clock_fine_tune()

int max30009_clock_fine_tune ( struct max30009_dev * device,
uint8_t tune_val )

Fine tune internal clock frequency.

Fine tune internal clock frequency

Parameters
device- Device descriptor
tune_val- Fine tune value (0-31, ±0.78% adjustment range)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_configure_i2c_broadcast()

int max30009_configure_i2c_broadcast ( struct max30009_dev * device,
bool enable,
uint8_t broadcast_addr )

Configure I2C broadcast address.

Configure I2C broadcast address

Parameters
device- Device descriptor
enable- True to enable broadcast, false to disable
broadcast_addr- Broadcast address (7-bit, shifted left by 1)
Returns
0 in case of success, negative error code otherwise
Note
Allows multiple devices to respond to broadcast address

◆ max30009_configure_int_pin()

int max30009_configure_int_pin ( struct max30009_dev * device,
uint8_t func_cfg,
uint8_t out_cfg )

Configure INT pin function and output.

Configure INT pin function and output

Parameters
device- Device descriptor
func_cfg- Function configuration (0-3)
out_cfg- Output configuration (0-3)
Returns
0 in case of success, negative error code otherwise

◆ max30009_configure_trig_pin()

int max30009_configure_trig_pin ( struct max30009_dev * device,
uint8_t input_cfg,
uint8_t output_cfg )

Configure TRIG pin input and output.

Configure TRIG pin input and output

Parameters
device- Device descriptor
input_cfg- Input configuration (0 or 1)
output_cfg- Output configuration (0-3)
Returns
0 in case of success, negative error code otherwise

◆ max30009_disable_differential_mode()

int max30009_disable_differential_mode ( struct max30009_dev * device,
bool disable )

Disable differential mode (enable single-ended)

Disable differential mode - enable single-ended

Parameters
device- Device descriptor
disable- True to disable differential mode, false for differential
Returns
0 in case of success, negative error code otherwise

◆ max30009_disable_i2c()

int max30009_disable_i2c ( struct max30009_dev * device)

Disable I2C interface (SPI only mode)

Disable I2C interface - SPI only mode

Parameters
device- Device descriptor
Returns
0 in case of success, negative error code otherwise
Note
After disabling I2C, device only responds to SPI

◆ max30009_enable_bia_bist()

int max30009_enable_bia_bist ( struct max30009_dev * device,
bool enable )

Enable or disable BIA BIST (Built-In Self Test)

Enable or disable BIA BIST (Built-In Self Test)

Parameters
device- Device descriptor
enable- True to enable BIST, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_bioz_threshold()

int max30009_enable_bioz_threshold ( struct max30009_dev * device,
bool enable )

Enable or disable BioZ threshold detection.

Enable or disable BioZ threshold detection

Parameters
device- Device descriptor
enable- True to enable threshold detection, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_calibration()

int max30009_enable_calibration ( struct max30009_dev * device,
bool enable )

Enable or disable calibration mode.

Enable or disable calibration mode

Parameters
device- Device descriptor
enable- True to enable calibration, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_calibration_mux()

int max30009_enable_calibration_mux ( struct max30009_dev * device,
bool enable )

Enable or disable calibration MUX.

Enable or disable calibration MUX

Parameters
device- Device descriptor
enable- True to enable calibration MUX, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_dac_reset()

int max30009_enable_dac_reset ( struct max30009_dev * device,
bool enable )

Enable or disable DAC reset.

Enable or disable DAC reset

Parameters
device- Device descriptor
enable- True to enable DAC reset, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_dc_restore()

int max30009_enable_dc_restore ( struct max30009_dev * device,
bool enable )

Enable or disable DC restore circuit.

Enable or disable DC restore circuit

Parameters
device- Device descriptor
enable- True to enable DC restore, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_drive_oor_detect()

int max30009_enable_drive_oor_detect ( struct max30009_dev * device,
bool enable )

Enable or disable drive out-of-range detection.

Enable or disable drive out-of-range detection

Parameters
device- Device descriptor
enable- True to enable drive OOR detection, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_drive_reset()

int max30009_enable_drive_reset ( struct max30009_dev * device,
bool enable )

Enable or disable drive reset.

Enable or disable drive reset

Parameters
device- Device descriptor
enable- True to enable drive reset, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_external_cap()

int max30009_enable_external_cap ( struct max30009_dev * device,
bool enable )

Enable or disable external capacitor.

Enable or disable external capacitor

Parameters
device- Device descriptor
enable- True to enable external capacitor, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_external_lead_off()

int max30009_enable_external_lead_off ( struct max30009_dev * device,
bool enable )

Enable or disable external lead-off detection.

Enable or disable external lead-off detection for AC-coupled electrodes

Parameters
device- Device descriptor
enable- True to enable external lead-off detection, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_external_load()

int max30009_enable_external_load ( struct max30009_dev * device,
bool enable )

Enable or disable external load connection.

Enable or disable external load connection

Parameters
device- Device descriptor
enable- True to enable external load connection, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_external_resistor()

int max30009_enable_external_resistor ( struct max30009_dev * device,
bool enable )

Enable or disable external resistor for current drive.

Enable or disable external resistor for current drive

Parameters
device- Device descriptor
enable- True to enable external resistor, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_fast_start()

int max30009_enable_fast_start ( struct max30009_dev * device,
bool enable,
bool manual )

Enable or disable fast start mode.

Enable or disable fast start mode

Parameters
device- Device descriptor
enable- True to enable fast start, false to disable
manual- True for manual trigger, false for automatic
Returns
0 in case of success, negative error code otherwise
Note
Fast start reduces settling time for faster measurements

◆ max30009_enable_gsr_load()

int max30009_enable_gsr_load ( struct max30009_dev * device,
bool enable )

Enable or disable GSR load resistor.

Enable or disable GSR load resistor

Parameters
device- Device descriptor
enable- True to enable GSR load, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_ina_chopping()

int max30009_enable_ina_chopping ( struct max30009_dev * device,
bool enable )

Enable or disable INA chopping.

Enable or disable INA chopping

Parameters
device- Device descriptor
enable- True to enable chopping (improves CMRR), false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_internal_load()

int max30009_enable_internal_load ( struct max30009_dev * device,
bool enable )

Enable or disable internal load resistor.

Enable or disable internal load resistor

Parameters
device- Device descriptor
enable- True to enable internal load, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_enable_interrupt()

int max30009_enable_interrupt ( struct max30009_dev * device,
enum max30009_interrupt interrupt,
bool enable )

Enable or disable a specific interrupt.

Enable or disable a specific interrupt

Parameters
device- MAX30009 device descriptor
interrupt- Interrupt type from max30009_interrupt enum
enable- True to enable, false to disable
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_enable_rapid_lead_off()

int max30009_enable_rapid_lead_off ( struct max30009_dev * device,
bool enable )

Enable or disable rapid lead-off detection.

Enable or disable rapid lead-off detection

Parameters
device- Device descriptor
enable- True to enable rapid mode, false for normal
Returns
0 in case of success, negative error code otherwise
Note
Rapid mode detects lead-off faster but with higher current consumption

◆ max30009_enable_standby_mode()

int max30009_enable_standby_mode ( struct max30009_dev * device,
bool keep_rx_on )

Enable or disable standby mode.

Enable or disable standby mode

Parameters
device- Device descriptor
keep_rx_on- True to keep receive path on in standby, false to power down completely
Returns
0 in case of success, negative error code otherwise
Note
Standby mode reduces power consumption while maintaining quick wake-up

◆ max30009_enable_ultra_low_power_lead_on()

int max30009_enable_ultra_low_power_lead_on ( struct max30009_dev * device,
bool enable )

Enable or disable ultra-low-power lead-on detection.

Enable or disable ultra-low-power lead-on detection

Parameters
device- Device descriptor
enable- True to enable ULP lead-on detection, false to disable
Returns
0 in case of success, negative error code otherwise

◆ max30009_fifo_decode_sample()

int max30009_fifo_decode_sample ( uint8_t * raw_data,
struct max30009_fifo_sample * sample )

Decode a 3-byte FIFO sample into type and data.

Decode a 3-byte FIFO sample into type and data

Parameters
raw_data- 3-byte raw FIFO data
sample- Pointer to store decoded sample (type and data)
Returns
0 in case of success, negative error code otherwise

FIFO Data Format (24 bits total):

  • Bits 23-20: TAG[3:0] - Sample type identifier
  • Bits 19-0: DATA[19:0] - 20-bit signed measurement data

TAG Values:

  • 0x1: BioZ In-Phase sample
  • 0x2: BioZ Quadrature sample
  • 0xE: Marker (0xFFFFFE - all 1s except bit 0)
  • 0xF: Invalid sample (0xFFFFFF - all 1s)
Here is the caller graph for this function:

◆ max30009_fifo_flush()

int max30009_fifo_flush ( struct max30009_dev * device)

Flush FIFO contents.

Flush FIFO contents

Parameters
device- MAX30009 device descriptor
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_fifo_get_count()

int max30009_fifo_get_count ( struct max30009_dev * device,
uint16_t * count )

Get FIFO data count.

Get FIFO data count

Parameters
device- MAX30009 device descriptor
count- Pointer to store FIFO data count (0-256)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_fifo_get_ovf_count()

int max30009_fifo_get_ovf_count ( struct max30009_dev * device,
uint16_t * count )

Get FIFO overflow data count.

Get FIFO overflow data count

Parameters
device- MAX30009 device descriptor
count- Pointer to store FIFO overflow data count (0-128)
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_bioz_config()

int max30009_get_bioz_config ( struct max30009_dev * device,
struct max30009_bioz_config * bioz_config )

Get complete BioZ configuration.

Get complete BioZ configuration

Parameters
device- Device descriptor
bioz_config- Pointer to store BioZ configuration
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_bioz_mux_config()

int max30009_get_bioz_mux_config ( struct max30009_dev * device,
struct max30009_bioz_mux_config * mux_config )

Get complete BioZ MUX configuration.

Get complete BioZ MUX configuration

Parameters
device- Device descriptor
mux_config- Pointer to store BioZ MUX configuration
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_detailed_lead_status()

int max30009_get_detailed_lead_status ( struct max30009_dev * device,
struct max30009_lead_status * status )

Get detailed lead detection status.

Get detailed lead detection status

Parameters
device- Device descriptor
status- Pointer to store detailed lead status information
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_fifo_config()

int max30009_get_fifo_config ( struct max30009_dev * device,
struct max30009_fifo_config * fifo_config )

Get complete FIFO configuration.

Get complete FIFO configuration

Parameters
device- Device descriptor
fifo_config- Pointer to store FIFO configuration
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_fifo_pointers()

int max30009_get_fifo_pointers ( struct max30009_dev * device,
uint8_t * write_ptr,
uint8_t * read_ptr )

Get FIFO read and write pointers.

Get FIFO read and write pointers

Parameters
device- Device descriptor
write_ptr- Pointer to store write pointer value (0-255)
read_ptr- Pointer to store read pointer value (0-255)
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_fifo_watermark()

int max30009_get_fifo_watermark ( struct max30009_dev * device,
uint8_t * watermark )

Gets the FIFO watermark level of the device.

Gets the FIFO watermark level of the device.

Parameters
device- Device descriptor.
watermark- Pointer to a variable where the current FIFO watermark level
Returns
0 in case of success, negative error code otherwise.

◆ max30009_get_lead_detect_config()

int max30009_get_lead_detect_config ( struct max30009_dev * device,
struct max30009_lead_detect_config * lead_config )

Get complete lead detection configuration.

Get complete lead detection configuration

Parameters
device- Device descriptor
lead_config- Pointer to store lead detection configuration
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_pll_config()

int max30009_get_pll_config ( struct max30009_dev * device,
struct max30009_pll_config * pll_config )

Get complete PLL configuration.

Get complete PLL configuration

Parameters
device- Device descriptor
pll_config- Pointer to store PLL configuration
Returns
0 in case of success, negative error code otherwise

◆ max30009_get_status()

int max30009_get_status ( struct max30009_dev * device,
struct max30009_status * status )

Get device status.

Get device status

Parameters
device- MAX30009 device descriptor
status- Pointer to store device status information
Returns
0 in case of success, negative error code otherwise

◆ max30009_init()

int max30009_init ( struct max30009_dev ** device,
struct max30009_init_param * init_param )

Initialize the MAX30009 device.

Initialize the MAX30009 device

Parameters
device- Pointer to the device descriptor pointer
init_param- Initialization parameters
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_insert_fifo_marker()

int max30009_insert_fifo_marker ( struct max30009_dev * device)

Insert marker into FIFO data stream.

Insert marker into FIFO data stream

Parameters
device- Device descriptor
Returns
0 in case of success, negative error code otherwise
Note
Marker is used to identify specific data points in FIFO stream

◆ max30009_interrupt_config()

int max30009_interrupt_config ( struct max30009_dev * device,
uint8_t int1_mask,
uint8_t int2_mask )

Configure interrupt enables.

Configure interrupt enables

Parameters
device- MAX30009 device descriptor
int1_mask- Interrupt enable mask for INTERRUPT_ENABLE1 register
int2_mask- Interrupt enable mask for INTERRUPT_ENABLE2 register
Returns
0 in case of success, negative error code otherwise

◆ max30009_lead_off_config()

int max30009_lead_off_config ( struct max30009_dev * device,
bool enable,
uint8_t threshold )

Configure lead-off detection.

Configure lead-off detection

Parameters
device- MAX30009 device descriptor
enable- True to enable lead-off detection, false to disable
threshold- Lead-off detection threshold (0-15)
Returns
0 in case of success, negative error code otherwise

◆ max30009_pll_enable()

int max30009_pll_enable ( struct max30009_dev * device,
bool enable )

Enable or disable PLL.

Enable or disable PLL

Parameters
device- Device descriptor
enable- True to enable PLL, false to disable
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_pll_set_dividers()

int max30009_pll_set_dividers ( struct max30009_dev * device,
uint16_t mdiv,
enum max30009_pll_ndiv ndiv,
enum max30009_pll_kdiv kdiv )

Configure PLL dividers.

Configure PLL dividers

Parameters
device- Device descriptor
mdiv- M divider value (0-1023, PLL_CLK = (MDIV+1) × REF_CLK)
ndiv- N divider value (MAX30009_NDIV_512 or MAX30009_NDIV_1024)
kdiv- K divider value (MAX30009_KDIV_1 to MAX30009_KDIV_8192)
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_pll_set_lock_window()

int max30009_pll_set_lock_window ( struct max30009_dev * device,
bool lock_window )

Set PLL lock window.

Set PLL lock window

Parameters
device- Device descriptor
lock_window- True to enable extended lock window, false for normal
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_read_bist_error()

int max30009_read_bist_error ( struct max30009_dev * device,
uint8_t * error )

Read BIST error value.

Read BIST error value

Parameters
device- Device descriptor
error- Pointer to store BIST error value
Returns
0 in case of success, negative error code otherwise

◆ max30009_read_fifo_data()

int max30009_read_fifo_data ( struct max30009_dev * device,
uint8_t * data,
uint32_t len )

Read data from FIFO.

Read data from FIFO

Parameters
device- MAX30009 device descriptor
data- Buffer to store FIFO data
lenNumber of bytes to read from the FIFO.
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_reg_read()

int max30009_reg_read ( struct max30009_dev * device,
uint8_t reg_addr,
uint8_t * data )

Read a single byte from register.

Read a single byte from register

Parameters
device- MAX30009 device descriptor
reg_addr- Register address to read from
data- Pointer to variable where read byte will be stored
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_reg_read_multiple()

int max30009_reg_read_multiple ( struct max30009_dev * device,
uint8_t reg_addr,
uint8_t * data,
uint32_t len )

Read multiple bytes from register.

Read multiple bytes from register

Parameters
device- MAX30009 device descriptor
reg_addr- Register address to read from
data- Pointer to buffer where read data will be stored
len- Number of bytes to read
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_reg_update()

int max30009_reg_update ( struct max30009_dev * device,
uint8_t reg_addr,
uint8_t mask,
uint8_t value )

Update specific bits in a register.

Update specific bits in a register

Parameters
device- MAX30009 device descriptor
reg_addr- Register address to update
mask- Bit mask indicating which bits to update
value- New value for the field, given in raw (unshifted) form. It is shifted into the mask position internally via no_os_field_prep, so callers must NOT pre-shift with no_os_field_prep.
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_reg_write()

int max30009_reg_write ( struct max30009_dev * device,
uint8_t reg_addr,
uint8_t data )

Write a single byte to register.

Write a single byte to register

Parameters
device- MAX30009 device descriptor
reg_addr- Register address to write to
data- Byte value to be written
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_reg_write_multiple()

int max30009_reg_write_multiple ( struct max30009_dev * device,
uint8_t reg_addr,
uint8_t * data,
uint32_t len )

Write multiple bytes to register.

Write multiple bytes to register

Parameters
device- MAX30009 device descriptor
reg_addr- Register address to write to
data- Pointer to buffer containing data to be written
len- Number of bytes to write
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_remove()

int max30009_remove ( struct max30009_dev * device)

Remove the MAX30009 device and free resources.

Remove the MAX30009 device and free resources

Parameters
device- MAX30009 device descriptor
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_a_full_type()

int max30009_set_a_full_type ( struct max30009_dev * device,
bool type )

Set almost-full interrupt type.

Set almost-full interrupt type

Parameters
device- Device descriptor
type- True for asserted when count >= threshold, False for count > threshold
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_adc_osr()

int max30009_set_adc_osr ( struct max30009_dev * device,
enum max30009_adc_osr osr )

Set ADC oversampling ratio.

Set ADC oversampling ratio

Parameters
device- Device descriptor
osr- ADC OSR value (MAX30009_ADC_OSR_8 through _1024)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_amp_bandwidth()

int max30009_set_amp_bandwidth ( struct max30009_dev * device,
uint8_t amp_bw )

Set amplifier bandwidth.

Set amplifier bandwidth

Parameters
device- Device descriptor
amp_bw- Amplifier bandwidth setting (0-3)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_amp_range()

int max30009_set_amp_range ( struct max30009_dev * device,
uint8_t amp_range )

Set amplifier range.

Set amplifier range

Parameters
device- Device descriptor
amp_range- Amplifier range setting (0-3)
Returns
0 in case of success, negative error code otherwise
Note
Optimizes ADC dynamic range for different electrode impedances

◆ max30009_set_analog_hpf()

int max30009_set_analog_hpf ( struct max30009_dev * device,
enum max30009_ahpf ahpf )

Set analog high-pass filter.

Set analog high-pass filter

Parameters
device- Device descriptor
ahpf- Analog HPF setting (BYPASS, or 100Hz-10kHz)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_bia_load_resistor()

int max30009_set_bia_load_resistor ( struct max30009_dev * device,
enum max30009_bia_rsel rsel )

Set BIA (Body Impedance Analysis) load resistor.

Set BIA Body Impedance Analysis load resistor

Parameters
device- Device descriptor
rsel- Resistor selection (280, 600, 900, or 5100 ohms)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_bioz_config()

int max30009_set_bioz_config ( struct max30009_dev * device,
struct max30009_bioz_config * bioz_config )

Set complete BioZ configuration.

Set complete BioZ configuration

Parameters
device- Device descriptor
bioz_config- BioZ configuration structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_bioz_mux_config()

int max30009_set_bioz_mux_config ( struct max30009_dev * device,
struct max30009_bioz_mux_config * mux_config )

Set complete BioZ MUX configuration.

Set complete BioZ MUX configuration

Parameters
device- Device descriptor
mux_config- BioZ MUX configuration structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_bioz_thresholds()

int max30009_set_bioz_thresholds ( struct max30009_dev * device,
uint8_t low_thresh,
uint8_t high_thresh )

Set BioZ threshold values.

Set BioZ threshold values

Parameters
device- Device descriptor
low_thresh- Low threshold value (0-255)
high_thresh- High threshold value (0-255)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_channel_freq_select()

int max30009_set_channel_freq_select ( struct max30009_dev * device,
bool fsel )

Set channel frequency select.

Set channel frequency select

Parameters
device- Device descriptor
fsel- Frequency select bit
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_clock_source()

int max30009_set_clock_source ( struct max30009_dev * device,
bool use_external,
bool use_32768_hz )

Configure clock source.

Configure clock source

Parameters
device- Device descriptor
use_external- True for external clock, false for internal oscillator
use_32768_hz- True for 32.768 kHz, false for 32.0 kHz
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_comparison_mode()

int max30009_set_comparison_mode ( struct max30009_dev * device,
uint8_t cmp_mode )

Set comparison mode for threshold detection.

Set comparison mode for threshold detection

Parameters
device- Device descriptor
cmp_mode- Comparison mode (0-3)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_dac_osr()

int max30009_set_dac_osr ( struct max30009_dev * device,
enum max30009_dac_osr osr )

Set DAC oversampling ratio.

Set DAC oversampling ratio

Parameters
device- Device descriptor
osr- DAC OSR value (MAX30009_DAC_OSR_32, _64, _128, or _256)
Returns
0 in case of success, negative error code otherwise
Note
Affects stimulus frequency: F_BIOZ = PLL_CLK / (KDIV × DAC_OSR)

◆ max30009_set_demod_clk_phases()

int max30009_set_demod_clk_phases ( struct max30009_dev * device,
bool i_clk_phase,
bool q_clk_phase )

Set demodulation clock phases.

Set demodulation clock phases

Parameters
device- Device descriptor
i_clk_phase- I channel clock phase (true for inverted)
q_clk_phase- Q channel clock phase (true for inverted)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_digital_hpf()

int max30009_set_digital_hpf ( struct max30009_dev * device,
enum max30009_dhpf dhpf )

Set digital high-pass filter.

Set digital high-pass filter

Parameters
device- Device descriptor
dhpf- Digital HPF setting
Returns
0 in case of success, negative error code otherwise
Note
Used to remove DC offset from bioimpedance signal

◆ max30009_set_digital_lpf()

int max30009_set_digital_lpf ( struct max30009_dev * device,
enum max30009_dlpf dlpf )

Set digital low-pass filter.

Set digital low-pass filter

Parameters
device- Device descriptor
dlpf- Digital LPF setting
Returns
0 in case of success, negative error code otherwise
Note
Used for anti-aliasing and noise reduction

◆ max30009_set_drive_current_detailed()

int max30009_set_drive_current_detailed ( struct max30009_dev * device,
uint8_t idrv_range,
uint8_t vdrv_mag )

Set drive current with detailed control.

Set drive current with detailed control

Parameters
device- Device descriptor
idrv_range- Current range setting (0-3)
vdrv_mag- Voltage magnitude setting (0-3)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_drive_mode()

int max30009_set_drive_mode ( struct max30009_dev * device,
enum max30009_drive_mode mode )

Set drive mode (current, voltage, H-bridge, or standby)

Set drive mode - current, voltage, H-bridge, or standby

Parameters
device- Device descriptor
mode- Drive mode (SINE_CURRENT, SINE_VOLTAGE, H_BRIDGE, or STANDBY)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_fifo_config()

int max30009_set_fifo_config ( struct max30009_dev * device,
struct max30009_fifo_config * fifo_config )

Set complete FIFO configuration.

Set complete FIFO configuration

Parameters
device- Device descriptor
fifo_config- FIFO configuration structure
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_fifo_rollover()

int max30009_set_fifo_rollover ( struct max30009_dev * device,
bool rollover )

Set FIFO rollover mode.

Set FIFO rollover mode

Parameters
device- Device descriptor
rollover- True to enable rollover mode, false to stop when full
Returns
0 in case of success, negative error code otherwise
Note
In rollover mode, new data overwrites oldest data when FIFO is full
Here is the caller graph for this function:

◆ max30009_set_fifo_watermark()

int max30009_set_fifo_watermark ( struct max30009_dev * device,
uint8_t watermark )

Set FIFO watermark level.

Set FIFO almost-full threshold

Parameters
device- Device descriptor
watermark- Watermark level (number of samples before FIFO generates an interrupt).
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_gsr_load_resistor()

int max30009_set_gsr_load_resistor ( struct max30009_dev * device,
enum max30009_gsr_rsel rsel )

Set GSR (Galvanic Skin Response) load resistor.

Set GSR (Galvanic Skin Response) load resistor

Parameters
device- Device descriptor
rsel- Resistor selection (25.7k, 101k, 505k, or 1M ohms)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_ina_mode()

int max30009_set_ina_mode ( struct max30009_dev * device,
bool low_power )

Set INA (Instrumentation Amplifier) mode.

Set INA (Instrumentation Amplifier) mode

Parameters
device- Device descriptor
low_power- True for low-power mode, false for low-noise mode
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_lead_bias()

int max30009_set_lead_bias ( struct max30009_dev * device,
enum max30009_rbias_val rbias_value,
bool enable_bip,
bool enable_bin )

Configure lead bias resistor and enable for receive electrodes.

Configure lead bias resistor and enable for receive electrodes

Parameters
device- Device descriptor
rbias_value- Bias resistor value (50M, 100M, 200M ohms)
enable_bip- True to enable bias on BIP (positive receive) electrode
enable_bin- True to enable bias on BIN (negative receive) electrode
Returns
0 in case of success, negative error code otherwise
Note
Lead bias pulls electrodes to mid-supply for proper DC operating point
Here is the caller graph for this function:

◆ max30009_set_lead_detect_config()

int max30009_set_lead_detect_config ( struct max30009_dev * device,
struct max30009_lead_detect_config * lead_config )

Set complete lead detection configuration.

Set complete lead detection configuration

Parameters
device- Device descriptor
lead_config- Lead detection configuration structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_lead_off_current()

int max30009_set_lead_off_current ( struct max30009_dev * device,
enum max30009_loff_current current )

Set lead-off detection current magnitude.

Set lead-off detection current magnitude

Parameters
device- Device descriptor
current- Lead-off current setting (5nA, 11nA, 22nA, 55nA, or 110nA)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_lead_off_polarity()

int max30009_set_lead_off_polarity ( struct max30009_dev * device,
bool positive )

Set lead-off detection current polarity.

Set lead-off detection current polarity

Parameters
device- Device descriptor
positive- True for positive polarity, false for negative polarity
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_master_mode()

int max30009_set_master_mode ( struct max30009_dev * device,
bool is_master )

Set master/slave mode for PLL synchronization.

Set master/slave mode for PLL synchronization

Parameters
device- Device descriptor
is_master- True for master mode (generates FCLK_SYS), False for slave mode (uses external FCLK_SYS)
Returns
0 in case of success, negative error code otherwise

◆ max30009_set_pll_config()

int max30009_set_pll_config ( struct max30009_dev * device,
struct max30009_pll_config * pll_config )

Set complete PLL configuration.

Set complete PLL configuration

Parameters
device- Device descriptor
pll_config- PLL configuration structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_set_power_mode()

int max30009_set_power_mode ( struct max30009_dev * device,
bool shutdown )

Set power mode (shutdown or active)

Set power mode - shutdown or active

Parameters
device- MAX30009 device descriptor
shutdown- True to enter shutdown mode, false for active mode
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ max30009_soft_reset()

int max30009_soft_reset ( struct max30009_dev * device)

Perform software reset.

Perform software reset

Parameters
device- MAX30009 device descriptor
Returns
0 in case of success, negative error code otherwise
Note
Follows the datasheet-required soft-reset sequence: BIOZ_BG_EN=1, SHDN=0, REF_CLK_SEL=0, PLL_EN=0, wait >=1ms, RESET=1. Re-enable the PLL after soft reset via max30009_pll_enable().
Here is the caller graph for this function:

◆ max30009_timing_system_reset()

int max30009_timing_system_reset ( struct max30009_dev * device)

Trigger timing system reset for PLL synchronization.

Trigger timing system reset for PLL synchronization

Parameters
device- Device descriptor
Returns
0 in case of success, negative error code otherwise
Note
Use this after PLL configuration changes to synchronize timing system

◆ max30009_verify_part_id()

int max30009_verify_part_id ( struct max30009_dev * device)

Read device part ID.

Read device part ID

Parameters
device- MAX30009 device descriptor
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function: