Example Host software for integration of MAX3266x chips (, MAX32664GWEB) equipped with Heart Rate from Wrist Algorithm. This is “stand-alone” software that runs on the MAX32630 low-power microcontroller to display heart rate on the display of the MAXREFDES101 reference design. It is intended provide a simple example of how to initialize and communicate with the sensor hub. Windows and Android communications are not supported.

Dependencies:   Maxim_Sensor_Hub_Communications BMI160 whrmDemoUI max32630hsp3

Fork of Host_Software_MAX32664GWEB_HR_wrist by mehmet gok

Committer:
gmehmet
Date:
Thu Jan 10 08:30:00 2019 +0000
Revision:
15:c1d7fdf5d55a
Parent:
13:3d1a6b947396
ready to export/fork

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gmehmet 13:3d1a6b947396 1 /*******************************************************************************
gmehmet 13:3d1a6b947396 2 * Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved.
gmehmet 13:3d1a6b947396 3 *
gmehmet 13:3d1a6b947396 4 * Permission is hereby granted, free of charge, to any person obtaining a
gmehmet 13:3d1a6b947396 5 * copy of this software and associated documentation files (the "Software"),
gmehmet 13:3d1a6b947396 6 * to deal in the Software without restriction, including without limitation
gmehmet 13:3d1a6b947396 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
gmehmet 13:3d1a6b947396 8 * and/or sell copies of the Software, and to permit persons to whom the
gmehmet 13:3d1a6b947396 9 * Software is furnished to do so, subject to the following conditions:
gmehmet 13:3d1a6b947396 10 *
gmehmet 13:3d1a6b947396 11 * The above copyright notice and this permission notice shall be included
gmehmet 13:3d1a6b947396 12 * in all copies or substantial portions of the Software.
gmehmet 13:3d1a6b947396 13 *
gmehmet 13:3d1a6b947396 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
gmehmet 13:3d1a6b947396 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
gmehmet 13:3d1a6b947396 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
gmehmet 13:3d1a6b947396 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
gmehmet 13:3d1a6b947396 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
gmehmet 13:3d1a6b947396 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
gmehmet 13:3d1a6b947396 20 * OTHER DEALINGS IN THE SOFTWARE.
gmehmet 13:3d1a6b947396 21 *
gmehmet 13:3d1a6b947396 22 * Except as contained in this notice, the name of Maxim Integrated
gmehmet 13:3d1a6b947396 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
gmehmet 13:3d1a6b947396 24 * Products, Inc. Branding Policy.
gmehmet 13:3d1a6b947396 25 *
gmehmet 13:3d1a6b947396 26 * The mere transfer of this software does not imply any licenses
gmehmet 13:3d1a6b947396 27 * of trade secrets, proprietary technology, copyrights, patents,
gmehmet 13:3d1a6b947396 28 * trademarks, maskwork rights, or any other form of intellectual
gmehmet 13:3d1a6b947396 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
gmehmet 13:3d1a6b947396 30 * ownership rights.
gmehmet 13:3d1a6b947396 31 *******************************************************************************
gmehmet 13:3d1a6b947396 32 */
gmehmet 13:3d1a6b947396 33 #ifndef SH_Max8614x_WHRM_H_
gmehmet 13:3d1a6b947396 34 #define SH_Max8614x_WHRM_H_
gmehmet 13:3d1a6b947396 35
gmehmet 13:3d1a6b947396 36 #include <stdint.h>
gmehmet 13:3d1a6b947396 37 #include <stdio.h>
gmehmet 13:3d1a6b947396 38
gmehmet 13:3d1a6b947396 39 #define COMM_SUCCESS 0
gmehmet 13:3d1a6b947396 40 #define COMM_GENERAL_ERROR -1
gmehmet 13:3d1a6b947396 41 #define COMM_INVALID_PARAM -254
gmehmet 13:3d1a6b947396 42 #define COMM_NOT_RECOGNIZED -255
gmehmet 13:3d1a6b947396 43
gmehmet 13:3d1a6b947396 44 enum enAlgoMode{
gmehmet 13:3d1a6b947396 45 kAlgoModeHeartRate = 0,
gmehmet 13:3d1a6b947396 46 kAlgoModeHeartRateReinit = 1
gmehmet 13:3d1a6b947396 47 };
gmehmet 13:3d1a6b947396 48
gmehmet 13:3d1a6b947396 49 /**
gmehmet 13:3d1a6b947396 50 * @brief Get the value of register at addr
gmehmet 13:3d1a6b947396 51 *
gmehmet 13:3d1a6b947396 52 * @param[in] addr - adress of the register
gmehmet 13:3d1a6b947396 53 * @param[out] val - value at the register
gmehmet 13:3d1a6b947396 54
gmehmet 13:3d1a6b947396 55 */
gmehmet 13:3d1a6b947396 56 void SH_Max8614x_get_reg(uint8_t addr, uint32_t *val);
gmehmet 13:3d1a6b947396 57
gmehmet 13:3d1a6b947396 58 /**
gmehmet 13:3d1a6b947396 59 * @brief Write a value to the register at address addr
gmehmet 13:3d1a6b947396 60 *
gmehmet 13:3d1a6b947396 61 * @param[in] addr - adress of the register to write
gmehmet 13:3d1a6b947396 62 * @param[in] val - value of the register to write
gmehmet 13:3d1a6b947396 63 */
gmehmet 13:3d1a6b947396 64 void SH_Max8614x_set_reg(uint8_t addr, uint32_t val);
gmehmet 13:3d1a6b947396 65
gmehmet 13:3d1a6b947396 66 /**
gmehmet 13:3d1a6b947396 67 * @brief Initialize Max86140 with default configuration
gmehmet 13:3d1a6b947396 68 *
gmehmet 13:3d1a6b947396 69 * @param[in] paramAlgoMode - the mode of the algorithm to initialize
gmehmet 13:3d1a6b947396 70 *
gmehmet 13:3d1a6b947396 71 * @return 0 on SUCCESS
gmehmet 13:3d1a6b947396 72 */
gmehmet 13:3d1a6b947396 73 int SH_Max8614x_default_init(enum enAlgoMode paramAlgoMode);
gmehmet 13:3d1a6b947396 74
gmehmet 13:3d1a6b947396 75 /**
gmehmet 13:3d1a6b947396 76 * @brief Check the data stored in the Sensor Hub. Reads and prints
gmehmet 13:3d1a6b947396 77 * the data if available
gmehmet 13:3d1a6b947396 78 *
gmehmet 13:3d1a6b947396 79 */
gmehmet 13:3d1a6b947396 80 int SH_Max8614x_data_report_execute(void);
gmehmet 13:3d1a6b947396 81
gmehmet 13:3d1a6b947396 82 /**
gmehmet 13:3d1a6b947396 83 * @brief Stops the active sensors and algorithms
gmehmet 13:3d1a6b947396 84 *
gmehmet 13:3d1a6b947396 85 */
gmehmet 13:3d1a6b947396 86 void SH_Max8614x_stop(void);
gmehmet 13:3d1a6b947396 87
gmehmet 13:3d1a6b947396 88
gmehmet 13:3d1a6b947396 89 extern uint16_t HrmResult;
gmehmet 13:3d1a6b947396 90 extern uint8_t HrmConfidence;
gmehmet 13:3d1a6b947396 91
gmehmet 13:3d1a6b947396 92
gmehmet 13:3d1a6b947396 93 /* define to see debug messages*/
gmehmet 13:3d1a6b947396 94 #define DEBUG_INFO
gmehmet 13:3d1a6b947396 95
gmehmet 13:3d1a6b947396 96
gmehmet 13:3d1a6b947396 97
gmehmet 13:3d1a6b947396 98
gmehmet 13:3d1a6b947396 99
gmehmet 13:3d1a6b947396 100 #endif
gmehmet 13:3d1a6b947396 101
gmehmet 13:3d1a6b947396 102