Eddystone test using modified DAL

Dependencies:   BLE_API mbed-dev-bin nRF51822

Dependents:   microbit-eddystone

Fork of microbit-dal by Lancaster University

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TimedInterruptIn.h Source File

TimedInterruptIn.h

00001 /*
00002 The MIT License (MIT)
00003 
00004 Copyright (c) 2016 Lancaster University, UK.
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a
00007 copy of this software and associated documentation files (the "Software"),
00008 to deal in the Software without restriction, including without limitation
00009 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00010 and/or sell copies of the Software, and to permit persons to whom the
00011 Software is furnished to do so, subject to the following conditions:
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00019 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00020 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00021 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00022 DEALINGS IN THE SOFTWARE.
00023 */
00024 
00025 #ifndef TIMED_INTERRUPT_H
00026 #define TIMED_INTERRUPT_H
00027 
00028 #include "mbed.h"
00029 #include "MicroBitConfig.h"
00030 
00031 class TimedInterruptIn : public InterruptIn
00032 {
00033     uint64_t timestamp;
00034 
00035     public:
00036 
00037     /**
00038       * Constructor.
00039       *
00040       * Create an instance of TimedInterruptIn that has an additional timestamp field.
00041       */
00042     TimedInterruptIn(PinName name);
00043 
00044     /**
00045       * Stores the given timestamp for this instance of TimedInterruptIn.
00046       *
00047       * @param timestamp the timestamp to retain.
00048       */
00049     void setTimestamp(uint64_t timestamp);
00050 
00051     /**
00052       * Retrieves the retained timestamp for this instance of TimedInterruptIn.
00053       *
00054       * @return the timestamp held by this instance.
00055       */
00056     uint64_t getTimestamp();
00057 };
00058 
00059 #endif