The HexiHeart is a demo project product that takes advantage of many of the onboard Hexiwear sensors and capabilities to create a multifunctional fitness and safety watch.
Dependencies: FXAS21002 FXOS8700 Hexi_KW40Z Hexi_OLED_SSD1351 MAXIM W25Q64FVSSIG HTU21D MPL3115A2 TSL2561
Fork of HexiHeart_Alex by
Hexi_Battery/hexi_battery.h@22:3de592f8e696, 2018-05-10 (annotated)
- Committer:
- asong
- Date:
- Thu May 10 03:44:47 2018 +0000
- Revision:
- 22:3de592f8e696
- Parent:
- 4:0803151bc5e4
Added stages to the heart rate simulation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nbaker | 4:0803151bc5e4 | 1 | /** Battery Driver for Hexiwear |
nbaker | 4:0803151bc5e4 | 2 | * This file contains battery driver functionality for check battery level and status |
nbaker | 4:0803151bc5e4 | 3 | * |
nbaker | 4:0803151bc5e4 | 4 | * Redistribution and use in source and binary forms, with or without modification, |
nbaker | 4:0803151bc5e4 | 5 | * are permitted provided that the following conditions are met: |
nbaker | 4:0803151bc5e4 | 6 | * |
nbaker | 4:0803151bc5e4 | 7 | * Redistributions of source code must retain the above copyright notice, this list |
nbaker | 4:0803151bc5e4 | 8 | * of conditions and the following disclaimer. |
nbaker | 4:0803151bc5e4 | 9 | * |
nbaker | 4:0803151bc5e4 | 10 | * Redistributions in binary form must reproduce the above copyright notice, this |
nbaker | 4:0803151bc5e4 | 11 | * list of conditions and the following disclaimer in the documentation and/or |
nbaker | 4:0803151bc5e4 | 12 | * other materials provided with the distribution. |
nbaker | 4:0803151bc5e4 | 13 | * |
nbaker | 4:0803151bc5e4 | 14 | * Neither the name of NXP, nor the names of its |
nbaker | 4:0803151bc5e4 | 15 | * contributors may be used to endorse or promote products derived from this |
nbaker | 4:0803151bc5e4 | 16 | * software without specific prior written permission. |
nbaker | 4:0803151bc5e4 | 17 | * |
nbaker | 4:0803151bc5e4 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
nbaker | 4:0803151bc5e4 | 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
nbaker | 4:0803151bc5e4 | 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
nbaker | 4:0803151bc5e4 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
nbaker | 4:0803151bc5e4 | 22 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
nbaker | 4:0803151bc5e4 | 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
nbaker | 4:0803151bc5e4 | 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
nbaker | 4:0803151bc5e4 | 25 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
nbaker | 4:0803151bc5e4 | 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
nbaker | 4:0803151bc5e4 | 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
nbaker | 4:0803151bc5e4 | 28 | * |
nbaker | 4:0803151bc5e4 | 29 | * visit: http://www.mikroe.com and http://www.nxp.com |
nbaker | 4:0803151bc5e4 | 30 | * |
nbaker | 4:0803151bc5e4 | 31 | * get support at: http://www.mikroe.com/forum and https://community.nxp.com |
nbaker | 4:0803151bc5e4 | 32 | * |
nbaker | 4:0803151bc5e4 | 33 | * Project HEXIWEAR, 2015 |
nbaker | 4:0803151bc5e4 | 34 | */ |
nbaker | 4:0803151bc5e4 | 35 | |
nbaker | 4:0803151bc5e4 | 36 | #ifndef HG_HEXI_BATTERY |
nbaker | 4:0803151bc5e4 | 37 | #define HG_HEXI_BATTERY |
nbaker | 4:0803151bc5e4 | 38 | |
nbaker | 4:0803151bc5e4 | 39 | #include "mbed.h" |
nbaker | 4:0803151bc5e4 | 40 | |
nbaker | 4:0803151bc5e4 | 41 | class HexiwearBattery |
nbaker | 4:0803151bc5e4 | 42 | { |
nbaker | 4:0803151bc5e4 | 43 | |
nbaker | 4:0803151bc5e4 | 44 | public: |
nbaker | 4:0803151bc5e4 | 45 | HexiwearBattery(); |
nbaker | 4:0803151bc5e4 | 46 | ~HexiwearBattery(); |
nbaker | 4:0803151bc5e4 | 47 | uint8_t readLevelPercent(); |
nbaker | 4:0803151bc5e4 | 48 | void sensorOn(); |
nbaker | 4:0803151bc5e4 | 49 | void sensorOff(); |
nbaker | 4:0803151bc5e4 | 50 | bool isBatteryCharging(); |
nbaker | 4:0803151bc5e4 | 51 | |
nbaker | 4:0803151bc5e4 | 52 | |
nbaker | 4:0803151bc5e4 | 53 | private: |
nbaker | 4:0803151bc5e4 | 54 | |
nbaker | 4:0803151bc5e4 | 55 | DigitalOut *batSensSwitch; |
nbaker | 4:0803151bc5e4 | 56 | DigitalIn *batCharging; |
nbaker | 4:0803151bc5e4 | 57 | |
nbaker | 4:0803151bc5e4 | 58 | }; |
nbaker | 4:0803151bc5e4 | 59 | |
nbaker | 4:0803151bc5e4 | 60 | |
nbaker | 4:0803151bc5e4 | 61 | #endif |
nbaker | 4:0803151bc5e4 | 62 |