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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TaskGyroscope.h Source File

TaskGyroscope.h

Go to the documentation of this file.
00001 /**
00002  * @file TaskGyroscope.h
00003  *
00004  * @author Adrian
00005  * @date 30.05.2016
00006  *
00007  */
00008 
00009 #include "MPU9250.h "
00010 #include "MPU9250GyroscopeMessage.h "
00011 #include "main.h"
00012 #include "Task.h"
00013 
00014 #ifndef TASKGYROSCOPE_H_
00015 #define TASKGYROSCOPE_H_
00016 
00017 /**
00018  * @class TaskGyroscope
00019  * @brief This TaskGyroscope Class handles the gyroscope 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 TaskGyroscope : public Task {
00025 public:
00026     TaskGyroscope(MPU9250*,Mutex*, Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>*);
00027     TaskGyroscope(MPU9250*,Mutex*,Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>*,
00028             osPriority, uint32_t, unsigned char*);
00029     virtual ~TaskGyroscope();
00030 
00031 private:
00032 
00033     rtos::Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>* queue;
00034 
00035     MPU9250* mpu9250;
00036 
00037     /**
00038      * @brief A thread safe method that acquires data from the gyroscope. After acquiring data from the
00039      * it stores the data inside a MPU9250GyroscopeMessage
00040      */
00041     void measure();
00042 
00043     /**
00044      * @brief Sets the message Queue of the Task where the measured values will be stored
00045      * after the measurement
00046      * @param queueGyro the queue where the MPU9250GyroscopeMessage will be stored
00047      */
00048     void setQueue(Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>* queueGyro);
00049 
00050 };
00051 
00052 #endif /* TASKGYROSCOPE_H_ */