Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ECG_3_click_example
ECG_3_click.h@0:6cd861d8d613, 2021-09-30 (annotated)
- Committer:
- JohnnyK
- Date:
- Thu Sep 30 16:29:58 2021 +0000
- Revision:
- 0:6cd861d8d613
First
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JohnnyK | 0:6cd861d8d613 | 1 | #ifndef _ECG_3_click_H_ |
JohnnyK | 0:6cd861d8d613 | 2 | #define _ECG_3_click_H_ |
JohnnyK | 0:6cd861d8d613 | 3 | |
JohnnyK | 0:6cd861d8d613 | 4 | |
JohnnyK | 0:6cd861d8d613 | 5 | #include "mbed.h" |
JohnnyK | 0:6cd861d8d613 | 6 | |
JohnnyK | 0:6cd861d8d613 | 7 | |
JohnnyK | 0:6cd861d8d613 | 8 | /** |
JohnnyK | 0:6cd861d8d613 | 9 | * #include "mbed.h" |
JohnnyK | 0:6cd861d8d613 | 10 | * #include "ECG_3_click.h" |
JohnnyK | 0:6cd861d8d613 | 11 | * |
JohnnyK | 0:6cd861d8d613 | 12 | * int main(void) |
JohnnyK | 0:6cd861d8d613 | 13 | * { |
JohnnyK | 0:6cd861d8d613 | 14 | * DigitalOut led(LED1, 1); |
JohnnyK | 0:6cd861d8d613 | 15 | * |
JohnnyK | 0:6cd861d8d613 | 16 | * |
JohnnyK | 0:6cd861d8d613 | 17 | * SPI spiBus(D4, D5, D6); |
JohnnyK | 0:6cd861d8d613 | 18 | * ECG_3_click ecg3click(spiBus, D7); |
JohnnyK | 0:6cd861d8d613 | 19 | * ecg3click.swReset(); |
JohnnyK | 0:6cd861d8d613 | 20 | * ecg3click.fifoReset(); |
JohnnyK | 0:6cd861d8d613 | 21 | * thread_sleep_for(100); |
JohnnyK | 0:6cd861d8d613 | 22 | * ecg3click.init(); |
JohnnyK | 0:6cd861d8d613 | 23 | * |
JohnnyK | 0:6cd861d8d613 | 24 | * uint32_t ecgData; |
JohnnyK | 0:6cd861d8d613 | 25 | * uint16_t outHR, outRR; |
JohnnyK | 0:6cd861d8d613 | 26 | * |
JohnnyK | 0:6cd861d8d613 | 27 | * while(1) |
JohnnyK | 0:6cd861d8d613 | 28 | * { |
JohnnyK | 0:6cd861d8d613 | 29 | * led = !led; |
JohnnyK | 0:6cd861d8d613 | 30 | * ecg3click.getECG(&ecgData); |
JohnnyK | 0:6cd861d8d613 | 31 | * printf("ECG: %zu\n", ecgData); |
JohnnyK | 0:6cd861d8d613 | 32 | * ecg3click.getRTOR(&outHR, &outRR ); |
JohnnyK | 0:6cd861d8d613 | 33 | * printf("HeardBeat: %zu, R: %zu\n", ecgData, outRR); |
JohnnyK | 0:6cd861d8d613 | 34 | * thread_sleep_for(500); |
JohnnyK | 0:6cd861d8d613 | 35 | * } |
JohnnyK | 0:6cd861d8d613 | 36 | * } |
JohnnyK | 0:6cd861d8d613 | 37 | * @endcode |
JohnnyK | 0:6cd861d8d613 | 38 | */ |
JohnnyK | 0:6cd861d8d613 | 39 | class ECG_3_click |
JohnnyK | 0:6cd861d8d613 | 40 | { |
JohnnyK | 0:6cd861d8d613 | 41 | public: |
JohnnyK | 0:6cd861d8d613 | 42 | |
JohnnyK | 0:6cd861d8d613 | 43 | const uint8_t _ECG3_WRONG_ADDR = 0x01; |
JohnnyK | 0:6cd861d8d613 | 44 | const uint8_t _ECG3_OK = 0x00; |
JohnnyK | 0:6cd861d8d613 | 45 | const uint8_t _ECG3_INT_OCCURRED = 0x01; |
JohnnyK | 0:6cd861d8d613 | 46 | const uint8_t _ECG3_INT_NOT_OCCURRED = 0x00; |
JohnnyK | 0:6cd861d8d613 | 47 | const uint8_t _ECG3_DUMMY_BYTE = 0x00; |
JohnnyK | 0:6cd861d8d613 | 48 | |
JohnnyK | 0:6cd861d8d613 | 49 | ///@brief ECG_3_click Constructor |
JohnnyK | 0:6cd861d8d613 | 50 | ///@param spiBus - Reference to spi interface |
JohnnyK | 0:6cd861d8d613 | 51 | ///@param cs - Pin used for chip select |
JohnnyK | 0:6cd861d8d613 | 52 | ECG_3_click(SPI &spiBus, PinName cs); |
JohnnyK | 0:6cd861d8d613 | 53 | |
JohnnyK | 0:6cd861d8d613 | 54 | ///@brief ECG_3_click Destructor |
JohnnyK | 0:6cd861d8d613 | 55 | ~ECG_3_click(); |
JohnnyK | 0:6cd861d8d613 | 56 | |
JohnnyK | 0:6cd861d8d613 | 57 | /** |
JohnnyK | 0:6cd861d8d613 | 58 | * @brief SW Reset function |
JohnnyK | 0:6cd861d8d613 | 59 | * |
JohnnyK | 0:6cd861d8d613 | 60 | * Function performs a SW reset. |
JohnnyK | 0:6cd861d8d613 | 61 | */ |
JohnnyK | 0:6cd861d8d613 | 62 | void swReset(void); |
JohnnyK | 0:6cd861d8d613 | 63 | |
JohnnyK | 0:6cd861d8d613 | 64 | /** |
JohnnyK | 0:6cd861d8d613 | 65 | * @brief FIFO Reset function |
JohnnyK | 0:6cd861d8d613 | 66 | * |
JohnnyK | 0:6cd861d8d613 | 67 | * Function performs a FIFO reset. |
JohnnyK | 0:6cd861d8d613 | 68 | */ |
JohnnyK | 0:6cd861d8d613 | 69 | void fifoReset( void); |
JohnnyK | 0:6cd861d8d613 | 70 | |
JohnnyK | 0:6cd861d8d613 | 71 | /** |
JohnnyK | 0:6cd861d8d613 | 72 | * @brief Synchronization function |
JohnnyK | 0:6cd861d8d613 | 73 | * |
JohnnyK | 0:6cd861d8d613 | 74 | * Function performs a device synchronization and begins a new ECG operations and recording. |
JohnnyK | 0:6cd861d8d613 | 75 | */ |
JohnnyK | 0:6cd861d8d613 | 76 | void sync(void); |
JohnnyK | 0:6cd861d8d613 | 77 | |
JohnnyK | 0:6cd861d8d613 | 78 | /** |
JohnnyK | 0:6cd861d8d613 | 79 | * @brief Initialization function |
JohnnyK | 0:6cd861d8d613 | 80 | * |
JohnnyK | 0:6cd861d8d613 | 81 | * Function performs a device initialization to work properly. |
JohnnyK | 0:6cd861d8d613 | 82 | */ |
JohnnyK | 0:6cd861d8d613 | 83 | void init(void); |
JohnnyK | 0:6cd861d8d613 | 84 | |
JohnnyK | 0:6cd861d8d613 | 85 | /** |
JohnnyK | 0:6cd861d8d613 | 86 | * @brief ECG Get function |
JohnnyK | 0:6cd861d8d613 | 87 | * |
JohnnyK | 0:6cd861d8d613 | 88 | * @param[out] outECG Memory where ECG data be stored |
JohnnyK | 0:6cd861d8d613 | 89 | * |
JohnnyK | 0:6cd861d8d613 | 90 | * Function reads ECG data from FIFO register. |
JohnnyK | 0:6cd861d8d613 | 91 | */ |
JohnnyK | 0:6cd861d8d613 | 92 | void getECG( uint32_t *outECG ); |
JohnnyK | 0:6cd861d8d613 | 93 | |
JohnnyK | 0:6cd861d8d613 | 94 | /** |
JohnnyK | 0:6cd861d8d613 | 95 | * @brief RTOR Get function |
JohnnyK | 0:6cd861d8d613 | 96 | * |
JohnnyK | 0:6cd861d8d613 | 97 | * @param[out] outHR Memory where Heart Rate data be stored |
JohnnyK | 0:6cd861d8d613 | 98 | * @param[out] outRR Memory where R - R data be stored |
JohnnyK | 0:6cd861d8d613 | 99 | * |
JohnnyK | 0:6cd861d8d613 | 100 | * Function reads Heart Rate and R - R data and calculates Heart Rate data to BPM, |
JohnnyK | 0:6cd861d8d613 | 101 | * and R - R data to ms. |
JohnnyK | 0:6cd861d8d613 | 102 | */ |
JohnnyK | 0:6cd861d8d613 | 103 | void getRTOR( uint16_t *outHR, uint16_t *outRR ); |
JohnnyK | 0:6cd861d8d613 | 104 | |
JohnnyK | 0:6cd861d8d613 | 105 | private: |
JohnnyK | 0:6cd861d8d613 | 106 | |
JohnnyK | 0:6cd861d8d613 | 107 | ///@brief Read given register.\n |
JohnnyK | 0:6cd861d8d613 | 108 | /// |
JohnnyK | 0:6cd861d8d613 | 109 | ///On Entry: |
JohnnyK | 0:6cd861d8d613 | 110 | ///@param[in] reg - Register to read |
JohnnyK | 0:6cd861d8d613 | 111 | /// |
JohnnyK | 0:6cd861d8d613 | 112 | ///On Exit: |
JohnnyK | 0:6cd861d8d613 | 113 | /// |
JohnnyK | 0:6cd861d8d613 | 114 | ///@returns Read data |
JohnnyK | 0:6cd861d8d613 | 115 | uint32_t readRegister(const uint8_t reg); |
JohnnyK | 0:6cd861d8d613 | 116 | |
JohnnyK | 0:6cd861d8d613 | 117 | ///@brief Write given register.\n |
JohnnyK | 0:6cd861d8d613 | 118 | /// |
JohnnyK | 0:6cd861d8d613 | 119 | ///On Entry: |
JohnnyK | 0:6cd861d8d613 | 120 | ///@param[in] reg - Register to write |
JohnnyK | 0:6cd861d8d613 | 121 | ///@param[in] data - Data to write |
JohnnyK | 0:6cd861d8d613 | 122 | /// |
JohnnyK | 0:6cd861d8d613 | 123 | ///@returns None |
JohnnyK | 0:6cd861d8d613 | 124 | void writeRegister(const uint8_t reg, const uint32_t data); |
JohnnyK | 0:6cd861d8d613 | 125 | |
JohnnyK | 0:6cd861d8d613 | 126 | |
JohnnyK | 0:6cd861d8d613 | 127 | /// Registers |
JohnnyK | 0:6cd861d8d613 | 128 | const uint8_t _ECG3_NO_OP_REG = 0x00; |
JohnnyK | 0:6cd861d8d613 | 129 | const uint8_t _ECG3_STAT_REG = 0x01; |
JohnnyK | 0:6cd861d8d613 | 130 | const uint8_t _ECG3_EN_INT_REG = 0x02; |
JohnnyK | 0:6cd861d8d613 | 131 | const uint8_t _ECG3_EN_INT2_REG = 0x03; |
JohnnyK | 0:6cd861d8d613 | 132 | const uint8_t _ECG3_MNGR_INT_REG = 0x04; |
JohnnyK | 0:6cd861d8d613 | 133 | const uint8_t _ECG3_MNGR_DYN_REG = 0x05; |
JohnnyK | 0:6cd861d8d613 | 134 | const uint8_t _ECG3_SW_RST_REG = 0x08; |
JohnnyK | 0:6cd861d8d613 | 135 | const uint8_t _ECG3_SYNC_REG = 0x09; |
JohnnyK | 0:6cd861d8d613 | 136 | const uint8_t _ECG3_FIFO_RST_REG = 0x0A; |
JohnnyK | 0:6cd861d8d613 | 137 | const uint8_t _ECG3_INFO_REG = 0x0F; |
JohnnyK | 0:6cd861d8d613 | 138 | const uint8_t _ECG3_CNFG_GEN_REG = 0x10; |
JohnnyK | 0:6cd861d8d613 | 139 | const uint8_t _ECG3_CNFG_CAL_REG = 0x12; |
JohnnyK | 0:6cd861d8d613 | 140 | const uint8_t _ECG3_CNFG_EMUX_REG = 0x14; |
JohnnyK | 0:6cd861d8d613 | 141 | const uint8_t _ECG3_CNFG_ECG_REG = 0x15; |
JohnnyK | 0:6cd861d8d613 | 142 | const uint8_t _ECG3_CNFG_RTOR1_REG = 0x1D; |
JohnnyK | 0:6cd861d8d613 | 143 | const uint8_t _ECG3_CNFG_RTOR2_REG = 0x1E; |
JohnnyK | 0:6cd861d8d613 | 144 | const uint8_t _ECG3_ECG_FIFO_BURST_REG = 0x20; |
JohnnyK | 0:6cd861d8d613 | 145 | const uint8_t _ECG3_ECG_FIFO_REG = 0x21; |
JohnnyK | 0:6cd861d8d613 | 146 | const uint8_t _ECG3_RTOR_REG = 0x25; |
JohnnyK | 0:6cd861d8d613 | 147 | const uint8_t _ECG3_NO_OP2_REG = 0x7F; |
JohnnyK | 0:6cd861d8d613 | 148 | |
JohnnyK | 0:6cd861d8d613 | 149 | const uint32_t _ECG3_EINT_MASK = 0x800000; |
JohnnyK | 0:6cd861d8d613 | 150 | const uint32_t _ECG3_EOVF_MASK = 0x400000; |
JohnnyK | 0:6cd861d8d613 | 151 | const uint32_t _ECG3_FSTINT_MASK = 0x200000; |
JohnnyK | 0:6cd861d8d613 | 152 | const uint32_t _ECG3_DCLOFF_INT_MASK = 0x100000; |
JohnnyK | 0:6cd861d8d613 | 153 | const uint32_t _ECG3_LONINT_MASK = 0x000800; |
JohnnyK | 0:6cd861d8d613 | 154 | const uint32_t _ECG3_RRINT_MASK = 0x000400; |
JohnnyK | 0:6cd861d8d613 | 155 | const uint32_t _ECG3_SAMP_INT_MASK = 0x000200; |
JohnnyK | 0:6cd861d8d613 | 156 | const uint32_t _ECG3_PLLINT_MASK = 0x000100; |
JohnnyK | 0:6cd861d8d613 | 157 | const uint32_t _ECG3_LDOFF_PH_INT_MASK = 0x000008; |
JohnnyK | 0:6cd861d8d613 | 158 | const uint32_t _ECG3_LDOFF_PL_INT_MASK = 0x000004; |
JohnnyK | 0:6cd861d8d613 | 159 | const uint32_t _ECG3_LDOFF_NH_INT_MASK = 0x000002; |
JohnnyK | 0:6cd861d8d613 | 160 | const uint32_t _ECG3_LDOFF_NL_INT_MASK = 0x000001; |
JohnnyK | 0:6cd861d8d613 | 161 | |
JohnnyK | 0:6cd861d8d613 | 162 | const uint32_t _ECG3_INTB_DIS = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 163 | const uint32_t _ECG3_INTB_CMOS = 0x000001; |
JohnnyK | 0:6cd861d8d613 | 164 | const uint32_t _ECG3_INTB_OD_NMOS = 0x000002; |
JohnnyK | 0:6cd861d8d613 | 165 | const uint32_t _ECG3_INTB_OD_NMOS_INTER_PULLUP = 0x000003; |
JohnnyK | 0:6cd861d8d613 | 166 | |
JohnnyK | 0:6cd861d8d613 | 167 | const uint32_t _ECG3_FSINT_CLR_DISENGAGED = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 168 | const uint32_t _ECG3_FSINT_CLR_STAT = 0x000040; |
JohnnyK | 0:6cd861d8d613 | 169 | const uint32_t _ECG3_RRINT_CLR_STAT = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 170 | const uint32_t _ECG3_RRINT_CLR_RTOR = 0x000010; |
JohnnyK | 0:6cd861d8d613 | 171 | const uint32_t _ECG3_RRINT_SELF_CLR = 0x000020; |
JohnnyK | 0:6cd861d8d613 | 172 | const uint32_t _ECG3_SAMP_CLR_STAT = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 173 | const uint32_t _ECG3_SAMP_SELF_CLR = 0x000004; |
JohnnyK | 0:6cd861d8d613 | 174 | const uint32_t _ECG3_SAMP_FREQ_1_SAMP = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 175 | const uint32_t _ECG3_SAMP_FREQ_2_SAMP = 0x000001; |
JohnnyK | 0:6cd861d8d613 | 176 | const uint32_t _ECG3_SAMP_FREQ_4_SAMP = 0x000002; |
JohnnyK | 0:6cd861d8d613 | 177 | const uint32_t _ECG3_SAMP_FREQ_16_SAMP = 0x000003; |
JohnnyK | 0:6cd861d8d613 | 178 | |
JohnnyK | 0:6cd861d8d613 | 179 | const uint32_t _ECG3_NORMAL_MODE = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 180 | const uint32_t _ECG3_MANUAL_FAST_MODE = 0x400000; |
JohnnyK | 0:6cd861d8d613 | 181 | const uint32_t _ECG3_AUTO_FAST_MODE = 0x800000; |
JohnnyK | 0:6cd861d8d613 | 182 | |
JohnnyK | 0:6cd861d8d613 | 183 | const uint32_t _ECG3_SW_RST_CMD = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 184 | const uint32_t _ECG3_FIFO_RST_CMD = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 185 | const uint32_t _ECG3_SYNCH_CMD = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 186 | |
JohnnyK | 0:6cd861d8d613 | 187 | const uint32_t _ECG3_ULP_LON_EN = 0x400000; |
JohnnyK | 0:6cd861d8d613 | 188 | const uint32_t _ECG3_FMSTR_32768HZ_ECG_512HZ = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 189 | const uint32_t _ECG3_FMSTR_32000HZ_ECG_500HZ = 0x100000; |
JohnnyK | 0:6cd861d8d613 | 190 | const uint32_t _ECG3_FMSTR_32000HZ_ECG_200HZ = 0x200000; |
JohnnyK | 0:6cd861d8d613 | 191 | const uint32_t _ECG3_FMSTR_31968HZ_ECG_199HZ = 0x300000; |
JohnnyK | 0:6cd861d8d613 | 192 | const uint32_t _ECG3_ECG_CHANN_EN = 0x080000; |
JohnnyK | 0:6cd861d8d613 | 193 | const uint32_t _ECG3_DCLOFF_EN = 0x001000; |
JohnnyK | 0:6cd861d8d613 | 194 | const uint32_t _ECG3_ECGP_PULLUP = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 195 | const uint32_t _ECG3_ECGP_PULLDOWN = 0x000800; |
JohnnyK | 0:6cd861d8d613 | 196 | const uint32_t _ECG3_DCLOFF_IMAG_0NA = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 197 | const uint32_t _ECG3_DCLOFF_IMAG_5NA = 0x000100; |
JohnnyK | 0:6cd861d8d613 | 198 | const uint32_t _ECG3_DCLOFF_IMAG_10NA = 0x000200; |
JohnnyK | 0:6cd861d8d613 | 199 | const uint32_t _ECG3_DCLOFF_IMAG_20NA = 0x000300; |
JohnnyK | 0:6cd861d8d613 | 200 | const uint32_t _ECG3_DCLOFF_IMAG_50NA = 0x000400; |
JohnnyK | 0:6cd861d8d613 | 201 | const uint32_t _ECG3_DCLOFF_IMAG_100NA = 0x000500; |
JohnnyK | 0:6cd861d8d613 | 202 | const uint32_t _ECG3_DCLOFF_VTH_300MV = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 203 | const uint32_t _ECG3_DCLOFF_VTH_400MV = 0x000040; |
JohnnyK | 0:6cd861d8d613 | 204 | const uint32_t _ECG3_DCLOFF_VTH_450MV = 0x000080; |
JohnnyK | 0:6cd861d8d613 | 205 | const uint32_t _ECG3_DCLOFF_VTH_500MV = 0x0000C0; |
JohnnyK | 0:6cd861d8d613 | 206 | const uint32_t _ECG3_RBIAS_EN = 0x000010; |
JohnnyK | 0:6cd861d8d613 | 207 | const uint32_t _ECG3_RBIAS_50M_OHM = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 208 | const uint32_t _ECG3_RBIAS_100M_OHM = 0x000004; |
JohnnyK | 0:6cd861d8d613 | 209 | const uint32_t _ECG3_RBIAS_200M_OHM = 0x000008; |
JohnnyK | 0:6cd861d8d613 | 210 | const uint32_t _ECG3_RBIASP_EN = 0x000002; |
JohnnyK | 0:6cd861d8d613 | 211 | const uint32_t _ECG3_RBIASN_EN = 0x000001; |
JohnnyK | 0:6cd861d8d613 | 212 | |
JohnnyK | 0:6cd861d8d613 | 213 | const uint32_t _ECG3_VCAL_EN = 0x400000; |
JohnnyK | 0:6cd861d8d613 | 214 | const uint32_t _ECG3_VMODE_UNIPOL = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 215 | const uint32_t _ECG3_VMODE_BIPOL = 0x200000; |
JohnnyK | 0:6cd861d8d613 | 216 | const uint32_t _ECG3_VMAG_250MICROV = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 217 | const uint32_t _ECG3_VMAG_500MICROV = 0x100000; |
JohnnyK | 0:6cd861d8d613 | 218 | const uint32_t _ECG3_FCAL_256HZ = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 219 | const uint32_t _ECG3_FCAL_64HZ = 0x001000; |
JohnnyK | 0:6cd861d8d613 | 220 | const uint32_t _ECG3_FCAL_16HZ = 0x002000; |
JohnnyK | 0:6cd861d8d613 | 221 | const uint32_t _ECG3_FCAL_4HZ = 0x003000; |
JohnnyK | 0:6cd861d8d613 | 222 | const uint32_t _ECG3_FCAL_1HZ = 0x004000; |
JohnnyK | 0:6cd861d8d613 | 223 | const uint32_t _ECG3_FCAL_1PER4HZ = 0x005000; |
JohnnyK | 0:6cd861d8d613 | 224 | const uint32_t _ECG3_FCAL_1PER16HZ = 0x006000; |
JohnnyK | 0:6cd861d8d613 | 225 | const uint32_t _ECG3_FCAL_1PER64HZ = 0x007000; |
JohnnyK | 0:6cd861d8d613 | 226 | const uint32_t _ECG3_FIFTY_CAL_THIGH = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 227 | const uint32_t _ECG3_FIFTY_50PERCENTS = 0x000800; |
JohnnyK | 0:6cd861d8d613 | 228 | |
JohnnyK | 0:6cd861d8d613 | 229 | const uint32_t _ECG3_INPUT_NON_INV = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 230 | const uint32_t _ECG3_INPUT_INV = 0x800000; |
JohnnyK | 0:6cd861d8d613 | 231 | const uint32_t _ECG3_ECGP_EN = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 232 | const uint32_t _ECG3_ECGP_DIS = 0x200000; |
JohnnyK | 0:6cd861d8d613 | 233 | const uint32_t _ECG3_ECGN_EN = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 234 | const uint32_t _ECG3_ECGN_DIS = 0x100000; |
JohnnyK | 0:6cd861d8d613 | 235 | const uint32_t _ECG3_ECGP_NO_CAL = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 236 | const uint32_t _ECG3_ECGP_CAL_VMID = 0x040000; |
JohnnyK | 0:6cd861d8d613 | 237 | const uint32_t _ECG3_ECGP_CAL_VCALP = 0x080000; |
JohnnyK | 0:6cd861d8d613 | 238 | const uint32_t _ECG3_ECGP_CAL_VCALN = 0x0C0000; |
JohnnyK | 0:6cd861d8d613 | 239 | const uint32_t _ECG3_ECGN_NO_CAL = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 240 | const uint32_t _ECG3_ECGN_CAL_VMID = 0x010000; |
JohnnyK | 0:6cd861d8d613 | 241 | const uint32_t _ECG3_ECGN_CAL_VCALP = 0x020000; |
JohnnyK | 0:6cd861d8d613 | 242 | const uint32_t _ECG3_ECGN_CAL_VCALN = 0x030000; |
JohnnyK | 0:6cd861d8d613 | 243 | |
JohnnyK | 0:6cd861d8d613 | 244 | const uint32_t _ECG3_GAIN_20VPERV = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 245 | const uint32_t _ECG3_GAIN_40VPERV = 0x010000; |
JohnnyK | 0:6cd861d8d613 | 246 | const uint32_t _ECG3_GAIN_80VPERV = 0x020000; |
JohnnyK | 0:6cd861d8d613 | 247 | const uint32_t _ECG3_GAIN_160VPERV = 0x030000; |
JohnnyK | 0:6cd861d8d613 | 248 | const uint32_t _ECG3_DHPF_BYPASS_DC = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 249 | const uint32_t _ECG3_DHPF_500MILIHZ = 0x004000; |
JohnnyK | 0:6cd861d8d613 | 250 | const uint32_t _ECG3_DLPF_BYPASS = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 251 | const uint32_t _ECG3_DLPF_40HZ = 0x001000; |
JohnnyK | 0:6cd861d8d613 | 252 | const uint32_t _ECG3_DLPF_100HZ = 0x002000; |
JohnnyK | 0:6cd861d8d613 | 253 | const uint32_t _ECG3_DLPF_150HZ = 0x003000; |
JohnnyK | 0:6cd861d8d613 | 254 | |
JohnnyK | 0:6cd861d8d613 | 255 | const uint32_t _ECG3_WNDW_6 = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 256 | const uint32_t _ECG3_WNDW_8 = 0x100000; |
JohnnyK | 0:6cd861d8d613 | 257 | const uint32_t _ECG3_WNDW_10 = 0x200000; |
JohnnyK | 0:6cd861d8d613 | 258 | const uint32_t _ECG3_WNDW_12 = 0x300000; |
JohnnyK | 0:6cd861d8d613 | 259 | const uint32_t _ECG3_WNDW_14 = 0x400000; |
JohnnyK | 0:6cd861d8d613 | 260 | const uint32_t _ECG3_WNDW_16 = 0x500000; |
JohnnyK | 0:6cd861d8d613 | 261 | const uint32_t _ECG3_WNDW_18 = 0x600000; |
JohnnyK | 0:6cd861d8d613 | 262 | const uint32_t _ECG3_WNDW_20 = 0x700000; |
JohnnyK | 0:6cd861d8d613 | 263 | const uint32_t _ECG3_WNDW_22 = 0x800000; |
JohnnyK | 0:6cd861d8d613 | 264 | const uint32_t _ECG3_WNDW_24 = 0x900000; |
JohnnyK | 0:6cd861d8d613 | 265 | const uint32_t _ECG3_WNDW_26 = 0xA00000; |
JohnnyK | 0:6cd861d8d613 | 266 | const uint32_t _ECG3_WNDW_28 = 0xB00000; |
JohnnyK | 0:6cd861d8d613 | 267 | const uint32_t _ECG3_RRGAIN_1 = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 268 | const uint32_t _ECG3_RRGAIN_2 = 0x010000; |
JohnnyK | 0:6cd861d8d613 | 269 | const uint32_t _ECG3_RRGAIN_4 = 0x020000; |
JohnnyK | 0:6cd861d8d613 | 270 | const uint32_t _ECG3_RRGAIN_8 = 0x030000; |
JohnnyK | 0:6cd861d8d613 | 271 | const uint32_t _ECG3_RRGAIN_16 = 0x040000; |
JohnnyK | 0:6cd861d8d613 | 272 | const uint32_t _ECG3_RRGAIN_32 = 0x050000; |
JohnnyK | 0:6cd861d8d613 | 273 | const uint32_t _ECG3_RRGAIN_64 = 0x060000; |
JohnnyK | 0:6cd861d8d613 | 274 | const uint32_t _ECG3_RRGAIN_128 = 0x070000; |
JohnnyK | 0:6cd861d8d613 | 275 | const uint32_t _ECG3_RRGAIN_256 = 0x080000; |
JohnnyK | 0:6cd861d8d613 | 276 | const uint32_t _ECG3_RRGAIN_512 = 0x090000; |
JohnnyK | 0:6cd861d8d613 | 277 | const uint32_t _ECG3_RRGAIN_1024 = 0x0A0000; |
JohnnyK | 0:6cd861d8d613 | 278 | const uint32_t _ECG3_RRGAIN_2048 = 0x0B0000; |
JohnnyK | 0:6cd861d8d613 | 279 | const uint32_t _ECG3_RRGAIN_4096 = 0x0C0000; |
JohnnyK | 0:6cd861d8d613 | 280 | const uint32_t _ECG3_RRGAIN_8192 = 0x0D0000; |
JohnnyK | 0:6cd861d8d613 | 281 | const uint32_t _ECG3_RRGAIN_16384 = 0x0E0000; |
JohnnyK | 0:6cd861d8d613 | 282 | const uint32_t _ECG3_RRGAIN_AUTO_SCALE = 0x0F0000; |
JohnnyK | 0:6cd861d8d613 | 283 | const uint32_t _ECG3_RTOR_EN = 0x008000; |
JohnnyK | 0:6cd861d8d613 | 284 | const uint32_t _ECG3_PAVG_2 = 0x000000; |
JohnnyK | 0:6cd861d8d613 | 285 | const uint32_t _ECG3_PAVG_4 = 0x001000; |
JohnnyK | 0:6cd861d8d613 | 286 | const uint32_t _ECG3_PAVG_8 = 0x002000; |
JohnnyK | 0:6cd861d8d613 | 287 | const uint32_t _ECG3_PAVG_16 = 0x003000; |
JohnnyK | 0:6cd861d8d613 | 288 | |
JohnnyK | 0:6cd861d8d613 | 289 | SPI &m_spiBus; |
JohnnyK | 0:6cd861d8d613 | 290 | DigitalOut m_cs; |
JohnnyK | 0:6cd861d8d613 | 291 | }; |
JohnnyK | 0:6cd861d8d613 | 292 | |
JohnnyK | 0:6cd861d8d613 | 293 | #endif /*_ECG_3_click_H_*/ |
JohnnyK | 0:6cd861d8d613 | 294 |