/TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/hal/adc/fsl_adc_hal.h substitute line 894 extern } by }
Fork of mbed by
TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/utilities/fsl_os_abstraction.h@83:8a40adfe8776, 2014-04-28 (annotated)
- Committer:
- bogdanm
- Date:
- Mon Apr 28 17:39:05 2014 +0100
- Revision:
- 83:8a40adfe8776
Release 83 of the mbed library
Main changes:
- updated tests
- K64F TCP/IP support
- lots of fixes in various targets
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 83:8a40adfe8776 | 1 | /* |
bogdanm | 83:8a40adfe8776 | 2 | * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc. |
bogdanm | 83:8a40adfe8776 | 3 | * All rights reserved. |
bogdanm | 83:8a40adfe8776 | 4 | * |
bogdanm | 83:8a40adfe8776 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 83:8a40adfe8776 | 6 | * are permitted provided that the following conditions are met: |
bogdanm | 83:8a40adfe8776 | 7 | * |
bogdanm | 83:8a40adfe8776 | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
bogdanm | 83:8a40adfe8776 | 9 | * of conditions and the following disclaimer. |
bogdanm | 83:8a40adfe8776 | 10 | * |
bogdanm | 83:8a40adfe8776 | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
bogdanm | 83:8a40adfe8776 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
bogdanm | 83:8a40adfe8776 | 13 | * other materials provided with the distribution. |
bogdanm | 83:8a40adfe8776 | 14 | * |
bogdanm | 83:8a40adfe8776 | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
bogdanm | 83:8a40adfe8776 | 16 | * contributors may be used to endorse or promote products derived from this |
bogdanm | 83:8a40adfe8776 | 17 | * software without specific prior written permission. |
bogdanm | 83:8a40adfe8776 | 18 | * |
bogdanm | 83:8a40adfe8776 | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
bogdanm | 83:8a40adfe8776 | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
bogdanm | 83:8a40adfe8776 | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 83:8a40adfe8776 | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
bogdanm | 83:8a40adfe8776 | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
bogdanm | 83:8a40adfe8776 | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
bogdanm | 83:8a40adfe8776 | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
bogdanm | 83:8a40adfe8776 | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
bogdanm | 83:8a40adfe8776 | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
bogdanm | 83:8a40adfe8776 | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 83:8a40adfe8776 | 29 | */ |
bogdanm | 83:8a40adfe8776 | 30 | #if !defined(__FSL_OS_ABSTRACTION_H__) |
bogdanm | 83:8a40adfe8776 | 31 | #define __FSL_OS_ABSTRACTION_H__ |
bogdanm | 83:8a40adfe8776 | 32 | |
bogdanm | 83:8a40adfe8776 | 33 | #include <stdint.h> |
bogdanm | 83:8a40adfe8776 | 34 | #include <stdbool.h> |
bogdanm | 83:8a40adfe8776 | 35 | #include <stdlib.h> |
bogdanm | 83:8a40adfe8776 | 36 | |
bogdanm | 83:8a40adfe8776 | 37 | #if defined __CC_ARM |
bogdanm | 83:8a40adfe8776 | 38 | #define inline __inline |
bogdanm | 83:8a40adfe8776 | 39 | #endif |
bogdanm | 83:8a40adfe8776 | 40 | |
bogdanm | 83:8a40adfe8776 | 41 | /*! |
bogdanm | 83:8a40adfe8776 | 42 | * @addtogroup os_abstraction |
bogdanm | 83:8a40adfe8776 | 43 | * @{ |
bogdanm | 83:8a40adfe8776 | 44 | */ |
bogdanm | 83:8a40adfe8776 | 45 | |
bogdanm | 83:8a40adfe8776 | 46 | /*! @brief Status values to be returned by functions. */ |
bogdanm | 83:8a40adfe8776 | 47 | typedef enum |
bogdanm | 83:8a40adfe8776 | 48 | { |
bogdanm | 83:8a40adfe8776 | 49 | kSuccess = 0, /*!< Functions work correctly. */ |
bogdanm | 83:8a40adfe8776 | 50 | kError, /*!< Functions work failed. */ |
bogdanm | 83:8a40adfe8776 | 51 | kTimeout, /*!< Timeout occurs while waiting for an object. */ |
bogdanm | 83:8a40adfe8776 | 52 | kIdle /*!< Can not get the object in non-blocking mode.*/ |
bogdanm | 83:8a40adfe8776 | 53 | }fsl_rtos_status; |
bogdanm | 83:8a40adfe8776 | 54 | |
bogdanm | 83:8a40adfe8776 | 55 | /*! @brief The event flags are set or not.*/ |
bogdanm | 83:8a40adfe8776 | 56 | typedef enum |
bogdanm | 83:8a40adfe8776 | 57 | { |
bogdanm | 83:8a40adfe8776 | 58 | kFlagNotSet = 0, /*!< The flags checked are set. */ |
bogdanm | 83:8a40adfe8776 | 59 | kFlagSet /*!< The flags checked are not set. */ |
bogdanm | 83:8a40adfe8776 | 60 | }event_status; |
bogdanm | 83:8a40adfe8776 | 61 | |
bogdanm | 83:8a40adfe8776 | 62 | /*! @brief The event flags are cleared automatically or manually.*/ |
bogdanm | 83:8a40adfe8776 | 63 | typedef enum |
bogdanm | 83:8a40adfe8776 | 64 | { |
bogdanm | 83:8a40adfe8776 | 65 | kEventAutoClr = 0, /*!< The flags of the event will be cleared automatically. */ |
bogdanm | 83:8a40adfe8776 | 66 | kEventManualClr /*!< The flags of the event will be cleared manually. */ |
bogdanm | 83:8a40adfe8776 | 67 | }event_clear_type; |
bogdanm | 83:8a40adfe8776 | 68 | |
bogdanm | 83:8a40adfe8776 | 69 | // Temporary "fix", until the proper macros are integrated in the on-line build system |
bogdanm | 83:8a40adfe8776 | 70 | #define FSL_RTOS_MBED |
bogdanm | 83:8a40adfe8776 | 71 | |
bogdanm | 83:8a40adfe8776 | 72 | /* Include required header file based on RTOS selection */ |
bogdanm | 83:8a40adfe8776 | 73 | #if defined (FSL_RTOS_MQX) |
bogdanm | 83:8a40adfe8776 | 74 | /*! @brief Macro to set message queue copy messages to internal memory or not. */ |
bogdanm | 83:8a40adfe8776 | 75 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 1 |
bogdanm | 83:8a40adfe8776 | 76 | #include "fsl_os_abstraction_mqx.h" |
bogdanm | 83:8a40adfe8776 | 77 | |
bogdanm | 83:8a40adfe8776 | 78 | #elif defined (FSL_RTOS_FREE_RTOS) |
bogdanm | 83:8a40adfe8776 | 79 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 1 |
bogdanm | 83:8a40adfe8776 | 80 | #include "fsl_os_abstraction_free_rtos.h" |
bogdanm | 83:8a40adfe8776 | 81 | |
bogdanm | 83:8a40adfe8776 | 82 | #elif defined (FSL_RTOS_UCOSII) |
bogdanm | 83:8a40adfe8776 | 83 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 1 |
bogdanm | 83:8a40adfe8776 | 84 | #include "fsl_os_abstraction_ucosii.h" |
bogdanm | 83:8a40adfe8776 | 85 | |
bogdanm | 83:8a40adfe8776 | 86 | #elif defined (FSL_RTOS_UCOSIII) |
bogdanm | 83:8a40adfe8776 | 87 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 1 |
bogdanm | 83:8a40adfe8776 | 88 | #include "fsl_os_abstraction_ucosiii.h" |
bogdanm | 83:8a40adfe8776 | 89 | |
bogdanm | 83:8a40adfe8776 | 90 | #elif defined (FSL_RTOS_CMSIS) |
bogdanm | 83:8a40adfe8776 | 91 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 0 |
bogdanm | 83:8a40adfe8776 | 92 | #include "fsl_os_abstraction_cmsis.h" |
bogdanm | 83:8a40adfe8776 | 93 | |
bogdanm | 83:8a40adfe8776 | 94 | #elif defined (FSL_RTOS_MBED) |
bogdanm | 83:8a40adfe8776 | 95 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 1 |
bogdanm | 83:8a40adfe8776 | 96 | #include "fsl_os_abstraction_mbed.h" |
bogdanm | 83:8a40adfe8776 | 97 | |
bogdanm | 83:8a40adfe8776 | 98 | #else |
bogdanm | 83:8a40adfe8776 | 99 | #define __FSL_RTOS_MSGQ_COPY_MSG__ 1 |
bogdanm | 83:8a40adfe8776 | 100 | #include "fsl_os_abstraction_bm.h" |
bogdanm | 83:8a40adfe8776 | 101 | #endif |
bogdanm | 83:8a40adfe8776 | 102 | |
bogdanm | 83:8a40adfe8776 | 103 | /******************************************************************************* |
bogdanm | 83:8a40adfe8776 | 104 | * API |
bogdanm | 83:8a40adfe8776 | 105 | ******************************************************************************/ |
bogdanm | 83:8a40adfe8776 | 106 | |
bogdanm | 83:8a40adfe8776 | 107 | #if defined(__cplusplus) |
bogdanm | 83:8a40adfe8776 | 108 | extern "C" { |
bogdanm | 83:8a40adfe8776 | 109 | #endif |
bogdanm | 83:8a40adfe8776 | 110 | |
bogdanm | 83:8a40adfe8776 | 111 | /*! |
bogdanm | 83:8a40adfe8776 | 112 | * @name Synchronization |
bogdanm | 83:8a40adfe8776 | 113 | * @{ |
bogdanm | 83:8a40adfe8776 | 114 | */ |
bogdanm | 83:8a40adfe8776 | 115 | |
bogdanm | 83:8a40adfe8776 | 116 | /*! |
bogdanm | 83:8a40adfe8776 | 117 | * @brief Initialize a synchronization object to a given state. |
bogdanm | 83:8a40adfe8776 | 118 | * |
bogdanm | 83:8a40adfe8776 | 119 | * @param obj The sync object to initialize. |
bogdanm | 83:8a40adfe8776 | 120 | * @param initValue The initial value the object will be set to. |
bogdanm | 83:8a40adfe8776 | 121 | * |
bogdanm | 83:8a40adfe8776 | 122 | * @retval kSuccess The object was successfully created. |
bogdanm | 83:8a40adfe8776 | 123 | * @retval kError Invalid parameter or no more objects can be created. |
bogdanm | 83:8a40adfe8776 | 124 | */ |
bogdanm | 83:8a40adfe8776 | 125 | fsl_rtos_status sync_create(sync_object_t *obj, uint8_t initValue); |
bogdanm | 83:8a40adfe8776 | 126 | |
bogdanm | 83:8a40adfe8776 | 127 | /*! |
bogdanm | 83:8a40adfe8776 | 128 | * @brief Wait for the synchronization object. |
bogdanm | 83:8a40adfe8776 | 129 | * |
bogdanm | 83:8a40adfe8776 | 130 | * This function checks the sync object's counting value, if it is |
bogdanm | 83:8a40adfe8776 | 131 | * positive, decreases it and returns kSuccess, otherwise, timeout will be |
bogdanm | 83:8a40adfe8776 | 132 | * used for wait. |
bogdanm | 83:8a40adfe8776 | 133 | * |
bogdanm | 83:8a40adfe8776 | 134 | * @param obj Pointer to the synchronization object. |
bogdanm | 83:8a40adfe8776 | 135 | * @param timeout The maximum number of milliseconds to wait for the object to be signalled. |
bogdanm | 83:8a40adfe8776 | 136 | * Pass the #kSyncWaitForever constant to wait indefinitely for someone to signal the object. |
bogdanm | 83:8a40adfe8776 | 137 | * A value of 0 should not be passed to this function. Instead, use sync_poll for |
bogdanm | 83:8a40adfe8776 | 138 | * a non blocking check. |
bogdanm | 83:8a40adfe8776 | 139 | * |
bogdanm | 83:8a40adfe8776 | 140 | * @retval kSuccess The object was signalled. |
bogdanm | 83:8a40adfe8776 | 141 | * @retval kTimeout A timeout occurred. |
bogdanm | 83:8a40adfe8776 | 142 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 143 | * @retval kIdle The object has not been signalled. |
bogdanm | 83:8a40adfe8776 | 144 | * |
bogdanm | 83:8a40adfe8776 | 145 | * @note There could be only one process waiting for the object at the same time. |
bogdanm | 83:8a40adfe8776 | 146 | */ |
bogdanm | 83:8a40adfe8776 | 147 | fsl_rtos_status sync_wait(sync_object_t *obj, uint32_t timeout); |
bogdanm | 83:8a40adfe8776 | 148 | |
bogdanm | 83:8a40adfe8776 | 149 | /*! |
bogdanm | 83:8a40adfe8776 | 150 | * @brief Checks a synchronization object's status. |
bogdanm | 83:8a40adfe8776 | 151 | * |
bogdanm | 83:8a40adfe8776 | 152 | * This function is used to poll a sync object's status. |
bogdanm | 83:8a40adfe8776 | 153 | * If the sync object's counting value is positive, decrease it and return |
bogdanm | 83:8a40adfe8776 | 154 | * kSuccess. If the object's counting value is 0, the function will |
bogdanm | 83:8a40adfe8776 | 155 | * return kIdle immediately |
bogdanm | 83:8a40adfe8776 | 156 | * |
bogdanm | 83:8a40adfe8776 | 157 | * @param obj The synchronization object. |
bogdanm | 83:8a40adfe8776 | 158 | * |
bogdanm | 83:8a40adfe8776 | 159 | * @retval kSuccess The object was signalled. |
bogdanm | 83:8a40adfe8776 | 160 | * @retval kIdle The object was not signalled. |
bogdanm | 83:8a40adfe8776 | 161 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 162 | */ |
bogdanm | 83:8a40adfe8776 | 163 | fsl_rtos_status sync_poll(sync_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 164 | |
bogdanm | 83:8a40adfe8776 | 165 | /*! |
bogdanm | 83:8a40adfe8776 | 166 | * @brief Signal for someone waiting on the synchronization object to wake up. |
bogdanm | 83:8a40adfe8776 | 167 | * |
bogdanm | 83:8a40adfe8776 | 168 | * This function should not be called from an ISR. |
bogdanm | 83:8a40adfe8776 | 169 | * |
bogdanm | 83:8a40adfe8776 | 170 | * @param obj The synchronization object to signal. |
bogdanm | 83:8a40adfe8776 | 171 | * |
bogdanm | 83:8a40adfe8776 | 172 | * @retval kSuccess The object was successfully signaled. |
bogdanm | 83:8a40adfe8776 | 173 | * @retval kError The object can not be signaled or invalid parameter. |
bogdanm | 83:8a40adfe8776 | 174 | */ |
bogdanm | 83:8a40adfe8776 | 175 | fsl_rtos_status sync_signal(sync_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 176 | |
bogdanm | 83:8a40adfe8776 | 177 | /*! |
bogdanm | 83:8a40adfe8776 | 178 | * @brief Signal for someone waiting on the synchronization object to wake up. |
bogdanm | 83:8a40adfe8776 | 179 | * |
bogdanm | 83:8a40adfe8776 | 180 | * This function should only be called from an ISR. |
bogdanm | 83:8a40adfe8776 | 181 | * |
bogdanm | 83:8a40adfe8776 | 182 | * @param obj The synchronization object to signal. |
bogdanm | 83:8a40adfe8776 | 183 | * |
bogdanm | 83:8a40adfe8776 | 184 | * @retval kSuccess The object was successfully signaled. |
bogdanm | 83:8a40adfe8776 | 185 | * @retval kError The object can not be signaled or invalid parameter. |
bogdanm | 83:8a40adfe8776 | 186 | */ |
bogdanm | 83:8a40adfe8776 | 187 | fsl_rtos_status sync_signal_from_isr(sync_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 188 | |
bogdanm | 83:8a40adfe8776 | 189 | /*! |
bogdanm | 83:8a40adfe8776 | 190 | * @brief Destroy a previously created synchronization object. |
bogdanm | 83:8a40adfe8776 | 191 | * |
bogdanm | 83:8a40adfe8776 | 192 | * @param obj The synchronization object to destroy. |
bogdanm | 83:8a40adfe8776 | 193 | * |
bogdanm | 83:8a40adfe8776 | 194 | * @retval kSuccess The object was successfully destroyed. |
bogdanm | 83:8a40adfe8776 | 195 | * @retval kError Object destruction failed. |
bogdanm | 83:8a40adfe8776 | 196 | */ |
bogdanm | 83:8a40adfe8776 | 197 | fsl_rtos_status sync_destroy(sync_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 198 | |
bogdanm | 83:8a40adfe8776 | 199 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 200 | |
bogdanm | 83:8a40adfe8776 | 201 | /*! |
bogdanm | 83:8a40adfe8776 | 202 | * @name Resource locking |
bogdanm | 83:8a40adfe8776 | 203 | * @{ |
bogdanm | 83:8a40adfe8776 | 204 | */ |
bogdanm | 83:8a40adfe8776 | 205 | |
bogdanm | 83:8a40adfe8776 | 206 | /*! |
bogdanm | 83:8a40adfe8776 | 207 | * @brief Initialize a locking object. |
bogdanm | 83:8a40adfe8776 | 208 | * |
bogdanm | 83:8a40adfe8776 | 209 | * @param obj The lock object to initialize. |
bogdanm | 83:8a40adfe8776 | 210 | * |
bogdanm | 83:8a40adfe8776 | 211 | * @retval kSuccess The lock is created successfully. |
bogdanm | 83:8a40adfe8776 | 212 | * @retval kError Tke lock creation failed. |
bogdanm | 83:8a40adfe8776 | 213 | */ |
bogdanm | 83:8a40adfe8776 | 214 | fsl_rtos_status lock_create(lock_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 215 | |
bogdanm | 83:8a40adfe8776 | 216 | /*! |
bogdanm | 83:8a40adfe8776 | 217 | * @brief Wait for the object to be unlocked and lock it. |
bogdanm | 83:8a40adfe8776 | 218 | * |
bogdanm | 83:8a40adfe8776 | 219 | * This function will wait for some time or wait forever if could not get the lock. |
bogdanm | 83:8a40adfe8776 | 220 | * |
bogdanm | 83:8a40adfe8776 | 221 | * @param obj The locking object. |
bogdanm | 83:8a40adfe8776 | 222 | * @param timeout The maximum number of milliseconds to wait for the mutex. |
bogdanm | 83:8a40adfe8776 | 223 | * Pass the #kSyncWaitForever constant to wait indefinitely for someone to unlock the object. |
bogdanm | 83:8a40adfe8776 | 224 | * A value of 0 should not be passed to this function. Instead, use lock_poll for a non |
bogdanm | 83:8a40adfe8776 | 225 | * blocking check. |
bogdanm | 83:8a40adfe8776 | 226 | * |
bogdanm | 83:8a40adfe8776 | 227 | * @retval kSuccess The lock was obtained. |
bogdanm | 83:8a40adfe8776 | 228 | * @retval kTimeout A timeout occurred. |
bogdanm | 83:8a40adfe8776 | 229 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 230 | */ |
bogdanm | 83:8a40adfe8776 | 231 | fsl_rtos_status lock_wait(lock_object_t *obj, uint32_t timeout); |
bogdanm | 83:8a40adfe8776 | 232 | |
bogdanm | 83:8a40adfe8776 | 233 | /*! |
bogdanm | 83:8a40adfe8776 | 234 | * @brief Checks if a locking object can be locked and locks it if possible. |
bogdanm | 83:8a40adfe8776 | 235 | * |
bogdanm | 83:8a40adfe8776 | 236 | * This function returns instantly if could not get the lock. |
bogdanm | 83:8a40adfe8776 | 237 | * |
bogdanm | 83:8a40adfe8776 | 238 | * @param obj The locking object. |
bogdanm | 83:8a40adfe8776 | 239 | * |
bogdanm | 83:8a40adfe8776 | 240 | * @retval kSuccess The lock was obtained. |
bogdanm | 83:8a40adfe8776 | 241 | * @retval kIdle The lock could not be obtained. |
bogdanm | 83:8a40adfe8776 | 242 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 243 | * |
bogdanm | 83:8a40adfe8776 | 244 | * @note There could be only one process waiting for the object at the same time. |
bogdanm | 83:8a40adfe8776 | 245 | * For RTOSes, wait for a lock recursively by one task is not supported. |
bogdanm | 83:8a40adfe8776 | 246 | * |
bogdanm | 83:8a40adfe8776 | 247 | */ |
bogdanm | 83:8a40adfe8776 | 248 | fsl_rtos_status lock_poll(lock_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 249 | |
bogdanm | 83:8a40adfe8776 | 250 | /*! |
bogdanm | 83:8a40adfe8776 | 251 | * @brief Unlock a previously locked object. |
bogdanm | 83:8a40adfe8776 | 252 | * |
bogdanm | 83:8a40adfe8776 | 253 | * @param obj The locking object to unlock. |
bogdanm | 83:8a40adfe8776 | 254 | * |
bogdanm | 83:8a40adfe8776 | 255 | * @retval kSuccess The object was successfully unlocked. |
bogdanm | 83:8a40adfe8776 | 256 | * @retval kError The object can not be unlocked or invalid parameter. |
bogdanm | 83:8a40adfe8776 | 257 | */ |
bogdanm | 83:8a40adfe8776 | 258 | fsl_rtos_status lock_release(lock_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 259 | |
bogdanm | 83:8a40adfe8776 | 260 | /*! |
bogdanm | 83:8a40adfe8776 | 261 | * @brief Destroy a previously created locking object. |
bogdanm | 83:8a40adfe8776 | 262 | * |
bogdanm | 83:8a40adfe8776 | 263 | * @param obj The locking object to destroy. |
bogdanm | 83:8a40adfe8776 | 264 | * |
bogdanm | 83:8a40adfe8776 | 265 | * @retval kSuccess The object was successfully destroyed. |
bogdanm | 83:8a40adfe8776 | 266 | * @retval kError Object destruction failed. |
bogdanm | 83:8a40adfe8776 | 267 | */ |
bogdanm | 83:8a40adfe8776 | 268 | fsl_rtos_status lock_destroy(lock_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 269 | |
bogdanm | 83:8a40adfe8776 | 270 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 271 | |
bogdanm | 83:8a40adfe8776 | 272 | /*! |
bogdanm | 83:8a40adfe8776 | 273 | * @name Event signaling |
bogdanm | 83:8a40adfe8776 | 274 | * @{ |
bogdanm | 83:8a40adfe8776 | 275 | */ |
bogdanm | 83:8a40adfe8776 | 276 | |
bogdanm | 83:8a40adfe8776 | 277 | /*! |
bogdanm | 83:8a40adfe8776 | 278 | * @brief Initializes the event object. |
bogdanm | 83:8a40adfe8776 | 279 | * |
bogdanm | 83:8a40adfe8776 | 280 | * When the object is created, the flags is 0. |
bogdanm | 83:8a40adfe8776 | 281 | * |
bogdanm | 83:8a40adfe8776 | 282 | * @param obj Pointer to the event object to initialize. |
bogdanm | 83:8a40adfe8776 | 283 | * @param clearType The event is auto-clear or manual-clear. |
bogdanm | 83:8a40adfe8776 | 284 | * |
bogdanm | 83:8a40adfe8776 | 285 | * @retval kSuccess The object was successfully created. |
bogdanm | 83:8a40adfe8776 | 286 | * @retval kError Incorrect parameter or no more objects can be created. |
bogdanm | 83:8a40adfe8776 | 287 | */ |
bogdanm | 83:8a40adfe8776 | 288 | fsl_rtos_status event_create(event_object_t *obj, event_clear_type clearType); |
bogdanm | 83:8a40adfe8776 | 289 | |
bogdanm | 83:8a40adfe8776 | 290 | /*! |
bogdanm | 83:8a40adfe8776 | 291 | * @brief Wait for any event flags to be set. |
bogdanm | 83:8a40adfe8776 | 292 | * |
bogdanm | 83:8a40adfe8776 | 293 | * This function will wait for some time or wait forever if no flags are set. Any flags set |
bogdanm | 83:8a40adfe8776 | 294 | * will wake up the function. |
bogdanm | 83:8a40adfe8776 | 295 | * |
bogdanm | 83:8a40adfe8776 | 296 | * @param obj The event object. |
bogdanm | 83:8a40adfe8776 | 297 | * @param timeout The maximum number of milliseconds to wait for the event. |
bogdanm | 83:8a40adfe8776 | 298 | * Pass the #kSyncWaitForever constant to wait indefinitely. A value of 0 should not be passed |
bogdanm | 83:8a40adfe8776 | 299 | * to this function. |
bogdanm | 83:8a40adfe8776 | 300 | * @param setFlags Pointer to receive the flags that were set. |
bogdanm | 83:8a40adfe8776 | 301 | * |
bogdanm | 83:8a40adfe8776 | 302 | * @retval kSuccess An event was set. |
bogdanm | 83:8a40adfe8776 | 303 | * @retval kTimeout A timeout occurred. |
bogdanm | 83:8a40adfe8776 | 304 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 305 | */ |
bogdanm | 83:8a40adfe8776 | 306 | fsl_rtos_status event_wait(event_object_t *obj, uint32_t timeout, event_group_t *setFlags); |
bogdanm | 83:8a40adfe8776 | 307 | |
bogdanm | 83:8a40adfe8776 | 308 | /*! |
bogdanm | 83:8a40adfe8776 | 309 | * @brief Set one or more event flags of an event object. |
bogdanm | 83:8a40adfe8776 | 310 | * |
bogdanm | 83:8a40adfe8776 | 311 | * This function should not be called from an ISR. |
bogdanm | 83:8a40adfe8776 | 312 | * |
bogdanm | 83:8a40adfe8776 | 313 | * @param obj The event object. |
bogdanm | 83:8a40adfe8776 | 314 | * @param flags Event flags to be set. |
bogdanm | 83:8a40adfe8776 | 315 | * |
bogdanm | 83:8a40adfe8776 | 316 | * @retval kSuccess The flags were successfully set. |
bogdanm | 83:8a40adfe8776 | 317 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 318 | * |
bogdanm | 83:8a40adfe8776 | 319 | * @note There could be only one process waiting for the event. |
bogdanm | 83:8a40adfe8776 | 320 | * |
bogdanm | 83:8a40adfe8776 | 321 | */ |
bogdanm | 83:8a40adfe8776 | 322 | fsl_rtos_status event_set(event_object_t *obj, event_group_t flags); |
bogdanm | 83:8a40adfe8776 | 323 | |
bogdanm | 83:8a40adfe8776 | 324 | /*! |
bogdanm | 83:8a40adfe8776 | 325 | * @brief Set one or more event flags of an event object. |
bogdanm | 83:8a40adfe8776 | 326 | * |
bogdanm | 83:8a40adfe8776 | 327 | * This function should only be called from an ISR. |
bogdanm | 83:8a40adfe8776 | 328 | * |
bogdanm | 83:8a40adfe8776 | 329 | * @param obj The event object. |
bogdanm | 83:8a40adfe8776 | 330 | * @param flags Event flags to be set. |
bogdanm | 83:8a40adfe8776 | 331 | * |
bogdanm | 83:8a40adfe8776 | 332 | * @retval kSuccess The flags were successfully set. |
bogdanm | 83:8a40adfe8776 | 333 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 334 | */ |
bogdanm | 83:8a40adfe8776 | 335 | fsl_rtos_status event_set_from_isr(event_object_t *obj, event_group_t flags); |
bogdanm | 83:8a40adfe8776 | 336 | |
bogdanm | 83:8a40adfe8776 | 337 | /*! |
bogdanm | 83:8a40adfe8776 | 338 | * @brief Clear one or more events of an event object. |
bogdanm | 83:8a40adfe8776 | 339 | * |
bogdanm | 83:8a40adfe8776 | 340 | * This function should not be called from an ISR. |
bogdanm | 83:8a40adfe8776 | 341 | * |
bogdanm | 83:8a40adfe8776 | 342 | * @param obj The event object. |
bogdanm | 83:8a40adfe8776 | 343 | * @param flags Event flags to be clear. |
bogdanm | 83:8a40adfe8776 | 344 | * |
bogdanm | 83:8a40adfe8776 | 345 | * @retval kSuccess The flags were successfully cleared. |
bogdanm | 83:8a40adfe8776 | 346 | * @retval kError An incorrect parameter was passed. |
bogdanm | 83:8a40adfe8776 | 347 | */ |
bogdanm | 83:8a40adfe8776 | 348 | fsl_rtos_status event_clear(event_object_t *obj, event_group_t flags); |
bogdanm | 83:8a40adfe8776 | 349 | |
bogdanm | 83:8a40adfe8776 | 350 | /*! |
bogdanm | 83:8a40adfe8776 | 351 | * @brief Check the flags are set or not. |
bogdanm | 83:8a40adfe8776 | 352 | * |
bogdanm | 83:8a40adfe8776 | 353 | * @param obj The event object. |
bogdanm | 83:8a40adfe8776 | 354 | * @param flag The flag to check. |
bogdanm | 83:8a40adfe8776 | 355 | * |
bogdanm | 83:8a40adfe8776 | 356 | * @retval kFlagsSet The flags checked are set. |
bogdanm | 83:8a40adfe8776 | 357 | * @retval kFlagsNotSet The flags checked are not set or got an error. |
bogdanm | 83:8a40adfe8776 | 358 | */ |
bogdanm | 83:8a40adfe8776 | 359 | event_status event_check_flags(event_object_t *obj, event_group_t flag); |
bogdanm | 83:8a40adfe8776 | 360 | |
bogdanm | 83:8a40adfe8776 | 361 | /*! |
bogdanm | 83:8a40adfe8776 | 362 | * @brief Destroy a previously created event object. |
bogdanm | 83:8a40adfe8776 | 363 | * |
bogdanm | 83:8a40adfe8776 | 364 | * @param obj The event object to destroy. |
bogdanm | 83:8a40adfe8776 | 365 | * |
bogdanm | 83:8a40adfe8776 | 366 | * @retval kSuccess The object was successfully destroyed. |
bogdanm | 83:8a40adfe8776 | 367 | * @retval kError Event destruction failed. |
bogdanm | 83:8a40adfe8776 | 368 | */ |
bogdanm | 83:8a40adfe8776 | 369 | fsl_rtos_status event_destroy(event_object_t *obj); |
bogdanm | 83:8a40adfe8776 | 370 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 371 | |
bogdanm | 83:8a40adfe8776 | 372 | /*! |
bogdanm | 83:8a40adfe8776 | 373 | * @name Thread management |
bogdanm | 83:8a40adfe8776 | 374 | * @{ |
bogdanm | 83:8a40adfe8776 | 375 | */ |
bogdanm | 83:8a40adfe8776 | 376 | |
bogdanm | 83:8a40adfe8776 | 377 | /*! |
bogdanm | 83:8a40adfe8776 | 378 | * @brief Create a task. |
bogdanm | 83:8a40adfe8776 | 379 | * |
bogdanm | 83:8a40adfe8776 | 380 | * This function is wrapped by the macro task_create. Generally, this function is for |
bogdanm | 83:8a40adfe8776 | 381 | * internal use only, applications must use FSL_RTOS_TASK_DEFINE to define resources for |
bogdanm | 83:8a40adfe8776 | 382 | * task statically then use task_create to create task. If applications have prepare |
bogdanm | 83:8a40adfe8776 | 383 | * the resouces for task dynamically, they can use this function to create the task. |
bogdanm | 83:8a40adfe8776 | 384 | * |
bogdanm | 83:8a40adfe8776 | 385 | * @param task The task function. |
bogdanm | 83:8a40adfe8776 | 386 | * @param name The name of this task. |
bogdanm | 83:8a40adfe8776 | 387 | * @param stackSize The stack size in byte. |
bogdanm | 83:8a40adfe8776 | 388 | * @param stackMem Pointer to the stack. For bare metal, MQX and FreeRTOS, this could be NULL. |
bogdanm | 83:8a40adfe8776 | 389 | * @param priority Initial priority of the task. |
bogdanm | 83:8a40adfe8776 | 390 | * @param param Pointer to be passed to the task when it is created. |
bogdanm | 83:8a40adfe8776 | 391 | * @param usesFloat This task will use float register or not. |
bogdanm | 83:8a40adfe8776 | 392 | * @param handler Pointer to the task handler. |
bogdanm | 83:8a40adfe8776 | 393 | * |
bogdanm | 83:8a40adfe8776 | 394 | * @retval kSuccess The task was successfully created. |
bogdanm | 83:8a40adfe8776 | 395 | * @retval kError The task could not be created. |
bogdanm | 83:8a40adfe8776 | 396 | * |
bogdanm | 83:8a40adfe8776 | 397 | * @note Different tasks can not use the same task function. |
bogdanm | 83:8a40adfe8776 | 398 | */ |
bogdanm | 83:8a40adfe8776 | 399 | fsl_rtos_status __task_create(task_t task, uint8_t *name, uint16_t stackSize, |
bogdanm | 83:8a40adfe8776 | 400 | task_stack_t *stackMem, uint16_t priority, |
bogdanm | 83:8a40adfe8776 | 401 | void *param, bool usesFloat, task_handler_t *handler); |
bogdanm | 83:8a40adfe8776 | 402 | |
bogdanm | 83:8a40adfe8776 | 403 | /*! |
bogdanm | 83:8a40adfe8776 | 404 | * @brief Destroy a previously created task. |
bogdanm | 83:8a40adfe8776 | 405 | * @note Depending on the RTOS, task resources may or may not be automatically freed, |
bogdanm | 83:8a40adfe8776 | 406 | * and this function may not return if the current task is destroyed. |
bogdanm | 83:8a40adfe8776 | 407 | * |
bogdanm | 83:8a40adfe8776 | 408 | * @param handler The handler of the task to destroy. Returned by the task_create function. |
bogdanm | 83:8a40adfe8776 | 409 | * |
bogdanm | 83:8a40adfe8776 | 410 | * @retval kSuccess The task was successfully destroyed. |
bogdanm | 83:8a40adfe8776 | 411 | * @retval kError Task destruction failed or invalid parameter. |
bogdanm | 83:8a40adfe8776 | 412 | */ |
bogdanm | 83:8a40adfe8776 | 413 | fsl_rtos_status task_destroy(task_handler_t handler); |
bogdanm | 83:8a40adfe8776 | 414 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 415 | |
bogdanm | 83:8a40adfe8776 | 416 | /*! |
bogdanm | 83:8a40adfe8776 | 417 | * @name Message queues |
bogdanm | 83:8a40adfe8776 | 418 | * @{ |
bogdanm | 83:8a40adfe8776 | 419 | */ |
bogdanm | 83:8a40adfe8776 | 420 | |
bogdanm | 83:8a40adfe8776 | 421 | /*! |
bogdanm | 83:8a40adfe8776 | 422 | * @brief Initialize the message queue. |
bogdanm | 83:8a40adfe8776 | 423 | * |
bogdanm | 83:8a40adfe8776 | 424 | * This function will initialize the message queue that declared previously. |
bogdanm | 83:8a40adfe8776 | 425 | * Here is an example demonstrating how to use: |
bogdanm | 83:8a40adfe8776 | 426 | @code |
bogdanm | 83:8a40adfe8776 | 427 | msg_queue_handler_t handler; |
bogdanm | 83:8a40adfe8776 | 428 | MSG_QUEUE_DECLARE(my_message, msg_num, msg_size); |
bogdanm | 83:8a40adfe8776 | 429 | handler = msg_queue_create(&my_message, msg_num, msg_size); |
bogdanm | 83:8a40adfe8776 | 430 | @endcode |
bogdanm | 83:8a40adfe8776 | 431 | * |
bogdanm | 83:8a40adfe8776 | 432 | * @param queue The queue declared through the MSG_QUEUE_DECLARE macro. |
bogdanm | 83:8a40adfe8776 | 433 | * @param number The number of elements in the queue. |
bogdanm | 83:8a40adfe8776 | 434 | * @param size Size of every elements in words. |
bogdanm | 83:8a40adfe8776 | 435 | * |
bogdanm | 83:8a40adfe8776 | 436 | * @retval Handler to access the queue for put and get operations. If message queue |
bogdanm | 83:8a40adfe8776 | 437 | * created failed, return 0. |
bogdanm | 83:8a40adfe8776 | 438 | */ |
bogdanm | 83:8a40adfe8776 | 439 | msg_queue_handler_t msg_queue_create(msg_queue_t *queue, uint16_t number, uint16_t size); |
bogdanm | 83:8a40adfe8776 | 440 | |
bogdanm | 83:8a40adfe8776 | 441 | /*! |
bogdanm | 83:8a40adfe8776 | 442 | * @brief Introduce an element at the tail of the queue. |
bogdanm | 83:8a40adfe8776 | 443 | * |
bogdanm | 83:8a40adfe8776 | 444 | * @param handler Queue handler returned by the msg_queue_create function. |
bogdanm | 83:8a40adfe8776 | 445 | * @param item Pointer to the element to be introduced in the queue. |
bogdanm | 83:8a40adfe8776 | 446 | * |
bogdanm | 83:8a40adfe8776 | 447 | * @retval kSuccess Element successfully introduced in the queue. |
bogdanm | 83:8a40adfe8776 | 448 | * @retval kError The queue was full or an invalid parameter was passed. |
bogdanm | 83:8a40adfe8776 | 449 | */ |
bogdanm | 83:8a40adfe8776 | 450 | fsl_rtos_status msg_queue_put(msg_queue_handler_t handler, msg_queue_item_t item); |
bogdanm | 83:8a40adfe8776 | 451 | |
bogdanm | 83:8a40adfe8776 | 452 | /*! |
bogdanm | 83:8a40adfe8776 | 453 | * @brief Read and remove an element at the head of the queue. |
bogdanm | 83:8a40adfe8776 | 454 | * |
bogdanm | 83:8a40adfe8776 | 455 | * @param handler Queue handler returned by the msg_queue_create function. |
bogdanm | 83:8a40adfe8776 | 456 | * @param item Pointer to store a pointer to the element of the queue. |
bogdanm | 83:8a40adfe8776 | 457 | * @param timeout In case the queue is empty, the number of milliseconds to |
bogdanm | 83:8a40adfe8776 | 458 | * wait for an element to be introduced into the queue. Use 0 to return |
bogdanm | 83:8a40adfe8776 | 459 | * immediately or #kSyncWaitForever to wait indefinitely. |
bogdanm | 83:8a40adfe8776 | 460 | * |
bogdanm | 83:8a40adfe8776 | 461 | * @retval kSuccess Element successfully obtained from the queue. |
bogdanm | 83:8a40adfe8776 | 462 | * @retval kTimeout If a timeout was specified, the queue remained empty after timeout. |
bogdanm | 83:8a40adfe8776 | 463 | * @retval kError The queue was empty or the handler was invalid. |
bogdanm | 83:8a40adfe8776 | 464 | * @retval kIdle The queue was empty and the timeout has not expired. |
bogdanm | 83:8a40adfe8776 | 465 | * |
bogdanm | 83:8a40adfe8776 | 466 | * @note There should be only one process waiting on the queue. |
bogdanm | 83:8a40adfe8776 | 467 | */ |
bogdanm | 83:8a40adfe8776 | 468 | fsl_rtos_status msg_queue_get(msg_queue_handler_t handler, |
bogdanm | 83:8a40adfe8776 | 469 | msg_queue_item_t *item, |
bogdanm | 83:8a40adfe8776 | 470 | uint32_t timeout); |
bogdanm | 83:8a40adfe8776 | 471 | |
bogdanm | 83:8a40adfe8776 | 472 | /*! |
bogdanm | 83:8a40adfe8776 | 473 | * @brief Discards all elements in the queue and leaves the queue empty. |
bogdanm | 83:8a40adfe8776 | 474 | * |
bogdanm | 83:8a40adfe8776 | 475 | * @param handler Queue handler returned by the msg_queue_create function. |
bogdanm | 83:8a40adfe8776 | 476 | * |
bogdanm | 83:8a40adfe8776 | 477 | * @retval kSuccess Queue successfully emptied. |
bogdanm | 83:8a40adfe8776 | 478 | * @retval kError Emptying queue failed. |
bogdanm | 83:8a40adfe8776 | 479 | */ |
bogdanm | 83:8a40adfe8776 | 480 | fsl_rtos_status msg_queue_flush(msg_queue_handler_t handler); |
bogdanm | 83:8a40adfe8776 | 481 | |
bogdanm | 83:8a40adfe8776 | 482 | /*! |
bogdanm | 83:8a40adfe8776 | 483 | * @brief Destroy a previously created queue. |
bogdanm | 83:8a40adfe8776 | 484 | * |
bogdanm | 83:8a40adfe8776 | 485 | * @param handler Queue handler returned by the msg_queue_create function. |
bogdanm | 83:8a40adfe8776 | 486 | * |
bogdanm | 83:8a40adfe8776 | 487 | * @retval kSuccess The queue was successfully destroyed. |
bogdanm | 83:8a40adfe8776 | 488 | * @retval kError Message queue destruction failed. |
bogdanm | 83:8a40adfe8776 | 489 | */ |
bogdanm | 83:8a40adfe8776 | 490 | fsl_rtos_status msg_queue_destroy(msg_queue_handler_t handler); |
bogdanm | 83:8a40adfe8776 | 491 | |
bogdanm | 83:8a40adfe8776 | 492 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 493 | |
bogdanm | 83:8a40adfe8776 | 494 | #ifndef FSL_RTOS_MBED |
bogdanm | 83:8a40adfe8776 | 495 | /*! |
bogdanm | 83:8a40adfe8776 | 496 | * @name Memory Management |
bogdanm | 83:8a40adfe8776 | 497 | * @{ |
bogdanm | 83:8a40adfe8776 | 498 | */ |
bogdanm | 83:8a40adfe8776 | 499 | |
bogdanm | 83:8a40adfe8776 | 500 | /*! |
bogdanm | 83:8a40adfe8776 | 501 | * @brief Reserves the requested amount of memory in bytes. |
bogdanm | 83:8a40adfe8776 | 502 | * |
bogdanm | 83:8a40adfe8776 | 503 | * @param size Amount of bytes to reserve. |
bogdanm | 83:8a40adfe8776 | 504 | * |
bogdanm | 83:8a40adfe8776 | 505 | * @retval Pointer to the reserved memory. NULL if memory could not be allocated. |
bogdanm | 83:8a40adfe8776 | 506 | */ |
bogdanm | 83:8a40adfe8776 | 507 | void * mem_allocate(size_t size); |
bogdanm | 83:8a40adfe8776 | 508 | |
bogdanm | 83:8a40adfe8776 | 509 | /*! |
bogdanm | 83:8a40adfe8776 | 510 | * @brief Reserves the requested amount of memory in bytes and initializes it to 0. |
bogdanm | 83:8a40adfe8776 | 511 | * |
bogdanm | 83:8a40adfe8776 | 512 | * @param size Amount of bytes to reserve. |
bogdanm | 83:8a40adfe8776 | 513 | * |
bogdanm | 83:8a40adfe8776 | 514 | * @retval Pointer to the reserved memory. NULL if memory could not be allocated. |
bogdanm | 83:8a40adfe8776 | 515 | */ |
bogdanm | 83:8a40adfe8776 | 516 | void * mem_allocate_zero(size_t size); |
bogdanm | 83:8a40adfe8776 | 517 | |
bogdanm | 83:8a40adfe8776 | 518 | /*! |
bogdanm | 83:8a40adfe8776 | 519 | * @brief Releases the memory previously reserved. |
bogdanm | 83:8a40adfe8776 | 520 | * |
bogdanm | 83:8a40adfe8776 | 521 | * @param ptr Pointer to the start of the memory block previously reserved. |
bogdanm | 83:8a40adfe8776 | 522 | * |
bogdanm | 83:8a40adfe8776 | 523 | * @retval kSuccess Memory correctly released. |
bogdanm | 83:8a40adfe8776 | 524 | */ |
bogdanm | 83:8a40adfe8776 | 525 | fsl_rtos_status mem_free(void *ptr); |
bogdanm | 83:8a40adfe8776 | 526 | #endif |
bogdanm | 83:8a40adfe8776 | 527 | |
bogdanm | 83:8a40adfe8776 | 528 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 529 | |
bogdanm | 83:8a40adfe8776 | 530 | /*! |
bogdanm | 83:8a40adfe8776 | 531 | * @name Time management |
bogdanm | 83:8a40adfe8776 | 532 | * @{ |
bogdanm | 83:8a40adfe8776 | 533 | */ |
bogdanm | 83:8a40adfe8776 | 534 | |
bogdanm | 83:8a40adfe8776 | 535 | /*! |
bogdanm | 83:8a40adfe8776 | 536 | * @brief Delays execution for a number of milliseconds. |
bogdanm | 83:8a40adfe8776 | 537 | * |
bogdanm | 83:8a40adfe8776 | 538 | * @param delay The time in milliseconds to wait. |
bogdanm | 83:8a40adfe8776 | 539 | */ |
bogdanm | 83:8a40adfe8776 | 540 | void time_delay(uint32_t delay); |
bogdanm | 83:8a40adfe8776 | 541 | |
bogdanm | 83:8a40adfe8776 | 542 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 543 | |
bogdanm | 83:8a40adfe8776 | 544 | /*! |
bogdanm | 83:8a40adfe8776 | 545 | * @name Interrupt management |
bogdanm | 83:8a40adfe8776 | 546 | * @{ |
bogdanm | 83:8a40adfe8776 | 547 | */ |
bogdanm | 83:8a40adfe8776 | 548 | |
bogdanm | 83:8a40adfe8776 | 549 | /*! |
bogdanm | 83:8a40adfe8776 | 550 | * @brief Install interrupt handler. |
bogdanm | 83:8a40adfe8776 | 551 | * |
bogdanm | 83:8a40adfe8776 | 552 | * @param irqNumber IRQ number of the interrupt. |
bogdanm | 83:8a40adfe8776 | 553 | * @param handler The interrupt handler to install. |
bogdanm | 83:8a40adfe8776 | 554 | * |
bogdanm | 83:8a40adfe8776 | 555 | * @retval kSuccess Handler is installed successfully. |
bogdanm | 83:8a40adfe8776 | 556 | * @retval kSuccess Handler could not be installed. |
bogdanm | 83:8a40adfe8776 | 557 | */ |
bogdanm | 83:8a40adfe8776 | 558 | fsl_rtos_status interrupt_handler_register(int32_t irqNumber, void (*handler)(void)); |
bogdanm | 83:8a40adfe8776 | 559 | |
bogdanm | 83:8a40adfe8776 | 560 | /* @} */ |
bogdanm | 83:8a40adfe8776 | 561 | |
bogdanm | 83:8a40adfe8776 | 562 | #if defined(__cplusplus) |
bogdanm | 83:8a40adfe8776 | 563 | } |
bogdanm | 83:8a40adfe8776 | 564 | #endif |
bogdanm | 83:8a40adfe8776 | 565 | |
bogdanm | 83:8a40adfe8776 | 566 | /*! @}*/ |
bogdanm | 83:8a40adfe8776 | 567 | |
bogdanm | 83:8a40adfe8776 | 568 | #endif /* __FSL_OS_ABSTRACTION_H__ */ |
bogdanm | 83:8a40adfe8776 | 569 | /******************************************************************************* |
bogdanm | 83:8a40adfe8776 | 570 | * EOF |
bogdanm | 83:8a40adfe8776 | 571 | ******************************************************************************/ |
bogdanm | 83:8a40adfe8776 | 572 |