Hexiwear_zeta / Mbed OS HexiHeart_Main

Dependencies:   FXAS21002 FXOS8700 Hexi_KW40Z Hexi_OLED_SSD1351 MAXIM W25Q64FVSSIG HTU21D MPL3115A2 TSL2561

Fork of HexiHeart_Alex by Hexiwear_zeta

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hexi_battery.h Source File

hexi_battery.h

00001 /** Battery Driver for Hexiwear 
00002  *  This file contains battery driver functionality for check battery level and status
00003  *
00004  * Redistribution and use in source and binary forms, with or without modification,
00005  * are permitted provided that the following conditions are met:
00006  *
00007  * Redistributions of source code must retain the above copyright notice, this list
00008  * of conditions and the following disclaimer.
00009  *
00010  * Redistributions in binary form must reproduce the above copyright notice, this
00011  * list of conditions and the following disclaimer in the documentation and/or
00012  * other materials provided with the distribution.
00013  *
00014  * Neither the name of NXP, nor the names of its
00015  * contributors may be used to endorse or promote products derived from this
00016  * software without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00019  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00020  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00021  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
00022  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00024  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00025  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00026  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  *
00029  * visit: http://www.mikroe.com and http://www.nxp.com
00030  *
00031  * get support at: http://www.mikroe.com/forum and https://community.nxp.com
00032  *
00033  * Project HEXIWEAR, 2015
00034  */
00035  
00036 #ifndef HG_HEXI_BATTERY
00037 #define HG_HEXI_BATTERY
00038 
00039 #include "mbed.h"
00040 
00041 class HexiwearBattery
00042 {
00043 
00044 public:
00045     HexiwearBattery();
00046     ~HexiwearBattery();
00047     uint8_t readLevelPercent();
00048     void sensorOn();
00049     void sensorOff();
00050     bool isBatteryCharging();
00051 
00052 
00053 private:
00054 
00055     DigitalOut *batSensSwitch;
00056     DigitalIn *batCharging;
00057 
00058 };
00059 
00060 
00061 #endif
00062