44#define MAX30009_REG_STATUS1 0x00
45#define MAX30009_STATUS1_A_FULL_MSK NO_OS_BIT(7)
46#define MAX30009_STATUS1_FIFO_DATA_RDY_MSK NO_OS_BIT(5)
47#define MAX30009_STATUS1_FREQ_UNLOCK_MSK NO_OS_BIT(4)
48#define MAX30009_STATUS1_FREQ_LOCK_MSK NO_OS_BIT(3)
49#define MAX30009_STATUS1_PHASE_UNLOCK_MSK NO_OS_BIT(2)
50#define MAX30009_STATUS1_PHASE_LOCK_MSK NO_OS_BIT(1)
51#define MAX30009_STATUS1_PWR_RDY_MSK NO_OS_BIT(0)
53#define MAX30009_REG_STATUS2 0x01
54#define MAX30009_STATUS2_LON_MSK NO_OS_BIT(7)
55#define MAX30009_STATUS2_BIOZ_OVER_MSK NO_OS_BIT(6)
56#define MAX30009_STATUS2_BIOZ_UNDR_MSK NO_OS_BIT(5)
57#define MAX30009_STATUS2_DRV_OOR_MSK NO_OS_BIT(4)
58#define MAX30009_STATUS2_DC_LOFF_PH_MSK NO_OS_BIT(3)
59#define MAX30009_STATUS2_DC_LOFF_PL_MSK NO_OS_BIT(2)
60#define MAX30009_STATUS2_DC_LOFF_NH_MSK NO_OS_BIT(1)
61#define MAX30009_STATUS2_DC_LOFF_NL_MSK NO_OS_BIT(0)
63#define MAX30009_REG_FIFO_WRITE_POINTER 0x08
64#define MAX30009_REG_FIFO_READ_POINTER 0x09
66#define MAX30009_REG_FIFO_COUNTER1 0x0A
67#define MAX30009_FIFO_DATA_COUNT_MSB_MSK NO_OS_BIT(7)
68#define MAX30009_OVF_COUNTER_MSK NO_OS_GENMASK(6, 0)
70#define MAX30009_REG_FIFO_COUNTER2 0x0B
71#define MAX30009_FIFO_DATA_COUNT_LSB_MSK NO_OS_GENMASK(7, 0)
73#define MAX30009_REG_FIFO_DATA_REGISTER 0x0C
74#define MAX30009_FIFO_DATA_MSK NO_OS_GENMASK(7, 0)
76#define MAX30009_REG_FIFO_CONFIGURATION1 0x0D
77#define MAX30009_FIFO_A_FULL_MSK NO_OS_GENMASK(7, 0)
79#define MAX30009_REG_FIFO_CONFIGURATION2 0x0E
80#define MAX30009_FIFO_MARK_MSK NO_OS_BIT(5)
81#define MAX30009_FLUSH_FIFO_MSK NO_OS_BIT(4)
82#define MAX30009_FIFO_STAT_CLR_MSK NO_OS_BIT(3)
83#define MAX30009_A_FULL_TYPE_MSK NO_OS_BIT(2)
84#define MAX30009_FIFO_RO_MSK NO_OS_BIT(1)
86#define MAX30009_REG_SYSTEM_SYNC 0x10
87#define MAX30009_TIMING_SYS_RESET_MSK NO_OS_BIT(7)
89#define MAX30009_REG_SYSTEM_CONFIGURATION1 0x11
90#define MAX30009_MASTER_MSK NO_OS_BIT(7)
91#define MAX30009_DISABLE_I2C_MSK NO_OS_BIT(6)
92#define MAX30009_SHDN_MSK NO_OS_BIT(1)
93#define MAX30009_RESET_MSK NO_OS_BIT(0)
95#define MAX30009_REG_PIN_FUNC_CONFIGURATION 0x12
96#define MAX30009_INT_FCFG_MSK NO_OS_GENMASK(3, 2)
97#define MAX30009_TRIG_ICFG_MSK NO_OS_BIT(0)
99#define MAX30009_REG_OUTPUT_PIN_CONFIGURATION 0x13
100#define MAX30009_INT_OCFG_MSK NO_OS_GENMASK(3, 2)
101#define MAX30009_TRIG_OCFG_MSK NO_OS_GENMASK(1, 0)
103#define MAX30009_REG_I2C_BROADCAST_ADDRESS 0x14
104#define MAX30009_I2C_BCAST_ADDR_MSK NO_OS_GENMASK(6, 1)
105#define MAX30009_I2C_BCAST_EN_MSK NO_OS_BIT(0)
107#define MAX30009_REG_PLL_CONFIGURATION1 0x17
108#define MAX30009_MDIV_MSB_MSK NO_OS_GENMASK(7, 6)
109#define MAX30009_NDIV_MSK NO_OS_BIT(5)
110#define MAX30009_KDIV_MSK NO_OS_GENMASK(4, 1)
111#define MAX30009_PLL_EN_MSK NO_OS_BIT(0)
113#define MAX30009_REG_PLL_CONFIGURATION2 0x18
114#define MAX30009_MDIV_LSB_MSK NO_OS_GENMASK(7, 0)
116#define MAX30009_REG_PLL_CONFIGURATION3 0x19
117#define MAX30009_PLL_LOCK_WNDW_MSK NO_OS_BIT(0)
119#define MAX30009_REG_PLL_CONFIGURATION4 0x1A
120#define MAX30009_REF_CLK_SEL_MSK NO_OS_BIT(6)
121#define MAX30009_CLK_FREQ_SEL_MSK NO_OS_BIT(5)
122#define MAX30009_CLK_FINE_TUNE_MSK NO_OS_GENMASK(4, 0)
124#define MAX30009_REG_BIOZ_CONFIGURATION1 0x20
125#define MAX30009_BIOZ_DAC_OSR_MSK NO_OS_GENMASK(7, 6)
126#define MAX30009_BIOZ_ADC_OSR_MSK NO_OS_GENMASK(5, 3)
127#define MAX30009_BIOZ_BG_EN_MSK NO_OS_BIT(2)
128#define MAX30009_BIOZ_Q_EN_MSK NO_OS_BIT(1)
129#define MAX30009_BIOZ_I_EN_MSK NO_OS_BIT(0)
131#define MAX30009_REG_BIOZ_CONFIGURATION2 0x21
132#define MAX30009_BIOZ_DHPF_MSK NO_OS_GENMASK(7, 6)
133#define MAX30009_BIOZ_DLPF_MSK NO_OS_GENMASK(5, 3)
134#define MAX30009_BIOZ_CMP_MSK NO_OS_GENMASK(2, 1)
135#define MAX30009_EN_BIOZ_THRESH_MSK NO_OS_BIT(0)
137#define MAX30009_REG_BIOZ_CONFIGURATION3 0x22
138#define MAX30009_BIOZ_EXT_RES_MSK NO_OS_BIT(7)
139#define MAX30009_LOFF_RAPID_MSK NO_OS_BIT(6)
140#define MAX30009_BIOZ_VDRV_MAG_MSK NO_OS_GENMASK(5, 4)
141#define MAX30009_BIOZ_IDRV_RGE_MSK NO_OS_GENMASK(3, 2)
142#define MAX30009_BIOZ_DRV_MODE_MSK NO_OS_GENMASK(1, 0)
144#define MAX30009_REG_BIOZ_CONFIGURATION4 0x23
145#define MAX30009_BIOZ_FAST_MANUAL_MSK NO_OS_BIT(1)
146#define MAX30009_BIOZ_FAST_START_EN_MSK NO_OS_BIT(0)
148#define MAX30009_REG_BIOZ_CONFIGURATION5 0x24
149#define MAX30009_BIOZ_AHPF_MSK NO_OS_GENMASK(7, 4)
150#define MAX30009_BIOZ_INA_MODE_MSK NO_OS_BIT(3)
151#define MAX30009_BIOZ_DM_DIS_MSK NO_OS_BIT(2)
152#define MAX30009_BIOZ_GAIN_MSK NO_OS_GENMASK(1, 0)
154#define MAX30009_REG_BIOZ_CONFIGURATION6 0x25
155#define MAX30009_BIOZ_EXT_CAP_MSK NO_OS_BIT(7)
156#define MAX30009_BIOZ_DC_RESTORE_MSK NO_OS_BIT(6)
157#define MAX30009_BIOZ_DRV_RESET_MSK NO_OS_BIT(5)
158#define MAX30009_BIOZ_DAC_RESET_MSK NO_OS_BIT(4)
159#define MAX30009_BIOZ_AMP_RGE_MSK NO_OS_GENMASK(3, 2)
160#define MAX30009_BIOZ_AMP_BW_MSK NO_OS_GENMASK(1, 0)
162#define MAX30009_REG_BIOZ_LOW_THRESHOLD 0x26
163#define MAX30009_BIOZ_LO_THRESH_MSK NO_OS_GENMASK(7, 0)
165#define MAX30009_REG_BIOZ_HIGH_THRESHOLD 0x27
166#define MAX30009_BIOZ_HI_THRESH_MSK NO_OS_GENMASK(7, 0)
168#define MAX30009_REG_BIOZ_CONFIGURATION7 0x28
169#define MAX30009_BIOZ_STBYON_MSK NO_OS_BIT(4)
170#define MAX30009_BIOZ_Q_CLK_PHASE_MSK NO_OS_BIT(3)
171#define MAX30009_BIOZ_I_CLK_PHASE_MSK NO_OS_BIT(2)
172#define MAX30009_BIOZ_INA_CHOP_EN_MSK NO_OS_BIT(1)
173#define MAX30009_BIOZ_CH_FSEL_MSK NO_OS_BIT(0)
175#define MAX30009_REG_BIOZ_MUX_CONFIGURATION1 0x41
176#define MAX30009_BMUX_RSEL_MSK NO_OS_GENMASK(7, 6)
177#define MAX30009_BMUX_BIST_EN_MSK NO_OS_BIT(5)
178#define MAX30009_CONNECT_CAL_ONLY_MSK NO_OS_BIT(2)
179#define MAX30009_MUX_EN_MSK NO_OS_BIT(1)
180#define MAX30009_CAL_EN_MSK NO_OS_BIT(0)
182#define MAX30009_REG_BIOZ_MUX_CONFIGURATION2 0x42
183#define MAX30009_GSR_RSEL_MSK NO_OS_GENMASK(7, 6)
184#define MAX30009_GSR_LOAD_EN_MSK NO_OS_BIT(5)
185#define MAX30009_EN_EXT_INLOAD_MSK NO_OS_BIT(1)
186#define MAX30009_EN_INT_INLOAD_MSK NO_OS_BIT(0)
188#define MAX30009_REG_BIOZ_MUX_CONFIGURATION3 0x43
189#define MAX30009_BIP_ASSIGN_MSK NO_OS_GENMASK(7, 6)
190#define MAX30009_BIN_ASSIGN_MSK NO_OS_GENMASK(5, 4)
191#define MAX30009_DRVP_ASSIGN_MSK NO_OS_GENMASK(3, 2)
192#define MAX30009_DRVN_ASSIGN_MSK NO_OS_GENMASK(1, 0)
194#define MAX30009_REG_BIOZ_MUX_CONFIGURATION4 0x44
195#define MAX30009_BIST_R_ERR_MSK NO_OS_GENMASK(7, 0)
197#define MAX30009_REG_DC_LEADS_CONFIGURATION 0x50
198#define MAX30009_EN_LON_DET_MSK NO_OS_BIT(7)
199#define MAX30009_EN_LOFF_DET_MSK NO_OS_BIT(6)
200#define MAX30009_EN_EXT_LOFF_MSK NO_OS_BIT(5)
201#define MAX30009_EN_DRV_OOR_MSK NO_OS_BIT(4)
202#define MAX30009_LOFF_IPOL_MSK NO_OS_BIT(3)
203#define MAX30009_LOFF_IMAG_MSK NO_OS_GENMASK(2, 0)
205#define MAX30009_REG_DC_LEAD_DETECT_THRESHOLD 0x51
206#define MAX30009_LOFF_THRESH_MSK NO_OS_GENMASK(3, 0)
208#define MAX30009_REG_LEAD_BIAS_CONFIGURATION1 0x58
209#define MAX30009_RBIAS_VAL_MSK NO_OS_GENMASK(3, 2)
210#define MAX30009_EN_RBIAS_BIP_MSK NO_OS_BIT(1)
211#define MAX30009_EN_RBIAS_BIN_MSK NO_OS_BIT(0)
213#define MAX30009_REG_INTERRUPT_ENABLE1 0x80
214#define MAX30009_A_FULL_EN_MSK NO_OS_BIT(7)
215#define MAX30009_FIFO_DATA_RDY_EN_MSK NO_OS_BIT(5)
216#define MAX30009_FREQ_UNLOCK_EN_MSK NO_OS_BIT(4)
217#define MAX30009_FREQ_LOCK_EN_MSK NO_OS_BIT(3)
218#define MAX30009_PHASE_UNLOCK_EN_MSK NO_OS_BIT(2)
219#define MAX30009_PHASE_LOCK_EN_MSK NO_OS_BIT(1)
221#define MAX30009_REG_INTERRUPT_ENABLE2 0x81
222#define MAX30009_LON_EN_MSK NO_OS_BIT(7)
223#define MAX30009_BIOZ_OVER_EN_MSK NO_OS_BIT(6)
224#define MAX30009_BIOZ_UNDR_EN_MSK NO_OS_BIT(5)
225#define MAX30009_DRV_OOR_EN_MSK NO_OS_BIT(4)
226#define MAX30009_DC_LOFF_PH_EN_MSK NO_OS_BIT(3)
227#define MAX30009_DC_LOFF_PL_EN_MSK NO_OS_BIT(2)
228#define MAX30009_DC_LOFF_NH_EN_MSK NO_OS_BIT(1)
229#define MAX30009_DC_LOFF_NL_EN_MSK NO_OS_BIT(0)
231#define MAX30009_REG_PART_ID 0xFF
233#define MAX30009_I2C_ADDRESS 0x68
234#define MAX30009_PART_ID_VALUE 0x42
235#define MAX30009_FIFO_DEPTH 256
236#define MAX30009_FIFO_DATA_SIZE 3
237#define MAX30009_PLL_LOCK_TIMEOUT_MS 1000
239#define MAX30009_REF_CLK_32768_HZ 32768
240#define MAX30009_REF_CLK_32000_HZ 32000
243#define MAX30009_FIFO_TAG_SHIFT 20
244#define MAX30009_FIFO_TAG_MASK NO_OS_GENMASK(3, 0)
245#define MAX30009_FIFO_DATA_MASK NO_OS_GENMASK(19, 0)
246#define MAX30009_FIFO_SIGN_BIT NO_OS_BIT(19)
247#define MAX30009_FIFO_SIGN_EXT 0xFFF00000UL
557 uint8_t *data, uint32_t len);
565 uint8_t *data, uint32_t len);
573 uint8_t mask, uint8_t value);
651 uint8_t broadcast_addr);
760 uint8_t low_thresh, uint8_t high_thresh);
764 bool i_clk_phase,
bool q_clk_phase);
811 uint8_t drvn_assign);
struct ad7616_init_param init_param
Definition ad7616_sdz.c:109
int max30009_enable_dac_reset(struct max30009_dev *device, bool enable)
Enable or disable DAC reset.
Definition max30009.c:1571
int max30009_soft_reset(struct max30009_dev *device)
Perform software reset.
Definition max30009.c:237
int max30009_insert_fifo_marker(struct max30009_dev *device)
Insert marker into FIFO data stream.
Definition max30009.c:792
int max30009_set_bioz_thresholds(struct max30009_dev *device, uint8_t low_thresh, uint8_t high_thresh)
Set BioZ threshold values.
Definition max30009.c:1626
int max30009_enable_calibration_mux(struct max30009_dev *device, bool enable)
Enable or disable calibration MUX.
Definition max30009.c:1748
int max30009_set_fifo_watermark(struct max30009_dev *device, uint8_t watermark)
Set FIFO watermark level.
Definition max30009.c:715
int max30009_set_bia_load_resistor(struct max30009_dev *device, enum max30009_bia_rsel rsel)
Set BIA (Body Impedance Analysis) load resistor.
Definition max30009.c:1783
int max30009_set_pll_config(struct max30009_dev *device, struct max30009_pll_config *pll_config)
Set complete PLL configuration.
Definition max30009.c:2143
int max30009_enable_external_load(struct max30009_dev *device, bool enable)
Enable or disable external load connection.
Definition max30009.c:1876
int max30009_set_digital_lpf(struct max30009_dev *device, enum max30009_dlpf dlpf)
Set digital low-pass filter.
Definition max30009.c:1285
int max30009_enable_bia_bist(struct max30009_dev *device, bool enable)
Enable or disable BIA BIST (Built-In Self Test)
Definition max30009.c:1804
int max30009_enable_drive_oor_detect(struct max30009_dev *device, bool enable)
Enable or disable drive out-of-range detection.
Definition max30009.c:2035
int max30009_enable_ina_chopping(struct max30009_dev *device, bool enable)
Enable or disable INA chopping.
Definition max30009.c:1677
int max30009_configure_int_pin(struct max30009_dev *device, uint8_t func_cfg, uint8_t out_cfg)
Configure INT pin function and output.
Definition max30009.c:868
int max30009_bioz_bg_enable(struct max30009_dev *device, bool enable)
Enable or disable BioZ bandgap.
Definition max30009.c:1182
max30009_bioz_gain
Definition max30009.h:249
@ MAX30009_BIOZ_GAIN_1
Definition max30009.h:250
@ MAX30009_BIOZ_GAIN_2
Definition max30009.h:251
@ MAX30009_BIOZ_GAIN_5
Definition max30009.h:252
@ MAX30009_BIOZ_GAIN_10
Definition max30009.h:253
int max30009_bioz_i_enable(struct max30009_dev *device, bool enable)
Enable or disable BioZ I channel.
Definition max30009.c:1150
int max30009_reg_read(struct max30009_dev *device, uint8_t reg_addr, uint8_t *data)
Read a single byte from register.
Definition max30009.c:171
int max30009_set_channel_freq_select(struct max30009_dev *device, bool fsel)
Set channel frequency select.
Definition max30009.c:1694
max30009_ahpf
Definition max30009.h:302
@ MAX30009_AHPF_4M2K_OHM
Definition max30009.h:314
@ MAX30009_AHPF_BYPASS
Definition max30009.h:310
@ MAX30009_AHPF_8M4K_OHM
Definition max30009.h:313
@ MAX30009_AHPF_848K_OHM
Definition max30009.h:316
@ MAX30009_AHPF_2M2K_OHM
Definition max30009.h:315
@ MAX30009_AHPF_42M4K_OHM
Definition max30009.h:311
@ MAX30009_AHPF_500HZ
Definition max30009.h:305
@ MAX30009_AHPF_5KHZ
Definition max30009.h:308
@ MAX30009_AHPF_1KHZ
Definition max30009.h:306
@ MAX30009_AHPF_21M2K_OHM
Definition max30009.h:312
@ MAX30009_AHPF_200HZ
Definition max30009.h:304
@ MAX30009_AHPF_2KHZ
Definition max30009.h:307
@ MAX30009_AHPF_100HZ
Definition max30009.h:303
@ MAX30009_AHPF_10KHZ
Definition max30009.h:309
int max30009_get_fifo_watermark(struct max30009_dev *desc, uint8_t *watermark)
Gets the FIFO watermark level of the device.
Definition max30009.c:735
int max30009_pll_enable(struct max30009_dev *device, bool enable)
Enable or disable PLL.
Definition max30009.c:1023
int max30009_enable_rapid_lead_off(struct max30009_dev *device, bool enable)
Enable or disable rapid lead-off detection.
Definition max30009.c:1397
int max30009_init(struct max30009_dev **device, struct max30009_init_param *init_param)
Initialize the MAX30009 device.
Definition max30009.c:322
int max30009_fifo_decode_sample(uint8_t *raw_data, struct max30009_fifo_sample *sample)
Decode a 3-byte FIFO sample into type and data.
Definition max30009.c:636
int max30009_clear_status(struct max30009_dev *device)
Clear interrupt status registers.
Definition max30009.c:2655
int max30009_set_drive_current_detailed(struct max30009_dev *device, uint8_t idrv_range, uint8_t vdrv_mag)
Set drive current with detailed control.
Definition max30009.c:1349
max30009_bia_rsel
Definition max30009.h:326
@ MAX30009_BIA_900_OHM
Definition max30009.h:328
@ MAX30009_BIA_280_OHM
Definition max30009.h:330
@ MAX30009_BIA_600_OHM
Definition max30009.h:329
@ MAX30009_BIA_5100_OHM
Definition max30009.h:327
int max30009_enable_gsr_load(struct max30009_dev *device, bool enable)
Enable or disable GSR load resistor.
Definition max30009.c:1842
int max30009_set_lead_detect_config(struct max30009_dev *device, struct max30009_lead_detect_config *lead_config)
Set complete lead detection configuration.
Definition max30009.c:2484
int max30009_reg_read_multiple(struct max30009_dev *device, uint8_t reg_addr, uint8_t *data, uint32_t len)
Read multiple bytes from register.
Definition max30009.c:158
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.
Definition max30009.c:975
max30009_bioz_bw
Definition max30009.h:263
@ MAX30009_BIOZ_HIGH_BW
Definition max30009.h:267
@ MAX30009_BIOZ_LOW_BW
Definition max30009.h:264
@ MAX30009_BIOZ_MEDIUM_LOW_BW
Definition max30009.h:265
@ MAX30009_BIOZ_MEDIUM_HIGH_BW
Definition max30009.h:266
int max30009_set_fifo_rollover(struct max30009_dev *device, bool rollover)
Set FIFO rollover mode.
Definition max30009.c:757
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.
Definition max30009.c:1896
int max30009_set_analog_hpf(struct max30009_dev *device, enum max30009_ahpf ahpf)
Set analog high-pass filter.
Definition max30009.c:1306
int max30009_clear_fifo_status(struct max30009_dev *device)
Clear FIFO status flags.
Definition max30009.c:808
int max30009_enable_external_cap(struct max30009_dev *device, bool enable)
Enable or disable external capacitor.
Definition max30009.c:1520
int max30009_set_lead_off_current(struct max30009_dev *device, enum max30009_loff_current current)
Set lead-off detection current magnitude.
Definition max30009.c:1980
int max30009_get_bioz_mux_config(struct max30009_dev *device, struct max30009_bioz_mux_config *mux_config)
Get complete BioZ MUX configuration.
Definition max30009.c:2466
max30009_dhpf
Definition max30009.h:288
@ MAX30009_DHPF_BYPASS
Definition max30009.h:289
@ MAX30009_DHPF_0_00025_SR
Definition max30009.h:290
@ MAX30009_DHPF_0_002_SR
Definition max30009.h:291
int max30009_get_fifo_config(struct max30009_dev *device, struct max30009_fifo_config *fifo_config)
Get complete FIFO configuration.
Definition max30009.c:2246
int max30009_enable_dc_restore(struct max30009_dev *device, bool enable)
Enable or disable DC restore circuit.
Definition max30009.c:1537
int max30009_disable_differential_mode(struct max30009_dev *device, bool disable)
Disable differential mode (enable single-ended)
Definition max30009.c:1461
int max30009_set_ina_mode(struct max30009_dev *device, bool low_power)
Set INA (Instrumentation Amplifier) mode.
Definition max30009.c:1444
int max30009_verify_part_id(struct max30009_dev *device)
Read device part ID.
Definition max30009.c:281
int max30009_set_amp_range(struct max30009_dev *device, uint8_t amp_range)
Set amplifier range.
Definition max30009.c:1480
max30009_adc_osr
Definition max30009.h:277
@ MAX30009_ADC_OSR_32
Definition max30009.h:280
@ MAX30009_ADC_OSR_16
Definition max30009.h:279
@ MAX30009_ADC_OSR_8
Definition max30009.h:278
@ MAX30009_ADC_OSR_512
Definition max30009.h:284
@ MAX30009_ADC_OSR_1024
Definition max30009.h:285
@ MAX30009_ADC_OSR_64
Definition max30009.h:281
@ MAX30009_ADC_OSR_128
Definition max30009.h:282
@ MAX30009_ADC_OSR_256
Definition max30009.h:283
int max30009_configure_i2c_broadcast(struct max30009_dev *device, bool enable, uint8_t broadcast_addr)
Configure I2C broadcast address.
Definition max30009.c:933
max30009_fifo_sample_type
Definition max30009.h:536
@ MAX30009_FIFO_SAMPLE_IN_PHASE
Definition max30009.h:537
@ MAX30009_FIFO_SAMPLE_QUADRATURE
Definition max30009.h:538
@ MAX30009_FIFO_SAMPLE_INVALID
Definition max30009.h:540
@ MAX30009_FIFO_SAMPLE_MARKER
Definition max30009.h:539
int max30009_bioz_enable(struct max30009_dev *device, bool enable)
Enable or disable BioZ measurement.
Definition max30009.c:1121
int max30009_enable_external_lead_off(struct max30009_dev *device, bool enable)
Enable or disable external lead-off detection.
Definition max30009.c:2018
int max30009_configure_trig_pin(struct max30009_dev *device, uint8_t input_cfg, uint8_t output_cfg)
Configure TRIG pin input and output.
Definition max30009.c:900
int max30009_interrupt_config(struct max30009_dev *device, uint8_t int1_mask, uint8_t int2_mask)
Configure interrupt enables.
Definition max30009.c:2551
int max30009_set_comparison_mode(struct max30009_dev *device, uint8_t cmp_mode)
Set comparison mode for threshold detection.
Definition max30009.c:1588
int max30009_calibration_connect_only(struct max30009_dev *device, bool cal_only)
Set calibration connect-only mode.
Definition max30009.c:1765
max30009_dlpf
Definition max30009.h:294
@ MAX30009_DLPF_BYPASS
Definition max30009.h:295
@ MAX30009_DLPF_0_08_SR
Definition max30009.h:298
@ MAX30009_DLPF_0_02_SR
Definition max30009.h:297
@ MAX30009_DLPF_0_005_SR
Definition max30009.h:296
@ MAX30009_DLPF_0_25_SR
Definition max30009.h:299
int max30009_reg_write_multiple(struct max30009_dev *device, uint8_t reg_addr, uint8_t *data, uint32_t len)
Write multiple bytes to register.
Definition max30009.c:185
int max30009_timing_system_reset(struct max30009_dev *device)
Trigger timing system reset for PLL synchronization.
Definition max30009.c:825
int max30009_set_dac_osr(struct max30009_dev *device, enum max30009_dac_osr osr)
Set DAC oversampling ratio.
Definition max30009.c:1208
int max30009_set_digital_hpf(struct max30009_dev *device, enum max30009_dhpf dhpf)
Set digital high-pass filter.
Definition max30009.c:1263
max30009_interrupt
Definition max30009.h:519
@ MAX30009_INT_DC_LOFF_NH
Definition max30009.h:532
@ MAX30009_INT_PHASE_LOCK
Definition max30009.h:525
@ MAX30009_INT_FIFO_DATA_RDY
Definition max30009.h:521
@ MAX30009_INT_DRV_OOR
Definition max30009.h:529
@ MAX30009_INT_PHASE_UNLOCK
Definition max30009.h:524
@ MAX30009_INT_BIOZ_UNDR
Definition max30009.h:528
@ MAX30009_INT_FREQ_UNLOCK
Definition max30009.h:522
@ MAX30009_INT_A_FULL
Definition max30009.h:520
@ MAX30009_INT_BIOZ_OVER
Definition max30009.h:527
@ MAX30009_INT_DC_LOFF_NL
Definition max30009.h:533
@ MAX30009_INT_LON
Definition max30009.h:526
@ MAX30009_INT_DC_LOFF_PL
Definition max30009.h:531
@ MAX30009_INT_DC_LOFF_PH
Definition max30009.h:530
@ MAX30009_INT_FREQ_LOCK
Definition max30009.h:523
int max30009_enable_fast_start(struct max30009_dev *device, bool enable, bool manual)
Enable or disable fast start mode.
Definition max30009.c:1416
int max30009_get_status(struct max30009_dev *device, struct max30009_status *status)
Get device status.
Definition max30009.c:441
int max30009_read_fifo_data(struct max30009_dev *device, uint8_t *data, uint32_t len)
Read data from FIFO.
Definition max30009.c:609
int max30009_read_bist_error(struct max30009_dev *device, uint8_t *error)
Read BIST error value.
Definition max30009.c:1928
int max30009_enable_calibration(struct max30009_dev *device, bool enable)
Enable or disable calibration mode.
Definition max30009.c:1731
int max30009_enable_interrupt(struct max30009_dev *device, enum max30009_interrupt interrupt, bool enable)
Enable or disable a specific interrupt.
Definition max30009.c:2575
int max30009_enable_standby_mode(struct max30009_dev *device, bool keep_rx_on)
Enable or disable standby mode.
Definition max30009.c:1713
int max30009_get_fifo_pointers(struct max30009_dev *device, uint8_t *write_ptr, uint8_t *read_ptr)
Get FIFO read and write pointers.
Definition max30009.c:690
int max30009_lead_off_config(struct max30009_dev *device, bool enable, uint8_t threshold)
Configure lead-off detection.
Definition max30009.c:1944
max30009_bioz_drv_mode
Definition max30009.h:256
@ MAX30009_CURRENT_DRV_MODE
Definition max30009.h:257
@ MAX30009_H_BRIDGE_DRV_MODE
Definition max30009.h:259
@ MAX30009_VOLTAGE_DRV_MODE
Definition max30009.h:258
@ MAX30009_STANDBY_MODE
Definition max30009.h:260
int max30009_fifo_flush(struct max30009_dev *device)
Flush FIFO contents.
Definition max30009.c:537
int max30009_remove(struct max30009_dev *device)
Remove the MAX30009 device and free resources.
Definition max30009.c:408
int max30009_bioz_q_enable(struct max30009_dev *device, bool enable)
Enable or disable BioZ Q channel.
Definition max30009.c:1166
int max30009_enable_external_resistor(struct max30009_dev *device, bool enable)
Enable or disable external resistor for current drive.
Definition max30009.c:1379
int max30009_pll_set_lock_window(struct max30009_dev *device, bool lock_window)
Set PLL lock window.
Definition max30009.c:1051
max30009_drive_mode
Definition max30009.h:319
@ MAX30009_DRIVE_SINE_CURRENT
Definition max30009.h:320
@ MAX30009_DRIVE_HBRIDGE
Definition max30009.h:322
@ MAX30009_DRIVE_SINE_VOLTAGE
Definition max30009.h:321
@ MAX30009_DRIVE_STANDBY
Definition max30009.h:323
max30009_rbias_val
Definition max30009.h:349
@ MAX30009_RBIAS_100M_OHM
Definition max30009.h:351
@ MAX30009_RBIAS_50M_OHM
Definition max30009.h:350
@ MAX30009_RBIAS_RESERVED
Definition max30009.h:353
@ MAX30009_RBIAS_200M_OHM
Definition max30009.h:352
int max30009_set_bioz_config(struct max30009_dev *device, struct max30009_bioz_config *bioz_config)
Set complete BioZ configuration.
Definition max30009.c:2264
int max30009_set_adc_osr(struct max30009_dev *device, enum max30009_adc_osr osr)
Set ADC oversampling ratio.
Definition max30009.c:1235
int max30009_set_clock_source(struct max30009_dev *device, bool use_external, bool use_32768_hz)
Configure clock source.
Definition max30009.c:1069
int max30009_set_drive_mode(struct max30009_dev *device, enum max30009_drive_mode mode)
Set drive mode (current, voltage, H-bridge, or standby)
Definition max30009.c:1327
int max30009_set_gsr_load_resistor(struct max30009_dev *device, enum max30009_gsr_rsel rsel)
Set GSR (Galvanic Skin Response) load resistor.
Definition max30009.c:1821
int max30009_get_lead_detect_config(struct max30009_dev *device, struct max30009_lead_detect_config *lead_config)
Get complete lead detection configuration.
Definition max30009.c:2532
int max30009_disable_i2c(struct max30009_dev *device)
Disable I2C interface (SPI only mode)
Definition max30009.c:956
int max30009_set_lead_off_polarity(struct max30009_dev *device, bool positive)
Set lead-off detection current polarity.
Definition max30009.c:2001
max30009_pll_kdiv
Definition max30009.h:361
@ MAX30009_KDIV_2
Definition max30009.h:363
@ MAX30009_KDIV_64
Definition max30009.h:368
@ MAX30009_KDIV_32
Definition max30009.h:367
@ MAX30009_KDIV_256
Definition max30009.h:370
@ MAX30009_KDIV_128
Definition max30009.h:369
@ MAX30009_KDIV_4
Definition max30009.h:364
@ MAX30009_KDIV_8192
Definition max30009.h:375
@ MAX30009_KDIV_8
Definition max30009.h:365
@ MAX30009_KDIV_4096
Definition max30009.h:374
@ MAX30009_KDIV_512
Definition max30009.h:371
@ MAX30009_KDIV_1024
Definition max30009.h:372
@ MAX30009_KDIV_1
Definition max30009.h:362
@ MAX30009_KDIV_2048
Definition max30009.h:373
@ MAX30009_KDIV_16
Definition max30009.h:366
int max30009_fifo_get_count(struct max30009_dev *device, uint16_t *count)
Get FIFO data count.
Definition max30009.c:554
int max30009_set_power_mode(struct max30009_dev *device, bool shutdown)
Set power mode (shutdown or active)
Definition max30009.c:305
int max30009_enable_bioz_threshold(struct max30009_dev *device, bool enable)
Enable or disable BioZ threshold detection.
Definition max30009.c:1608
max30009_dac_osr
Definition max30009.h:270
@ MAX30009_DAC_OSR_128
Definition max30009.h:273
@ MAX30009_DAC_OSR_64
Definition max30009.h:272
@ MAX30009_DAC_OSR_32
Definition max30009.h:271
@ MAX30009_DAC_OSR_256
Definition max30009.h:274
int max30009_clock_fine_tune(struct max30009_dev *device, uint8_t tune_val)
Fine tune internal clock frequency.
Definition max30009.c:1101
int max30009_check_lead_off(struct max30009_dev *device, bool *leads_on)
Check lead-off detection status.
Definition max30009.c:515
int max30009_set_fifo_config(struct max30009_dev *device, struct max30009_fifo_config *fifo_config)
Set complete FIFO configuration.
Definition max30009.c:2204
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.
Definition max30009.c:2104
int max30009_set_master_mode(struct max30009_dev *device, bool is_master)
Set master/slave mode for PLL synchronization.
Definition max30009.c:850
max30009_gsr_rsel
Definition max30009.h:333
@ MAX30009_GSR_1M_OHM
Definition max30009.h:337
@ MAX30009_GSR_101K_OHM
Definition max30009.h:335
@ MAX30009_GSR_25K7_OHM
Definition max30009.h:334
@ MAX30009_GSR_505K_OHM
Definition max30009.h:336
int max30009_set_a_full_type(struct max30009_dev *device, bool type)
Set almost-full interrupt type.
Definition max30009.c:775
int max30009_enable_internal_load(struct max30009_dev *device, bool enable)
Enable or disable internal load resistor.
Definition max30009.c:1859
int max30009_set_amp_bandwidth(struct max30009_dev *device, uint8_t amp_bw)
Set amplifier bandwidth.
Definition max30009.c:1500
int max30009_set_bioz_mux_config(struct max30009_dev *device, struct max30009_bioz_mux_config *mux_config)
Set complete BioZ MUX configuration.
Definition max30009.c:2399
int max30009_reg_write(struct max30009_dev *device, uint8_t reg_addr, uint8_t data)
Write a single byte to register.
Definition max30009.c:198
int max30009_get_pll_config(struct max30009_dev *device, struct max30009_pll_config *pll_config)
Get complete PLL configuration.
Definition max30009.c:2186
max30009_loff_current
Definition max30009.h:340
@ MAX30009_LOFF_10NA
Definition max30009.h:343
@ MAX30009_LOFF_50NA
Definition max30009.h:345
@ MAX30009_LOFF_DISABLE
Definition max30009.h:341
@ MAX30009_LOFF_100NA
Definition max30009.h:346
@ MAX30009_LOFF_20NA
Definition max30009.h:344
@ MAX30009_LOFF_5NA
Definition max30009.h:342
int max30009_set_demod_clk_phases(struct max30009_dev *device, bool i_clk_phase, bool q_clk_phase)
Set demodulation clock phases.
Definition max30009.c:1650
int max30009_get_detailed_lead_status(struct max30009_dev *device, struct max30009_lead_status *status)
Get detailed lead detection status.
Definition max30009.c:2070
int max30009_fifo_get_ovf_count(struct max30009_dev *device, uint16_t *count)
Get FIFO overflow data count.
Definition max30009.c:586
int max30009_reg_update(struct max30009_dev *device, uint8_t reg_addr, uint8_t mask, uint8_t value)
Update specific bits in a register.
Definition max30009.c:214
int max30009_enable_ultra_low_power_lead_on(struct max30009_dev *device, bool enable)
Enable or disable ultra-low-power lead-on detection.
Definition max30009.c:2052
int max30009_get_bioz_config(struct max30009_dev *device, struct max30009_bioz_config *bioz_config)
Get complete BioZ configuration.
Definition max30009.c:2381
max30009_pll_ndiv
Definition max30009.h:356
@ MAX30009_NDIV_512
Definition max30009.h:357
@ MAX30009_NDIV_1024
Definition max30009.h:358
int max30009_enable_drive_reset(struct max30009_dev *device, bool enable)
Enable or disable drive reset.
Definition max30009.c:1554
Header file of GPIO Interface.
Header file of I2C Interface.
Header file of SPI Interface.
Header file of utility functions.
Definition ad9361_util.h:63
Definition max30009.h:396
bool ext_cap
Definition max30009.h:414
enum max30009_dlpf dlpf
Definition max30009.h:400
enum max30009_dac_osr dac_osr
Definition max30009.h:397
enum max30009_adc_osr adc_osr
Definition max30009.h:398
bool fast_start_en
Definition max30009.h:409
bool dm_dis
Definition max30009.h:412
bool loff_rapid
Definition max30009.h:404
bool stbyon
Definition max30009.h:422
enum max30009_drive_mode drv_mode
Definition max30009.h:407
bool i_clk_phase
Definition max30009.h:424
enum max30009_ahpf ahpf
Definition max30009.h:410
enum max30009_bioz_gain gain
Definition max30009.h:413
uint8_t hi_thresh
Definition max30009.h:421
uint8_t amp_rge
Definition max30009.h:418
bool drv_reset
Definition max30009.h:416
uint8_t cmp_mode
Definition max30009.h:401
bool q_clk_phase
Definition max30009.h:423
uint8_t idrv_rge
Definition max30009.h:406
uint8_t lo_thresh
Definition max30009.h:420
bool ext_res
Definition max30009.h:403
bool dac_reset
Definition max30009.h:417
bool dc_restore
Definition max30009.h:415
enum max30009_dhpf dhpf
Definition max30009.h:399
bool ina_chop_en
Definition max30009.h:425
bool fast_manual
Definition max30009.h:408
uint8_t amp_bw
Definition max30009.h:419
bool ch_fsel
Definition max30009.h:426
bool en_bioz_thresh
Definition max30009.h:402
bool ina_mode
Definition max30009.h:411
uint8_t vdrv_mag
Definition max30009.h:405
Definition max30009.h:480
int32_t i_data
Definition max30009.h:481
int32_t q_data
Definition max30009.h:482
Definition max30009.h:429
bool connect_cal_only
Definition max30009.h:432
enum max30009_bia_rsel bmux_rsel
Definition max30009.h:430
uint8_t drvp_assign
Definition max30009.h:441
bool cal_en
Definition max30009.h:434
bool en_int_inload
Definition max30009.h:438
bool bmux_bist_en
Definition max30009.h:431
bool gsr_load_en
Definition max30009.h:436
uint8_t bin_assign
Definition max30009.h:440
bool en_ext_inload
Definition max30009.h:437
uint8_t drvn_assign
Definition max30009.h:442
enum max30009_gsr_rsel bmux_gsr_rsel
Definition max30009.h:435
bool mux_en
Definition max30009.h:433
uint8_t bip_assign
Definition max30009.h:439
Definition max30009.h:499
float i_coef
Definition max30009.h:502
float q_offset
Definition max30009.h:501
float i_phase_coef
Definition max30009.h:504
float i_offset
Definition max30009.h:500
float q_phase_coef
Definition max30009.h:505
float q_coef
Definition max30009.h:503
Definition max30009.h:458
struct no_os_spi_desc * spi_desc
Definition max30009.h:460
struct max30009_fifo_config fifo_config
Definition max30009.h:464
struct max30009_bioz_mux_config bioz_mux_config
Definition max30009.h:466
struct max30009_lead_detect_config lead_detect_config
Definition max30009.h:467
uint8_t * fifo_read_buf
Definition max30009.h:469
struct max30009_pll_config pll_config
Definition max30009.h:463
uint32_t ref_clk_freq
Definition max30009.h:468
struct max30009_bioz_config bioz_config
Definition max30009.h:465
struct no_os_i2c_desc * i2c_desc
Definition max30009.h:459
struct no_os_gpio_desc * csb_gpio_desc
Definition max30009.h:462
struct no_os_gpio_desc * int_gpio
Definition max30009.h:461
Definition max30009.h:389
bool fifo_stat_clr
Definition max30009.h:393
uint8_t watermark
Definition max30009.h:390
bool fifo_rollover
Definition max30009.h:391
bool a_full_type
Definition max30009.h:392
Definition max30009.h:543
enum max30009_fifo_sample_type type
Definition max30009.h:544
int32_t data
Definition max30009.h:545
Definition max30009.h:472
struct no_os_gpio_init_param * int_gpio_init
Definition max30009.h:476
struct no_os_spi_init_param spi_init
Definition max30009.h:475
struct no_os_i2c_init_param i2c_init
Definition max30009.h:474
bool use_i2c
Definition max30009.h:473
struct no_os_gpio_init_param csb_gpio_init
Definition max30009.h:477
Definition max30009.h:445
uint8_t loff_thresh
Definition max30009.h:452
enum max30009_loff_current loff_imag
Definition max30009.h:451
bool en_loff_det
Definition max30009.h:447
bool en_lon_det
Definition max30009.h:446
bool en_drv_oor
Definition max30009.h:449
bool en_rbias_bip
Definition max30009.h:454
bool en_rbias_bin
Definition max30009.h:455
enum max30009_rbias_val rbias_value
Definition max30009.h:453
bool loff_ipol
Definition max30009.h:450
bool en_ext_loff
Definition max30009.h:448
Definition max30009.h:508
bool dc_loff_nl
Definition max30009.h:513
bool dc_loff_nh
Definition max30009.h:512
bool bioz_undr
Definition max30009.h:516
bool bioz_over
Definition max30009.h:515
bool drv_oor
Definition max30009.h:514
bool dc_loff_ph
Definition max30009.h:510
bool dc_loff_pl
Definition max30009.h:511
bool leads_on
Definition max30009.h:509
Definition max30009.h:378
enum max30009_pll_ndiv ndiv
Definition max30009.h:380
bool pll_enabled
Definition max30009.h:386
bool use_external_clk
Definition max30009.h:383
enum max30009_pll_kdiv kdiv
Definition max30009.h:381
uint16_t mdiv
Definition max30009.h:379
uint8_t clk_fine_tune
Definition max30009.h:385
bool pll_lock_wndw
Definition max30009.h:382
bool use_32768_hz
Definition max30009.h:384
Definition max30009.h:485
bool pwr_rdy
Definition max30009.h:492
bool freq_unlock
Definition max30009.h:488
bool freq_lock
Definition max30009.h:489
bool drv_oor
Definition max30009.h:496
bool bioz_undr
Definition max30009.h:495
bool leads_on
Definition max30009.h:493
bool a_full
Definition max30009.h:486
bool phase_lock
Definition max30009.h:491
bool fifo_data_rdy
Definition max30009.h:487
bool phase_unlock
Definition max30009.h:490
bool bioz_over
Definition max30009.h:494
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128