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