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 Sep 18 14:00:17 2014 +0100
Revision:
324:406fd2029f23
Parent:
168:cf9372ac0a74
Synchronized with git revision a73f28e6fbca9559fbed2726410eeb4c0534a4a5

Full URL: https://github.com/mbedmicro/mbed/commit/a73f28e6fbca9559fbed2726410eeb4c0534a4a5/

Extended #476, which does not break ethernet for K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 168:cf9372ac0a74 1 /*
mbed_official 168:cf9372ac0a74 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 168:cf9372ac0a74 3 * All rights reserved.
mbed_official 168:cf9372ac0a74 4 *
mbed_official 168:cf9372ac0a74 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 168:cf9372ac0a74 6 * are permitted provided that the following conditions are met:
mbed_official 168:cf9372ac0a74 7 *
mbed_official 168:cf9372ac0a74 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 168:cf9372ac0a74 9 * of conditions and the following disclaimer.
mbed_official 168:cf9372ac0a74 10 *
mbed_official 168:cf9372ac0a74 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 168:cf9372ac0a74 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 168:cf9372ac0a74 13 * other materials provided with the distribution.
mbed_official 168:cf9372ac0a74 14 *
mbed_official 168:cf9372ac0a74 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 168:cf9372ac0a74 16 * contributors may be used to endorse or promote products derived from this
mbed_official 168:cf9372ac0a74 17 * software without specific prior written permission.
mbed_official 168:cf9372ac0a74 18 *
mbed_official 168:cf9372ac0a74 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 168:cf9372ac0a74 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 168:cf9372ac0a74 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 168:cf9372ac0a74 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 168:cf9372ac0a74 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 168:cf9372ac0a74 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 168:cf9372ac0a74 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 168:cf9372ac0a74 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 168:cf9372ac0a74 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 168:cf9372ac0a74 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 168:cf9372ac0a74 29 */
mbed_official 168:cf9372ac0a74 30 #if !defined(__FSL_INTERRUPT_MANAGER_H__)
mbed_official 168:cf9372ac0a74 31 #define __FSL_INTERRUPT_MANAGER_H__
mbed_official 168:cf9372ac0a74 32
mbed_official 168:cf9372ac0a74 33 #include <stdint.h>
mbed_official 168:cf9372ac0a74 34 #include <stdbool.h>
mbed_official 168:cf9372ac0a74 35 #include <assert.h>
mbed_official 168:cf9372ac0a74 36 #include "fsl_interrupt_features.h"
mbed_official 168:cf9372ac0a74 37 #include "device/fsl_device_registers.h"
mbed_official 168:cf9372ac0a74 38
mbed_official 168:cf9372ac0a74 39 /*! @addtogroup interrupt_manager*/
mbed_official 168:cf9372ac0a74 40 /*! @{*/
mbed_official 168:cf9372ac0a74 41
mbed_official 168:cf9372ac0a74 42 /*! @file*/
mbed_official 168:cf9372ac0a74 43
mbed_official 168:cf9372ac0a74 44 /*******************************************************************************
mbed_official 168:cf9372ac0a74 45 * Definitions
mbed_official 168:cf9372ac0a74 46 ******************************************************************************/
mbed_official 168:cf9372ac0a74 47
mbed_official 168:cf9372ac0a74 48 /*******************************************************************************
mbed_official 168:cf9372ac0a74 49 * API
mbed_official 168:cf9372ac0a74 50 ******************************************************************************/
mbed_official 168:cf9372ac0a74 51
mbed_official 168:cf9372ac0a74 52 #if defined(__cplusplus)
mbed_official 168:cf9372ac0a74 53 extern "C" {
mbed_official 168:cf9372ac0a74 54 #endif /* __cplusplus*/
mbed_official 168:cf9372ac0a74 55
mbed_official 168:cf9372ac0a74 56 /*! @name interrupt_manager APIs*/
mbed_official 168:cf9372ac0a74 57 /*@{*/
mbed_official 168:cf9372ac0a74 58
mbed_official 168:cf9372ac0a74 59 /*!
mbed_official 168:cf9372ac0a74 60 * @brief Installs an interrupt handler routine for a given IRQ number.
mbed_official 168:cf9372ac0a74 61 *
mbed_official 168:cf9372ac0a74 62 * This function lets the application register/replace the interrupt
mbed_official 168:cf9372ac0a74 63 * handler for a specified IRQ number. The IRQ number is different than the vector
mbed_official 168:cf9372ac0a74 64 * number. IRQ 0 starts from the vector 16 address. See a chip-specific reference
mbed_official 168:cf9372ac0a74 65 * manual for details and the startup_MKxxxx.s file for each chip
mbed_official 168:cf9372ac0a74 66 * family to find out the default interrupt handler for each device. This
mbed_official 168:cf9372ac0a74 67 * function converts the IRQ number to the vector number by adding 16 to
mbed_official 168:cf9372ac0a74 68 * it.
mbed_official 168:cf9372ac0a74 69 *
mbed_official 168:cf9372ac0a74 70 * @param irqNumber IRQ number
mbed_official 168:cf9372ac0a74 71 * @param handler Interrupt handler routine address pointer
mbed_official 168:cf9372ac0a74 72 */
mbed_official 324:406fd2029f23 73 void INT_SYS_InstallHandler(IRQn_Type irqNumber, void (*handler)(void));
mbed_official 168:cf9372ac0a74 74
mbed_official 168:cf9372ac0a74 75 /*!
mbed_official 168:cf9372ac0a74 76 * @brief Enables an interrupt for a given IRQ number.
mbed_official 168:cf9372ac0a74 77 *
mbed_official 168:cf9372ac0a74 78 * This function enables the individual interrupt for a specified IRQ
mbed_official 168:cf9372ac0a74 79 * number. It calls the system NVIC API to access the interrupt control
mbed_official 168:cf9372ac0a74 80 * register. The input IRQ number does not include the core interrupt, only
mbed_official 168:cf9372ac0a74 81 * the peripheral interrupt, from 0 to a maximum supported IRQ.
mbed_official 168:cf9372ac0a74 82 *
mbed_official 168:cf9372ac0a74 83 * @param irqNumber IRQ number
mbed_official 168:cf9372ac0a74 84 */
mbed_official 324:406fd2029f23 85 static inline void INT_SYS_EnableIRQ(IRQn_Type irqNumber)
mbed_official 168:cf9372ac0a74 86 {
mbed_official 168:cf9372ac0a74 87 /* check IRQ number */
mbed_official 168:cf9372ac0a74 88 assert(0 <= irqNumber);
mbed_official 168:cf9372ac0a74 89 assert(irqNumber <= FSL_FEATURE_INTERRUPT_IRQ_MAX);
mbed_official 168:cf9372ac0a74 90
mbed_official 168:cf9372ac0a74 91 /* call core API to enable the IRQ*/
mbed_official 168:cf9372ac0a74 92 NVIC_EnableIRQ(irqNumber);
mbed_official 168:cf9372ac0a74 93 }
mbed_official 168:cf9372ac0a74 94
mbed_official 168:cf9372ac0a74 95 /*!
mbed_official 168:cf9372ac0a74 96 * @brief Disables an interrupt for a given IRQ number.
mbed_official 168:cf9372ac0a74 97 *
mbed_official 168:cf9372ac0a74 98 * This function enables the individual interrupt for a specified IRQ
mbed_official 168:cf9372ac0a74 99 * number. It calls the system NVIC API to access the interrupt control
mbed_official 168:cf9372ac0a74 100 * register.
mbed_official 168:cf9372ac0a74 101 *
mbed_official 168:cf9372ac0a74 102 * @param irqNumber IRQ number
mbed_official 168:cf9372ac0a74 103 */
mbed_official 324:406fd2029f23 104 static inline void INT_SYS_DisableIRQ(IRQn_Type irqNumber)
mbed_official 168:cf9372ac0a74 105 {
mbed_official 168:cf9372ac0a74 106 /* check IRQ number */
mbed_official 168:cf9372ac0a74 107 assert(0 <= irqNumber);
mbed_official 168:cf9372ac0a74 108 assert(irqNumber <= FSL_FEATURE_INTERRUPT_IRQ_MAX);
mbed_official 168:cf9372ac0a74 109
mbed_official 168:cf9372ac0a74 110 /* call core API to disable the IRQ*/
mbed_official 168:cf9372ac0a74 111 NVIC_DisableIRQ(irqNumber);
mbed_official 168:cf9372ac0a74 112 }
mbed_official 168:cf9372ac0a74 113
mbed_official 168:cf9372ac0a74 114 /*!
mbed_official 168:cf9372ac0a74 115 * @brief Enables system interrupt.
mbed_official 168:cf9372ac0a74 116 *
mbed_official 168:cf9372ac0a74 117 * This function enables the global interrupt by calling the core API.
mbed_official 168:cf9372ac0a74 118 *
mbed_official 168:cf9372ac0a74 119 */
mbed_official 324:406fd2029f23 120 void INT_SYS_EnableIRQGlobal(void);
mbed_official 168:cf9372ac0a74 121
mbed_official 168:cf9372ac0a74 122 /*!
mbed_official 168:cf9372ac0a74 123 * @brief Disable system interrupt.
mbed_official 168:cf9372ac0a74 124 *
mbed_official 168:cf9372ac0a74 125 * This function disables the global interrupt by calling the core API.
mbed_official 168:cf9372ac0a74 126 *
mbed_official 168:cf9372ac0a74 127 */
mbed_official 324:406fd2029f23 128 void INT_SYS_DisableIRQGlobal(void);
mbed_official 168:cf9372ac0a74 129
mbed_official 168:cf9372ac0a74 130 /*@}*/
mbed_official 168:cf9372ac0a74 131
mbed_official 168:cf9372ac0a74 132 #if defined(__cplusplus)
mbed_official 168:cf9372ac0a74 133 }
mbed_official 168:cf9372ac0a74 134 #endif /* __cplusplus*/
mbed_official 168:cf9372ac0a74 135
mbed_official 168:cf9372ac0a74 136 /*! @}*/
mbed_official 168:cf9372ac0a74 137
mbed_official 168:cf9372ac0a74 138 #endif /* __FSL_INTERRUPT_MANAGER_H__*/
mbed_official 168:cf9372ac0a74 139 /*******************************************************************************
mbed_official 168:cf9372ac0a74 140 * EOF
mbed_official 168:cf9372ac0a74 141 ******************************************************************************/
mbed_official 168:cf9372ac0a74 142