Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Jun 09 14:29:26 2015 +0100
Revision:
101:7cff1c4259d7
Child:
106:ba1f97679dad
Release 101 of the mbed library

Changes:
- new platform: APPNEARME_MICRONFCBOARD, MTS_DRAGONFLY_F411RE, MAX32600MBED, WIZwiki_W7500
- Silabs memory optimization in gpio, pwm fixes
- SPI - ssel documentation fixes and its use

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 101:7cff1c4259d7 1 /**
Kojto 101:7cff1c4259d7 2 ******************************************************************************
Kojto 101:7cff1c4259d7 3 * @file stm32f4xx_hal_fmpi2c.h
Kojto 101:7cff1c4259d7 4 * @author MCD Application Team
Kojto 101:7cff1c4259d7 5 * @version V1.3.0
Kojto 101:7cff1c4259d7 6 * @date 09-March-2015
Kojto 101:7cff1c4259d7 7 * @brief Header file of FMPI2C HAL module.
Kojto 101:7cff1c4259d7 8 ******************************************************************************
Kojto 101:7cff1c4259d7 9 * @attention
Kojto 101:7cff1c4259d7 10 *
Kojto 101:7cff1c4259d7 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 101:7cff1c4259d7 12 *
Kojto 101:7cff1c4259d7 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 101:7cff1c4259d7 14 * are permitted provided that the following conditions are met:
Kojto 101:7cff1c4259d7 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 101:7cff1c4259d7 16 * this list of conditions and the following disclaimer.
Kojto 101:7cff1c4259d7 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 101:7cff1c4259d7 18 * this list of conditions and the following disclaimer in the documentation
Kojto 101:7cff1c4259d7 19 * and/or other materials provided with the distribution.
Kojto 101:7cff1c4259d7 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 101:7cff1c4259d7 21 * may be used to endorse or promote products derived from this software
Kojto 101:7cff1c4259d7 22 * without specific prior written permission.
Kojto 101:7cff1c4259d7 23 *
Kojto 101:7cff1c4259d7 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 101:7cff1c4259d7 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 101:7cff1c4259d7 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 101:7cff1c4259d7 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 101:7cff1c4259d7 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 101:7cff1c4259d7 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 101:7cff1c4259d7 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 101:7cff1c4259d7 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 101:7cff1c4259d7 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 101:7cff1c4259d7 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 101:7cff1c4259d7 34 *
Kojto 101:7cff1c4259d7 35 ******************************************************************************
Kojto 101:7cff1c4259d7 36 */
Kojto 101:7cff1c4259d7 37
Kojto 101:7cff1c4259d7 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 101:7cff1c4259d7 39 #ifndef __STM32F4xx_HAL_FMPI2C_H
Kojto 101:7cff1c4259d7 40 #define __STM32F4xx_HAL_FMPI2C_H
Kojto 101:7cff1c4259d7 41
Kojto 101:7cff1c4259d7 42 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 43 extern "C" {
Kojto 101:7cff1c4259d7 44 #endif
Kojto 101:7cff1c4259d7 45
Kojto 101:7cff1c4259d7 46 #if defined(STM32F446xx)
Kojto 101:7cff1c4259d7 47
Kojto 101:7cff1c4259d7 48 /* Includes ------------------------------------------------------------------*/
Kojto 101:7cff1c4259d7 49 #include "stm32f4xx_hal_def.h"
Kojto 101:7cff1c4259d7 50
Kojto 101:7cff1c4259d7 51 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 101:7cff1c4259d7 52 * @{
Kojto 101:7cff1c4259d7 53 */
Kojto 101:7cff1c4259d7 54
Kojto 101:7cff1c4259d7 55 /** @addtogroup FMPI2C
Kojto 101:7cff1c4259d7 56 * @{
Kojto 101:7cff1c4259d7 57 */
Kojto 101:7cff1c4259d7 58
Kojto 101:7cff1c4259d7 59 /* Exported types ------------------------------------------------------------*/
Kojto 101:7cff1c4259d7 60 /** @defgroup FMPI2C_Exported_Types FMPI2C Exported Types
Kojto 101:7cff1c4259d7 61 * @{
Kojto 101:7cff1c4259d7 62 */
Kojto 101:7cff1c4259d7 63
Kojto 101:7cff1c4259d7 64 /**
Kojto 101:7cff1c4259d7 65 * @brief FMPI2C Configuration Structure definition
Kojto 101:7cff1c4259d7 66 */
Kojto 101:7cff1c4259d7 67 typedef struct
Kojto 101:7cff1c4259d7 68 {
Kojto 101:7cff1c4259d7 69 uint32_t Timing; /*!< Specifies the FMPI2C_TIMINGR_register value.
Kojto 101:7cff1c4259d7 70 This parameter calculated by referring to FMPI2C initialization
Kojto 101:7cff1c4259d7 71 section in Reference manual */
Kojto 101:7cff1c4259d7 72
Kojto 101:7cff1c4259d7 73 uint32_t OwnAddress1; /*!< Specifies the first device own address.
Kojto 101:7cff1c4259d7 74 This parameter can be a 7-bit or 10-bit address. */
Kojto 101:7cff1c4259d7 75
Kojto 101:7cff1c4259d7 76 uint32_t AddressingMode; /*!< Specifies if 7-bit or 10-bit addressing mode is selected.
Kojto 101:7cff1c4259d7 77 This parameter can be a value of @ref FMPI2C_addressing_mode */
Kojto 101:7cff1c4259d7 78
Kojto 101:7cff1c4259d7 79 uint32_t DualAddressMode; /*!< Specifies if dual addressing mode is selected.
Kojto 101:7cff1c4259d7 80 This parameter can be a value of @ref FMPI2C_dual_addressing_mode */
Kojto 101:7cff1c4259d7 81
Kojto 101:7cff1c4259d7 82 uint32_t OwnAddress2; /*!< Specifies the second device own address if dual addressing mode is selected
Kojto 101:7cff1c4259d7 83 This parameter can be a 7-bit address. */
Kojto 101:7cff1c4259d7 84
Kojto 101:7cff1c4259d7 85 uint32_t OwnAddress2Masks; /*!< Specifies the acknoledge mask address second device own address if dual addressing mode is selected
Kojto 101:7cff1c4259d7 86 This parameter can be a value of @ref FMPI2C_own_address2_masks */
Kojto 101:7cff1c4259d7 87
Kojto 101:7cff1c4259d7 88 uint32_t GeneralCallMode; /*!< Specifies if general call mode is selected.
Kojto 101:7cff1c4259d7 89 This parameter can be a value of @ref FMPI2C_general_call_addressing_mode */
Kojto 101:7cff1c4259d7 90
Kojto 101:7cff1c4259d7 91 uint32_t NoStretchMode; /*!< Specifies if nostretch mode is selected.
Kojto 101:7cff1c4259d7 92 This parameter can be a value of @ref FMPI2C_nostretch_mode */
Kojto 101:7cff1c4259d7 93
Kojto 101:7cff1c4259d7 94 }FMPI2C_InitTypeDef;
Kojto 101:7cff1c4259d7 95
Kojto 101:7cff1c4259d7 96 /**
Kojto 101:7cff1c4259d7 97 * @brief HAL State structures definition
Kojto 101:7cff1c4259d7 98 */
Kojto 101:7cff1c4259d7 99 typedef enum
Kojto 101:7cff1c4259d7 100 {
Kojto 101:7cff1c4259d7 101 HAL_FMPI2C_STATE_RESET = 0x00, /*!< FMPI2C not yet initialized or disabled */
Kojto 101:7cff1c4259d7 102 HAL_FMPI2C_STATE_READY = 0x01, /*!< FMPI2C initialized and ready for use */
Kojto 101:7cff1c4259d7 103 HAL_FMPI2C_STATE_BUSY = 0x02, /*!< FMPI2C internal process is ongoing */
Kojto 101:7cff1c4259d7 104 HAL_FMPI2C_STATE_MASTER_BUSY_TX = 0x12, /*!< Master Data Transmission process is ongoing */
Kojto 101:7cff1c4259d7 105 HAL_FMPI2C_STATE_MASTER_BUSY_RX = 0x22, /*!< Master Data Reception process is ongoing */
Kojto 101:7cff1c4259d7 106 HAL_FMPI2C_STATE_SLAVE_BUSY_TX = 0x32, /*!< Slave Data Transmission process is ongoing */
Kojto 101:7cff1c4259d7 107 HAL_FMPI2C_STATE_SLAVE_BUSY_RX = 0x42, /*!< Slave Data Reception process is ongoing */
Kojto 101:7cff1c4259d7 108 HAL_FMPI2C_STATE_MEM_BUSY_TX = 0x52, /*!< Memory Data Transmission process is ongoing */
Kojto 101:7cff1c4259d7 109 HAL_FMPI2C_STATE_MEM_BUSY_RX = 0x62, /*!< Memory Data Reception process is ongoing */
Kojto 101:7cff1c4259d7 110 HAL_FMPI2C_STATE_TIMEOUT = 0x03, /*!< Timeout state */
Kojto 101:7cff1c4259d7 111 HAL_FMPI2C_STATE_ERROR = 0x04 /*!< Reception process is ongoing */
Kojto 101:7cff1c4259d7 112 }HAL_FMPI2C_StateTypeDef;
Kojto 101:7cff1c4259d7 113
Kojto 101:7cff1c4259d7 114 /**
Kojto 101:7cff1c4259d7 115 * @brief HAL FMPI2C Error Code structure definition
Kojto 101:7cff1c4259d7 116 */
Kojto 101:7cff1c4259d7 117 typedef enum
Kojto 101:7cff1c4259d7 118 {
Kojto 101:7cff1c4259d7 119 HAL_FMPI2C_ERROR_NONE = 0x00, /*!< No error */
Kojto 101:7cff1c4259d7 120 HAL_FMPI2C_ERROR_BERR = 0x01, /*!< BERR error */
Kojto 101:7cff1c4259d7 121 HAL_FMPI2C_ERROR_ARLO = 0x02, /*!< ARLO error */
Kojto 101:7cff1c4259d7 122 HAL_FMPI2C_ERROR_AF = 0x04, /*!< ACKF error */
Kojto 101:7cff1c4259d7 123 HAL_FMPI2C_ERROR_OVR = 0x08, /*!< OVR error */
Kojto 101:7cff1c4259d7 124 HAL_FMPI2C_ERROR_DMA = 0x10, /*!< DMA transfer error */
Kojto 101:7cff1c4259d7 125 HAL_FMPI2C_ERROR_TIMEOUT = 0x20, /*!< Timeout error */
Kojto 101:7cff1c4259d7 126 HAL_FMPI2C_ERROR_SIZE = 0x40 /*!< Size Management error */
Kojto 101:7cff1c4259d7 127 }HAL_FMPI2C_ErrorTypeDef;
Kojto 101:7cff1c4259d7 128
Kojto 101:7cff1c4259d7 129 /**
Kojto 101:7cff1c4259d7 130 * @brief FMPI2C handle Structure definition
Kojto 101:7cff1c4259d7 131 */
Kojto 101:7cff1c4259d7 132 typedef struct
Kojto 101:7cff1c4259d7 133 {
Kojto 101:7cff1c4259d7 134 FMPI2C_TypeDef *Instance; /*!< FMPI2C registers base address */
Kojto 101:7cff1c4259d7 135
Kojto 101:7cff1c4259d7 136 FMPI2C_InitTypeDef Init; /*!< FMPI2C communication parameters */
Kojto 101:7cff1c4259d7 137
Kojto 101:7cff1c4259d7 138 uint8_t *pBuffPtr; /*!< Pointer to FMPI2C transfer buffer */
Kojto 101:7cff1c4259d7 139
Kojto 101:7cff1c4259d7 140 uint16_t XferSize; /*!< FMPI2C transfer size */
Kojto 101:7cff1c4259d7 141
Kojto 101:7cff1c4259d7 142 __IO uint16_t XferCount; /*!< FMPI2C transfer counter */
Kojto 101:7cff1c4259d7 143
Kojto 101:7cff1c4259d7 144 DMA_HandleTypeDef *hdmatx; /*!< FMPI2C Tx DMA handle parameters */
Kojto 101:7cff1c4259d7 145
Kojto 101:7cff1c4259d7 146 DMA_HandleTypeDef *hdmarx; /*!< FMPI2C Rx DMA handle parameters */
Kojto 101:7cff1c4259d7 147
Kojto 101:7cff1c4259d7 148 HAL_LockTypeDef Lock; /*!< FMPI2C locking object */
Kojto 101:7cff1c4259d7 149
Kojto 101:7cff1c4259d7 150 __IO HAL_FMPI2C_StateTypeDef State; /*!< FMPI2C communication state */
Kojto 101:7cff1c4259d7 151
Kojto 101:7cff1c4259d7 152 __IO HAL_FMPI2C_ErrorTypeDef ErrorCode; /* FMPI2C Error code */
Kojto 101:7cff1c4259d7 153
Kojto 101:7cff1c4259d7 154 }FMPI2C_HandleTypeDef;
Kojto 101:7cff1c4259d7 155 /**
Kojto 101:7cff1c4259d7 156 * @}
Kojto 101:7cff1c4259d7 157 */
Kojto 101:7cff1c4259d7 158
Kojto 101:7cff1c4259d7 159 /* Exported constants --------------------------------------------------------*/
Kojto 101:7cff1c4259d7 160
Kojto 101:7cff1c4259d7 161 /** @defgroup FMPI2C_Exported_Constants FMPI2C Exported Constants
Kojto 101:7cff1c4259d7 162 * @{
Kojto 101:7cff1c4259d7 163 */
Kojto 101:7cff1c4259d7 164
Kojto 101:7cff1c4259d7 165 /** @defgroup FMPI2C_addressing_mode FMPI2C addressing mode
Kojto 101:7cff1c4259d7 166 * @{
Kojto 101:7cff1c4259d7 167 */
Kojto 101:7cff1c4259d7 168 #define FMPI2C_ADDRESSINGMODE_7BIT ((uint32_t)0x00000001)
Kojto 101:7cff1c4259d7 169 #define FMPI2C_ADDRESSINGMODE_10BIT ((uint32_t)0x00000002)
Kojto 101:7cff1c4259d7 170
Kojto 101:7cff1c4259d7 171 /**
Kojto 101:7cff1c4259d7 172 * @}
Kojto 101:7cff1c4259d7 173 */
Kojto 101:7cff1c4259d7 174
Kojto 101:7cff1c4259d7 175 /** @defgroup FMPI2C_dual_addressing_mode FMPI2C dual addressing mode
Kojto 101:7cff1c4259d7 176 * @{
Kojto 101:7cff1c4259d7 177 */
Kojto 101:7cff1c4259d7 178
Kojto 101:7cff1c4259d7 179 #define FMPI2C_DUALADDRESS_DISABLE ((uint32_t)0x00000000)
Kojto 101:7cff1c4259d7 180 #define FMPI2C_DUALADDRESS_ENABLE FMPI2C_OAR2_OA2EN
Kojto 101:7cff1c4259d7 181
Kojto 101:7cff1c4259d7 182 /**
Kojto 101:7cff1c4259d7 183 * @}
Kojto 101:7cff1c4259d7 184 */
Kojto 101:7cff1c4259d7 185
Kojto 101:7cff1c4259d7 186 /** @defgroup FMPI2C_own_address2_masks FMPI2C own address2 masks
Kojto 101:7cff1c4259d7 187 * @{
Kojto 101:7cff1c4259d7 188 */
Kojto 101:7cff1c4259d7 189
Kojto 101:7cff1c4259d7 190 #define FMPI2C_OA2_NOMASK ((uint8_t)0x00)
Kojto 101:7cff1c4259d7 191 #define FMPI2C_OA2_MASK01 ((uint8_t)0x01)
Kojto 101:7cff1c4259d7 192 #define FMPI2C_OA2_MASK02 ((uint8_t)0x02)
Kojto 101:7cff1c4259d7 193 #define FMPI2C_OA2_MASK03 ((uint8_t)0x03)
Kojto 101:7cff1c4259d7 194 #define FMPI2C_OA2_MASK04 ((uint8_t)0x04)
Kojto 101:7cff1c4259d7 195 #define FMPI2C_OA2_MASK05 ((uint8_t)0x05)
Kojto 101:7cff1c4259d7 196 #define FMPI2C_OA2_MASK06 ((uint8_t)0x06)
Kojto 101:7cff1c4259d7 197 #define FMPI2C_OA2_MASK07 ((uint8_t)0x07)
Kojto 101:7cff1c4259d7 198
Kojto 101:7cff1c4259d7 199 /**
Kojto 101:7cff1c4259d7 200 * @}
Kojto 101:7cff1c4259d7 201 */
Kojto 101:7cff1c4259d7 202
Kojto 101:7cff1c4259d7 203 /** @defgroup FMPI2C_general_call_addressing_mode FMPI2C general call addressing mode
Kojto 101:7cff1c4259d7 204 * @{
Kojto 101:7cff1c4259d7 205 */
Kojto 101:7cff1c4259d7 206 #define FMPI2C_GENERALCALL_DISABLE ((uint32_t)0x00000000)
Kojto 101:7cff1c4259d7 207 #define FMPI2C_GENERALCALL_ENABLE FMPI2C_CR1_GCEN
Kojto 101:7cff1c4259d7 208
Kojto 101:7cff1c4259d7 209 /**
Kojto 101:7cff1c4259d7 210 * @}
Kojto 101:7cff1c4259d7 211 */
Kojto 101:7cff1c4259d7 212
Kojto 101:7cff1c4259d7 213 /** @defgroup FMPI2C_nostretch_mode FMPI2C nostretch mode
Kojto 101:7cff1c4259d7 214 * @{
Kojto 101:7cff1c4259d7 215 */
Kojto 101:7cff1c4259d7 216 #define FMPI2C_NOSTRETCH_DISABLE ((uint32_t)0x00000000)
Kojto 101:7cff1c4259d7 217 #define FMPI2C_NOSTRETCH_ENABLE FMPI2C_CR1_NOSTRETCH
Kojto 101:7cff1c4259d7 218
Kojto 101:7cff1c4259d7 219 /**
Kojto 101:7cff1c4259d7 220 * @}
Kojto 101:7cff1c4259d7 221 */
Kojto 101:7cff1c4259d7 222
Kojto 101:7cff1c4259d7 223 /** @defgroup FMPI2C_Memory_Address_Size FMPI2C Memory Address Size
Kojto 101:7cff1c4259d7 224 * @{
Kojto 101:7cff1c4259d7 225 */
Kojto 101:7cff1c4259d7 226 #define FMPI2C_MEMADD_SIZE_8BIT ((uint32_t)0x00000001)
Kojto 101:7cff1c4259d7 227 #define FMPI2C_MEMADD_SIZE_16BIT ((uint32_t)0x00000002)
Kojto 101:7cff1c4259d7 228
Kojto 101:7cff1c4259d7 229 /**
Kojto 101:7cff1c4259d7 230 * @}
Kojto 101:7cff1c4259d7 231 */
Kojto 101:7cff1c4259d7 232
Kojto 101:7cff1c4259d7 233 /** @defgroup FMPI2C_ReloadEndMode_definition FMPI2C ReloadEndMode definition
Kojto 101:7cff1c4259d7 234 * @{
Kojto 101:7cff1c4259d7 235 */
Kojto 101:7cff1c4259d7 236
Kojto 101:7cff1c4259d7 237 #define FMPI2C_RELOAD_MODE FMPI2C_CR2_RELOAD
Kojto 101:7cff1c4259d7 238 #define FMPI2C_AUTOEND_MODE FMPI2C_CR2_AUTOEND
Kojto 101:7cff1c4259d7 239 #define FMPI2C_SOFTEND_MODE ((uint32_t)0x00000000)
Kojto 101:7cff1c4259d7 240
Kojto 101:7cff1c4259d7 241 /**
Kojto 101:7cff1c4259d7 242 * @}
Kojto 101:7cff1c4259d7 243 */
Kojto 101:7cff1c4259d7 244
Kojto 101:7cff1c4259d7 245 /** @defgroup FMPI2C_StartStopMode_definition FMPI2C StartStopMode definition
Kojto 101:7cff1c4259d7 246 * @{
Kojto 101:7cff1c4259d7 247 */
Kojto 101:7cff1c4259d7 248
Kojto 101:7cff1c4259d7 249 #define FMPI2C_NO_STARTSTOP ((uint32_t)0x00000000)
Kojto 101:7cff1c4259d7 250 #define FMPI2C_GENERATE_STOP FMPI2C_CR2_STOP
Kojto 101:7cff1c4259d7 251 #define FMPI2C_GENERATE_START_READ (uint32_t)(FMPI2C_CR2_START | FMPI2C_CR2_RD_WRN)
Kojto 101:7cff1c4259d7 252 #define FMPI2C_GENERATE_START_WRITE FMPI2C_CR2_START
Kojto 101:7cff1c4259d7 253
Kojto 101:7cff1c4259d7 254 /**
Kojto 101:7cff1c4259d7 255 * @}
Kojto 101:7cff1c4259d7 256 */
Kojto 101:7cff1c4259d7 257
Kojto 101:7cff1c4259d7 258 /** @defgroup FMPI2C_Interrupt_configuration_definition FMPI2C Interrupt configuration definition
Kojto 101:7cff1c4259d7 259 * @brief FMPI2C Interrupt definition
Kojto 101:7cff1c4259d7 260 * Elements values convention: 0xXXXXXXXX
Kojto 101:7cff1c4259d7 261 * - XXXXXXXX : Interrupt control mask
Kojto 101:7cff1c4259d7 262 * @{
Kojto 101:7cff1c4259d7 263 */
Kojto 101:7cff1c4259d7 264 #define FMPI2C_IT_ERRI FMPI2C_CR1_ERRIE
Kojto 101:7cff1c4259d7 265 #define FMPI2C_IT_TCI FMPI2C_CR1_TCIE
Kojto 101:7cff1c4259d7 266 #define FMPI2C_IT_STOPI FMPI2C_CR1_STOPIE
Kojto 101:7cff1c4259d7 267 #define FMPI2C_IT_NACKI FMPI2C_CR1_NACKIE
Kojto 101:7cff1c4259d7 268 #define FMPI2C_IT_ADDRI FMPI2C_CR1_ADDRIE
Kojto 101:7cff1c4259d7 269 #define FMPI2C_IT_RXI FMPI2C_CR1_RXIE
Kojto 101:7cff1c4259d7 270 #define FMPI2C_IT_TXI FMPI2C_CR1_TXIE
Kojto 101:7cff1c4259d7 271
Kojto 101:7cff1c4259d7 272 /**
Kojto 101:7cff1c4259d7 273 * @}
Kojto 101:7cff1c4259d7 274 */
Kojto 101:7cff1c4259d7 275
Kojto 101:7cff1c4259d7 276
Kojto 101:7cff1c4259d7 277 /** @defgroup FMPI2C_Flag_definition FMPI2C Flag definition
Kojto 101:7cff1c4259d7 278 * @{
Kojto 101:7cff1c4259d7 279 */
Kojto 101:7cff1c4259d7 280
Kojto 101:7cff1c4259d7 281 #define FMPI2C_FLAG_TXE FMPI2C_ISR_TXE
Kojto 101:7cff1c4259d7 282 #define FMPI2C_FLAG_TXIS FMPI2C_ISR_TXIS
Kojto 101:7cff1c4259d7 283 #define FMPI2C_FLAG_RXNE FMPI2C_ISR_RXNE
Kojto 101:7cff1c4259d7 284 #define FMPI2C_FLAG_ADDR FMPI2C_ISR_ADDR
Kojto 101:7cff1c4259d7 285 #define FMPI2C_FLAG_AF FMPI2C_ISR_NACKF
Kojto 101:7cff1c4259d7 286 #define FMPI2C_FLAG_STOPF FMPI2C_ISR_STOPF
Kojto 101:7cff1c4259d7 287 #define FMPI2C_FLAG_TC FMPI2C_ISR_TC
Kojto 101:7cff1c4259d7 288 #define FMPI2C_FLAG_TCR FMPI2C_ISR_TCR
Kojto 101:7cff1c4259d7 289 #define FMPI2C_FLAG_BERR FMPI2C_ISR_BERR
Kojto 101:7cff1c4259d7 290 #define FMPI2C_FLAG_ARLO FMPI2C_ISR_ARLO
Kojto 101:7cff1c4259d7 291 #define FMPI2C_FLAG_OVR FMPI2C_ISR_OVR
Kojto 101:7cff1c4259d7 292 #define FMPI2C_FLAG_PECERR FMPI2C_ISR_PECERR
Kojto 101:7cff1c4259d7 293 #define FMPI2C_FLAG_TIMEOUT FMPI2C_ISR_TIMEOUT
Kojto 101:7cff1c4259d7 294 #define FMPI2C_FLAG_ALERT FMPI2C_ISR_ALERT
Kojto 101:7cff1c4259d7 295 #define FMPI2C_FLAG_BUSY FMPI2C_ISR_BUSY
Kojto 101:7cff1c4259d7 296 #define FMPI2C_FLAG_DIR FMPI2C_ISR_DIR
Kojto 101:7cff1c4259d7 297
Kojto 101:7cff1c4259d7 298 /**
Kojto 101:7cff1c4259d7 299 * @}
Kojto 101:7cff1c4259d7 300 */
Kojto 101:7cff1c4259d7 301
Kojto 101:7cff1c4259d7 302 /**
Kojto 101:7cff1c4259d7 303 * @}
Kojto 101:7cff1c4259d7 304 */
Kojto 101:7cff1c4259d7 305
Kojto 101:7cff1c4259d7 306 /* Exported macro ------------------------------------------------------------*/
Kojto 101:7cff1c4259d7 307 /** @defgroup FMPI2C_Exported_Macros FMPI2C Exported Macros
Kojto 101:7cff1c4259d7 308 * @{
Kojto 101:7cff1c4259d7 309 */
Kojto 101:7cff1c4259d7 310
Kojto 101:7cff1c4259d7 311 /** @brief Reset FMPI2C handle state
Kojto 101:7cff1c4259d7 312 * @param __HANDLE__: specifies the FMPI2C Handle.
Kojto 101:7cff1c4259d7 313 * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral.
Kojto 101:7cff1c4259d7 314 * @retval None
Kojto 101:7cff1c4259d7 315 */
Kojto 101:7cff1c4259d7 316 #define __HAL_FMPI2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_FMPI2C_STATE_RESET)
Kojto 101:7cff1c4259d7 317
Kojto 101:7cff1c4259d7 318 /** @brief Enables or disables the specified FMPI2C interrupts.
Kojto 101:7cff1c4259d7 319 * @param __HANDLE__: specifies the FMPI2C Handle.
Kojto 101:7cff1c4259d7 320 * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral.
Kojto 101:7cff1c4259d7 321 * @param __INTERRUPT__: specifies the interrupt source to enable or disable.
Kojto 101:7cff1c4259d7 322 * This parameter can be one of the following values:
Kojto 101:7cff1c4259d7 323 * @arg FMPI2C_IT_ERRI: Errors interrupt enable
Kojto 101:7cff1c4259d7 324 * @arg FMPI2C_IT_TCI: Transfer complete interrupt enable
Kojto 101:7cff1c4259d7 325 * @arg FMPI2C_IT_STOPI: STOP detection interrupt enable
Kojto 101:7cff1c4259d7 326 * @arg FMPI2C_IT_NACKI: NACK received interrupt enable
Kojto 101:7cff1c4259d7 327 * @arg FMPI2C_IT_ADDRI: Address match interrupt enable
Kojto 101:7cff1c4259d7 328 * @arg FMPI2C_IT_RXI: RX interrupt enable
Kojto 101:7cff1c4259d7 329 * @arg FMPI2C_IT_TXI: TX interrupt enable
Kojto 101:7cff1c4259d7 330 *
Kojto 101:7cff1c4259d7 331 * @retval None
Kojto 101:7cff1c4259d7 332 */
Kojto 101:7cff1c4259d7 333
Kojto 101:7cff1c4259d7 334 #define __HAL_FMPI2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__))
Kojto 101:7cff1c4259d7 335 #define __HAL_FMPI2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__)))
Kojto 101:7cff1c4259d7 336
Kojto 101:7cff1c4259d7 337 /** @brief Checks if the specified FMPI2C interrupt source is enabled or disabled.
Kojto 101:7cff1c4259d7 338 * @param __HANDLE__: specifies the FMPI2C Handle.
Kojto 101:7cff1c4259d7 339 * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral.
Kojto 101:7cff1c4259d7 340 * @param __INTERRUPT__: specifies the FMPI2C interrupt source to check.
Kojto 101:7cff1c4259d7 341 * This parameter can be one of the following values:
Kojto 101:7cff1c4259d7 342 * @arg FMPI2C_IT_ERRI: Errors interrupt enable
Kojto 101:7cff1c4259d7 343 * @arg FMPI2C_IT_TCI: Transfer complete interrupt enable
Kojto 101:7cff1c4259d7 344 * @arg FMPI2C_IT_STOPI: STOP detection interrupt enable
Kojto 101:7cff1c4259d7 345 * @arg FMPI2C_IT_NACKI: NACK received interrupt enable
Kojto 101:7cff1c4259d7 346 * @arg FMPI2C_IT_ADDRI: Address match interrupt enable
Kojto 101:7cff1c4259d7 347 * @arg FMPI2C_IT_RXI: RX interrupt enable
Kojto 101:7cff1c4259d7 348 * @arg FMPI2C_IT_TXI: TX interrupt enable
Kojto 101:7cff1c4259d7 349 *
Kojto 101:7cff1c4259d7 350 * @retval The new state of __IT__ (TRUE or FALSE).
Kojto 101:7cff1c4259d7 351 */
Kojto 101:7cff1c4259d7 352 #define __HAL_FMPI2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
Kojto 101:7cff1c4259d7 353
Kojto 101:7cff1c4259d7 354 /** @brief Checks whether the specified FMPI2C flag is set or not.
Kojto 101:7cff1c4259d7 355 * @param __HANDLE__: specifies the FMPI2C Handle.
Kojto 101:7cff1c4259d7 356 * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral.
Kojto 101:7cff1c4259d7 357 * @param __FLAG__: specifies the flag to check.
Kojto 101:7cff1c4259d7 358 * This parameter can be one of the following values:
Kojto 101:7cff1c4259d7 359 * @arg FMPI2C_FLAG_TXE: Transmit data register empty
Kojto 101:7cff1c4259d7 360 * @arg FMPI2C_FLAG_TXIS: Transmit interrupt status
Kojto 101:7cff1c4259d7 361 * @arg FMPI2C_FLAG_RXNE: Receive data register not empty
Kojto 101:7cff1c4259d7 362 * @arg FMPI2C_FLAG_ADDR: Address matched (slave mode)
Kojto 101:7cff1c4259d7 363 * @arg FMPI2C_FLAG_AF: Acknowledge failure received flag
Kojto 101:7cff1c4259d7 364 * @arg FMPI2C_FLAG_STOPF: STOP detection flag
Kojto 101:7cff1c4259d7 365 * @arg FMPI2C_FLAG_TC: Transfer complete (master mode)
Kojto 101:7cff1c4259d7 366 * @arg FMPI2C_FLAG_TCR: Transfer complete reload
Kojto 101:7cff1c4259d7 367 * @arg FMPI2C_FLAG_BERR: Bus error
Kojto 101:7cff1c4259d7 368 * @arg FMPI2C_FLAG_ARLO: Arbitration lost
Kojto 101:7cff1c4259d7 369 * @arg FMPI2C_FLAG_OVR: Overrun/Underrun
Kojto 101:7cff1c4259d7 370 * @arg FMPI2C_FLAG_PECERR: PEC error in reception
Kojto 101:7cff1c4259d7 371 * @arg FMPI2C_FLAG_TIMEOUT: Timeout or Tlow detection flag
Kojto 101:7cff1c4259d7 372 * @arg FMPI2C_FLAG_ALERT: SMBus alert
Kojto 101:7cff1c4259d7 373 * @arg FMPI2C_FLAG_BUSY: Bus busy
Kojto 101:7cff1c4259d7 374 * @arg FMPI2C_FLAG_DIR: Transfer direction (slave mode)
Kojto 101:7cff1c4259d7 375 *
Kojto 101:7cff1c4259d7 376 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 101:7cff1c4259d7 377 */
Kojto 101:7cff1c4259d7 378 #define __HAL_FMPI2C_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__) & FMPI2C_FLAG_MASK)) == ((__FLAG__) & FMPI2C_FLAG_MASK)))
Kojto 101:7cff1c4259d7 379
Kojto 101:7cff1c4259d7 380 /** @brief Clears the FMPI2C pending flags which are cleared by writing 1 in a specific bit.
Kojto 101:7cff1c4259d7 381 * @param __HANDLE__: specifies the FMPI2C Handle.
Kojto 101:7cff1c4259d7 382 * This parameter can be FMPI2C where x: 1 or 2 to select the FMPI2C peripheral.
Kojto 101:7cff1c4259d7 383 * @param __FLAG__: specifies the flag to clear.
Kojto 101:7cff1c4259d7 384 * This parameter can be any combination of the following values:
Kojto 101:7cff1c4259d7 385 * @arg FMPI2C_FLAG_ADDR: Address matched (slave mode)
Kojto 101:7cff1c4259d7 386 * @arg FMPI2C_FLAG_AF: Acknowledge failure received flag
Kojto 101:7cff1c4259d7 387 * @arg FMPI2C_FLAG_STOPF: STOP detection flag
Kojto 101:7cff1c4259d7 388 * @arg FMPI2C_FLAG_BERR: Bus error
Kojto 101:7cff1c4259d7 389 * @arg FMPI2C_FLAG_ARLO: Arbitration lost
Kojto 101:7cff1c4259d7 390 * @arg FMPI2C_FLAG_OVR: Overrun/Underrun
Kojto 101:7cff1c4259d7 391 * @arg FMPI2C_FLAG_PECERR: PEC error in reception
Kojto 101:7cff1c4259d7 392 * @arg FMPI2C_FLAG_TIMEOUT: Timeout or Tlow detection flag
Kojto 101:7cff1c4259d7 393 * @arg FMPI2C_FLAG_ALERT: SMBus alert
Kojto 101:7cff1c4259d7 394 *
Kojto 101:7cff1c4259d7 395 * @retval None
Kojto 101:7cff1c4259d7 396 */
Kojto 101:7cff1c4259d7 397 #define __HAL_FMPI2C_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = ((__FLAG__) & FMPI2C_FLAG_MASK))
Kojto 101:7cff1c4259d7 398
Kojto 101:7cff1c4259d7 399
Kojto 101:7cff1c4259d7 400 #define __HAL_FMPI2C_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= FMPI2C_CR1_PE)
Kojto 101:7cff1c4259d7 401 #define __HAL_FMPI2C_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~FMPI2C_CR1_PE)
Kojto 101:7cff1c4259d7 402
Kojto 101:7cff1c4259d7 403 #define __HAL_FMPI2C_RESET_CR2(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= (uint32_t)~((uint32_t)(FMPI2C_CR2_SADD | FMPI2C_CR2_HEAD10R | FMPI2C_CR2_NBYTES | FMPI2C_CR2_RELOAD | FMPI2C_CR2_RD_WRN)))
Kojto 101:7cff1c4259d7 404
Kojto 101:7cff1c4259d7 405 #define __HAL_FMPI2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00))) >> 8)))
Kojto 101:7cff1c4259d7 406 #define __HAL_FMPI2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FF))))
Kojto 101:7cff1c4259d7 407
Kojto 101:7cff1c4259d7 408 #define __HAL_FMPI2C_GENERATE_START(__ADDMODE__,__ADDRESS__) (((__ADDMODE__) == FMPI2C_ADDRESSINGMODE_7BIT) ? (uint32_t)((((uint32_t)(__ADDRESS__) & (FMPI2C_CR2_SADD)) | (FMPI2C_CR2_START) | (FMPI2C_CR2_AUTOEND)) & (~FMPI2C_CR2_RD_WRN)) : \
Kojto 101:7cff1c4259d7 409 (uint32_t)((((uint32_t)(__ADDRESS__) & (FMPI2C_CR2_SADD)) | (FMPI2C_CR2_ADD10) | (FMPI2C_CR2_START)) & (~FMPI2C_CR2_RD_WRN)))
Kojto 101:7cff1c4259d7 410
Kojto 101:7cff1c4259d7 411 #define IS_FMPI2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= (uint32_t)0x000003FF)
Kojto 101:7cff1c4259d7 412 #define IS_FMPI2C_OWN_ADDRESS2(ADDRESS2) ((ADDRESS2) <= (uint16_t)0x00FF)
Kojto 101:7cff1c4259d7 413
Kojto 101:7cff1c4259d7 414 /**
Kojto 101:7cff1c4259d7 415 * @}
Kojto 101:7cff1c4259d7 416 */
Kojto 101:7cff1c4259d7 417
Kojto 101:7cff1c4259d7 418 /* Include FMPI2C HAL Extension module */
Kojto 101:7cff1c4259d7 419 #include "stm32f4xx_hal_fmpi2c_ex.h"
Kojto 101:7cff1c4259d7 420
Kojto 101:7cff1c4259d7 421 /* Exported functions --------------------------------------------------------*/
Kojto 101:7cff1c4259d7 422 /** @addtogroup FMPI2C_Exported_Functions
Kojto 101:7cff1c4259d7 423 * @{
Kojto 101:7cff1c4259d7 424 */
Kojto 101:7cff1c4259d7 425
Kojto 101:7cff1c4259d7 426 /** @addtogroup FMPI2C_Exported_Functions_Group1
Kojto 101:7cff1c4259d7 427 * @{
Kojto 101:7cff1c4259d7 428 */
Kojto 101:7cff1c4259d7 429
Kojto 101:7cff1c4259d7 430 /* Initialization/de-initialization functions**********************************/
Kojto 101:7cff1c4259d7 431 HAL_StatusTypeDef HAL_FMPI2C_Init(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 432 HAL_StatusTypeDef HAL_FMPI2C_DeInit (FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 433 void HAL_FMPI2C_MspInit(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 434 void HAL_FMPI2C_MspDeInit(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 435
Kojto 101:7cff1c4259d7 436 /**
Kojto 101:7cff1c4259d7 437 * @}
Kojto 101:7cff1c4259d7 438 */
Kojto 101:7cff1c4259d7 439
Kojto 101:7cff1c4259d7 440 /** @addtogroup FMPI2C_Exported_Functions_Group2
Kojto 101:7cff1c4259d7 441 * @{
Kojto 101:7cff1c4259d7 442 */
Kojto 101:7cff1c4259d7 443
Kojto 101:7cff1c4259d7 444 /* I/O operation functions ***************************************************/
Kojto 101:7cff1c4259d7 445 /******* Blocking mode: Polling */
Kojto 101:7cff1c4259d7 446 HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 101:7cff1c4259d7 447 HAL_StatusTypeDef HAL_FMPI2C_Master_Receive(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 101:7cff1c4259d7 448 HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 101:7cff1c4259d7 449 HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 101:7cff1c4259d7 450 HAL_StatusTypeDef HAL_FMPI2C_Mem_Write(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 101:7cff1c4259d7 451 HAL_StatusTypeDef HAL_FMPI2C_Mem_Read(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 101:7cff1c4259d7 452 HAL_StatusTypeDef HAL_FMPI2C_IsDeviceReady(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout);
Kojto 101:7cff1c4259d7 453
Kojto 101:7cff1c4259d7 454 /******* Non-Blocking mode: Interrupt */
Kojto 101:7cff1c4259d7 455 HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 456 HAL_StatusTypeDef HAL_FMPI2C_Master_Receive_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 457 HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 458 HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 459 HAL_StatusTypeDef HAL_FMPI2C_Mem_Write_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 460 HAL_StatusTypeDef HAL_FMPI2C_Mem_Read_IT(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 461
Kojto 101:7cff1c4259d7 462 /******* Non-Blocking mode: DMA */
Kojto 101:7cff1c4259d7 463 HAL_StatusTypeDef HAL_FMPI2C_Master_Transmit_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 464 HAL_StatusTypeDef HAL_FMPI2C_Master_Receive_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 465 HAL_StatusTypeDef HAL_FMPI2C_Slave_Transmit_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 466 HAL_StatusTypeDef HAL_FMPI2C_Slave_Receive_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 467 HAL_StatusTypeDef HAL_FMPI2C_Mem_Write_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 468 HAL_StatusTypeDef HAL_FMPI2C_Mem_Read_DMA(FMPI2C_HandleTypeDef *hFMPI2C, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
Kojto 101:7cff1c4259d7 469
Kojto 101:7cff1c4259d7 470 /******* FMPI2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
Kojto 101:7cff1c4259d7 471 void HAL_FMPI2C_EV_IRQHandler(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 472 void HAL_FMPI2C_ER_IRQHandler(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 473 void HAL_FMPI2C_MasterTxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 474 void HAL_FMPI2C_MasterRxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 475 void HAL_FMPI2C_SlaveTxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 476 void HAL_FMPI2C_SlaveRxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 477 void HAL_FMPI2C_MemTxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 478 void HAL_FMPI2C_MemRxCpltCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 479 void HAL_FMPI2C_ErrorCallback(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 480 /**
Kojto 101:7cff1c4259d7 481 * @}
Kojto 101:7cff1c4259d7 482 */
Kojto 101:7cff1c4259d7 483
Kojto 101:7cff1c4259d7 484 /** @addtogroup FMPI2C_Exported_Functions_Group3
Kojto 101:7cff1c4259d7 485 * @{
Kojto 101:7cff1c4259d7 486 */
Kojto 101:7cff1c4259d7 487
Kojto 101:7cff1c4259d7 488 /* Peripheral State functions ************************************************/
Kojto 101:7cff1c4259d7 489 HAL_FMPI2C_StateTypeDef HAL_FMPI2C_GetState(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 490 uint32_t HAL_FMPI2C_GetError(FMPI2C_HandleTypeDef *hFMPI2C);
Kojto 101:7cff1c4259d7 491
Kojto 101:7cff1c4259d7 492 /**
Kojto 101:7cff1c4259d7 493 * @}
Kojto 101:7cff1c4259d7 494 */
Kojto 101:7cff1c4259d7 495
Kojto 101:7cff1c4259d7 496 /**
Kojto 101:7cff1c4259d7 497 * @}
Kojto 101:7cff1c4259d7 498 */
Kojto 101:7cff1c4259d7 499
Kojto 101:7cff1c4259d7 500 /* Private types -------------------------------------------------------------*/
Kojto 101:7cff1c4259d7 501
Kojto 101:7cff1c4259d7 502 /* Private variables ---------------------------------------------------------*/
Kojto 101:7cff1c4259d7 503 /* Private constants ---------------------------------------------------------*/
Kojto 101:7cff1c4259d7 504 /** @defgroup FMPI2C_Private_Constants FMPI2C Private Constants
Kojto 101:7cff1c4259d7 505 * @{
Kojto 101:7cff1c4259d7 506 */
Kojto 101:7cff1c4259d7 507 #define FMPI2C_FLAG_MASK ((uint32_t)0x0001FFFF)
Kojto 101:7cff1c4259d7 508 /**
Kojto 101:7cff1c4259d7 509 * @}
Kojto 101:7cff1c4259d7 510 */
Kojto 101:7cff1c4259d7 511
Kojto 101:7cff1c4259d7 512 /* Private macros ------------------------------------------------------------*/
Kojto 101:7cff1c4259d7 513 /** @defgroup FMPI2C_Private_Macros FMPI2C Private Macros
Kojto 101:7cff1c4259d7 514 * @{
Kojto 101:7cff1c4259d7 515 */
Kojto 101:7cff1c4259d7 516
Kojto 101:7cff1c4259d7 517 #define IS_FMPI2C_ADDRESSING_MODE(MODE) (((MODE) == FMPI2C_ADDRESSINGMODE_7BIT) || \
Kojto 101:7cff1c4259d7 518 ((MODE) == FMPI2C_ADDRESSINGMODE_10BIT))
Kojto 101:7cff1c4259d7 519
Kojto 101:7cff1c4259d7 520 #define IS_FMPI2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == FMPI2C_DUALADDRESS_DISABLE) || \
Kojto 101:7cff1c4259d7 521 ((ADDRESS) == FMPI2C_DUALADDRESS_ENABLE))
Kojto 101:7cff1c4259d7 522
Kojto 101:7cff1c4259d7 523 #define IS_FMPI2C_OWN_ADDRESS2_MASK(MASK) (((MASK) == FMPI2C_OA2_NOMASK) || \
Kojto 101:7cff1c4259d7 524 ((MASK) == FMPI2C_OA2_MASK01) || \
Kojto 101:7cff1c4259d7 525 ((MASK) == FMPI2C_OA2_MASK02) || \
Kojto 101:7cff1c4259d7 526 ((MASK) == FMPI2C_OA2_MASK03) || \
Kojto 101:7cff1c4259d7 527 ((MASK) == FMPI2C_OA2_MASK04) || \
Kojto 101:7cff1c4259d7 528 ((MASK) == FMPI2C_OA2_MASK05) || \
Kojto 101:7cff1c4259d7 529 ((MASK) == FMPI2C_OA2_MASK06) || \
Kojto 101:7cff1c4259d7 530 ((MASK) == FMPI2C_OA2_MASK07))
Kojto 101:7cff1c4259d7 531
Kojto 101:7cff1c4259d7 532 #define IS_FMPI2C_GENERAL_CALL(CALL) (((CALL) == FMPI2C_GENERALCALL_DISABLE) || \
Kojto 101:7cff1c4259d7 533 ((CALL) == FMPI2C_GENERALCALL_ENABLE))
Kojto 101:7cff1c4259d7 534
Kojto 101:7cff1c4259d7 535 #define IS_FMPI2C_NO_STRETCH(STRETCH) (((STRETCH) == FMPI2C_NOSTRETCH_DISABLE) || \
Kojto 101:7cff1c4259d7 536 ((STRETCH) == FMPI2C_NOSTRETCH_ENABLE))
Kojto 101:7cff1c4259d7 537
Kojto 101:7cff1c4259d7 538 #define IS_FMPI2C_MEMADD_SIZE(SIZE) (((SIZE) == FMPI2C_MEMADD_SIZE_8BIT) || \
Kojto 101:7cff1c4259d7 539 ((SIZE) == FMPI2C_MEMADD_SIZE_16BIT))
Kojto 101:7cff1c4259d7 540
Kojto 101:7cff1c4259d7 541 #define IS_TRANSFER_MODE(MODE) (((MODE) == FMPI2C_RELOAD_MODE) || \
Kojto 101:7cff1c4259d7 542 ((MODE) == FMPI2C_AUTOEND_MODE) || \
Kojto 101:7cff1c4259d7 543 ((MODE) == FMPI2C_SOFTEND_MODE))
Kojto 101:7cff1c4259d7 544
Kojto 101:7cff1c4259d7 545 #define IS_TRANSFER_REQUEST(REQUEST) (((REQUEST) == FMPI2C_GENERATE_STOP) || \
Kojto 101:7cff1c4259d7 546 ((REQUEST) == FMPI2C_GENERATE_START_READ) || \
Kojto 101:7cff1c4259d7 547 ((REQUEST) == FMPI2C_GENERATE_START_WRITE) || \
Kojto 101:7cff1c4259d7 548 ((REQUEST) == FMPI2C_NO_STARTSTOP))
Kojto 101:7cff1c4259d7 549
Kojto 101:7cff1c4259d7 550 /**
Kojto 101:7cff1c4259d7 551 * @}
Kojto 101:7cff1c4259d7 552 */
Kojto 101:7cff1c4259d7 553 /* Private functions ---------------------------------------------------------*/
Kojto 101:7cff1c4259d7 554 /** @defgroup FMPI2C_Private_Functions FMPI2C Private Functions
Kojto 101:7cff1c4259d7 555 * @brief FMPI2C private functions
Kojto 101:7cff1c4259d7 556 * @{
Kojto 101:7cff1c4259d7 557 */
Kojto 101:7cff1c4259d7 558 /**
Kojto 101:7cff1c4259d7 559 * @}
Kojto 101:7cff1c4259d7 560 */
Kojto 101:7cff1c4259d7 561
Kojto 101:7cff1c4259d7 562 /**
Kojto 101:7cff1c4259d7 563 * @}
Kojto 101:7cff1c4259d7 564 */
Kojto 101:7cff1c4259d7 565
Kojto 101:7cff1c4259d7 566 /**
Kojto 101:7cff1c4259d7 567 * @}
Kojto 101:7cff1c4259d7 568 */
Kojto 101:7cff1c4259d7 569 #endif /* STM32F446xx */
Kojto 101:7cff1c4259d7 570 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 571 }
Kojto 101:7cff1c4259d7 572 #endif
Kojto 101:7cff1c4259d7 573
Kojto 101:7cff1c4259d7 574
Kojto 101:7cff1c4259d7 575 #endif /* __STM32F4xx_HAL_FMPI2C_H */
Kojto 101:7cff1c4259d7 576
Kojto 101:7cff1c4259d7 577 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/