help :(

Dependencies:   FFT

Committer:
annieluo2
Date:
Wed Dec 02 18:02:03 2020 +0000
Revision:
0:d6c9b09b4042
boo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
annieluo2 0:d6c9b09b4042 1 /* mbed Microcontroller Library
annieluo2 0:d6c9b09b4042 2 * Copyright (c) 2006-2013 ARM Limited
annieluo2 0:d6c9b09b4042 3 *
annieluo2 0:d6c9b09b4042 4 * Licensed under the Apache License, Version 2.0 (the "License");
annieluo2 0:d6c9b09b4042 5 * you may not use this file except in compliance with the License.
annieluo2 0:d6c9b09b4042 6 * You may obtain a copy of the License at
annieluo2 0:d6c9b09b4042 7 *
annieluo2 0:d6c9b09b4042 8 * http://www.apache.org/licenses/LICENSE-2.0
annieluo2 0:d6c9b09b4042 9 *
annieluo2 0:d6c9b09b4042 10 * Unless required by applicable law or agreed to in writing, software
annieluo2 0:d6c9b09b4042 11 * distributed under the License is distributed on an "AS IS" BASIS,
annieluo2 0:d6c9b09b4042 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
annieluo2 0:d6c9b09b4042 13 * See the License for the specific language governing permissions and
annieluo2 0:d6c9b09b4042 14 * limitations under the License.
annieluo2 0:d6c9b09b4042 15 */
annieluo2 0:d6c9b09b4042 16 #ifndef MBED_TIMEREVENT_H
annieluo2 0:d6c9b09b4042 17 #define MBED_TIMEREVENT_H
annieluo2 0:d6c9b09b4042 18
annieluo2 0:d6c9b09b4042 19 #include "hal/ticker_api.h"
annieluo2 0:d6c9b09b4042 20 #include "hal/us_ticker_api.h"
annieluo2 0:d6c9b09b4042 21
annieluo2 0:d6c9b09b4042 22 namespace mbed {
annieluo2 0:d6c9b09b4042 23 /** \addtogroup drivers */
annieluo2 0:d6c9b09b4042 24 /** @{*/
annieluo2 0:d6c9b09b4042 25
annieluo2 0:d6c9b09b4042 26 /** Base abstraction for timer interrupts
annieluo2 0:d6c9b09b4042 27 *
annieluo2 0:d6c9b09b4042 28 * @Note Synchronization level: Interrupt safe
annieluo2 0:d6c9b09b4042 29 */
annieluo2 0:d6c9b09b4042 30 class TimerEvent {
annieluo2 0:d6c9b09b4042 31 public:
annieluo2 0:d6c9b09b4042 32 TimerEvent();
annieluo2 0:d6c9b09b4042 33 TimerEvent(const ticker_data_t *data);
annieluo2 0:d6c9b09b4042 34
annieluo2 0:d6c9b09b4042 35 /** The handler registered with the underlying timer interrupt
annieluo2 0:d6c9b09b4042 36 */
annieluo2 0:d6c9b09b4042 37 static void irq(uint32_t id);
annieluo2 0:d6c9b09b4042 38
annieluo2 0:d6c9b09b4042 39 /** Destruction removes it...
annieluo2 0:d6c9b09b4042 40 */
annieluo2 0:d6c9b09b4042 41 virtual ~TimerEvent();
annieluo2 0:d6c9b09b4042 42
annieluo2 0:d6c9b09b4042 43 protected:
annieluo2 0:d6c9b09b4042 44 // The handler called to service the timer event of the derived class
annieluo2 0:d6c9b09b4042 45 virtual void handler() = 0;
annieluo2 0:d6c9b09b4042 46
annieluo2 0:d6c9b09b4042 47 // insert in to linked list
annieluo2 0:d6c9b09b4042 48 void insert(timestamp_t timestamp);
annieluo2 0:d6c9b09b4042 49
annieluo2 0:d6c9b09b4042 50 // remove from linked list, if in it
annieluo2 0:d6c9b09b4042 51 void remove();
annieluo2 0:d6c9b09b4042 52
annieluo2 0:d6c9b09b4042 53 ticker_event_t event;
annieluo2 0:d6c9b09b4042 54
annieluo2 0:d6c9b09b4042 55 const ticker_data_t *_ticker_data;
annieluo2 0:d6c9b09b4042 56 };
annieluo2 0:d6c9b09b4042 57
annieluo2 0:d6c9b09b4042 58 } // namespace mbed
annieluo2 0:d6c9b09b4042 59
annieluo2 0:d6c9b09b4042 60 #endif
annieluo2 0:d6c9b09b4042 61
annieluo2 0:d6c9b09b4042 62 /** @}*/