mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Apr 03 11:45:06 2014 +0100
Revision:
149:1fb5f62b92bd
Parent:
targets/hal/TARGET_Freescale/TARGET_KSDK_MCUS/TARGET_KSDK_CODE/hal/pit/fsl_pit_hal.h@146:f64d43ff0c18
Child:
324:406fd2029f23
Synchronized with git revision 220c0bb39ceee40016e1e86350c058963d01ed42

Full URL: https://github.com/mbedmicro/mbed/commit/220c0bb39ceee40016e1e86350c058963d01ed42/

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 146:f64d43ff0c18 1 /*
mbed_official 146:f64d43ff0c18 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 146:f64d43ff0c18 3 * All rights reserved.
mbed_official 146:f64d43ff0c18 4 *
mbed_official 146:f64d43ff0c18 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 146:f64d43ff0c18 6 * are permitted provided that the following conditions are met:
mbed_official 146:f64d43ff0c18 7 *
mbed_official 146:f64d43ff0c18 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 146:f64d43ff0c18 9 * of conditions and the following disclaimer.
mbed_official 146:f64d43ff0c18 10 *
mbed_official 146:f64d43ff0c18 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 146:f64d43ff0c18 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 146:f64d43ff0c18 13 * other materials provided with the distribution.
mbed_official 146:f64d43ff0c18 14 *
mbed_official 146:f64d43ff0c18 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 146:f64d43ff0c18 16 * contributors may be used to endorse or promote products derived from this
mbed_official 146:f64d43ff0c18 17 * software without specific prior written permission.
mbed_official 146:f64d43ff0c18 18 *
mbed_official 146:f64d43ff0c18 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 146:f64d43ff0c18 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 146:f64d43ff0c18 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 146:f64d43ff0c18 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 146:f64d43ff0c18 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 146:f64d43ff0c18 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 146:f64d43ff0c18 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 146:f64d43ff0c18 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 146:f64d43ff0c18 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 146:f64d43ff0c18 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 146:f64d43ff0c18 29 */
mbed_official 146:f64d43ff0c18 30 #ifndef __FSL_PIT_HAL_H__
mbed_official 146:f64d43ff0c18 31 #define __FSL_PIT_HAL_H__
mbed_official 146:f64d43ff0c18 32
mbed_official 146:f64d43ff0c18 33 #include <assert.h>
mbed_official 146:f64d43ff0c18 34 #include <stdint.h>
mbed_official 146:f64d43ff0c18 35 #include <stdbool.h>
mbed_official 146:f64d43ff0c18 36 #include "fsl_pit_features.h"
mbed_official 146:f64d43ff0c18 37 #include "fsl_device_registers.h"
mbed_official 146:f64d43ff0c18 38
mbed_official 146:f64d43ff0c18 39 /*!
mbed_official 146:f64d43ff0c18 40 * @addtogroup pit_hal
mbed_official 146:f64d43ff0c18 41 * @{
mbed_official 146:f64d43ff0c18 42 */
mbed_official 146:f64d43ff0c18 43
mbed_official 146:f64d43ff0c18 44 /*******************************************************************************
mbed_official 146:f64d43ff0c18 45 * API
mbed_official 146:f64d43ff0c18 46 ******************************************************************************/
mbed_official 146:f64d43ff0c18 47
mbed_official 146:f64d43ff0c18 48 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 49 extern "C" {
mbed_official 146:f64d43ff0c18 50 #endif
mbed_official 146:f64d43ff0c18 51
mbed_official 146:f64d43ff0c18 52 /*!
mbed_official 146:f64d43ff0c18 53 * @name Initialization
mbed_official 146:f64d43ff0c18 54 * @{
mbed_official 146:f64d43ff0c18 55 */
mbed_official 146:f64d43ff0c18 56
mbed_official 146:f64d43ff0c18 57 /*!
mbed_official 146:f64d43ff0c18 58 * @brief Enables the PIT module.
mbed_official 146:f64d43ff0c18 59 *
mbed_official 146:f64d43ff0c18 60 * This function enables the PIT timer clock (Note: this function does not un-gate
mbed_official 146:f64d43ff0c18 61 * the system clock gating control). It should be called before any other timer
mbed_official 146:f64d43ff0c18 62 * related setup.
mbed_official 146:f64d43ff0c18 63 */
mbed_official 146:f64d43ff0c18 64 static inline void pit_hal_enable(void)
mbed_official 146:f64d43ff0c18 65 {
mbed_official 146:f64d43ff0c18 66 BW_PIT_MCR_MDIS(0U);
mbed_official 146:f64d43ff0c18 67 }
mbed_official 146:f64d43ff0c18 68
mbed_official 146:f64d43ff0c18 69 /*!
mbed_official 146:f64d43ff0c18 70 * @brief Disables the PIT module.
mbed_official 146:f64d43ff0c18 71 *
mbed_official 146:f64d43ff0c18 72 * This function disables all PIT timer clocks(Note: it does not affect the
mbed_official 146:f64d43ff0c18 73 * SIM clock gating control).
mbed_official 146:f64d43ff0c18 74 */
mbed_official 146:f64d43ff0c18 75 static inline void pit_hal_disable(void)
mbed_official 146:f64d43ff0c18 76 {
mbed_official 146:f64d43ff0c18 77 BW_PIT_MCR_MDIS(1U);
mbed_official 146:f64d43ff0c18 78 }
mbed_official 146:f64d43ff0c18 79
mbed_official 146:f64d43ff0c18 80 /*!
mbed_official 146:f64d43ff0c18 81 * @brief Configures the timers to continue running or stop in debug mode.
mbed_official 146:f64d43ff0c18 82 *
mbed_official 146:f64d43ff0c18 83 * In debug mode, the timers may or may not be frozen, based on the configuration of
mbed_official 146:f64d43ff0c18 84 * this function. This is intended to aid software development, allowing the developer
mbed_official 146:f64d43ff0c18 85 * to halt the processor, investigate the current state of the system (for example,
mbed_official 146:f64d43ff0c18 86 * the timer values), and continue the operation.
mbed_official 146:f64d43ff0c18 87 *
mbed_official 146:f64d43ff0c18 88 * @param timerRun Timers run or stop in debug mode.
mbed_official 146:f64d43ff0c18 89 * - true: Timers continue to run in debug mode.
mbed_official 146:f64d43ff0c18 90 * - false: Timers stop in debug mode.
mbed_official 146:f64d43ff0c18 91 */
mbed_official 146:f64d43ff0c18 92 static inline void pit_hal_configure_timer_run_in_debug(bool timerRun)
mbed_official 146:f64d43ff0c18 93 {
mbed_official 146:f64d43ff0c18 94 BW_PIT_MCR_FRZ(!timerRun);
mbed_official 146:f64d43ff0c18 95 }
mbed_official 146:f64d43ff0c18 96
mbed_official 146:f64d43ff0c18 97 #if FSL_FEATURE_PIT_HAS_CHAIN_MODE
mbed_official 146:f64d43ff0c18 98 /*!
mbed_official 146:f64d43ff0c18 99 * @brief Enables or disables the timer chain with the previous timer.
mbed_official 146:f64d43ff0c18 100 *
mbed_official 146:f64d43ff0c18 101 * When a timer has a chain mode enabled, it only counts after the previous
mbed_official 146:f64d43ff0c18 102 * timer has expired. If the timer n-1 has counted down to 0, counter n
mbed_official 146:f64d43ff0c18 103 * decrements the value by one. This allows the developers to chain timers together
mbed_official 146:f64d43ff0c18 104 * and form a longer timer. The first timer (timer 0) cannot be chained to any
mbed_official 146:f64d43ff0c18 105 * other timer.
mbed_official 146:f64d43ff0c18 106 *
mbed_official 146:f64d43ff0c18 107 * @param timer Timer channel number which is chained with the previous timer.
mbed_official 146:f64d43ff0c18 108 * @param enable Enable or disable chain.
mbed_official 146:f64d43ff0c18 109 * - true: Current timer is chained with the previous timer.
mbed_official 146:f64d43ff0c18 110 * - false: Timer doesn't chain with other timers.
mbed_official 146:f64d43ff0c18 111 */
mbed_official 146:f64d43ff0c18 112 static inline void pit_hal_configure_timer_chain(uint32_t timer, bool enable)
mbed_official 146:f64d43ff0c18 113 {
mbed_official 146:f64d43ff0c18 114 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 115 BW_PIT_TCTRLn_CHN(timer, enable);
mbed_official 146:f64d43ff0c18 116 }
mbed_official 146:f64d43ff0c18 117
mbed_official 146:f64d43ff0c18 118 #endif /* FSL_FEATURE_PIT_HAS_CHAIN_MODE*/
mbed_official 146:f64d43ff0c18 119
mbed_official 146:f64d43ff0c18 120 /* @} */
mbed_official 146:f64d43ff0c18 121
mbed_official 146:f64d43ff0c18 122 /*!
mbed_official 146:f64d43ff0c18 123 * @name Timer Start and Stop
mbed_official 146:f64d43ff0c18 124 * @{
mbed_official 146:f64d43ff0c18 125 */
mbed_official 146:f64d43ff0c18 126
mbed_official 146:f64d43ff0c18 127 /*!
mbed_official 146:f64d43ff0c18 128 * @brief Starts the timer counting.
mbed_official 146:f64d43ff0c18 129 *
mbed_official 146:f64d43ff0c18 130 * After calling this function, timers load the start value as specified by the function
mbed_official 146:f64d43ff0c18 131 * pit_hal_set_timer_period_count(uint32_t timer, uint32_t count), count down to
mbed_official 146:f64d43ff0c18 132 * 0, and load the respective start value again. Each time a timer reaches 0,
mbed_official 146:f64d43ff0c18 133 * it generates a trigger pulse and sets the time-out interrupt flag.
mbed_official 146:f64d43ff0c18 134 *
mbed_official 146:f64d43ff0c18 135 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 136 */
mbed_official 146:f64d43ff0c18 137 static inline void pit_hal_timer_start(uint32_t timer)
mbed_official 146:f64d43ff0c18 138 {
mbed_official 146:f64d43ff0c18 139 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 140 BW_PIT_TCTRLn_TEN(timer, 1U);
mbed_official 146:f64d43ff0c18 141 }
mbed_official 146:f64d43ff0c18 142
mbed_official 146:f64d43ff0c18 143 /*!
mbed_official 146:f64d43ff0c18 144 * @brief Stops the timer from counting.
mbed_official 146:f64d43ff0c18 145 *
mbed_official 146:f64d43ff0c18 146 * This function stops every timer from counting. Timers reload their periods
mbed_official 146:f64d43ff0c18 147 * respectively after they call the pit_hal_timer_start the next time.
mbed_official 146:f64d43ff0c18 148 *
mbed_official 146:f64d43ff0c18 149 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 150 */
mbed_official 146:f64d43ff0c18 151 static inline void pit_hal_timer_stop(uint32_t timer)
mbed_official 146:f64d43ff0c18 152 {
mbed_official 146:f64d43ff0c18 153 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 154 BW_PIT_TCTRLn_TEN(timer, 0U);
mbed_official 146:f64d43ff0c18 155 }
mbed_official 146:f64d43ff0c18 156
mbed_official 146:f64d43ff0c18 157 /*!
mbed_official 146:f64d43ff0c18 158 * @brief Checks to see whether the current timer is started or not.
mbed_official 146:f64d43ff0c18 159 *
mbed_official 146:f64d43ff0c18 160 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 161 * @return Current timer running status
mbed_official 146:f64d43ff0c18 162 * -true: Current timer is running.
mbed_official 146:f64d43ff0c18 163 * -false: Current timer has stopped.
mbed_official 146:f64d43ff0c18 164 */
mbed_official 146:f64d43ff0c18 165 static inline bool pit_hal_is_timer_started(uint32_t timer)
mbed_official 146:f64d43ff0c18 166 {
mbed_official 146:f64d43ff0c18 167 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 168 return BR_PIT_TCTRLn_TEN(timer);
mbed_official 146:f64d43ff0c18 169 }
mbed_official 146:f64d43ff0c18 170
mbed_official 146:f64d43ff0c18 171 /* @} */
mbed_official 146:f64d43ff0c18 172
mbed_official 146:f64d43ff0c18 173 /*!
mbed_official 146:f64d43ff0c18 174 * @name Timer Period
mbed_official 146:f64d43ff0c18 175 * @{
mbed_official 146:f64d43ff0c18 176 */
mbed_official 146:f64d43ff0c18 177
mbed_official 146:f64d43ff0c18 178 /*!
mbed_official 146:f64d43ff0c18 179 * @brief Sets the timer period in units of count.
mbed_official 146:f64d43ff0c18 180 *
mbed_official 146:f64d43ff0c18 181 * Timers begin counting from the value set by this function.
mbed_official 146:f64d43ff0c18 182 * The counter period of a running timer can be modified by first stopping
mbed_official 146:f64d43ff0c18 183 * the timer, setting a new load value, and starting the timer again. If
mbed_official 146:f64d43ff0c18 184 * timers are not restarted, the new value is loaded after the next trigger
mbed_official 146:f64d43ff0c18 185 * event.
mbed_official 146:f64d43ff0c18 186 *
mbed_official 146:f64d43ff0c18 187 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 188 * @param count Timer period in units of count
mbed_official 146:f64d43ff0c18 189 */
mbed_official 146:f64d43ff0c18 190 static inline void pit_hal_set_timer_period_count(uint32_t timer, uint32_t count)
mbed_official 146:f64d43ff0c18 191 {
mbed_official 146:f64d43ff0c18 192 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 193 HW_PIT_LDVALn_WR(timer, count);
mbed_official 146:f64d43ff0c18 194 }
mbed_official 146:f64d43ff0c18 195
mbed_official 146:f64d43ff0c18 196 /*!
mbed_official 146:f64d43ff0c18 197 * @brief Returns the current timer period in units of count.
mbed_official 146:f64d43ff0c18 198 *
mbed_official 146:f64d43ff0c18 199 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 200 * @return Timer period in units of count
mbed_official 146:f64d43ff0c18 201 */
mbed_official 146:f64d43ff0c18 202 static inline uint32_t pit_hal_read_timer_period_count(uint32_t timer)
mbed_official 146:f64d43ff0c18 203 {
mbed_official 146:f64d43ff0c18 204 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 205 return HW_PIT_LDVALn_RD(timer);
mbed_official 146:f64d43ff0c18 206 }
mbed_official 146:f64d43ff0c18 207
mbed_official 146:f64d43ff0c18 208 /*!
mbed_official 146:f64d43ff0c18 209 * @brief Reads the current timer counting value.
mbed_official 146:f64d43ff0c18 210 *
mbed_official 146:f64d43ff0c18 211 * This function returns the real-time timer counting value, in a range from 0 to a
mbed_official 146:f64d43ff0c18 212 * timer period.
mbed_official 146:f64d43ff0c18 213 *
mbed_official 146:f64d43ff0c18 214 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 215 * @return Current timer counting value
mbed_official 146:f64d43ff0c18 216 */
mbed_official 146:f64d43ff0c18 217 static inline uint32_t pit_hal_read_timer_count(uint32_t timer)
mbed_official 146:f64d43ff0c18 218 {
mbed_official 146:f64d43ff0c18 219 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 220 return HW_PIT_CVALn_RD(timer);
mbed_official 146:f64d43ff0c18 221 }
mbed_official 146:f64d43ff0c18 222
mbed_official 146:f64d43ff0c18 223 #if FSL_FEATURE_PIT_HAS_LIFETIME_TIMER
mbed_official 146:f64d43ff0c18 224 /*!
mbed_official 146:f64d43ff0c18 225 * @brief Reads the current lifetime counter value.
mbed_official 146:f64d43ff0c18 226 *
mbed_official 146:f64d43ff0c18 227 * The lifetime timer is a 64-bit timer which chains timer 0 and timer 1 together.
mbed_official 146:f64d43ff0c18 228 * Timer 0 and 1 are chained by calling the pit_hal_configure_timer_chain
mbed_official 146:f64d43ff0c18 229 * before using this timer. The period of lifetime timer is equal to the "period of
mbed_official 146:f64d43ff0c18 230 * timer 0 * period of timer 1". For the 64-bit value, the higher 32-bit has
mbed_official 146:f64d43ff0c18 231 * the value of timer 1, and the lower 32-bit has the value of timer 0.
mbed_official 146:f64d43ff0c18 232 *
mbed_official 146:f64d43ff0c18 233 * @return Current lifetime timer value
mbed_official 146:f64d43ff0c18 234 */
mbed_official 146:f64d43ff0c18 235 uint64_t pit_hal_read_lifetime_timer_count(void);
mbed_official 146:f64d43ff0c18 236 #endif /*FSL_FEATURE_PIT_HAS_LIFETIME_TIMER*/
mbed_official 146:f64d43ff0c18 237
mbed_official 146:f64d43ff0c18 238 /* @} */
mbed_official 146:f64d43ff0c18 239
mbed_official 146:f64d43ff0c18 240 /*!
mbed_official 146:f64d43ff0c18 241 * @name Interrupt
mbed_official 146:f64d43ff0c18 242 * @{
mbed_official 146:f64d43ff0c18 243 */
mbed_official 146:f64d43ff0c18 244
mbed_official 146:f64d43ff0c18 245 /*!
mbed_official 146:f64d43ff0c18 246 * @brief Enables or disables the timer interrupt.
mbed_official 146:f64d43ff0c18 247 *
mbed_official 146:f64d43ff0c18 248 * If enabled, an interrupt happens when a timeout event occurs
mbed_official 146:f64d43ff0c18 249 * (Note: NVIC should be called to enable pit interrupt in system level).
mbed_official 146:f64d43ff0c18 250 *
mbed_official 146:f64d43ff0c18 251 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 252 * @param enable Enable or disable interrupt.
mbed_official 146:f64d43ff0c18 253 * - true: Generate interrupt when timer counts to 0.
mbed_official 146:f64d43ff0c18 254 * - false: No interrupt is generated.
mbed_official 146:f64d43ff0c18 255 */
mbed_official 146:f64d43ff0c18 256 static inline void pit_hal_configure_interrupt(uint32_t timer, bool enable)
mbed_official 146:f64d43ff0c18 257 {
mbed_official 146:f64d43ff0c18 258 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 259 BW_PIT_TCTRLn_TIE(timer, enable);
mbed_official 146:f64d43ff0c18 260 }
mbed_official 146:f64d43ff0c18 261
mbed_official 146:f64d43ff0c18 262 /*!
mbed_official 146:f64d43ff0c18 263 * @brief Checks whether the timer interrupt is enabled or not.
mbed_official 146:f64d43ff0c18 264 *
mbed_official 146:f64d43ff0c18 265 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 266 * @return Status of enabled or disabled interrupt
mbed_official 146:f64d43ff0c18 267 * - true: Interrupt is enabled.
mbed_official 146:f64d43ff0c18 268 * - false: Interrupt is disabled.
mbed_official 146:f64d43ff0c18 269 */
mbed_official 146:f64d43ff0c18 270 static inline bool pit_hal_is_interrupt_enabled(uint32_t timer)
mbed_official 146:f64d43ff0c18 271 {
mbed_official 146:f64d43ff0c18 272 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 273 return BR_PIT_TCTRLn_TIE(timer);
mbed_official 146:f64d43ff0c18 274 }
mbed_official 146:f64d43ff0c18 275
mbed_official 146:f64d43ff0c18 276 /*!
mbed_official 146:f64d43ff0c18 277 * @brief Clears the timer interrupt flag.
mbed_official 146:f64d43ff0c18 278 *
mbed_official 146:f64d43ff0c18 279 * This function clears the timer interrupt flag after a timeout event
mbed_official 146:f64d43ff0c18 280 * occurs.
mbed_official 146:f64d43ff0c18 281 *
mbed_official 146:f64d43ff0c18 282 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 283 */
mbed_official 146:f64d43ff0c18 284 static inline void pit_hal_clear_interrupt_flag(uint32_t timer)
mbed_official 146:f64d43ff0c18 285 {
mbed_official 146:f64d43ff0c18 286 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 287 /* Write 1 will clear the flag. */
mbed_official 146:f64d43ff0c18 288 HW_PIT_TFLGn_WR(timer, 1U);
mbed_official 146:f64d43ff0c18 289 }
mbed_official 146:f64d43ff0c18 290
mbed_official 146:f64d43ff0c18 291 /*!
mbed_official 146:f64d43ff0c18 292 * @brief Reads the current timer timeout flag.
mbed_official 146:f64d43ff0c18 293 *
mbed_official 146:f64d43ff0c18 294 * Every time the timer counts to 0, this flag is set.
mbed_official 146:f64d43ff0c18 295 *
mbed_official 146:f64d43ff0c18 296 * @param timer Timer channel number
mbed_official 146:f64d43ff0c18 297 * @return Current status of the timeout flag
mbed_official 146:f64d43ff0c18 298 * - true: Timeout has occurred.
mbed_official 146:f64d43ff0c18 299 * - false: Timeout has not yet occurred.
mbed_official 146:f64d43ff0c18 300 */
mbed_official 146:f64d43ff0c18 301 static inline bool pit_hal_is_timeout_occurred(uint32_t timer)
mbed_official 146:f64d43ff0c18 302 {
mbed_official 146:f64d43ff0c18 303 assert(timer < FSL_FEATURE_PIT_TIMER_COUNT);
mbed_official 146:f64d43ff0c18 304 return HW_PIT_TFLGn_RD(timer);
mbed_official 146:f64d43ff0c18 305 }
mbed_official 146:f64d43ff0c18 306
mbed_official 146:f64d43ff0c18 307 /* @} */
mbed_official 146:f64d43ff0c18 308
mbed_official 146:f64d43ff0c18 309 #if defined(__cplusplus)
mbed_official 146:f64d43ff0c18 310 }
mbed_official 146:f64d43ff0c18 311 #endif
mbed_official 146:f64d43ff0c18 312
mbed_official 146:f64d43ff0c18 313 /*! @}*/
mbed_official 146:f64d43ff0c18 314
mbed_official 146:f64d43ff0c18 315 #endif /* __FSL_PIT_HAL_H__*/
mbed_official 146:f64d43ff0c18 316 /*******************************************************************************
mbed_official 146:f64d43ff0c18 317 * EOF
mbed_official 146:f64d43ff0c18 318 *******************************************************************************/
mbed_official 146:f64d43ff0c18 319