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

app/SI1143Config.h

Committer:
mitea1
Date:
2016-07-06
Revision:
0:f2815503561f

File content as of revision 0:f2815503561f:

/**
 * @file SI1143Config.h
 *
 * @author Adrian
 * @date 02.06.2016
 *
 */
#include <stdint.h>

#ifndef APP_SI1143CONFIG_H_
#define APP_SI1143CONFIG_H_

#define SI1143_LED_VOLTAGE_50_MV	0b0001
#define SI1143_LED_VOLTAGE_115_MV	0b0101
#define SI1143_LED_VOLTAGE_185_MV	0b0111
#define SI1143_LED_VOLTAGE_290_MV	0b1010
#define SI1143_LED_VOLTAGE_410_MV	0b1111

#define SI1143_PS1_IRQ_EN_MASK		0x02
#define SI1143_THRESHOLD_1000		0x3E8

/**
 * SI1143 Modes. Modes define sensor functionality
 */
enum SI1143_MODE{
	SI1143_MODE_1,//!< SI1143_MODE_1
	SI1143_MODE_2,//!< SI1143_MODE_2
	SI1143_MODE_3,//!< SI1143_MODE_3
	SI1143_MODE_4 //!< SI1143_MODE_4
};

/**
 * @class SI1143Config
 * @brief A configuration container for the SI1143 Sensor.
 * All its configuration values are stored an held inside
 * this Class. Depending on the SI1143_MODE it sets all the configuration values.
 */
class SI1143Config {
public:
	SI1143Config();
	virtual ~SI1143Config();

	/**
	 * @brief Generates a configuration and sets its value according to the
	 * chosen SI1143_MODE
	 * @param desiredMode the mode to build the configuration according to
	 */
	void build(SI1143_MODE desiredMode);


	/**
	 * @brief Gets the voltage of Led1 from the actual configuration
	 * @return led 1 voltage register value
	 */
	uint8_t getLed1Voltage();

	/**
	 * @brief Gets the interrupt enable from the actual configuration
	 * @return interrupt enable register value
	 */
	uint8_t getInterruptEnable();

	/**
	 * @brief Gets the proximity sensing threshold for led 1
	 * @return proximity sensing threshold for led 1 register value
	 */
	uint8_t getProximitySensing1Threshold();

private:
	uint8_t led1Voltage;
	uint8_t interruptEnable;
	uint16_t proximitySensing1Threshold;


	/**
	 * @brief Sets the register value for the led 1 voltage of the actual configuration
	 * @param ledVoltag register value of the led1 voltage
	 */
	void setLed1Voltage(uint8_t ledVoltage);

	/**
	 * @brief Sets the interrupt enable register value of the actual configuration
	 * @param interruptEnable register value of interrupt enable
	 */
	void setInterruptEnable(uint8_t interruptEnable);

	/**
	 * @brief Sets the proximity sensing threshold register value of the actual configuration
	 * @param thershold register value of the proximity sensing threshold
	 */
	void setProximitySensing1Threshold(uint16_t thershold);
};

#endif /* APP_SI1143CONFIG_H_ */