Adrian Mitevski / Mbed 2 deprecated mDot_LoRa_Sensornode

Dependencies:   mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TaskTesla.h Source File

TaskTesla.h

Go to the documentation of this file.
00001 /**
00002  * @file TaskTesla.h
00003  *
00004  * @author Adrian
00005  * @date 01.06.2016
00006  *
00007  */
00008 
00009 #include "MPU9250.h "
00010 #include "MPU9250TeslaMessage.h "
00011 #include "main.h"
00012 #include "Task.h"
00013 
00014 #ifndef APP_TASKTESLA_H_
00015 #define APP_TASKTESLA_H_
00016 
00017 /**
00018  * @class TaskTesla
00019  * @brief This TaskTesla Class handles the tesla measurement using the MPU9250.
00020  * Starting the task using the start() starts the measurement of all axis.
00021  * It can be used alongside with other measurement Tasks inside the mbed::rtos
00022  * environment. The Task Class basically wraps mbeds Thread functionality.
00023  */
00024 class TaskTesla : public Task {
00025 public:
00026     TaskTesla(MPU9250*,Mutex*, Queue<MPU9250TeslaMessage,TESLA_QUEUE_LENGHT>*);
00027     TaskTesla(MPU9250*,Mutex*,Queue<MPU9250TeslaMessage,TESLA_QUEUE_LENGHT>*,
00028             osPriority, uint32_t, unsigned char*);
00029     virtual ~TaskTesla();
00030 
00031 private:
00032     rtos::Queue<MPU9250TeslaMessage,TESLA_QUEUE_LENGHT>* queue;
00033 
00034     MPU9250* mpu9250;
00035 
00036     /**
00037      * @brief A thread safe method that measures Teslas of each axis. After the measurement
00038      * it stores the data inside a MPU9250TelsaMessage
00039      */
00040     void measure();
00041 
00042     /**
00043      * @brief Sets the message Queue of the Task where the measured values will be stored
00044      * after the measurement
00045      * @param queueTesla the queue where the MPU9250TeslaMessage will be stored
00046      */
00047     void setQueue(Queue<MPU9250TeslaMessage,TESLA_QUEUE_LENGHT>*queueTesla);
00048 };
00049 
00050 #endif /* APP_TASKTESLA_H_ */