A multifunctional and modular Firmware for Multitech's mDot based on ARM mBed provides a widerange of functionality for several Sensors such as MAX44009, BME280, MPU9250, SI1143 and uBlox. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.

Dependencies:   mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed

LoRa-Sensornode Firmware for Multitech mDot

A multifunctional and modular Firmware for Multitech's mDot which provides a widerange of functionality for several Sensors. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.

/media/uploads/mitea1/logo-lora-600x370.png /media/uploads/mitea1/mt_mdot_family_642px.png

Supported Sensors

Idea

The Firmware has some predefined Application Modes running different Tasks(Measurements). Each mode can be used in a different Scenario. Application_Modes define which sensors are used, how often they aquire data and how often the data has to be sent via LoRa. Lets say you just want to measure the Light then you choose an Application_Mode (or define one) that only runs TaskLight for light measurement. As a standard all measurements are taken every second and sent via LoRa but you can change that interval depending on your usage Scenario

Committer:
mitea1
Date:
Fri Nov 02 17:01:02 2018 +0000
Revision:
10:4051c38bf73f
Parent:
0:f2815503561f
wtf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /**
mitea1 0:f2815503561f 2 * @file BME280Config.h
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * @author Adrian
mitea1 0:f2815503561f 5 * @date 24.05.2016
mitea1 0:f2815503561f 6 *
mitea1 0:f2815503561f 7 */
mitea1 0:f2815503561f 8 #include <stdint.h>
mitea1 0:f2815503561f 9
mitea1 0:f2815503561f 10 #ifndef APP_BME280CONFIG_H_
mitea1 0:f2815503561f 11 #define APP_BME280CONFIG_H_
mitea1 0:f2815503561f 12
mitea1 0:f2815503561f 13 // CTRL_HUM Humidity over sampling Settings
mitea1 0:f2815503561f 14 #define BME280_HUM_SKPPD 0b000
mitea1 0:f2815503561f 15 #define BME280_HUM_OVRS_1 0b001
mitea1 0:f2815503561f 16 #define BME280_HUM_OVRS_2 0b010
mitea1 0:f2815503561f 17 #define BME280_HUM_OVRS_4 0b011
mitea1 0:f2815503561f 18 #define BME280_HUM_OVRS_8 0b100
mitea1 0:f2815503561f 19 #define BME280_HUM_OVRS_16 0b101
mitea1 0:f2815503561f 20
mitea1 0:f2815503561f 21 // CTRL_HUM Pressure over sampling Settings
mitea1 0:f2815503561f 22 #define BME280_PRESS_SKPPD 0b000
mitea1 0:f2815503561f 23 #define BME280_PRESS_OVRS_1 0b001
mitea1 0:f2815503561f 24 #define BME280_PRESS_OVRS_2 0b010
mitea1 0:f2815503561f 25 #define BME280_PRESS_OVRS_4 0b011
mitea1 0:f2815503561f 26 #define BME280_PRESS_OVRS_8 0b100
mitea1 0:f2815503561f 27 #define BME280_PRESS_OVRS_16 0b101
mitea1 0:f2815503561f 28
mitea1 0:f2815503561f 29 // CTRL_HUM Temperature over sampling Settings
mitea1 0:f2815503561f 30 #define BME280_TEMP_SKPPD 0b000
mitea1 0:f2815503561f 31 #define BME280_TEMP_OVRS_1 0b001
mitea1 0:f2815503561f 32 #define BME280_TEMP_OVRS_2 0b010
mitea1 0:f2815503561f 33 #define BME280_TEMP_OVRS_4 0b011
mitea1 0:f2815503561f 34 #define BME280_TEMP_OVRS_8 0b100
mitea1 0:f2815503561f 35 #define BME280_TEMP_OVRS_16 0b101
mitea1 0:f2815503561f 36
mitea1 0:f2815503561f 37 // CTRL_MEAS Settings Modes
mitea1 0:f2815503561f 38 #define BME280_SLEEP_MODE 0b00 /**< Sleep mode */
mitea1 0:f2815503561f 39 #define BME280_FORCED_MODE 0b01 /**< Forced mode */
mitea1 0:f2815503561f 40 #define BME280_NORMAL_MODE 0b11 /**< Normal mode */
mitea1 0:f2815503561f 41
mitea1 0:f2815503561f 42 //Oversampling Settings
mitea1 0:f2815503561f 43 #define BME280_WHEAT_OVRS_T_P (BME280_TEMP_OVRS_1<<5)|(BME280_PRESS_OVRS_1<<2)|BME280_NORMAL_MODE
mitea1 0:f2815503561f 44 #define BME280_WHEAT_OVRS_H BME280_HUM_OVRS_1
mitea1 0:f2815503561f 45
mitea1 0:f2815503561f 46
mitea1 0:f2815503561f 47 /**
mitea1 0:f2815503561f 48 * BME280 Modes. Modes define sensor functionality
mitea1 0:f2815503561f 49 */
mitea1 0:f2815503561f 50 enum BME280_MODE{
mitea1 0:f2815503561f 51 BME280_MODE_0,//!< BME280_MODE_0
mitea1 0:f2815503561f 52 BME280_MODE_1,//!< BME280_MODE_1
mitea1 0:f2815503561f 53 BME280_MODE_2,//!< BME280_MODE_2
mitea1 0:f2815503561f 54 BME280_MODE_3,//!< BME280_MODE_3
mitea1 0:f2815503561f 55 BME280_MODE_4,//!< BME280_MODE_4
mitea1 0:f2815503561f 56 BME280_MODE_5,//!< BME280_MODE_5
mitea1 0:f2815503561f 57 BME280_MODE_6,//!< BME280_MODE_6
mitea1 0:f2815503561f 58 BME280_MODE_7,//!< BME280_MODE_7
mitea1 0:f2815503561f 59 BME280_MODE_8,//!< BME280_MODE_8
mitea1 0:f2815503561f 60 BME280_MODE_9,//!< BME280_MODE_9
mitea1 0:f2815503561f 61 };
mitea1 0:f2815503561f 62
mitea1 0:f2815503561f 63 /**
mitea1 0:f2815503561f 64 * @class BME280Config
mitea1 0:f2815503561f 65 * @brief A configuration container for the BME280 Sensor.
mitea1 0:f2815503561f 66 * All its configuration values are stored an held inside
mitea1 0:f2815503561f 67 * this Class. Depending on the BME280_MODE it sets all the configuration values.
mitea1 0:f2815503561f 68 */
mitea1 0:f2815503561f 69 class BME280Config {
mitea1 0:f2815503561f 70 public:
mitea1 0:f2815503561f 71 BME280Config();
mitea1 0:f2815503561f 72 virtual ~BME280Config();
mitea1 0:f2815503561f 73
mitea1 0:f2815503561f 74 /**
mitea1 0:f2815503561f 75 * @brief Generates a configuration according to the chosen BME280_MODE
mitea1 0:f2815503561f 76 * @param desiredMode the mode to build the configuration according to
mitea1 0:f2815503561f 77 */
mitea1 0:f2815503561f 78 void build(BME280_MODE);
mitea1 0:f2815503561f 79
mitea1 0:f2815503561f 80 /**
mitea1 0:f2815503561f 81 * Gets the temperature measurements oversampling value for the configuration and initialization of the BME280
mitea1 0:f2815503561f 82 * @return temperature oversampling register value
mitea1 0:f2815503561f 83 */
mitea1 0:f2815503561f 84 uint8_t getOversamplingTemperature();
mitea1 0:f2815503561f 85
mitea1 0:f2815503561f 86 /**
mitea1 0:f2815503561f 87 * Gets the pressure measurements oversampling value for the configuration and initialization of the BME280
mitea1 0:f2815503561f 88 * @return pressure oversampling register value
mitea1 0:f2815503561f 89 */
mitea1 0:f2815503561f 90 uint8_t getOversamplingPressure();
mitea1 0:f2815503561f 91
mitea1 0:f2815503561f 92 /**
mitea1 0:f2815503561f 93 * Gets the humidity measurements oversampling value for the configuration and initialization of the BME280
mitea1 0:f2815503561f 94 * @return humidity oversampling register value
mitea1 0:f2815503561f 95 */
mitea1 0:f2815503561f 96 uint8_t getOversamplingHumidity();
mitea1 0:f2815503561f 97
mitea1 0:f2815503561f 98 /**
mitea1 0:f2815503561f 99 * Gets the sensor internal Mode
mitea1 0:f2815503561f 100 * @return sensor internal Mode
mitea1 0:f2815503561f 101 */
mitea1 0:f2815503561f 102 uint8_t getMode();
mitea1 0:f2815503561f 103
mitea1 0:f2815503561f 104 private:
mitea1 0:f2815503561f 105 uint8_t oversamplingTemperature;
mitea1 0:f2815503561f 106 uint8_t oversamplingPressure;
mitea1 0:f2815503561f 107 uint8_t oversamplingHumidity;
mitea1 0:f2815503561f 108
mitea1 0:f2815503561f 109 uint8_t mode;
mitea1 0:f2815503561f 110
mitea1 0:f2815503561f 111
mitea1 0:f2815503561f 112 /**
mitea1 0:f2815503561f 113 * @brief Sets the oversampling Value for Temperature measurements
mitea1 0:f2815503561f 114 * @param oversamplingTemperature oversampling Value for Temperature measurements
mitea1 0:f2815503561f 115 */
mitea1 0:f2815503561f 116 void setOversamplingTemperature(uint8_t oversamplingTemperature);
mitea1 0:f2815503561f 117
mitea1 0:f2815503561f 118 /**
mitea1 0:f2815503561f 119 * @brief Sets the oversampling Value for Pressure measurements
mitea1 0:f2815503561f 120 * @param oversamplingPressure oversampling Value for Pressure measurements
mitea1 0:f2815503561f 121 */
mitea1 0:f2815503561f 122 void setOversamplingPressure(uint8_t oversamplingPressure);
mitea1 0:f2815503561f 123
mitea1 0:f2815503561f 124 /**
mitea1 0:f2815503561f 125 * @brief Sets the oversampling Value for Humidity measurements
mitea1 0:f2815503561f 126 * @param oversamplingHumidity oversampling Value for Humidity measurements
mitea1 0:f2815503561f 127 */
mitea1 0:f2815503561f 128 void setOversamplingHumidity(uint8_t oversamplingHumidity);
mitea1 0:f2815503561f 129
mitea1 0:f2815503561f 130 /**
mitea1 0:f2815503561f 131 * Set the internal mode of the BME280
mitea1 0:f2815503561f 132 * @param desiredMode the internal mode of the BME280
mitea1 0:f2815503561f 133 */
mitea1 0:f2815503561f 134 void setMode(uint8_t desiredMode);
mitea1 0:f2815503561f 135 };
mitea1 0:f2815503561f 136
mitea1 0:f2815503561f 137 #endif /* APP_BME280CONFIG_H_ */