I2C_EEPROM

Committer:
jhon309
Date:
Thu Aug 13 00:23:16 2015 +0000
Revision:
0:ac8863619623
I2C

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jhon309 0:ac8863619623 1 /**
jhon309 0:ac8863619623 2 ******************************************************************************
jhon309 0:ac8863619623 3 * @file stm32f0xx_hal_irda.h
jhon309 0:ac8863619623 4 * @author MCD Application Team
jhon309 0:ac8863619623 5 * @version V1.2.0
jhon309 0:ac8863619623 6 * @date 11-December-2014
jhon309 0:ac8863619623 7 * @brief This file contains all the functions prototypes for the IRDA
jhon309 0:ac8863619623 8 * firmware library.
jhon309 0:ac8863619623 9 ******************************************************************************
jhon309 0:ac8863619623 10 * @attention
jhon309 0:ac8863619623 11 *
jhon309 0:ac8863619623 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
jhon309 0:ac8863619623 13 *
jhon309 0:ac8863619623 14 * Redistribution and use in source and binary forms, with or without modification,
jhon309 0:ac8863619623 15 * are permitted provided that the following conditions are met:
jhon309 0:ac8863619623 16 * 1. Redistributions of source code must retain the above copyright notice,
jhon309 0:ac8863619623 17 * this list of conditions and the following disclaimer.
jhon309 0:ac8863619623 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
jhon309 0:ac8863619623 19 * this list of conditions and the following disclaimer in the documentation
jhon309 0:ac8863619623 20 * and/or other materials provided with the distribution.
jhon309 0:ac8863619623 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
jhon309 0:ac8863619623 22 * may be used to endorse or promote products derived from this software
jhon309 0:ac8863619623 23 * without specific prior written permission.
jhon309 0:ac8863619623 24 *
jhon309 0:ac8863619623 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
jhon309 0:ac8863619623 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
jhon309 0:ac8863619623 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
jhon309 0:ac8863619623 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
jhon309 0:ac8863619623 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
jhon309 0:ac8863619623 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
jhon309 0:ac8863619623 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
jhon309 0:ac8863619623 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
jhon309 0:ac8863619623 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
jhon309 0:ac8863619623 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
jhon309 0:ac8863619623 35 *
jhon309 0:ac8863619623 36 ******************************************************************************
jhon309 0:ac8863619623 37 */
jhon309 0:ac8863619623 38
jhon309 0:ac8863619623 39 /* Define to prevent recursive inclusion -------------------------------------*/
jhon309 0:ac8863619623 40 #ifndef __STM32F0xx_HAL_IRDA_H
jhon309 0:ac8863619623 41 #define __STM32F0xx_HAL_IRDA_H
jhon309 0:ac8863619623 42
jhon309 0:ac8863619623 43 #ifdef __cplusplus
jhon309 0:ac8863619623 44 extern "C" {
jhon309 0:ac8863619623 45 #endif
jhon309 0:ac8863619623 46
jhon309 0:ac8863619623 47 #if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F070x6) && !defined(STM32F070xB) && !defined(STM32F030xC)
jhon309 0:ac8863619623 48
jhon309 0:ac8863619623 49 /* Includes ------------------------------------------------------------------*/
jhon309 0:ac8863619623 50 #include "stm32f0xx_hal_def.h"
jhon309 0:ac8863619623 51
jhon309 0:ac8863619623 52 /** @addtogroup STM32F0xx_HAL_Driver
jhon309 0:ac8863619623 53 * @{
jhon309 0:ac8863619623 54 */
jhon309 0:ac8863619623 55
jhon309 0:ac8863619623 56 /** @addtogroup IRDA
jhon309 0:ac8863619623 57 * @{
jhon309 0:ac8863619623 58 */
jhon309 0:ac8863619623 59
jhon309 0:ac8863619623 60 /* Exported types ------------------------------------------------------------*/
jhon309 0:ac8863619623 61 /** @defgroup IRDA_Exported_Types IRDA Exported Types
jhon309 0:ac8863619623 62 * @{
jhon309 0:ac8863619623 63 */
jhon309 0:ac8863619623 64
jhon309 0:ac8863619623 65 /**
jhon309 0:ac8863619623 66 * @brief IRDA Init Structure definition
jhon309 0:ac8863619623 67 */
jhon309 0:ac8863619623 68 typedef struct
jhon309 0:ac8863619623 69 {
jhon309 0:ac8863619623 70 uint32_t BaudRate; /*!< This member configures the IRDA communication baud rate.
jhon309 0:ac8863619623 71 The baud rate register is computed using the following formula:
jhon309 0:ac8863619623 72 Baud Rate Register = ((PCLKx) / ((hirda->Init.BaudRate))) */
jhon309 0:ac8863619623 73
jhon309 0:ac8863619623 74 uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame.
jhon309 0:ac8863619623 75 This parameter can be a value of @ref IRDAEx_Word_Length */
jhon309 0:ac8863619623 76
jhon309 0:ac8863619623 77 uint16_t Parity; /*!< Specifies the parity mode.
jhon309 0:ac8863619623 78 This parameter can be a value of @ref IRDA_Parity
jhon309 0:ac8863619623 79 @note When parity is enabled, the computed parity is inserted
jhon309 0:ac8863619623 80 at the MSB position of the transmitted data (9th bit when
jhon309 0:ac8863619623 81 the word length is set to 9 data bits; 8th bit when the
jhon309 0:ac8863619623 82 word length is set to 8 data bits). */
jhon309 0:ac8863619623 83
jhon309 0:ac8863619623 84 uint16_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled.
jhon309 0:ac8863619623 85 This parameter can be a value of @ref IRDA_Mode */
jhon309 0:ac8863619623 86
jhon309 0:ac8863619623 87 uint8_t Prescaler; /*!< Specifies the Prescaler value for dividing the UART/USART source clock
jhon309 0:ac8863619623 88 to achieve low-power frequency.
jhon309 0:ac8863619623 89 @note Prescaler value 0 is forbidden */
jhon309 0:ac8863619623 90
jhon309 0:ac8863619623 91 uint16_t PowerMode; /*!< Specifies the IRDA power mode.
jhon309 0:ac8863619623 92 This parameter can be a value of @ref IRDA_Low_Power */
jhon309 0:ac8863619623 93 }IRDA_InitTypeDef;
jhon309 0:ac8863619623 94
jhon309 0:ac8863619623 95 /**
jhon309 0:ac8863619623 96 * @brief HAL IRDA State structures definition
jhon309 0:ac8863619623 97 */
jhon309 0:ac8863619623 98 typedef enum
jhon309 0:ac8863619623 99 {
jhon309 0:ac8863619623 100 HAL_IRDA_STATE_RESET = 0x00, /*!< Peripheral is not initialized */
jhon309 0:ac8863619623 101 HAL_IRDA_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
jhon309 0:ac8863619623 102 HAL_IRDA_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
jhon309 0:ac8863619623 103 HAL_IRDA_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
jhon309 0:ac8863619623 104 HAL_IRDA_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
jhon309 0:ac8863619623 105 HAL_IRDA_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
jhon309 0:ac8863619623 106 HAL_IRDA_STATE_TIMEOUT = 0x03, /*!< Timeout state */
jhon309 0:ac8863619623 107 HAL_IRDA_STATE_ERROR = 0x04 /*!< Error */
jhon309 0:ac8863619623 108 }HAL_IRDA_StateTypeDef;
jhon309 0:ac8863619623 109
jhon309 0:ac8863619623 110 /**
jhon309 0:ac8863619623 111 * @brief IRDA clock sources definition
jhon309 0:ac8863619623 112 */
jhon309 0:ac8863619623 113 typedef enum
jhon309 0:ac8863619623 114 {
jhon309 0:ac8863619623 115 IRDA_CLOCKSOURCE_PCLK1 = 0x00, /*!< PCLK1 clock source */
jhon309 0:ac8863619623 116 IRDA_CLOCKSOURCE_HSI = 0x02, /*!< HSI clock source */
jhon309 0:ac8863619623 117 IRDA_CLOCKSOURCE_SYSCLK = 0x04, /*!< SYSCLK clock source */
jhon309 0:ac8863619623 118 IRDA_CLOCKSOURCE_LSE = 0x08, /*!< LSE clock source */
jhon309 0:ac8863619623 119 IRDA_CLOCKSOURCE_UNDEFINED = 0x10 /*!< undefined clock source */
jhon309 0:ac8863619623 120 }IRDA_ClockSourceTypeDef;
jhon309 0:ac8863619623 121
jhon309 0:ac8863619623 122 /**
jhon309 0:ac8863619623 123 * @brief IRDA handle Structure definition
jhon309 0:ac8863619623 124 */
jhon309 0:ac8863619623 125 typedef struct
jhon309 0:ac8863619623 126 {
jhon309 0:ac8863619623 127 USART_TypeDef *Instance; /*!< USART registers base address */
jhon309 0:ac8863619623 128
jhon309 0:ac8863619623 129 IRDA_InitTypeDef Init; /*!< IRDA communication parameters */
jhon309 0:ac8863619623 130
jhon309 0:ac8863619623 131 uint8_t *pTxBuffPtr; /*!< Pointer to IRDA Tx transfer Buffer */
jhon309 0:ac8863619623 132
jhon309 0:ac8863619623 133 uint16_t TxXferSize; /*!< IRDA Tx Transfer size */
jhon309 0:ac8863619623 134
jhon309 0:ac8863619623 135 uint16_t TxXferCount; /*!< IRDA Tx Transfer Counter */
jhon309 0:ac8863619623 136
jhon309 0:ac8863619623 137 uint8_t *pRxBuffPtr; /*!< Pointer to IRDA Rx transfer Buffer */
jhon309 0:ac8863619623 138
jhon309 0:ac8863619623 139 uint16_t RxXferSize; /*!< IRDA Rx Transfer size */
jhon309 0:ac8863619623 140
jhon309 0:ac8863619623 141 uint16_t RxXferCount; /*!< IRDA Rx Transfer Counter */
jhon309 0:ac8863619623 142
jhon309 0:ac8863619623 143 uint16_t Mask; /*!< USART RX RDR register mask */
jhon309 0:ac8863619623 144
jhon309 0:ac8863619623 145 DMA_HandleTypeDef *hdmatx; /*!< IRDA Tx DMA Handle parameters */
jhon309 0:ac8863619623 146
jhon309 0:ac8863619623 147 DMA_HandleTypeDef *hdmarx; /*!< IRDA Rx DMA Handle parameters */
jhon309 0:ac8863619623 148
jhon309 0:ac8863619623 149 HAL_LockTypeDef Lock; /*!< Locking object */
jhon309 0:ac8863619623 150
jhon309 0:ac8863619623 151 HAL_IRDA_StateTypeDef State; /*!< IRDA communication state */
jhon309 0:ac8863619623 152
jhon309 0:ac8863619623 153 __IO uint32_t ErrorCode; /*!< IRDA Error code
jhon309 0:ac8863619623 154 This parameter can be a value of @ref IRDA_Error */
jhon309 0:ac8863619623 155
jhon309 0:ac8863619623 156 }IRDA_HandleTypeDef;
jhon309 0:ac8863619623 157
jhon309 0:ac8863619623 158 /**
jhon309 0:ac8863619623 159 * @brief IRDA Configuration enumeration values definition
jhon309 0:ac8863619623 160 */
jhon309 0:ac8863619623 161 typedef enum
jhon309 0:ac8863619623 162 {
jhon309 0:ac8863619623 163 IRDA_BAUDRATE = 0x00,
jhon309 0:ac8863619623 164 IRDA_PARITY = 0x01,
jhon309 0:ac8863619623 165 IRDA_WORDLENGTH = 0x02,
jhon309 0:ac8863619623 166 IRDA_MODE = 0x03,
jhon309 0:ac8863619623 167 IRDA_PRESCALER = 0x04,
jhon309 0:ac8863619623 168 IRDA_POWERMODE = 0x05
jhon309 0:ac8863619623 169 }IRDA_ControlTypeDef;
jhon309 0:ac8863619623 170
jhon309 0:ac8863619623 171 /**
jhon309 0:ac8863619623 172 * @}
jhon309 0:ac8863619623 173 */
jhon309 0:ac8863619623 174
jhon309 0:ac8863619623 175 /* Exported constants --------------------------------------------------------*/
jhon309 0:ac8863619623 176 /** @defgroup IRDA_Exported_Constants IRDA Exported constants
jhon309 0:ac8863619623 177 * @{
jhon309 0:ac8863619623 178 */
jhon309 0:ac8863619623 179
jhon309 0:ac8863619623 180 /** @defgroup IRDA_Error IRDA Error
jhon309 0:ac8863619623 181 * @{
jhon309 0:ac8863619623 182 */
jhon309 0:ac8863619623 183 #define HAL_IRDA_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
jhon309 0:ac8863619623 184 #define HAL_IRDA_ERROR_PE ((uint32_t)0x00000001) /*!< Parity error */
jhon309 0:ac8863619623 185 #define HAL_IRDA_ERROR_NE ((uint32_t)0x00000002) /*!< Noise error */
jhon309 0:ac8863619623 186 #define HAL_IRDA_ERROR_FE ((uint32_t)0x00000004) /*!< frame error */
jhon309 0:ac8863619623 187 #define HAL_IRDA_ERROR_ORE ((uint32_t)0x00000008) /*!< Overrun error */
jhon309 0:ac8863619623 188 #define HAL_IRDA_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */
jhon309 0:ac8863619623 189 /**
jhon309 0:ac8863619623 190 * @}
jhon309 0:ac8863619623 191 */
jhon309 0:ac8863619623 192
jhon309 0:ac8863619623 193 /** @defgroup IRDA_Parity IRDA Parity
jhon309 0:ac8863619623 194 * @{
jhon309 0:ac8863619623 195 */
jhon309 0:ac8863619623 196 #define IRDA_PARITY_NONE ((uint16_t)0x0000)
jhon309 0:ac8863619623 197 #define IRDA_PARITY_EVEN ((uint16_t)USART_CR1_PCE)
jhon309 0:ac8863619623 198 #define IRDA_PARITY_ODD ((uint16_t)(USART_CR1_PCE | USART_CR1_PS))
jhon309 0:ac8863619623 199 #define IS_IRDA_PARITY(PARITY) (((PARITY) == IRDA_PARITY_NONE) || \
jhon309 0:ac8863619623 200 ((PARITY) == IRDA_PARITY_EVEN) || \
jhon309 0:ac8863619623 201 ((PARITY) == IRDA_PARITY_ODD))
jhon309 0:ac8863619623 202 /**
jhon309 0:ac8863619623 203 * @}
jhon309 0:ac8863619623 204 */
jhon309 0:ac8863619623 205
jhon309 0:ac8863619623 206
jhon309 0:ac8863619623 207 /** @defgroup IRDA_Transfer_Mode IRDA Transfer Mode
jhon309 0:ac8863619623 208 * @{
jhon309 0:ac8863619623 209 */
jhon309 0:ac8863619623 210 #define IRDA_MODE_RX ((uint16_t)USART_CR1_RE)
jhon309 0:ac8863619623 211 #define IRDA_MODE_TX ((uint16_t)USART_CR1_TE)
jhon309 0:ac8863619623 212 #define IRDA_MODE_TX_RX ((uint16_t)(USART_CR1_TE |USART_CR1_RE))
jhon309 0:ac8863619623 213 #define IS_IRDA_TX_RX_MODE(MODE) ((((MODE) & ((uint16_t)(~((uint16_t)(IRDA_MODE_TX_RX))))) == (uint16_t)0x00) && ((MODE) != (uint16_t)0x00))
jhon309 0:ac8863619623 214 /**
jhon309 0:ac8863619623 215 * @}
jhon309 0:ac8863619623 216 */
jhon309 0:ac8863619623 217
jhon309 0:ac8863619623 218 /** @defgroup IRDA_Low_Power IRDA Low Power
jhon309 0:ac8863619623 219 * @{
jhon309 0:ac8863619623 220 */
jhon309 0:ac8863619623 221 #define IRDA_POWERMODE_NORMAL ((uint16_t)0x0000)
jhon309 0:ac8863619623 222 #define IRDA_POWERMODE_LOWPOWER ((uint16_t)USART_CR3_IRLP)
jhon309 0:ac8863619623 223 #define IS_IRDA_POWERMODE(MODE) (((MODE) == IRDA_POWERMODE_LOWPOWER) || \
jhon309 0:ac8863619623 224 ((MODE) == IRDA_POWERMODE_NORMAL))
jhon309 0:ac8863619623 225 /**
jhon309 0:ac8863619623 226 * @}
jhon309 0:ac8863619623 227 */
jhon309 0:ac8863619623 228
jhon309 0:ac8863619623 229 /** @defgroup IRDA_State IRDA State
jhon309 0:ac8863619623 230 * @{
jhon309 0:ac8863619623 231 */
jhon309 0:ac8863619623 232 #define IRDA_STATE_DISABLE ((uint16_t)0x0000)
jhon309 0:ac8863619623 233 #define IRDA_STATE_ENABLE ((uint16_t)USART_CR1_UE)
jhon309 0:ac8863619623 234 #define IS_IRDA_STATE(STATE) (((STATE) == IRDA_STATE_DISABLE) || \
jhon309 0:ac8863619623 235 ((STATE) == IRDA_STATE_ENABLE))
jhon309 0:ac8863619623 236 /**
jhon309 0:ac8863619623 237 * @}
jhon309 0:ac8863619623 238 */
jhon309 0:ac8863619623 239
jhon309 0:ac8863619623 240 /** @defgroup IRDA_Mode IRDA Mode
jhon309 0:ac8863619623 241 * @{
jhon309 0:ac8863619623 242 */
jhon309 0:ac8863619623 243 #define IRDA_MODE_DISABLE ((uint16_t)0x0000)
jhon309 0:ac8863619623 244 #define IRDA_MODE_ENABLE ((uint16_t)USART_CR3_IREN)
jhon309 0:ac8863619623 245 #define IS_IRDA_MODE(STATE) (((STATE) == IRDA_MODE_DISABLE) || \
jhon309 0:ac8863619623 246 ((STATE) == IRDA_MODE_ENABLE))
jhon309 0:ac8863619623 247 /**
jhon309 0:ac8863619623 248 * @}
jhon309 0:ac8863619623 249 */
jhon309 0:ac8863619623 250
jhon309 0:ac8863619623 251 /** @defgroup IRDA_One_Bit IRDA One Bit Sampling
jhon309 0:ac8863619623 252 * @{
jhon309 0:ac8863619623 253 */
jhon309 0:ac8863619623 254 #define IRDA_ONE_BIT_SAMPLE_DISABLED ((uint16_t)0x00000000)
jhon309 0:ac8863619623 255 #define IRDA_ONE_BIT_SAMPLE_ENABLED ((uint16_t)USART_CR3_ONEBIT)
jhon309 0:ac8863619623 256 #define IS_IRDA_ONEBIT_SAMPLE(ONEBIT) (((ONEBIT) == IRDA_ONE_BIT_SAMPLE_DISABLED) || \
jhon309 0:ac8863619623 257 ((ONEBIT) == IRDA_ONE_BIT_SAMPLE_ENABLED))
jhon309 0:ac8863619623 258 /**
jhon309 0:ac8863619623 259 * @}
jhon309 0:ac8863619623 260 */
jhon309 0:ac8863619623 261
jhon309 0:ac8863619623 262 /** @defgroup IRDA_DMA_Tx IRDA DMA Tx
jhon309 0:ac8863619623 263 * @{
jhon309 0:ac8863619623 264 */
jhon309 0:ac8863619623 265 #define IRDA_DMA_TX_DISABLE ((uint16_t)0x00000000)
jhon309 0:ac8863619623 266 #define IRDA_DMA_TX_ENABLE ((uint16_t)USART_CR3_DMAT)
jhon309 0:ac8863619623 267 #define IS_IRDA_DMA_TX(DMATX) (((DMATX) == IRDA_DMA_TX_DISABLE) || \
jhon309 0:ac8863619623 268 ((DMATX) == IRDA_DMA_TX_ENABLE))
jhon309 0:ac8863619623 269 /**
jhon309 0:ac8863619623 270 * @}
jhon309 0:ac8863619623 271 */
jhon309 0:ac8863619623 272
jhon309 0:ac8863619623 273 /** @defgroup IRDA_DMA_Rx IRDA DMA Rx
jhon309 0:ac8863619623 274 * @{
jhon309 0:ac8863619623 275 */
jhon309 0:ac8863619623 276 #define IRDA_DMA_RX_DISABLE ((uint16_t)0x0000)
jhon309 0:ac8863619623 277 #define IRDA_DMA_RX_ENABLE ((uint16_t)USART_CR3_DMAR)
jhon309 0:ac8863619623 278 #define IS_IRDA_DMA_RX(DMARX) (((DMARX) == IRDA_DMA_RX_DISABLE) || \
jhon309 0:ac8863619623 279 ((DMARX) == IRDA_DMA_RX_ENABLE))
jhon309 0:ac8863619623 280 /**
jhon309 0:ac8863619623 281 * @}
jhon309 0:ac8863619623 282 */
jhon309 0:ac8863619623 283
jhon309 0:ac8863619623 284 /** @defgroup IRDA_Flags IRDA Flags
jhon309 0:ac8863619623 285 * Elements values convention: 0xXXXX
jhon309 0:ac8863619623 286 * - 0xXXXX : Flag mask in the ISR register
jhon309 0:ac8863619623 287 * @{
jhon309 0:ac8863619623 288 */
jhon309 0:ac8863619623 289 #define IRDA_FLAG_REACK ((uint32_t)0x00400000)
jhon309 0:ac8863619623 290 #define IRDA_FLAG_TEACK ((uint32_t)0x00200000)
jhon309 0:ac8863619623 291 #define IRDA_FLAG_BUSY ((uint32_t)0x00010000)
jhon309 0:ac8863619623 292 #define IRDA_FLAG_ABRF ((uint32_t)0x00008000)
jhon309 0:ac8863619623 293 #define IRDA_FLAG_ABRE ((uint32_t)0x00004000)
jhon309 0:ac8863619623 294 #define IRDA_FLAG_TXE ((uint32_t)0x00000080)
jhon309 0:ac8863619623 295 #define IRDA_FLAG_TC ((uint32_t)0x00000040)
jhon309 0:ac8863619623 296 #define IRDA_FLAG_RXNE ((uint32_t)0x00000020)
jhon309 0:ac8863619623 297 #define IRDA_FLAG_ORE ((uint32_t)0x00000008)
jhon309 0:ac8863619623 298 #define IRDA_FLAG_NE ((uint32_t)0x00000004)
jhon309 0:ac8863619623 299 #define IRDA_FLAG_FE ((uint32_t)0x00000002)
jhon309 0:ac8863619623 300 #define IRDA_FLAG_PE ((uint32_t)0x00000001)
jhon309 0:ac8863619623 301 /**
jhon309 0:ac8863619623 302 * @}
jhon309 0:ac8863619623 303 */
jhon309 0:ac8863619623 304
jhon309 0:ac8863619623 305 /** @defgroup IRDA_Interrupt_definition IRDA Interrupt Definition
jhon309 0:ac8863619623 306 * Elements values convention: 0000ZZZZ0XXYYYYYb
jhon309 0:ac8863619623 307 * - YYYYY : Interrupt source position in the XX register (5bits)
jhon309 0:ac8863619623 308 * - XX : Interrupt source register (2bits)
jhon309 0:ac8863619623 309 * - 01: CR1 register
jhon309 0:ac8863619623 310 * - 10: CR2 register
jhon309 0:ac8863619623 311 * - 11: CR3 register
jhon309 0:ac8863619623 312 * - ZZZZ : Flag position in the ISR register(4bits)
jhon309 0:ac8863619623 313 * @{
jhon309 0:ac8863619623 314 */
jhon309 0:ac8863619623 315 #define IRDA_IT_PE ((uint16_t)0x0028)
jhon309 0:ac8863619623 316 #define IRDA_IT_TXE ((uint16_t)0x0727)
jhon309 0:ac8863619623 317 #define IRDA_IT_TC ((uint16_t)0x0626)
jhon309 0:ac8863619623 318 #define IRDA_IT_RXNE ((uint16_t)0x0525)
jhon309 0:ac8863619623 319 #define IRDA_IT_IDLE ((uint16_t)0x0424)
jhon309 0:ac8863619623 320
jhon309 0:ac8863619623 321
jhon309 0:ac8863619623 322
jhon309 0:ac8863619623 323 /** Elements values convention: 000000000XXYYYYYb
jhon309 0:ac8863619623 324 * - YYYYY : Interrupt source position in the XX register (5bits)
jhon309 0:ac8863619623 325 * - XX : Interrupt source register (2bits)
jhon309 0:ac8863619623 326 * - 01: CR1 register
jhon309 0:ac8863619623 327 * - 10: CR2 register
jhon309 0:ac8863619623 328 * - 11: CR3 register
jhon309 0:ac8863619623 329 */
jhon309 0:ac8863619623 330 #define IRDA_IT_ERR ((uint16_t)0x0060)
jhon309 0:ac8863619623 331
jhon309 0:ac8863619623 332 /** Elements values convention: 0000ZZZZ00000000b
jhon309 0:ac8863619623 333 * - ZZZZ : Flag position in the ISR register(4bits)
jhon309 0:ac8863619623 334 */
jhon309 0:ac8863619623 335 #define IRDA_IT_ORE ((uint16_t)0x0300)
jhon309 0:ac8863619623 336 #define IRDA_IT_NE ((uint16_t)0x0200)
jhon309 0:ac8863619623 337 #define IRDA_IT_FE ((uint16_t)0x0100)
jhon309 0:ac8863619623 338 /**
jhon309 0:ac8863619623 339 * @}
jhon309 0:ac8863619623 340 */
jhon309 0:ac8863619623 341
jhon309 0:ac8863619623 342 /** @defgroup IRDA_IT_CLEAR_Flags IRDA Interruption Clear Flags
jhon309 0:ac8863619623 343 * @{
jhon309 0:ac8863619623 344 */
jhon309 0:ac8863619623 345 #define IRDA_CLEAR_PEF USART_ICR_PECF /*!< Parity Error Clear Flag */
jhon309 0:ac8863619623 346 #define IRDA_CLEAR_FEF USART_ICR_FECF /*!< Framing Error Clear Flag */
jhon309 0:ac8863619623 347 #define IRDA_CLEAR_NEF USART_ICR_NCF /*!< Noise detected Clear Flag */
jhon309 0:ac8863619623 348 #define IRDA_CLEAR_OREF USART_ICR_ORECF /*!< OverRun Error Clear Flag */
jhon309 0:ac8863619623 349 #define IRDA_CLEAR_TCF USART_ICR_TCCF /*!< Transmission Complete Clear Flag */
jhon309 0:ac8863619623 350 /**
jhon309 0:ac8863619623 351 * @}
jhon309 0:ac8863619623 352 */
jhon309 0:ac8863619623 353
jhon309 0:ac8863619623 354
jhon309 0:ac8863619623 355
jhon309 0:ac8863619623 356 /** @defgroup IRDA_Request_Parameters IRDA Request Parameters
jhon309 0:ac8863619623 357 * @{
jhon309 0:ac8863619623 358 */
jhon309 0:ac8863619623 359 #define IRDA_AUTOBAUD_REQUEST ((uint16_t)USART_RQR_ABRRQ) /*!< Auto-Baud Rate Request */
jhon309 0:ac8863619623 360 #define IRDA_RXDATA_FLUSH_REQUEST ((uint16_t)USART_RQR_RXFRQ) /*!< Receive Data flush Request */
jhon309 0:ac8863619623 361 #define IRDA_TXDATA_FLUSH_REQUEST ((uint16_t)USART_RQR_TXFRQ) /*!< Transmit data flush Request */
jhon309 0:ac8863619623 362 #define IS_IRDA_REQUEST_PARAMETER(PARAM) (((PARAM) == IRDA_AUTOBAUD_REQUEST) || \
jhon309 0:ac8863619623 363 ((PARAM) == IRDA_RXDATA_FLUSH_REQUEST) || \
jhon309 0:ac8863619623 364 ((PARAM) == IRDA_TXDATA_FLUSH_REQUEST))
jhon309 0:ac8863619623 365 /**
jhon309 0:ac8863619623 366 * @}
jhon309 0:ac8863619623 367 */
jhon309 0:ac8863619623 368
jhon309 0:ac8863619623 369 /** @defgroup IRDA_Interruption_Mask IRDA interruptions flag mask
jhon309 0:ac8863619623 370 * @{
jhon309 0:ac8863619623 371 */
jhon309 0:ac8863619623 372 #define IRDA_IT_MASK ((uint16_t)0x001F)
jhon309 0:ac8863619623 373 /**
jhon309 0:ac8863619623 374 * @}
jhon309 0:ac8863619623 375 */
jhon309 0:ac8863619623 376
jhon309 0:ac8863619623 377 /**
jhon309 0:ac8863619623 378 * @}
jhon309 0:ac8863619623 379 */
jhon309 0:ac8863619623 380
jhon309 0:ac8863619623 381 /* Exported macro ------------------------------------------------------------*/
jhon309 0:ac8863619623 382 /** @defgroup IRDA_Exported_Macros IRDA Exported Macros
jhon309 0:ac8863619623 383 * @{
jhon309 0:ac8863619623 384 */
jhon309 0:ac8863619623 385
jhon309 0:ac8863619623 386 /** @brief Reset IRDA handle state
jhon309 0:ac8863619623 387 * @param __HANDLE__: IRDA handle.
jhon309 0:ac8863619623 388 * @retval None
jhon309 0:ac8863619623 389 */
jhon309 0:ac8863619623 390 #define __HAL_IRDA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_IRDA_STATE_RESET)
jhon309 0:ac8863619623 391
jhon309 0:ac8863619623 392 /** @brief Checks whether the specified IRDA flag is set or not.
jhon309 0:ac8863619623 393 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 394 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 395 * UART peripheral
jhon309 0:ac8863619623 396 * @param __FLAG__: specifies the flag to check.
jhon309 0:ac8863619623 397 * This parameter can be one of the following values:
jhon309 0:ac8863619623 398 * @arg IRDA_FLAG_REACK: Receive enable ackowledge flag
jhon309 0:ac8863619623 399 * @arg IRDA_FLAG_TEACK: Transmit enable ackowledge flag
jhon309 0:ac8863619623 400 * @arg IRDA_FLAG_BUSY: Busy flag
jhon309 0:ac8863619623 401 * @arg IRDA_FLAG_ABRF: Auto Baud rate detection flag
jhon309 0:ac8863619623 402 * @arg IRDA_FLAG_ABRE: Auto Baud rate detection error flag
jhon309 0:ac8863619623 403 * @arg IRDA_FLAG_TXE: Transmit data register empty flag
jhon309 0:ac8863619623 404 * @arg IRDA_FLAG_TC: Transmission Complete flag
jhon309 0:ac8863619623 405 * @arg IRDA_FLAG_RXNE: Receive data register not empty flag
jhon309 0:ac8863619623 406 * @arg IRDA_FLAG_IDLE: Idle Line detection flag
jhon309 0:ac8863619623 407 * @arg IRDA_FLAG_ORE: OverRun Error flag
jhon309 0:ac8863619623 408 * @arg IRDA_FLAG_NE: Noise Error flag
jhon309 0:ac8863619623 409 * @arg IRDA_FLAG_FE: Framing Error flag
jhon309 0:ac8863619623 410 * @arg IRDA_FLAG_PE: Parity Error flag
jhon309 0:ac8863619623 411 * @retval The new state of __FLAG__ (TRUE or FALSE).
jhon309 0:ac8863619623 412 */
jhon309 0:ac8863619623 413 #define __HAL_IRDA_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
jhon309 0:ac8863619623 414
jhon309 0:ac8863619623 415 /** @brief Enables the specified IRDA interrupt.
jhon309 0:ac8863619623 416 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 417 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 418 * UART peripheral
jhon309 0:ac8863619623 419 * @param __INTERRUPT__: specifies the IRDA interrupt source to enable.
jhon309 0:ac8863619623 420 * This parameter can be one of the following values:
jhon309 0:ac8863619623 421 * @arg IRDA_IT_TXE: Transmit Data Register empty interrupt
jhon309 0:ac8863619623 422 * @arg IRDA_IT_TC: Transmission complete interrupt
jhon309 0:ac8863619623 423 * @arg IRDA_IT_RXNE: Receive Data register not empty interrupt
jhon309 0:ac8863619623 424 * @arg IRDA_IT_IDLE: Idle line detection interrupt
jhon309 0:ac8863619623 425 * @arg IRDA_IT_PE: Parity Error interrupt
jhon309 0:ac8863619623 426 * @arg IRDA_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
jhon309 0:ac8863619623 427 * @retval None
jhon309 0:ac8863619623 428 */
jhon309 0:ac8863619623 429 #define __HAL_IRDA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 |= (1U << ((__INTERRUPT__) & IRDA_IT_MASK))): \
jhon309 0:ac8863619623 430 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 |= (1U << ((__INTERRUPT__) & IRDA_IT_MASK))): \
jhon309 0:ac8863619623 431 ((__HANDLE__)->Instance->CR3 |= (1U << ((__INTERRUPT__) & IRDA_IT_MASK))))
jhon309 0:ac8863619623 432
jhon309 0:ac8863619623 433 /** @brief Disables the specified IRDA interrupt.
jhon309 0:ac8863619623 434 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 435 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 436 * UART peripheral
jhon309 0:ac8863619623 437 * @param __INTERRUPT__: specifies the IRDA interrupt source to disable.
jhon309 0:ac8863619623 438 * This parameter can be one of the following values:
jhon309 0:ac8863619623 439 * @arg IRDA_IT_TXE: Transmit Data Register empty interrupt
jhon309 0:ac8863619623 440 * @arg IRDA_IT_TC: Transmission complete interrupt
jhon309 0:ac8863619623 441 * @arg IRDA_IT_RXNE: Receive Data register not empty interrupt
jhon309 0:ac8863619623 442 * @arg IRDA_IT_IDLE: Idle line detection interrupt
jhon309 0:ac8863619623 443 * @arg IRDA_IT_PE: Parity Error interrupt
jhon309 0:ac8863619623 444 * @arg IRDA_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
jhon309 0:ac8863619623 445 * @retval None
jhon309 0:ac8863619623 446 */
jhon309 0:ac8863619623 447 #define __HAL_IRDA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 &= ~ (1U << ((__INTERRUPT__) & IRDA_IT_MASK))): \
jhon309 0:ac8863619623 448 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 &= ~ (1U << ((__INTERRUPT__) & IRDA_IT_MASK))): \
jhon309 0:ac8863619623 449 ((__HANDLE__)->Instance->CR3 &= ~ (1U << ((__INTERRUPT__) & IRDA_IT_MASK))))
jhon309 0:ac8863619623 450
jhon309 0:ac8863619623 451
jhon309 0:ac8863619623 452 /** @brief Checks whether the specified IRDA interrupt has occurred or not.
jhon309 0:ac8863619623 453 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 454 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 455 * UART peripheral
jhon309 0:ac8863619623 456 * @param __IT__: specifies the IRDA interrupt source to check.
jhon309 0:ac8863619623 457 * This parameter can be one of the following values:
jhon309 0:ac8863619623 458 * @arg IRDA_IT_TXE: Transmit Data Register empty interrupt
jhon309 0:ac8863619623 459 * @arg IRDA_IT_TC: Transmission complete interrupt
jhon309 0:ac8863619623 460 * @arg IRDA_IT_RXNE: Receive Data register not empty interrupt
jhon309 0:ac8863619623 461 * @arg IRDA_IT_IDLE: Idle line detection interrupt
jhon309 0:ac8863619623 462 * @arg IRDA_IT_ORE: OverRun Error interrupt
jhon309 0:ac8863619623 463 * @arg IRDA_IT_NE: Noise Error interrupt
jhon309 0:ac8863619623 464 * @arg IRDA_IT_FE: Framing Error interrupt
jhon309 0:ac8863619623 465 * @arg IRDA_IT_PE: Parity Error interrupt
jhon309 0:ac8863619623 466 * @retval The new state of __IT__ (TRUE or FALSE).
jhon309 0:ac8863619623 467 */
jhon309 0:ac8863619623 468 #define __HAL_IRDA_GET_IT(__HANDLE__, __IT__) ((__HANDLE__)->Instance->ISR & ((uint32_t)1U << ((__IT__)>> 0x08)))
jhon309 0:ac8863619623 469
jhon309 0:ac8863619623 470 /** @brief Checks whether the specified IRDA interrupt source is enabled.
jhon309 0:ac8863619623 471 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 472 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 473 * UART peripheral
jhon309 0:ac8863619623 474 * @param __IT__: specifies the IRDA interrupt source to check.
jhon309 0:ac8863619623 475 * This parameter can be one of the following values:
jhon309 0:ac8863619623 476 * @arg IRDA_IT_TXE: Transmit Data Register empty interrupt
jhon309 0:ac8863619623 477 * @arg IRDA_IT_TC: Transmission complete interrupt
jhon309 0:ac8863619623 478 * @arg IRDA_IT_RXNE: Receive Data register not empty interrupt
jhon309 0:ac8863619623 479 * @arg IRDA_IT_IDLE: Idle line detection interrupt
jhon309 0:ac8863619623 480 * @arg IRDA_IT_ORE: OverRun Error interrupt
jhon309 0:ac8863619623 481 * @arg IRDA_IT_NE: Noise Error interrupt
jhon309 0:ac8863619623 482 * @arg IRDA_IT_FE: Framing Error interrupt
jhon309 0:ac8863619623 483 * @arg IRDA_IT_PE: Parity Error interrupt
jhon309 0:ac8863619623 484 * @retval The new state of __IT__ (TRUE or FALSE).
jhon309 0:ac8863619623 485 */
jhon309 0:ac8863619623 486 #define __HAL_IRDA_GET_IT_SOURCE(__HANDLE__, __IT__) ((((((uint8_t)(__IT__)) >> 5U) == 1)? (__HANDLE__)->Instance->CR1:(((((uint8_t)(__IT__)) >> 5U) == 2)? \
jhon309 0:ac8863619623 487 (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & ((uint32_t)1 << (((uint16_t)(__IT__)) & IRDA_IT_MASK)))
jhon309 0:ac8863619623 488
jhon309 0:ac8863619623 489
jhon309 0:ac8863619623 490 /** @brief Clears the specified IRDA ISR flag, in setting the proper ICR register flag.
jhon309 0:ac8863619623 491 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 492 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 493 * UART peripheral
jhon309 0:ac8863619623 494 * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
jhon309 0:ac8863619623 495 * to clear the corresponding interrupt
jhon309 0:ac8863619623 496 * This parameter can be one of the following values:
jhon309 0:ac8863619623 497 * @arg IRDA_CLEAR_PEF: Parity Error Clear Flag
jhon309 0:ac8863619623 498 * @arg IRDA_CLEAR_FEF: Framing Error Clear Flag
jhon309 0:ac8863619623 499 * @arg IRDA_CLEAR_NEF: Noise detected Clear Flag
jhon309 0:ac8863619623 500 * @arg IRDA_CLEAR_OREF: OverRun Error Clear Flag
jhon309 0:ac8863619623 501 * @arg IRDA_CLEAR_TCF: Transmission Complete Clear Flag
jhon309 0:ac8863619623 502 * @retval None
jhon309 0:ac8863619623 503 */
jhon309 0:ac8863619623 504 #define __HAL_IRDA_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))
jhon309 0:ac8863619623 505
jhon309 0:ac8863619623 506
jhon309 0:ac8863619623 507 /** @brief Set a specific IRDA request flag.
jhon309 0:ac8863619623 508 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 509 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 510 * UART peripheral
jhon309 0:ac8863619623 511 * @param __REQ__: specifies the request flag to set
jhon309 0:ac8863619623 512 * This parameter can be one of the following values:
jhon309 0:ac8863619623 513 * @arg IRDA_AUTOBAUD_REQUEST: Auto-Baud Rate Request
jhon309 0:ac8863619623 514 * @arg IRDA_RXDATA_FLUSH_REQUEST: Receive Data flush Request
jhon309 0:ac8863619623 515 * @arg IRDA_TXDATA_FLUSH_REQUEST: Transmit data flush Request
jhon309 0:ac8863619623 516 *
jhon309 0:ac8863619623 517 * @retval None
jhon309 0:ac8863619623 518 */
jhon309 0:ac8863619623 519 #define __HAL_IRDA_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__))
jhon309 0:ac8863619623 520
jhon309 0:ac8863619623 521
jhon309 0:ac8863619623 522
jhon309 0:ac8863619623 523 /** @brief Enable UART/USART associated to IRDA Handle
jhon309 0:ac8863619623 524 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 525 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 526 * UART peripheral
jhon309 0:ac8863619623 527 * @retval None
jhon309 0:ac8863619623 528 */
jhon309 0:ac8863619623 529 #define __HAL_IRDA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
jhon309 0:ac8863619623 530
jhon309 0:ac8863619623 531 /** @brief Disable UART/USART associated to IRDA Handle
jhon309 0:ac8863619623 532 * @param __HANDLE__: specifies the IRDA Handle.
jhon309 0:ac8863619623 533 * The Handle Instance can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
jhon309 0:ac8863619623 534 * UART peripheral
jhon309 0:ac8863619623 535 * @retval None
jhon309 0:ac8863619623 536 */
jhon309 0:ac8863619623 537 #define __HAL_IRDA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
jhon309 0:ac8863619623 538
jhon309 0:ac8863619623 539 /** @brief Ensure that IRDA Baud rate is less or equal to maximum value
jhon309 0:ac8863619623 540 * @param __BAUDRATE__: specifies the IRDA Baudrate set by the user.
jhon309 0:ac8863619623 541 * @retval True or False
jhon309 0:ac8863619623 542 */
jhon309 0:ac8863619623 543 #define IS_IRDA_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 115201)
jhon309 0:ac8863619623 544
jhon309 0:ac8863619623 545 /** @brief Ensure that IRDA prescaler value is strictly larger than 0
jhon309 0:ac8863619623 546 * @param __PRESCALER__: specifies the IRDA prescaler value set by the user.
jhon309 0:ac8863619623 547 * @retval True or False
jhon309 0:ac8863619623 548 */
jhon309 0:ac8863619623 549 #define IS_IRDA_PRESCALER(__PRESCALER__) ((__PRESCALER__) > 0)
jhon309 0:ac8863619623 550
jhon309 0:ac8863619623 551 /**
jhon309 0:ac8863619623 552 * @}
jhon309 0:ac8863619623 553 */
jhon309 0:ac8863619623 554
jhon309 0:ac8863619623 555 /* Include IRDA HAL Extended module */
jhon309 0:ac8863619623 556 #include "stm32f0xx_hal_irda_ex.h"
jhon309 0:ac8863619623 557
jhon309 0:ac8863619623 558 /* Exported functions --------------------------------------------------------*/
jhon309 0:ac8863619623 559
jhon309 0:ac8863619623 560 /** @addtogroup IRDA_Exported_Functions IRDA Exported Functions
jhon309 0:ac8863619623 561 * @{
jhon309 0:ac8863619623 562 */
jhon309 0:ac8863619623 563
jhon309 0:ac8863619623 564 /** @addtogroup IRDA_Exported_Functions_Group1 Initialization and de-initialization functions
jhon309 0:ac8863619623 565 * @{
jhon309 0:ac8863619623 566 */
jhon309 0:ac8863619623 567
jhon309 0:ac8863619623 568 /* Initialization and de-initialization functions ****************************/
jhon309 0:ac8863619623 569 HAL_StatusTypeDef HAL_IRDA_Init(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 570 HAL_StatusTypeDef HAL_IRDA_DeInit(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 571 void HAL_IRDA_MspInit(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 572 void HAL_IRDA_MspDeInit(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 573
jhon309 0:ac8863619623 574 /**
jhon309 0:ac8863619623 575 * @}
jhon309 0:ac8863619623 576 */
jhon309 0:ac8863619623 577
jhon309 0:ac8863619623 578 /** @addtogroup IRDA_Exported_Functions_Group2 IO operation functions
jhon309 0:ac8863619623 579 * @{
jhon309 0:ac8863619623 580 */
jhon309 0:ac8863619623 581
jhon309 0:ac8863619623 582 /* IO operation functions *****************************************************/
jhon309 0:ac8863619623 583 HAL_StatusTypeDef HAL_IRDA_Transmit(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size, uint32_t Timeout);
jhon309 0:ac8863619623 584 HAL_StatusTypeDef HAL_IRDA_Receive(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size, uint32_t Timeout);
jhon309 0:ac8863619623 585 HAL_StatusTypeDef HAL_IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size);
jhon309 0:ac8863619623 586 HAL_StatusTypeDef HAL_IRDA_Receive_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size);
jhon309 0:ac8863619623 587 HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size);
jhon309 0:ac8863619623 588 HAL_StatusTypeDef HAL_IRDA_Receive_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size);
jhon309 0:ac8863619623 589 void HAL_IRDA_IRQHandler(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 590 void HAL_IRDA_TxCpltCallback(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 591 void HAL_IRDA_RxCpltCallback(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 592 void HAL_IRDA_ErrorCallback(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 593
jhon309 0:ac8863619623 594 /**
jhon309 0:ac8863619623 595 * @}
jhon309 0:ac8863619623 596 */
jhon309 0:ac8863619623 597
jhon309 0:ac8863619623 598 /** @addtogroup IRDA_Exported_Functions_Group3
jhon309 0:ac8863619623 599 * @{
jhon309 0:ac8863619623 600 */
jhon309 0:ac8863619623 601
jhon309 0:ac8863619623 602 /* Peripheral State and Error functions ***************************************/
jhon309 0:ac8863619623 603 HAL_IRDA_StateTypeDef HAL_IRDA_GetState(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 604 uint32_t HAL_IRDA_GetError(IRDA_HandleTypeDef *hirda);
jhon309 0:ac8863619623 605
jhon309 0:ac8863619623 606 /**
jhon309 0:ac8863619623 607 * @}
jhon309 0:ac8863619623 608 */
jhon309 0:ac8863619623 609
jhon309 0:ac8863619623 610 /**
jhon309 0:ac8863619623 611 * @}
jhon309 0:ac8863619623 612 */
jhon309 0:ac8863619623 613
jhon309 0:ac8863619623 614 /**
jhon309 0:ac8863619623 615 * @}
jhon309 0:ac8863619623 616 */
jhon309 0:ac8863619623 617
jhon309 0:ac8863619623 618 /**
jhon309 0:ac8863619623 619 * @}
jhon309 0:ac8863619623 620 */
jhon309 0:ac8863619623 621
jhon309 0:ac8863619623 622 #endif /* !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F070x6) && !defined(STM32F070xB) && !defined(STM32F030xC) */
jhon309 0:ac8863619623 623
jhon309 0:ac8863619623 624 #ifdef __cplusplus
jhon309 0:ac8863619623 625 }
jhon309 0:ac8863619623 626 #endif
jhon309 0:ac8863619623 627
jhon309 0:ac8863619623 628 #endif /* __STM32F0xx_HAL_IRDA_H */
jhon309 0:ac8863619623 629
jhon309 0:ac8863619623 630 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
jhon309 0:ac8863619623 631