Added a new structure in order to get power infos
This commit is contained in:
parent
ae0588206f
commit
b7ddc2cb16
@ -24,13 +24,22 @@ typedef enum { GPIO_0 = 0,
|
|||||||
#define SDCARD_INIT_ERR B00000100
|
#define SDCARD_INIT_ERR B00000100
|
||||||
|
|
||||||
#define MALLOC_ERR B00000001
|
#define MALLOC_ERR B00000001
|
||||||
|
#define NO_ERROR 0
|
||||||
|
|
||||||
#define NO_CURRENT_VIEW NULL
|
#define NO_CURRENT_VIEW NULL
|
||||||
#define LAST_VIEW -1
|
#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 { 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 { BIT = 0, BYTE, KBIT, KBYTE, MBIT, MBYTE, GBIT, GBYTE } SizeUnit;
|
||||||
|
|
||||||
|
typedef enum { BATTERY = 0, USB } PowerType;
|
||||||
|
|
||||||
//Data structure for the view handling
|
//Data structure for the view handling
|
||||||
typedef struct viewLink{
|
typedef struct viewLink{
|
||||||
boolean (*viewLogicFunction)(Adafruit_SSD1306&, void*);
|
boolean (*viewLogicFunction)(Adafruit_SSD1306&, void*);
|
||||||
@ -40,5 +49,12 @@ typedef struct viewLink{
|
|||||||
struct viewLink *next;
|
struct viewLink *next;
|
||||||
} ViewLink, *ViewLinkedList;
|
} ViewLink, *ViewLinkedList;
|
||||||
|
|
||||||
|
//Data structure for the battery info
|
||||||
|
typedef struct powerInfo
|
||||||
|
{
|
||||||
|
PowerType powerType;
|
||||||
|
unsigned char level;
|
||||||
|
}PowerInfo;
|
||||||
|
|
||||||
|
|
||||||
#endif //DEFINITION_H
|
#endif //DEFINITION_H
|
||||||
|
Loading…
Reference in New Issue
Block a user