2 ******************************************************************************
\r
3 * @file stm32f0xx_cec.c
\r
4 * @author MCD Application Team
\r
6 * @date 27-January-2012
\r
7 * @brief This file provides firmware functions to manage the following
\r
8 * functionalities of the Consumer Electronics Control (CEC) peripheral:
\r
9 * + Initialization and Configuration
\r
10 * + Data transfers functions
\r
11 * + Interrupts and flags management
\r
14 ==============================================================================
\r
15 ##### CEC features #####
\r
16 ==============================================================================
\r
17 [..] This device provides some features:
\r
18 (#) Supports HDMI-CEC specification 1.4.
\r
19 (#) Supports two source clocks(HSI/244 or LSE).
\r
20 (#) Works in stop mode(without APB clock, but with CEC clock 32KHz).
\r
21 It can genarate an interrupt in the CEC clock domain that the CPU
\r
22 wakes up from the low power mode.
\r
23 (#) Configurable Signal Free Time before of transmission start. The
\r
24 number of nominal data bit periods waited before transmission can be
\r
25 ruled by Hardware or Software.
\r
26 (#) Configurable Peripheral Address (multi-addressing configuration).
\r
27 (#) Supports listen mode.The CEC Messages addressed to different destination
\r
28 can be received without interfering with CEC bus when Listen mode option is enabled.
\r
29 (#) Configurable Rx-Tolerance(Standard and Extended tolerance margin).
\r
30 (#) Error detection with configurable error bit generation.
\r
31 (#) Arbitration lost error in the case of two CEC devices starting at the same time.
\r
33 ##### How to use this driver #####
\r
34 ==============================================================================
\r
35 [..] This driver provides functions to configure and program the CEC device,
\r
37 (#) The source clock can be configured using:
\r
38 (++) RCC_CECCLKConfig(RCC_CECCLK_HSI_Div244) for HSI(Default)
\r
39 (++) RCC_CECCLKConfig(RCC_CECCLK_LSE) for LSE.
\r
40 (#) Enable CEC peripheral clock using RCC_APBPeriphClockCmd(RCC_APBPeriph_CEC, ENABLE).
\r
41 (#) Peripherals alternate function.
\r
42 (++) Connect the pin to the desired peripherals' Alternate Function (AF) using
\r
43 GPIO_PinAFConfig() function.
\r
44 (++) Configure the desired pin in alternate function by:
\r
45 GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AF.
\r
46 (++) Select the type open-drain and output speed via GPIO_OType
\r
47 and GPIO_Speed members.
\r
48 (++) Call GPIO_Init() function.
\r
49 (#) Configure the Signal Free Time, Rx Tolerance, Stop reception generation
\r
50 and Bit error generation using the CEC_Init() function.
\r
51 The function CEC_Init() must be called when the CEC peripheral is disabled.
\r
52 (#) Configure the CEC own address by calling the fuction CEC_OwnAddressConfig().
\r
53 (#) Optionally, you can configure the Listen mode using the function CEC_ListenModeCmd().
\r
54 (#) Enable the NVIC and the corresponding interrupt using the function
\r
55 CEC_ITConfig() if you need to use interrupt mode.
\r
56 CEC_ITConfig() must be called before enabling the CEC peripheral.
\r
57 (#) Enable the CEC using the CEC_Cmd() function.
\r
58 (#) Charge the first data byte in the TXDR register using CEC_SendDataByte().
\r
59 (#) Enable the transmission of the Byte of a CEC message using CEC_StartOfMessage()
\r
60 (#) Transmit single data through the CEC peripheral using CEC_SendDataByte()
\r
61 and Receive the last transmitted byte using CEC_ReceiveDataByte().
\r
62 (#) Enable the CEC_EndOfMessage() in order to indicate the last byte of the message.
\r
64 (@) If the listen mode is enabled, Stop reception generation and Bit error generation
\r
65 must be in reset state.
\r
66 (@) If the CEC message consists of only 1 byte, the function CEC_EndOfMessage()
\r
67 must be called before CEC_StartOfMessage().
\r
71 ******************************************************************************
\r
74 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
\r
75 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
\r
76 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
\r
77 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
\r
78 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
\r
79 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
\r
81 * FOR MORE INFORMATION PLEASE READ CAREFULLY THE LICENSE AGREEMENT FILE
\r
82 * LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.
\r
84 * <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
\r
85 ******************************************************************************
\r
88 /* Includes ------------------------------------------------------------------*/
\r
89 #include "stm32f0xx_cec.h"
\r
90 #include "stm32f0xx_rcc.h"
\r
92 /** @addtogroup STM32F0xx_StdPeriph_Driver
\r
97 * @brief CEC driver modules
\r
101 /* Private typedef -----------------------------------------------------------*/
\r
102 /* Private define ------------------------------------------------------------*/
\r
103 #define BROADCAST_ADDRESS ((uint32_t)0x0000F)
\r
104 #define CFGR_CLEAR_MASK ((uint32_t)0x7000FE00) /* CFGR register Mask */
\r
106 /* Private macro -------------------------------------------------------------*/
\r
107 /* Private variables ---------------------------------------------------------*/
\r
108 /* Private function prototypes -----------------------------------------------*/
\r
109 /* Private functions ---------------------------------------------------------*/
\r
111 /** @defgroup CEC_Private_Functions
\r
115 /** @defgroup CEC_Group1 Initialization and Configuration functions
\r
116 * @brief Initialization and Configuration functions
\r
119 ===============================================================================
\r
120 ##### Initialization and Configuration functions #####
\r
121 ===============================================================================
\r
122 [..] This section provides functions allowing to initialize:
\r
123 (+) CEC own addresses
\r
124 (+) CEC Signal Free Time
\r
125 (+) CEC Rx Tolerance
\r
126 (+) CEC Stop Reception
\r
127 (+) CEC Bit Rising Error
\r
128 (+) CEC Long Bit Period Error
\r
129 [..] This section provides also a function to configure the CEC peripheral in Listen Mode.
\r
130 Messages addressed to different destination can be received when Listen mode is
\r
131 enabled without interfering with CEC bus.
\r
137 * @brief Deinitializes the CEC peripheral registers to their default reset values.
\r
141 void CEC_DeInit(void)
\r
143 RCC_APB1PeriphResetCmd(RCC_APB1Periph_CEC, ENABLE);
\r
144 RCC_APB1PeriphResetCmd(RCC_APB1Periph_CEC, DISABLE);
\r
148 * @brief Initializes the CEC peripheral according to the specified parameters
\r
149 * in the CEC_InitStruct.
\r
150 * @note The CEC parameters must be configured before enabling the CEC peripheral.
\r
151 * @param CEC_InitStruct: pointer to an CEC_InitTypeDef structure that contains
\r
152 * the configuration information for the specified CEC peripheral.
\r
155 void CEC_Init(CEC_InitTypeDef* CEC_InitStruct)
\r
157 uint32_t tmpreg = 0;
\r
159 /* Check the parameters */
\r
160 assert_param(IS_CEC_SIGNAL_FREE_TIME(CEC_InitStruct->CEC_SignalFreeTime));
\r
161 assert_param(IS_CEC_RX_TOLERANCE(CEC_InitStruct->CEC_RxTolerance));
\r
162 assert_param(IS_CEC_STOP_RECEPTION(CEC_InitStruct->CEC_StopReception));
\r
163 assert_param(IS_CEC_BIT_RISING_ERROR(CEC_InitStruct->CEC_BitRisingError));
\r
164 assert_param(IS_CEC_LONG_BIT_PERIOD_ERROR(CEC_InitStruct->CEC_LongBitPeriodError));
\r
165 assert_param(IS_CEC_BDR_NO_GEN_ERROR(CEC_InitStruct->CEC_BRDNoGen));
\r
166 assert_param(IS_CEC_SFT_OPTION(CEC_InitStruct->CEC_SFTOption));
\r
168 /* Get the CEC CFGR value */
\r
169 tmpreg = CEC->CFGR;
\r
171 /* Clear CFGR bits */
\r
172 tmpreg &= CFGR_CLEAR_MASK;
\r
174 /* Configure the CEC peripheral */
\r
175 tmpreg |= (CEC_InitStruct->CEC_SignalFreeTime | CEC_InitStruct->CEC_RxTolerance |
\r
176 CEC_InitStruct->CEC_StopReception | CEC_InitStruct->CEC_BitRisingError |
\r
177 CEC_InitStruct->CEC_LongBitPeriodError| CEC_InitStruct->CEC_BRDNoGen |
\r
178 CEC_InitStruct->CEC_SFTOption);
\r
180 /* Write to CEC CFGR register */
\r
181 CEC->CFGR = tmpreg;
\r
185 * @brief Fills each CEC_InitStruct member with its default value.
\r
186 * @param CEC_InitStruct: pointer to a CEC_InitTypeDef structure which will
\r
190 void CEC_StructInit(CEC_InitTypeDef* CEC_InitStruct)
\r
192 CEC_InitStruct->CEC_SignalFreeTime = CEC_SignalFreeTime_Standard;
\r
193 CEC_InitStruct->CEC_RxTolerance = CEC_RxTolerance_Standard;
\r
194 CEC_InitStruct->CEC_StopReception = CEC_StopReception_Off;
\r
195 CEC_InitStruct->CEC_BitRisingError = CEC_BitRisingError_Off;
\r
196 CEC_InitStruct->CEC_LongBitPeriodError = CEC_LongBitPeriodError_Off;
\r
197 CEC_InitStruct->CEC_BRDNoGen = CEC_BRDNoGen_Off;
\r
198 CEC_InitStruct->CEC_SFTOption = CEC_SFTOption_Off;
\r
202 * @brief Enables or disables the CEC peripheral.
\r
203 * @param NewState: new state of the CEC peripheral.
\r
204 * This parameter can be: ENABLE or DISABLE.
\r
207 void CEC_Cmd(FunctionalState NewState)
\r
209 assert_param(IS_FUNCTIONAL_STATE(NewState));
\r
211 if (NewState != DISABLE)
\r
213 /* Enable the CEC peripheral */
\r
214 CEC->CR |= CEC_CR_CECEN;
\r
218 /* Disable the CEC peripheral */
\r
219 CEC->CR &= ~CEC_CR_CECEN;
\r
224 * @brief Enables or disables the CEC Listen Mode.
\r
225 * @param NewState: new state of the Listen Mode.
\r
226 * This parameter can be: ENABLE or DISABLE.
\r
229 void CEC_ListenModeCmd(FunctionalState NewState)
\r
231 assert_param(IS_FUNCTIONAL_STATE(NewState));
\r
233 if (NewState != DISABLE)
\r
235 /* Enable the Listen Mode */
\r
236 CEC->CFGR |= CEC_CFGR_LSTN;
\r
240 /* Disable the Listen Mode */
\r
241 CEC->CFGR &= ~CEC_CFGR_LSTN;
\r
246 * @brief Defines the Own Address of the CEC device.
\r
247 * @param CEC_OwnAddress: The CEC own address.
\r
250 void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress)
\r
252 uint32_t tmp =0x00;
\r
253 /* Check the parameters */
\r
254 assert_param(IS_CEC_ADDRESS(CEC_OwnAddress));
\r
255 tmp = 1 <<(CEC_OwnAddress + 16);
\r
256 /* Set the CEC own address */
\r
261 * @brief Clears the Own Address of the CEC device.
\r
262 * @param CEC_OwnAddress: The CEC own address.
\r
265 void CEC_OwnAddressClear(void)
\r
267 /* Set the CEC own address */
\r
275 /** @defgroup CEC_Group2 Data transfers functions
\r
276 * @brief Data transfers functions
\r
279 ===============================================================================
\r
280 ##### Data transfers functions #####
\r
281 ===============================================================================
\r
282 [..] This section provides functions allowing the CEC data transfers.The read
\r
283 access of the CEC_RXDR register can be done using the CEC_ReceiveData()function
\r
284 and returns the Rx buffered value. Whereas a write access to the CEC_TXDR can be
\r
285 done using CEC_SendData() function.
\r
291 * @brief Transmits single data through the CEC peripheral.
\r
292 * @param Data: the data to transmit.
\r
295 void CEC_SendData(uint8_t Data)
\r
297 /* Transmit Data */
\r
302 * @brief Returns the most recent received data by the CEC peripheral.
\r
304 * @retval The received data.
\r
306 uint8_t CEC_ReceiveData(void)
\r
309 return (uint8_t)(CEC->RXDR);
\r
313 * @brief Starts a new message.
\r
317 void CEC_StartOfMessage(void)
\r
319 /* Starts of new message */
\r
320 CEC->CR |= CEC_CR_TXSOM;
\r
324 * @brief Transmits message with an EOM bit.
\r
328 void CEC_EndOfMessage(void)
\r
330 /* The data byte will be transmitted with an EOM bit */
\r
331 CEC->CR |= CEC_CR_TXEOM;
\r
338 /** @defgroup CEC_Group3 Interrupts and flags management functions
\r
339 * @brief Interrupts and flags management functions
\r
342 ===============================================================================
\r
343 ##### Interrupts and flags management functions #####
\r
344 ===============================================================================
\r
345 [..] This section provides functions allowing to configure the CEC Interrupts
\r
346 sources and check or clear the flags or pending bits status.
\r
347 [..] The user should identify which mode will be used in his application to manage
\r
348 the communication: Polling mode or Interrupt mode.
\r
350 [..] In polling mode, the CEC can be managed by the following flags:
\r
351 (+) CEC_FLAG_TXACKE : to indicate a missing acknowledge in transmission mode.
\r
352 (+) CEC_FLAG_TXERR : to indicate an error occurs during transmission mode.
\r
353 The initiator detects low impedance in the CEC line.
\r
354 (+) CEC_FLAG_TXUDR : to indicate if an underrun error occurs in transmission mode.
\r
355 The transmission is enabled while the software has not yet
\r
356 loaded any value into the TXDR register.
\r
357 (+) CEC_FLAG_TXEND : to indicate the end of successful transmission.
\r
358 (+) CEC_FLAG_TXBR : to indicate the next transmission data has to be written to TXDR.
\r
359 (+) CEC_FLAG_ARBLST : to indicate arbitration lost in the case of two CEC devices
\r
360 starting at the same time.
\r
361 (+) CEC_FLAG_RXACKE : to indicate a missing acknowledge in receive mode.
\r
362 (+) CEC_FLAG_LBPE : to indicate a long bit period error generated during receive mode.
\r
363 (+) CEC_FLAG_SBPE : to indicate a short bit period error generated during receive mode.
\r
364 (+) CEC_FLAG_BRE : to indicate a bit rising error generated during receive mode.
\r
365 (+) CEC_FLAG_RXOVR : to indicate if an overrun error occur while receiving a CEC message.
\r
366 A byte is not yet received while a new byte is stored in the RXDR register.
\r
367 (+) CEC_FLAG_RXEND : to indicate the end Of reception
\r
368 (+) CEC_FLAG_RXBR : to indicate a new byte has been received from the CEC line and
\r
369 stored into the RXDR buffer.
\r
371 (@)In this Mode, it is advised to use the following functions:
\r
372 FlagStatus CEC_GetFlagStatus(uint16_t CEC_FLAG);
\r
373 void CEC_ClearFlag(uint16_t CEC_FLAG);
\r
375 [..] In Interrupt mode, the CEC can be managed by the following interrupt sources:
\r
376 (+) CEC_IT_TXACKE : to indicate a TX Missing acknowledge
\r
377 (+) CEC_IT_TXACKE : to indicate a missing acknowledge in transmission mode.
\r
378 (+) CEC_IT_TXERR : to indicate an error occurs during transmission mode.
\r
379 The initiator detects low impedance in the CEC line.
\r
380 (+) CEC_IT_TXUDR : to indicate if an underrun error occurs in transmission mode.
\r
381 The transmission is enabled while the software has not yet
\r
382 loaded any value into the TXDR register.
\r
383 (+) CEC_IT_TXEND : to indicate the end of successful transmission.
\r
384 (+) CEC_IT_TXBR : to indicate the next transmission data has to be written to TXDR register.
\r
385 (+) CEC_IT_ARBLST : to indicate arbitration lost in the case of two CEC devices
\r
386 starting at the same time.
\r
387 (+) CEC_IT_RXACKE : to indicate a missing acknowledge in receive mode.
\r
388 (+) CEC_IT_LBPE : to indicate a long bit period error generated during receive mode.
\r
389 (+) CEC_IT_SBPE : to indicate a short bit period error generated during receive mode.
\r
390 (+) CEC_IT_BRE : to indicate a bit rising error generated during receive mode.
\r
391 (+) CEC_IT_RXOVR : to indicate if an overrun error occur while receiving a CEC message.
\r
392 A byte is not yet received while a new byte is stored in the RXDR register.
\r
393 (+) CEC_IT_RXEND : to indicate the end Of reception
\r
394 (+) CEC_IT_RXBR : to indicate a new byte has been received from the CEC line and
\r
395 stored into the RXDR buffer.
\r
397 (@)In this Mode it is advised to use the following functions:
\r
398 void CEC_ITConfig( uint16_t CEC_IT, FunctionalState NewState);
\r
399 ITStatus CEC_GetITStatus(uint16_t CEC_IT);
\r
400 void CEC_ClearITPendingBit(uint16_t CEC_IT);
\r
408 * @brief Enables or disables the selected CEC interrupts.
\r
409 * @param CEC_IT: specifies the CEC interrupt source to be enabled.
\r
410 * This parameter can be any combination of the following values:
\r
411 * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error
\r
412 * @arg CEC_IT_TXERR: Tx Error.
\r
413 * @arg CEC_IT_TXUDR: Tx-Buffer Underrun.
\r
414 * @arg CEC_IT_TXEND: End of Transmission (successful transmission of the last byte).
\r
415 * @arg CEC_IT_TXBR: Tx-Byte Request.
\r
416 * @arg CEC_IT_ARBLST: Arbitration Lost
\r
417 * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge
\r
418 * @arg CEC_IT_LBPE: Rx Long period Error
\r
419 * @arg CEC_IT_SBPE: Rx Short period Error
\r
420 * @arg CEC_IT_BRE: Rx Bit Rising Error
\r
421 * @arg CEC_IT_RXOVR: Rx Overrun.
\r
422 * @arg CEC_IT_RXEND: End Of Reception
\r
423 * @arg CEC_IT_RXBR: Rx-Byte Received
\r
424 * @param NewState: new state of the selected CEC interrupts.
\r
425 * This parameter can be: ENABLE or DISABLE.
\r
428 void CEC_ITConfig(uint16_t CEC_IT, FunctionalState NewState)
\r
430 assert_param(IS_FUNCTIONAL_STATE(NewState));
\r
431 assert_param(IS_CEC_IT(CEC_IT));
\r
433 if (NewState != DISABLE)
\r
435 /* Enable the selected CEC interrupt */
\r
436 CEC->IER |= CEC_IT;
\r
441 /* Disable the selected CEC interrupt */
\r
442 CEC->IER &= CEC_IT;
\r
447 * @brief Gets the CEC flag status.
\r
448 * @param CEC_FLAG: specifies the CEC flag to check.
\r
449 * This parameter can be one of the following values:
\r
450 * @arg CEC_FLAG_TXACKE: Tx Missing acknowledge Error
\r
451 * @arg CEC_FLAG_TXERR: Tx Error.
\r
452 * @arg CEC_FLAG_TXUDR: Tx-Buffer Underrun.
\r
453 * @arg CEC_FLAG_TXEND: End of transmission (successful transmission of the last byte).
\r
454 * @arg CEC_FLAG_TXBR: Tx-Byte Request.
\r
455 * @arg CEC_FLAG_ARBLST: Arbitration Lost
\r
456 * @arg CEC_FLAG_RXACKE: Rx-Missing Acknowledge
\r
457 * @arg CEC_FLAG_LBPE: Rx Long period Error
\r
458 * @arg CEC_FLAG_SBPE: Rx Short period Error
\r
459 * @arg CEC_FLAG_BRE: Rx Bit Rissing Error
\r
460 * @arg CEC_FLAG_RXOVR: Rx Overrun.
\r
461 * @arg CEC_FLAG_RXEND: End Of Reception.
\r
462 * @arg CEC_FLAG_RXBR: Rx-Byte Received.
\r
463 * @retval The new state of CEC_FLAG (SET or RESET)
\r
465 FlagStatus CEC_GetFlagStatus(uint16_t CEC_FLAG)
\r
467 FlagStatus bitstatus = RESET;
\r
469 assert_param(IS_CEC_GET_FLAG(CEC_FLAG));
\r
471 /* Check the status of the specified CEC flag */
\r
472 if ((CEC->ISR & CEC_FLAG) != (uint16_t)RESET)
\r
474 /* CEC flag is set */
\r
479 /* CEC flag is reset */
\r
483 /* Return the CEC flag status */
\r
488 * @brief Clears the CEC's pending flags.
\r
489 * @param CEC_FLAG: specifies the flag to clear.
\r
490 * This parameter can be any combination of the following values:
\r
491 * @arg CEC_FLAG_TXACKE: Tx Missing acknowledge Error
\r
492 * @arg CEC_FLAG_TXERR: Tx Error
\r
493 * @arg CEC_FLAG_TXUDR: Tx-Buffer Underrun
\r
494 * @arg CEC_FLAG_TXEND: End of transmission (successful transmission of the last byte).
\r
495 * @arg CEC_FLAG_TXBR: Tx-Byte Request
\r
496 * @arg CEC_FLAG_ARBLST: Arbitration Lost
\r
497 * @arg CEC_FLAG_RXACKE: Rx Missing Acknowledge
\r
498 * @arg CEC_FLAG_LBPE: Rx Long period Error
\r
499 * @arg CEC_FLAG_SBPE: Rx Short period Error
\r
500 * @arg CEC_FLAG_BRE: Rx Bit Rising Error
\r
501 * @arg CEC_FLAG_RXOVR: Rx Overrun
\r
502 * @arg CEC_FLAG_RXEND: End Of Reception
\r
503 * @arg CEC_FLAG_RXBR: Rx-Byte Received
\r
506 void CEC_ClearFlag(uint32_t CEC_FLAG)
\r
508 assert_param(IS_CEC_CLEAR_FLAG(CEC_FLAG));
\r
510 /* Clear the selected CEC flag */
\r
511 CEC->ISR = CEC_FLAG;
\r
515 * @brief Checks whether the specified CEC interrupt has occurred or not.
\r
516 * @param CEC_IT: specifies the CEC interrupt source to check.
\r
517 * This parameter can be one of the following values:
\r
518 * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error
\r
519 * @arg CEC_IT_TXERR: Tx Error.
\r
520 * @arg CEC_IT_TXUDR: Tx-Buffer Underrun.
\r
521 * @arg CEC_IT_TXEND: End of transmission (successful transmission of the last byte).
\r
522 * @arg CEC_IT_TXBR: Tx-Byte Request.
\r
523 * @arg CEC_IT_ARBLST: Arbitration Lost.
\r
524 * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge.
\r
525 * @arg CEC_IT_LBPE: Rx Long period Error.
\r
526 * @arg CEC_IT_SBPE: Rx Short period Error.
\r
527 * @arg CEC_IT_BRE: Rx Bit Rising Error.
\r
528 * @arg CEC_IT_RXOVR: Rx Overrun.
\r
529 * @arg CEC_IT_RXEND: End Of Reception.
\r
530 * @arg CEC_IT_RXBR: Rx-Byte Received
\r
531 * @retval The new state of CEC_IT (SET or RESET).
\r
533 ITStatus CEC_GetITStatus(uint16_t CEC_IT)
\r
535 ITStatus bitstatus = RESET;
\r
536 uint32_t enablestatus = 0;
\r
538 /* Check the parameters */
\r
539 assert_param(IS_CEC_GET_IT(CEC_IT));
\r
541 /* Get the CEC IT enable bit status */
\r
542 enablestatus = (CEC->IER & CEC_IT);
\r
544 /* Check the status of the specified CEC interrupt */
\r
545 if (((CEC->ISR & CEC_IT) != (uint32_t)RESET) && enablestatus)
\r
547 /* CEC interrupt is set */
\r
552 /* CEC interrupt is reset */
\r
556 /* Return the CEC interrupt status */
\r
561 * @brief Clears the CEC's interrupt pending bits.
\r
562 * @param CEC_IT: specifies the CEC interrupt pending bit to clear.
\r
563 * This parameter can be any combination of the following values:
\r
564 * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error
\r
565 * @arg CEC_IT_TXERR: Tx Error
\r
566 * @arg CEC_IT_TXUDR: Tx-Buffer Underrun
\r
567 * @arg CEC_IT_TXEND: End of Transmission
\r
568 * @arg CEC_IT_TXBR: Tx-Byte Request
\r
569 * @arg CEC_IT_ARBLST: Arbitration Lost
\r
570 * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge
\r
571 * @arg CEC_IT_LBPE: Rx Long period Error
\r
572 * @arg CEC_IT_SBPE: Rx Short period Error
\r
573 * @arg CEC_IT_BRE: Rx Bit Rising Error
\r
574 * @arg CEC_IT_RXOVR: Rx Overrun
\r
575 * @arg CEC_IT_RXEND: End Of Reception
\r
576 * @arg CEC_IT_RXBR: Rx-Byte Received
\r
579 void CEC_ClearITPendingBit(uint16_t CEC_IT)
\r
581 assert_param(IS_CEC_IT(CEC_IT));
\r
583 /* Clear the selected CEC interrupt pending bits */
\r
603 /******************* (C) COPYRIGHT 2012 STMicroelectronics *****END OF FILE****/
\r