external UI solar on foils
Dependencies: mbed
Fork of CAN_module_ext_UI by
ExtUI.h@0:877c5ece70ac, 2015-08-11 (annotated)
- Committer:
- Dannis_mbed
- Date:
- Tue Aug 11 08:46:16 2015 +0000
- Revision:
- 0:877c5ece70ac
presentation version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Dannis_mbed | 0:877c5ece70ac | 1 | #ifndef EXTUI_H_INCLUDED |
Dannis_mbed | 0:877c5ece70ac | 2 | #define EXTUI_H_INCLUDED |
Dannis_mbed | 0:877c5ece70ac | 3 | |
Dannis_mbed | 0:877c5ece70ac | 4 | #include "mbed.h" |
Dannis_mbed | 0:877c5ece70ac | 5 | |
Dannis_mbed | 0:877c5ece70ac | 6 | //Solar on Foils display screens |
Dannis_mbed | 0:877c5ece70ac | 7 | enum BUTTON_t |
Dannis_mbed | 0:877c5ece70ac | 8 | { |
Dannis_mbed | 0:877c5ece70ac | 9 | _EMERG_LANDING = 0, // Initialize screen |
Dannis_mbed | 0:877c5ece70ac | 10 | _STANDBY, // Standby screen |
Dannis_mbed | 0:877c5ece70ac | 11 | _ACTIVE // Active screen |
Dannis_mbed | 0:877c5ece70ac | 12 | }; |
Dannis_mbed | 0:877c5ece70ac | 13 | |
Dannis_mbed | 0:877c5ece70ac | 14 | // SOF LUT |
Dannis_mbed | 0:877c5ece70ac | 15 | const uint32_t cuLut[6] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F}; |
Dannis_mbed | 0:877c5ece70ac | 16 | |
Dannis_mbed | 0:877c5ece70ac | 17 | class ExtUI |
Dannis_mbed | 0:877c5ece70ac | 18 | { |
Dannis_mbed | 0:877c5ece70ac | 19 | private: |
Dannis_mbed | 0:877c5ece70ac | 20 | // Resource |
Dannis_mbed | 0:877c5ece70ac | 21 | BusOut heightLeds; |
Dannis_mbed | 0:877c5ece70ac | 22 | |
Dannis_mbed | 0:877c5ece70ac | 23 | PwmOut Red; |
Dannis_mbed | 0:877c5ece70ac | 24 | PwmOut Green; |
Dannis_mbed | 0:877c5ece70ac | 25 | PwmOut Blue; |
Dannis_mbed | 0:877c5ece70ac | 26 | |
Dannis_mbed | 0:877c5ece70ac | 27 | // variable |
Dannis_mbed | 0:877c5ece70ac | 28 | BUTTON_t buttonStatus; |
Dannis_mbed | 0:877c5ece70ac | 29 | |
Dannis_mbed | 0:877c5ece70ac | 30 | int iHeight; |
Dannis_mbed | 0:877c5ece70ac | 31 | uint32_t uiCounter; |
Dannis_mbed | 0:877c5ece70ac | 32 | uint32_t uiTargetHeight; |
Dannis_mbed | 0:877c5ece70ac | 33 | |
Dannis_mbed | 0:877c5ece70ac | 34 | char cMessage; |
Dannis_mbed | 0:877c5ece70ac | 35 | |
Dannis_mbed | 0:877c5ece70ac | 36 | bool bError; |
Dannis_mbed | 0:877c5ece70ac | 37 | |
Dannis_mbed | 0:877c5ece70ac | 38 | public: |
Dannis_mbed | 0:877c5ece70ac | 39 | // Constructor |
Dannis_mbed | 0:877c5ece70ac | 40 | ExtUI(); |
Dannis_mbed | 0:877c5ece70ac | 41 | // Destructor |
Dannis_mbed | 0:877c5ece70ac | 42 | ~ExtUI(); |
Dannis_mbed | 0:877c5ece70ac | 43 | |
Dannis_mbed | 0:877c5ece70ac | 44 | // Gets |
Dannis_mbed | 0:877c5ece70ac | 45 | uint32_t getTargetHeight(void); |
Dannis_mbed | 0:877c5ece70ac | 46 | |
Dannis_mbed | 0:877c5ece70ac | 47 | // Sets |
Dannis_mbed | 0:877c5ece70ac | 48 | int setTargetHeight(uint32_t); |
Dannis_mbed | 0:877c5ece70ac | 49 | |
Dannis_mbed | 0:877c5ece70ac | 50 | // Other functions |
Dannis_mbed | 0:877c5ece70ac | 51 | void init(void); |
Dannis_mbed | 0:877c5ece70ac | 52 | void heightIncrease(void); |
Dannis_mbed | 0:877c5ece70ac | 53 | void heightDecrease(void); |
Dannis_mbed | 0:877c5ece70ac | 54 | void vUpdatextUI(void); |
Dannis_mbed | 0:877c5ece70ac | 55 | |
Dannis_mbed | 0:877c5ece70ac | 56 | }; |
Dannis_mbed | 0:877c5ece70ac | 57 | #endif |