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