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_UBRIDGE/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/drivers/fsl_flexio_i2s.h@145:64910690c574, 2017-06-21 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Jun 21 17:31:38 2017 +0100
- Revision:
- 145:64910690c574
Release 145 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 145:64910690c574 | 1 | /* |
AnnaBridge | 145:64910690c574 | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
AnnaBridge | 145:64910690c574 | 3 | * All rights reserved. |
AnnaBridge | 145:64910690c574 | 4 | * |
AnnaBridge | 145:64910690c574 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
AnnaBridge | 145:64910690c574 | 6 | * are permitted provided that the following conditions are met: |
AnnaBridge | 145:64910690c574 | 7 | * |
AnnaBridge | 145:64910690c574 | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
AnnaBridge | 145:64910690c574 | 9 | * of conditions and the following disclaimer. |
AnnaBridge | 145:64910690c574 | 10 | * |
AnnaBridge | 145:64910690c574 | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
AnnaBridge | 145:64910690c574 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
AnnaBridge | 145:64910690c574 | 13 | * other materials provided with the distribution. |
AnnaBridge | 145:64910690c574 | 14 | * |
AnnaBridge | 145:64910690c574 | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
AnnaBridge | 145:64910690c574 | 16 | * contributors may be used to endorse or promote products derived from this |
AnnaBridge | 145:64910690c574 | 17 | * software without specific prior written permission. |
AnnaBridge | 145:64910690c574 | 18 | * |
AnnaBridge | 145:64910690c574 | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
AnnaBridge | 145:64910690c574 | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
AnnaBridge | 145:64910690c574 | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
AnnaBridge | 145:64910690c574 | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
AnnaBridge | 145:64910690c574 | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
AnnaBridge | 145:64910690c574 | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
AnnaBridge | 145:64910690c574 | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
AnnaBridge | 145:64910690c574 | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
AnnaBridge | 145:64910690c574 | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
AnnaBridge | 145:64910690c574 | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
AnnaBridge | 145:64910690c574 | 29 | */ |
AnnaBridge | 145:64910690c574 | 30 | #ifndef _FSL_FLEXIO_I2S_H_ |
AnnaBridge | 145:64910690c574 | 31 | #define _FSL_FLEXIO_I2S_H_ |
AnnaBridge | 145:64910690c574 | 32 | |
AnnaBridge | 145:64910690c574 | 33 | #include "fsl_common.h" |
AnnaBridge | 145:64910690c574 | 34 | #include "fsl_flexio.h" |
AnnaBridge | 145:64910690c574 | 35 | |
AnnaBridge | 145:64910690c574 | 36 | /*! |
AnnaBridge | 145:64910690c574 | 37 | * @addtogroup flexio_i2s |
AnnaBridge | 145:64910690c574 | 38 | * @{ |
AnnaBridge | 145:64910690c574 | 39 | */ |
AnnaBridge | 145:64910690c574 | 40 | |
AnnaBridge | 145:64910690c574 | 41 | |
AnnaBridge | 145:64910690c574 | 42 | /******************************************************************************* |
AnnaBridge | 145:64910690c574 | 43 | * Definitions |
AnnaBridge | 145:64910690c574 | 44 | ******************************************************************************/ |
AnnaBridge | 145:64910690c574 | 45 | |
AnnaBridge | 145:64910690c574 | 46 | /*! @name Driver version */ |
AnnaBridge | 145:64910690c574 | 47 | /*@{*/ |
AnnaBridge | 145:64910690c574 | 48 | /*! @brief FlexIO I2S driver version 2.1.0. */ |
AnnaBridge | 145:64910690c574 | 49 | #define FSL_FLEXIO_I2S_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) |
AnnaBridge | 145:64910690c574 | 50 | /*@}*/ |
AnnaBridge | 145:64910690c574 | 51 | |
AnnaBridge | 145:64910690c574 | 52 | /*! @brief FlexIO I2S transfer status */ |
AnnaBridge | 145:64910690c574 | 53 | enum _flexio_i2s_status |
AnnaBridge | 145:64910690c574 | 54 | { |
AnnaBridge | 145:64910690c574 | 55 | kStatus_FLEXIO_I2S_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 0), /*!< FlexIO I2S is in idle state */ |
AnnaBridge | 145:64910690c574 | 56 | kStatus_FLEXIO_I2S_TxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 1), /*!< FlexIO I2S Tx is busy */ |
AnnaBridge | 145:64910690c574 | 57 | kStatus_FLEXIO_I2S_RxBusy = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 2), /*!< FlexIO I2S Tx is busy */ |
AnnaBridge | 145:64910690c574 | 58 | kStatus_FLEXIO_I2S_Error = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 3), /*!< FlexIO I2S error occurred */ |
AnnaBridge | 145:64910690c574 | 59 | kStatus_FLEXIO_I2S_QueueFull = MAKE_STATUS(kStatusGroup_FLEXIO_I2S, 4), /*!< FlexIO I2S transfer queue is full. */ |
AnnaBridge | 145:64910690c574 | 60 | }; |
AnnaBridge | 145:64910690c574 | 61 | |
AnnaBridge | 145:64910690c574 | 62 | /*! @brief Define FlexIO I2S access structure typedef */ |
AnnaBridge | 145:64910690c574 | 63 | typedef struct _flexio_i2s_type |
AnnaBridge | 145:64910690c574 | 64 | { |
AnnaBridge | 145:64910690c574 | 65 | FLEXIO_Type *flexioBase; /*!< FlexIO base pointer */ |
AnnaBridge | 145:64910690c574 | 66 | uint8_t txPinIndex; /*!< Tx data pin index in FlexIO pins */ |
AnnaBridge | 145:64910690c574 | 67 | uint8_t rxPinIndex; /*!< Rx data pin index */ |
AnnaBridge | 145:64910690c574 | 68 | uint8_t bclkPinIndex; /*!< Bit clock pin index */ |
AnnaBridge | 145:64910690c574 | 69 | uint8_t fsPinIndex; /*!< Frame sync pin index */ |
AnnaBridge | 145:64910690c574 | 70 | uint8_t txShifterIndex; /*!< Tx data shifter index */ |
AnnaBridge | 145:64910690c574 | 71 | uint8_t rxShifterIndex; /*!< Rx data shifter index */ |
AnnaBridge | 145:64910690c574 | 72 | uint8_t bclkTimerIndex; /*!< Bit clock timer index */ |
AnnaBridge | 145:64910690c574 | 73 | uint8_t fsTimerIndex; /*!< Frame sync timer index */ |
AnnaBridge | 145:64910690c574 | 74 | } FLEXIO_I2S_Type; |
AnnaBridge | 145:64910690c574 | 75 | |
AnnaBridge | 145:64910690c574 | 76 | /*! @brief Master or slave mode */ |
AnnaBridge | 145:64910690c574 | 77 | typedef enum _flexio_i2s_master_slave |
AnnaBridge | 145:64910690c574 | 78 | { |
AnnaBridge | 145:64910690c574 | 79 | kFLEXIO_I2S_Master = 0x0U, /*!< Master mode */ |
AnnaBridge | 145:64910690c574 | 80 | kFLEXIO_I2S_Slave = 0x1U /*!< Slave mode */ |
AnnaBridge | 145:64910690c574 | 81 | } flexio_i2s_master_slave_t; |
AnnaBridge | 145:64910690c574 | 82 | |
AnnaBridge | 145:64910690c574 | 83 | /*! @brief Define FlexIO FlexIO I2S interrupt mask. */ |
AnnaBridge | 145:64910690c574 | 84 | enum _flexio_i2s_interrupt_enable |
AnnaBridge | 145:64910690c574 | 85 | { |
AnnaBridge | 145:64910690c574 | 86 | kFLEXIO_I2S_TxDataRegEmptyInterruptEnable = 0x1U, /*!< Transmit buffer empty interrupt enable. */ |
AnnaBridge | 145:64910690c574 | 87 | kFLEXIO_I2S_RxDataRegFullInterruptEnable = 0x2U, /*!< Receive buffer full interrupt enable. */ |
AnnaBridge | 145:64910690c574 | 88 | }; |
AnnaBridge | 145:64910690c574 | 89 | |
AnnaBridge | 145:64910690c574 | 90 | /*! @brief Define FlexIO FlexIO I2S status mask. */ |
AnnaBridge | 145:64910690c574 | 91 | enum _flexio_i2s_status_flags |
AnnaBridge | 145:64910690c574 | 92 | { |
AnnaBridge | 145:64910690c574 | 93 | kFLEXIO_I2S_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */ |
AnnaBridge | 145:64910690c574 | 94 | kFLEXIO_I2S_RxDataRegFullFlag = 0x2U, /*!< Receive buffer full flag. */ |
AnnaBridge | 145:64910690c574 | 95 | }; |
AnnaBridge | 145:64910690c574 | 96 | |
AnnaBridge | 145:64910690c574 | 97 | /*! @brief FlexIO I2S configure structure */ |
AnnaBridge | 145:64910690c574 | 98 | typedef struct _flexio_i2s_config |
AnnaBridge | 145:64910690c574 | 99 | { |
AnnaBridge | 145:64910690c574 | 100 | bool enableI2S; /*!< Enable FlexIO I2S */ |
AnnaBridge | 145:64910690c574 | 101 | flexio_i2s_master_slave_t masterSlave; /*!< Master or slave */ |
AnnaBridge | 145:64910690c574 | 102 | } flexio_i2s_config_t; |
AnnaBridge | 145:64910690c574 | 103 | |
AnnaBridge | 145:64910690c574 | 104 | /*! @brief FlexIO I2S audio format, FlexIO I2S only support the same format in Tx and Rx */ |
AnnaBridge | 145:64910690c574 | 105 | typedef struct _flexio_i2s_format |
AnnaBridge | 145:64910690c574 | 106 | { |
AnnaBridge | 145:64910690c574 | 107 | uint8_t bitWidth; /*!< Bit width of audio data, always 8/16/24/32 bits */ |
AnnaBridge | 145:64910690c574 | 108 | uint32_t sampleRate_Hz; /*!< Sample rate of the audio data */ |
AnnaBridge | 145:64910690c574 | 109 | } flexio_i2s_format_t; |
AnnaBridge | 145:64910690c574 | 110 | |
AnnaBridge | 145:64910690c574 | 111 | /*!@brief FlexIO I2S transfer queue size, user can refine it according to use case. */ |
AnnaBridge | 145:64910690c574 | 112 | #define FLEXIO_I2S_XFER_QUEUE_SIZE (4) |
AnnaBridge | 145:64910690c574 | 113 | |
AnnaBridge | 145:64910690c574 | 114 | /*! @brief Audio sample rate */ |
AnnaBridge | 145:64910690c574 | 115 | typedef enum _flexio_i2s_sample_rate |
AnnaBridge | 145:64910690c574 | 116 | { |
AnnaBridge | 145:64910690c574 | 117 | kFLEXIO_I2S_SampleRate8KHz = 8000U, /*!< Sample rate 8000Hz */ |
AnnaBridge | 145:64910690c574 | 118 | kFLEXIO_I2S_SampleRate11025Hz = 11025U, /*!< Sample rate 11025Hz */ |
AnnaBridge | 145:64910690c574 | 119 | kFLEXIO_I2S_SampleRate12KHz = 12000U, /*!< Sample rate 12000Hz */ |
AnnaBridge | 145:64910690c574 | 120 | kFLEXIO_I2S_SampleRate16KHz = 16000U, /*!< Sample rate 16000Hz */ |
AnnaBridge | 145:64910690c574 | 121 | kFLEXIO_I2S_SampleRate22050Hz = 22050U, /*!< Sample rate 22050Hz */ |
AnnaBridge | 145:64910690c574 | 122 | kFLEXIO_I2S_SampleRate24KHz = 24000U, /*!< Sample rate 24000Hz */ |
AnnaBridge | 145:64910690c574 | 123 | kFLEXIO_I2S_SampleRate32KHz = 32000U, /*!< Sample rate 32000Hz */ |
AnnaBridge | 145:64910690c574 | 124 | kFLEXIO_I2S_SampleRate44100Hz = 44100U, /*!< Sample rate 44100Hz */ |
AnnaBridge | 145:64910690c574 | 125 | kFLEXIO_I2S_SampleRate48KHz = 48000U, /*!< Sample rate 48000Hz */ |
AnnaBridge | 145:64910690c574 | 126 | kFLEXIO_I2S_SampleRate96KHz = 96000U /*!< Sample rate 96000Hz */ |
AnnaBridge | 145:64910690c574 | 127 | } flexio_i2s_sample_rate_t; |
AnnaBridge | 145:64910690c574 | 128 | |
AnnaBridge | 145:64910690c574 | 129 | /*! @brief Audio word width */ |
AnnaBridge | 145:64910690c574 | 130 | typedef enum _flexio_i2s_word_width |
AnnaBridge | 145:64910690c574 | 131 | { |
AnnaBridge | 145:64910690c574 | 132 | kFLEXIO_I2S_WordWidth8bits = 8U, /*!< Audio data width 8 bits */ |
AnnaBridge | 145:64910690c574 | 133 | kFLEXIO_I2S_WordWidth16bits = 16U, /*!< Audio data width 16 bits */ |
AnnaBridge | 145:64910690c574 | 134 | kFLEXIO_I2S_WordWidth24bits = 24U, /*!< Audio data width 24 bits */ |
AnnaBridge | 145:64910690c574 | 135 | kFLEXIO_I2S_WordWidth32bits = 32U /*!< Audio data width 32 bits */ |
AnnaBridge | 145:64910690c574 | 136 | } flexio_i2s_word_width_t; |
AnnaBridge | 145:64910690c574 | 137 | |
AnnaBridge | 145:64910690c574 | 138 | /*! @brief Define FlexIO I2S transfer structure. */ |
AnnaBridge | 145:64910690c574 | 139 | typedef struct _flexio_i2s_transfer |
AnnaBridge | 145:64910690c574 | 140 | { |
AnnaBridge | 145:64910690c574 | 141 | uint8_t *data; /*!< Data buffer start pointer */ |
AnnaBridge | 145:64910690c574 | 142 | size_t dataSize; /*!< Bytes to be transferred. */ |
AnnaBridge | 145:64910690c574 | 143 | } flexio_i2s_transfer_t; |
AnnaBridge | 145:64910690c574 | 144 | |
AnnaBridge | 145:64910690c574 | 145 | typedef struct _flexio_i2s_handle flexio_i2s_handle_t; |
AnnaBridge | 145:64910690c574 | 146 | |
AnnaBridge | 145:64910690c574 | 147 | /*! @brief FlexIO I2S xfer callback prototype */ |
AnnaBridge | 145:64910690c574 | 148 | typedef void (*flexio_i2s_callback_t)(FLEXIO_I2S_Type *base, |
AnnaBridge | 145:64910690c574 | 149 | flexio_i2s_handle_t *handle, |
AnnaBridge | 145:64910690c574 | 150 | status_t status, |
AnnaBridge | 145:64910690c574 | 151 | void *userData); |
AnnaBridge | 145:64910690c574 | 152 | |
AnnaBridge | 145:64910690c574 | 153 | /*! @brief Define FlexIO I2S handle structure. */ |
AnnaBridge | 145:64910690c574 | 154 | struct _flexio_i2s_handle |
AnnaBridge | 145:64910690c574 | 155 | { |
AnnaBridge | 145:64910690c574 | 156 | uint32_t state; /*!< Internal state */ |
AnnaBridge | 145:64910690c574 | 157 | flexio_i2s_callback_t callback; /*!< Callback function called at transfer event*/ |
AnnaBridge | 145:64910690c574 | 158 | void *userData; /*!< Callback parameter passed to callback function*/ |
AnnaBridge | 145:64910690c574 | 159 | uint8_t bitWidth; /*!< Bit width for transfer, 8/16/24/32bits */ |
AnnaBridge | 145:64910690c574 | 160 | flexio_i2s_transfer_t queue[FLEXIO_I2S_XFER_QUEUE_SIZE]; /*!< Transfer queue storing queued transfer */ |
AnnaBridge | 145:64910690c574 | 161 | size_t transferSize[FLEXIO_I2S_XFER_QUEUE_SIZE]; /*!< Data bytes need to transfer */ |
AnnaBridge | 145:64910690c574 | 162 | volatile uint8_t queueUser; /*!< Index for user to queue transfer */ |
AnnaBridge | 145:64910690c574 | 163 | volatile uint8_t queueDriver; /*!< Index for driver to get the transfer data and size */ |
AnnaBridge | 145:64910690c574 | 164 | }; |
AnnaBridge | 145:64910690c574 | 165 | |
AnnaBridge | 145:64910690c574 | 166 | /******************************************************************************* |
AnnaBridge | 145:64910690c574 | 167 | * API |
AnnaBridge | 145:64910690c574 | 168 | ******************************************************************************/ |
AnnaBridge | 145:64910690c574 | 169 | |
AnnaBridge | 145:64910690c574 | 170 | #if defined(__cplusplus) |
AnnaBridge | 145:64910690c574 | 171 | extern "C" { |
AnnaBridge | 145:64910690c574 | 172 | #endif /*_cplusplus*/ |
AnnaBridge | 145:64910690c574 | 173 | |
AnnaBridge | 145:64910690c574 | 174 | /*! |
AnnaBridge | 145:64910690c574 | 175 | * @name Initialization and deinitialization |
AnnaBridge | 145:64910690c574 | 176 | * @{ |
AnnaBridge | 145:64910690c574 | 177 | */ |
AnnaBridge | 145:64910690c574 | 178 | |
AnnaBridge | 145:64910690c574 | 179 | /*! |
AnnaBridge | 145:64910690c574 | 180 | * @brief Initializes the FlexIO I2S. |
AnnaBridge | 145:64910690c574 | 181 | * |
AnnaBridge | 145:64910690c574 | 182 | * This API configures FlexIO pins and shifter to I2S and configures the FlexIO I2S with a configuration structure. |
AnnaBridge | 145:64910690c574 | 183 | * The configuration structure can be filled by the user, or be set with default values by |
AnnaBridge | 145:64910690c574 | 184 | * FLEXIO_I2S_GetDefaultConfig(). |
AnnaBridge | 145:64910690c574 | 185 | * |
AnnaBridge | 145:64910690c574 | 186 | * @note This API should be called at the beginning of the application to use |
AnnaBridge | 145:64910690c574 | 187 | * the FlexIO I2S driver. Otherwise, any access to the FlexIO I2S module can cause hard fault |
AnnaBridge | 145:64910690c574 | 188 | * because the clock is not enabled. |
AnnaBridge | 145:64910690c574 | 189 | * |
AnnaBridge | 145:64910690c574 | 190 | * @param base FlexIO I2S base pointer |
AnnaBridge | 145:64910690c574 | 191 | * @param config FlexIO I2S configure structure. |
AnnaBridge | 145:64910690c574 | 192 | */ |
AnnaBridge | 145:64910690c574 | 193 | void FLEXIO_I2S_Init(FLEXIO_I2S_Type *base, const flexio_i2s_config_t *config); |
AnnaBridge | 145:64910690c574 | 194 | |
AnnaBridge | 145:64910690c574 | 195 | /*! |
AnnaBridge | 145:64910690c574 | 196 | * @brief Sets the FlexIO I2S configuration structure to default values. |
AnnaBridge | 145:64910690c574 | 197 | * |
AnnaBridge | 145:64910690c574 | 198 | * The purpose of this API is to get the configuration structure initialized for use in FLEXIO_I2S_Init(). |
AnnaBridge | 145:64910690c574 | 199 | * Users may use the initialized structure unchanged in FLEXIO_I2S_Init() or modify |
AnnaBridge | 145:64910690c574 | 200 | * some fields of the structure before calling FLEXIO_I2S_Init(). |
AnnaBridge | 145:64910690c574 | 201 | * |
AnnaBridge | 145:64910690c574 | 202 | * @param config pointer to master configuration structure |
AnnaBridge | 145:64910690c574 | 203 | */ |
AnnaBridge | 145:64910690c574 | 204 | void FLEXIO_I2S_GetDefaultConfig(flexio_i2s_config_t *config); |
AnnaBridge | 145:64910690c574 | 205 | |
AnnaBridge | 145:64910690c574 | 206 | /*! |
AnnaBridge | 145:64910690c574 | 207 | * @brief De-initializes the FlexIO I2S. |
AnnaBridge | 145:64910690c574 | 208 | * |
AnnaBridge | 145:64910690c574 | 209 | * Calling this API gates the FlexIO i2s clock. After calling this API, call the FLEXO_I2S_Init to use the |
AnnaBridge | 145:64910690c574 | 210 | * FlexIO I2S module. |
AnnaBridge | 145:64910690c574 | 211 | * |
AnnaBridge | 145:64910690c574 | 212 | * @param base FlexIO I2S base pointer |
AnnaBridge | 145:64910690c574 | 213 | */ |
AnnaBridge | 145:64910690c574 | 214 | void FLEXIO_I2S_Deinit(FLEXIO_I2S_Type *base); |
AnnaBridge | 145:64910690c574 | 215 | |
AnnaBridge | 145:64910690c574 | 216 | /*! |
AnnaBridge | 145:64910690c574 | 217 | * @brief Enables/disables the FlexIO I2S module operation. |
AnnaBridge | 145:64910690c574 | 218 | * |
AnnaBridge | 145:64910690c574 | 219 | * @param base Pointer to FLEXIO_I2S_Type |
AnnaBridge | 145:64910690c574 | 220 | * @param enable True to enable, false to disable. |
AnnaBridge | 145:64910690c574 | 221 | */ |
AnnaBridge | 145:64910690c574 | 222 | static inline void FLEXIO_I2S_Enable(FLEXIO_I2S_Type *base, bool enable) |
AnnaBridge | 145:64910690c574 | 223 | { |
AnnaBridge | 145:64910690c574 | 224 | if (enable) |
AnnaBridge | 145:64910690c574 | 225 | { |
AnnaBridge | 145:64910690c574 | 226 | base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; |
AnnaBridge | 145:64910690c574 | 227 | } |
AnnaBridge | 145:64910690c574 | 228 | else |
AnnaBridge | 145:64910690c574 | 229 | { |
AnnaBridge | 145:64910690c574 | 230 | base->flexioBase->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; |
AnnaBridge | 145:64910690c574 | 231 | } |
AnnaBridge | 145:64910690c574 | 232 | } |
AnnaBridge | 145:64910690c574 | 233 | |
AnnaBridge | 145:64910690c574 | 234 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 235 | |
AnnaBridge | 145:64910690c574 | 236 | /*! |
AnnaBridge | 145:64910690c574 | 237 | * @name Status |
AnnaBridge | 145:64910690c574 | 238 | * @{ |
AnnaBridge | 145:64910690c574 | 239 | */ |
AnnaBridge | 145:64910690c574 | 240 | |
AnnaBridge | 145:64910690c574 | 241 | /*! |
AnnaBridge | 145:64910690c574 | 242 | * @brief Gets the FlexIO I2S status flags. |
AnnaBridge | 145:64910690c574 | 243 | * |
AnnaBridge | 145:64910690c574 | 244 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 245 | * @return Status flag, which are ORed by the enumerators in the _flexio_i2s_status_flags. |
AnnaBridge | 145:64910690c574 | 246 | */ |
AnnaBridge | 145:64910690c574 | 247 | uint32_t FLEXIO_I2S_GetStatusFlags(FLEXIO_I2S_Type *base); |
AnnaBridge | 145:64910690c574 | 248 | |
AnnaBridge | 145:64910690c574 | 249 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 250 | |
AnnaBridge | 145:64910690c574 | 251 | /*! |
AnnaBridge | 145:64910690c574 | 252 | * @name Interrupts |
AnnaBridge | 145:64910690c574 | 253 | * @{ |
AnnaBridge | 145:64910690c574 | 254 | */ |
AnnaBridge | 145:64910690c574 | 255 | |
AnnaBridge | 145:64910690c574 | 256 | /*! |
AnnaBridge | 145:64910690c574 | 257 | * @brief Enables the FlexIO I2S interrupt. |
AnnaBridge | 145:64910690c574 | 258 | * |
AnnaBridge | 145:64910690c574 | 259 | * This function enables the FlexIO UART interrupt. |
AnnaBridge | 145:64910690c574 | 260 | * |
AnnaBridge | 145:64910690c574 | 261 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 262 | * @param mask interrupt source |
AnnaBridge | 145:64910690c574 | 263 | */ |
AnnaBridge | 145:64910690c574 | 264 | void FLEXIO_I2S_EnableInterrupts(FLEXIO_I2S_Type *base, uint32_t mask); |
AnnaBridge | 145:64910690c574 | 265 | |
AnnaBridge | 145:64910690c574 | 266 | /*! |
AnnaBridge | 145:64910690c574 | 267 | * @brief Disables the FlexIO I2S interrupt. |
AnnaBridge | 145:64910690c574 | 268 | * |
AnnaBridge | 145:64910690c574 | 269 | * This function enables the FlexIO UART interrupt. |
AnnaBridge | 145:64910690c574 | 270 | * |
AnnaBridge | 145:64910690c574 | 271 | * @param base pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 272 | * @param mask interrupt source |
AnnaBridge | 145:64910690c574 | 273 | */ |
AnnaBridge | 145:64910690c574 | 274 | void FLEXIO_I2S_DisableInterrupts(FLEXIO_I2S_Type *base, uint32_t mask); |
AnnaBridge | 145:64910690c574 | 275 | |
AnnaBridge | 145:64910690c574 | 276 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 277 | |
AnnaBridge | 145:64910690c574 | 278 | /*! |
AnnaBridge | 145:64910690c574 | 279 | * @name DMA Control |
AnnaBridge | 145:64910690c574 | 280 | * @{ |
AnnaBridge | 145:64910690c574 | 281 | */ |
AnnaBridge | 145:64910690c574 | 282 | |
AnnaBridge | 145:64910690c574 | 283 | /*! |
AnnaBridge | 145:64910690c574 | 284 | * @brief Enables/disables the FlexIO I2S Tx DMA requests. |
AnnaBridge | 145:64910690c574 | 285 | * |
AnnaBridge | 145:64910690c574 | 286 | * @param base FlexIO I2S base pointer |
AnnaBridge | 145:64910690c574 | 287 | * @param enable True means enable DMA, false means disable DMA. |
AnnaBridge | 145:64910690c574 | 288 | */ |
AnnaBridge | 145:64910690c574 | 289 | static inline void FLEXIO_I2S_TxEnableDMA(FLEXIO_I2S_Type *base, bool enable) |
AnnaBridge | 145:64910690c574 | 290 | { |
AnnaBridge | 145:64910690c574 | 291 | FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1 << base->txShifterIndex, enable); |
AnnaBridge | 145:64910690c574 | 292 | } |
AnnaBridge | 145:64910690c574 | 293 | |
AnnaBridge | 145:64910690c574 | 294 | /*! |
AnnaBridge | 145:64910690c574 | 295 | * @brief Enables/disables the FlexIO I2S Rx DMA requests. |
AnnaBridge | 145:64910690c574 | 296 | * |
AnnaBridge | 145:64910690c574 | 297 | * @param base FlexIO I2S base pointer |
AnnaBridge | 145:64910690c574 | 298 | * @param enable True means enable DMA, false means disable DMA. |
AnnaBridge | 145:64910690c574 | 299 | */ |
AnnaBridge | 145:64910690c574 | 300 | static inline void FLEXIO_I2S_RxEnableDMA(FLEXIO_I2S_Type *base, bool enable) |
AnnaBridge | 145:64910690c574 | 301 | { |
AnnaBridge | 145:64910690c574 | 302 | FLEXIO_EnableShifterStatusDMA(base->flexioBase, 1 << base->rxShifterIndex, enable); |
AnnaBridge | 145:64910690c574 | 303 | } |
AnnaBridge | 145:64910690c574 | 304 | |
AnnaBridge | 145:64910690c574 | 305 | /*! |
AnnaBridge | 145:64910690c574 | 306 | * @brief Gets the FlexIO I2S send data register address. |
AnnaBridge | 145:64910690c574 | 307 | * |
AnnaBridge | 145:64910690c574 | 308 | * This function returns the I2S data register address, mainly used by DMA/eDMA. |
AnnaBridge | 145:64910690c574 | 309 | * |
AnnaBridge | 145:64910690c574 | 310 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 311 | * @return FlexIO i2s send data register address. |
AnnaBridge | 145:64910690c574 | 312 | */ |
AnnaBridge | 145:64910690c574 | 313 | static inline uint32_t FLEXIO_I2S_TxGetDataRegisterAddress(FLEXIO_I2S_Type *base) |
AnnaBridge | 145:64910690c574 | 314 | { |
AnnaBridge | 145:64910690c574 | 315 | return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->txShifterIndex); |
AnnaBridge | 145:64910690c574 | 316 | } |
AnnaBridge | 145:64910690c574 | 317 | |
AnnaBridge | 145:64910690c574 | 318 | /*! |
AnnaBridge | 145:64910690c574 | 319 | * @brief Gets the FlexIO I2S receive data register address. |
AnnaBridge | 145:64910690c574 | 320 | * |
AnnaBridge | 145:64910690c574 | 321 | * This function returns the I2S data register address, mainly used by DMA/eDMA. |
AnnaBridge | 145:64910690c574 | 322 | * |
AnnaBridge | 145:64910690c574 | 323 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 324 | * @return FlexIO i2s receive data register address. |
AnnaBridge | 145:64910690c574 | 325 | */ |
AnnaBridge | 145:64910690c574 | 326 | static inline uint32_t FLEXIO_I2S_RxGetDataRegisterAddress(FLEXIO_I2S_Type *base) |
AnnaBridge | 145:64910690c574 | 327 | { |
AnnaBridge | 145:64910690c574 | 328 | return FLEXIO_GetShifterBufferAddress(base->flexioBase, kFLEXIO_ShifterBufferBitSwapped, base->rxShifterIndex); |
AnnaBridge | 145:64910690c574 | 329 | } |
AnnaBridge | 145:64910690c574 | 330 | |
AnnaBridge | 145:64910690c574 | 331 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 332 | |
AnnaBridge | 145:64910690c574 | 333 | /*! |
AnnaBridge | 145:64910690c574 | 334 | * @name Bus Operations |
AnnaBridge | 145:64910690c574 | 335 | * @{ |
AnnaBridge | 145:64910690c574 | 336 | */ |
AnnaBridge | 145:64910690c574 | 337 | |
AnnaBridge | 145:64910690c574 | 338 | /*! |
AnnaBridge | 145:64910690c574 | 339 | * @brief Configures the FlexIO I2S audio format in master mode. |
AnnaBridge | 145:64910690c574 | 340 | * |
AnnaBridge | 145:64910690c574 | 341 | * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data |
AnnaBridge | 145:64910690c574 | 342 | * format to be transferred. |
AnnaBridge | 145:64910690c574 | 343 | * |
AnnaBridge | 145:64910690c574 | 344 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 345 | * @param format Pointer to FlexIO I2S audio data format structure. |
AnnaBridge | 145:64910690c574 | 346 | * @param srcClock_Hz I2S master clock source frequency in Hz. |
AnnaBridge | 145:64910690c574 | 347 | */ |
AnnaBridge | 145:64910690c574 | 348 | void FLEXIO_I2S_MasterSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format, uint32_t srcClock_Hz); |
AnnaBridge | 145:64910690c574 | 349 | |
AnnaBridge | 145:64910690c574 | 350 | /*! |
AnnaBridge | 145:64910690c574 | 351 | * @brief Configures the FlexIO I2S audio format in slave mode. |
AnnaBridge | 145:64910690c574 | 352 | * |
AnnaBridge | 145:64910690c574 | 353 | * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data |
AnnaBridge | 145:64910690c574 | 354 | * format to be transferred. |
AnnaBridge | 145:64910690c574 | 355 | * |
AnnaBridge | 145:64910690c574 | 356 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 357 | * @param format Pointer to FlexIO I2S audio data format structure. |
AnnaBridge | 145:64910690c574 | 358 | */ |
AnnaBridge | 145:64910690c574 | 359 | void FLEXIO_I2S_SlaveSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format); |
AnnaBridge | 145:64910690c574 | 360 | |
AnnaBridge | 145:64910690c574 | 361 | /*! |
AnnaBridge | 145:64910690c574 | 362 | * @brief Sends data using a blocking method. |
AnnaBridge | 145:64910690c574 | 363 | * |
AnnaBridge | 145:64910690c574 | 364 | * @note This function blocks via polling until data is ready to be sent. |
AnnaBridge | 145:64910690c574 | 365 | * |
AnnaBridge | 145:64910690c574 | 366 | * @param base FlexIO I2S base pointer. |
AnnaBridge | 145:64910690c574 | 367 | * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. |
AnnaBridge | 145:64910690c574 | 368 | * @param txData Pointer to the data to be written. |
AnnaBridge | 145:64910690c574 | 369 | * @param size Bytes to be written. |
AnnaBridge | 145:64910690c574 | 370 | */ |
AnnaBridge | 145:64910690c574 | 371 | void FLEXIO_I2S_WriteBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *txData, size_t size); |
AnnaBridge | 145:64910690c574 | 372 | |
AnnaBridge | 145:64910690c574 | 373 | /*! |
AnnaBridge | 145:64910690c574 | 374 | * @brief Writes data into a data register. |
AnnaBridge | 145:64910690c574 | 375 | * |
AnnaBridge | 145:64910690c574 | 376 | * @param base FlexIO I2S base pointer. |
AnnaBridge | 145:64910690c574 | 377 | * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. |
AnnaBridge | 145:64910690c574 | 378 | * @param data Data to be written. |
AnnaBridge | 145:64910690c574 | 379 | */ |
AnnaBridge | 145:64910690c574 | 380 | static inline void FLEXIO_I2S_WriteData(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint32_t data) |
AnnaBridge | 145:64910690c574 | 381 | { |
AnnaBridge | 145:64910690c574 | 382 | base->flexioBase->SHIFTBUFBIS[base->txShifterIndex] = (data << (32U - bitWidth)); |
AnnaBridge | 145:64910690c574 | 383 | } |
AnnaBridge | 145:64910690c574 | 384 | |
AnnaBridge | 145:64910690c574 | 385 | /*! |
AnnaBridge | 145:64910690c574 | 386 | * @brief Receives a piece of data using a blocking method. |
AnnaBridge | 145:64910690c574 | 387 | * |
AnnaBridge | 145:64910690c574 | 388 | * @note This function blocks via polling until data is ready to be sent. |
AnnaBridge | 145:64910690c574 | 389 | * |
AnnaBridge | 145:64910690c574 | 390 | * @param base FlexIO I2S base pointer |
AnnaBridge | 145:64910690c574 | 391 | * @param bitWidth How many bits in a audio word, usually 8/16/24/32 bits. |
AnnaBridge | 145:64910690c574 | 392 | * @param rxData Pointer to the data to be read. |
AnnaBridge | 145:64910690c574 | 393 | * @param size Bytes to be read. |
AnnaBridge | 145:64910690c574 | 394 | */ |
AnnaBridge | 145:64910690c574 | 395 | void FLEXIO_I2S_ReadBlocking(FLEXIO_I2S_Type *base, uint8_t bitWidth, uint8_t *rxData, size_t size); |
AnnaBridge | 145:64910690c574 | 396 | |
AnnaBridge | 145:64910690c574 | 397 | /*! |
AnnaBridge | 145:64910690c574 | 398 | * @brief Reads a data from the data register. |
AnnaBridge | 145:64910690c574 | 399 | * |
AnnaBridge | 145:64910690c574 | 400 | * @param base FlexIO I2S base pointer |
AnnaBridge | 145:64910690c574 | 401 | * @return Data read from data register. |
AnnaBridge | 145:64910690c574 | 402 | */ |
AnnaBridge | 145:64910690c574 | 403 | static inline uint32_t FLEXIO_I2S_ReadData(FLEXIO_I2S_Type *base) |
AnnaBridge | 145:64910690c574 | 404 | { |
AnnaBridge | 145:64910690c574 | 405 | return base->flexioBase->SHIFTBUFBIS[base->rxShifterIndex]; |
AnnaBridge | 145:64910690c574 | 406 | } |
AnnaBridge | 145:64910690c574 | 407 | |
AnnaBridge | 145:64910690c574 | 408 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 409 | |
AnnaBridge | 145:64910690c574 | 410 | /*! |
AnnaBridge | 145:64910690c574 | 411 | * @name Transactional |
AnnaBridge | 145:64910690c574 | 412 | * @{ |
AnnaBridge | 145:64910690c574 | 413 | */ |
AnnaBridge | 145:64910690c574 | 414 | |
AnnaBridge | 145:64910690c574 | 415 | /*! |
AnnaBridge | 145:64910690c574 | 416 | * @brief Initializes the FlexIO I2S handle. |
AnnaBridge | 145:64910690c574 | 417 | * |
AnnaBridge | 145:64910690c574 | 418 | * This function initializes the FlexIO I2S handle which can be used for other |
AnnaBridge | 145:64910690c574 | 419 | * FlexIO I2S transactional APIs. Call this API once to get the |
AnnaBridge | 145:64910690c574 | 420 | * initialized handle. |
AnnaBridge | 145:64910690c574 | 421 | * |
AnnaBridge | 145:64910690c574 | 422 | * @param base Pointer to FLEXIO_I2S_Type structure |
AnnaBridge | 145:64910690c574 | 423 | * @param handle Pointer to flexio_i2s_handle_t structure to store the transfer state. |
AnnaBridge | 145:64910690c574 | 424 | * @param callback FlexIO I2S callback function, which is called while finished a block. |
AnnaBridge | 145:64910690c574 | 425 | * @param userData User parameter for the FlexIO I2S callback. |
AnnaBridge | 145:64910690c574 | 426 | */ |
AnnaBridge | 145:64910690c574 | 427 | void FLEXIO_I2S_TransferTxCreateHandle(FLEXIO_I2S_Type *base, |
AnnaBridge | 145:64910690c574 | 428 | flexio_i2s_handle_t *handle, |
AnnaBridge | 145:64910690c574 | 429 | flexio_i2s_callback_t callback, |
AnnaBridge | 145:64910690c574 | 430 | void *userData); |
AnnaBridge | 145:64910690c574 | 431 | |
AnnaBridge | 145:64910690c574 | 432 | /*! |
AnnaBridge | 145:64910690c574 | 433 | * @brief Configures the FlexIO I2S audio format. |
AnnaBridge | 145:64910690c574 | 434 | * |
AnnaBridge | 145:64910690c574 | 435 | * Audio format can be changed at run-time of FlexIO I2S. This function configures the sample rate and audio data |
AnnaBridge | 145:64910690c574 | 436 | * format to be transferred. |
AnnaBridge | 145:64910690c574 | 437 | * |
AnnaBridge | 145:64910690c574 | 438 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 439 | * @param handle FlexIO I2S handle pointer. |
AnnaBridge | 145:64910690c574 | 440 | * @param format Pointer to audio data format structure. |
AnnaBridge | 145:64910690c574 | 441 | * @param srcClock_Hz FlexIO I2S bit clock source frequency in Hz. This parameter should be 0 while in slave mode. |
AnnaBridge | 145:64910690c574 | 442 | */ |
AnnaBridge | 145:64910690c574 | 443 | void FLEXIO_I2S_TransferSetFormat(FLEXIO_I2S_Type *base, |
AnnaBridge | 145:64910690c574 | 444 | flexio_i2s_handle_t *handle, |
AnnaBridge | 145:64910690c574 | 445 | flexio_i2s_format_t *format, |
AnnaBridge | 145:64910690c574 | 446 | uint32_t srcClock_Hz); |
AnnaBridge | 145:64910690c574 | 447 | |
AnnaBridge | 145:64910690c574 | 448 | /*! |
AnnaBridge | 145:64910690c574 | 449 | * @brief Initializes the FlexIO I2S receive handle. |
AnnaBridge | 145:64910690c574 | 450 | * |
AnnaBridge | 145:64910690c574 | 451 | * This function initializes the FlexIO I2S handle which can be used for other |
AnnaBridge | 145:64910690c574 | 452 | * FlexIO I2S transactional APIs. Call this API once to get the |
AnnaBridge | 145:64910690c574 | 453 | * initialized handle. |
AnnaBridge | 145:64910690c574 | 454 | * |
AnnaBridge | 145:64910690c574 | 455 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 456 | * @param handle Pointer to flexio_i2s_handle_t structure to store the transfer state. |
AnnaBridge | 145:64910690c574 | 457 | * @param callback FlexIO I2S callback function, which is called while finished a block. |
AnnaBridge | 145:64910690c574 | 458 | * @param userData User parameter for the FlexIO I2S callback. |
AnnaBridge | 145:64910690c574 | 459 | */ |
AnnaBridge | 145:64910690c574 | 460 | void FLEXIO_I2S_TransferRxCreateHandle(FLEXIO_I2S_Type *base, |
AnnaBridge | 145:64910690c574 | 461 | flexio_i2s_handle_t *handle, |
AnnaBridge | 145:64910690c574 | 462 | flexio_i2s_callback_t callback, |
AnnaBridge | 145:64910690c574 | 463 | void *userData); |
AnnaBridge | 145:64910690c574 | 464 | |
AnnaBridge | 145:64910690c574 | 465 | /*! |
AnnaBridge | 145:64910690c574 | 466 | * @brief Performs an interrupt non-blocking send transfer on FlexIO I2S. |
AnnaBridge | 145:64910690c574 | 467 | * |
AnnaBridge | 145:64910690c574 | 468 | * @note The API returns immediately after transfer initiates. |
AnnaBridge | 145:64910690c574 | 469 | * Call FLEXIO_I2S_GetRemainingBytes to poll the transfer status and check whether |
AnnaBridge | 145:64910690c574 | 470 | * the transfer is finished. If the return status is 0, the transfer is finished. |
AnnaBridge | 145:64910690c574 | 471 | * |
AnnaBridge | 145:64910690c574 | 472 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 473 | * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state |
AnnaBridge | 145:64910690c574 | 474 | * @param xfer Pointer to flexio_i2s_transfer_t structure |
AnnaBridge | 145:64910690c574 | 475 | * @retval kStatus_Success Successfully start the data transmission. |
AnnaBridge | 145:64910690c574 | 476 | * @retval kStatus_FLEXIO_I2S_TxBusy Previous transmission still not finished, data not all written to TX register yet. |
AnnaBridge | 145:64910690c574 | 477 | * @retval kStatus_InvalidArgument The input parameter is invalid. |
AnnaBridge | 145:64910690c574 | 478 | */ |
AnnaBridge | 145:64910690c574 | 479 | status_t FLEXIO_I2S_TransferSendNonBlocking(FLEXIO_I2S_Type *base, |
AnnaBridge | 145:64910690c574 | 480 | flexio_i2s_handle_t *handle, |
AnnaBridge | 145:64910690c574 | 481 | flexio_i2s_transfer_t *xfer); |
AnnaBridge | 145:64910690c574 | 482 | |
AnnaBridge | 145:64910690c574 | 483 | /*! |
AnnaBridge | 145:64910690c574 | 484 | * @brief Performs an interrupt non-blocking receive transfer on FlexIO I2S. |
AnnaBridge | 145:64910690c574 | 485 | * |
AnnaBridge | 145:64910690c574 | 486 | * @note The API returns immediately after transfer initiates. |
AnnaBridge | 145:64910690c574 | 487 | * Call FLEXIO_I2S_GetRemainingBytes to poll the transfer status to check whether |
AnnaBridge | 145:64910690c574 | 488 | * the transfer is finished. If the return status is 0, the transfer is finished. |
AnnaBridge | 145:64910690c574 | 489 | * |
AnnaBridge | 145:64910690c574 | 490 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 491 | * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state |
AnnaBridge | 145:64910690c574 | 492 | * @param xfer Pointer to flexio_i2s_transfer_t structure |
AnnaBridge | 145:64910690c574 | 493 | * @retval kStatus_Success Successfully start the data receive. |
AnnaBridge | 145:64910690c574 | 494 | * @retval kStatus_FLEXIO_I2S_RxBusy Previous receive still not finished. |
AnnaBridge | 145:64910690c574 | 495 | * @retval kStatus_InvalidArgument The input parameter is invalid. |
AnnaBridge | 145:64910690c574 | 496 | */ |
AnnaBridge | 145:64910690c574 | 497 | status_t FLEXIO_I2S_TransferReceiveNonBlocking(FLEXIO_I2S_Type *base, |
AnnaBridge | 145:64910690c574 | 498 | flexio_i2s_handle_t *handle, |
AnnaBridge | 145:64910690c574 | 499 | flexio_i2s_transfer_t *xfer); |
AnnaBridge | 145:64910690c574 | 500 | |
AnnaBridge | 145:64910690c574 | 501 | /*! |
AnnaBridge | 145:64910690c574 | 502 | * @brief Aborts the current send. |
AnnaBridge | 145:64910690c574 | 503 | * |
AnnaBridge | 145:64910690c574 | 504 | * @note This API can be called at any time when interrupt non-blocking transfer initiates |
AnnaBridge | 145:64910690c574 | 505 | * to abort the transfer in a early time. |
AnnaBridge | 145:64910690c574 | 506 | * |
AnnaBridge | 145:64910690c574 | 507 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 508 | * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state |
AnnaBridge | 145:64910690c574 | 509 | */ |
AnnaBridge | 145:64910690c574 | 510 | void FLEXIO_I2S_TransferAbortSend(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle); |
AnnaBridge | 145:64910690c574 | 511 | |
AnnaBridge | 145:64910690c574 | 512 | /*! |
AnnaBridge | 145:64910690c574 | 513 | * @brief Aborts the current receive. |
AnnaBridge | 145:64910690c574 | 514 | * |
AnnaBridge | 145:64910690c574 | 515 | * @note This API can be called at any time when interrupt non-blocking transfer initiates |
AnnaBridge | 145:64910690c574 | 516 | * to abort the transfer in a early time. |
AnnaBridge | 145:64910690c574 | 517 | * |
AnnaBridge | 145:64910690c574 | 518 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 519 | * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state |
AnnaBridge | 145:64910690c574 | 520 | */ |
AnnaBridge | 145:64910690c574 | 521 | void FLEXIO_I2S_TransferAbortReceive(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle); |
AnnaBridge | 145:64910690c574 | 522 | |
AnnaBridge | 145:64910690c574 | 523 | /*! |
AnnaBridge | 145:64910690c574 | 524 | * @brief Gets the remaining bytes to be sent. |
AnnaBridge | 145:64910690c574 | 525 | * |
AnnaBridge | 145:64910690c574 | 526 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 527 | * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state |
AnnaBridge | 145:64910690c574 | 528 | * @param count Bytes sent. |
AnnaBridge | 145:64910690c574 | 529 | * @retval kStatus_Success Succeed get the transfer count. |
AnnaBridge | 145:64910690c574 | 530 | * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. |
AnnaBridge | 145:64910690c574 | 531 | */ |
AnnaBridge | 145:64910690c574 | 532 | status_t FLEXIO_I2S_TransferGetSendCount(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, size_t *count); |
AnnaBridge | 145:64910690c574 | 533 | |
AnnaBridge | 145:64910690c574 | 534 | /*! |
AnnaBridge | 145:64910690c574 | 535 | * @brief Gets the remaining bytes to be received. |
AnnaBridge | 145:64910690c574 | 536 | * |
AnnaBridge | 145:64910690c574 | 537 | * @param base Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 538 | * @param handle Pointer to flexio_i2s_handle_t structure which stores the transfer state |
AnnaBridge | 145:64910690c574 | 539 | * @return count Bytes received. |
AnnaBridge | 145:64910690c574 | 540 | * @retval kStatus_Success Succeed get the transfer count. |
AnnaBridge | 145:64910690c574 | 541 | * @retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. |
AnnaBridge | 145:64910690c574 | 542 | */ |
AnnaBridge | 145:64910690c574 | 543 | status_t FLEXIO_I2S_TransferGetReceiveCount(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, size_t *count); |
AnnaBridge | 145:64910690c574 | 544 | |
AnnaBridge | 145:64910690c574 | 545 | /*! |
AnnaBridge | 145:64910690c574 | 546 | * @brief Tx interrupt handler. |
AnnaBridge | 145:64910690c574 | 547 | * |
AnnaBridge | 145:64910690c574 | 548 | * @param i2sBase Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 549 | * @param i2sHandle Pointer to flexio_i2s_handle_t structure |
AnnaBridge | 145:64910690c574 | 550 | */ |
AnnaBridge | 145:64910690c574 | 551 | void FLEXIO_I2S_TransferTxHandleIRQ(void *i2sBase, void *i2sHandle); |
AnnaBridge | 145:64910690c574 | 552 | |
AnnaBridge | 145:64910690c574 | 553 | /*! |
AnnaBridge | 145:64910690c574 | 554 | * @brief Rx interrupt handler. |
AnnaBridge | 145:64910690c574 | 555 | * |
AnnaBridge | 145:64910690c574 | 556 | * @param i2sBase Pointer to FLEXIO_I2S_Type structure. |
AnnaBridge | 145:64910690c574 | 557 | * @param i2sHandle Pointer to flexio_i2s_handle_t structure. |
AnnaBridge | 145:64910690c574 | 558 | */ |
AnnaBridge | 145:64910690c574 | 559 | void FLEXIO_I2S_TransferRxHandleIRQ(void *i2sBase, void *i2sHandle); |
AnnaBridge | 145:64910690c574 | 560 | |
AnnaBridge | 145:64910690c574 | 561 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 562 | |
AnnaBridge | 145:64910690c574 | 563 | #if defined(__cplusplus) |
AnnaBridge | 145:64910690c574 | 564 | } |
AnnaBridge | 145:64910690c574 | 565 | #endif /*_cplusplus*/ |
AnnaBridge | 145:64910690c574 | 566 | |
AnnaBridge | 145:64910690c574 | 567 | /*! @} */ |
AnnaBridge | 145:64910690c574 | 568 | |
AnnaBridge | 145:64910690c574 | 569 | #endif /* _FSL_FLEXIO_I2S_H_ */ |