A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.

Dependencies:   C12832

Committer:
tushki7
Date:
Sun Apr 12 15:45:52 2015 +0000
Revision:
1:eb68c94a8ee5
Parent:
0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;

Who changed what in which revision?

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