![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/drivers/fsl_flexio_spi.h@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
kadonotakashi | 0:8fdf9a60065b | 3 | * All rights reserved. |
kadonotakashi | 0:8fdf9a60065b | 4 | * |
kadonotakashi | 0:8fdf9a60065b | 5 | * Redistribution and use in source and binary forms, with or without modification, |
kadonotakashi | 0:8fdf9a60065b | 6 | * are permitted provided that the following conditions are met: |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
kadonotakashi | 0:8fdf9a60065b | 9 | * of conditions and the following disclaimer. |
kadonotakashi | 0:8fdf9a60065b | 10 | * |
kadonotakashi | 0:8fdf9a60065b | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
kadonotakashi | 0:8fdf9a60065b | 12 | * list of conditions and the following disclaimer in the documentation and/or |
kadonotakashi | 0:8fdf9a60065b | 13 | * other materials provided with the distribution. |
kadonotakashi | 0:8fdf9a60065b | 14 | * |
kadonotakashi | 0:8fdf9a60065b | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
kadonotakashi | 0:8fdf9a60065b | 16 | * contributors may be used to endorse or promote products derived from this |
kadonotakashi | 0:8fdf9a60065b | 17 | * software without specific prior written permission. |
kadonotakashi | 0:8fdf9a60065b | 18 | * |
kadonotakashi | 0:8fdf9a60065b | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
kadonotakashi | 0:8fdf9a60065b | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
kadonotakashi | 0:8fdf9a60065b | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
kadonotakashi | 0:8fdf9a60065b | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
kadonotakashi | 0:8fdf9a60065b | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
kadonotakashi | 0:8fdf9a60065b | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
kadonotakashi | 0:8fdf9a60065b | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
kadonotakashi | 0:8fdf9a60065b | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
kadonotakashi | 0:8fdf9a60065b | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
kadonotakashi | 0:8fdf9a60065b | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
kadonotakashi | 0:8fdf9a60065b | 29 | */ |
kadonotakashi | 0:8fdf9a60065b | 30 | |
kadonotakashi | 0:8fdf9a60065b | 31 | #ifndef _FSL_FLEXIO_SPI_H_ |
kadonotakashi | 0:8fdf9a60065b | 32 | #define _FSL_FLEXIO_SPI_H_ |
kadonotakashi | 0:8fdf9a60065b | 33 | |
kadonotakashi | 0:8fdf9a60065b | 34 | #include "fsl_common.h" |
kadonotakashi | 0:8fdf9a60065b | 35 | #include "fsl_flexio.h" |
kadonotakashi | 0:8fdf9a60065b | 36 | |
kadonotakashi | 0:8fdf9a60065b | 37 | /*! |
kadonotakashi | 0:8fdf9a60065b | 38 | * @addtogroup flexio_spi |
kadonotakashi | 0:8fdf9a60065b | 39 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 40 | */ |
kadonotakashi | 0:8fdf9a60065b | 41 | |
kadonotakashi | 0:8fdf9a60065b | 42 | /*! @file */ |
kadonotakashi | 0:8fdf9a60065b | 43 | |
kadonotakashi | 0:8fdf9a60065b | 44 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 45 | * Definitions |
kadonotakashi | 0:8fdf9a60065b | 46 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 47 | |
kadonotakashi | 0:8fdf9a60065b | 48 | /*! @name Driver version */ |
kadonotakashi | 0:8fdf9a60065b | 49 | /*@{*/ |
kadonotakashi | 0:8fdf9a60065b | 50 | /*! @brief FlexIO SPI driver version 2.1.0. */ |
kadonotakashi | 0:8fdf9a60065b | 51 | #define FSL_FLEXIO_SPI_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) |
kadonotakashi | 0:8fdf9a60065b | 52 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 53 | |
kadonotakashi | 0:8fdf9a60065b | 54 | /*! @brief FlexIO SPI dummy transfer data, the data is sent while txData is NULL. */ |
kadonotakashi | 0:8fdf9a60065b | 55 | #define FLEXIO_SPI_DUMMYDATA (0xFFFFU) |
kadonotakashi | 0:8fdf9a60065b | 56 | |
kadonotakashi | 0:8fdf9a60065b | 57 | /*! @brief Error codes for the FlexIO SPI driver. */ |
kadonotakashi | 0:8fdf9a60065b | 58 | enum _flexio_spi_status |
kadonotakashi | 0:8fdf9a60065b | 59 | { |
kadonotakashi | 0:8fdf9a60065b | 60 | kStatus_FLEXIO_SPI_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 1), /*!< FlexIO SPI is busy. */ |
kadonotakashi | 0:8fdf9a60065b | 61 | kStatus_FLEXIO_SPI_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 2), /*!< SPI is idle */ |
kadonotakashi | 0:8fdf9a60065b | 62 | kStatus_FLEXIO_SPI_Error = MAKE_STATUS(kStatusGroup_FLEXIO_SPI, 3), /*!< FlexIO SPI error. */ |
kadonotakashi | 0:8fdf9a60065b | 63 | }; |
kadonotakashi | 0:8fdf9a60065b | 64 | |
kadonotakashi | 0:8fdf9a60065b | 65 | /*! @brief FlexIO SPI clock phase configuration. */ |
kadonotakashi | 0:8fdf9a60065b | 66 | typedef enum _flexio_spi_clock_phase |
kadonotakashi | 0:8fdf9a60065b | 67 | { |
kadonotakashi | 0:8fdf9a60065b | 68 | kFLEXIO_SPI_ClockPhaseFirstEdge = 0x0U, /*!< First edge on SPSCK occurs at the middle of the first |
kadonotakashi | 0:8fdf9a60065b | 69 | * cycle of a data transfer. */ |
kadonotakashi | 0:8fdf9a60065b | 70 | kFLEXIO_SPI_ClockPhaseSecondEdge = 0x1U, /*!< First edge on SPSCK occurs at the start of the |
kadonotakashi | 0:8fdf9a60065b | 71 | * first cycle of a data transfer. */ |
kadonotakashi | 0:8fdf9a60065b | 72 | } flexio_spi_clock_phase_t; |
kadonotakashi | 0:8fdf9a60065b | 73 | |
kadonotakashi | 0:8fdf9a60065b | 74 | /*! @brief FlexIO SPI data shifter direction options. */ |
kadonotakashi | 0:8fdf9a60065b | 75 | typedef enum _flexio_spi_shift_direction |
kadonotakashi | 0:8fdf9a60065b | 76 | { |
kadonotakashi | 0:8fdf9a60065b | 77 | kFLEXIO_SPI_MsbFirst = 0, /*!< Data transfers start with most significant bit. */ |
kadonotakashi | 0:8fdf9a60065b | 78 | kFLEXIO_SPI_LsbFirst = 1, /*!< Data transfers start with least significant bit. */ |
kadonotakashi | 0:8fdf9a60065b | 79 | } flexio_spi_shift_direction_t; |
kadonotakashi | 0:8fdf9a60065b | 80 | |
kadonotakashi | 0:8fdf9a60065b | 81 | /*! @brief FlexIO SPI data length mode options. */ |
kadonotakashi | 0:8fdf9a60065b | 82 | typedef enum _flexio_spi_data_bitcount_mode |
kadonotakashi | 0:8fdf9a60065b | 83 | { |
kadonotakashi | 0:8fdf9a60065b | 84 | kFLEXIO_SPI_8BitMode = 0x08U, /*!< 8-bit data transmission mode. */ |
kadonotakashi | 0:8fdf9a60065b | 85 | kFLEXIO_SPI_16BitMode = 0x10U, /*!< 16-bit data transmission mode. */ |
kadonotakashi | 0:8fdf9a60065b | 86 | } flexio_spi_data_bitcount_mode_t; |
kadonotakashi | 0:8fdf9a60065b | 87 | |
kadonotakashi | 0:8fdf9a60065b | 88 | /*! @brief Define FlexIO SPI interrupt mask. */ |
kadonotakashi | 0:8fdf9a60065b | 89 | enum _flexio_spi_interrupt_enable |
kadonotakashi | 0:8fdf9a60065b | 90 | { |
kadonotakashi | 0:8fdf9a60065b | 91 | kFLEXIO_SPI_TxEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ |
kadonotakashi | 0:8fdf9a60065b | 92 | kFLEXIO_SPI_RxFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ |
kadonotakashi | 0:8fdf9a60065b | 93 | }; |
kadonotakashi | 0:8fdf9a60065b | 94 | |
kadonotakashi | 0:8fdf9a60065b | 95 | /*! @brief Define FlexIO SPI status mask. */ |
kadonotakashi | 0:8fdf9a60065b | 96 | enum _flexio_spi_status_flags |
kadonotakashi | 0:8fdf9a60065b | 97 | { |
kadonotakashi | 0:8fdf9a60065b | 98 | kFLEXIO_SPI_TxBufferEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ |
kadonotakashi | 0:8fdf9a60065b | 99 | kFLEXIO_SPI_RxBufferFullFlag = 0x2U, /*!< Receive buffer full flag. */ |
kadonotakashi | 0:8fdf9a60065b | 100 | }; |
kadonotakashi | 0:8fdf9a60065b | 101 | |
kadonotakashi | 0:8fdf9a60065b | 102 | /*! @brief Define FlexIO SPI DMA mask. */ |
kadonotakashi | 0:8fdf9a60065b | 103 | enum _flexio_spi_dma_enable |
kadonotakashi | 0:8fdf9a60065b | 104 | { |
kadonotakashi | 0:8fdf9a60065b | 105 | kFLEXIO_SPI_TxDmaEnable = 0x1U, /*!< Tx DMA request source */ |
kadonotakashi | 0:8fdf9a60065b | 106 | kFLEXIO_SPI_RxDmaEnable = 0x2U, /*!< Rx DMA request source */ |
kadonotakashi | 0:8fdf9a60065b | 107 | kFLEXIO_SPI_DmaAllEnable = 0x3U, /*!< All DMA request source*/ |
kadonotakashi | 0:8fdf9a60065b | 108 | }; |
kadonotakashi | 0:8fdf9a60065b | 109 | |
kadonotakashi | 0:8fdf9a60065b | 110 | /*! @brief Define FlexIO SPI transfer flags. */ |
kadonotakashi | 0:8fdf9a60065b | 111 | enum _flexio_spi_transfer_flags |
kadonotakashi | 0:8fdf9a60065b | 112 | { |
kadonotakashi | 0:8fdf9a60065b | 113 | kFLEXIO_SPI_8bitMsb = 0x1U, /*!< FlexIO SPI 8-bit MSB first */ |
kadonotakashi | 0:8fdf9a60065b | 114 | kFLEXIO_SPI_8bitLsb = 0x2U, /*!< FlexIO SPI 8-bit LSB first */ |
kadonotakashi | 0:8fdf9a60065b | 115 | kFLEXIO_SPI_16bitMsb = 0x9U, /*!< FlexIO SPI 16-bit MSB first */ |
kadonotakashi | 0:8fdf9a60065b | 116 | kFLEXIO_SPI_16bitLsb = 0xaU, /*!< FlexIO SPI 16-bit LSB first */ |
kadonotakashi | 0:8fdf9a60065b | 117 | }; |
kadonotakashi | 0:8fdf9a60065b | 118 | |
kadonotakashi | 0:8fdf9a60065b | 119 | /*! @brief Define FlexIO SPI access structure typedef. */ |
kadonotakashi | 0:8fdf9a60065b | 120 | typedef struct _flexio_spi_type |
kadonotakashi | 0:8fdf9a60065b | 121 | { |
kadonotakashi | 0:8fdf9a60065b | 122 | FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ |
kadonotakashi | 0:8fdf9a60065b | 123 | uint8_t SDOPinIndex; /*!< Pin select for data output. */ |
kadonotakashi | 0:8fdf9a60065b | 124 | uint8_t SDIPinIndex; /*!< Pin select for data input. */ |
kadonotakashi | 0:8fdf9a60065b | 125 | uint8_t SCKPinIndex; /*!< Pin select for clock. */ |
kadonotakashi | 0:8fdf9a60065b | 126 | uint8_t CSnPinIndex; /*!< Pin select for enable. */ |
kadonotakashi | 0:8fdf9a60065b | 127 | uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO SPI. */ |
kadonotakashi | 0:8fdf9a60065b | 128 | uint8_t timerIndex[2]; /*!< Timer index used in FlexIO SPI. */ |
kadonotakashi | 0:8fdf9a60065b | 129 | } FLEXIO_SPI_Type; |
kadonotakashi | 0:8fdf9a60065b | 130 | |
kadonotakashi | 0:8fdf9a60065b | 131 | /*! @brief Define FlexIO SPI master configuration structure. */ |
kadonotakashi | 0:8fdf9a60065b | 132 | typedef struct _flexio_spi_master_config |
kadonotakashi | 0:8fdf9a60065b | 133 | { |
kadonotakashi | 0:8fdf9a60065b | 134 | bool enableMaster; /*!< Enable/disable FlexIO SPI master after configuration. */ |
kadonotakashi | 0:8fdf9a60065b | 135 | bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ |
kadonotakashi | 0:8fdf9a60065b | 136 | bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ |
kadonotakashi | 0:8fdf9a60065b | 137 | bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, |
kadonotakashi | 0:8fdf9a60065b | 138 | fast access requires the FlexIO clock to be at least |
kadonotakashi | 0:8fdf9a60065b | 139 | twice the frequency of the bus clock. */ |
kadonotakashi | 0:8fdf9a60065b | 140 | uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ |
kadonotakashi | 0:8fdf9a60065b | 141 | flexio_spi_clock_phase_t phase; /*!< Clock phase. */ |
kadonotakashi | 0:8fdf9a60065b | 142 | flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ |
kadonotakashi | 0:8fdf9a60065b | 143 | } flexio_spi_master_config_t; |
kadonotakashi | 0:8fdf9a60065b | 144 | |
kadonotakashi | 0:8fdf9a60065b | 145 | /*! @brief Define FlexIO SPI slave configuration structure. */ |
kadonotakashi | 0:8fdf9a60065b | 146 | typedef struct _flexio_spi_slave_config |
kadonotakashi | 0:8fdf9a60065b | 147 | { |
kadonotakashi | 0:8fdf9a60065b | 148 | bool enableSlave; /*!< Enable/disable FlexIO SPI slave after configuration. */ |
kadonotakashi | 0:8fdf9a60065b | 149 | bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ |
kadonotakashi | 0:8fdf9a60065b | 150 | bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ |
kadonotakashi | 0:8fdf9a60065b | 151 | bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, |
kadonotakashi | 0:8fdf9a60065b | 152 | fast access requires the FlexIO clock to be at least |
kadonotakashi | 0:8fdf9a60065b | 153 | twice the frequency of the bus clock. */ |
kadonotakashi | 0:8fdf9a60065b | 154 | flexio_spi_clock_phase_t phase; /*!< Clock phase. */ |
kadonotakashi | 0:8fdf9a60065b | 155 | flexio_spi_data_bitcount_mode_t dataMode; /*!< 8bit or 16bit mode. */ |
kadonotakashi | 0:8fdf9a60065b | 156 | } flexio_spi_slave_config_t; |
kadonotakashi | 0:8fdf9a60065b | 157 | |
kadonotakashi | 0:8fdf9a60065b | 158 | /*! @brief Define FlexIO SPI transfer structure. */ |
kadonotakashi | 0:8fdf9a60065b | 159 | typedef struct _flexio_spi_transfer |
kadonotakashi | 0:8fdf9a60065b | 160 | { |
kadonotakashi | 0:8fdf9a60065b | 161 | uint8_t *txData; /*!< Send buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 162 | uint8_t *rxData; /*!< Receive buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 163 | size_t dataSize; /*!< Transfer bytes. */ |
kadonotakashi | 0:8fdf9a60065b | 164 | uint8_t flags; /*!< FlexIO SPI control flag, MSB first or LSB first. */ |
kadonotakashi | 0:8fdf9a60065b | 165 | } flexio_spi_transfer_t; |
kadonotakashi | 0:8fdf9a60065b | 166 | |
kadonotakashi | 0:8fdf9a60065b | 167 | /*! @brief typedef for flexio_spi_master_handle_t in advance. */ |
kadonotakashi | 0:8fdf9a60065b | 168 | typedef struct _flexio_spi_master_handle flexio_spi_master_handle_t; |
kadonotakashi | 0:8fdf9a60065b | 169 | |
kadonotakashi | 0:8fdf9a60065b | 170 | /*! @brief Slave handle is the same with master handle. */ |
kadonotakashi | 0:8fdf9a60065b | 171 | typedef flexio_spi_master_handle_t flexio_spi_slave_handle_t; |
kadonotakashi | 0:8fdf9a60065b | 172 | |
kadonotakashi | 0:8fdf9a60065b | 173 | /*! @brief FlexIO SPI master callback for finished transmit */ |
kadonotakashi | 0:8fdf9a60065b | 174 | typedef void (*flexio_spi_master_transfer_callback_t)(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 175 | flexio_spi_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 176 | status_t status, |
kadonotakashi | 0:8fdf9a60065b | 177 | void *userData); |
kadonotakashi | 0:8fdf9a60065b | 178 | |
kadonotakashi | 0:8fdf9a60065b | 179 | /*! @brief FlexIO SPI slave callback for finished transmit */ |
kadonotakashi | 0:8fdf9a60065b | 180 | typedef void (*flexio_spi_slave_transfer_callback_t)(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 181 | flexio_spi_slave_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 182 | status_t status, |
kadonotakashi | 0:8fdf9a60065b | 183 | void *userData); |
kadonotakashi | 0:8fdf9a60065b | 184 | |
kadonotakashi | 0:8fdf9a60065b | 185 | /*! @brief Define FlexIO SPI handle structure. */ |
kadonotakashi | 0:8fdf9a60065b | 186 | struct _flexio_spi_master_handle |
kadonotakashi | 0:8fdf9a60065b | 187 | { |
kadonotakashi | 0:8fdf9a60065b | 188 | uint8_t *txData; /*!< Transfer buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 189 | uint8_t *rxData; /*!< Receive buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 190 | size_t transferSize; /*!< Total bytes to be transferred. */ |
kadonotakashi | 0:8fdf9a60065b | 191 | volatile size_t txRemainingBytes; /*!< Send data remaining in bytes. */ |
kadonotakashi | 0:8fdf9a60065b | 192 | volatile size_t rxRemainingBytes; /*!< Receive data remaining in bytes. */ |
kadonotakashi | 0:8fdf9a60065b | 193 | volatile uint32_t state; /*!< FlexIO SPI internal state. */ |
kadonotakashi | 0:8fdf9a60065b | 194 | uint8_t bytePerFrame; /*!< SPI mode, 2bytes or 1byte in a frame */ |
kadonotakashi | 0:8fdf9a60065b | 195 | flexio_spi_shift_direction_t direction; /*!< Shift direction. */ |
kadonotakashi | 0:8fdf9a60065b | 196 | flexio_spi_master_transfer_callback_t callback; /*!< FlexIO SPI callback. */ |
kadonotakashi | 0:8fdf9a60065b | 197 | void *userData; /*!< Callback parameter. */ |
kadonotakashi | 0:8fdf9a60065b | 198 | }; |
kadonotakashi | 0:8fdf9a60065b | 199 | |
kadonotakashi | 0:8fdf9a60065b | 200 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 201 | * API |
kadonotakashi | 0:8fdf9a60065b | 202 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 203 | |
kadonotakashi | 0:8fdf9a60065b | 204 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 205 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 206 | #endif /*_cplusplus*/ |
kadonotakashi | 0:8fdf9a60065b | 207 | |
kadonotakashi | 0:8fdf9a60065b | 208 | /*! |
kadonotakashi | 0:8fdf9a60065b | 209 | * @name FlexIO SPI Configuration |
kadonotakashi | 0:8fdf9a60065b | 210 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 211 | */ |
kadonotakashi | 0:8fdf9a60065b | 212 | |
kadonotakashi | 0:8fdf9a60065b | 213 | /*! |
kadonotakashi | 0:8fdf9a60065b | 214 | * @brief Ungates the FlexIO clock, resets the FlexIO module and configures the FlexIO SPI master hardware, |
kadonotakashi | 0:8fdf9a60065b | 215 | * and configures the FlexIO SPI with FlexIO SPI master configuration. The |
kadonotakashi | 0:8fdf9a60065b | 216 | * configuration structure can be filled by the user, or be set with default values |
kadonotakashi | 0:8fdf9a60065b | 217 | * by the FLEXIO_SPI_MasterGetDefaultConfig(). |
kadonotakashi | 0:8fdf9a60065b | 218 | * |
kadonotakashi | 0:8fdf9a60065b | 219 | * @note FlexIO SPI master only support CPOL = 0, which means clock inactive low. |
kadonotakashi | 0:8fdf9a60065b | 220 | * |
kadonotakashi | 0:8fdf9a60065b | 221 | * Example |
kadonotakashi | 0:8fdf9a60065b | 222 | @code |
kadonotakashi | 0:8fdf9a60065b | 223 | FLEXIO_SPI_Type spiDev = { |
kadonotakashi | 0:8fdf9a60065b | 224 | .flexioBase = FLEXIO, |
kadonotakashi | 0:8fdf9a60065b | 225 | .SDOPinIndex = 0, |
kadonotakashi | 0:8fdf9a60065b | 226 | .SDIPinIndex = 1, |
kadonotakashi | 0:8fdf9a60065b | 227 | .SCKPinIndex = 2, |
kadonotakashi | 0:8fdf9a60065b | 228 | .CSnPinIndex = 3, |
kadonotakashi | 0:8fdf9a60065b | 229 | .shifterIndex = {0,1}, |
kadonotakashi | 0:8fdf9a60065b | 230 | .timerIndex = {0,1} |
kadonotakashi | 0:8fdf9a60065b | 231 | }; |
kadonotakashi | 0:8fdf9a60065b | 232 | flexio_spi_master_config_t config = { |
kadonotakashi | 0:8fdf9a60065b | 233 | .enableMaster = true, |
kadonotakashi | 0:8fdf9a60065b | 234 | .enableInDoze = false, |
kadonotakashi | 0:8fdf9a60065b | 235 | .enableInDebug = true, |
kadonotakashi | 0:8fdf9a60065b | 236 | .enableFastAccess = false, |
kadonotakashi | 0:8fdf9a60065b | 237 | .baudRate_Bps = 500000, |
kadonotakashi | 0:8fdf9a60065b | 238 | .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, |
kadonotakashi | 0:8fdf9a60065b | 239 | .direction = kFLEXIO_SPI_MsbFirst, |
kadonotakashi | 0:8fdf9a60065b | 240 | .dataMode = kFLEXIO_SPI_8BitMode |
kadonotakashi | 0:8fdf9a60065b | 241 | }; |
kadonotakashi | 0:8fdf9a60065b | 242 | FLEXIO_SPI_MasterInit(&spiDev, &config, srcClock_Hz); |
kadonotakashi | 0:8fdf9a60065b | 243 | @endcode |
kadonotakashi | 0:8fdf9a60065b | 244 | * |
kadonotakashi | 0:8fdf9a60065b | 245 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 246 | * @param masterConfig Pointer to the flexio_spi_master_config_t structure. |
kadonotakashi | 0:8fdf9a60065b | 247 | * @param srcClock_Hz FlexIO source clock in Hz. |
kadonotakashi | 0:8fdf9a60065b | 248 | */ |
kadonotakashi | 0:8fdf9a60065b | 249 | void FLEXIO_SPI_MasterInit(FLEXIO_SPI_Type *base, flexio_spi_master_config_t *masterConfig, uint32_t srcClock_Hz); |
kadonotakashi | 0:8fdf9a60065b | 250 | |
kadonotakashi | 0:8fdf9a60065b | 251 | /*! |
kadonotakashi | 0:8fdf9a60065b | 252 | * @brief Gates the FlexIO clock. |
kadonotakashi | 0:8fdf9a60065b | 253 | * |
kadonotakashi | 0:8fdf9a60065b | 254 | * @param base Pointer to the FLEXIO_SPI_Type. |
kadonotakashi | 0:8fdf9a60065b | 255 | */ |
kadonotakashi | 0:8fdf9a60065b | 256 | void FLEXIO_SPI_MasterDeinit(FLEXIO_SPI_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 257 | |
kadonotakashi | 0:8fdf9a60065b | 258 | /*! |
kadonotakashi | 0:8fdf9a60065b | 259 | * @brief Gets the default configuration to configure the FlexIO SPI master. The configuration |
kadonotakashi | 0:8fdf9a60065b | 260 | * can be used directly by calling the FLEXIO_SPI_MasterConfigure(). |
kadonotakashi | 0:8fdf9a60065b | 261 | * Example: |
kadonotakashi | 0:8fdf9a60065b | 262 | @code |
kadonotakashi | 0:8fdf9a60065b | 263 | flexio_spi_master_config_t masterConfig; |
kadonotakashi | 0:8fdf9a60065b | 264 | FLEXIO_SPI_MasterGetDefaultConfig(&masterConfig); |
kadonotakashi | 0:8fdf9a60065b | 265 | @endcode |
kadonotakashi | 0:8fdf9a60065b | 266 | * @param masterConfig Pointer to the flexio_spi_master_config_t structure. |
kadonotakashi | 0:8fdf9a60065b | 267 | */ |
kadonotakashi | 0:8fdf9a60065b | 268 | void FLEXIO_SPI_MasterGetDefaultConfig(flexio_spi_master_config_t *masterConfig); |
kadonotakashi | 0:8fdf9a60065b | 269 | |
kadonotakashi | 0:8fdf9a60065b | 270 | /*! |
kadonotakashi | 0:8fdf9a60065b | 271 | * @brief Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO SPI slave hardware |
kadonotakashi | 0:8fdf9a60065b | 272 | * configuration, and configures the FlexIO SPI with FlexIO SPI slave configuration. The |
kadonotakashi | 0:8fdf9a60065b | 273 | * configuration structure can be filled by the user, or be set with default values |
kadonotakashi | 0:8fdf9a60065b | 274 | * by the FLEXIO_SPI_SlaveGetDefaultConfig(). |
kadonotakashi | 0:8fdf9a60065b | 275 | * |
kadonotakashi | 0:8fdf9a60065b | 276 | * @note Only one timer is needed in the FlexIO SPI slave. As a result, the second timer index is ignored. |
kadonotakashi | 0:8fdf9a60065b | 277 | * FlexIO SPI slave only support CPOL = 0, which means clock inactive low. |
kadonotakashi | 0:8fdf9a60065b | 278 | * Example |
kadonotakashi | 0:8fdf9a60065b | 279 | @code |
kadonotakashi | 0:8fdf9a60065b | 280 | FLEXIO_SPI_Type spiDev = { |
kadonotakashi | 0:8fdf9a60065b | 281 | .flexioBase = FLEXIO, |
kadonotakashi | 0:8fdf9a60065b | 282 | .SDOPinIndex = 0, |
kadonotakashi | 0:8fdf9a60065b | 283 | .SDIPinIndex = 1, |
kadonotakashi | 0:8fdf9a60065b | 284 | .SCKPinIndex = 2, |
kadonotakashi | 0:8fdf9a60065b | 285 | .CSnPinIndex = 3, |
kadonotakashi | 0:8fdf9a60065b | 286 | .shifterIndex = {0,1}, |
kadonotakashi | 0:8fdf9a60065b | 287 | .timerIndex = {0} |
kadonotakashi | 0:8fdf9a60065b | 288 | }; |
kadonotakashi | 0:8fdf9a60065b | 289 | flexio_spi_slave_config_t config = { |
kadonotakashi | 0:8fdf9a60065b | 290 | .enableSlave = true, |
kadonotakashi | 0:8fdf9a60065b | 291 | .enableInDoze = false, |
kadonotakashi | 0:8fdf9a60065b | 292 | .enableInDebug = true, |
kadonotakashi | 0:8fdf9a60065b | 293 | .enableFastAccess = false, |
kadonotakashi | 0:8fdf9a60065b | 294 | .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, |
kadonotakashi | 0:8fdf9a60065b | 295 | .direction = kFLEXIO_SPI_MsbFirst, |
kadonotakashi | 0:8fdf9a60065b | 296 | .dataMode = kFLEXIO_SPI_8BitMode |
kadonotakashi | 0:8fdf9a60065b | 297 | }; |
kadonotakashi | 0:8fdf9a60065b | 298 | FLEXIO_SPI_SlaveInit(&spiDev, &config); |
kadonotakashi | 0:8fdf9a60065b | 299 | @endcode |
kadonotakashi | 0:8fdf9a60065b | 300 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 301 | * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. |
kadonotakashi | 0:8fdf9a60065b | 302 | */ |
kadonotakashi | 0:8fdf9a60065b | 303 | void FLEXIO_SPI_SlaveInit(FLEXIO_SPI_Type *base, flexio_spi_slave_config_t *slaveConfig); |
kadonotakashi | 0:8fdf9a60065b | 304 | |
kadonotakashi | 0:8fdf9a60065b | 305 | /*! |
kadonotakashi | 0:8fdf9a60065b | 306 | * @brief Gates the FlexIO clock. |
kadonotakashi | 0:8fdf9a60065b | 307 | * |
kadonotakashi | 0:8fdf9a60065b | 308 | * @param base Pointer to the FLEXIO_SPI_Type. |
kadonotakashi | 0:8fdf9a60065b | 309 | */ |
kadonotakashi | 0:8fdf9a60065b | 310 | void FLEXIO_SPI_SlaveDeinit(FLEXIO_SPI_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 311 | |
kadonotakashi | 0:8fdf9a60065b | 312 | /*! |
kadonotakashi | 0:8fdf9a60065b | 313 | * @brief Gets the default configuration to configure the FlexIO SPI slave. The configuration |
kadonotakashi | 0:8fdf9a60065b | 314 | * can be used directly for calling the FLEXIO_SPI_SlaveConfigure(). |
kadonotakashi | 0:8fdf9a60065b | 315 | * Example: |
kadonotakashi | 0:8fdf9a60065b | 316 | @code |
kadonotakashi | 0:8fdf9a60065b | 317 | flexio_spi_slave_config_t slaveConfig; |
kadonotakashi | 0:8fdf9a60065b | 318 | FLEXIO_SPI_SlaveGetDefaultConfig(&slaveConfig); |
kadonotakashi | 0:8fdf9a60065b | 319 | @endcode |
kadonotakashi | 0:8fdf9a60065b | 320 | * @param slaveConfig Pointer to the flexio_spi_slave_config_t structure. |
kadonotakashi | 0:8fdf9a60065b | 321 | */ |
kadonotakashi | 0:8fdf9a60065b | 322 | void FLEXIO_SPI_SlaveGetDefaultConfig(flexio_spi_slave_config_t *slaveConfig); |
kadonotakashi | 0:8fdf9a60065b | 323 | |
kadonotakashi | 0:8fdf9a60065b | 324 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 325 | |
kadonotakashi | 0:8fdf9a60065b | 326 | /*! |
kadonotakashi | 0:8fdf9a60065b | 327 | * @name Status |
kadonotakashi | 0:8fdf9a60065b | 328 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 329 | */ |
kadonotakashi | 0:8fdf9a60065b | 330 | |
kadonotakashi | 0:8fdf9a60065b | 331 | /*! |
kadonotakashi | 0:8fdf9a60065b | 332 | * @brief Gets FlexIO SPI status flags. |
kadonotakashi | 0:8fdf9a60065b | 333 | * |
kadonotakashi | 0:8fdf9a60065b | 334 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 335 | * @return status flag; Use the status flag to AND the following flag mask and get the status. |
kadonotakashi | 0:8fdf9a60065b | 336 | * @arg kFLEXIO_SPI_TxEmptyFlag |
kadonotakashi | 0:8fdf9a60065b | 337 | * @arg kFLEXIO_SPI_RxEmptyFlag |
kadonotakashi | 0:8fdf9a60065b | 338 | */ |
kadonotakashi | 0:8fdf9a60065b | 339 | |
kadonotakashi | 0:8fdf9a60065b | 340 | uint32_t FLEXIO_SPI_GetStatusFlags(FLEXIO_SPI_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 341 | |
kadonotakashi | 0:8fdf9a60065b | 342 | /*! |
kadonotakashi | 0:8fdf9a60065b | 343 | * @brief Clears FlexIO SPI status flags. |
kadonotakashi | 0:8fdf9a60065b | 344 | * |
kadonotakashi | 0:8fdf9a60065b | 345 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 346 | * @param mask status flag |
kadonotakashi | 0:8fdf9a60065b | 347 | * The parameter can be any combination of the following values: |
kadonotakashi | 0:8fdf9a60065b | 348 | * @arg kFLEXIO_SPI_TxEmptyFlag |
kadonotakashi | 0:8fdf9a60065b | 349 | * @arg kFLEXIO_SPI_RxEmptyFlag |
kadonotakashi | 0:8fdf9a60065b | 350 | */ |
kadonotakashi | 0:8fdf9a60065b | 351 | |
kadonotakashi | 0:8fdf9a60065b | 352 | void FLEXIO_SPI_ClearStatusFlags(FLEXIO_SPI_Type *base, uint32_t mask); |
kadonotakashi | 0:8fdf9a60065b | 353 | |
kadonotakashi | 0:8fdf9a60065b | 354 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 355 | |
kadonotakashi | 0:8fdf9a60065b | 356 | /*! |
kadonotakashi | 0:8fdf9a60065b | 357 | * @name Interrupts |
kadonotakashi | 0:8fdf9a60065b | 358 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 359 | */ |
kadonotakashi | 0:8fdf9a60065b | 360 | |
kadonotakashi | 0:8fdf9a60065b | 361 | /*! |
kadonotakashi | 0:8fdf9a60065b | 362 | * @brief Enables the FlexIO SPI interrupt. |
kadonotakashi | 0:8fdf9a60065b | 363 | * |
kadonotakashi | 0:8fdf9a60065b | 364 | * This function enables the FlexIO SPI interrupt. |
kadonotakashi | 0:8fdf9a60065b | 365 | * |
kadonotakashi | 0:8fdf9a60065b | 366 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 367 | * @param mask interrupt source. The parameter can be any combination of the following values: |
kadonotakashi | 0:8fdf9a60065b | 368 | * @arg kFLEXIO_SPI_RxFullInterruptEnable |
kadonotakashi | 0:8fdf9a60065b | 369 | * @arg kFLEXIO_SPI_TxEmptyInterruptEnable |
kadonotakashi | 0:8fdf9a60065b | 370 | */ |
kadonotakashi | 0:8fdf9a60065b | 371 | void FLEXIO_SPI_EnableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); |
kadonotakashi | 0:8fdf9a60065b | 372 | |
kadonotakashi | 0:8fdf9a60065b | 373 | /*! |
kadonotakashi | 0:8fdf9a60065b | 374 | * @brief Disables the FlexIO SPI interrupt. |
kadonotakashi | 0:8fdf9a60065b | 375 | * |
kadonotakashi | 0:8fdf9a60065b | 376 | * This function disables the FlexIO SPI interrupt. |
kadonotakashi | 0:8fdf9a60065b | 377 | * |
kadonotakashi | 0:8fdf9a60065b | 378 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 379 | * @param mask interrupt source The parameter can be any combination of the following values: |
kadonotakashi | 0:8fdf9a60065b | 380 | * @arg kFLEXIO_SPI_RxFullInterruptEnable |
kadonotakashi | 0:8fdf9a60065b | 381 | * @arg kFLEXIO_SPI_TxEmptyInterruptEnable |
kadonotakashi | 0:8fdf9a60065b | 382 | */ |
kadonotakashi | 0:8fdf9a60065b | 383 | void FLEXIO_SPI_DisableInterrupts(FLEXIO_SPI_Type *base, uint32_t mask); |
kadonotakashi | 0:8fdf9a60065b | 384 | |
kadonotakashi | 0:8fdf9a60065b | 385 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 386 | |
kadonotakashi | 0:8fdf9a60065b | 387 | /*! |
kadonotakashi | 0:8fdf9a60065b | 388 | * @name DMA Control |
kadonotakashi | 0:8fdf9a60065b | 389 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 390 | */ |
kadonotakashi | 0:8fdf9a60065b | 391 | |
kadonotakashi | 0:8fdf9a60065b | 392 | /*! |
kadonotakashi | 0:8fdf9a60065b | 393 | * @brief Enables/disables the FlexIO SPI transmit DMA. This function enables/disables the FlexIO SPI Tx DMA, |
kadonotakashi | 0:8fdf9a60065b | 394 | * which means that asserting the kFLEXIO_SPI_TxEmptyFlag does/doesn't trigger the DMA request. |
kadonotakashi | 0:8fdf9a60065b | 395 | * |
kadonotakashi | 0:8fdf9a60065b | 396 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 397 | * @param mask SPI DMA source. |
kadonotakashi | 0:8fdf9a60065b | 398 | * @param enable True means enable DMA, false means disable DMA. |
kadonotakashi | 0:8fdf9a60065b | 399 | */ |
kadonotakashi | 0:8fdf9a60065b | 400 | void FLEXIO_SPI_EnableDMA(FLEXIO_SPI_Type *base, uint32_t mask, bool enable); |
kadonotakashi | 0:8fdf9a60065b | 401 | |
kadonotakashi | 0:8fdf9a60065b | 402 | /*! |
kadonotakashi | 0:8fdf9a60065b | 403 | * @brief Gets the FlexIO SPI transmit data register address for MSB first transfer. |
kadonotakashi | 0:8fdf9a60065b | 404 | * |
kadonotakashi | 0:8fdf9a60065b | 405 | * This function returns the SPI data register address, which is mainly used by DMA/eDMA. |
kadonotakashi | 0:8fdf9a60065b | 406 | * |
kadonotakashi | 0:8fdf9a60065b | 407 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 408 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 409 | * @return FlexIO SPI transmit data register address. |
kadonotakashi | 0:8fdf9a60065b | 410 | */ |
kadonotakashi | 0:8fdf9a60065b | 411 | static inline uint32_t FLEXIO_SPI_GetTxDataRegisterAddress(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 412 | flexio_spi_shift_direction_t direction) |
kadonotakashi | 0:8fdf9a60065b | 413 | { |
kadonotakashi | 0:8fdf9a60065b | 414 | if (direction == kFLEXIO_SPI_MsbFirst) |
kadonotakashi | 0:8fdf9a60065b | 415 | { |
kadonotakashi | 0:8fdf9a60065b | 416 | return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, |
kadonotakashi | 0:8fdf9a60065b | 417 | base->shifterIndex[0]) + |
kadonotakashi | 0:8fdf9a60065b | 418 | 3U; |
kadonotakashi | 0:8fdf9a60065b | 419 | } |
kadonotakashi | 0:8fdf9a60065b | 420 | else |
kadonotakashi | 0:8fdf9a60065b | 421 | { |
kadonotakashi | 0:8fdf9a60065b | 422 | return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBuffer, base->shifterIndex[0]); |
kadonotakashi | 0:8fdf9a60065b | 423 | } |
kadonotakashi | 0:8fdf9a60065b | 424 | } |
kadonotakashi | 0:8fdf9a60065b | 425 | |
kadonotakashi | 0:8fdf9a60065b | 426 | /*! |
kadonotakashi | 0:8fdf9a60065b | 427 | * @brief Gets the FlexIO SPI receive data register address for the MSB first transfer. |
kadonotakashi | 0:8fdf9a60065b | 428 | * |
kadonotakashi | 0:8fdf9a60065b | 429 | * This function returns the SPI data register address, which is mainly used by DMA/eDMA. |
kadonotakashi | 0:8fdf9a60065b | 430 | * |
kadonotakashi | 0:8fdf9a60065b | 431 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 432 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 433 | * @return FlexIO SPI receive data register address. |
kadonotakashi | 0:8fdf9a60065b | 434 | */ |
kadonotakashi | 0:8fdf9a60065b | 435 | static inline uint32_t FLEXIO_SPI_GetRxDataRegisterAddress(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 436 | flexio_spi_shift_direction_t direction) |
kadonotakashi | 0:8fdf9a60065b | 437 | { |
kadonotakashi | 0:8fdf9a60065b | 438 | if (direction == kFLEXIO_SPI_MsbFirst) |
kadonotakashi | 0:8fdf9a60065b | 439 | { |
kadonotakashi | 0:8fdf9a60065b | 440 | return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->shifterIndex[1]); |
kadonotakashi | 0:8fdf9a60065b | 441 | } |
kadonotakashi | 0:8fdf9a60065b | 442 | else |
kadonotakashi | 0:8fdf9a60065b | 443 | { |
kadonotakashi | 0:8fdf9a60065b | 444 | return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferByteSwapped, |
kadonotakashi | 0:8fdf9a60065b | 445 | base->shifterIndex[1]); |
kadonotakashi | 0:8fdf9a60065b | 446 | } |
kadonotakashi | 0:8fdf9a60065b | 447 | } |
kadonotakashi | 0:8fdf9a60065b | 448 | |
kadonotakashi | 0:8fdf9a60065b | 449 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 450 | |
kadonotakashi | 0:8fdf9a60065b | 451 | /*! |
kadonotakashi | 0:8fdf9a60065b | 452 | * @name Bus Operations |
kadonotakashi | 0:8fdf9a60065b | 453 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 454 | */ |
kadonotakashi | 0:8fdf9a60065b | 455 | |
kadonotakashi | 0:8fdf9a60065b | 456 | /*! |
kadonotakashi | 0:8fdf9a60065b | 457 | * @brief Enables/disables the FlexIO SPI module operation. |
kadonotakashi | 0:8fdf9a60065b | 458 | * |
kadonotakashi | 0:8fdf9a60065b | 459 | * @param base Pointer to the FLEXIO_SPI_Type. |
kadonotakashi | 0:8fdf9a60065b | 460 | * @param enable True to enable, false to disable. |
kadonotakashi | 0:8fdf9a60065b | 461 | */ |
kadonotakashi | 0:8fdf9a60065b | 462 | static inline void FLEXIO_SPI_Enable(FLEXIO_SPI_Type *base, bool enable) |
kadonotakashi | 0:8fdf9a60065b | 463 | { |
kadonotakashi | 0:8fdf9a60065b | 464 | if (enable) |
kadonotakashi | 0:8fdf9a60065b | 465 | { |
kadonotakashi | 0:8fdf9a60065b | 466 | base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; |
kadonotakashi | 0:8fdf9a60065b | 467 | } |
kadonotakashi | 0:8fdf9a60065b | 468 | else |
kadonotakashi | 0:8fdf9a60065b | 469 | { |
kadonotakashi | 0:8fdf9a60065b | 470 | base->flexioBase->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; |
kadonotakashi | 0:8fdf9a60065b | 471 | } |
kadonotakashi | 0:8fdf9a60065b | 472 | } |
kadonotakashi | 0:8fdf9a60065b | 473 | |
kadonotakashi | 0:8fdf9a60065b | 474 | /*! |
kadonotakashi | 0:8fdf9a60065b | 475 | * @brief Sets baud rate for the FlexIO SPI transfer, which is only used for the master. |
kadonotakashi | 0:8fdf9a60065b | 476 | * |
kadonotakashi | 0:8fdf9a60065b | 477 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 478 | * @param baudRate_Bps Baud Rate needed in Hz. |
kadonotakashi | 0:8fdf9a60065b | 479 | * @param srcClockHz SPI source clock frequency in Hz. |
kadonotakashi | 0:8fdf9a60065b | 480 | */ |
kadonotakashi | 0:8fdf9a60065b | 481 | void FLEXIO_SPI_MasterSetBaudRate(FLEXIO_SPI_Type *base, uint32_t baudRate_Bps, uint32_t srcClockHz); |
kadonotakashi | 0:8fdf9a60065b | 482 | |
kadonotakashi | 0:8fdf9a60065b | 483 | /*! |
kadonotakashi | 0:8fdf9a60065b | 484 | * @brief Writes one byte of data, which is sent using the MSB method. |
kadonotakashi | 0:8fdf9a60065b | 485 | * |
kadonotakashi | 0:8fdf9a60065b | 486 | * @note This is a non-blocking API, which returns directly after the data is put into the |
kadonotakashi | 0:8fdf9a60065b | 487 | * data register but the data transfer is not finished on the bus. Ensure that |
kadonotakashi | 0:8fdf9a60065b | 488 | * the TxEmptyFlag is asserted before calling this API. |
kadonotakashi | 0:8fdf9a60065b | 489 | * |
kadonotakashi | 0:8fdf9a60065b | 490 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 491 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 492 | * @param data 8 bit/16 bit data. |
kadonotakashi | 0:8fdf9a60065b | 493 | */ |
kadonotakashi | 0:8fdf9a60065b | 494 | static inline void FLEXIO_SPI_WriteData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction, uint16_t data) |
kadonotakashi | 0:8fdf9a60065b | 495 | { |
kadonotakashi | 0:8fdf9a60065b | 496 | if (direction == kFLEXIO_SPI_MsbFirst) |
kadonotakashi | 0:8fdf9a60065b | 497 | { |
kadonotakashi | 0:8fdf9a60065b | 498 | base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; |
kadonotakashi | 0:8fdf9a60065b | 499 | } |
kadonotakashi | 0:8fdf9a60065b | 500 | else |
kadonotakashi | 0:8fdf9a60065b | 501 | { |
kadonotakashi | 0:8fdf9a60065b | 502 | base->flexioBase->SHIFTBUF[base->shifterIndex[0]] = data; |
kadonotakashi | 0:8fdf9a60065b | 503 | } |
kadonotakashi | 0:8fdf9a60065b | 504 | } |
kadonotakashi | 0:8fdf9a60065b | 505 | |
kadonotakashi | 0:8fdf9a60065b | 506 | /*! |
kadonotakashi | 0:8fdf9a60065b | 507 | * @brief Reads 8 bit/16 bit data. |
kadonotakashi | 0:8fdf9a60065b | 508 | * |
kadonotakashi | 0:8fdf9a60065b | 509 | * @note This is a non-blocking API, which returns directly after the data is read from the |
kadonotakashi | 0:8fdf9a60065b | 510 | * data register. Ensure that the RxFullFlag is asserted before calling this API. |
kadonotakashi | 0:8fdf9a60065b | 511 | * |
kadonotakashi | 0:8fdf9a60065b | 512 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 513 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 514 | * @return 8 bit/16 bit data received. |
kadonotakashi | 0:8fdf9a60065b | 515 | */ |
kadonotakashi | 0:8fdf9a60065b | 516 | static inline uint16_t FLEXIO_SPI_ReadData(FLEXIO_SPI_Type *base, flexio_spi_shift_direction_t direction) |
kadonotakashi | 0:8fdf9a60065b | 517 | { |
kadonotakashi | 0:8fdf9a60065b | 518 | if (direction == kFLEXIO_SPI_MsbFirst) |
kadonotakashi | 0:8fdf9a60065b | 519 | { |
kadonotakashi | 0:8fdf9a60065b | 520 | return base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]; |
kadonotakashi | 0:8fdf9a60065b | 521 | } |
kadonotakashi | 0:8fdf9a60065b | 522 | else |
kadonotakashi | 0:8fdf9a60065b | 523 | { |
kadonotakashi | 0:8fdf9a60065b | 524 | return base->flexioBase->SHIFTBUFBYS[base->shifterIndex[1]]; |
kadonotakashi | 0:8fdf9a60065b | 525 | } |
kadonotakashi | 0:8fdf9a60065b | 526 | } |
kadonotakashi | 0:8fdf9a60065b | 527 | |
kadonotakashi | 0:8fdf9a60065b | 528 | /*! |
kadonotakashi | 0:8fdf9a60065b | 529 | * @brief Sends a buffer of data bytes. |
kadonotakashi | 0:8fdf9a60065b | 530 | * |
kadonotakashi | 0:8fdf9a60065b | 531 | * @note This function blocks using the polling method until all bytes have been sent. |
kadonotakashi | 0:8fdf9a60065b | 532 | * |
kadonotakashi | 0:8fdf9a60065b | 533 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 534 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 535 | * @param buffer The data bytes to send. |
kadonotakashi | 0:8fdf9a60065b | 536 | * @param size The number of data bytes to send. |
kadonotakashi | 0:8fdf9a60065b | 537 | */ |
kadonotakashi | 0:8fdf9a60065b | 538 | void FLEXIO_SPI_WriteBlocking(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 539 | flexio_spi_shift_direction_t direction, |
kadonotakashi | 0:8fdf9a60065b | 540 | const uint8_t *buffer, |
kadonotakashi | 0:8fdf9a60065b | 541 | size_t size); |
kadonotakashi | 0:8fdf9a60065b | 542 | |
kadonotakashi | 0:8fdf9a60065b | 543 | /*! |
kadonotakashi | 0:8fdf9a60065b | 544 | * @brief Receives a buffer of bytes. |
kadonotakashi | 0:8fdf9a60065b | 545 | * |
kadonotakashi | 0:8fdf9a60065b | 546 | * @note This function blocks using the polling method until all bytes have been received. |
kadonotakashi | 0:8fdf9a60065b | 547 | * |
kadonotakashi | 0:8fdf9a60065b | 548 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 549 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 550 | * @param buffer The buffer to store the received bytes. |
kadonotakashi | 0:8fdf9a60065b | 551 | * @param size The number of data bytes to be received. |
kadonotakashi | 0:8fdf9a60065b | 552 | * @param direction Shift direction of MSB first or LSB first. |
kadonotakashi | 0:8fdf9a60065b | 553 | */ |
kadonotakashi | 0:8fdf9a60065b | 554 | void FLEXIO_SPI_ReadBlocking(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 555 | flexio_spi_shift_direction_t direction, |
kadonotakashi | 0:8fdf9a60065b | 556 | uint8_t *buffer, |
kadonotakashi | 0:8fdf9a60065b | 557 | size_t size); |
kadonotakashi | 0:8fdf9a60065b | 558 | |
kadonotakashi | 0:8fdf9a60065b | 559 | /*! |
kadonotakashi | 0:8fdf9a60065b | 560 | * @brief Receives a buffer of bytes. |
kadonotakashi | 0:8fdf9a60065b | 561 | * |
kadonotakashi | 0:8fdf9a60065b | 562 | * @note This function blocks via polling until all bytes have been received. |
kadonotakashi | 0:8fdf9a60065b | 563 | * |
kadonotakashi | 0:8fdf9a60065b | 564 | * @param base pointer to FLEXIO_SPI_Type structure |
kadonotakashi | 0:8fdf9a60065b | 565 | * @param xfer FlexIO SPI transfer structure, see #flexio_spi_transfer_t. |
kadonotakashi | 0:8fdf9a60065b | 566 | */ |
kadonotakashi | 0:8fdf9a60065b | 567 | void FLEXIO_SPI_MasterTransferBlocking(FLEXIO_SPI_Type *base, flexio_spi_transfer_t *xfer); |
kadonotakashi | 0:8fdf9a60065b | 568 | |
kadonotakashi | 0:8fdf9a60065b | 569 | /*Transactional APIs*/ |
kadonotakashi | 0:8fdf9a60065b | 570 | |
kadonotakashi | 0:8fdf9a60065b | 571 | /*! |
kadonotakashi | 0:8fdf9a60065b | 572 | * @name Transactional |
kadonotakashi | 0:8fdf9a60065b | 573 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 574 | */ |
kadonotakashi | 0:8fdf9a60065b | 575 | |
kadonotakashi | 0:8fdf9a60065b | 576 | /*! |
kadonotakashi | 0:8fdf9a60065b | 577 | * @brief Initializes the FlexIO SPI Master handle, which is used in transactional functions. |
kadonotakashi | 0:8fdf9a60065b | 578 | * |
kadonotakashi | 0:8fdf9a60065b | 579 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 580 | * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 581 | * @param callback The callback function. |
kadonotakashi | 0:8fdf9a60065b | 582 | * @param userData The parameter of the callback function. |
kadonotakashi | 0:8fdf9a60065b | 583 | * @retval kStatus_Success Successfully create the handle. |
kadonotakashi | 0:8fdf9a60065b | 584 | * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. |
kadonotakashi | 0:8fdf9a60065b | 585 | */ |
kadonotakashi | 0:8fdf9a60065b | 586 | status_t FLEXIO_SPI_MasterTransferCreateHandle(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 587 | flexio_spi_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 588 | flexio_spi_master_transfer_callback_t callback, |
kadonotakashi | 0:8fdf9a60065b | 589 | void *userData); |
kadonotakashi | 0:8fdf9a60065b | 590 | |
kadonotakashi | 0:8fdf9a60065b | 591 | /*! |
kadonotakashi | 0:8fdf9a60065b | 592 | * @brief Master transfer data using IRQ. |
kadonotakashi | 0:8fdf9a60065b | 593 | * |
kadonotakashi | 0:8fdf9a60065b | 594 | * This function sends data using IRQ. This is a non-blocking function, which returns |
kadonotakashi | 0:8fdf9a60065b | 595 | * right away. When all data is sent out/received, the callback function is called. |
kadonotakashi | 0:8fdf9a60065b | 596 | * |
kadonotakashi | 0:8fdf9a60065b | 597 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 598 | * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 599 | * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. |
kadonotakashi | 0:8fdf9a60065b | 600 | * @retval kStatus_Success Successfully start a transfer. |
kadonotakashi | 0:8fdf9a60065b | 601 | * @retval kStatus_InvalidArgument Input argument is invalid. |
kadonotakashi | 0:8fdf9a60065b | 602 | * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle, is running another transfer. |
kadonotakashi | 0:8fdf9a60065b | 603 | */ |
kadonotakashi | 0:8fdf9a60065b | 604 | status_t FLEXIO_SPI_MasterTransferNonBlocking(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 605 | flexio_spi_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 606 | flexio_spi_transfer_t *xfer); |
kadonotakashi | 0:8fdf9a60065b | 607 | |
kadonotakashi | 0:8fdf9a60065b | 608 | /*! |
kadonotakashi | 0:8fdf9a60065b | 609 | * @brief Aborts the master data transfer, which used IRQ. |
kadonotakashi | 0:8fdf9a60065b | 610 | * |
kadonotakashi | 0:8fdf9a60065b | 611 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 612 | * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 613 | */ |
kadonotakashi | 0:8fdf9a60065b | 614 | void FLEXIO_SPI_MasterTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle); |
kadonotakashi | 0:8fdf9a60065b | 615 | |
kadonotakashi | 0:8fdf9a60065b | 616 | /*! |
kadonotakashi | 0:8fdf9a60065b | 617 | * @brief Gets the data transfer status which used IRQ. |
kadonotakashi | 0:8fdf9a60065b | 618 | * |
kadonotakashi | 0:8fdf9a60065b | 619 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 620 | * @param handle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 621 | * @param count Number of bytes transferred so far by the non-blocking transaction. |
kadonotakashi | 0:8fdf9a60065b | 622 | * @retval kStatus_InvalidArgument count is Invalid. |
kadonotakashi | 0:8fdf9a60065b | 623 | * @retval kStatus_Success Successfully return the count. |
kadonotakashi | 0:8fdf9a60065b | 624 | */ |
kadonotakashi | 0:8fdf9a60065b | 625 | status_t FLEXIO_SPI_MasterTransferGetCount(FLEXIO_SPI_Type *base, flexio_spi_master_handle_t *handle, size_t *count); |
kadonotakashi | 0:8fdf9a60065b | 626 | |
kadonotakashi | 0:8fdf9a60065b | 627 | /*! |
kadonotakashi | 0:8fdf9a60065b | 628 | * @brief FlexIO SPI master IRQ handler function. |
kadonotakashi | 0:8fdf9a60065b | 629 | * |
kadonotakashi | 0:8fdf9a60065b | 630 | * @param spiType Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 631 | * @param spiHandle Pointer to the flexio_spi_master_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 632 | */ |
kadonotakashi | 0:8fdf9a60065b | 633 | void FLEXIO_SPI_MasterTransferHandleIRQ(void *spiType, void *spiHandle); |
kadonotakashi | 0:8fdf9a60065b | 634 | |
kadonotakashi | 0:8fdf9a60065b | 635 | /*! |
kadonotakashi | 0:8fdf9a60065b | 636 | * @brief Initializes the FlexIO SPI Slave handle, which is used in transactional functions. |
kadonotakashi | 0:8fdf9a60065b | 637 | * |
kadonotakashi | 0:8fdf9a60065b | 638 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 639 | * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 640 | * @param callback The callback function. |
kadonotakashi | 0:8fdf9a60065b | 641 | * @param userData The parameter of the callback function. |
kadonotakashi | 0:8fdf9a60065b | 642 | * @retval kStatus_Success Successfully create the handle. |
kadonotakashi | 0:8fdf9a60065b | 643 | * @retval kStatus_OutOfRange The FlexIO type/handle/ISR table out of range. |
kadonotakashi | 0:8fdf9a60065b | 644 | */ |
kadonotakashi | 0:8fdf9a60065b | 645 | status_t FLEXIO_SPI_SlaveTransferCreateHandle(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 646 | flexio_spi_slave_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 647 | flexio_spi_slave_transfer_callback_t callback, |
kadonotakashi | 0:8fdf9a60065b | 648 | void *userData); |
kadonotakashi | 0:8fdf9a60065b | 649 | |
kadonotakashi | 0:8fdf9a60065b | 650 | /*! |
kadonotakashi | 0:8fdf9a60065b | 651 | * @brief Slave transfer data using IRQ. |
kadonotakashi | 0:8fdf9a60065b | 652 | * |
kadonotakashi | 0:8fdf9a60065b | 653 | * This function sends data using IRQ. This is a non-blocking function, which returns |
kadonotakashi | 0:8fdf9a60065b | 654 | * right away. When all data is sent out/received, the callback function is called. |
kadonotakashi | 0:8fdf9a60065b | 655 | * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 656 | * |
kadonotakashi | 0:8fdf9a60065b | 657 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 658 | * @param xfer FlexIO SPI transfer structure. See #flexio_spi_transfer_t. |
kadonotakashi | 0:8fdf9a60065b | 659 | * @retval kStatus_Success Successfully start a transfer. |
kadonotakashi | 0:8fdf9a60065b | 660 | * @retval kStatus_InvalidArgument Input argument is invalid. |
kadonotakashi | 0:8fdf9a60065b | 661 | * @retval kStatus_FLEXIO_SPI_Busy SPI is not idle; it is running another transfer. |
kadonotakashi | 0:8fdf9a60065b | 662 | */ |
kadonotakashi | 0:8fdf9a60065b | 663 | status_t FLEXIO_SPI_SlaveTransferNonBlocking(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 664 | flexio_spi_slave_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 665 | flexio_spi_transfer_t *xfer); |
kadonotakashi | 0:8fdf9a60065b | 666 | |
kadonotakashi | 0:8fdf9a60065b | 667 | /*! |
kadonotakashi | 0:8fdf9a60065b | 668 | * @brief Aborts the slave data transfer which used IRQ, share same API with master. |
kadonotakashi | 0:8fdf9a60065b | 669 | * |
kadonotakashi | 0:8fdf9a60065b | 670 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 671 | * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 672 | */ |
kadonotakashi | 0:8fdf9a60065b | 673 | static inline void FLEXIO_SPI_SlaveTransferAbort(FLEXIO_SPI_Type *base, flexio_spi_slave_handle_t *handle) |
kadonotakashi | 0:8fdf9a60065b | 674 | { |
kadonotakashi | 0:8fdf9a60065b | 675 | FLEXIO_SPI_MasterTransferAbort(base, handle); |
kadonotakashi | 0:8fdf9a60065b | 676 | } |
kadonotakashi | 0:8fdf9a60065b | 677 | /*! |
kadonotakashi | 0:8fdf9a60065b | 678 | * @brief Gets the data transfer status which used IRQ, share same API with master. |
kadonotakashi | 0:8fdf9a60065b | 679 | * |
kadonotakashi | 0:8fdf9a60065b | 680 | * @param base Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 681 | * @param handle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 682 | * @param count Number of bytes transferred so far by the non-blocking transaction. |
kadonotakashi | 0:8fdf9a60065b | 683 | * @retval kStatus_InvalidArgument count is Invalid. |
kadonotakashi | 0:8fdf9a60065b | 684 | * @retval kStatus_Success Successfully return the count. |
kadonotakashi | 0:8fdf9a60065b | 685 | */ |
kadonotakashi | 0:8fdf9a60065b | 686 | static inline status_t FLEXIO_SPI_SlaveTransferGetCount(FLEXIO_SPI_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 687 | flexio_spi_slave_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 688 | size_t *count) |
kadonotakashi | 0:8fdf9a60065b | 689 | { |
kadonotakashi | 0:8fdf9a60065b | 690 | return FLEXIO_SPI_MasterTransferGetCount(base, handle, count); |
kadonotakashi | 0:8fdf9a60065b | 691 | } |
kadonotakashi | 0:8fdf9a60065b | 692 | |
kadonotakashi | 0:8fdf9a60065b | 693 | /*! |
kadonotakashi | 0:8fdf9a60065b | 694 | * @brief FlexIO SPI slave IRQ handler function. |
kadonotakashi | 0:8fdf9a60065b | 695 | * |
kadonotakashi | 0:8fdf9a60065b | 696 | * @param spiType Pointer to the FLEXIO_SPI_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 697 | * @param spiHandle Pointer to the flexio_spi_slave_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 698 | */ |
kadonotakashi | 0:8fdf9a60065b | 699 | void FLEXIO_SPI_SlaveTransferHandleIRQ(void *spiType, void *spiHandle); |
kadonotakashi | 0:8fdf9a60065b | 700 | |
kadonotakashi | 0:8fdf9a60065b | 701 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 702 | |
kadonotakashi | 0:8fdf9a60065b | 703 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 704 | } |
kadonotakashi | 0:8fdf9a60065b | 705 | #endif /*_cplusplus*/ |
kadonotakashi | 0:8fdf9a60065b | 706 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 707 | |
kadonotakashi | 0:8fdf9a60065b | 708 | #endif /*_FSL_FLEXIO_SPI_H_*/ |