Biomimetics MBED Library w/ Added Support for CAN3
Dependents: CAN_TEST SPIne_Plus_DYNO_SENSORS SPIne_Plus_v2 SPIne_Plus_Dyno_v2
hal/lp_ticker_api.h@3:993b4d6ff61e, 2021-03-09 (annotated)
- Committer:
- adimmit
- Date:
- Tue Mar 09 20:33:24 2021 +0000
- Revision:
- 3:993b4d6ff61e
- Parent:
- 0:083111ae2a11
added CAN3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
saloutos | 0:083111ae2a11 | 1 | |
saloutos | 0:083111ae2a11 | 2 | /** \addtogroup hal */ |
saloutos | 0:083111ae2a11 | 3 | /** @{*/ |
saloutos | 0:083111ae2a11 | 4 | /* mbed Microcontroller Library |
saloutos | 0:083111ae2a11 | 5 | * Copyright (c) 2015 ARM Limited |
saloutos | 0:083111ae2a11 | 6 | * |
saloutos | 0:083111ae2a11 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
saloutos | 0:083111ae2a11 | 8 | * you may not use this file except in compliance with the License. |
saloutos | 0:083111ae2a11 | 9 | * You may obtain a copy of the License at |
saloutos | 0:083111ae2a11 | 10 | * |
saloutos | 0:083111ae2a11 | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
saloutos | 0:083111ae2a11 | 12 | * |
saloutos | 0:083111ae2a11 | 13 | * Unless required by applicable law or agreed to in writing, software |
saloutos | 0:083111ae2a11 | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
saloutos | 0:083111ae2a11 | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
saloutos | 0:083111ae2a11 | 16 | * See the License for the specific language governing permissions and |
saloutos | 0:083111ae2a11 | 17 | * limitations under the License. |
saloutos | 0:083111ae2a11 | 18 | */ |
saloutos | 0:083111ae2a11 | 19 | #ifndef MBED_LPTICKER_API_H |
saloutos | 0:083111ae2a11 | 20 | #define MBED_LPTICKER_API_H |
saloutos | 0:083111ae2a11 | 21 | |
saloutos | 0:083111ae2a11 | 22 | #include "device.h" |
saloutos | 0:083111ae2a11 | 23 | |
saloutos | 0:083111ae2a11 | 24 | #if DEVICE_LOWPOWERTIMER |
saloutos | 0:083111ae2a11 | 25 | |
saloutos | 0:083111ae2a11 | 26 | #include "hal/ticker_api.h" |
saloutos | 0:083111ae2a11 | 27 | |
saloutos | 0:083111ae2a11 | 28 | #ifdef __cplusplus |
saloutos | 0:083111ae2a11 | 29 | extern "C" { |
saloutos | 0:083111ae2a11 | 30 | #endif |
saloutos | 0:083111ae2a11 | 31 | |
saloutos | 0:083111ae2a11 | 32 | /** |
saloutos | 0:083111ae2a11 | 33 | * \defgroup hal_LpTicker Low Power Ticker Functions |
saloutos | 0:083111ae2a11 | 34 | * @{ |
saloutos | 0:083111ae2a11 | 35 | */ |
saloutos | 0:083111ae2a11 | 36 | |
saloutos | 0:083111ae2a11 | 37 | /** Get low power ticker's data |
saloutos | 0:083111ae2a11 | 38 | * |
saloutos | 0:083111ae2a11 | 39 | * @return The low power ticker data |
saloutos | 0:083111ae2a11 | 40 | */ |
saloutos | 0:083111ae2a11 | 41 | const ticker_data_t* get_lp_ticker_data(void); |
saloutos | 0:083111ae2a11 | 42 | |
saloutos | 0:083111ae2a11 | 43 | /** The wrapper for ticker_irq_handler, to pass lp ticker's data |
saloutos | 0:083111ae2a11 | 44 | * |
saloutos | 0:083111ae2a11 | 45 | */ |
saloutos | 0:083111ae2a11 | 46 | void lp_ticker_irq_handler(void); |
saloutos | 0:083111ae2a11 | 47 | |
saloutos | 0:083111ae2a11 | 48 | /* HAL lp ticker */ |
saloutos | 0:083111ae2a11 | 49 | |
saloutos | 0:083111ae2a11 | 50 | /** Initialize the low power ticker |
saloutos | 0:083111ae2a11 | 51 | * |
saloutos | 0:083111ae2a11 | 52 | */ |
saloutos | 0:083111ae2a11 | 53 | void lp_ticker_init(void); |
saloutos | 0:083111ae2a11 | 54 | |
saloutos | 0:083111ae2a11 | 55 | /** Read the current counter |
saloutos | 0:083111ae2a11 | 56 | * |
saloutos | 0:083111ae2a11 | 57 | * @return The current timer's counter value in microseconds |
saloutos | 0:083111ae2a11 | 58 | */ |
saloutos | 0:083111ae2a11 | 59 | uint32_t lp_ticker_read(void); |
saloutos | 0:083111ae2a11 | 60 | |
saloutos | 0:083111ae2a11 | 61 | /** Set interrupt for specified timestamp |
saloutos | 0:083111ae2a11 | 62 | * |
saloutos | 0:083111ae2a11 | 63 | * @param timestamp The time in microseconds to be set |
saloutos | 0:083111ae2a11 | 64 | */ |
saloutos | 0:083111ae2a11 | 65 | void lp_ticker_set_interrupt(timestamp_t timestamp); |
saloutos | 0:083111ae2a11 | 66 | |
saloutos | 0:083111ae2a11 | 67 | /** Disable low power ticker interrupt |
saloutos | 0:083111ae2a11 | 68 | * |
saloutos | 0:083111ae2a11 | 69 | */ |
saloutos | 0:083111ae2a11 | 70 | void lp_ticker_disable_interrupt(void); |
saloutos | 0:083111ae2a11 | 71 | |
saloutos | 0:083111ae2a11 | 72 | /** Clear the low power ticker interrupt |
saloutos | 0:083111ae2a11 | 73 | * |
saloutos | 0:083111ae2a11 | 74 | */ |
saloutos | 0:083111ae2a11 | 75 | void lp_ticker_clear_interrupt(void); |
saloutos | 0:083111ae2a11 | 76 | |
saloutos | 0:083111ae2a11 | 77 | /** Set pending interrupt that should be fired right away. |
saloutos | 0:083111ae2a11 | 78 | * |
saloutos | 0:083111ae2a11 | 79 | * The ticker should be initialized prior calling this function. |
saloutos | 0:083111ae2a11 | 80 | */ |
saloutos | 0:083111ae2a11 | 81 | void lp_ticker_fire_interrupt(void); |
saloutos | 0:083111ae2a11 | 82 | |
saloutos | 0:083111ae2a11 | 83 | /**@}*/ |
saloutos | 0:083111ae2a11 | 84 | |
saloutos | 0:083111ae2a11 | 85 | #ifdef __cplusplus |
saloutos | 0:083111ae2a11 | 86 | } |
saloutos | 0:083111ae2a11 | 87 | #endif |
saloutos | 0:083111ae2a11 | 88 | |
saloutos | 0:083111ae2a11 | 89 | #endif |
saloutos | 0:083111ae2a11 | 90 | |
saloutos | 0:083111ae2a11 | 91 | #endif |
saloutos | 0:083111ae2a11 | 92 | |
saloutos | 0:083111ae2a11 | 93 | /** @}*/ |