-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDisplay.h
More file actions
175 lines (164 loc) · 7.05 KB
/
Copy pathDisplay.h
File metadata and controls
175 lines (164 loc) · 7.05 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#pragma once
#include <Arduino.h> // For String, uint8_t types
#include "GlobalState.h"
#ifdef ENABLE_DISPLAY
// Must be called once in setup() BEFORE any display function.
// Creates the recursive FreeRTOS mutex that serializes all SPI/TFT access
// across Core 0 (Task1 button callbacks) and Core 1 (main loop).
void initDisplayMutex();
void initDisplay();
void startupScreen();
void btctickerScreen();
void updateBtctickerValues(); // Partial update - only values, no full redraw
void initializationScreen();
void bootUpScreen();
void configModeScreen();
void errorReportScreen(uint8_t wifiCount, uint8_t internetCount, uint8_t serverCount, uint8_t websocketCount);
void wifiReconnectScreen();
void internetReconnectScreen();
void serverReconnectScreen();
void websocketReconnectScreen();
void stepOneScreen();
void stepTwoScreen();
void stepThreeScreen();
void actionTimeScreen();
void updateActionTimeCountdown(int remainingSecs);
void identityTriggerScreen();
void nfcPendingScreen();
void nfcNoLuckScreen();
void nfcNotSupportedScreen();
void nfcErrorDetailScreen(const char* detail);
void thankYouScreen();
void productBlockedScreen();
void supplyBinEmptyScreen();
void drawQRCode();
void showQRScreen();
void showThresholdQRScreen();
void showProductQRScreen(String label, int pin);
void showBoltCardScreen(String label, int pin);
void showMobilePhoneScreen(String label, int pin);
void productSelectionScreen();
void activateScreensaver(String mode);
void deactivateScreensaver();
bool isScreensaverActive();
void prepareDeepSleep();
void setupDeepSleepWakeup(String mode);
bool isDeepSleepActive();
// NFC Hardware Test (ENABLE_NFC=1 + ENABLE_NFC_TEST=1)
void nfcTestScreen(String lnurlw);
// PIN pad for BoltCard PIN entry (LUD pinLimit)
void showPinPadScreen(const PinPadState &state);
// Returns: 0-9=digit, 10=backspace, 11=clear, 12=cancel, -1=no hit
int pinPadHitTest(uint16_t x, uint16_t y);
// Auth / Identity screens: implemented on both T-Display-S3 and Touch 3.5".
// Touch 3.5": CANCEL button on teach screen; tap-driven tab switch for dual-page.
// T-Display-S3: simplified teach screen; NEXT button drives dual-page navigation.
void showAuthTeachScreen(String label, int pin);
void showAuthToast(const String &msg, bool isError);
void showAuthIdentityScreen(String label, int pin);
void showAuthPayScreen(String label, int pin);
void authIdentityDisabledScreen();
// Board-specific: Touch 3.5" has real implementations; T-Display-S3 uses stubs.
#ifdef BOARD_JC3248W535C
// Mini-PoS amount entry, invoice QR, paid confirmation (Touch 3.5 only)
void showMiniPosInputScreen();
int miniPosHitTest(uint16_t x, uint16_t y);
void showMiniPosQRScreen();
bool miniPosQrCancelHit(uint16_t x, uint16_t y);
void miniPosPaidScreen();
// Numerical product selection (Touch 3.5 multi-channel only)
void showProductSelectScreen();
void updateProductSelectBlockHeight();
int productSelectHitTest(uint16_t x, uint16_t y);
void showProductSelectQRScreen(String label, int pin);
bool productSelectQrCancelHit(uint16_t x, uint16_t y);
// Mode selection screen (Touch 3.5 only)
void showModeSelectionScreen();
int modeSelectHitTest(uint16_t x, uint16_t y);
// PIN failure overlay and touch-based cancel/tab hit tests (Touch 3.5 only)
void showAuthPinError(const String &l1, const String &l2, const String &l3);
bool authTeachCancelHit(uint16_t x, uint16_t y);
bool authTabHit(uint16_t x, uint16_t y);
#else
// T-Display-S3: these touch-only functions are not needed
inline void showMiniPosInputScreen() {}
inline int miniPosHitTest(uint16_t, uint16_t) { return -1; }
inline void showMiniPosQRScreen() {}
inline bool miniPosQrCancelHit(uint16_t, uint16_t) { return false; }
inline void miniPosPaidScreen() {}
inline void showProductSelectScreen() {}
inline void updateProductSelectBlockHeight() {}
inline int productSelectHitTest(uint16_t, uint16_t) { return -1; }
inline void showProductSelectQRScreen(String, int) {}
inline bool productSelectQrCancelHit(uint16_t, uint16_t) { return false; }
inline void showModeSelectionScreen() {}
inline int modeSelectHitTest(uint16_t, uint16_t) { return -1; }
inline void showAuthPinError(const String &, const String &, const String &) {}
inline bool authTeachCancelHit(uint16_t, uint16_t) { return false; }
inline bool authTabHit(uint16_t, uint16_t) { return false; }
#endif // BOARD_JC3248W535C
#else // !ENABLE_DISPLAY
// Headless mode - stub implementations (no display)
inline void initDisplayMutex() {}
inline void initDisplay() {}
inline void startupScreen() {}
inline void btctickerScreen() {}
inline void updateBtctickerValues() {}
inline void initializationScreen() {}
inline void bootUpScreen() {}
inline void configModeScreen() {}
inline void errorReportScreen(uint8_t, uint8_t, uint8_t, uint8_t) {}
inline void wifiReconnectScreen() {}
inline void internetReconnectScreen() {}
inline void serverReconnectScreen() {}
inline void websocketReconnectScreen() {}
inline void stepOneScreen() {}
inline void stepTwoScreen() {}
inline void stepThreeScreen() {}
inline void actionTimeScreen() {}
inline void identityTriggerScreen() {}
inline void updateActionTimeCountdown(int) {}
inline void nfcPendingScreen() {}
inline void nfcNoLuckScreen() {}
inline void nfcNotSupportedScreen() {}
inline void nfcErrorDetailScreen(const char*) {}
inline void thankYouScreen() {}
inline void productBlockedScreen() {}
inline void supplyBinEmptyScreen() {}
inline void drawQRCode() {}
inline void showQRScreen() {}
inline void showThresholdQRScreen() {}
inline void showProductQRScreen(String, int) {}
inline void showBoltCardScreen(String, int) {}
inline void showMobilePhoneScreen(String, int) {}
inline void productSelectionScreen() {}
inline void activateScreensaver(String) {}
inline void deactivateScreensaver() {}
inline bool isScreensaverActive() { return false; }
inline void prepareDeepSleep() {}
inline void setupDeepSleepWakeup(String) {}
inline bool isDeepSleepActive() { return false; }
inline void nfcTestScreen(String) {}
inline void showPinPadScreen(const PinPadState &) {}
inline int pinPadHitTest(uint16_t, uint16_t) { return -1; }
inline void showModeSelectionScreen() {}
inline int modeSelectHitTest(uint16_t, uint16_t) { return -1; }
inline void showMiniPosInputScreen() {}
inline int miniPosHitTest(uint16_t, uint16_t) { return -1; }
inline void showMiniPosQRScreen() {}
inline bool miniPosQrCancelHit(uint16_t, uint16_t) { return false; }
inline void miniPosPaidScreen() {}
inline void showProductSelectScreen() {}
inline void updateProductSelectBlockHeight() {}
inline int productSelectHitTest(uint16_t, uint16_t) { return -1; }
inline void showProductSelectQRScreen(String, int) {}
inline bool productSelectQrCancelHit(uint16_t, uint16_t) { return false; }
inline void showAuthTeachScreen(String, int) {}
inline void showAuthPinError(const String &, const String &, const String &) {}
inline void showAuthToast(const String &, bool) {}
inline bool authTeachCancelHit(uint16_t, uint16_t) { return false; }
inline void showAuthIdentityScreen(String, int) {}
inline void showAuthPayScreen(String, int) {}
inline bool authTabHit(uint16_t, uint16_t) { return false; }
inline void authIdentityDisabledScreen() {}
#endif // ENABLE_DISPLAY