1 /* 2 * Copyright (c) 2013-2016 ARM Limited. All rights reserved. 3 * Copyright (c) 2016, Freescale Semiconductor, Inc. Not a Contribution. 4 * Copyright 2016-2020 NXP. Not a Contribution. 5 * 6 * SPDX-License-Identifier: Apache-2.0 7 * 8 * Licensed under the Apache License, Version 2.0 (the License); you may 9 * not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 #ifndef _FSL_SPI_CMSIS_H_ 22 #define _FSL_SPI_CMSIS_H_ 23 24 #include "fsl_ecspi.h" 25 #include "RTE_Device.h" 26 #include "Driver_SPI.h" 27 #if ((defined(RTE_SPI1_DMA_EN) && RTE_SPI1_DMA_EN) || (defined(RTE_SPI2_DMA_EN) && RTE_SPI2_DMA_EN) || \ 28 (defined(RTE_SPI3_DMA_EN) && RTE_SPI3_DMA_EN)) 29 #if defined(FSL_FEATURE_SOC_SDMA_COUNT) && (FSL_FEATURE_SOC_SDMA_COUNT) 30 #include "fsl_ecspi_sdma.h" 31 #endif 32 #endif 33 34 #if defined(ECSPI1) && defined(RTE_SPI1) && RTE_SPI1 35 extern ARM_DRIVER_SPI Driver_SPI1; 36 #endif /* SPI1 */ 37 38 #if defined(ECSPI2) && defined(RTE_SPI2) && RTE_SPI2 39 extern ARM_DRIVER_SPI Driver_SPI2; 40 #endif /* SPI2 */ 41 42 #if defined(ECSPI3) && defined(RTE_SPI3) && RTE_SPI3 43 extern ARM_DRIVER_SPI Driver_SPI3; 44 #endif /* SPI3 */ 45 46 #define SPI_FLAG_UNINIT (0UL) 47 #define SPI_FLAG_INIT (1UL << 0) 48 #define SPI_FLAG_POWER (1UL << 1) 49 #define SPI_FLAG_CONFIGURED (1UL << 2) 50 #define SPI_FLAG_MASTER (1UL << 3) 51 52 #endif 53