This is a mbed 5.2 Release
Fork of mbed-os-test by
MAX30001 Class Reference
Maxim Integrated MAX30001 ECG/BIOZ chip. More...
#include <MAX30001.h>
Data Structures | |
union | max30001_bioz_reg |
CNFG_BIOZ (0x18) More... | |
union | max30001_cnfg_bmux_reg |
CNFG_BMUX (0x17) More... | |
union | max30001_cnfg_cal_reg |
CNFG_CAL (0x12) More... | |
union | max30001_cnfg_ecg_reg |
CNFG_ECG (0x15) More... | |
union | max30001_cnfg_emux_reg |
CNFG_EMUX (0x14) More... | |
union | max30001_cnfg_gen_reg |
CNFG_GEN (0x10) More... | |
union | max30001_cnfg_pace_reg |
CNFG_PACE (0x1A) More... | |
union | max30001_cnfg_rtor1_reg |
CNFG_RTOR1 (0x1D) More... | |
union | max30001_cnfg_rtor2_reg |
CNFG_RTOR2 (0x1E) More... | |
union | max30001_en_int2_reg |
EN_INT2 (0x03) More... | |
union | max30001_en_int_reg |
EN_INT (0x02) More... | |
union | max30001_info_reg |
INFO (0x0F) More... | |
union | max30001_mngr_dyn_reg |
MNGR_DYN (0x05) More... | |
union | max30001_mngr_int_reg |
MNGR_INT (0x04) More... | |
union | max30001_status_reg |
STATUS (0x01) More... | |
Public Types | |
typedef void(* | PtrFunction )(uint32_t id, uint32_t *buffer, uint32_t length) |
type definition for data interrupt | |
Public Member Functions | |
MAX30001 (SPI *spi) | |
Constructor that accepts pin names for the SPI interface. | |
MAX30001 (PinName mosi, PinName miso, PinName sclk, PinName cs) | |
Constructor that accepts pin names for the SPI interface. | |
~MAX30001 (void) | |
MAX30001 destructor. | |
int | max30001_Rbias_FMSTR_Init (uint8_t En_rbias, uint8_t Rbiasv, uint8_t Rbiasp, uint8_t Rbiasn, uint8_t Fmstr) |
This function sets up the Resistive Bias mode and also selects the master clock frequency. | |
int | max30001_CAL_InitStart (uint8_t En_Vcal, uint8_t Vmode, uint8_t Vmag, uint8_t Fcal, uint16_t Thigh, uint8_t Fifty) |
This function uses sets up the calibration signal internally. | |
int | max30001_CAL_Stop (void) |
This function disables the VCAL signal. | |
int | max30001_INT_assignment (max30001_intrpt_Location_t en_enint_loc, max30001_intrpt_Location_t en_eovf_loc, max30001_intrpt_Location_t en_fstint_loc, max30001_intrpt_Location_t en_dcloffint_loc, max30001_intrpt_Location_t en_bint_loc, max30001_intrpt_Location_t en_bovf_loc, max30001_intrpt_Location_t en_bover_loc, max30001_intrpt_Location_t en_bundr_loc, max30001_intrpt_Location_t en_bcgmon_loc, max30001_intrpt_Location_t en_pint_loc, max30001_intrpt_Location_t en_povf_loc, max30001_intrpt_Location_t en_pedge_loc, max30001_intrpt_Location_t en_lonint_loc, max30001_intrpt_Location_t en_rrint_loc, max30001_intrpt_Location_t en_samp_loc, max30001_intrpt_type_t intb_Type, max30001_intrpt_type_t int2b_Type) |
This function handles the assignment of the two interrupt pins (INTB & INT2B) with various. | |
int | max30001_ECG_InitStart (uint8_t En_ecg, uint8_t Openp, uint8_t Openn, uint8_t Pol, uint8_t Calp_sel, uint8_t Caln_sel, uint8_t E_fit, uint8_t Rate, uint8_t Gain, uint8_t Dhpf, uint8_t Dlpf) |
For MAX30001/3 ONLY. | |
int | max30001_ECGFast_Init (uint8_t Clr_Fast, uint8_t Fast, uint8_t Fast_Th) |
For MAX30001/3 ONLY. | |
int | max30001_Stop_ECG (void) |
For MAX30001/3 ONLY. | |
int | max30001_PACE_InitStart (uint8_t En_pace, uint8_t Clr_pedge, uint8_t Pol, uint8_t Gn_diff_off, uint8_t Gain, uint8_t Aout_lbw, uint8_t Aout, uint8_t Dacp, uint8_t Dacn) |
For MAX30001 ONLY. | |
int | max30001_Stop_PACE (void) |
For MAX30001 ONLY. | |
int | max30001_BIOZ_InitStart (uint8_t En_bioz, uint8_t Openp, uint8_t Openn, uint8_t Calp_sel, uint8_t Caln_sel, uint8_t CG_mode, uint8_t B_fit, uint8_t Rate, uint8_t Ahpf, uint8_t Ext_rbias, uint8_t Gain, uint8_t Dhpf, uint8_t Dlpf, uint8_t Fcgen, uint8_t Cgmon, uint8_t Cgmag, uint8_t Phoff) |
For MAX30001/2 ONLY. | |
int | max30001_Stop_BIOZ (void) |
For MAX30001/2 ONLY. | |
int | max30001_BIOZ_InitBist (uint8_t En_bist, uint8_t Rnom, uint8_t Rmod, uint8_t Fbist) |
For MAX30001/2 ONLY. | |
int | max30001_RtoR_InitStart (uint8_t En_rtor, uint8_t Wndw, uint8_t Gain, uint8_t Pavg, uint8_t Ptsf, uint8_t Hoff, uint8_t Ravg, uint8_t Rhsf, uint8_t Clr_rrint) |
For MAX30001/3/4 ONLY. | |
int | max30001_Stop_RtoR (void) |
For MAX30001/3/4 ONLY. | |
int | max30001_PLL_lock (void) |
This is a function that waits for the PLL to lock; once a lock is achieved it exits out. | |
int | max30001_sw_rst (void) |
This function causes the MAX30001 to reset. | |
int | max30001_synch (void) |
This function provides a SYNCH operation. | |
int | max300001_fifo_rst (void) |
This function performs a FIFO Reset. | |
int | max30001_int_handler (void) |
This is a callback function which collects all the data from the ECG, BIOZ, PACE and RtoR. | |
int | max30001_FIFO_LeadONOff_Read (void) |
This is function called from the max30001_int_handler() function and processes all the ECG, BIOZ, PACE. | |
int | max30001_reg_write (MAX30001_REG_map_t addr, uint32_t data) |
This function allows writing to a register. | |
int | max30001_reg_read (MAX30001_REG_map_t addr, uint32_t *return_data) |
This function allows reading from a register. | |
int | max30001_Enable_DcLeadOFF_Init (int8_t En_dcloff, int8_t Ipol, int8_t Imag, int8_t Vth) |
This function enables the DC Lead Off detection. | |
int | max30001_Disable_DcLeadOFF (void) |
This function disables the DC Lead OFF feature, whichever is active. | |
int | max30001_BIOZ_Enable_ACLeadOFF_Init (uint8_t En_bloff, uint8_t Bloff_hi_it, uint8_t Bloff_lo_it) |
This function sets up the BIOZ for AC Lead Off test. | |
int | max30001_BIOZ_Disable_ACleadOFF (void) |
This function Turns of the BIOZ AC Lead OFF feature. | |
int | max30001_BIOZ_Enable_BCGMON (void) |
This function enables the Current Gnerator Monitor. | |
int | max30001_Enable_LeadON (int8_t Channel) |
This function enables the Lead ON detection. | |
int | max30001_Disable_LeadON (void) |
This function turns off the Lead ON feature, whichever one is active. | |
void | max30001_ServiceLeadON (uint32_t currentTime) |
This function is toggled every 2 seconds to switch between ECG Lead ON and BIOZ Lead ON detect. | |
void | max30001_ServiceLeadoff (uint32_t currentTime) |
This function is toggled every 2 seconds to switch between ECG DC Lead Off and BIOZ DC Lead Off. | |
void | max30001_ReadHeartrateData (max30001_t *_hspValMax30001) |
This function sets current RtoR values and fmstr values in a pointer structure. | |
void | onDataAvailable (PtrFunction _onDataAvailable) |
Used to connect a callback for when interrupt data is available. |
Detailed Description
Maxim Integrated MAX30001 ECG/BIOZ chip.
Definition at line 101 of file MAX30001.h.
Member Typedef Documentation
typedef void(* PtrFunction)(uint32_t id, uint32_t *buffer, uint32_t length) |
type definition for data interrupt
Definition at line 1025 of file MAX30001.h.
Constructor & Destructor Documentation
MAX30001 | ( | SPI * | spi ) |
Constructor that accepts pin names for the SPI interface.
- Parameters:
-
spi pointer to the mbed SPI object
Definition at line 51 of file MAX30001.cpp.
MAX30001 | ( | PinName | mosi, |
PinName | miso, | ||
PinName | sclk, | ||
PinName | cs | ||
) |
Constructor that accepts pin names for the SPI interface.
- Parameters:
-
mosi master out slave in pin name miso master in slave out pin name sclk serial clock pin name cs chip select pin name
Definition at line 41 of file MAX30001.cpp.
~MAX30001 | ( | void | ) |
MAX30001 destructor.
Definition at line 61 of file MAX30001.cpp.
Member Function Documentation
int max300001_fifo_rst | ( | void | ) |
This function performs a FIFO Reset.
Uses Register FIFO_RST-0x0A. Please refer to the data sheet for the details on how to use this.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 653 of file MAX30001.cpp.
int max30001_BIOZ_Disable_ACleadOFF | ( | void | ) |
This function Turns of the BIOZ AC Lead OFF feature.
Registers Used: CNFG_GEN-0x10
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 772 of file MAX30001.cpp.
int max30001_BIOZ_Enable_ACLeadOFF_Init | ( | uint8_t | En_bloff, |
uint8_t | Bloff_hi_it, | ||
uint8_t | Bloff_lo_it | ||
) |
This function sets up the BIOZ for AC Lead Off test.
Registers Used: CNFG_GEN-0x10, MNGR_DYN-0x05
- Parameters:
-
En_bloff,: BIOZ Digital Lead Off Detection Enable <CNFG_GEN register>=""> Bloff_hi_it,: DC Lead Off Current Polarity (if current sources are enabled/connected) <MNGR_DYN register>=""> Bloff_lo_it,: DC Lead off current Magnitude Selection <MNGR_DYN register>="">
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 741 of file MAX30001.cpp.
int max30001_BIOZ_Enable_BCGMON | ( | void | ) |
This function enables the Current Gnerator Monitor.
Registers Used: CNFG_BIOZ-0x18
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 788 of file MAX30001.cpp.
int max30001_BIOZ_InitBist | ( | uint8_t | En_bist, |
uint8_t | Rnom, | ||
uint8_t | Rmod, | ||
uint8_t | Fbist | ||
) |
For MAX30001/2 ONLY.
BIOZ modulated Resistance Built-in-Self-Test, Registers used: CNFG_BMUX-0x17
- Parameters:
-
En_bist,: Enable Modulated Resistance Built-in-Self-test <CNFG_BMUX register>=""> Rnom,: BIOZ RMOD BIST Nominal Resistance Selection <CNFG_BMUX register>=""> Rmod,: BIOZ RMOD BIST Modulated Resistance Selection <CNFG_BMUX register>=""> Fbist,: BIOZ RMOD BIST Frequency Selection <CNFG_BMUX register>="">
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 529 of file MAX30001.cpp.
int max30001_BIOZ_InitStart | ( | uint8_t | En_bioz, |
uint8_t | Openp, | ||
uint8_t | Openn, | ||
uint8_t | Calp_sel, | ||
uint8_t | Caln_sel, | ||
uint8_t | CG_mode, | ||
uint8_t | B_fit, | ||
uint8_t | Rate, | ||
uint8_t | Ahpf, | ||
uint8_t | Ext_rbias, | ||
uint8_t | Gain, | ||
uint8_t | Dhpf, | ||
uint8_t | Dlpf, | ||
uint8_t | Fcgen, | ||
uint8_t | Cgmon, | ||
uint8_t | Cgmag, | ||
uint8_t | Phoff | ||
) |
For MAX30001/2 ONLY.
This function sets up the MAX30001 for BIOZ measurement. Registers used: MNGR_INT-0x04, CNFG_GEN-0X10, CNFG_BMUX-0x17,CNFG_BIOZ-0x18.
- Parameters:
-
En_bioz,: BIOZ Channel Enable <CNFG_GEN register>=""> Openp,: Open the BIP Input Switch <CNFG_BMUX register>=""> Openn,: Open the BIN Input Switch <CNFG_BMUX register>=""> Calp_sel,: BIP Calibration Selection <CNFG_BMUX register>=""> Caln_sel,: BIN Calibration Selection <CNFG_BMUX register>=""> CG_mode,: BIOZ Current Generator Mode Selection <CNFG_BMUX register>=""> B_fit,: BIOZ FIFO Interrupt Threshold (issues BINT based on number of unread FIFO records) <MNGR_INT register>=""> Rate,: BIOZ Data Rate <CNFG_BIOZ register>=""> Ahpf,: BIOZ/PACE Channel Analog High Pass Filter Cutoff Frequency and Bypass <CNFG_BIOZ register>=""> Ext_rbias,: External Resistor Bias Enable <CNFG_BIOZ register>=""> Gain,: BIOZ Channel Gain Setting <CNFG_BIOZ register>=""> Dhpf,: BIOZ Channel Digital High Pass Filter Cutoff Frequency <CNFG_BIOZ register>=""> Dlpf,: BIOZ Channel Digital Low Pass Filter Cutoff Frequency <CNFG_BIOZ register>=""> Fcgen,: BIOZ Current Generator Modulation Frequency <CNFG_BIOZ register>=""> Cgmon,: BIOZ Current Generator Monitor <CNFG_BIOZ register>=""> Cgmag,: BIOZ Current Generator Magnitude <CNFG_BIOZ register>=""> Phoff,: BIOZ Current Generator Modulation Phase Offset <CNFG_BIOZ register>="">
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 423 of file MAX30001.cpp.
int max30001_CAL_InitStart | ( | uint8_t | En_Vcal, |
uint8_t | Vmode, | ||
uint8_t | Vmag, | ||
uint8_t | Fcal, | ||
uint16_t | Thigh, | ||
uint8_t | Fifty | ||
) |
This function uses sets up the calibration signal internally.
If it is desired to use the internal signal, then this function must be called and the registers set, prior to setting the CALP_SEL and CALN_SEL in the ECG_InitStart and BIOZ_InitStart functions. Uses Register: CNFG_CAL-0x12
- Parameters:
-
En_Vcal,: Calibration Source (VCALP and VCALN) Enable Vmode,: Calibration Source Mode Selection Vmag,: Calibration Source Magnitude Selection (VMAG) Fcal,: Calibration Source Frequency Selection (FCAL) Thigh,: Calibration Source Time High Selection Fifty,: Calibration Source Duty Cycle Mode Selection
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 88 of file MAX30001.cpp.
int max30001_CAL_Stop | ( | void | ) |
This function disables the VCAL signal.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 128 of file MAX30001.cpp.
int max30001_Disable_DcLeadOFF | ( | void | ) |
This function disables the DC Lead OFF feature, whichever is active.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 726 of file MAX30001.cpp.
int max30001_Disable_LeadON | ( | void | ) |
This function turns off the Lead ON feature, whichever one is active.
Also, retrieves the en_bioz, en_ecg, en_pace and sets it back to as it was.
- Parameters:
-
0-if everything is good. A non-zero value indicates an error.
Definition at line 831 of file MAX30001.cpp.
int max30001_ECG_InitStart | ( | uint8_t | En_ecg, |
uint8_t | Openp, | ||
uint8_t | Openn, | ||
uint8_t | Pol, | ||
uint8_t | Calp_sel, | ||
uint8_t | Caln_sel, | ||
uint8_t | E_fit, | ||
uint8_t | Rate, | ||
uint8_t | Gain, | ||
uint8_t | Dhpf, | ||
uint8_t | Dlpf | ||
) |
For MAX30001/3 ONLY.
This function sets up the MAX30001 for the ECG measurements. Registers used: CNFG_EMUX, CNFG_GEN, MNGR_INT, CNFG_ECG.
- Parameters:
-
En_ecg,: ECG Channel Enable <CNFG_GEN register="" bits>=""> Openp,: Open the ECGN Input Switch (most often used for testing and calibration studies) <CNFG_EMUX register="" bits>=""> Openn,: Open the ECGN Input Switch (most often used for testing and calibration studies) <CNFG_EMUX register="" bits>=""> Calp_sel,: ECGP Calibration Selection <CNFG_EMUX register="" bits>=""> Caln_sel,: ECGN Calibration Selection <CNFG_EMUX register="" bits>=""> E_fit,: ECG FIFO Interrupt Threshold (issues EINT based on number of unread FIFO records) <CNFG_GEN register="" bits>=""> Clr_rrint,: RTOR R Detect Interrupt (RRINT) Clear Behavior <CNFG_GEN register="" bits>=""> Rate,: ECG Data Rate Gain,: ECG Channel Gain Setting Dhpf,: ECG Channel Digital High Pass Filter Cutoff Frequency Dlpf,: ECG Channel Digital Low Pass Filter Cutoff Frequency
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 223 of file MAX30001.cpp.
int max30001_ECGFast_Init | ( | uint8_t | Clr_Fast, |
uint8_t | Fast, | ||
uint8_t | Fast_Th | ||
) |
For MAX30001/3 ONLY.
This function enables the Fast mode feature of the ECG. Registers used: MNGR_INT-0x04, MNGR_DYN-0x05
- Parameters:
-
Clr_Fast,: FAST MODE Interrupt Clear Behavior <MNGR_INT register>=""> Fast,: ECG Channel Fast Recovery Mode Selection (ECG High Pass Filter Bypass) <MNGR_DYN register>=""> Fast_Th,: Automatic Fast Recovery Threshold
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 302 of file MAX30001.cpp.
int max30001_Enable_DcLeadOFF_Init | ( | int8_t | En_dcloff, |
int8_t | Ipol, | ||
int8_t | Imag, | ||
int8_t | Vth | ||
) |
This function enables the DC Lead Off detection.
Either ECG or BIOZ can be detected, one at a time. Registers Used: CNFG_GEN-0x10
- Parameters:
-
En_dcloff,: BIOZ Digital Lead Off Detection Enable Ipol,: DC Lead Off Current Polarity (if current sources are enabled/connected) Imag,: DC Lead off current Magnitude Selection Vth,: DC Lead Off Voltage Threshold Selection
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 703 of file MAX30001.cpp.
int max30001_Enable_LeadON | ( | int8_t | Channel ) |
This function enables the Lead ON detection.
Either ECG or BIOZ can be detected, one at a time. Also, the en_bioz, en_ecg, en_pace setting is saved so that when this feature is disabled through the max30001_Disable_LeadON() function (or otherwise) the enable/disable state of those features can be retrieved.
- Parameters:
-
Channel,: ECG or BIOZ detection
- Returns:
- 0-if everything is good. A non-zero value indicates an error.
Definition at line 807 of file MAX30001.cpp.
int max30001_FIFO_LeadONOff_Read | ( | void | ) |
This is function called from the max30001_int_handler() function and processes all the ECG, BIOZ, PACE.
and the RtoR data and sticks them in appropriate arrays and variables each unsigned 32 bits.
- Parameters:
-
ECG data will be in the array (input): max30001_ECG_FIFO_buffer[] Pace data will be in the array (input): max30001_PACE[] RtoRdata will be in the variable (input): max30001_RtoR_data BIOZ data will be in the array (input): max30001_BIOZ_FIFO_buffer[] global max30001_ECG_FIFO_buffer[] global max30001_PACE[] global max30001_BIOZ_FIFO_buffer[] global max30001_RtoR_data global max30001_DCLeadOff global max30001_ACLeadOff global max30001_LeadON
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 904 of file MAX30001.cpp.
int max30001_INT_assignment | ( | max30001_intrpt_Location_t | en_enint_loc, |
max30001_intrpt_Location_t | en_eovf_loc, | ||
max30001_intrpt_Location_t | en_fstint_loc, | ||
max30001_intrpt_Location_t | en_dcloffint_loc, | ||
max30001_intrpt_Location_t | en_bint_loc, | ||
max30001_intrpt_Location_t | en_bovf_loc, | ||
max30001_intrpt_Location_t | en_bover_loc, | ||
max30001_intrpt_Location_t | en_bundr_loc, | ||
max30001_intrpt_Location_t | en_bcgmon_loc, | ||
max30001_intrpt_Location_t | en_pint_loc, | ||
max30001_intrpt_Location_t | en_povf_loc, | ||
max30001_intrpt_Location_t | en_pedge_loc, | ||
max30001_intrpt_Location_t | en_lonint_loc, | ||
max30001_intrpt_Location_t | en_rrint_loc, | ||
max30001_intrpt_Location_t | en_samp_loc, | ||
max30001_intrpt_type_t | intb_Type, | ||
max30001_intrpt_type_t | int2b_Type | ||
) |
This function handles the assignment of the two interrupt pins (INTB & INT2B) with various.
functions/behaviors of the MAX30001. Also, each pin can be configured for different drive capability. Uses Registers: EN_INT-0x02 and EN_INT2-0x03.
- Parameters:
-
max30001_intrpt_Locatio_t <argument>: All the arguments with the aforementioned enumeration essentially can be configured to generate an interrupt on either INTB or INT2B or NONE. max30001_intrpt_type_t intb_Type: INTB Port Type (EN_INT Selections). max30001_intrpt_type _t int2b_Type: INT2B Port Type (EN_INT2 Selections)
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 144 of file MAX30001.cpp.
int max30001_int_handler | ( | void | ) |
This is a callback function which collects all the data from the ECG, BIOZ, PACE and RtoR.
It also handles Lead On/Off. This function is passed through the argument of max30001_COMMinit().
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 1193 of file MAX30001.cpp.
int max30001_PACE_InitStart | ( | uint8_t | En_pace, |
uint8_t | Clr_pedge, | ||
uint8_t | Pol, | ||
uint8_t | Gn_diff_off, | ||
uint8_t | Gain, | ||
uint8_t | Aout_lbw, | ||
uint8_t | Aout, | ||
uint8_t | Dacp, | ||
uint8_t | Dacn | ||
) |
For MAX30001 ONLY.
This function sets up the MAX30001 for pace signal detection. If both PACE and BIOZ are turned ON, then make sure Fcgen is set for 80K or 40K in the max30001_BIOZ_InitStart() function. However, if Only PACE is on but BIOZ off, then Fcgen can be set for 80K only, in the max30001_BIOZ_InitStart() function Registers used: MNGR_INT-0x04, CNFG_GEN-0x37, CNFG_PACE-0x1A.
- Parameters:
-
En_pace : PACE Channel Enable <CNFG_GEN register>=""> Clr_pedge : PACE Edge Detect Interrupt (PEDGE) Clear Behavior <MNGR_INT register>=""> Pol,: PACE Input Polarity Selection <CNFG_PACE register>=""> Gn_diff_off,: PACE Differentiator Mode <CNFG_PACE register>=""> Gain,: PACE Channel Gain Selection <CNFG_PACE register>=""> Aout_lbw,: PACE Analog Output Buffer Bandwidth Mode <CNFG_PACE register>=""> Aout,: PACE Single Ended Analog Output Buffer Signal Monitoring Selection <CNFG_PACE register>=""> Dacp (4bits): PACE Detector Positive Comparator Threshold <CNFG_PACE register>=""> Dacn(4bits),: PACE Detector Negative Comparator Threshold <CNFG_PACE register>="">
- Returns:
- 0-if no error. A non-zero value indicates an error <CNFG_PACE register>="">
Definition at line 346 of file MAX30001.cpp.
int max30001_PLL_lock | ( | void | ) |
This is a function that waits for the PLL to lock; once a lock is achieved it exits out.
(For convenience only)
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 616 of file MAX30001.cpp.
int max30001_Rbias_FMSTR_Init | ( | uint8_t | En_rbias, |
uint8_t | Rbiasv, | ||
uint8_t | Rbiasp, | ||
uint8_t | Rbiasn, | ||
uint8_t | Fmstr | ||
) |
This function sets up the Resistive Bias mode and also selects the master clock frequency.
Uses Register: CNFG_GEN-0x10
- Parameters:
-
En_rbias,: Enable and Select Resitive Lead Bias Mode Rbiasv,: Resistive Bias Mode Value Selection Rbiasp,: Enables Resistive Bias on Positive Input Rbiasn,: Enables Resistive Bias on Negative Input Fmstr,: Selects Master Clock Frequency
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 68 of file MAX30001.cpp.
void max30001_ReadHeartrateData | ( | max30001_t * | _hspValMax30001 ) |
This function sets current RtoR values and fmstr values in a pointer structure.
- Parameters:
-
hspValMax30001 - Pointer to a structure where to store the values
Definition at line 1274 of file MAX30001.cpp.
int max30001_reg_read | ( | MAX30001_REG_map_t | addr, |
uint32_t * | return_data | ||
) |
This function allows reading from a register.
- Parameters:
-
addr,: Address of the register to read from. *return_data,: pointer to the value read from the register.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 685 of file MAX30001.cpp.
int max30001_reg_write | ( | MAX30001_REG_map_t | addr, |
uint32_t | data | ||
) |
This function allows writing to a register.
- Parameters:
-
addr,: Address of the register to write to data,: 24-bit data read from the register.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 662 of file MAX30001.cpp.
int max30001_RtoR_InitStart | ( | uint8_t | En_rtor, |
uint8_t | Wndw, | ||
uint8_t | Gain, | ||
uint8_t | Pavg, | ||
uint8_t | Ptsf, | ||
uint8_t | Hoff, | ||
uint8_t | Ravg, | ||
uint8_t | Rhsf, | ||
uint8_t | Clr_rrint | ||
) |
For MAX30001/3/4 ONLY.
Sets up the device for RtoR measurement
- Parameters:
-
EN_rtor,: ECG RTOR Detection Enable <RTOR1 register>=""> Wndw,: R to R Window Averaging (Window Width = RTOR_WNDW[3:0]*8mS) <RTOR1 register>=""> Gain,: R to R Gain (where Gain = 2^RTOR_GAIN[3:0], plus an auto-scale option) <RTOR1 register>=""> Pavg,: R to R Peak Averaging Weight Factor <RTOR1 register>=""> Ptsf,: R to R Peak Threshold Scaling Factor <RTOR1 register>=""> Hoff,: R to R minimum Hold Off <RTOR2 register>=""> Ravg,: R to R Interval Averaging Weight Factor <RTOR2 register>=""> Rhsf,: R to R Interval Hold Off Scaling Factor <RTOR2 register>=""> Clr_rrint,: RTOR Detect Interrupt Clear behaviour <MNGR_INT register>="">
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 550 of file MAX30001.cpp.
void max30001_ServiceLeadoff | ( | uint32_t | currentTime ) |
This function is toggled every 2 seconds to switch between ECG DC Lead Off and BIOZ DC Lead Off.
Adjust LEADOFF_SERVICE_TIME to determine the duration between the toggles.
- Parameters:
-
CurrentTime - This gets fed the time by RTC_GetValue function
Definition at line 851 of file MAX30001.cpp.
void max30001_ServiceLeadON | ( | uint32_t | currentTime ) |
This function is toggled every 2 seconds to switch between ECG Lead ON and BIOZ Lead ON detect.
Adjust LEADOFF_SERVICE_TIME to determine the duration between the toggles.
- Parameters:
-
CurrentTime - This gets fed the time by RTC_GetValue function
Definition at line 879 of file MAX30001.cpp.
int max30001_Stop_BIOZ | ( | void | ) |
For MAX30001/2 ONLY.
This function disables the BIOZ. Uses Register CNFG_GEN-0x10.
- Returns:
- 0-if no error. A non-zero value indicates an error.
- 0-if no error. A non-zero value indicates an error.
Definition at line 513 of file MAX30001.cpp.
int max30001_Stop_ECG | ( | void | ) |
For MAX30001/3 ONLY.
This function disables the ECG. Uses Register CNFG_GEN-0x10.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 328 of file MAX30001.cpp.
int max30001_Stop_PACE | ( | void | ) |
For MAX30001 ONLY.
- Parameters:
-
This function disables the PACE. Uses Register CNFG_GEN-0x10.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 407 of file MAX30001.cpp.
int max30001_Stop_RtoR | ( | void | ) |
For MAX30001/3/4 ONLY.
This function disables the RtoR. Uses Register CNFG_RTOR1-0x1D
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 600 of file MAX30001.cpp.
int max30001_sw_rst | ( | void | ) |
This function causes the MAX30001 to reset.
Uses Register SW_RST-0x08
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 634 of file MAX30001.cpp.
int max30001_synch | ( | void | ) |
This function provides a SYNCH operation.
Uses Register SYCNH-0x09. Please refer to the data sheet for the details on how to use this.
- Returns:
- 0-if no error. A non-zero value indicates an error.
Definition at line 645 of file MAX30001.cpp.
void onDataAvailable | ( | PtrFunction | _onDataAvailable ) |
Used to connect a callback for when interrupt data is available.
Definition at line 1280 of file MAX30001.cpp.
Generated on Wed Jul 13 2022 17:00:35 by 1.7.2