Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Thu Oct 29 08:40:18 2015 +0000
Revision:
109:9296ab0bfc11
Release 109  of the mbed library

Changes:
- new platforms - NUCLEO_F042K6, WIZNWIKI_W7500ECO
- MTS targets - bootloaders update to 0.1.1
- STM F7 - RTC enable fixes
- STM F4 - i2c pending stop before start fix
- STM all targets - analogout normalization fix

Who changed what in which revision?

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