ME11C Sample Code in Maxim Integrated Team
Dependencies: BMI160 max32630hsp3 MemoryLCD USBDevice
Fork of Host_Software_MAX32664GWEC_SpO2_HR-_EXTE by
SHMAX8614X/SH_Max8614x_BareMetal.h@0:b259fd1a88f5, 2019-03-18 (annotated)
- Committer:
- seyhmus.cacina
- Date:
- Mon Mar 18 14:09:48 2019 +0300
- Revision:
- 0:b259fd1a88f5
ME11C Sample Code First Commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| seyhmus.cacina | 0:b259fd1a88f5 | 1 | /******************************************************************************* |
| seyhmus.cacina | 0:b259fd1a88f5 | 2 | * Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved. |
| seyhmus.cacina | 0:b259fd1a88f5 | 3 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| seyhmus.cacina | 0:b259fd1a88f5 | 5 | * copy of this software and associated documentation files (the "Software"), |
| seyhmus.cacina | 0:b259fd1a88f5 | 6 | * to deal in the Software without restriction, including without limitation |
| seyhmus.cacina | 0:b259fd1a88f5 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| seyhmus.cacina | 0:b259fd1a88f5 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| seyhmus.cacina | 0:b259fd1a88f5 | 9 | * Software is furnished to do so, subject to the following conditions: |
| seyhmus.cacina | 0:b259fd1a88f5 | 10 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 11 | * The above copyright notice and this permission notice shall be included |
| seyhmus.cacina | 0:b259fd1a88f5 | 12 | * in all copies or substantial portions of the Software. |
| seyhmus.cacina | 0:b259fd1a88f5 | 13 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| seyhmus.cacina | 0:b259fd1a88f5 | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| seyhmus.cacina | 0:b259fd1a88f5 | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| seyhmus.cacina | 0:b259fd1a88f5 | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
| seyhmus.cacina | 0:b259fd1a88f5 | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| seyhmus.cacina | 0:b259fd1a88f5 | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| seyhmus.cacina | 0:b259fd1a88f5 | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
| seyhmus.cacina | 0:b259fd1a88f5 | 21 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 22 | * Except as contained in this notice, the name of Maxim Integrated |
| seyhmus.cacina | 0:b259fd1a88f5 | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
| seyhmus.cacina | 0:b259fd1a88f5 | 24 | * Products, Inc. Branding Policy. |
| seyhmus.cacina | 0:b259fd1a88f5 | 25 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 26 | * The mere transfer of this software does not imply any licenses |
| seyhmus.cacina | 0:b259fd1a88f5 | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
| seyhmus.cacina | 0:b259fd1a88f5 | 28 | * trademarks, maskwork rights, or any other form of intellectual |
| seyhmus.cacina | 0:b259fd1a88f5 | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
| seyhmus.cacina | 0:b259fd1a88f5 | 30 | * ownership rights. |
| seyhmus.cacina | 0:b259fd1a88f5 | 31 | ******************************************************************************* |
| seyhmus.cacina | 0:b259fd1a88f5 | 32 | */ |
| seyhmus.cacina | 0:b259fd1a88f5 | 33 | #ifndef SH_Max8614x_BareMetal_H_ |
| seyhmus.cacina | 0:b259fd1a88f5 | 34 | #define SH_Max8614x_BareMetal_H_ |
| seyhmus.cacina | 0:b259fd1a88f5 | 35 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 36 | #include <stdint.h> |
| seyhmus.cacina | 0:b259fd1a88f5 | 37 | #include <stdio.h> |
| seyhmus.cacina | 0:b259fd1a88f5 | 38 | #include "demoDefinitions.h" |
| seyhmus.cacina | 0:b259fd1a88f5 | 39 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 40 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 41 | #define COMM_SUCCESS 0 |
| seyhmus.cacina | 0:b259fd1a88f5 | 42 | #define COMM_GENERAL_ERROR -1 |
| seyhmus.cacina | 0:b259fd1a88f5 | 43 | #define COMM_INVALID_PARAM -254 |
| seyhmus.cacina | 0:b259fd1a88f5 | 44 | #define COMM_NOT_RECOGNIZED -255 |
| seyhmus.cacina | 0:b259fd1a88f5 | 45 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 46 | enum enAlgoMode{ |
| seyhmus.cacina | 0:b259fd1a88f5 | 47 | kAlgoModeHeartRate = 0, |
| seyhmus.cacina | 0:b259fd1a88f5 | 48 | kAlgoModeSPO2 = 1, |
| seyhmus.cacina | 0:b259fd1a88f5 | 49 | kAlgoModeContSPO2 = 2, |
| seyhmus.cacina | 0:b259fd1a88f5 | 50 | }; |
| seyhmus.cacina | 0:b259fd1a88f5 | 51 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 52 | /** |
| seyhmus.cacina | 0:b259fd1a88f5 | 53 | * @brief Get the value of register at addr |
| seyhmus.cacina | 0:b259fd1a88f5 | 54 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 55 | * @param[in] addr - adress of the register |
| seyhmus.cacina | 0:b259fd1a88f5 | 56 | * @param[out] val - value at the register |
| seyhmus.cacina | 0:b259fd1a88f5 | 57 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 58 | */ |
| seyhmus.cacina | 0:b259fd1a88f5 | 59 | void SH_Max8614x_get_reg(uint8_t addr, uint32_t *val); |
| seyhmus.cacina | 0:b259fd1a88f5 | 60 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 61 | /** |
| seyhmus.cacina | 0:b259fd1a88f5 | 62 | * @brief Write a value to the register at address addr |
| seyhmus.cacina | 0:b259fd1a88f5 | 63 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 64 | * @param[in] addr - adress of the register to write |
| seyhmus.cacina | 0:b259fd1a88f5 | 65 | * @param[in] val - value of the register to write |
| seyhmus.cacina | 0:b259fd1a88f5 | 66 | */ |
| seyhmus.cacina | 0:b259fd1a88f5 | 67 | void SH_Max8614x_set_reg(uint8_t addr, uint32_t val); |
| seyhmus.cacina | 0:b259fd1a88f5 | 68 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 69 | /** |
| seyhmus.cacina | 0:b259fd1a88f5 | 70 | * @brief Initialize Max86140 with default configuration |
| seyhmus.cacina | 0:b259fd1a88f5 | 71 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 72 | * @param[in] paramAlgoMode - the mode of the algorithm to initialize |
| seyhmus.cacina | 0:b259fd1a88f5 | 73 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 74 | * @return 0 on SUCCESS |
| seyhmus.cacina | 0:b259fd1a88f5 | 75 | */ |
| seyhmus.cacina | 0:b259fd1a88f5 | 76 | int SH_Max8614x_default_init(enum enAlgoMode paramAlgoMode); |
| seyhmus.cacina | 0:b259fd1a88f5 | 77 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 78 | /** |
| seyhmus.cacina | 0:b259fd1a88f5 | 79 | * @brief Check the data stored in the Sensor Hub. Reads and prints |
| seyhmus.cacina | 0:b259fd1a88f5 | 80 | * the data if available |
| seyhmus.cacina | 0:b259fd1a88f5 | 81 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 82 | */ |
| seyhmus.cacina | 0:b259fd1a88f5 | 83 | int SH_Max8614x_data_report_execute(void); |
| seyhmus.cacina | 0:b259fd1a88f5 | 84 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 85 | /** |
| seyhmus.cacina | 0:b259fd1a88f5 | 86 | * @brief Stops the active sensors and algorithms |
| seyhmus.cacina | 0:b259fd1a88f5 | 87 | * |
| seyhmus.cacina | 0:b259fd1a88f5 | 88 | */ |
| seyhmus.cacina | 0:b259fd1a88f5 | 89 | void SH_Max8614x_stop(void); |
| seyhmus.cacina | 0:b259fd1a88f5 | 90 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 91 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 92 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 93 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 94 | /*FOR THIS EXAMPLE DEMO PURPOSES*/ |
| seyhmus.cacina | 0:b259fd1a88f5 | 95 | int Max8614x_Set_WSPO2Mode(int mode); |
| seyhmus.cacina | 0:b259fd1a88f5 | 96 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 97 | extern uint16_t HrmResult; |
| seyhmus.cacina | 0:b259fd1a88f5 | 98 | extern uint16_t SPO2Result; |
| seyhmus.cacina | 0:b259fd1a88f5 | 99 | extern uint8_t HrmConfidence; |
| seyhmus.cacina | 0:b259fd1a88f5 | 100 | extern uint8_t SPo2Confidence; |
| seyhmus.cacina | 0:b259fd1a88f5 | 101 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 102 | /* define to see debug messages*/ |
| seyhmus.cacina | 0:b259fd1a88f5 | 103 | #define DEBUG_INFO |
| seyhmus.cacina | 0:b259fd1a88f5 | 104 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 105 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 106 | int SH_Max8614x_get_whrm_dataformat(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 107 | int SH_Max8614x_get_wspo2_dataformat(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 108 | int SH_Max8614x_set_ppgreg(const char *addr_value_args); |
| seyhmus.cacina | 0:b259fd1a88f5 | 109 | int SH_Max8614x_get_ppgreg(const char *addr_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 110 | int SH_Max8614x_measure_whrm(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 111 | int SH_Max8614x_measure_wspo2(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 112 | int SH_Max8614x_self_test_ppg(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 113 | int SH_Max8614x_self_test_acc(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 114 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 115 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 116 | int SH_Max8614x_set_spo2_calibration(const char *calib_args); |
| seyhmus.cacina | 0:b259fd1a88f5 | 117 | int SH_Max8614x_get_spo2_calibration(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 118 | int SH_Max8614x_set_spo2_algomode(const char *mode_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 119 | int SH_Max8614x_get_spo2_algomode(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 120 | int SH_Max8614x_set_spo2_samplerate(const char *srate_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 121 | int SH_Max8614x_get_spo2_samplerate(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 122 | int SH_Max8614x_set_spo2_agcusage(const char *onoff_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 123 | int SH_Max8614x_get_spo2_agcusage(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 124 | int SH_Max8614x_set_spo2_agctimeout(const char *timeout_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 125 | int SH_Max8614x_get_spo2_agctimeout(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 126 | int SH_Max8614x_set_spo2_algotimeout(const char *timeout_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 127 | int SH_Max8614x_get_spo2_algotimeout(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 128 | int SH_Max8614x_set_spo2_motionusage(const char *onoff_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 129 | int SH_Max8614x_get_spo2_motionusage(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 130 | int SH_Max8614x_set_spo2_motionperiod(const char *period_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 131 | int SH_Max8614x_get_spo2_motionperiod(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 132 | int SH_Max8614x_set_spo2_motionthresh(const char *thresh_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 133 | int SH_Max8614x_get_spo2_motionthresh(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 134 | int SH_Max8614x_set_spo2_pdiodeconfig(const char *pdcfg_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 135 | int SH_Max8614x_get_spo2_pdiodeconfig(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 136 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 137 | int SH_Max8614x_set_whrm_aecusage(const char *onoff_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 138 | int SH_Max8614x_get_whrm_aecusage(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 139 | int SH_Max8614x_set_whrm_scdusage(const char *onoff_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 140 | int SH_Max8614x_get_whrm_scdusage(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 141 | int SH_Max8614x_set_whrm_scdadjperiod(const char *period_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 142 | int SH_Max8614x_get_whrm_scdadjperiod(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 143 | int SH_Max8614x_set_whrm_scddebouncewin(const char *dwindow_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 144 | int SH_Max8614x_get_whrm_scddebouncewin(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 145 | int SH_Max8614x_set_whrm_motionthresh(const char *motion_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 146 | int SH_Max8614x_get_whrm_motionthresh(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 147 | int SH_Max8614x_set_whrm_minpdiodecurr(const char *curr_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 148 | int SH_Max8614x_get_whrm_minpdiodecurr(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 149 | int SH_Max8614x_set_whrm_pdiodeconfig(const char *cfg_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 150 | int SH_Max8614x_get_whrm_pdiodeconfig(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 151 | int SH_Max8614x_send_raw(const char *raw_data); |
| seyhmus.cacina | 0:b259fd1a88f5 | 152 | int SH_Max8614x_stop_acquisition(const char *null_arg); |
| seyhmus.cacina | 0:b259fd1a88f5 | 153 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 154 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 155 | #define NUMCMDS8614X (43) |
| seyhmus.cacina | 0:b259fd1a88f5 | 156 | #define CONSOLE_STR_BUF_SZ ((int)1024); |
| seyhmus.cacina | 0:b259fd1a88f5 | 157 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 158 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 159 | typedef int (*cmdExecFunc)( const char*); // typedef void (*cmdExecFunc)( const void*); |
| seyhmus.cacina | 0:b259fd1a88f5 | 160 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 161 | typedef struct { |
| seyhmus.cacina | 0:b259fd1a88f5 | 162 | char const* cmdStr; |
| seyhmus.cacina | 0:b259fd1a88f5 | 163 | cmdExecFunc execute; |
| seyhmus.cacina | 0:b259fd1a88f5 | 164 | char const *help; |
| seyhmus.cacina | 0:b259fd1a88f5 | 165 | }cmd_interface_t; |
| seyhmus.cacina | 0:b259fd1a88f5 | 166 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 167 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 168 | static int command_help(const char *str); |
| seyhmus.cacina | 0:b259fd1a88f5 | 169 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 170 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 171 | const cmd_interface_t CMDTABLE8614x[] = { |
| seyhmus.cacina | 0:b259fd1a88f5 | 172 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 173 | { "get_format whrmdata" , SH_Max8614x_get_whrm_dataformat , "returns whrm algo sample format in terms of bit fileds" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 174 | { "get_format wspo2data" , SH_Max8614x_get_wspo2_dataformat , "returns wspo2 algo sample format in terms of bit fileds" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 175 | { "enable_measurement whrm" , SH_Max8614x_measure_whrm , "start whrm measurement with default settings" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 176 | { "enable_measurement wspo2" , SH_Max8614x_measure_wspo2 , "start wspo2 measurement with default settings" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 177 | { "get_reg ppgsensor" , SH_Max8614x_get_ppgreg , "get register value of 8614x sensor, usage: get_reg ppgsensor rAddr(1byte)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 178 | { "set_reg ppgsensor" , SH_Max8614x_set_ppgreg , "set register value of 8614x sensor, usage : set_reg ppgsensor rAddr(1byte) rval(1byte)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 179 | { "self_test ppgsensor" , SH_Max8614x_self_test_ppg , "starts self test of onboard ppg sensor" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 180 | { "self_test accel" , SH_Max8614x_self_test_acc , "starts self test of onboard accel sensor" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 181 | { "set_cfg spo2 cal" , SH_Max8614x_set_spo2_calibration , "sets spo2 calibration, usage: set_cfg spo2 cal 0xAAAAAAAA 0xBBBBBBBB 0xCCCCCCCC" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 182 | { "get_cfg spo2 cal" , SH_Max8614x_get_spo2_calibration , "gets spo2 calibration" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 183 | { "set_cfg spo2 algomode" , SH_Max8614x_set_spo2_algomode , "sets the spo2 algo mode to oneshot(0) or continious(1), usage: set_cfg spo2 algomode mode(1byte)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 184 | { "get_cfg spo2 algomode" , SH_Max8614x_get_spo2_algomode , "check if spo2 is oneshot/continious" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 185 | { "set_cfg spo2 samplerate" , SH_Max8614x_set_spo2_samplerate , "sets spo2 sample rate, uasge: set_cfg spo2 samplerate sampleRate(numeric value)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 186 | { "get_cfg spo2 samplerate" , SH_Max8614x_get_spo2_samplerate , "gets spo2 sample rate" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 187 | { "set_cfg sop2 agc" , SH_Max8614x_set_spo2_agcusage , "on/off automatic gain control in wspo, usage: set_cfg wsop2 agc X(1byte) X: 0 off 1 on" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 188 | { "get_cfg sop2 agc" , SH_Max8614x_get_spo2_agcusage , "check if agc is on/off" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 189 | { "set_cfg spo2 agctimeout" , SH_Max8614x_set_spo2_agctimeout , "sets agc timeout for spo2, usage: set_cfg spo2 agctimeout timeout(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 190 | { "get_cfg spo2 agctimeout" , SH_Max8614x_get_spo2_agctimeout , "gets agctimeout for spo2" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 191 | { "set_cfg spo2 timeout" , SH_Max8614x_set_spo2_algotimeout , "sets timeout for spo2 incase of no valid result, usage: set_cfg spo2 timeout timeout(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 192 | { "get_cfg spo2 timeout" , SH_Max8614x_get_spo2_algotimeout , "gets valid result timeout for spo2" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 193 | { "set_cfg spo2 motion" , SH_Max8614x_set_spo2_motionusage , "on/off motion data usage for spo2, usage: set_cfg spo2 motionenable X(1byte) X: 0 off 1 on " }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 194 | { "get_cfg spo2 motion" , SH_Max8614x_get_spo2_motionusage , "checks if spo2 uses motion data" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 195 | { "set_cfg spo2 motionperiod" , SH_Max8614x_set_spo2_motionperiod , "sets motion period for spo2, usage: set_cfg spo2 motionperiod period(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 196 | { "get_cfg spo2 motionperiod" , SH_Max8614x_get_spo2_motionperiod , "gets motion period for spo2" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 197 | { "set_cfg spo2 motionthreshold" , SH_Max8614x_set_spo2_motionthresh , "sets motion threshold for spo2, usage: set_cfg spo2 motionthreshold thres(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 198 | { "get_cfg spo2 motionthreshold" , SH_Max8614x_get_spo2_motionthresh , "gets motion threshold for spo2" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 199 | { "set_cfg spo2 pdconfig" , SH_Max8614x_set_spo2_pdiodeconfig , "sets spo2 photodiode config, usage set_cfg spo2 pdconfig X , X: 1-pd1, 2-pd2, 3-both, 4-avaraged" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 200 | { "get_cfg spo2 pdconfig" , SH_Max8614x_get_spo2_pdiodeconfig , "gets spo2 photodiode config" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 201 | { "set_cfg whrm aecenable" , SH_Max8614x_set_whrm_aecusage , "on/off whrm aec algo, usage: set_cfg whrm aec X , X: 0 off 1 on" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 202 | { "get_cfg whrm aecenable" , SH_Max8614x_get_whrm_aecusage , "check if aec algo for whrm is on/off" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 203 | { "set_cfg whrm scdenable" , SH_Max8614x_set_whrm_scdusage , "on/off whrm skin contact detection, usage: set_cfg whrm scd X , X: 0 off 1 on" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 204 | { "get_cfg whrm scdenable" , SH_Max8614x_get_whrm_scdusage , "check if whrm skin contact detection is on/off" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 205 | { "set_cfg whrm scdadjperiod" , SH_Max8614x_set_whrm_scdadjperiod , "sets photo diode adj peroiod for whrm scd algo, usage: set_cfg whrm scdadjperiod period(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 206 | { "get_cfg whrm scdadjperiod" , SH_Max8614x_get_whrm_scdadjperiod , "gets photo diode adj peroiod for whrm scd algo" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 207 | { "set_cfg whrm scddebouncewin" , SH_Max8614x_set_whrm_scddebouncewin , "sets debounce window for whrm scd algo, usage: set_cfg whrm scddebouncewin window(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 208 | { "get_cfg whrm scddebouncewin" , SH_Max8614x_get_whrm_scddebouncewin , "gets debounce window for whrm scd algo" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 209 | { "set_cfg whrm motionthreshold" , SH_Max8614x_set_whrm_motionthresh , "sets motion threshold for whrm, usage: set_cfg whrm motionthreshold threshold(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 210 | { "get_cfg whrm motionthreshold" , SH_Max8614x_get_whrm_motionthresh , "gets motion threshold for whrm" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 211 | { "set_cfg whrm minpdcurrent" , SH_Max8614x_set_whrm_minpdiodecurr , "sets photodiode current range for whrm, usage: set_cfg whrm minpdcurrent current(numeric)" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 212 | { "get_cfg whrm minpdcurrent" , SH_Max8614x_get_whrm_minpdiodecurr , "gets photodiode current rangefor whrm" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 213 | { "set_cfg whrm pdconfig" , SH_Max8614x_set_whrm_pdiodeconfig , "sets photdiode config for whrm, usage: set_cfg whrmaecscd pdconfig configstring" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 214 | { "get_cfg whrm pdconfig" , SH_Max8614x_get_whrm_pdiodeconfig , "gets photdiode config for whrm" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 215 | { "stop" , SH_Max8614x_stop_acquisition , "stops raw&algorithm data acquisition within 8614x instance of hub" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 216 | { "help" , command_help , "commnand info" } |
| seyhmus.cacina | 0:b259fd1a88f5 | 217 | // { "send_raw" , SH_Max8614x_send_raw , "sends raw data to sensor hub, usage: send_raw datastring" }, |
| seyhmus.cacina | 0:b259fd1a88f5 | 218 | }; |
| seyhmus.cacina | 0:b259fd1a88f5 | 219 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 220 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 221 | static int command_help(const char *str){ |
| seyhmus.cacina | 0:b259fd1a88f5 | 222 | int cmdIdx = 0; |
| seyhmus.cacina | 0:b259fd1a88f5 | 223 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 224 | SERIALOUT("AVAILABLE COMMANDS: \r\n\r\n"); |
| seyhmus.cacina | 0:b259fd1a88f5 | 225 | while( cmdIdx != NUMCMDS8614X){ |
| seyhmus.cacina | 0:b259fd1a88f5 | 226 | SERIALOUT(" %s : \r\n %s \r\n\r\n", CMDTABLE8614x[cmdIdx].cmdStr , CMDTABLE8614x[cmdIdx].help ); |
| seyhmus.cacina | 0:b259fd1a88f5 | 227 | cmdIdx++; |
| seyhmus.cacina | 0:b259fd1a88f5 | 228 | }; |
| seyhmus.cacina | 0:b259fd1a88f5 | 229 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 230 | } |
| seyhmus.cacina | 0:b259fd1a88f5 | 231 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 232 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 233 | #endif |
| seyhmus.cacina | 0:b259fd1a88f5 | 234 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 235 | |
| seyhmus.cacina | 0:b259fd1a88f5 | 236 |
