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:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
116:c0f6e94411f5
.

Who changed what in which revision?

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