MAX30001G 1.0.1 Arduino library for MAX30001G ECG and BIOZ AFE

max30001g_typedefs.h
Go to the documentation of this file.
1 /******************************************************************************************************/
2 /* Structures */
3 /******************************************************************************************************/
4
5 #ifndef MAX30001G_TYPEDEFS_H
6 #define MAX30001G_TYPEDEFS_H
7
8 #include <stdint.h>
9 #include "max30001g_defs.h"
10
16 struct ImpedanceModel {
17 float magnitude;
18 float phase;
19 };
20
25 struct ImpedanceSpectrum {
26 float frequency[MAX30001_BIOZ_NUM_FREQUENCIES];
27 float magnitude[MAX30001_BIOZ_NUM_FREQUENCIES];
28 float phase[MAX30001_BIOZ_NUM_FREQUENCIES];
29 };
30
39 struct HealthCheckResult {
40 bool spi_ok;
41 uint32_t info_reg;
42 uint32_t status_reg;
43 bool pll_unlocked;
44 bool fault_present;
45 };
46
63 struct BIOZScanConfig {
64 uint8_t avg;
65 bool fast;
66 bool fourleads;
67 bool use_internal_resistor;
68 uint16_t internal_resistor_ohm;
69 uint8_t max_retries;
70 float low_target_fraction;
71 float high_target_fraction;
72 float target_fraction;
73 uint8_t outlier_min_samples;
74 float outlier_sigma;
75 uint16_t timeout_margin_ms;
76 uint8_t freq_start_index;
77 uint8_t freq_end_index;
78 int32_t initial_current_nA;
79
80 BIOZScanConfig()
81 : avg(2),
82 fast(false),
83 fourleads(false),
84 use_internal_resistor(false),
85 internal_resistor_ohm(1000),
86 max_retries(4),
87 low_target_fraction(0.10f),
88 high_target_fraction(0.90f),
89 target_fraction(0.60f),
90 outlier_min_samples(5),
91 outlier_sigma(2.5f),
92 timeout_margin_ms(50),
93 freq_start_index(0),
94 freq_end_index(7),
95 initial_current_nA(8000) {}
96 };
97
103 struct ConfigSnapshot {
104 bool valid;
105 uint32_t en_int1;
106 uint32_t en_int2;
107 uint32_t mngr_int;
108 uint32_t mngr_dyn;
109 uint32_t cnfg_gen;
110 uint32_t cnfg_cal;
111 uint32_t cnfg_emux;
112 uint32_t cnfg_ecg;
113 uint32_t cnfg_bmux;
114 uint32_t cnfg_bioz;
115 uint32_t cnfg_bioz_lc;
116 uint32_t cnfg_rtor1;
117 uint32_t cnfg_rtor2;
118 };
119
120 #endif // MAX30001G_TYPEDEFS_H
max30001g_defs.h
MAX30001_BIOZ_NUM_FREQUENCIES
#define MAX30001_BIOZ_NUM_FREQUENCIES
Definition: max30001g_defs.h:11
BIOZScanConfig
BIOZScanConfig configuration structure fields:
Definition: max30001g_typedefs.h:63
BIOZScanConfig::BIOZScanConfig
BIOZScanConfig()
Definition: max30001g_typedefs.h:80
BIOZScanConfig::use_internal_resistor
bool use_internal_resistor
Definition: max30001g_typedefs.h:67
BIOZScanConfig::freq_end_index
uint8_t freq_end_index
Definition: max30001g_typedefs.h:77
BIOZScanConfig::fourleads
bool fourleads
Definition: max30001g_typedefs.h:66
BIOZScanConfig::initial_current_nA
int32_t initial_current_nA
Definition: max30001g_typedefs.h:78
BIOZScanConfig::high_target_fraction
float high_target_fraction
Definition: max30001g_typedefs.h:71
BIOZScanConfig::target_fraction
float target_fraction
Definition: max30001g_typedefs.h:72
BIOZScanConfig::freq_start_index
uint8_t freq_start_index
Definition: max30001g_typedefs.h:76
BIOZScanConfig::low_target_fraction
float low_target_fraction
Definition: max30001g_typedefs.h:70
BIOZScanConfig::outlier_sigma
float outlier_sigma
Definition: max30001g_typedefs.h:74
BIOZScanConfig::outlier_min_samples
uint8_t outlier_min_samples
Definition: max30001g_typedefs.h:73
BIOZScanConfig::avg
uint8_t avg
Definition: max30001g_typedefs.h:64
BIOZScanConfig::internal_resistor_ohm
uint16_t internal_resistor_ohm
Definition: max30001g_typedefs.h:68
BIOZScanConfig::timeout_margin_ms
uint16_t timeout_margin_ms
Definition: max30001g_typedefs.h:75
BIOZScanConfig::fast
bool fast
Definition: max30001g_typedefs.h:65
BIOZScanConfig::max_retries
uint8_t max_retries
Definition: max30001g_typedefs.h:69
ConfigSnapshot
ConfigSnapshot structure for storing/restoring MAX30001G register configurations.
Definition: max30001g_typedefs.h:103
ConfigSnapshot::cnfg_rtor2
uint32_t cnfg_rtor2
Definition: max30001g_typedefs.h:117
ConfigSnapshot::en_int2
uint32_t en_int2
Definition: max30001g_typedefs.h:106
ConfigSnapshot::cnfg_bioz
uint32_t cnfg_bioz
Definition: max30001g_typedefs.h:114
ConfigSnapshot::en_int1
uint32_t en_int1
Definition: max30001g_typedefs.h:105
ConfigSnapshot::cnfg_gen
uint32_t cnfg_gen
Definition: max30001g_typedefs.h:109
ConfigSnapshot::cnfg_emux
uint32_t cnfg_emux
Definition: max30001g_typedefs.h:111
ConfigSnapshot::mngr_dyn
uint32_t mngr_dyn
Definition: max30001g_typedefs.h:108
ConfigSnapshot::mngr_int
uint32_t mngr_int
Definition: max30001g_typedefs.h:107
ConfigSnapshot::cnfg_ecg
uint32_t cnfg_ecg
Definition: max30001g_typedefs.h:112
ConfigSnapshot::cnfg_bmux
uint32_t cnfg_bmux
Definition: max30001g_typedefs.h:113
ConfigSnapshot::cnfg_cal
uint32_t cnfg_cal
Definition: max30001g_typedefs.h:110
ConfigSnapshot::cnfg_bioz_lc
uint32_t cnfg_bioz_lc
Definition: max30001g_typedefs.h:115
ConfigSnapshot::valid
bool valid
Definition: max30001g_typedefs.h:104
ConfigSnapshot::cnfg_rtor1
uint32_t cnfg_rtor1
Definition: max30001g_typedefs.h:116
HealthCheckResult
HealthCheckResult structure for storing health check results.
Definition: max30001g_typedefs.h:39
HealthCheckResult::spi_ok
bool spi_ok
Definition: max30001g_typedefs.h:40
HealthCheckResult::pll_unlocked
bool pll_unlocked
Definition: max30001g_typedefs.h:43
HealthCheckResult::info_reg
uint32_t info_reg
Definition: max30001g_typedefs.h:41
HealthCheckResult::status_reg
uint32_t status_reg
Definition: max30001g_typedefs.h:42
HealthCheckResult::fault_present
bool fault_present
Definition: max30001g_typedefs.h:44
ImpedanceModel
ImpedanceModel structure for storing impedance measurement results.
Definition: max30001g_typedefs.h:16
ImpedanceModel::phase
float phase
Definition: max30001g_typedefs.h:18
ImpedanceModel::magnitude
float magnitude
Definition: max30001g_typedefs.h:17
ImpedanceSpectrum
ImpedanceSpectrum structure for storing one full BIOZ sweep.
Definition: max30001g_typedefs.h:25
ImpedanceSpectrum::magnitude
float magnitude[MAX30001_BIOZ_NUM_FREQUENCIES]
Definition: max30001g_typedefs.h:27
ImpedanceSpectrum::phase
float phase[MAX30001_BIOZ_NUM_FREQUENCIES]
Definition: max30001g_typedefs.h:28
ImpedanceSpectrum::frequency
float frequency[MAX30001_BIOZ_NUM_FREQUENCIES]
Definition: max30001g_typedefs.h:26