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: mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed
ApplicationConfig.h
00001 /* 00002 * ApplicationConfig.h 00003 * 00004 * Created on: Jun 3, 2016 00005 * Author: Adrian 00006 */ 00007 #include "BME280Config.h " 00008 #include "MPU9250Config.h " 00009 #include "uBloxConfig.h " 00010 #include "MAX44009Config.h " 00011 #include "SI1143Config.h " 00012 #include "main.h" 00013 00014 #include "LoRaConfig.h " 00015 #ifndef APPLICATIONCONFIG_H_ 00016 #define APPLICATIONCONFIG_H_ 00017 00018 /** 00019 * Application Modes. Modes define different Usages of the LoRa sensor node 00020 */ 00021 enum APPLICATION_MODE { 00022 APPLICATION_MODE_1, //!< APPLICATION_MODE_1 00023 APPLICATION_MODE_2, //!< APPLICATION_MODE_2 00024 APPLICATION_MODE_3, //!< APPLICATION_MODE_3 00025 APPLICATION_MODE_4, //!< APPLICATION_MODE_4 00026 APPLICATION_MODE_5, //!< APPLICATION_MODE_5 00027 APPLICATION_MODE_6, //!< APPLICATION_MODE_6 00028 APPLICATION_MODE_7, //!< APPLICATION_MODE_7 00029 APPLICATION_MODE_8, //!< APPLICATION_MODE_8 00030 APPLICATION_MODE_9, //!< APPLICATION_MODE_9 00031 APPLICATION_MODE_10, //!< APPLICATION_MODE_10 00032 APPLICATION_MODE_11, //!< APPLICATION_MODE_11 00033 APPLICATION_MODE_99, //!< APPLICATION_MODE_99 00034 APPLICATION_MODE_TEST, //!< APPLICATION_MODE_TEST 00035 APPLICATION_MODE_TEST_MAX44009, //!< APPLICATION_MODE_TEST_MAX44009 00036 APPLICATION_MODE_TEST_BME280, //!< APPLICATION_MODE_TEST_BME280 00037 APPLICATION_MODE_TEST_MPU9250, //!< APPLICATION_MODE_TEST_MPU9250 00038 APPLICATION_MODE_TEST_SI1143, //!< APPLICATION_MODE_TEST_SI1143 00039 APPLICATION_MODE_TEST_uBlox, //!< APPLICATION_MODE_TEST_uBlox 00040 APPLICATION_MODE_LORA_MEASUREMENT,//!< APPLICATION_MODE_LORA_MEASUREMENT 00041 WEATHER_MEASUREMENT, //!< WEATHER_STATION 00042 ORIENTATATION_MEASUREMENT, //!< ORIENTATATION_SENSOR 00043 DISTANCE_MEASUREMENT, //!< DISTANCE_SENSOR 00044 }; 00045 00046 00047 class ApplicationConfig { 00048 public: 00049 ApplicationConfig(); 00050 virtual ~ApplicationConfig(); 00051 00052 /** 00053 * @brief Generates a configuration according to the chosen APPLICATION_MODE 00054 * @param desiredMode the mode to build the configuration according to 00055 */ 00056 void build(APPLICATION_MODE desiredMode); 00057 00058 00059 /** 00060 * @brief Get Information about the MAX44009_MODE of the actual ApplicationConfig 00061 * @return the actual MAX44009_MODE 00062 */ 00063 MAX44009_MODE getMAX44009_MODE(); 00064 00065 /** 00066 * @brief Get Information about the BME280_MODE of the actual ApplicationConfig 00067 * @return the actual BME280_MODE 00068 */ 00069 BME280_MODE getBME280_MODE(); 00070 00071 /** 00072 * @brief Get Information about the MPU9250_MODE of the actual ApplicationConfig 00073 * @return the actual MPU9250_MODE 00074 */ 00075 MPU9250_MODE getMPU9250_MODE(); 00076 00077 /** 00078 * @brief Get Information about the SI1143_MODE of the actual ApplicationConfig 00079 * @return the actual SI1143_MODE 00080 */ 00081 SI1143_MODE getSI1143_MODE(); 00082 00083 /** 00084 * @brief Get Information about the uBLOX_MODE of the actual ApplicationConfig 00085 * @return the actual uBLOX_MODE 00086 */ 00087 uBLOX_MODE getuBlox_MODE(); 00088 00089 /** 00090 * @brief Get Information about the LORA_MODE of the actual ApplicationConfig 00091 * @return the actual LORA_MODE 00092 */ 00093 LORA_MODE getLORA_MODE(); 00094 00095 00096 /** 00097 * @brief Get Information about the TASK_STATE of the TaskLight in the actual ApplicationConfig 00098 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskLight 00099 */ 00100 TASK_STATE getStateTaskLight(); 00101 00102 /** 00103 * @brief Get Information about the TASK_STATE of the TaskTemperature in the actual ApplicationConfig 00104 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskTemperature 00105 */ 00106 TASK_STATE getStateTaskTemperature(); 00107 00108 /** 00109 * @brief Get Information about the TASK_STATE of the TaskPressure in the actual ApplicationConfig 00110 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskPressure 00111 */ 00112 TASK_STATE getStateTaskPressure(); 00113 00114 /** 00115 * @brief Get Information about the TASK_STATE of the TaskHumidity in the actual ApplicationConfig 00116 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskHumidity 00117 */ 00118 TASK_STATE getStateTaskHumidity(); 00119 00120 /** 00121 * @brief Get Information about the TASK_STATE of the TaskAcceleration in the actual ApplicationConfig 00122 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskAcceleration 00123 */ 00124 TASK_STATE getStateTaskAcceleration(); 00125 00126 /** 00127 * @brief Get Information about the TASK_STATE of the TaskGyroscope in the actual ApplicationConfig 00128 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskGyroscope 00129 */ 00130 TASK_STATE getStateTaskGyroscope(); 00131 00132 /** 00133 * @brief Get Information about the TASK_STATE of the TaskTesla in the actual ApplicationConfig 00134 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskTesla 00135 */ 00136 TASK_STATE getStateTaskTesla(); 00137 00138 /** 00139 * @brief Get Information about the TASK_STATE of the TaskProximity in the actual ApplicationConfig 00140 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskProximity 00141 */ 00142 TASK_STATE getStateTaskProximity(); 00143 00144 /** 00145 * @brief Get Information about the TASK_STATE of the TaskGPS in the actual ApplicationConfig 00146 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskGPS 00147 */ 00148 TASK_STATE getStateTaskGPS(); 00149 00150 /** 00151 * @brief Get Information about the TASK_STATE of the TaskFlowMeter in the actual ApplicationConfig 00152 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskFlowMeter 00153 */ 00154 TASK_STATE getStateTaskFlowMeter(); 00155 00156 /** 00157 * @brief Get Information about the TASK_STATE of the TaskLoRaMeasurement in the actual ApplicationConfig 00158 * @return the actual TASK_STATE (RUNNING,SLEEPING) of TaskLoRaMeasurement 00159 */ 00160 TASK_STATE getStateTaskLoRaMeasurement(); 00161 00162 /** 00163 * @brief Get Information about the LORA_STATE of the LoRa Module in the actual ApplicationConfig 00164 * @return the actual LORA_STATE (ON,OFF) of TaskLoRaMeasurement 00165 */ 00166 LORA_STATE getStateLoRa(); 00167 00168 private: 00169 MAX44009_MODE max44009Mode; 00170 BME280_MODE bme280Mode; 00171 MPU9250_MODE mpu9250Mode; 00172 SI1143_MODE si1143Mode; 00173 uBLOX_MODE ubloxMode; 00174 LORA_MODE loraMode; 00175 //todo add Flowmeter Mode 00176 00177 TASK_STATE stateTaskLight; 00178 TASK_STATE stateTaskTemperature; 00179 TASK_STATE stateTaskPressure; 00180 TASK_STATE stateTaskHumidity; 00181 TASK_STATE stateTaskAcceleration; 00182 TASK_STATE stateTaskGyroscope; 00183 TASK_STATE stateTaskTesla; 00184 TASK_STATE stateTaskProximity; 00185 TASK_STATE stateTaskGPS; 00186 TASK_STATE stateTaskFlowMeter; 00187 TASK_STATE stateTaskLoraMeasurement; 00188 00189 LORA_STATE stateLoRa; 00190 00191 /** 00192 * @brief Sets the MAX44009_MODE for that the MAX44009 Sensor has to be initialized for the actual ApplicationConfig 00193 * @param the diseredMode 00194 */ 00195 void setMAX44009_MODE(MAX44009_MODE desiredMode); 00196 00197 /** 00198 * @brief Sets the BME280_MODE for that the BME280 Sensor has to be initialized for the actual ApplicationConfig 00199 * @param the diseredMode 00200 */ 00201 void setBME280_MODE(BME280_MODE desiredMode); 00202 00203 /** 00204 * @brief Sets the MPU9250_MODE for that the MPU9250 Sensor has to be initialized for the actual ApplicationConfig 00205 * @param the diseredMode 00206 */ 00207 void setMPU9250_MODE(MPU9250_MODE desiredMode); 00208 00209 /** 00210 * @brief Sets the SI1143_MODE for that the SI1143 Sensor has to be initialized for the actual ApplicationConfig 00211 * @param the diseredMode 00212 */ 00213 void setSI1143_MODE(SI1143_MODE desiredMode); 00214 00215 /** 00216 * @brief Sets the uBLOX_MODE for that the uBlox Sensor has to be initialized for the actual ApplicationConfig 00217 * @param the diseredMode 00218 */ 00219 void setuBlox_MODE(uBLOX_MODE desiredMode); 00220 00221 //todo add setFlowMeterMode 00222 00223 /** 00224 * @brief Sets the LORA_MODE for that the LORA device has to be initialized for the actual ApplicationConfig 00225 * @param the diseredMode 00226 */ 00227 void setLORA_MODE(LORA_MODE desiredMode); 00228 00229 00230 /** 00231 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskLight for the actual ApplicationConfig 00232 * @param the desired State 00233 */ 00234 void setStateTaskLight(TASK_STATE desiredState); 00235 00236 /** 00237 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskTemperature for the actual ApplicationConfig 00238 * @param the desired State 00239 */ 00240 void setStateTaskTemperature(TASK_STATE desiredState); 00241 00242 /** 00243 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskPressure for the actual ApplicationConfig 00244 * @param the desired State 00245 */ 00246 void setStateTaskPressure(TASK_STATE desiredState); 00247 00248 /** 00249 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskHumidity for the actual ApplicationConfig 00250 * @param the desired State 00251 */ 00252 void setStateTaskHumidity(TASK_STATE desiredState); 00253 00254 /** 00255 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskAcceleration for the actual ApplicationConfig 00256 * @param the desired State 00257 */ 00258 void setStateTaskAcceleration(TASK_STATE desiredState); 00259 00260 /** 00261 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskGyroscope for the actual ApplicationConfig 00262 * @param the desired State 00263 */ 00264 void setStateTaskGyroscope(TASK_STATE desiredState); 00265 00266 /** 00267 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskTesla for the actual ApplicationConfig 00268 * @param the desired State 00269 */ 00270 void setStateTaskTesla(TASK_STATE desiredState); 00271 00272 /** 00273 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskProximity for the actual ApplicationConfig 00274 * @param the desired State 00275 */ 00276 void setStateTaskProximity(TASK_STATE desiredState); 00277 00278 /** 00279 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskGPS for the actual ApplicationConfig 00280 * @param the desired State 00281 */ 00282 void setStateTaskGPS(TASK_STATE desiredState); 00283 00284 /** 00285 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskFlowMeter for the actual ApplicationConfig 00286 * @param the desired State 00287 */ 00288 void setStateTaskFlowMeter(TASK_STATE desiredState); 00289 00290 /** 00291 * @brief Sets the TASK_STATE (RUNNING,SLEEPING) of TaskLoRaMeasurement for the actual ApplicationConfig 00292 * @param the desired State 00293 */ 00294 void setStateTaskLoRaMeasurement(TASK_STATE desiredState); 00295 /** 00296 * @brief Sets the LORA_STATE (ON,OFF) of LoRa Device for the actual ApplicationConfig 00297 * @param the desired State 00298 */ 00299 void setStateLoRa(LORA_STATE); 00300 00301 }; 00302 00303 #endif /* APPLICATIONCONFIG_H_ */
Generated on Tue Jul 12 2022 21:35:26 by
1.7.2