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
TaskLight.h
00001 /** 00002 * @file TaskLight.h 00003 * 00004 * @author Adrian 00005 * @date 27.05.2016 00006 * 00007 */ 00008 00009 #include <Thread.h> 00010 #include <Queue.h> 00011 #include <Mutex.h> 00012 #include "MAX44009.h " 00013 #include "MAX44009Message.h " 00014 #include "main.h" 00015 #include "Task.h" 00016 00017 #ifndef TASKLIGHT_H_ 00018 #define TASKLIGHT_H_ 00019 00020 /** 00021 * @class TaskLight 00022 * @brief This TaskLight Class handles the light measurement using the MAX44009. 00023 * Starting the task using the start() starts the measurement. 00024 * It can be used alongside with other measurement Tasks inside the mbed::rtos 00025 * environment. The Task Class basically wraps mbeds Thread functionality. 00026 */ 00027 class TaskLight : public Task{ 00028 public: 00029 TaskLight(MAX44009*,Mutex*, Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>*); 00030 TaskLight(MAX44009*,Mutex*,Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>*, 00031 osPriority, uint32_t, unsigned char*); 00032 virtual ~TaskLight(); 00033 00034 private: 00035 rtos::Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>* queue; 00036 00037 MAX44009* max44009; 00038 00039 /** 00040 * @brief A thread safe method that measures the light. After measuring the light 00041 * it stores the value inside a MAX44009Message 00042 */ 00043 void measure(); 00044 00045 /** 00046 * @brief Sets the message Queue of the Task where the measured values will be stored 00047 * after the measurement 00048 * @param queueLight the queue where the MAX44009Message will be stored 00049 */ 00050 void setQueue(Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>* queueLight); 00051 00052 }; 00053 #endif /* TASKLIGHT_H_ */
Generated on Tue Jul 12 2022 21:35:27 by 1.7.2