Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DmTftLibrary eeprom SX1280Lib filesystem mbed
Fork of MSNV2-Terminal_V1-5 by
Application.h@8:cd489b7c49a0, 2018-08-22 (annotated)
- Committer:
- FCH_31
- Date:
- Wed Aug 22 13:03:00 2018 +0000
- Revision:
- 8:cd489b7c49a0
- Child:
- 10:1b37e3b41947
1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| FCH_31 | 8:cd489b7c49a0 | 1 | /* |
| FCH_31 | 8:cd489b7c49a0 | 2 | * Application.h |
| FCH_31 | 8:cd489b7c49a0 | 3 | * |
| FCH_31 | 8:cd489b7c49a0 | 4 | * Created on: Jun 3, 2016 |
| FCH_31 | 8:cd489b7c49a0 | 5 | * Author: Adrian |
| FCH_31 | 8:cd489b7c49a0 | 6 | */ |
| FCH_31 | 8:cd489b7c49a0 | 7 | |
| FCH_31 | 8:cd489b7c49a0 | 8 | |
| FCH_31 | 8:cd489b7c49a0 | 9 | #include "mbed.h" |
| FCH_31 | 8:cd489b7c49a0 | 10 | #include "main.h" |
| FCH_31 | 8:cd489b7c49a0 | 11 | #include "Messages.h" |
| FCH_31 | 8:cd489b7c49a0 | 12 | #include "Tftlcd.h" |
| FCH_31 | 8:cd489b7c49a0 | 13 | #include "sx1280-hal.h" |
| FCH_31 | 8:cd489b7c49a0 | 14 | #include "DataBase.h" |
| FCH_31 | 8:cd489b7c49a0 | 15 | |
| FCH_31 | 8:cd489b7c49a0 | 16 | // All Sensors/Actuator header here |
| FCH_31 | 8:cd489b7c49a0 | 17 | #include "Sensor.h" |
| FCH_31 | 8:cd489b7c49a0 | 18 | #include "Actuator.h" |
| FCH_31 | 8:cd489b7c49a0 | 19 | |
| FCH_31 | 8:cd489b7c49a0 | 20 | |
| FCH_31 | 8:cd489b7c49a0 | 21 | #ifndef __APPLICATION_H__ |
| FCH_31 | 8:cd489b7c49a0 | 22 | #define __APPLICATION_H__ |
| FCH_31 | 8:cd489b7c49a0 | 23 | |
| FCH_31 | 8:cd489b7c49a0 | 24 | |
| FCH_31 | 8:cd489b7c49a0 | 25 | using namespace std; |
| FCH_31 | 8:cd489b7c49a0 | 26 | |
| FCH_31 | 8:cd489b7c49a0 | 27 | |
| FCH_31 | 8:cd489b7c49a0 | 28 | class Application { |
| FCH_31 | 8:cd489b7c49a0 | 29 | public: |
| FCH_31 | 8:cd489b7c49a0 | 30 | Application (); |
| FCH_31 | 8:cd489b7c49a0 | 31 | ~Application (); |
| FCH_31 | 8:cd489b7c49a0 | 32 | |
| FCH_31 | 8:cd489b7c49a0 | 33 | // @brief Get timer of scheduling mode |
| FCH_31 | 8:cd489b7c49a0 | 34 | void getScheduling (uint16_t &TimerPayload, uint16_t &TimerGoodhealth, uint16_t &TimerSynchro, uint16_t &TimerListening ); |
| FCH_31 | 8:cd489b7c49a0 | 35 | |
| FCH_31 | 8:cd489b7c49a0 | 36 | void start (); // @brief Start the Application |
| FCH_31 | 8:cd489b7c49a0 | 37 | void readSensors (); // @brief Read Sensor(s) |
| FCH_31 | 8:cd489b7c49a0 | 38 | void writeActuators (); // @brief Write Actuator(s) |
| FCH_31 | 8:cd489b7c49a0 | 39 | void buildMessageSensors (); // @brief Build Message Sensors |
| FCH_31 | 8:cd489b7c49a0 | 40 | void buildMessageGoodhealth (); // @brief Build Message Goodhealt |
| FCH_31 | 8:cd489b7c49a0 | 41 | void buildMessageSynchro (); // @brief Build Message Goodhealt |
| FCH_31 | 8:cd489b7c49a0 | 42 | void sendMessage (); // @brief Send Message |
| FCH_31 | 8:cd489b7c49a0 | 43 | |
| FCH_31 | 8:cd489b7c49a0 | 44 | |
| FCH_31 | 8:cd489b7c49a0 | 45 | |
| FCH_31 | 8:cd489b7c49a0 | 46 | private: |
| FCH_31 | 8:cd489b7c49a0 | 47 | RawSerial * debugSerial ; // Serial Instance |
| FCH_31 | 8:cd489b7c49a0 | 48 | //DataBase dataBase ; // Database Instance |
| FCH_31 | 8:cd489b7c49a0 | 49 | Tftlcd * display ; // Display TFT access |
| FCH_31 | 8:cd489b7c49a0 | 50 | //Messages messages ; // Messages Maker (Sensors, Config, Synchro ...) |
| FCH_31 | 8:cd489b7c49a0 | 51 | Sensor * sensor ; |
| FCH_31 | 8:cd489b7c49a0 | 52 | |
| FCH_31 | 8:cd489b7c49a0 | 53 | // BME280* bme280; Examples |
| FCH_31 | 8:cd489b7c49a0 | 54 | |
| FCH_31 | 8:cd489b7c49a0 | 55 | void initInterfaces (); // @brief Initializes all Interfaces such as I2C, UART and a Debug Serial via USB |
| FCH_31 | 8:cd489b7c49a0 | 56 | void readMemory (); // @brief Read memory to know the list of sensor availables Initializes the Database |
| FCH_31 | 8:cd489b7c49a0 | 57 | void initSensors (); // @brief Initializes (builds) all Sensors in their specific modes |
| FCH_31 | 8:cd489b7c49a0 | 58 | void initActuators (); // @brief Initializes (builds) all Actuator in their specific modes |
| FCH_31 | 8:cd489b7c49a0 | 59 | |
| FCH_31 | 8:cd489b7c49a0 | 60 | void readSensor (); // @brief Request the sensors according to they SensorMode specific parameter |
| FCH_31 | 8:cd489b7c49a0 | 61 | void writeActuator (); // @brief Request the Actuators according to they ActuatorrMode specific parameters |
| FCH_31 | 8:cd489b7c49a0 | 62 | |
| FCH_31 | 8:cd489b7c49a0 | 63 | void buildMessageConfig (); // @brief Build Message config |
| FCH_31 | 8:cd489b7c49a0 | 64 | |
| FCH_31 | 8:cd489b7c49a0 | 65 | void updateDisplay ( uint32_t freq, RadioLoRaBandwidths_t bw, RadioLoRaSpreadingFactors_t sf, |
| FCH_31 | 8:cd489b7c49a0 | 66 | int8_t pwr , uint8_t bsz, int16_t time ) ; // @brief Update Display |
| FCH_31 | 8:cd489b7c49a0 | 67 | }; |
| FCH_31 | 8:cd489b7c49a0 | 68 | |
| FCH_31 | 8:cd489b7c49a0 | 69 | #endif /* APPLICATION_H_ */ |
