Railway Challenge
/
challenge-2022Fork
Commented out energgy sotrage code to rever to old state
lcd.h@37:64bb9779344e, 16 months ago (annotated)
- Committer:
- as96
- Date:
- Wed Jun 21 17:00:26 2023 +0000
- Revision:
- 37:64bb9779344e
2023 code with LCD SPI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
as96 | 37:64bb9779344e | 1 | #ifndef LCD_H |
as96 | 37:64bb9779344e | 2 | #define LCD_H |
as96 | 37:64bb9779344e | 3 | |
as96 | 37:64bb9779344e | 4 | #include <mbed.h> |
as96 | 37:64bb9779344e | 5 | |
as96 | 37:64bb9779344e | 6 | class Lcd{ |
as96 | 37:64bb9779344e | 7 | public: |
as96 | 37:64bb9779344e | 8 | // CONSTRUCTOR |
as96 | 37:64bb9779344e | 9 | Lcd(SPI& lcd, DigitalOut& lcdCS); |
as96 | 37:64bb9779344e | 10 | |
as96 | 37:64bb9779344e | 11 | int sendData(int precursor, int data) ; |
as96 | 37:64bb9779344e | 12 | void sendError(int error); |
as96 | 37:64bb9779344e | 13 | void setTime(int hr, int min, int sec, int day, int mon, int yr); |
as96 | 37:64bb9779344e | 14 | |
as96 | 37:64bb9779344e | 15 | private: |
as96 | 37:64bb9779344e | 16 | SPI& _lcd; |
as96 | 37:64bb9779344e | 17 | DigitalOut& _lcdCS; |
as96 | 37:64bb9779344e | 18 | |
as96 | 37:64bb9779344e | 19 | int spiDelay; |
as96 | 37:64bb9779344e | 20 | int commsFailures; // Number of consecutive remote comms failures |
as96 | 37:64bb9779344e | 21 | int errorIndex; |
as96 | 37:64bb9779344e | 22 | int errorBuffer[27]; |
as96 | 37:64bb9779344e | 23 | |
as96 | 37:64bb9779344e | 24 | |
as96 | 37:64bb9779344e | 25 | //Ticker commsCheckTicker; //ticker for recurring comms check |
as96 | 37:64bb9779344e | 26 | //Ticker remoteSwitchStateTicker; //ticker for recurring remote switch state update |
as96 | 37:64bb9779344e | 27 | }; |
as96 | 37:64bb9779344e | 28 | |
as96 | 37:64bb9779344e | 29 | #endif |