From b7ddc2cb16dcdf904a00fff984fd704a36513571 Mon Sep 17 00:00:00 2001 From: anschrammh Date: Sun, 10 Mar 2019 19:16:43 +0100 Subject: [PATCH] Added a new structure in order to get power infos --- src/app/definition.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/definition.h b/src/app/definition.h index c29d72f..3e6d0b1 100644 --- a/src/app/definition.h +++ b/src/app/definition.h @@ -24,13 +24,22 @@ typedef enum { GPIO_0 = 0, #define SDCARD_INIT_ERR B00000100 #define MALLOC_ERR B00000001 +#define NO_ERROR 0 #define NO_CURRENT_VIEW NULL #define LAST_VIEW -1 + +#define BATT_FULL 870 //8.4v +#define BATT_EMPTY 775 //7.4v +#define BATT_DIFF 95 +#define USB_THRESHOLD 600 + typedef enum { OR_0 = 2, OR_90 = 3, OR_180 = 0, OR_270 = 1 } Orientation; typedef enum { BIT = 0, BYTE, KBIT, KBYTE, MBIT, MBYTE, GBIT, GBYTE } SizeUnit; +typedef enum { BATTERY = 0, USB } PowerType; + //Data structure for the view handling typedef struct viewLink{ boolean (*viewLogicFunction)(Adafruit_SSD1306&, void*); @@ -39,6 +48,13 @@ typedef struct viewLink{ struct viewLink *next; } ViewLink, *ViewLinkedList; + +//Data structure for the battery info +typedef struct powerInfo +{ + PowerType powerType; + unsigned char level; +}PowerInfo; #endif //DEFINITION_H