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