-
Notifications
You must be signed in to change notification settings - Fork 1
/
display.h
69 lines (61 loc) · 2.24 KB
/
display.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* display.h
*
* Created on: Jan 1, 2019
* Author: Dan Walkes
*
* Use these steps to integrate the display module with your source code:
* 1) Add scheduler and timer events which can provide a 1Hz update for the display EXTCOMIN pin
* through a call to displayUpdate(). Include your scheduler/timer header files in the top of
* display.c. #define these values in appropriate header files:
* #define SCHEDULER_SUPPORTS_DISPLAY_UPDATE_EVENT 1
* #define TIMER_SUPPORTS_1HZ_TIMER_EVENT 1
* and customize the line timerEnable1HzSchedulerEvent(Scheduler_DisplayUpdate) to make the
* appropriate call to your timer/scheduler routine to start this event.
*
* 2) Add functions gpioEnableDisplay() and gpioSetDisplayExtcomin(bool high) to your gpio.c and
* gpio.h files, and include
* #define GPIO_SET_DISPLAY_EXT_COMIN_IMPLEMENTED 1
* and
* #define GPIO_DISPLAY_SUPPORT_IMPLEMENTED 1
* definitions in your gpio.h file
* ** Note that the Blue Gecko development board uses the same pin for both the sensor and display enable
* pins. This means you cannot disable the sensor for load power management if enabling the display. Your
* GPIO routines need to account for this **
*
* 3) Call displayInit() before attempting to write the display and after initializing your timer and
* scheduler.
*/
#ifndef SRC_DISPLAY_H_
#define SRC_DISPLAY_H_
#define ECEN5823_INCLUDE_DISPLAY_SUPPORT 1
#include "glib.h"
/**
* Display row definitions, used for writing specific content based on assignment requirements.
* See assignment text for details.
*/
enum display_row {
DISPLAY_ROW_NAME,
DISPLAY_ROW_BTADDR,
DISPLAY_ROW_BTADDR2,
DISPLAY_ROW_CLIENTADDR,
DISPLAY_ROW_CONNECTION,
DISPLAY_ROW_PASSKEY,
DISPLAY_ROW_ACTION,
DISPLAY_ROW_TEMPVALUE,
DISPLAY_ROW_AQI,
DISPLAY_ROW_HUMID,
DISPLAY_ROW_AQI_PERS,
DISPLAY_ROW_HUMID_PERS,
DISPLAY_ROW_MAX,
};
#if ECEN5823_INCLUDE_DISPLAY_SUPPORT
void displayInit();
bool displayUpdate();
void displayPrintf(enum display_row row, const char *format, ... );
#else
static inline void displayInit() { }
static inline bool displayUpdate() { return true; }
static inline void displayPrintf(enum display_row row, const char *format, ... ) { row=row; format=format;}
#endif
#endif /* SRC_DISPLAY_H_ */