Example host software to display SpO2 or Heart Rate on wrist using the MAX32664GWEC or MAXREFDES101 with IR/Red LED board. It is recommended that the MAX32664 be loaded with the latest Maxim supplied algorithm (.msbl file).

Dependencies:   Maxim_Sensor_Hub_Communications BMI160 demoUI max32630hsp3

Fork of Host_Software_MAX32664GWEC_SpO2_HR by mehmet gok

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SH_Max8614x_BareMetal.h Source File

SH_Max8614x_BareMetal.h

00001 /*******************************************************************************
00002  * Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved.
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a
00005  * copy of this software and associated documentation files (the "Software"),
00006  * to deal in the Software without restriction, including without limitation
00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008  * and/or sell copies of the Software, and to permit persons to whom the
00009  * Software is furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included
00012  * in all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
00018  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020  * OTHER DEALINGS IN THE SOFTWARE.
00021  *
00022  * Except as contained in this notice, the name of Maxim Integrated
00023  * Products, Inc. shall not be used except as stated in the Maxim Integrated
00024  * Products, Inc. Branding Policy.
00025  *
00026  * The mere transfer of this software does not imply any licenses
00027  * of trade secrets, proprietary technology, copyrights, patents,
00028  * trademarks, maskwork rights, or any other form of intellectual
00029  * property whatsoever. Maxim Integrated Products, Inc. retains all
00030  * ownership rights.
00031  *******************************************************************************
00032  */
00033 #ifndef SH_Max8614x_BareMetal_H_
00034 #define SH_Max8614x_BareMetal_H_
00035 
00036 #include <stdint.h>
00037 #include <stdio.h>
00038 
00039 #define COMM_SUCCESS        0
00040 #define COMM_GENERAL_ERROR  -1
00041 #define COMM_INVALID_PARAM  -254
00042 #define COMM_NOT_RECOGNIZED -255
00043 
00044 enum enAlgoMode{
00045     kAlgoModeHeartRate = 0,
00046     kAlgoModeSPO2
00047 };
00048 
00049 /**
00050  * @brief   Get the value of register at addr
00051  *
00052  * @param[in]   addr - adress of the register
00053  * @param[out]  val - value at the register
00054 
00055  */
00056 void SH_Max8614x_get_reg(uint8_t addr, uint32_t *val);
00057 
00058 /**
00059 * @brief    Write a value to the register at address addr
00060 *
00061 * @param[in]    addr - adress of the register to write
00062 * @param[in]    val - value of the register to write
00063 */
00064 void SH_Max8614x_set_reg(uint8_t addr, uint32_t val);
00065 
00066 /**
00067 * @brief    Initialize Max86140 with default configuration
00068 *
00069 * @param[in] paramAlgoMode - the mode of the algorithm to initialize
00070 *
00071 * @return 0 on SUCCESS
00072 */
00073 int SH_Max8614x_default_init(enum enAlgoMode paramAlgoMode);
00074 
00075 /**
00076 * @brief    Check the data stored in the Sensor Hub. Reads and prints
00077 *           the data if available
00078 *
00079 */
00080 int SH_Max8614x_data_report_execute(void);
00081 
00082 /**
00083 * @brief    Stops the active sensors and algorithms
00084 *
00085 */
00086 void SH_Max8614x_stop(void);
00087 
00088 
00089 extern uint16_t HrmResult;
00090 extern uint16_t SPO2Result;
00091 extern uint8_t  HrmConfidence;
00092 extern uint8_t  SPo2Confidence;
00093 
00094 /* define to see debug messages*/
00095 #define DEBUG_INFO
00096 
00097 
00098 
00099 #endif
00100 
00101