Miroslaw K. / Mbed 2 deprecated RadarDemo

Dependencies:   BSP_DISCO_F746NG Graphics mbed TS_DISCO_F746NG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RadarTimer.h Source File

RadarTimer.h

00001 /*
00002     RadarTimer.h - Radar time subsystem simulator, inherits timer and implements beam angle calculation method.
00003 
00004     Copyright(c) 2016 karpent at gmail.com, MIT License
00005 
00006     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
00007     to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008     and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
00009 
00010     The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00011 
00012     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00013     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00014     OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00015     THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016 */ 
00017 
00018 
00019 #include "mbed.h"
00020 
00021 /**
00022   * @brief Radar time subsystem simulator, inherits timer and implements beam angle calculation method.
00023   */
00024 class RadarTimer : public Timer
00025 {
00026 public:
00027     RadarTimer();
00028 
00029     /**
00030       * @brief Sets scan period in seconds
00031       */    
00032     RadarTimer(uint32_t scanPeriod);
00033 
00034     /**
00035       * @brief Sets scan period in seconds
00036       */    
00037     void SetScanPeriod(uint32_t scanPeriod);
00038  
00039      /**
00040       * @brief Starts the timer
00041       */    
00042     void Start();
00043  
00044     void RegisterScan();
00045        
00046     /**
00047       * @brief Get current time in miliseconds
00048       */
00049     uint32_t GetRunningTime();
00050 
00051     /**
00052       * @brief Get current beam angle in radians
00053       */
00054     float GetBeamAngle();
00055     
00056 private:
00057     /// <summary>
00058     /// The radar scan period in milisecons.
00059     /// </summary>
00060     uint32_t _scanPeriod;
00061     
00062     uint32_t _lastScanTime;
00063     
00064     uint32_t _runningTime;
00065 };