![](/media/cache/group/download_IjbieK2.png.50x50_q85.png)
demo new haven display
Dependencies: LCD Menu ButtonCtrl TimeManagement EventLog AddressMap emic2
ESCM 2000 Control and Display application provides interface for the LPC1768 processor boards with the ECSM 2000 system.
This application implements SW interface : - RX 485 Receive from physical system - RX 485 Interface to send toECOM / ESCM board - CAN Interface to send to ECOM / ESCM board - 4x40 LCD with menu controls - RTC configuration -EMIC2 Sound Card - GPIO Extender to push buttons etc
Diff: ESCMControlApp.h
- Revision:
- 5:65f21c0b6b79
- Parent:
- 3:ecaf9963341b
- Child:
- 6:010ceb99f7b0
--- a/ESCMControlApp.h Thu Jul 25 00:46:02 2019 +0000 +++ b/ESCMControlApp.h Thu Sep 12 11:28:26 2019 +0000 @@ -4,8 +4,6 @@ #include "mbed.h" #include "Menu.h" -#include "Navigator.h" -#include "Selection.h" #include "LCD.h" #include "AddressMap.h" #include "EventLog.h" @@ -14,8 +12,22 @@ #include "emic2.h" +#define LIMIT(x,low,high) x = ((x<=low)? low : ((x>=high) ? high : x )); +#define WRAP (x,low,high) ((x<low)?(high-1):((x>high)?0:x)); + +typedef struct { + int event; +} event_t; + +typedef struct { + char message[64]; +} playbackMessage_t; + + extern LCD lcd; +extern AddressMap addressMap; + extern ESCM_EventLog escmEventLog; extern RealTimeClock rtc; @@ -32,27 +44,51 @@ extern emic2 speaker; +extern CircularBuffer<event_t, 64> message_queue; + +extern CircularBuffer<event_t, 64> event_queue; + +extern CircularBuffer<playbackMessage_t, 10> playback_queue; + + class ESCMControlApp { public: - Menu getAddressMenu(); void init(void); void update(void); + void processMessageQueue (); + void processSoundQueue (); //void rx485Message(); void tx485Message(int address); void txCanMessage501 (int address); void txCanMessage502 (int address); + void txCanMessage580 (int address); static void say (char *format, ...); + static void refresh_display (void); - int dataRxCnt; + static void getTime(char *timeBuffer); + static void setTime(int hours, int mins, int sec, int months, int days, int years ); + + static void postEvent (uint16_t address); + static void postEvent (uint16_t address, uint16_t source); + int cur_address; - char fault[4]; + + int dataRxCnt; + int dataTxCnt; + + Mutex event_ctrl ; + Mutex emic_ctrl ; + Mutex can_ctrl ; + Mutex rs485_ctrl; }; +extern ESCMControlApp escmController; + #endif \ No newline at end of file