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