The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_LPC54114/TOOLCHAIN_GCC_ARM/fsl_flexcomm.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 148:fd96258d940d | 1 | /* |
Kojto | 148:fd96258d940d | 2 | * Copyright (c) 2016, Freescale Semiconductor, Inc. |
Kojto | 148:fd96258d940d | 3 | * All rights reserved. |
Kojto | 148:fd96258d940d | 4 | * |
Kojto | 148:fd96258d940d | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 148:fd96258d940d | 6 | * are permitted provided that the following conditions are met: |
Kojto | 148:fd96258d940d | 7 | * |
Kojto | 148:fd96258d940d | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
Kojto | 148:fd96258d940d | 9 | * of conditions and the following disclaimer. |
Kojto | 148:fd96258d940d | 10 | * |
Kojto | 148:fd96258d940d | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
Kojto | 148:fd96258d940d | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Kojto | 148:fd96258d940d | 13 | * other materials provided with the distribution. |
Kojto | 148:fd96258d940d | 14 | * |
Kojto | 148:fd96258d940d | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
Kojto | 148:fd96258d940d | 16 | * contributors may be used to endorse or promote products derived from this |
Kojto | 148:fd96258d940d | 17 | * software without specific prior written permission. |
Kojto | 148:fd96258d940d | 18 | * |
Kojto | 148:fd96258d940d | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Kojto | 148:fd96258d940d | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Kojto | 148:fd96258d940d | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 148:fd96258d940d | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Kojto | 148:fd96258d940d | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Kojto | 148:fd96258d940d | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Kojto | 148:fd96258d940d | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Kojto | 148:fd96258d940d | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Kojto | 148:fd96258d940d | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Kojto | 148:fd96258d940d | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 148:fd96258d940d | 29 | */ |
Kojto | 148:fd96258d940d | 30 | #ifndef _FSL_FLEXCOMM_H_ |
Kojto | 148:fd96258d940d | 31 | #define _FSL_FLEXCOMM_H_ |
Kojto | 148:fd96258d940d | 32 | |
Kojto | 148:fd96258d940d | 33 | #include "fsl_common.h" |
Kojto | 148:fd96258d940d | 34 | |
Kojto | 148:fd96258d940d | 35 | /*! |
Kojto | 148:fd96258d940d | 36 | * @addtogroup flexcomm_driver |
Kojto | 148:fd96258d940d | 37 | * @{ |
Kojto | 148:fd96258d940d | 38 | */ |
Kojto | 148:fd96258d940d | 39 | |
Kojto | 148:fd96258d940d | 40 | /*! @brief FLEXCOMM peripheral modes. */ |
Kojto | 148:fd96258d940d | 41 | typedef enum |
Kojto | 148:fd96258d940d | 42 | { |
Kojto | 148:fd96258d940d | 43 | FLEXCOMM_PERIPH_NONE, /*!< No peripheral */ |
Kojto | 148:fd96258d940d | 44 | FLEXCOMM_PERIPH_USART, /*!< USART peripheral */ |
Kojto | 148:fd96258d940d | 45 | FLEXCOMM_PERIPH_SPI, /*!< SPI Peripheral */ |
Kojto | 148:fd96258d940d | 46 | FLEXCOMM_PERIPH_I2C, /*!< I2C Peripheral */ |
Kojto | 148:fd96258d940d | 47 | FLEXCOMM_PERIPH_I2S_TX, /*!< I2S TX Peripheral */ |
Kojto | 148:fd96258d940d | 48 | FLEXCOMM_PERIPH_I2S_RX, /*!< I2S RX Peripheral */ |
Kojto | 148:fd96258d940d | 49 | } FLEXCOMM_PERIPH_T; |
Kojto | 148:fd96258d940d | 50 | |
Kojto | 148:fd96258d940d | 51 | /*! @brief Typedef for interrupt handler. */ |
Kojto | 148:fd96258d940d | 52 | typedef void (*flexcomm_irq_handler_t)(void *base, void *handle); |
Kojto | 148:fd96258d940d | 53 | |
Kojto | 148:fd96258d940d | 54 | /*! @brief Array with IRQ number for each FLEXCOMM module. */ |
Kojto | 148:fd96258d940d | 55 | extern IRQn_Type const kFlexcommIrqs[]; |
Kojto | 148:fd96258d940d | 56 | |
Kojto | 148:fd96258d940d | 57 | /*! @brief Returns instance number for FLEXCOMM module with given base address. */ |
Kojto | 148:fd96258d940d | 58 | uint32_t FLEXCOMM_GetInstance(void *base); |
Kojto | 148:fd96258d940d | 59 | |
Kojto | 148:fd96258d940d | 60 | /*! @brief Initializes FLEXCOMM and selects peripheral mode according to the second parameter. */ |
Kojto | 148:fd96258d940d | 61 | status_t FLEXCOMM_Init(void *base, FLEXCOMM_PERIPH_T periph); |
Kojto | 148:fd96258d940d | 62 | |
Kojto | 148:fd96258d940d | 63 | /*! @brief Sets IRQ handler for given FLEXCOMM module. It is used by drivers register IRQ handler according to FLEXCOMM |
Kojto | 148:fd96258d940d | 64 | * mode */ |
Kojto | 148:fd96258d940d | 65 | void FLEXCOMM_SetIRQHandler(void *base, flexcomm_irq_handler_t handler, void *handle); |
Kojto | 148:fd96258d940d | 66 | |
Kojto | 148:fd96258d940d | 67 | /*@}*/ |
Kojto | 148:fd96258d940d | 68 | |
Kojto | 148:fd96258d940d | 69 | #endif /* _FSL_FLEXCOMM_H_*/ |