![]() |
no-OS
|
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"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 |
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. | |
Header file for MAX30009 driver.
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:
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.
| #define MAX30009_A_FULL_EN_MSK NO_OS_BIT(7) |
| #define MAX30009_A_FULL_TYPE_MSK NO_OS_BIT(2) |
| #define MAX30009_BIN_ASSIGN_MSK NO_OS_GENMASK(5, 4) |
| #define MAX30009_BIOZ_ADC_OSR_MSK NO_OS_GENMASK(5, 3) |
| #define MAX30009_BIOZ_AHPF_MSK NO_OS_GENMASK(7, 4) |
| #define MAX30009_BIOZ_AMP_BW_MSK NO_OS_GENMASK(1, 0) |
| #define MAX30009_BIOZ_AMP_RGE_MSK NO_OS_GENMASK(3, 2) |
| #define MAX30009_BIOZ_BG_EN_MSK NO_OS_BIT(2) |
| #define MAX30009_BIOZ_CH_FSEL_MSK NO_OS_BIT(0) |
| #define MAX30009_BIOZ_CMP_MSK NO_OS_GENMASK(2, 1) |
| #define MAX30009_BIOZ_DAC_OSR_MSK NO_OS_GENMASK(7, 6) |
| #define MAX30009_BIOZ_DAC_RESET_MSK NO_OS_BIT(4) |
| #define MAX30009_BIOZ_DC_RESTORE_MSK NO_OS_BIT(6) |
| #define MAX30009_BIOZ_DHPF_MSK NO_OS_GENMASK(7, 6) |
| #define MAX30009_BIOZ_DLPF_MSK NO_OS_GENMASK(5, 3) |
| #define MAX30009_BIOZ_DM_DIS_MSK NO_OS_BIT(2) |
| #define MAX30009_BIOZ_DRV_MODE_MSK NO_OS_GENMASK(1, 0) |
| #define MAX30009_BIOZ_DRV_RESET_MSK NO_OS_BIT(5) |
| #define MAX30009_BIOZ_EXT_CAP_MSK NO_OS_BIT(7) |
| #define MAX30009_BIOZ_EXT_RES_MSK NO_OS_BIT(7) |
| #define MAX30009_BIOZ_FAST_MANUAL_MSK NO_OS_BIT(1) |
| #define MAX30009_BIOZ_FAST_START_EN_MSK NO_OS_BIT(0) |
| #define MAX30009_BIOZ_GAIN_MSK NO_OS_GENMASK(1, 0) |
| #define MAX30009_BIOZ_HI_THRESH_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_BIOZ_I_CLK_PHASE_MSK NO_OS_BIT(2) |
| #define MAX30009_BIOZ_I_EN_MSK NO_OS_BIT(0) |
| #define MAX30009_BIOZ_IDRV_RGE_MSK NO_OS_GENMASK(3, 2) |
| #define MAX30009_BIOZ_INA_CHOP_EN_MSK NO_OS_BIT(1) |
| #define MAX30009_BIOZ_INA_MODE_MSK NO_OS_BIT(3) |
| #define MAX30009_BIOZ_LO_THRESH_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_BIOZ_OVER_EN_MSK NO_OS_BIT(6) |
| #define MAX30009_BIOZ_Q_CLK_PHASE_MSK NO_OS_BIT(3) |
| #define MAX30009_BIOZ_Q_EN_MSK NO_OS_BIT(1) |
| #define MAX30009_BIOZ_STBYON_MSK NO_OS_BIT(4) |
| #define MAX30009_BIOZ_UNDR_EN_MSK NO_OS_BIT(5) |
| #define MAX30009_BIOZ_VDRV_MAG_MSK NO_OS_GENMASK(5, 4) |
| #define MAX30009_BIP_ASSIGN_MSK NO_OS_GENMASK(7, 6) |
| #define MAX30009_BIST_R_ERR_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_BMUX_BIST_EN_MSK NO_OS_BIT(5) |
| #define MAX30009_BMUX_RSEL_MSK NO_OS_GENMASK(7, 6) |
| #define MAX30009_CAL_EN_MSK NO_OS_BIT(0) |
| #define MAX30009_CLK_FINE_TUNE_MSK NO_OS_GENMASK(4, 0) |
| #define MAX30009_CLK_FREQ_SEL_MSK NO_OS_BIT(5) |
| #define MAX30009_CONNECT_CAL_ONLY_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_DC_LOFF_PH_EN_MSK NO_OS_BIT(3) |
| #define MAX30009_DC_LOFF_PL_EN_MSK NO_OS_BIT(2) |
| #define MAX30009_DISABLE_I2C_MSK NO_OS_BIT(6) |
| #define MAX30009_DRV_OOR_EN_MSK NO_OS_BIT(4) |
| #define MAX30009_DRVN_ASSIGN_MSK NO_OS_GENMASK(1, 0) |
| #define MAX30009_DRVP_ASSIGN_MSK NO_OS_GENMASK(3, 2) |
| #define MAX30009_EN_BIOZ_THRESH_MSK NO_OS_BIT(0) |
| #define MAX30009_EN_DRV_OOR_MSK NO_OS_BIT(4) |
| #define MAX30009_EN_EXT_INLOAD_MSK NO_OS_BIT(1) |
| #define MAX30009_EN_EXT_LOFF_MSK NO_OS_BIT(5) |
| #define MAX30009_EN_INT_INLOAD_MSK NO_OS_BIT(0) |
| #define MAX30009_EN_LOFF_DET_MSK NO_OS_BIT(6) |
| #define MAX30009_EN_LON_DET_MSK NO_OS_BIT(7) |
| #define MAX30009_EN_RBIAS_BIN_MSK NO_OS_BIT(0) |
| #define MAX30009_EN_RBIAS_BIP_MSK NO_OS_BIT(1) |
| #define MAX30009_FIFO_A_FULL_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_FIFO_DATA_COUNT_LSB_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_FIFO_DATA_COUNT_MSB_MSK NO_OS_BIT(7) |
| #define MAX30009_FIFO_DATA_MASK NO_OS_GENMASK(19, 0) |
| #define MAX30009_FIFO_DATA_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_FIFO_DATA_RDY_EN_MSK NO_OS_BIT(5) |
| #define MAX30009_FIFO_DATA_SIZE 3 |
| #define MAX30009_FIFO_DEPTH 256 |
| #define MAX30009_FIFO_MARK_MSK NO_OS_BIT(5) |
| #define MAX30009_FIFO_RO_MSK NO_OS_BIT(1) |
| #define MAX30009_FIFO_SIGN_BIT NO_OS_BIT(19) |
| #define MAX30009_FIFO_SIGN_EXT 0xFFF00000UL |
| #define MAX30009_FIFO_STAT_CLR_MSK NO_OS_BIT(3) |
| #define MAX30009_FIFO_TAG_MASK NO_OS_GENMASK(3, 0) |
| #define MAX30009_FIFO_TAG_SHIFT 20 |
| #define MAX30009_FLUSH_FIFO_MSK NO_OS_BIT(4) |
| #define MAX30009_FREQ_LOCK_EN_MSK NO_OS_BIT(3) |
| #define MAX30009_FREQ_UNLOCK_EN_MSK NO_OS_BIT(4) |
| #define MAX30009_GSR_LOAD_EN_MSK NO_OS_BIT(5) |
| #define MAX30009_GSR_RSEL_MSK NO_OS_GENMASK(7, 6) |
| #define MAX30009_I2C_ADDRESS 0x68 |
| #define MAX30009_I2C_BCAST_ADDR_MSK NO_OS_GENMASK(6, 1) |
| #define MAX30009_I2C_BCAST_EN_MSK NO_OS_BIT(0) |
| #define MAX30009_INT_FCFG_MSK NO_OS_GENMASK(3, 2) |
| #define MAX30009_INT_OCFG_MSK NO_OS_GENMASK(3, 2) |
| #define MAX30009_KDIV_MSK NO_OS_GENMASK(4, 1) |
| #define MAX30009_LOFF_IMAG_MSK NO_OS_GENMASK(2, 0) |
| #define MAX30009_LOFF_IPOL_MSK NO_OS_BIT(3) |
| #define MAX30009_LOFF_RAPID_MSK NO_OS_BIT(6) |
| #define MAX30009_LOFF_THRESH_MSK NO_OS_GENMASK(3, 0) |
| #define MAX30009_LON_EN_MSK NO_OS_BIT(7) |
| #define MAX30009_MASTER_MSK NO_OS_BIT(7) |
| #define MAX30009_MDIV_LSB_MSK NO_OS_GENMASK(7, 0) |
| #define MAX30009_MDIV_MSB_MSK NO_OS_GENMASK(7, 6) |
| #define MAX30009_MUX_EN_MSK NO_OS_BIT(1) |
| #define MAX30009_NDIV_MSK NO_OS_BIT(5) |
| #define MAX30009_OVF_COUNTER_MSK NO_OS_GENMASK(6, 0) |
| #define MAX30009_PART_ID_VALUE 0x42 |
| #define MAX30009_PHASE_LOCK_EN_MSK NO_OS_BIT(1) |
| #define MAX30009_PHASE_UNLOCK_EN_MSK NO_OS_BIT(2) |
| #define MAX30009_PLL_EN_MSK NO_OS_BIT(0) |
| #define MAX30009_PLL_LOCK_TIMEOUT_MS 1000 |
| #define MAX30009_PLL_LOCK_WNDW_MSK NO_OS_BIT(0) |
| #define MAX30009_RBIAS_VAL_MSK NO_OS_GENMASK(3, 2) |
| #define MAX30009_REF_CLK_32000_HZ 32000 |
| #define MAX30009_REF_CLK_32768_HZ 32768 |
| #define MAX30009_REF_CLK_SEL_MSK NO_OS_BIT(6) |
| #define MAX30009_REG_BIOZ_CONFIGURATION1 0x20 |
| #define MAX30009_REG_BIOZ_CONFIGURATION2 0x21 |
| #define MAX30009_REG_BIOZ_CONFIGURATION3 0x22 |
| #define MAX30009_REG_BIOZ_CONFIGURATION4 0x23 |
| #define MAX30009_REG_BIOZ_CONFIGURATION5 0x24 |
| #define MAX30009_REG_BIOZ_CONFIGURATION6 0x25 |
| #define MAX30009_REG_BIOZ_CONFIGURATION7 0x28 |
| #define MAX30009_REG_BIOZ_HIGH_THRESHOLD 0x27 |
| #define MAX30009_REG_BIOZ_LOW_THRESHOLD 0x26 |
| #define MAX30009_REG_BIOZ_MUX_CONFIGURATION1 0x41 |
| #define MAX30009_REG_BIOZ_MUX_CONFIGURATION2 0x42 |
| #define MAX30009_REG_BIOZ_MUX_CONFIGURATION3 0x43 |
| #define MAX30009_REG_BIOZ_MUX_CONFIGURATION4 0x44 |
| #define MAX30009_REG_DC_LEAD_DETECT_THRESHOLD 0x51 |
| #define MAX30009_REG_DC_LEADS_CONFIGURATION 0x50 |
| #define MAX30009_REG_FIFO_CONFIGURATION1 0x0D |
| #define MAX30009_REG_FIFO_CONFIGURATION2 0x0E |
| #define MAX30009_REG_FIFO_COUNTER1 0x0A |
| #define MAX30009_REG_FIFO_COUNTER2 0x0B |
| #define MAX30009_REG_FIFO_DATA_REGISTER 0x0C |
| #define MAX30009_REG_FIFO_READ_POINTER 0x09 |
| #define MAX30009_REG_FIFO_WRITE_POINTER 0x08 |
| #define MAX30009_REG_I2C_BROADCAST_ADDRESS 0x14 |
| #define MAX30009_REG_INTERRUPT_ENABLE1 0x80 |
| #define MAX30009_REG_INTERRUPT_ENABLE2 0x81 |
| #define MAX30009_REG_LEAD_BIAS_CONFIGURATION1 0x58 |
| #define MAX30009_REG_OUTPUT_PIN_CONFIGURATION 0x13 |
| #define MAX30009_REG_PART_ID 0xFF |
| #define MAX30009_REG_PIN_FUNC_CONFIGURATION 0x12 |
| #define MAX30009_REG_PLL_CONFIGURATION1 0x17 |
| #define MAX30009_REG_PLL_CONFIGURATION2 0x18 |
| #define MAX30009_REG_PLL_CONFIGURATION3 0x19 |
| #define MAX30009_REG_PLL_CONFIGURATION4 0x1A |
| #define MAX30009_REG_STATUS1 0x00 |
| #define MAX30009_REG_STATUS2 0x01 |
| #define MAX30009_REG_SYSTEM_CONFIGURATION1 0x11 |
| #define MAX30009_REG_SYSTEM_SYNC 0x10 |
| #define MAX30009_RESET_MSK NO_OS_BIT(0) |
| #define MAX30009_SHDN_MSK NO_OS_BIT(1) |
| #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_LOCK_MSK NO_OS_BIT(3) |
| #define MAX30009_STATUS1_FREQ_UNLOCK_MSK NO_OS_BIT(4) |
| #define MAX30009_STATUS1_PHASE_LOCK_MSK NO_OS_BIT(1) |
| #define MAX30009_STATUS1_PHASE_UNLOCK_MSK NO_OS_BIT(2) |
| #define MAX30009_STATUS1_PWR_RDY_MSK NO_OS_BIT(0) |
| #define MAX30009_STATUS2_BIOZ_OVER_MSK NO_OS_BIT(6) |
| #define MAX30009_STATUS2_BIOZ_UNDR_MSK NO_OS_BIT(5) |
| #define MAX30009_STATUS2_DC_LOFF_NH_MSK NO_OS_BIT(1) |
| #define MAX30009_STATUS2_DC_LOFF_NL_MSK NO_OS_BIT(0) |
| #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_DRV_OOR_MSK NO_OS_BIT(4) |
| #define MAX30009_STATUS2_LON_MSK NO_OS_BIT(7) |
| #define MAX30009_TIMING_SYS_RESET_MSK NO_OS_BIT(7) |
| #define MAX30009_TRIG_ICFG_MSK NO_OS_BIT(0) |
| #define MAX30009_TRIG_OCFG_MSK NO_OS_GENMASK(1, 0) |
| enum max30009_adc_osr |
| enum max30009_ahpf |
| enum max30009_bia_rsel |
| enum max30009_bioz_bw |
| enum max30009_bioz_gain |
| enum max30009_dac_osr |
| enum max30009_dhpf |
| enum max30009_dlpf |
| enum max30009_drive_mode |
| enum max30009_gsr_rsel |
| enum max30009_interrupt |
| enum max30009_pll_kdiv |
| enum max30009_pll_ndiv |
| enum max30009_rbias_val |
| 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
| 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 |
| int max30009_bioz_bg_enable | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable BioZ bandgap.
Enable or disable BioZ bandgap
| device | - MAX30009 device descriptor |
| enable | - True to enable bandgap, false to disable |
| int max30009_bioz_enable | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable BioZ measurement.
Enable or disable BioZ measurement
| device | - MAX30009 device descriptor |
| enable | - True to enable BioZ, false to disable |
| int max30009_bioz_i_enable | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable BioZ I channel.
Enable or disable BioZ I channel
| device | - MAX30009 device descriptor |
| enable | - True to enable I channel, false to disable |
| int max30009_bioz_q_enable | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable BioZ Q channel.
Enable or disable BioZ Q channel
| device | - MAX30009 device descriptor |
| enable | - True to enable Q channel, false to disable |
| int max30009_calibration_connect_only | ( | struct max30009_dev * | device, |
| bool | cal_only ) |
Set calibration connect-only mode.
Set calibration connect-only mode
| device | - Device descriptor |
| cal_only | - True for connect-only mode, false for normal |
| int max30009_check_lead_off | ( | struct max30009_dev * | device, |
| bool * | leads_on ) |
Check lead-off detection status.
Check lead-off detection status
| device | - MAX30009 device descriptor |
| leads_on | - True if leads connected |
| int max30009_clear_fifo_status | ( | struct max30009_dev * | device | ) |
Clear FIFO status flags.
Clear FIFO status flags
| device | - Device descriptor |
| int max30009_clear_status | ( | struct max30009_dev * | device | ) |
Clear interrupt status registers.
Clear interrupt status registers
| device | - MAX30009 device descriptor |
| int max30009_clock_fine_tune | ( | struct max30009_dev * | device, |
| uint8_t | tune_val ) |
Fine tune internal clock frequency.
Fine tune internal clock frequency
| device | - Device descriptor |
| tune_val | - Fine tune value (0-31, ±0.78% adjustment range) |
| int max30009_configure_i2c_broadcast | ( | struct max30009_dev * | device, |
| bool | enable, | ||
| uint8_t | broadcast_addr ) |
Configure I2C broadcast address.
Configure I2C broadcast address
| device | - Device descriptor |
| enable | - True to enable broadcast, false to disable |
| broadcast_addr | - Broadcast address (7-bit, shifted left by 1) |
| 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
| device | - Device descriptor |
| func_cfg | - Function configuration (0-3) |
| out_cfg | - Output configuration (0-3) |
| 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
| device | - Device descriptor |
| input_cfg | - Input configuration (0 or 1) |
| output_cfg | - Output configuration (0-3) |
| int max30009_disable_differential_mode | ( | struct max30009_dev * | device, |
| bool | disable ) |
Disable differential mode (enable single-ended)
Disable differential mode - enable single-ended
| device | - Device descriptor |
| disable | - True to disable differential mode, false for differential |
| int max30009_disable_i2c | ( | struct max30009_dev * | device | ) |
Disable I2C interface (SPI only mode)
Disable I2C interface - SPI only mode
| device | - Device descriptor |
| 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)
| device | - Device descriptor |
| enable | - True to enable BIST, false to disable |
| int max30009_enable_bioz_threshold | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable BioZ threshold detection.
Enable or disable BioZ threshold detection
| device | - Device descriptor |
| enable | - True to enable threshold detection, false to disable |
| int max30009_enable_calibration | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable calibration mode.
Enable or disable calibration mode
| device | - Device descriptor |
| enable | - True to enable calibration, false to disable |
| int max30009_enable_calibration_mux | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable calibration MUX.
Enable or disable calibration MUX
| device | - Device descriptor |
| enable | - True to enable calibration MUX, false to disable |
| int max30009_enable_dac_reset | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable DAC reset.
Enable or disable DAC reset
| device | - Device descriptor |
| enable | - True to enable DAC reset, false to disable |
| int max30009_enable_dc_restore | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable DC restore circuit.
Enable or disable DC restore circuit
| device | - Device descriptor |
| enable | - True to enable DC restore, false to disable |
| 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
| device | - Device descriptor |
| enable | - True to enable drive OOR detection, false to disable |
| int max30009_enable_drive_reset | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable drive reset.
Enable or disable drive reset
| device | - Device descriptor |
| enable | - True to enable drive reset, false to disable |
| int max30009_enable_external_cap | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable external capacitor.
Enable or disable external capacitor
| device | - Device descriptor |
| enable | - True to enable external capacitor, false to disable |
| 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
| device | - Device descriptor |
| enable | - True to enable external lead-off detection, false to disable |
| int max30009_enable_external_load | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable external load connection.
Enable or disable external load connection
| device | - Device descriptor |
| enable | - True to enable external load connection, false to disable |
| 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
| device | - Device descriptor |
| enable | - True to enable external resistor, false to disable |
| 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
| device | - Device descriptor |
| enable | - True to enable fast start, false to disable |
| manual | - True for manual trigger, false for automatic |
| int max30009_enable_gsr_load | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable GSR load resistor.
Enable or disable GSR load resistor
| device | - Device descriptor |
| enable | - True to enable GSR load, false to disable |
| int max30009_enable_ina_chopping | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable INA chopping.
Enable or disable INA chopping
| device | - Device descriptor |
| enable | - True to enable chopping (improves CMRR), false to disable |
| int max30009_enable_internal_load | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable internal load resistor.
Enable or disable internal load resistor
| device | - Device descriptor |
| enable | - True to enable internal load, false to disable |
| 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
| device | - MAX30009 device descriptor |
| interrupt | - Interrupt type from max30009_interrupt enum |
| enable | - True to enable, false to disable |
| 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
| device | - Device descriptor |
| enable | - True to enable rapid mode, false for normal |
| int max30009_enable_standby_mode | ( | struct max30009_dev * | device, |
| bool | keep_rx_on ) |
Enable or disable standby mode.
Enable or disable standby mode
| device | - Device descriptor |
| keep_rx_on | - True to keep receive path on in standby, false to power down completely |
| 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
| device | - Device descriptor |
| enable | - True to enable ULP lead-on detection, false to disable |
| 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
| raw_data | - 3-byte raw FIFO data |
| sample | - Pointer to store decoded sample (type and data) |
FIFO Data Format (24 bits total):
TAG Values:
| int max30009_fifo_flush | ( | struct max30009_dev * | device | ) |
Flush FIFO contents.
Flush FIFO contents
| device | - MAX30009 device descriptor |
| int max30009_fifo_get_count | ( | struct max30009_dev * | device, |
| uint16_t * | count ) |
Get FIFO data count.
Get FIFO data count
| device | - MAX30009 device descriptor |
| count | - Pointer to store FIFO data count (0-256) |
| int max30009_fifo_get_ovf_count | ( | struct max30009_dev * | device, |
| uint16_t * | count ) |
Get FIFO overflow data count.
Get FIFO overflow data count
| device | - MAX30009 device descriptor |
| count | - Pointer to store FIFO overflow data count (0-128) |
| int max30009_get_bioz_config | ( | struct max30009_dev * | device, |
| struct max30009_bioz_config * | bioz_config ) |
Get complete BioZ configuration.
Get complete BioZ configuration
| device | - Device descriptor |
| bioz_config | - Pointer to store BioZ configuration |
| 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
| device | - Device descriptor |
| mux_config | - Pointer to store BioZ MUX configuration |
| 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
| device | - Device descriptor |
| status | - Pointer to store detailed lead status information |
| int max30009_get_fifo_config | ( | struct max30009_dev * | device, |
| struct max30009_fifo_config * | fifo_config ) |
Get complete FIFO configuration.
Get complete FIFO configuration
| device | - Device descriptor |
| fifo_config | - Pointer to store FIFO configuration |
| 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
| device | - Device descriptor |
| write_ptr | - Pointer to store write pointer value (0-255) |
| read_ptr | - Pointer to store read pointer value (0-255) |
| 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.
| device | - Device descriptor. |
| watermark | - Pointer to a variable where the current FIFO watermark level |
| 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
| device | - Device descriptor |
| lead_config | - Pointer to store lead detection configuration |
| int max30009_get_pll_config | ( | struct max30009_dev * | device, |
| struct max30009_pll_config * | pll_config ) |
Get complete PLL configuration.
Get complete PLL configuration
| device | - Device descriptor |
| pll_config | - Pointer to store PLL configuration |
| int max30009_get_status | ( | struct max30009_dev * | device, |
| struct max30009_status * | status ) |
Get device status.
Get device status
| device | - MAX30009 device descriptor |
| status | - Pointer to store device status information |
| int max30009_init | ( | struct max30009_dev ** | device, |
| struct max30009_init_param * | init_param ) |
Initialize the MAX30009 device.
Initialize the MAX30009 device
| device | - Pointer to the device descriptor pointer |
| init_param | - Initialization parameters |
| int max30009_insert_fifo_marker | ( | struct max30009_dev * | device | ) |
Insert marker into FIFO data stream.
Insert marker into FIFO data stream
| device | - Device descriptor |
| int max30009_interrupt_config | ( | struct max30009_dev * | device, |
| uint8_t | int1_mask, | ||
| uint8_t | int2_mask ) |
Configure interrupt enables.
Configure interrupt enables
| device | - MAX30009 device descriptor |
| int1_mask | - Interrupt enable mask for INTERRUPT_ENABLE1 register |
| int2_mask | - Interrupt enable mask for INTERRUPT_ENABLE2 register |
| int max30009_lead_off_config | ( | struct max30009_dev * | device, |
| bool | enable, | ||
| uint8_t | threshold ) |
Configure lead-off detection.
Configure lead-off detection
| device | - MAX30009 device descriptor |
| enable | - True to enable lead-off detection, false to disable |
| threshold | - Lead-off detection threshold (0-15) |
| int max30009_pll_enable | ( | struct max30009_dev * | device, |
| bool | enable ) |
Enable or disable PLL.
Enable or disable PLL
| device | - Device descriptor |
| enable | - True to enable PLL, false to disable |
| 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
| 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) |
| int max30009_pll_set_lock_window | ( | struct max30009_dev * | device, |
| bool | lock_window ) |
Set PLL lock window.
Set PLL lock window
| device | - Device descriptor |
| lock_window | - True to enable extended lock window, false for normal |
| int max30009_read_bist_error | ( | struct max30009_dev * | device, |
| uint8_t * | error ) |
Read BIST error value.
Read BIST error value
| device | - Device descriptor |
| error | - Pointer to store BIST error value |
| int max30009_read_fifo_data | ( | struct max30009_dev * | device, |
| uint8_t * | data, | ||
| uint32_t | len ) |
Read data from FIFO.
Read data from FIFO
| device | - MAX30009 device descriptor |
| data | - Buffer to store FIFO data |
| len | Number of bytes to read from the FIFO. |
| 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
| device | - MAX30009 device descriptor |
| reg_addr | - Register address to read from |
| data | - Pointer to variable where read byte will be stored |
| 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
| 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 |
| 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
| 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. |
| 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
| device | - MAX30009 device descriptor |
| reg_addr | - Register address to write to |
| data | - Byte value to be written |
| 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
| 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 |
| int max30009_remove | ( | struct max30009_dev * | device | ) |
Remove the MAX30009 device and free resources.
Remove the MAX30009 device and free resources
| device | - MAX30009 device descriptor |
| int max30009_set_a_full_type | ( | struct max30009_dev * | device, |
| bool | type ) |
Set almost-full interrupt type.
Set almost-full interrupt type
| device | - Device descriptor |
| type | - True for asserted when count >= threshold, False for count > threshold |
| int max30009_set_adc_osr | ( | struct max30009_dev * | device, |
| enum max30009_adc_osr | osr ) |
Set ADC oversampling ratio.
Set ADC oversampling ratio
| device | - Device descriptor |
| osr | - ADC OSR value (MAX30009_ADC_OSR_8 through _1024) |
| int max30009_set_amp_bandwidth | ( | struct max30009_dev * | device, |
| uint8_t | amp_bw ) |
Set amplifier bandwidth.
Set amplifier bandwidth
| device | - Device descriptor |
| amp_bw | - Amplifier bandwidth setting (0-3) |
| int max30009_set_amp_range | ( | struct max30009_dev * | device, |
| uint8_t | amp_range ) |
Set amplifier range.
Set amplifier range
| device | - Device descriptor |
| amp_range | - Amplifier range setting (0-3) |
| int max30009_set_analog_hpf | ( | struct max30009_dev * | device, |
| enum max30009_ahpf | ahpf ) |
Set analog high-pass filter.
Set analog high-pass filter
| device | - Device descriptor |
| ahpf | - Analog HPF setting (BYPASS, or 100Hz-10kHz) |
| 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
| device | - Device descriptor |
| rsel | - Resistor selection (280, 600, 900, or 5100 ohms) |
| int max30009_set_bioz_config | ( | struct max30009_dev * | device, |
| struct max30009_bioz_config * | bioz_config ) |
Set complete BioZ configuration.
Set complete BioZ configuration
| device | - Device descriptor |
| bioz_config | - BioZ configuration structure |
| 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
| device | - Device descriptor |
| mux_config | - BioZ MUX configuration structure |
| 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
| device | - Device descriptor |
| low_thresh | - Low threshold value (0-255) |
| high_thresh | - High threshold value (0-255) |
| int max30009_set_channel_freq_select | ( | struct max30009_dev * | device, |
| bool | fsel ) |
Set channel frequency select.
Set channel frequency select
| device | - Device descriptor |
| fsel | - Frequency select bit |
| int max30009_set_clock_source | ( | struct max30009_dev * | device, |
| bool | use_external, | ||
| bool | use_32768_hz ) |
Configure clock source.
Configure clock source
| 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 |
| 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
| device | - Device descriptor |
| cmp_mode | - Comparison mode (0-3) |
| int max30009_set_dac_osr | ( | struct max30009_dev * | device, |
| enum max30009_dac_osr | osr ) |
Set DAC oversampling ratio.
Set DAC oversampling ratio
| device | - Device descriptor |
| osr | - DAC OSR value (MAX30009_DAC_OSR_32, _64, _128, or _256) |
| 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
| device | - Device descriptor |
| i_clk_phase | - I channel clock phase (true for inverted) |
| q_clk_phase | - Q channel clock phase (true for inverted) |
| int max30009_set_digital_hpf | ( | struct max30009_dev * | device, |
| enum max30009_dhpf | dhpf ) |
Set digital high-pass filter.
Set digital high-pass filter
| device | - Device descriptor |
| dhpf | - Digital HPF setting |
| int max30009_set_digital_lpf | ( | struct max30009_dev * | device, |
| enum max30009_dlpf | dlpf ) |
Set digital low-pass filter.
Set digital low-pass filter
| device | - Device descriptor |
| dlpf | - Digital LPF setting |
| 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
| device | - Device descriptor |
| idrv_range | - Current range setting (0-3) |
| vdrv_mag | - Voltage magnitude setting (0-3) |
| 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
| device | - Device descriptor |
| mode | - Drive mode (SINE_CURRENT, SINE_VOLTAGE, H_BRIDGE, or STANDBY) |
| int max30009_set_fifo_config | ( | struct max30009_dev * | device, |
| struct max30009_fifo_config * | fifo_config ) |
Set complete FIFO configuration.
Set complete FIFO configuration
| device | - Device descriptor |
| fifo_config | - FIFO configuration structure |
| int max30009_set_fifo_rollover | ( | struct max30009_dev * | device, |
| bool | rollover ) |
Set FIFO rollover mode.
Set FIFO rollover mode
| device | - Device descriptor |
| rollover | - True to enable rollover mode, false to stop when full |
| int max30009_set_fifo_watermark | ( | struct max30009_dev * | device, |
| uint8_t | watermark ) |
Set FIFO watermark level.
Set FIFO almost-full threshold
| device | - Device descriptor |
| watermark | - Watermark level (number of samples before FIFO generates an interrupt). |
| 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
| device | - Device descriptor |
| rsel | - Resistor selection (25.7k, 101k, 505k, or 1M ohms) |
| int max30009_set_ina_mode | ( | struct max30009_dev * | device, |
| bool | low_power ) |
Set INA (Instrumentation Amplifier) mode.
Set INA (Instrumentation Amplifier) mode
| device | - Device descriptor |
| low_power | - True for low-power mode, false for low-noise mode |
| 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
| 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 |
| 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
| device | - Device descriptor |
| lead_config | - Lead detection configuration structure |
| 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
| device | - Device descriptor |
| current | - Lead-off current setting (5nA, 11nA, 22nA, 55nA, or 110nA) |
| int max30009_set_lead_off_polarity | ( | struct max30009_dev * | device, |
| bool | positive ) |
Set lead-off detection current polarity.
Set lead-off detection current polarity
| device | - Device descriptor |
| positive | - True for positive polarity, false for negative polarity |
| 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
| device | - Device descriptor |
| is_master | - True for master mode (generates FCLK_SYS), False for slave mode (uses external FCLK_SYS) |
| int max30009_set_pll_config | ( | struct max30009_dev * | device, |
| struct max30009_pll_config * | pll_config ) |
Set complete PLL configuration.
Set complete PLL configuration
| device | - Device descriptor |
| pll_config | - PLL configuration structure |
| int max30009_set_power_mode | ( | struct max30009_dev * | device, |
| bool | shutdown ) |
Set power mode (shutdown or active)
Set power mode - shutdown or active
| device | - MAX30009 device descriptor |
| shutdown | - True to enter shutdown mode, false for active mode |
| int max30009_soft_reset | ( | struct max30009_dev * | device | ) |
Perform software reset.
Perform software reset
| device | - MAX30009 device descriptor |
| int max30009_timing_system_reset | ( | struct max30009_dev * | device | ) |
Trigger timing system reset for PLL synchronization.
Trigger timing system reset for PLL synchronization
| device | - Device descriptor |
| int max30009_verify_part_id | ( | struct max30009_dev * | device | ) |
Read device part ID.
Read device part ID
| device | - MAX30009 device descriptor |