![](/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_i2c_master.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 | #ifndef _FSL_FLEXIO_I2C_MASTER_H_ |
kadonotakashi | 0:8fdf9a60065b | 31 | #define _FSL_FLEXIO_I2C_MASTER_H_ |
kadonotakashi | 0:8fdf9a60065b | 32 | |
kadonotakashi | 0:8fdf9a60065b | 33 | #include "fsl_common.h" |
kadonotakashi | 0:8fdf9a60065b | 34 | #include "fsl_flexio.h" |
kadonotakashi | 0:8fdf9a60065b | 35 | |
kadonotakashi | 0:8fdf9a60065b | 36 | /*! |
kadonotakashi | 0:8fdf9a60065b | 37 | * @addtogroup flexio_i2c_master |
kadonotakashi | 0:8fdf9a60065b | 38 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 39 | */ |
kadonotakashi | 0:8fdf9a60065b | 40 | |
kadonotakashi | 0:8fdf9a60065b | 41 | /*! @file */ |
kadonotakashi | 0:8fdf9a60065b | 42 | |
kadonotakashi | 0:8fdf9a60065b | 43 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 44 | * Definitions |
kadonotakashi | 0:8fdf9a60065b | 45 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 46 | |
kadonotakashi | 0:8fdf9a60065b | 47 | /*! @name Driver version */ |
kadonotakashi | 0:8fdf9a60065b | 48 | /*@{*/ |
kadonotakashi | 0:8fdf9a60065b | 49 | /*! @brief FlexIO I2C master driver version 2.1.0. */ |
kadonotakashi | 0:8fdf9a60065b | 50 | #define FSL_FLEXIO_I2C_MASTER_DRIVER_VERSION (MAKE_VERSION(2, 1, 0)) |
kadonotakashi | 0:8fdf9a60065b | 51 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 52 | |
kadonotakashi | 0:8fdf9a60065b | 53 | /*! @brief FlexIO I2C transfer status*/ |
kadonotakashi | 0:8fdf9a60065b | 54 | enum _flexio_i2c_status |
kadonotakashi | 0:8fdf9a60065b | 55 | { |
kadonotakashi | 0:8fdf9a60065b | 56 | kStatus_FLEXIO_I2C_Busy = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 0), /*!< I2C is busy doing transfer. */ |
kadonotakashi | 0:8fdf9a60065b | 57 | kStatus_FLEXIO_I2C_Idle = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 1), /*!< I2C is busy doing transfer. */ |
kadonotakashi | 0:8fdf9a60065b | 58 | kStatus_FLEXIO_I2C_Nak = MAKE_STATUS(kStatusGroup_FLEXIO_I2C, 2), /*!< NAK received during transfer. */ |
kadonotakashi | 0:8fdf9a60065b | 59 | }; |
kadonotakashi | 0:8fdf9a60065b | 60 | |
kadonotakashi | 0:8fdf9a60065b | 61 | /*! @brief Define FlexIO I2C master interrupt mask. */ |
kadonotakashi | 0:8fdf9a60065b | 62 | enum _flexio_i2c_master_interrupt |
kadonotakashi | 0:8fdf9a60065b | 63 | { |
kadonotakashi | 0:8fdf9a60065b | 64 | kFLEXIO_I2C_TxEmptyInterruptEnable = 0x1U, /*!< Tx buffer empty interrupt enable. */ |
kadonotakashi | 0:8fdf9a60065b | 65 | kFLEXIO_I2C_RxFullInterruptEnable = 0x2U, /*!< Rx buffer full interrupt enable. */ |
kadonotakashi | 0:8fdf9a60065b | 66 | }; |
kadonotakashi | 0:8fdf9a60065b | 67 | |
kadonotakashi | 0:8fdf9a60065b | 68 | /*! @brief Define FlexIO I2C master status mask. */ |
kadonotakashi | 0:8fdf9a60065b | 69 | enum _flexio_i2c_master_status_flags |
kadonotakashi | 0:8fdf9a60065b | 70 | { |
kadonotakashi | 0:8fdf9a60065b | 71 | kFLEXIO_I2C_TxEmptyFlag = 0x1U, /*!< Tx shifter empty flag. */ |
kadonotakashi | 0:8fdf9a60065b | 72 | kFLEXIO_I2C_RxFullFlag = 0x2U, /*!< Rx shifter full/Transfer complete flag. */ |
kadonotakashi | 0:8fdf9a60065b | 73 | kFLEXIO_I2C_ReceiveNakFlag = 0x4U, /*!< Receive NAK flag. */ |
kadonotakashi | 0:8fdf9a60065b | 74 | }; |
kadonotakashi | 0:8fdf9a60065b | 75 | |
kadonotakashi | 0:8fdf9a60065b | 76 | /*! @brief Direction of master transfer.*/ |
kadonotakashi | 0:8fdf9a60065b | 77 | typedef enum _flexio_i2c_direction |
kadonotakashi | 0:8fdf9a60065b | 78 | { |
kadonotakashi | 0:8fdf9a60065b | 79 | kFLEXIO_I2C_Write = 0x0U, /*!< Master send to slave. */ |
kadonotakashi | 0:8fdf9a60065b | 80 | kFLEXIO_I2C_Read = 0x1U, /*!< Master receive from slave. */ |
kadonotakashi | 0:8fdf9a60065b | 81 | } flexio_i2c_direction_t; |
kadonotakashi | 0:8fdf9a60065b | 82 | |
kadonotakashi | 0:8fdf9a60065b | 83 | /*! @brief Define FlexIO I2C master access structure typedef. */ |
kadonotakashi | 0:8fdf9a60065b | 84 | typedef struct _flexio_i2c_type |
kadonotakashi | 0:8fdf9a60065b | 85 | { |
kadonotakashi | 0:8fdf9a60065b | 86 | FLEXIO_Type *flexioBase; /*!< FlexIO base pointer. */ |
kadonotakashi | 0:8fdf9a60065b | 87 | uint8_t SDAPinIndex; /*!< Pin select for I2C SDA. */ |
kadonotakashi | 0:8fdf9a60065b | 88 | uint8_t SCLPinIndex; /*!< Pin select for I2C SCL. */ |
kadonotakashi | 0:8fdf9a60065b | 89 | uint8_t shifterIndex[2]; /*!< Shifter index used in FlexIO I2C. */ |
kadonotakashi | 0:8fdf9a60065b | 90 | uint8_t timerIndex[2]; /*!< Timer index used in FlexIO I2C. */ |
kadonotakashi | 0:8fdf9a60065b | 91 | } FLEXIO_I2C_Type; |
kadonotakashi | 0:8fdf9a60065b | 92 | |
kadonotakashi | 0:8fdf9a60065b | 93 | /*! @brief Define FlexIO I2C master user configuration structure. */ |
kadonotakashi | 0:8fdf9a60065b | 94 | typedef struct _flexio_i2c_master_config |
kadonotakashi | 0:8fdf9a60065b | 95 | { |
kadonotakashi | 0:8fdf9a60065b | 96 | bool enableMaster; /*!< Enables the FLEXIO I2C peripheral at initialization time. */ |
kadonotakashi | 0:8fdf9a60065b | 97 | bool enableInDoze; /*!< Enable/disable FlexIO operation in doze mode. */ |
kadonotakashi | 0:8fdf9a60065b | 98 | bool enableInDebug; /*!< Enable/disable FlexIO operation in debug mode. */ |
kadonotakashi | 0:8fdf9a60065b | 99 | bool enableFastAccess; /*!< Enable/disable fast access to FlexIO registers, fast access requires |
kadonotakashi | 0:8fdf9a60065b | 100 | the FlexIO clock to be at least twice the frequency of the bus clock. */ |
kadonotakashi | 0:8fdf9a60065b | 101 | uint32_t baudRate_Bps; /*!< Baud rate in Bps. */ |
kadonotakashi | 0:8fdf9a60065b | 102 | } flexio_i2c_master_config_t; |
kadonotakashi | 0:8fdf9a60065b | 103 | |
kadonotakashi | 0:8fdf9a60065b | 104 | /*! @brief Define FlexIO I2C master transfer structure. */ |
kadonotakashi | 0:8fdf9a60065b | 105 | typedef struct _flexio_i2c_master_transfer |
kadonotakashi | 0:8fdf9a60065b | 106 | { |
kadonotakashi | 0:8fdf9a60065b | 107 | uint32_t flags; /*!< Transfer flag which controls the transfer, reserved for flexio i2c. */ |
kadonotakashi | 0:8fdf9a60065b | 108 | uint8_t slaveAddress; /*!< 7-bit slave address. */ |
kadonotakashi | 0:8fdf9a60065b | 109 | flexio_i2c_direction_t direction; /*!< Transfer direction, read or write. */ |
kadonotakashi | 0:8fdf9a60065b | 110 | uint32_t subaddress; /*!< Sub address. Transferred MSB first. */ |
kadonotakashi | 0:8fdf9a60065b | 111 | uint8_t subaddressSize; /*!< Size of command buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 112 | uint8_t volatile *data; /*!< Transfer buffer. */ |
kadonotakashi | 0:8fdf9a60065b | 113 | volatile size_t dataSize; /*!< Transfer size. */ |
kadonotakashi | 0:8fdf9a60065b | 114 | } flexio_i2c_master_transfer_t; |
kadonotakashi | 0:8fdf9a60065b | 115 | |
kadonotakashi | 0:8fdf9a60065b | 116 | /*! @brief FlexIO I2C master handle typedef. */ |
kadonotakashi | 0:8fdf9a60065b | 117 | typedef struct _flexio_i2c_master_handle flexio_i2c_master_handle_t; |
kadonotakashi | 0:8fdf9a60065b | 118 | |
kadonotakashi | 0:8fdf9a60065b | 119 | /*! @brief FlexIO I2C master transfer callback typedef. */ |
kadonotakashi | 0:8fdf9a60065b | 120 | typedef void (*flexio_i2c_master_transfer_callback_t)(FLEXIO_I2C_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 121 | flexio_i2c_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 122 | status_t status, |
kadonotakashi | 0:8fdf9a60065b | 123 | void *userData); |
kadonotakashi | 0:8fdf9a60065b | 124 | |
kadonotakashi | 0:8fdf9a60065b | 125 | /*! @brief Define FlexIO I2C master handle structure. */ |
kadonotakashi | 0:8fdf9a60065b | 126 | struct _flexio_i2c_master_handle |
kadonotakashi | 0:8fdf9a60065b | 127 | { |
kadonotakashi | 0:8fdf9a60065b | 128 | flexio_i2c_master_transfer_t transfer; /*!< FlexIO I2C master transfer copy. */ |
kadonotakashi | 0:8fdf9a60065b | 129 | size_t transferSize; /*!< Total bytes to be transferred. */ |
kadonotakashi | 0:8fdf9a60065b | 130 | uint8_t state; /*!< Transfer state maintained during transfer. */ |
kadonotakashi | 0:8fdf9a60065b | 131 | flexio_i2c_master_transfer_callback_t completionCallback; /*!< Callback function called at transfer event. */ |
kadonotakashi | 0:8fdf9a60065b | 132 | /*!< Callback function called at transfer event. */ |
kadonotakashi | 0:8fdf9a60065b | 133 | void *userData; /*!< Callback parameter passed to callback function. */ |
kadonotakashi | 0:8fdf9a60065b | 134 | }; |
kadonotakashi | 0:8fdf9a60065b | 135 | |
kadonotakashi | 0:8fdf9a60065b | 136 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 137 | * API |
kadonotakashi | 0:8fdf9a60065b | 138 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 139 | |
kadonotakashi | 0:8fdf9a60065b | 140 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 141 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 142 | #endif /*_cplusplus*/ |
kadonotakashi | 0:8fdf9a60065b | 143 | |
kadonotakashi | 0:8fdf9a60065b | 144 | /*! |
kadonotakashi | 0:8fdf9a60065b | 145 | * @name Initialization and deinitialization |
kadonotakashi | 0:8fdf9a60065b | 146 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 147 | */ |
kadonotakashi | 0:8fdf9a60065b | 148 | |
kadonotakashi | 0:8fdf9a60065b | 149 | /*! |
kadonotakashi | 0:8fdf9a60065b | 150 | * @brief Ungates the FlexIO clock, resets the FlexIO module, and configures the FlexIO I2C |
kadonotakashi | 0:8fdf9a60065b | 151 | * hardware configuration. |
kadonotakashi | 0:8fdf9a60065b | 152 | * |
kadonotakashi | 0:8fdf9a60065b | 153 | * Example |
kadonotakashi | 0:8fdf9a60065b | 154 | @code |
kadonotakashi | 0:8fdf9a60065b | 155 | FLEXIO_I2C_Type base = { |
kadonotakashi | 0:8fdf9a60065b | 156 | .flexioBase = FLEXIO, |
kadonotakashi | 0:8fdf9a60065b | 157 | .SDAPinIndex = 0, |
kadonotakashi | 0:8fdf9a60065b | 158 | .SCLPinIndex = 1, |
kadonotakashi | 0:8fdf9a60065b | 159 | .shifterIndex = {0,1}, |
kadonotakashi | 0:8fdf9a60065b | 160 | .timerIndex = {0,1} |
kadonotakashi | 0:8fdf9a60065b | 161 | }; |
kadonotakashi | 0:8fdf9a60065b | 162 | flexio_i2c_master_config_t config = { |
kadonotakashi | 0:8fdf9a60065b | 163 | .enableInDoze = false, |
kadonotakashi | 0:8fdf9a60065b | 164 | .enableInDebug = true, |
kadonotakashi | 0:8fdf9a60065b | 165 | .enableFastAccess = false, |
kadonotakashi | 0:8fdf9a60065b | 166 | .baudRate_Bps = 100000 |
kadonotakashi | 0:8fdf9a60065b | 167 | }; |
kadonotakashi | 0:8fdf9a60065b | 168 | FLEXIO_I2C_MasterInit(base, &config, srcClock_Hz); |
kadonotakashi | 0:8fdf9a60065b | 169 | @endcode |
kadonotakashi | 0:8fdf9a60065b | 170 | * |
kadonotakashi | 0:8fdf9a60065b | 171 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 172 | * @param masterConfig pointer to flexio_i2c_master_config_t structure. |
kadonotakashi | 0:8fdf9a60065b | 173 | * @param srcClock_Hz FlexIO source clock in Hz. |
kadonotakashi | 0:8fdf9a60065b | 174 | */ |
kadonotakashi | 0:8fdf9a60065b | 175 | void FLEXIO_I2C_MasterInit(FLEXIO_I2C_Type *base, flexio_i2c_master_config_t *masterConfig, uint32_t srcClock_Hz); |
kadonotakashi | 0:8fdf9a60065b | 176 | |
kadonotakashi | 0:8fdf9a60065b | 177 | /*! |
kadonotakashi | 0:8fdf9a60065b | 178 | * @brief De-initializes the FlexIO I2C master peripheral. Calling this API gates the FlexIO clock, |
kadonotakashi | 0:8fdf9a60065b | 179 | * so the FlexIO I2C master module can't work unless call FLEXIO_I2C_MasterInit. |
kadonotakashi | 0:8fdf9a60065b | 180 | * |
kadonotakashi | 0:8fdf9a60065b | 181 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 182 | */ |
kadonotakashi | 0:8fdf9a60065b | 183 | void FLEXIO_I2C_MasterDeinit(FLEXIO_I2C_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 184 | |
kadonotakashi | 0:8fdf9a60065b | 185 | /*! |
kadonotakashi | 0:8fdf9a60065b | 186 | * @brief Gets the default configuration to configure the FlexIO module. The configuration |
kadonotakashi | 0:8fdf9a60065b | 187 | * can be used directly for calling FLEXIO_I2C_MasterInit(). |
kadonotakashi | 0:8fdf9a60065b | 188 | * |
kadonotakashi | 0:8fdf9a60065b | 189 | * Example: |
kadonotakashi | 0:8fdf9a60065b | 190 | @code |
kadonotakashi | 0:8fdf9a60065b | 191 | flexio_i2c_master_config_t config; |
kadonotakashi | 0:8fdf9a60065b | 192 | FLEXIO_I2C_MasterGetDefaultConfig(&config); |
kadonotakashi | 0:8fdf9a60065b | 193 | @endcode |
kadonotakashi | 0:8fdf9a60065b | 194 | * @param masterConfig pointer to flexio_i2c_master_config_t structure. |
kadonotakashi | 0:8fdf9a60065b | 195 | */ |
kadonotakashi | 0:8fdf9a60065b | 196 | void FLEXIO_I2C_MasterGetDefaultConfig(flexio_i2c_master_config_t *masterConfig); |
kadonotakashi | 0:8fdf9a60065b | 197 | |
kadonotakashi | 0:8fdf9a60065b | 198 | /*! |
kadonotakashi | 0:8fdf9a60065b | 199 | * @brief Enables/disables the FlexIO module operation. |
kadonotakashi | 0:8fdf9a60065b | 200 | * |
kadonotakashi | 0:8fdf9a60065b | 201 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 202 | * @param enable pass true to enable module, false to disable module. |
kadonotakashi | 0:8fdf9a60065b | 203 | */ |
kadonotakashi | 0:8fdf9a60065b | 204 | static inline void FLEXIO_I2C_MasterEnable(FLEXIO_I2C_Type *base, bool enable) |
kadonotakashi | 0:8fdf9a60065b | 205 | { |
kadonotakashi | 0:8fdf9a60065b | 206 | if (enable) |
kadonotakashi | 0:8fdf9a60065b | 207 | { |
kadonotakashi | 0:8fdf9a60065b | 208 | base->flexioBase->CTRL |= FLEXIO_CTRL_FLEXEN_MASK; |
kadonotakashi | 0:8fdf9a60065b | 209 | } |
kadonotakashi | 0:8fdf9a60065b | 210 | else |
kadonotakashi | 0:8fdf9a60065b | 211 | { |
kadonotakashi | 0:8fdf9a60065b | 212 | base->flexioBase->CTRL &= ~FLEXIO_CTRL_FLEXEN_MASK; |
kadonotakashi | 0:8fdf9a60065b | 213 | } |
kadonotakashi | 0:8fdf9a60065b | 214 | } |
kadonotakashi | 0:8fdf9a60065b | 215 | |
kadonotakashi | 0:8fdf9a60065b | 216 | /* @} */ |
kadonotakashi | 0:8fdf9a60065b | 217 | |
kadonotakashi | 0:8fdf9a60065b | 218 | /*! |
kadonotakashi | 0:8fdf9a60065b | 219 | * @name Status |
kadonotakashi | 0:8fdf9a60065b | 220 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 221 | */ |
kadonotakashi | 0:8fdf9a60065b | 222 | |
kadonotakashi | 0:8fdf9a60065b | 223 | /*! |
kadonotakashi | 0:8fdf9a60065b | 224 | * @brief Gets the FlexIO I2C master status flags. |
kadonotakashi | 0:8fdf9a60065b | 225 | * |
kadonotakashi | 0:8fdf9a60065b | 226 | * @param base pointer to FLEXIO_I2C_Type structure |
kadonotakashi | 0:8fdf9a60065b | 227 | * @return status flag, use status flag to AND #_flexio_i2c_master_status_flags could get the related status. |
kadonotakashi | 0:8fdf9a60065b | 228 | */ |
kadonotakashi | 0:8fdf9a60065b | 229 | |
kadonotakashi | 0:8fdf9a60065b | 230 | uint32_t FLEXIO_I2C_MasterGetStatusFlags(FLEXIO_I2C_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 231 | |
kadonotakashi | 0:8fdf9a60065b | 232 | /*! |
kadonotakashi | 0:8fdf9a60065b | 233 | * @brief Clears the FlexIO I2C master status flags. |
kadonotakashi | 0:8fdf9a60065b | 234 | * |
kadonotakashi | 0:8fdf9a60065b | 235 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 236 | * @param mask status flag. |
kadonotakashi | 0:8fdf9a60065b | 237 | * The parameter could be any combination of the following values: |
kadonotakashi | 0:8fdf9a60065b | 238 | * @arg kFLEXIO_I2C_RxFullFlag |
kadonotakashi | 0:8fdf9a60065b | 239 | * @arg kFLEXIO_I2C_ReceiveNakFlag |
kadonotakashi | 0:8fdf9a60065b | 240 | */ |
kadonotakashi | 0:8fdf9a60065b | 241 | |
kadonotakashi | 0:8fdf9a60065b | 242 | void FLEXIO_I2C_MasterClearStatusFlags(FLEXIO_I2C_Type *base, uint32_t mask); |
kadonotakashi | 0:8fdf9a60065b | 243 | |
kadonotakashi | 0:8fdf9a60065b | 244 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 245 | |
kadonotakashi | 0:8fdf9a60065b | 246 | /*! |
kadonotakashi | 0:8fdf9a60065b | 247 | * @name Interrupts |
kadonotakashi | 0:8fdf9a60065b | 248 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 249 | */ |
kadonotakashi | 0:8fdf9a60065b | 250 | |
kadonotakashi | 0:8fdf9a60065b | 251 | /*! |
kadonotakashi | 0:8fdf9a60065b | 252 | * @brief Enables the FlexIO i2c master interrupt requests. |
kadonotakashi | 0:8fdf9a60065b | 253 | * |
kadonotakashi | 0:8fdf9a60065b | 254 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 255 | * @param mask interrupt source. |
kadonotakashi | 0:8fdf9a60065b | 256 | * Currently only one interrupt request source: |
kadonotakashi | 0:8fdf9a60065b | 257 | * @arg kFLEXIO_I2C_TransferCompleteInterruptEnable |
kadonotakashi | 0:8fdf9a60065b | 258 | */ |
kadonotakashi | 0:8fdf9a60065b | 259 | void FLEXIO_I2C_MasterEnableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); |
kadonotakashi | 0:8fdf9a60065b | 260 | |
kadonotakashi | 0:8fdf9a60065b | 261 | /*! |
kadonotakashi | 0:8fdf9a60065b | 262 | * @brief Disables the FlexIO I2C master interrupt requests. |
kadonotakashi | 0:8fdf9a60065b | 263 | * |
kadonotakashi | 0:8fdf9a60065b | 264 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 265 | * @param mask interrupt source. |
kadonotakashi | 0:8fdf9a60065b | 266 | */ |
kadonotakashi | 0:8fdf9a60065b | 267 | void FLEXIO_I2C_MasterDisableInterrupts(FLEXIO_I2C_Type *base, uint32_t mask); |
kadonotakashi | 0:8fdf9a60065b | 268 | |
kadonotakashi | 0:8fdf9a60065b | 269 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 270 | |
kadonotakashi | 0:8fdf9a60065b | 271 | /*! |
kadonotakashi | 0:8fdf9a60065b | 272 | * @name Bus Operations |
kadonotakashi | 0:8fdf9a60065b | 273 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 274 | */ |
kadonotakashi | 0:8fdf9a60065b | 275 | |
kadonotakashi | 0:8fdf9a60065b | 276 | /*! |
kadonotakashi | 0:8fdf9a60065b | 277 | * @brief Sets the FlexIO I2C master transfer baudrate. |
kadonotakashi | 0:8fdf9a60065b | 278 | * |
kadonotakashi | 0:8fdf9a60065b | 279 | * @param base pointer to FLEXIO_I2C_Type structure |
kadonotakashi | 0:8fdf9a60065b | 280 | * @param baudRate_Bps the baud rate value in HZ |
kadonotakashi | 0:8fdf9a60065b | 281 | * @param srcClock_Hz source clock in HZ |
kadonotakashi | 0:8fdf9a60065b | 282 | */ |
kadonotakashi | 0:8fdf9a60065b | 283 | void FLEXIO_I2C_MasterSetBaudRate(FLEXIO_I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz); |
kadonotakashi | 0:8fdf9a60065b | 284 | |
kadonotakashi | 0:8fdf9a60065b | 285 | /*! |
kadonotakashi | 0:8fdf9a60065b | 286 | * @brief Sends START + 7-bit address to the bus. |
kadonotakashi | 0:8fdf9a60065b | 287 | * |
kadonotakashi | 0:8fdf9a60065b | 288 | * @note This is API should be called when transfer configuration is ready to send a START signal |
kadonotakashi | 0:8fdf9a60065b | 289 | * and 7-bit address to the bus. This is a non-blocking API, which returns directly after the address |
kadonotakashi | 0:8fdf9a60065b | 290 | * is put into the data register but not address transfer finished on the bus. Ensure that |
kadonotakashi | 0:8fdf9a60065b | 291 | * the kFLEXIO_I2C_RxFullFlag status is asserted before calling this API. |
kadonotakashi | 0:8fdf9a60065b | 292 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 293 | * @param address 7-bit address. |
kadonotakashi | 0:8fdf9a60065b | 294 | * @param direction transfer direction. |
kadonotakashi | 0:8fdf9a60065b | 295 | * This parameter is one of the values in flexio_i2c_direction_t: |
kadonotakashi | 0:8fdf9a60065b | 296 | * @arg kFLEXIO_I2C_Write: Transmit |
kadonotakashi | 0:8fdf9a60065b | 297 | * @arg kFLEXIO_I2C_Read: Receive |
kadonotakashi | 0:8fdf9a60065b | 298 | */ |
kadonotakashi | 0:8fdf9a60065b | 299 | |
kadonotakashi | 0:8fdf9a60065b | 300 | void FLEXIO_I2C_MasterStart(FLEXIO_I2C_Type *base, uint8_t address, flexio_i2c_direction_t direction); |
kadonotakashi | 0:8fdf9a60065b | 301 | |
kadonotakashi | 0:8fdf9a60065b | 302 | /*! |
kadonotakashi | 0:8fdf9a60065b | 303 | * @brief Sends the stop signal on the bus. |
kadonotakashi | 0:8fdf9a60065b | 304 | * |
kadonotakashi | 0:8fdf9a60065b | 305 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 306 | */ |
kadonotakashi | 0:8fdf9a60065b | 307 | void FLEXIO_I2C_MasterStop(FLEXIO_I2C_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 308 | |
kadonotakashi | 0:8fdf9a60065b | 309 | /*! |
kadonotakashi | 0:8fdf9a60065b | 310 | * @brief Sends the repeated start signal on the bus. |
kadonotakashi | 0:8fdf9a60065b | 311 | * |
kadonotakashi | 0:8fdf9a60065b | 312 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 313 | */ |
kadonotakashi | 0:8fdf9a60065b | 314 | void FLEXIO_I2C_MasterRepeatedStart(FLEXIO_I2C_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 315 | |
kadonotakashi | 0:8fdf9a60065b | 316 | /*! |
kadonotakashi | 0:8fdf9a60065b | 317 | * @brief Sends the stop signal when transfer is still on-going. |
kadonotakashi | 0:8fdf9a60065b | 318 | * |
kadonotakashi | 0:8fdf9a60065b | 319 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 320 | */ |
kadonotakashi | 0:8fdf9a60065b | 321 | void FLEXIO_I2C_MasterAbortStop(FLEXIO_I2C_Type *base); |
kadonotakashi | 0:8fdf9a60065b | 322 | |
kadonotakashi | 0:8fdf9a60065b | 323 | /*! |
kadonotakashi | 0:8fdf9a60065b | 324 | * @brief Configures the sent ACK/NAK for the following byte. |
kadonotakashi | 0:8fdf9a60065b | 325 | * |
kadonotakashi | 0:8fdf9a60065b | 326 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 327 | * @param enable true to configure send ACK, false configure to send NAK. |
kadonotakashi | 0:8fdf9a60065b | 328 | */ |
kadonotakashi | 0:8fdf9a60065b | 329 | void FLEXIO_I2C_MasterEnableAck(FLEXIO_I2C_Type *base, bool enable); |
kadonotakashi | 0:8fdf9a60065b | 330 | |
kadonotakashi | 0:8fdf9a60065b | 331 | /*! |
kadonotakashi | 0:8fdf9a60065b | 332 | * @brief Sets the number of bytes to be transferred from a start signal to a stop signal. |
kadonotakashi | 0:8fdf9a60065b | 333 | * |
kadonotakashi | 0:8fdf9a60065b | 334 | * @note Call this API before a transfer begins because the timer generates a number of clocks according |
kadonotakashi | 0:8fdf9a60065b | 335 | * to the number of bytes that need to be transferred. |
kadonotakashi | 0:8fdf9a60065b | 336 | * |
kadonotakashi | 0:8fdf9a60065b | 337 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 338 | * @param count number of bytes need to be transferred from a start signal to a re-start/stop signal |
kadonotakashi | 0:8fdf9a60065b | 339 | * @retval kStatus_Success Successfully configured the count. |
kadonotakashi | 0:8fdf9a60065b | 340 | * @retval kStatus_InvalidArgument Input argument is invalid. |
kadonotakashi | 0:8fdf9a60065b | 341 | */ |
kadonotakashi | 0:8fdf9a60065b | 342 | status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint8_t count); |
kadonotakashi | 0:8fdf9a60065b | 343 | |
kadonotakashi | 0:8fdf9a60065b | 344 | /*! |
kadonotakashi | 0:8fdf9a60065b | 345 | * @brief Writes one byte of data to the I2C bus. |
kadonotakashi | 0:8fdf9a60065b | 346 | * |
kadonotakashi | 0:8fdf9a60065b | 347 | * @note This is a non-blocking API, which returns directly after the data is put into the |
kadonotakashi | 0:8fdf9a60065b | 348 | * data register but not data transfer finished on the bus. Ensure that |
kadonotakashi | 0:8fdf9a60065b | 349 | * the TxEmptyFlag is asserted before calling this API. |
kadonotakashi | 0:8fdf9a60065b | 350 | * |
kadonotakashi | 0:8fdf9a60065b | 351 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 352 | * @param data a byte of data. |
kadonotakashi | 0:8fdf9a60065b | 353 | */ |
kadonotakashi | 0:8fdf9a60065b | 354 | static inline void FLEXIO_I2C_MasterWriteByte(FLEXIO_I2C_Type *base, uint32_t data) |
kadonotakashi | 0:8fdf9a60065b | 355 | { |
kadonotakashi | 0:8fdf9a60065b | 356 | base->flexioBase->SHIFTBUFBBS[base->shifterIndex[0]] = data; |
kadonotakashi | 0:8fdf9a60065b | 357 | } |
kadonotakashi | 0:8fdf9a60065b | 358 | |
kadonotakashi | 0:8fdf9a60065b | 359 | /*! |
kadonotakashi | 0:8fdf9a60065b | 360 | * @brief Reads one byte of data from the I2C bus. |
kadonotakashi | 0:8fdf9a60065b | 361 | * |
kadonotakashi | 0:8fdf9a60065b | 362 | * @note This is a non-blocking API, which returns directly after the data is read from the |
kadonotakashi | 0:8fdf9a60065b | 363 | * data register. Ensure that the data is ready in the register. |
kadonotakashi | 0:8fdf9a60065b | 364 | * |
kadonotakashi | 0:8fdf9a60065b | 365 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 366 | * @return data byte read. |
kadonotakashi | 0:8fdf9a60065b | 367 | */ |
kadonotakashi | 0:8fdf9a60065b | 368 | static inline uint8_t FLEXIO_I2C_MasterReadByte(FLEXIO_I2C_Type *base) |
kadonotakashi | 0:8fdf9a60065b | 369 | { |
kadonotakashi | 0:8fdf9a60065b | 370 | return base->flexioBase->SHIFTBUFBIS[base->shifterIndex[1]]; |
kadonotakashi | 0:8fdf9a60065b | 371 | } |
kadonotakashi | 0:8fdf9a60065b | 372 | |
kadonotakashi | 0:8fdf9a60065b | 373 | /*! |
kadonotakashi | 0:8fdf9a60065b | 374 | * @brief Sends a buffer of data in bytes. |
kadonotakashi | 0:8fdf9a60065b | 375 | * |
kadonotakashi | 0:8fdf9a60065b | 376 | * @note This function blocks via polling until all bytes have been sent. |
kadonotakashi | 0:8fdf9a60065b | 377 | * |
kadonotakashi | 0:8fdf9a60065b | 378 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 379 | * @param txBuff The data bytes to send. |
kadonotakashi | 0:8fdf9a60065b | 380 | * @param txSize The number of data bytes to send. |
kadonotakashi | 0:8fdf9a60065b | 381 | * @retval kStatus_Success Successfully write data. |
kadonotakashi | 0:8fdf9a60065b | 382 | * @retval kStatus_FLEXIO_I2C_Nak Receive NAK during writing data. |
kadonotakashi | 0:8fdf9a60065b | 383 | */ |
kadonotakashi | 0:8fdf9a60065b | 384 | status_t FLEXIO_I2C_MasterWriteBlocking(FLEXIO_I2C_Type *base, const uint8_t *txBuff, uint8_t txSize); |
kadonotakashi | 0:8fdf9a60065b | 385 | |
kadonotakashi | 0:8fdf9a60065b | 386 | /*! |
kadonotakashi | 0:8fdf9a60065b | 387 | * @brief Receives a buffer of bytes. |
kadonotakashi | 0:8fdf9a60065b | 388 | * |
kadonotakashi | 0:8fdf9a60065b | 389 | * @note This function blocks via polling until all bytes have been received. |
kadonotakashi | 0:8fdf9a60065b | 390 | * |
kadonotakashi | 0:8fdf9a60065b | 391 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 392 | * @param rxBuff The buffer to store the received bytes. |
kadonotakashi | 0:8fdf9a60065b | 393 | * @param rxSize The number of data bytes to be received. |
kadonotakashi | 0:8fdf9a60065b | 394 | */ |
kadonotakashi | 0:8fdf9a60065b | 395 | void FLEXIO_I2C_MasterReadBlocking(FLEXIO_I2C_Type *base, uint8_t *rxBuff, uint8_t rxSize); |
kadonotakashi | 0:8fdf9a60065b | 396 | |
kadonotakashi | 0:8fdf9a60065b | 397 | /*! |
kadonotakashi | 0:8fdf9a60065b | 398 | * @brief Performs a master polling transfer on the I2C bus. |
kadonotakashi | 0:8fdf9a60065b | 399 | * |
kadonotakashi | 0:8fdf9a60065b | 400 | * @note The API does not return until the transfer succeeds or fails due |
kadonotakashi | 0:8fdf9a60065b | 401 | * to receiving NAK. |
kadonotakashi | 0:8fdf9a60065b | 402 | * |
kadonotakashi | 0:8fdf9a60065b | 403 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 404 | * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 405 | * @param xfer pointer to flexio_i2c_master_transfer_t structure. |
kadonotakashi | 0:8fdf9a60065b | 406 | * @return status of status_t. |
kadonotakashi | 0:8fdf9a60065b | 407 | */ |
kadonotakashi | 0:8fdf9a60065b | 408 | status_t FLEXIO_I2C_MasterTransferBlocking(FLEXIO_I2C_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 409 | flexio_i2c_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 410 | flexio_i2c_master_transfer_t *xfer); |
kadonotakashi | 0:8fdf9a60065b | 411 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 412 | |
kadonotakashi | 0:8fdf9a60065b | 413 | /*Transactional APIs*/ |
kadonotakashi | 0:8fdf9a60065b | 414 | |
kadonotakashi | 0:8fdf9a60065b | 415 | /*! |
kadonotakashi | 0:8fdf9a60065b | 416 | * @name Transactional |
kadonotakashi | 0:8fdf9a60065b | 417 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 418 | */ |
kadonotakashi | 0:8fdf9a60065b | 419 | |
kadonotakashi | 0:8fdf9a60065b | 420 | /*! |
kadonotakashi | 0:8fdf9a60065b | 421 | * @brief Initializes the I2C handle which is used in transactional functions. |
kadonotakashi | 0:8fdf9a60065b | 422 | * |
kadonotakashi | 0:8fdf9a60065b | 423 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 424 | * @param handle pointer to flexio_i2c_master_handle_t structure to store the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 425 | * @param callback pointer to user callback function. |
kadonotakashi | 0:8fdf9a60065b | 426 | * @param userData user param passed to the callback function. |
kadonotakashi | 0:8fdf9a60065b | 427 | * @retval kStatus_Success Successfully create the handle. |
kadonotakashi | 0:8fdf9a60065b | 428 | * @retval kStatus_OutOfRange The FlexIO type/handle/isr table out of range. |
kadonotakashi | 0:8fdf9a60065b | 429 | */ |
kadonotakashi | 0:8fdf9a60065b | 430 | status_t FLEXIO_I2C_MasterTransferCreateHandle(FLEXIO_I2C_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 431 | flexio_i2c_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 432 | flexio_i2c_master_transfer_callback_t callback, |
kadonotakashi | 0:8fdf9a60065b | 433 | void *userData); |
kadonotakashi | 0:8fdf9a60065b | 434 | |
kadonotakashi | 0:8fdf9a60065b | 435 | /*! |
kadonotakashi | 0:8fdf9a60065b | 436 | * @brief Performs a master interrupt non-blocking transfer on the I2C bus. |
kadonotakashi | 0:8fdf9a60065b | 437 | * |
kadonotakashi | 0:8fdf9a60065b | 438 | * @note The API returns immediately after the transfer initiates. |
kadonotakashi | 0:8fdf9a60065b | 439 | * Call FLEXIO_I2C_MasterGetTransferCount to poll the transfer status to check whether |
kadonotakashi | 0:8fdf9a60065b | 440 | * the transfer is finished. If the return status is not kStatus_FLEXIO_I2C_Busy, the transfer |
kadonotakashi | 0:8fdf9a60065b | 441 | * is finished. |
kadonotakashi | 0:8fdf9a60065b | 442 | * |
kadonotakashi | 0:8fdf9a60065b | 443 | * @param base pointer to FLEXIO_I2C_Type structure |
kadonotakashi | 0:8fdf9a60065b | 444 | * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state |
kadonotakashi | 0:8fdf9a60065b | 445 | * @param xfer pointer to flexio_i2c_master_transfer_t structure |
kadonotakashi | 0:8fdf9a60065b | 446 | * @retval kStatus_Success Successfully start a transfer. |
kadonotakashi | 0:8fdf9a60065b | 447 | * @retval kStatus_FLEXIO_I2C_Busy FLEXIO I2C is not idle, is running another transfer. |
kadonotakashi | 0:8fdf9a60065b | 448 | */ |
kadonotakashi | 0:8fdf9a60065b | 449 | status_t FLEXIO_I2C_MasterTransferNonBlocking(FLEXIO_I2C_Type *base, |
kadonotakashi | 0:8fdf9a60065b | 450 | flexio_i2c_master_handle_t *handle, |
kadonotakashi | 0:8fdf9a60065b | 451 | flexio_i2c_master_transfer_t *xfer); |
kadonotakashi | 0:8fdf9a60065b | 452 | |
kadonotakashi | 0:8fdf9a60065b | 453 | /*! |
kadonotakashi | 0:8fdf9a60065b | 454 | * @brief Gets the master transfer status during a interrupt non-blocking transfer. |
kadonotakashi | 0:8fdf9a60065b | 455 | * |
kadonotakashi | 0:8fdf9a60065b | 456 | * @param base pointer to FLEXIO_I2C_Type structure. |
kadonotakashi | 0:8fdf9a60065b | 457 | * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state. |
kadonotakashi | 0:8fdf9a60065b | 458 | * @param count Number of bytes transferred so far by the non-blocking transaction. |
kadonotakashi | 0:8fdf9a60065b | 459 | * @retval kStatus_InvalidArgument count is Invalid. |
kadonotakashi | 0:8fdf9a60065b | 460 | * @retval kStatus_Success Successfully return the count. |
kadonotakashi | 0:8fdf9a60065b | 461 | */ |
kadonotakashi | 0:8fdf9a60065b | 462 | status_t FLEXIO_I2C_MasterTransferGetCount(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle, size_t *count); |
kadonotakashi | 0:8fdf9a60065b | 463 | |
kadonotakashi | 0:8fdf9a60065b | 464 | /*! |
kadonotakashi | 0:8fdf9a60065b | 465 | * @brief Aborts an interrupt non-blocking transfer early. |
kadonotakashi | 0:8fdf9a60065b | 466 | * |
kadonotakashi | 0:8fdf9a60065b | 467 | * @note This API can be called at any time when an interrupt non-blocking transfer initiates |
kadonotakashi | 0:8fdf9a60065b | 468 | * to abort the transfer early. |
kadonotakashi | 0:8fdf9a60065b | 469 | * |
kadonotakashi | 0:8fdf9a60065b | 470 | * @param base pointer to FLEXIO_I2C_Type structure |
kadonotakashi | 0:8fdf9a60065b | 471 | * @param handle pointer to flexio_i2c_master_handle_t structure which stores the transfer state |
kadonotakashi | 0:8fdf9a60065b | 472 | */ |
kadonotakashi | 0:8fdf9a60065b | 473 | void FLEXIO_I2C_MasterTransferAbort(FLEXIO_I2C_Type *base, flexio_i2c_master_handle_t *handle); |
kadonotakashi | 0:8fdf9a60065b | 474 | |
kadonotakashi | 0:8fdf9a60065b | 475 | /*! |
kadonotakashi | 0:8fdf9a60065b | 476 | * @brief Master interrupt handler. |
kadonotakashi | 0:8fdf9a60065b | 477 | * |
kadonotakashi | 0:8fdf9a60065b | 478 | * @param i2cType pointer to FLEXIO_I2C_Type structure |
kadonotakashi | 0:8fdf9a60065b | 479 | * @param i2cHandle pointer to flexio_i2c_master_transfer_t structure |
kadonotakashi | 0:8fdf9a60065b | 480 | */ |
kadonotakashi | 0:8fdf9a60065b | 481 | void FLEXIO_I2C_MasterTransferHandleIRQ(void *i2cType, void *i2cHandle); |
kadonotakashi | 0:8fdf9a60065b | 482 | |
kadonotakashi | 0:8fdf9a60065b | 483 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 484 | |
kadonotakashi | 0:8fdf9a60065b | 485 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 486 | } |
kadonotakashi | 0:8fdf9a60065b | 487 | #endif /*_cplusplus*/ |
kadonotakashi | 0:8fdf9a60065b | 488 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 489 | |
kadonotakashi | 0:8fdf9a60065b | 490 | #endif /*_FSL_FLEXIO_I2C_MASTER_H_*/ |