Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_NUCLEO_F446RE/stm32f4xx_hal_cec.h@110:165afa46840b, 2015-11-25 (annotated)
- Committer:
- Kojto
- Date:
- Wed Nov 25 13:21:40 2015 +0000
- Revision:
- 110:165afa46840b
- Parent:
- 106:ba1f97679dad
Release 110 of the mbed library
Changes:
- new platforms - STM32F410R, DISCO_F429ZI, DISCO_F469NI
- Nucleo L476 - gcc and uvision template
- k22,k64f targets - ADC channels A addition
- EFM32 - bugfixes in sleep, serial and spi
- Delta DFCM NNN40 - pinnames update
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| Kojto | 106:ba1f97679dad | 1 | /** | 
| Kojto | 106:ba1f97679dad | 2 | ****************************************************************************** | 
| Kojto | 106:ba1f97679dad | 3 | * @file stm32f4xx_hal_cec.h | 
| Kojto | 106:ba1f97679dad | 4 | * @author MCD Application Team | 
| Kojto | 110:165afa46840b | 5 | * @version V1.4.1 | 
| Kojto | 110:165afa46840b | 6 | * @date 09-October-2015 | 
| Kojto | 106:ba1f97679dad | 7 | * @brief Header file of CEC HAL module. | 
| Kojto | 106:ba1f97679dad | 8 | ****************************************************************************** | 
| Kojto | 106:ba1f97679dad | 9 | * @attention | 
| Kojto | 106:ba1f97679dad | 10 | * | 
| Kojto | 106:ba1f97679dad | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> | 
| Kojto | 106:ba1f97679dad | 12 | * | 
| Kojto | 106:ba1f97679dad | 13 | * Redistribution and use in source and binary forms, with or without modification, | 
| Kojto | 106:ba1f97679dad | 14 | * are permitted provided that the following conditions are met: | 
| Kojto | 106:ba1f97679dad | 15 | * 1. Redistributions of source code must retain the above copyright notice, | 
| Kojto | 106:ba1f97679dad | 16 | * this list of conditions and the following disclaimer. | 
| Kojto | 106:ba1f97679dad | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, | 
| Kojto | 106:ba1f97679dad | 18 | * this list of conditions and the following disclaimer in the documentation | 
| Kojto | 106:ba1f97679dad | 19 | * and/or other materials provided with the distribution. | 
| Kojto | 106:ba1f97679dad | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors | 
| Kojto | 106:ba1f97679dad | 21 | * may be used to endorse or promote products derived from this software | 
| Kojto | 106:ba1f97679dad | 22 | * without specific prior written permission. | 
| Kojto | 106:ba1f97679dad | 23 | * | 
| Kojto | 106:ba1f97679dad | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 
| Kojto | 106:ba1f97679dad | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 
| Kojto | 106:ba1f97679dad | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 
| Kojto | 106:ba1f97679dad | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | 
| Kojto | 106:ba1f97679dad | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
| Kojto | 106:ba1f97679dad | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 
| Kojto | 106:ba1f97679dad | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | 
| Kojto | 106:ba1f97679dad | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
| Kojto | 106:ba1f97679dad | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
| Kojto | 106:ba1f97679dad | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| Kojto | 106:ba1f97679dad | 34 | * | 
| Kojto | 106:ba1f97679dad | 35 | ****************************************************************************** | 
| Kojto | 106:ba1f97679dad | 36 | */ | 
| Kojto | 106:ba1f97679dad | 37 | |
| Kojto | 106:ba1f97679dad | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 39 | #ifndef __STM32F4xx_HAL_CEC_H | 
| Kojto | 106:ba1f97679dad | 40 | #define __STM32F4xx_HAL_CEC_H | 
| Kojto | 106:ba1f97679dad | 41 | |
| Kojto | 106:ba1f97679dad | 42 | #ifdef __cplusplus | 
| Kojto | 106:ba1f97679dad | 43 | extern "C" { | 
| Kojto | 106:ba1f97679dad | 44 | #endif | 
| Kojto | 106:ba1f97679dad | 45 | |
| Kojto | 106:ba1f97679dad | 46 | #if defined(STM32F446xx) | 
| Kojto | 106:ba1f97679dad | 47 | /* Includes ------------------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 48 | #include "stm32f4xx_hal_def.h" | 
| Kojto | 106:ba1f97679dad | 49 | |
| Kojto | 106:ba1f97679dad | 50 | /** @addtogroup STM32F4xx_HAL_Driver | 
| Kojto | 106:ba1f97679dad | 51 | * @{ | 
| Kojto | 106:ba1f97679dad | 52 | */ | 
| Kojto | 106:ba1f97679dad | 53 | |
| Kojto | 106:ba1f97679dad | 54 | /** @addtogroup CEC | 
| Kojto | 106:ba1f97679dad | 55 | * @{ | 
| Kojto | 106:ba1f97679dad | 56 | */ | 
| Kojto | 106:ba1f97679dad | 57 | |
| Kojto | 106:ba1f97679dad | 58 | /* Exported types ------------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 59 | /** @defgroup CEC_Exported_Types CEC Exported Types | 
| Kojto | 106:ba1f97679dad | 60 | * @{ | 
| Kojto | 106:ba1f97679dad | 61 | */ | 
| Kojto | 106:ba1f97679dad | 62 | |
| Kojto | 106:ba1f97679dad | 63 | /** | 
| Kojto | 106:ba1f97679dad | 64 | * @brief CEC Init Structure definition | 
| Kojto | 106:ba1f97679dad | 65 | */ | 
| Kojto | 106:ba1f97679dad | 66 | typedef struct | 
| Kojto | 106:ba1f97679dad | 67 | { | 
| Kojto | 106:ba1f97679dad | 68 | uint32_t SignalFreeTime; /*!< Set SFT field, specifies the Signal Free Time. | 
| Kojto | 106:ba1f97679dad | 69 | It can be one of @ref CEC_Signal_Free_Time | 
| Kojto | 106:ba1f97679dad | 70 | and belongs to the set {0,...,7} where | 
| Kojto | 106:ba1f97679dad | 71 | 0x0 is the default configuration | 
| Kojto | 106:ba1f97679dad | 72 | else means 0.5 + (SignalFreeTime - 1) nominal data bit periods */ | 
| Kojto | 106:ba1f97679dad | 73 | |
| Kojto | 106:ba1f97679dad | 74 | uint32_t Tolerance; /*!< Set RXTOL bit, specifies the tolerance accepted on the received waveforms, | 
| Kojto | 106:ba1f97679dad | 75 | it can be a value of @ref CEC_Tolerance : it is either CEC_STANDARD_TOLERANCE | 
| Kojto | 106:ba1f97679dad | 76 | or CEC_EXTENDED_TOLERANCE */ | 
| Kojto | 106:ba1f97679dad | 77 | |
| Kojto | 106:ba1f97679dad | 78 | uint32_t BRERxStop; /*!< Set BRESTP bit @ref CEC_BRERxStop : specifies whether or not a Bit Rising Error stops the reception. | 
| Kojto | 106:ba1f97679dad | 79 | CEC_NO_RX_STOP_ON_BRE: reception is not stopped. | 
| Kojto | 106:ba1f97679dad | 80 | CEC_RX_STOP_ON_BRE: reception is stopped. */ | 
| Kojto | 106:ba1f97679dad | 81 | |
| Kojto | 106:ba1f97679dad | 82 | uint32_t BREErrorBitGen; /*!< Set BREGEN bit @ref CEC_BREErrorBitGen : specifies whether or not an Error-Bit is generated on the | 
| Kojto | 106:ba1f97679dad | 83 | CEC line upon Bit Rising Error detection. | 
| Kojto | 106:ba1f97679dad | 84 | CEC_BRE_ERRORBIT_NO_GENERATION: no error-bit generation. | 
| Kojto | 106:ba1f97679dad | 85 | CEC_BRE_ERRORBIT_GENERATION: error-bit generation if BRESTP is set. */ | 
| Kojto | 106:ba1f97679dad | 86 | |
| Kojto | 106:ba1f97679dad | 87 | uint32_t LBPEErrorBitGen; /*!< Set LBPEGEN bit @ref CEC_LBPEErrorBitGen : specifies whether or not an Error-Bit is generated on the | 
| Kojto | 106:ba1f97679dad | 88 | CEC line upon Long Bit Period Error detection. | 
| Kojto | 106:ba1f97679dad | 89 | CEC_LBPE_ERRORBIT_NO_GENERATION: no error-bit generation. | 
| Kojto | 106:ba1f97679dad | 90 | CEC_LBPE_ERRORBIT_GENERATION: error-bit generation. */ | 
| Kojto | 106:ba1f97679dad | 91 | |
| Kojto | 106:ba1f97679dad | 92 | uint32_t BroadcastMsgNoErrorBitGen; /*!< Set BRDNOGEN bit @ref CEC_BroadCastMsgErrorBitGen : allows to avoid an Error-Bit generation on the CEC line | 
| Kojto | 106:ba1f97679dad | 93 | upon an error detected on a broadcast message. | 
| Kojto | 106:ba1f97679dad | 94 | |
| Kojto | 106:ba1f97679dad | 95 | It supersedes BREGEN and LBPEGEN bits for a broadcast message error handling. It can take two values: | 
| Kojto | 106:ba1f97679dad | 96 | |
| Kojto | 106:ba1f97679dad | 97 | 1) CEC_BROADCASTERROR_ERRORBIT_GENERATION. | 
| Kojto | 106:ba1f97679dad | 98 | a) BRE detection: error-bit generation on the CEC line if BRESTP=CEC_RX_STOP_ON_BRE | 
| Kojto | 106:ba1f97679dad | 99 | and BREGEN=CEC_BRE_ERRORBIT_NO_GENERATION. | 
| Kojto | 106:ba1f97679dad | 100 | b) LBPE detection: error-bit generation on the CEC line | 
| Kojto | 106:ba1f97679dad | 101 | if LBPGEN=CEC_LBPE_ERRORBIT_NO_GENERATION. | 
| Kojto | 106:ba1f97679dad | 102 | |
| Kojto | 106:ba1f97679dad | 103 | 2) CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION. | 
| Kojto | 106:ba1f97679dad | 104 | no error-bit generation in case neither a) nor b) are satisfied. Additionally, | 
| Kojto | 106:ba1f97679dad | 105 | there is no error-bit generation in case of Short Bit Period Error detection in | 
| Kojto | 106:ba1f97679dad | 106 | a broadcast message while LSTN bit is set. */ | 
| Kojto | 106:ba1f97679dad | 107 | |
| Kojto | 106:ba1f97679dad | 108 | uint32_t SignalFreeTimeOption; /*!< Set SFTOP bit @ref CEC_SFT_Option : specifies when SFT timer starts. | 
| Kojto | 106:ba1f97679dad | 109 | CEC_SFT_START_ON_TXSOM SFT: timer starts when TXSOM is set by software. | 
| Kojto | 106:ba1f97679dad | 110 | CEC_SFT_START_ON_TX_RX_END: SFT timer starts automatically at the end of message transmission/reception. */ | 
| Kojto | 106:ba1f97679dad | 111 | |
| Kojto | 106:ba1f97679dad | 112 | uint32_t OwnAddress; /*!< Set OAR field, specifies CEC device address within a 15-bit long field */ | 
| Kojto | 106:ba1f97679dad | 113 | |
| Kojto | 106:ba1f97679dad | 114 | uint32_t ListenMode; /*!< Set LSTN bit @ref CEC_Listening_Mode : specifies device listening mode. It can take two values: | 
| Kojto | 106:ba1f97679dad | 115 | |
| Kojto | 106:ba1f97679dad | 116 | CEC_REDUCED_LISTENING_MODE: CEC peripheral receives only message addressed to its | 
| Kojto | 106:ba1f97679dad | 117 | own address (OAR). Messages addressed to different destination are ignored. | 
| Kojto | 106:ba1f97679dad | 118 | Broadcast messages are always received. | 
| Kojto | 106:ba1f97679dad | 119 | |
| Kojto | 106:ba1f97679dad | 120 | CEC_FULL_LISTENING_MODE: CEC peripheral receives messages addressed to its own | 
| Kojto | 106:ba1f97679dad | 121 | address (OAR) with positive acknowledge. Messages addressed to different destination | 
| Kojto | 106:ba1f97679dad | 122 | are received, but without interfering with the CEC bus: no acknowledge sent. */ | 
| Kojto | 106:ba1f97679dad | 123 | |
| Kojto | 106:ba1f97679dad | 124 | uint8_t InitiatorAddress; /* Initiator address (source logical address, sent in each header) */ | 
| Kojto | 106:ba1f97679dad | 125 | |
| Kojto | 106:ba1f97679dad | 126 | }CEC_InitTypeDef; | 
| Kojto | 106:ba1f97679dad | 127 | |
| Kojto | 106:ba1f97679dad | 128 | /** | 
| Kojto | 106:ba1f97679dad | 129 | * @brief HAL CEC State structures definition | 
| Kojto | 106:ba1f97679dad | 130 | */ | 
| Kojto | 106:ba1f97679dad | 131 | typedef enum | 
| Kojto | 106:ba1f97679dad | 132 | { | 
| Kojto | 106:ba1f97679dad | 133 | HAL_CEC_STATE_RESET = 0x00, /*!< Peripheral Reset state */ | 
| Kojto | 106:ba1f97679dad | 134 | HAL_CEC_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */ | 
| Kojto | 106:ba1f97679dad | 135 | HAL_CEC_STATE_BUSY = 0x02, /*!< an internal process is ongoing */ | 
| Kojto | 106:ba1f97679dad | 136 | HAL_CEC_STATE_BUSY_TX = 0x03, /*!< Data Transmission process is ongoing */ | 
| Kojto | 106:ba1f97679dad | 137 | HAL_CEC_STATE_BUSY_RX = 0x04, /*!< Data Reception process is ongoing */ | 
| Kojto | 106:ba1f97679dad | 138 | HAL_CEC_STATE_STANDBY_RX = 0x05, /*!< IP ready to receive, doesn't prevent IP to transmit */ | 
| Kojto | 106:ba1f97679dad | 139 | HAL_CEC_STATE_TIMEOUT = 0x06, /*!< Timeout state */ | 
| Kojto | 106:ba1f97679dad | 140 | HAL_CEC_STATE_ERROR = 0x07 /*!< State Error */ | 
| Kojto | 106:ba1f97679dad | 141 | }HAL_CEC_StateTypeDef; | 
| Kojto | 106:ba1f97679dad | 142 | |
| Kojto | 106:ba1f97679dad | 143 | /** | 
| Kojto | 106:ba1f97679dad | 144 | * @brief CEC handle Structure definition | 
| Kojto | 106:ba1f97679dad | 145 | */ | 
| Kojto | 106:ba1f97679dad | 146 | typedef struct | 
| Kojto | 106:ba1f97679dad | 147 | { | 
| Kojto | 106:ba1f97679dad | 148 | CEC_TypeDef *Instance; /* CEC registers base address */ | 
| Kojto | 106:ba1f97679dad | 149 | |
| Kojto | 106:ba1f97679dad | 150 | CEC_InitTypeDef Init; /* CEC communication parameters */ | 
| Kojto | 106:ba1f97679dad | 151 | |
| Kojto | 106:ba1f97679dad | 152 | uint8_t *pTxBuffPtr; /* Pointer to CEC Tx transfer Buffer */ | 
| Kojto | 106:ba1f97679dad | 153 | |
| Kojto | 106:ba1f97679dad | 154 | uint16_t TxXferCount; /* CEC Tx Transfer Counter */ | 
| Kojto | 106:ba1f97679dad | 155 | |
| Kojto | 106:ba1f97679dad | 156 | uint8_t *pRxBuffPtr; /* Pointer to CEC Rx transfer Buffer */ | 
| Kojto | 106:ba1f97679dad | 157 | |
| Kojto | 106:ba1f97679dad | 158 | uint16_t RxXferSize; /* CEC Rx Transfer size, 0: header received only */ | 
| Kojto | 106:ba1f97679dad | 159 | |
| Kojto | 106:ba1f97679dad | 160 | uint32_t ErrorCode; /* For errors handling purposes, copy of ISR register | 
| Kojto | 106:ba1f97679dad | 161 | in case error is reported */ | 
| Kojto | 106:ba1f97679dad | 162 | |
| Kojto | 106:ba1f97679dad | 163 | HAL_LockTypeDef Lock; /* Locking object */ | 
| Kojto | 106:ba1f97679dad | 164 | |
| Kojto | 106:ba1f97679dad | 165 | HAL_CEC_StateTypeDef State; /* CEC communication state */ | 
| Kojto | 106:ba1f97679dad | 166 | |
| Kojto | 106:ba1f97679dad | 167 | }CEC_HandleTypeDef; | 
| Kojto | 106:ba1f97679dad | 168 | /** | 
| Kojto | 106:ba1f97679dad | 169 | * @} | 
| Kojto | 106:ba1f97679dad | 170 | */ | 
| Kojto | 106:ba1f97679dad | 171 | |
| Kojto | 106:ba1f97679dad | 172 | /* Exported constants --------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 173 | /** @defgroup CEC_Exported_Constants CEC Exported Constants | 
| Kojto | 106:ba1f97679dad | 174 | * @{ | 
| Kojto | 106:ba1f97679dad | 175 | */ | 
| Kojto | 106:ba1f97679dad | 176 | |
| Kojto | 106:ba1f97679dad | 177 | /** @defgroup CEC_Error_Code CEC Error Code | 
| Kojto | 106:ba1f97679dad | 178 | * @{ | 
| Kojto | 106:ba1f97679dad | 179 | */ | 
| Kojto | 106:ba1f97679dad | 180 | #define HAL_CEC_ERROR_NONE (uint32_t) 0x0 /*!< no error */ | 
| Kojto | 106:ba1f97679dad | 181 | #define HAL_CEC_ERROR_RXOVR CEC_ISR_RXOVR /*!< CEC Rx-Overrun */ | 
| Kojto | 106:ba1f97679dad | 182 | #define HAL_CEC_ERROR_BRE CEC_ISR_BRE /*!< CEC Rx Bit Rising Error */ | 
| Kojto | 106:ba1f97679dad | 183 | #define HAL_CEC_ERROR_SBPE CEC_ISR_SBPE /*!< CEC Rx Short Bit period Error */ | 
| Kojto | 106:ba1f97679dad | 184 | #define HAL_CEC_ERROR_LBPE CEC_ISR_LBPE /*!< CEC Rx Long Bit period Error */ | 
| Kojto | 106:ba1f97679dad | 185 | #define HAL_CEC_ERROR_RXACKE CEC_ISR_RXACKE /*!< CEC Rx Missing Acknowledge */ | 
| Kojto | 106:ba1f97679dad | 186 | #define HAL_CEC_ERROR_ARBLST CEC_ISR_ARBLST /*!< CEC Arbitration Lost */ | 
| Kojto | 106:ba1f97679dad | 187 | #define HAL_CEC_ERROR_TXUDR CEC_ISR_TXUDR /*!< CEC Tx-Buffer Underrun */ | 
| Kojto | 106:ba1f97679dad | 188 | #define HAL_CEC_ERROR_TXERR CEC_ISR_TXERR /*!< CEC Tx-Error */ | 
| Kojto | 106:ba1f97679dad | 189 | #define HAL_CEC_ERROR_TXACKE CEC_ISR_TXACKE /*!< CEC Tx Missing Acknowledge */ | 
| Kojto | 106:ba1f97679dad | 190 | /** | 
| Kojto | 106:ba1f97679dad | 191 | * @} | 
| Kojto | 106:ba1f97679dad | 192 | */ | 
| Kojto | 106:ba1f97679dad | 193 | |
| Kojto | 106:ba1f97679dad | 194 | /** @defgroup CEC_Signal_Free_Time CEC Signal Free Time setting parameter | 
| Kojto | 106:ba1f97679dad | 195 | * @{ | 
| Kojto | 106:ba1f97679dad | 196 | */ | 
| Kojto | 106:ba1f97679dad | 197 | #define CEC_DEFAULT_SFT ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 198 | #define CEC_0_5_BITPERIOD_SFT ((uint32_t)0x00000001) | 
| Kojto | 106:ba1f97679dad | 199 | #define CEC_1_5_BITPERIOD_SFT ((uint32_t)0x00000002) | 
| Kojto | 106:ba1f97679dad | 200 | #define CEC_2_5_BITPERIOD_SFT ((uint32_t)0x00000003) | 
| Kojto | 106:ba1f97679dad | 201 | #define CEC_3_5_BITPERIOD_SFT ((uint32_t)0x00000004) | 
| Kojto | 106:ba1f97679dad | 202 | #define CEC_4_5_BITPERIOD_SFT ((uint32_t)0x00000005) | 
| Kojto | 106:ba1f97679dad | 203 | #define CEC_5_5_BITPERIOD_SFT ((uint32_t)0x00000006) | 
| Kojto | 106:ba1f97679dad | 204 | #define CEC_6_5_BITPERIOD_SFT ((uint32_t)0x00000007) | 
| Kojto | 106:ba1f97679dad | 205 | /** | 
| Kojto | 106:ba1f97679dad | 206 | * @} | 
| Kojto | 106:ba1f97679dad | 207 | */ | 
| Kojto | 106:ba1f97679dad | 208 | |
| Kojto | 106:ba1f97679dad | 209 | /** @defgroup CEC_Tolerance CEC Receiver Tolerance | 
| Kojto | 106:ba1f97679dad | 210 | * @{ | 
| Kojto | 106:ba1f97679dad | 211 | */ | 
| Kojto | 106:ba1f97679dad | 212 | #define CEC_STANDARD_TOLERANCE ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 213 | #define CEC_EXTENDED_TOLERANCE ((uint32_t)CEC_CFGR_RXTOL) | 
| Kojto | 106:ba1f97679dad | 214 | /** | 
| Kojto | 106:ba1f97679dad | 215 | * @} | 
| Kojto | 106:ba1f97679dad | 216 | */ | 
| Kojto | 106:ba1f97679dad | 217 | |
| Kojto | 106:ba1f97679dad | 218 | /** @defgroup CEC_BRERxStop CEC Reception Stop on Error | 
| Kojto | 106:ba1f97679dad | 219 | * @{ | 
| Kojto | 106:ba1f97679dad | 220 | */ | 
| Kojto | 106:ba1f97679dad | 221 | #define CEC_NO_RX_STOP_ON_BRE ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 222 | #define CEC_RX_STOP_ON_BRE ((uint32_t)CEC_CFGR_BRESTP) | 
| Kojto | 106:ba1f97679dad | 223 | /** | 
| Kojto | 106:ba1f97679dad | 224 | * @} | 
| Kojto | 106:ba1f97679dad | 225 | */ | 
| Kojto | 106:ba1f97679dad | 226 | |
| Kojto | 106:ba1f97679dad | 227 | /** @defgroup CEC_BREErrorBitGen CEC Error Bit Generation if Bit Rise Error reported | 
| Kojto | 106:ba1f97679dad | 228 | * @{ | 
| Kojto | 106:ba1f97679dad | 229 | */ | 
| Kojto | 106:ba1f97679dad | 230 | #define CEC_BRE_ERRORBIT_NO_GENERATION ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 231 | #define CEC_BRE_ERRORBIT_GENERATION ((uint32_t)CEC_CFGR_BREGEN) | 
| Kojto | 106:ba1f97679dad | 232 | /** | 
| Kojto | 106:ba1f97679dad | 233 | * @} | 
| Kojto | 106:ba1f97679dad | 234 | */ | 
| Kojto | 106:ba1f97679dad | 235 | |
| Kojto | 106:ba1f97679dad | 236 | /** @defgroup CEC_LBPEErrorBitGen CEC Error Bit Generation if Long Bit Period Error reported | 
| Kojto | 106:ba1f97679dad | 237 | * @{ | 
| Kojto | 106:ba1f97679dad | 238 | */ | 
| Kojto | 106:ba1f97679dad | 239 | #define CEC_LBPE_ERRORBIT_NO_GENERATION ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 240 | #define CEC_LBPE_ERRORBIT_GENERATION ((uint32_t)CEC_CFGR_LBPEGEN) | 
| Kojto | 106:ba1f97679dad | 241 | /** | 
| Kojto | 106:ba1f97679dad | 242 | * @} | 
| Kojto | 106:ba1f97679dad | 243 | */ | 
| Kojto | 106:ba1f97679dad | 244 | |
| Kojto | 106:ba1f97679dad | 245 | /** @defgroup CEC_BroadCastMsgErrorBitGen CEC Error Bit Generation on Broadcast message | 
| Kojto | 106:ba1f97679dad | 246 | * @{ | 
| Kojto | 106:ba1f97679dad | 247 | */ | 
| Kojto | 106:ba1f97679dad | 248 | #define CEC_BROADCASTERROR_ERRORBIT_GENERATION ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 249 | #define CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION ((uint32_t)CEC_CFGR_BRDNOGEN) | 
| Kojto | 106:ba1f97679dad | 250 | /** | 
| Kojto | 106:ba1f97679dad | 251 | * @} | 
| Kojto | 106:ba1f97679dad | 252 | */ | 
| Kojto | 106:ba1f97679dad | 253 | |
| Kojto | 106:ba1f97679dad | 254 | /** @defgroup CEC_SFT_Option CEC Signal Free Time start option | 
| Kojto | 106:ba1f97679dad | 255 | * @{ | 
| Kojto | 106:ba1f97679dad | 256 | */ | 
| Kojto | 106:ba1f97679dad | 257 | #define CEC_SFT_START_ON_TXSOM ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 258 | #define CEC_SFT_START_ON_TX_RX_END ((uint32_t)CEC_CFGR_SFTOPT) | 
| Kojto | 106:ba1f97679dad | 259 | /** | 
| Kojto | 106:ba1f97679dad | 260 | * @} | 
| Kojto | 106:ba1f97679dad | 261 | */ | 
| Kojto | 106:ba1f97679dad | 262 | |
| Kojto | 106:ba1f97679dad | 263 | /** @defgroup CEC_Listening_Mode CEC Listening mode option | 
| Kojto | 106:ba1f97679dad | 264 | * @{ | 
| Kojto | 106:ba1f97679dad | 265 | */ | 
| Kojto | 106:ba1f97679dad | 266 | #define CEC_REDUCED_LISTENING_MODE ((uint32_t)0x00000000) | 
| Kojto | 106:ba1f97679dad | 267 | #define CEC_FULL_LISTENING_MODE ((uint32_t)CEC_CFGR_LSTN) | 
| Kojto | 106:ba1f97679dad | 268 | /** | 
| Kojto | 106:ba1f97679dad | 269 | * @} | 
| Kojto | 106:ba1f97679dad | 270 | */ | 
| Kojto | 106:ba1f97679dad | 271 | |
| Kojto | 106:ba1f97679dad | 272 | /** @defgroup CEC_OAR_Position CEC Device Own Address position in CEC CFGR register | 
| Kojto | 106:ba1f97679dad | 273 | * @{ | 
| Kojto | 106:ba1f97679dad | 274 | */ | 
| Kojto | 106:ba1f97679dad | 275 | #define CEC_CFGR_OAR_LSB_POS ((uint32_t) 16) | 
| Kojto | 106:ba1f97679dad | 276 | /** | 
| Kojto | 106:ba1f97679dad | 277 | * @} | 
| Kojto | 106:ba1f97679dad | 278 | */ | 
| Kojto | 106:ba1f97679dad | 279 | |
| Kojto | 106:ba1f97679dad | 280 | /** @defgroup CEC_Initiator_Position CEC Initiator logical address position in message header | 
| Kojto | 106:ba1f97679dad | 281 | * @{ | 
| Kojto | 106:ba1f97679dad | 282 | */ | 
| Kojto | 106:ba1f97679dad | 283 | #define CEC_INITIATOR_LSB_POS ((uint32_t) 4) | 
| Kojto | 106:ba1f97679dad | 284 | /** | 
| Kojto | 106:ba1f97679dad | 285 | * @} | 
| Kojto | 106:ba1f97679dad | 286 | */ | 
| Kojto | 106:ba1f97679dad | 287 | |
| Kojto | 106:ba1f97679dad | 288 | /** @defgroup CEC_Interrupts_Definitions CEC Interrupts definition | 
| Kojto | 106:ba1f97679dad | 289 | * @{ | 
| Kojto | 106:ba1f97679dad | 290 | */ | 
| Kojto | 106:ba1f97679dad | 291 | #define CEC_IT_TXACKE CEC_IER_TXACKEIE | 
| Kojto | 106:ba1f97679dad | 292 | #define CEC_IT_TXERR CEC_IER_TXERRIE | 
| Kojto | 106:ba1f97679dad | 293 | #define CEC_IT_TXUDR CEC_IER_TXUDRIE | 
| Kojto | 106:ba1f97679dad | 294 | #define CEC_IT_TXEND CEC_IER_TXENDIE | 
| Kojto | 106:ba1f97679dad | 295 | #define CEC_IT_TXBR CEC_IER_TXBRIE | 
| Kojto | 106:ba1f97679dad | 296 | #define CEC_IT_ARBLST CEC_IER_ARBLSTIE | 
| Kojto | 106:ba1f97679dad | 297 | #define CEC_IT_RXACKE CEC_IER_RXACKEIE | 
| Kojto | 106:ba1f97679dad | 298 | #define CEC_IT_LBPE CEC_IER_LBPEIE | 
| Kojto | 106:ba1f97679dad | 299 | #define CEC_IT_SBPE CEC_IER_SBPEIE | 
| Kojto | 106:ba1f97679dad | 300 | #define CEC_IT_BRE CEC_IER_BREIE | 
| Kojto | 106:ba1f97679dad | 301 | #define CEC_IT_RXOVR CEC_IER_RXOVRIE | 
| Kojto | 106:ba1f97679dad | 302 | #define CEC_IT_RXEND CEC_IER_RXENDIE | 
| Kojto | 106:ba1f97679dad | 303 | #define CEC_IT_RXBR CEC_IER_RXBRIE | 
| Kojto | 106:ba1f97679dad | 304 | /** | 
| Kojto | 106:ba1f97679dad | 305 | * @} | 
| Kojto | 106:ba1f97679dad | 306 | */ | 
| Kojto | 106:ba1f97679dad | 307 | |
| Kojto | 106:ba1f97679dad | 308 | /** @defgroup CEC_Flags_Definitions CEC Flags definition | 
| Kojto | 106:ba1f97679dad | 309 | * @{ | 
| Kojto | 106:ba1f97679dad | 310 | */ | 
| Kojto | 106:ba1f97679dad | 311 | #define CEC_FLAG_TXACKE CEC_ISR_TXACKE | 
| Kojto | 106:ba1f97679dad | 312 | #define CEC_FLAG_TXERR CEC_ISR_TXERR | 
| Kojto | 106:ba1f97679dad | 313 | #define CEC_FLAG_TXUDR CEC_ISR_TXUDR | 
| Kojto | 106:ba1f97679dad | 314 | #define CEC_FLAG_TXEND CEC_ISR_TXEND | 
| Kojto | 106:ba1f97679dad | 315 | #define CEC_FLAG_TXBR CEC_ISR_TXBR | 
| Kojto | 106:ba1f97679dad | 316 | #define CEC_FLAG_ARBLST CEC_ISR_ARBLST | 
| Kojto | 106:ba1f97679dad | 317 | #define CEC_FLAG_RXACKE CEC_ISR_RXACKE | 
| Kojto | 106:ba1f97679dad | 318 | #define CEC_FLAG_LBPE CEC_ISR_LBPE | 
| Kojto | 106:ba1f97679dad | 319 | #define CEC_FLAG_SBPE CEC_ISR_SBPE | 
| Kojto | 106:ba1f97679dad | 320 | #define CEC_FLAG_BRE CEC_ISR_BRE | 
| Kojto | 106:ba1f97679dad | 321 | #define CEC_FLAG_RXOVR CEC_ISR_RXOVR | 
| Kojto | 106:ba1f97679dad | 322 | #define CEC_FLAG_RXEND CEC_ISR_RXEND | 
| Kojto | 106:ba1f97679dad | 323 | #define CEC_FLAG_RXBR CEC_ISR_RXBR | 
| Kojto | 106:ba1f97679dad | 324 | /** | 
| Kojto | 106:ba1f97679dad | 325 | * @} | 
| Kojto | 106:ba1f97679dad | 326 | */ | 
| Kojto | 106:ba1f97679dad | 327 | |
| Kojto | 106:ba1f97679dad | 328 | /** @defgroup CEC_ALL_ERROR CEC all RX or TX errors flags | 
| Kojto | 106:ba1f97679dad | 329 | * @{ | 
| Kojto | 106:ba1f97679dad | 330 | */ | 
| Kojto | 106:ba1f97679dad | 331 | #define CEC_ISR_ALL_ERROR ((uint32_t)CEC_ISR_RXOVR|CEC_ISR_BRE|CEC_ISR_SBPE|CEC_ISR_LBPE|CEC_ISR_RXACKE|\ | 
| Kojto | 106:ba1f97679dad | 332 | CEC_ISR_ARBLST|CEC_ISR_TXUDR|CEC_ISR_TXERR|CEC_ISR_TXACKE) | 
| Kojto | 106:ba1f97679dad | 333 | /** | 
| Kojto | 106:ba1f97679dad | 334 | * @} | 
| Kojto | 106:ba1f97679dad | 335 | */ | 
| Kojto | 106:ba1f97679dad | 336 | |
| Kojto | 106:ba1f97679dad | 337 | /** @defgroup CEC_IER_ALL_RX CEC all RX errors interrupts enabling flag | 
| Kojto | 106:ba1f97679dad | 338 | * @{ | 
| Kojto | 106:ba1f97679dad | 339 | */ | 
| Kojto | 106:ba1f97679dad | 340 | #define CEC_IER_RX_ALL_ERR ((uint32_t)CEC_IER_RXACKEIE|CEC_IER_LBPEIE|CEC_IER_SBPEIE|CEC_IER_BREIE|CEC_IER_RXOVRIE) | 
| Kojto | 106:ba1f97679dad | 341 | /** | 
| Kojto | 106:ba1f97679dad | 342 | * @} | 
| Kojto | 106:ba1f97679dad | 343 | */ | 
| Kojto | 106:ba1f97679dad | 344 | |
| Kojto | 106:ba1f97679dad | 345 | /** @defgroup CEC_IER_ALL_TX CEC all TX errors interrupts enabling flag | 
| Kojto | 106:ba1f97679dad | 346 | * @{ | 
| Kojto | 106:ba1f97679dad | 347 | */ | 
| Kojto | 106:ba1f97679dad | 348 | #define CEC_IER_TX_ALL_ERR ((uint32_t)CEC_IER_TXACKEIE|CEC_IER_TXERRIE|CEC_IER_TXUDRIE|CEC_IER_ARBLSTIE) | 
| Kojto | 106:ba1f97679dad | 349 | /** | 
| Kojto | 106:ba1f97679dad | 350 | * @} | 
| Kojto | 106:ba1f97679dad | 351 | */ | 
| Kojto | 106:ba1f97679dad | 352 | |
| Kojto | 106:ba1f97679dad | 353 | /** | 
| Kojto | 106:ba1f97679dad | 354 | * @} | 
| Kojto | 106:ba1f97679dad | 355 | */ | 
| Kojto | 106:ba1f97679dad | 356 | |
| Kojto | 106:ba1f97679dad | 357 | /* Exported macros -----------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 358 | /** @defgroup CEC_Exported_Macros CEC Exported Macros | 
| Kojto | 106:ba1f97679dad | 359 | * @{ | 
| Kojto | 106:ba1f97679dad | 360 | */ | 
| Kojto | 106:ba1f97679dad | 361 | |
| Kojto | 106:ba1f97679dad | 362 | /** @brief Reset CEC handle state | 
| Kojto | 106:ba1f97679dad | 363 | * @param __HANDLE__: CEC handle. | 
| Kojto | 106:ba1f97679dad | 364 | * @retval None | 
| Kojto | 106:ba1f97679dad | 365 | */ | 
| Kojto | 106:ba1f97679dad | 366 | #define __HAL_CEC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CEC_STATE_RESET) | 
| Kojto | 106:ba1f97679dad | 367 | |
| Kojto | 106:ba1f97679dad | 368 | /** @brief Checks whether or not the specified CEC interrupt flag is set. | 
| Kojto | 106:ba1f97679dad | 369 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 370 | * @param __FLAG__: specifies the interrupt to check. | 
| Kojto | 106:ba1f97679dad | 371 | * @arg CEC_FLAG_TXACKE: Tx Missing acknowledge Error | 
| Kojto | 106:ba1f97679dad | 372 | * @arg CEC_FLAG_TXERR: Tx Error. | 
| Kojto | 106:ba1f97679dad | 373 | * @arg CEC_FLAG_TXUDR: Tx-Buffer Underrun. | 
| Kojto | 106:ba1f97679dad | 374 | * @arg CEC_FLAG_TXEND: End of transmission (successful transmission of the last byte). | 
| Kojto | 106:ba1f97679dad | 375 | * @arg CEC_FLAG_TXBR: Tx-Byte Request. | 
| Kojto | 106:ba1f97679dad | 376 | * @arg CEC_FLAG_ARBLST: Arbitration Lost | 
| Kojto | 106:ba1f97679dad | 377 | * @arg CEC_FLAG_RXACKE: Rx-Missing Acknowledge | 
| Kojto | 106:ba1f97679dad | 378 | * @arg CEC_FLAG_LBPE: Rx Long period Error | 
| Kojto | 106:ba1f97679dad | 379 | * @arg CEC_FLAG_SBPE: Rx Short period Error | 
| Kojto | 106:ba1f97679dad | 380 | * @arg CEC_FLAG_BRE: Rx Bit Rissing Error | 
| Kojto | 106:ba1f97679dad | 381 | * @arg CEC_FLAG_RXOVR: Rx Overrun. | 
| Kojto | 106:ba1f97679dad | 382 | * @arg CEC_FLAG_RXEND: End Of Reception. | 
| Kojto | 106:ba1f97679dad | 383 | * @arg CEC_FLAG_RXBR: Rx-Byte Received. | 
| Kojto | 106:ba1f97679dad | 384 | * @retval ITStatus | 
| Kojto | 106:ba1f97679dad | 385 | */ | 
| Kojto | 106:ba1f97679dad | 386 | #define __HAL_CEC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__)) | 
| Kojto | 106:ba1f97679dad | 387 | |
| Kojto | 106:ba1f97679dad | 388 | /** @brief Clears the interrupt or status flag when raised (write at 1) | 
| Kojto | 106:ba1f97679dad | 389 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 390 | * @param __FLAG__: specifies the interrupt/status flag to clear. | 
| Kojto | 106:ba1f97679dad | 391 | * This parameter can be one of the following values: | 
| Kojto | 106:ba1f97679dad | 392 | * @arg CEC_FLAG_TXACKE: Tx Missing acknowledge Error | 
| Kojto | 106:ba1f97679dad | 393 | * @arg CEC_FLAG_TXERR: Tx Error. | 
| Kojto | 106:ba1f97679dad | 394 | * @arg CEC_FLAG_TXUDR: Tx-Buffer Underrun. | 
| Kojto | 106:ba1f97679dad | 395 | * @arg CEC_FLAG_TXEND: End of transmission (successful transmission of the last byte). | 
| Kojto | 106:ba1f97679dad | 396 | * @arg CEC_FLAG_TXBR: Tx-Byte Request. | 
| Kojto | 106:ba1f97679dad | 397 | * @arg CEC_FLAG_ARBLST: Arbitration Lost | 
| Kojto | 106:ba1f97679dad | 398 | * @arg CEC_FLAG_RXACKE: Rx-Missing Acknowledge | 
| Kojto | 106:ba1f97679dad | 399 | * @arg CEC_FLAG_LBPE: Rx Long period Error | 
| Kojto | 106:ba1f97679dad | 400 | * @arg CEC_FLAG_SBPE: Rx Short period Error | 
| Kojto | 106:ba1f97679dad | 401 | * @arg CEC_FLAG_BRE: Rx Bit Rissing Error | 
| Kojto | 106:ba1f97679dad | 402 | * @arg CEC_FLAG_RXOVR: Rx Overrun. | 
| Kojto | 106:ba1f97679dad | 403 | * @arg CEC_FLAG_RXEND: End Of Reception. | 
| Kojto | 106:ba1f97679dad | 404 | * @arg CEC_FLAG_RXBR: Rx-Byte Received. | 
| Kojto | 106:ba1f97679dad | 405 | * @retval none | 
| Kojto | 106:ba1f97679dad | 406 | */ | 
| Kojto | 106:ba1f97679dad | 407 | #define __HAL_CEC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR |= (__FLAG__)) | 
| Kojto | 106:ba1f97679dad | 408 | |
| Kojto | 106:ba1f97679dad | 409 | /** @brief Enables the specified CEC interrupt. | 
| Kojto | 106:ba1f97679dad | 410 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 411 | * @param __INTERRUPT__: specifies the CEC interrupt to enable. | 
| Kojto | 106:ba1f97679dad | 412 | * This parameter can be one of the following values: | 
| Kojto | 106:ba1f97679dad | 413 | * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error IT Enable | 
| Kojto | 106:ba1f97679dad | 414 | * @arg CEC_IT_TXERR: Tx Error IT Enable | 
| Kojto | 106:ba1f97679dad | 415 | * @arg CEC_IT_TXUDR: Tx-Buffer Underrun IT Enable | 
| Kojto | 106:ba1f97679dad | 416 | * @arg CEC_IT_TXEND: End of transmission IT Enable | 
| Kojto | 106:ba1f97679dad | 417 | * @arg CEC_IT_TXBR: Tx-Byte Request IT Enable | 
| Kojto | 106:ba1f97679dad | 418 | * @arg CEC_IT_ARBLST: Arbitration Lost IT Enable | 
| Kojto | 106:ba1f97679dad | 419 | * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge IT Enable | 
| Kojto | 106:ba1f97679dad | 420 | * @arg CEC_IT_LBPE: Rx Long period Error IT Enable | 
| Kojto | 106:ba1f97679dad | 421 | * @arg CEC_IT_SBPE: Rx Short period Error IT Enable | 
| Kojto | 106:ba1f97679dad | 422 | * @arg CEC_IT_BRE: Rx Bit Rising Error IT Enable | 
| Kojto | 106:ba1f97679dad | 423 | * @arg CEC_IT_RXOVR: Rx Overrun IT Enable | 
| Kojto | 106:ba1f97679dad | 424 | * @arg CEC_IT_RXEND: End Of Reception IT Enable | 
| Kojto | 106:ba1f97679dad | 425 | * @arg CEC_IT_RXBR: Rx-Byte Received IT Enable | 
| Kojto | 106:ba1f97679dad | 426 | * @retval none | 
| Kojto | 106:ba1f97679dad | 427 | */ | 
| Kojto | 106:ba1f97679dad | 428 | #define __HAL_CEC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__)) | 
| Kojto | 106:ba1f97679dad | 429 | |
| Kojto | 106:ba1f97679dad | 430 | /** @brief Disables the specified CEC interrupt. | 
| Kojto | 106:ba1f97679dad | 431 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 432 | * @param __INTERRUPT__: specifies the CEC interrupt to disable. | 
| Kojto | 106:ba1f97679dad | 433 | * This parameter can be one of the following values: | 
| Kojto | 106:ba1f97679dad | 434 | * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error IT Enable | 
| Kojto | 106:ba1f97679dad | 435 | * @arg CEC_IT_TXERR: Tx Error IT Enable | 
| Kojto | 106:ba1f97679dad | 436 | * @arg CEC_IT_TXUDR: Tx-Buffer Underrun IT Enable | 
| Kojto | 106:ba1f97679dad | 437 | * @arg CEC_IT_TXEND: End of transmission IT Enable | 
| Kojto | 106:ba1f97679dad | 438 | * @arg CEC_IT_TXBR: Tx-Byte Request IT Enable | 
| Kojto | 106:ba1f97679dad | 439 | * @arg CEC_IT_ARBLST: Arbitration Lost IT Enable | 
| Kojto | 106:ba1f97679dad | 440 | * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge IT Enable | 
| Kojto | 106:ba1f97679dad | 441 | * @arg CEC_IT_LBPE: Rx Long period Error IT Enable | 
| Kojto | 106:ba1f97679dad | 442 | * @arg CEC_IT_SBPE: Rx Short period Error IT Enable | 
| Kojto | 106:ba1f97679dad | 443 | * @arg CEC_IT_BRE: Rx Bit Rising Error IT Enable | 
| Kojto | 106:ba1f97679dad | 444 | * @arg CEC_IT_RXOVR: Rx Overrun IT Enable | 
| Kojto | 106:ba1f97679dad | 445 | * @arg CEC_IT_RXEND: End Of Reception IT Enable | 
| Kojto | 106:ba1f97679dad | 446 | * @arg CEC_IT_RXBR: Rx-Byte Received IT Enable | 
| Kojto | 106:ba1f97679dad | 447 | * @retval none | 
| Kojto | 106:ba1f97679dad | 448 | */ | 
| Kojto | 106:ba1f97679dad | 449 | #define __HAL_CEC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= (~(__INTERRUPT__))) | 
| Kojto | 106:ba1f97679dad | 450 | |
| Kojto | 106:ba1f97679dad | 451 | /** @brief Checks whether or not the specified CEC interrupt is enabled. | 
| Kojto | 106:ba1f97679dad | 452 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 453 | * @param __INTERRUPT__: specifies the CEC interrupt to check. | 
| Kojto | 106:ba1f97679dad | 454 | * This parameter can be one of the following values: | 
| Kojto | 106:ba1f97679dad | 455 | * @arg CEC_IT_TXACKE: Tx Missing acknowledge Error IT Enable | 
| Kojto | 106:ba1f97679dad | 456 | * @arg CEC_IT_TXERR: Tx Error IT Enable | 
| Kojto | 106:ba1f97679dad | 457 | * @arg CEC_IT_TXUDR: Tx-Buffer Underrun IT Enable | 
| Kojto | 106:ba1f97679dad | 458 | * @arg CEC_IT_TXEND: End of transmission IT Enable | 
| Kojto | 106:ba1f97679dad | 459 | * @arg CEC_IT_TXBR: Tx-Byte Request IT Enable | 
| Kojto | 106:ba1f97679dad | 460 | * @arg CEC_IT_ARBLST: Arbitration Lost IT Enable | 
| Kojto | 106:ba1f97679dad | 461 | * @arg CEC_IT_RXACKE: Rx-Missing Acknowledge IT Enable | 
| Kojto | 106:ba1f97679dad | 462 | * @arg CEC_IT_LBPE: Rx Long period Error IT Enable | 
| Kojto | 106:ba1f97679dad | 463 | * @arg CEC_IT_SBPE: Rx Short period Error IT Enable | 
| Kojto | 106:ba1f97679dad | 464 | * @arg CEC_IT_BRE: Rx Bit Rising Error IT Enable | 
| Kojto | 106:ba1f97679dad | 465 | * @arg CEC_IT_RXOVR: Rx Overrun IT Enable | 
| Kojto | 106:ba1f97679dad | 466 | * @arg CEC_IT_RXEND: End Of Reception IT Enable | 
| Kojto | 106:ba1f97679dad | 467 | * @arg CEC_IT_RXBR: Rx-Byte Received IT Enable | 
| Kojto | 106:ba1f97679dad | 468 | * @retval FlagStatus | 
| Kojto | 106:ba1f97679dad | 469 | */ | 
| Kojto | 106:ba1f97679dad | 470 | #define __HAL_CEC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__)) | 
| Kojto | 106:ba1f97679dad | 471 | |
| Kojto | 106:ba1f97679dad | 472 | /** @brief Enables the CEC device | 
| Kojto | 106:ba1f97679dad | 473 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 474 | * @retval none | 
| Kojto | 106:ba1f97679dad | 475 | */ | 
| Kojto | 106:ba1f97679dad | 476 | #define __HAL_CEC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CEC_CR_CECEN) | 
| Kojto | 106:ba1f97679dad | 477 | |
| Kojto | 106:ba1f97679dad | 478 | /** @brief Disables the CEC device | 
| Kojto | 106:ba1f97679dad | 479 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 480 | * @retval none | 
| Kojto | 106:ba1f97679dad | 481 | */ | 
| Kojto | 106:ba1f97679dad | 482 | #define __HAL_CEC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~CEC_CR_CECEN) | 
| Kojto | 106:ba1f97679dad | 483 | |
| Kojto | 106:ba1f97679dad | 484 | /** @brief Set Transmission Start flag | 
| Kojto | 106:ba1f97679dad | 485 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 486 | * @retval none | 
| Kojto | 106:ba1f97679dad | 487 | */ | 
| Kojto | 106:ba1f97679dad | 488 | #define __HAL_CEC_FIRST_BYTE_TX_SET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CEC_CR_TXSOM) | 
| Kojto | 106:ba1f97679dad | 489 | |
| Kojto | 106:ba1f97679dad | 490 | /** @brief Set Transmission End flag | 
| Kojto | 106:ba1f97679dad | 491 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 492 | * @retval none | 
| Kojto | 106:ba1f97679dad | 493 | * If the CEC message consists of only one byte, TXEOM must be set before of TXSOM. | 
| Kojto | 106:ba1f97679dad | 494 | */ | 
| Kojto | 106:ba1f97679dad | 495 | #define __HAL_CEC_LAST_BYTE_TX_SET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CEC_CR_TXEOM) | 
| Kojto | 106:ba1f97679dad | 496 | |
| Kojto | 106:ba1f97679dad | 497 | /** @brief Get Transmission Start flag | 
| Kojto | 106:ba1f97679dad | 498 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 499 | * @retval FlagStatus | 
| Kojto | 106:ba1f97679dad | 500 | */ | 
| Kojto | 106:ba1f97679dad | 501 | #define __HAL_CEC_GET_TRANSMISSION_START_FLAG(__HANDLE__) ((__HANDLE__)->Instance->CR & CEC_CR_TXSOM) | 
| Kojto | 106:ba1f97679dad | 502 | |
| Kojto | 106:ba1f97679dad | 503 | /** @brief Get Transmission End flag | 
| Kojto | 106:ba1f97679dad | 504 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 505 | * @retval FlagStatus | 
| Kojto | 106:ba1f97679dad | 506 | */ | 
| Kojto | 106:ba1f97679dad | 507 | #define __HAL_CEC_GET_TRANSMISSION_END_FLAG(__HANDLE__) ((__HANDLE__)->Instance->CR & CEC_CR_TXEOM) | 
| Kojto | 106:ba1f97679dad | 508 | |
| Kojto | 106:ba1f97679dad | 509 | /** @brief Clear OAR register | 
| Kojto | 106:ba1f97679dad | 510 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 511 | * @retval none | 
| Kojto | 106:ba1f97679dad | 512 | */ | 
| Kojto | 106:ba1f97679dad | 513 | #define __HAL_CEC_CLEAR_OAR(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CFGR, CEC_CFGR_OAR) | 
| Kojto | 106:ba1f97679dad | 514 | |
| Kojto | 106:ba1f97679dad | 515 | /** @brief Set OAR register (without resetting previously set address in case of multi-address mode) | 
| Kojto | 106:ba1f97679dad | 516 | * To reset OAR, __HAL_CEC_CLEAR_OAR() needs to be called beforehand | 
| Kojto | 106:ba1f97679dad | 517 | * @param __HANDLE__: specifies the CEC Handle. | 
| Kojto | 106:ba1f97679dad | 518 | * @param __ADDRESS__: Own Address value (CEC logical address is identified by bit position) | 
| Kojto | 106:ba1f97679dad | 519 | * @retval none | 
| Kojto | 106:ba1f97679dad | 520 | */ | 
| Kojto | 106:ba1f97679dad | 521 | #define __HAL_CEC_SET_OAR(__HANDLE__,__ADDRESS__) SET_BIT((__HANDLE__)->Instance->CFGR, (__ADDRESS__)<< CEC_CFGR_OAR_LSB_POS) | 
| Kojto | 106:ba1f97679dad | 522 | |
| Kojto | 106:ba1f97679dad | 523 | /** | 
| Kojto | 106:ba1f97679dad | 524 | * @} | 
| Kojto | 106:ba1f97679dad | 525 | */ | 
| Kojto | 106:ba1f97679dad | 526 | |
| Kojto | 106:ba1f97679dad | 527 | /* Exported functions --------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 528 | /** @addtogroup CEC_Exported_Functions | 
| Kojto | 106:ba1f97679dad | 529 | * @{ | 
| Kojto | 106:ba1f97679dad | 530 | */ | 
| Kojto | 106:ba1f97679dad | 531 | |
| Kojto | 106:ba1f97679dad | 532 | /** @addtogroup CEC_Exported_Functions_Group1 | 
| Kojto | 106:ba1f97679dad | 533 | * @{ | 
| Kojto | 106:ba1f97679dad | 534 | */ | 
| Kojto | 106:ba1f97679dad | 535 | /* Initialization and de-initialization functions ****************************/ | 
| Kojto | 106:ba1f97679dad | 536 | HAL_StatusTypeDef HAL_CEC_Init(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 537 | HAL_StatusTypeDef HAL_CEC_DeInit(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 538 | void HAL_CEC_MspInit(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 539 | void HAL_CEC_MspDeInit(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 540 | /** | 
| Kojto | 106:ba1f97679dad | 541 | * @} | 
| Kojto | 106:ba1f97679dad | 542 | */ | 
| Kojto | 106:ba1f97679dad | 543 | |
| Kojto | 106:ba1f97679dad | 544 | /** @addtogroup CEC_Exported_Functions_Group2 | 
| Kojto | 106:ba1f97679dad | 545 | * @{ | 
| Kojto | 106:ba1f97679dad | 546 | */ | 
| Kojto | 106:ba1f97679dad | 547 | /* I/O operation functions ***************************************************/ | 
| Kojto | 106:ba1f97679dad | 548 | HAL_StatusTypeDef HAL_CEC_Transmit(CEC_HandleTypeDef *hcec, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size, uint32_t Timeout); | 
| Kojto | 106:ba1f97679dad | 549 | HAL_StatusTypeDef HAL_CEC_Receive(CEC_HandleTypeDef *hcec, uint8_t *pData, uint32_t Timeout); | 
| Kojto | 106:ba1f97679dad | 550 | HAL_StatusTypeDef HAL_CEC_Transmit_IT(CEC_HandleTypeDef *hcec, uint8_t DestinationAddress, uint8_t *pData, uint32_t Size); | 
| Kojto | 106:ba1f97679dad | 551 | HAL_StatusTypeDef HAL_CEC_Receive_IT(CEC_HandleTypeDef *hcec, uint8_t *pData); | 
| Kojto | 106:ba1f97679dad | 552 | uint32_t HAL_CEC_GetReceivedFrameSize(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 553 | void HAL_CEC_IRQHandler(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 554 | void HAL_CEC_TxCpltCallback(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 555 | void HAL_CEC_RxCpltCallback(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 556 | void HAL_CEC_ErrorCallback(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 557 | /** | 
| Kojto | 106:ba1f97679dad | 558 | * @} | 
| Kojto | 106:ba1f97679dad | 559 | */ | 
| Kojto | 106:ba1f97679dad | 560 | |
| Kojto | 106:ba1f97679dad | 561 | /** @addtogroup CEC_Exported_Functions_Group3 | 
| Kojto | 106:ba1f97679dad | 562 | * @{ | 
| Kojto | 106:ba1f97679dad | 563 | */ | 
| Kojto | 106:ba1f97679dad | 564 | /* Peripheral State functions ************************************************/ | 
| Kojto | 106:ba1f97679dad | 565 | HAL_CEC_StateTypeDef HAL_CEC_GetState(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 566 | uint32_t HAL_CEC_GetError(CEC_HandleTypeDef *hcec); | 
| Kojto | 106:ba1f97679dad | 567 | /** | 
| Kojto | 106:ba1f97679dad | 568 | * @} | 
| Kojto | 106:ba1f97679dad | 569 | */ | 
| Kojto | 106:ba1f97679dad | 570 | |
| Kojto | 106:ba1f97679dad | 571 | /** | 
| Kojto | 106:ba1f97679dad | 572 | * @} | 
| Kojto | 106:ba1f97679dad | 573 | */ | 
| Kojto | 106:ba1f97679dad | 574 | |
| Kojto | 106:ba1f97679dad | 575 | /* Private types -------------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 576 | /** @defgroup CEC_Private_Types CEC Private Types | 
| Kojto | 106:ba1f97679dad | 577 | * @{ | 
| Kojto | 106:ba1f97679dad | 578 | */ | 
| Kojto | 106:ba1f97679dad | 579 | |
| Kojto | 106:ba1f97679dad | 580 | /** | 
| Kojto | 106:ba1f97679dad | 581 | * @} | 
| Kojto | 106:ba1f97679dad | 582 | */ | 
| Kojto | 106:ba1f97679dad | 583 | |
| Kojto | 106:ba1f97679dad | 584 | /* Private variables ---------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 585 | /** @defgroup CEC_Private_Variables CEC Private Variables | 
| Kojto | 106:ba1f97679dad | 586 | * @{ | 
| Kojto | 106:ba1f97679dad | 587 | */ | 
| Kojto | 106:ba1f97679dad | 588 | |
| Kojto | 106:ba1f97679dad | 589 | /** | 
| Kojto | 106:ba1f97679dad | 590 | * @} | 
| Kojto | 106:ba1f97679dad | 591 | */ | 
| Kojto | 106:ba1f97679dad | 592 | |
| Kojto | 106:ba1f97679dad | 593 | /* Private constants ---------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 594 | /** @defgroup CEC_Private_Constants CEC Private Constants | 
| Kojto | 106:ba1f97679dad | 595 | * @{ | 
| Kojto | 106:ba1f97679dad | 596 | */ | 
| Kojto | 106:ba1f97679dad | 597 | |
| Kojto | 106:ba1f97679dad | 598 | /** | 
| Kojto | 106:ba1f97679dad | 599 | * @} | 
| Kojto | 106:ba1f97679dad | 600 | */ | 
| Kojto | 106:ba1f97679dad | 601 | |
| Kojto | 106:ba1f97679dad | 602 | /* Private macros ------------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 603 | /** @defgroup CEC_Private_Macros CEC Private Macros | 
| Kojto | 106:ba1f97679dad | 604 | * @{ | 
| Kojto | 106:ba1f97679dad | 605 | */ | 
| Kojto | 106:ba1f97679dad | 606 | |
| Kojto | 106:ba1f97679dad | 607 | #define IS_CEC_SIGNALFREETIME(__SFT__) ((__SFT__) <= CEC_CFGR_SFT) | 
| Kojto | 106:ba1f97679dad | 608 | |
| Kojto | 106:ba1f97679dad | 609 | #define IS_CEC_TOLERANCE(__RXTOL__) (((__RXTOL__) == CEC_STANDARD_TOLERANCE) || \ | 
| Kojto | 106:ba1f97679dad | 610 | ((__RXTOL__) == CEC_EXTENDED_TOLERANCE)) | 
| Kojto | 106:ba1f97679dad | 611 | |
| Kojto | 106:ba1f97679dad | 612 | #define IS_CEC_BRERXSTOP(__BRERXSTOP__) (((__BRERXSTOP__) == CEC_NO_RX_STOP_ON_BRE) || \ | 
| Kojto | 106:ba1f97679dad | 613 | ((__BRERXSTOP__) == CEC_RX_STOP_ON_BRE)) | 
| Kojto | 106:ba1f97679dad | 614 | |
| Kojto | 106:ba1f97679dad | 615 | #define IS_CEC_BREERRORBITGEN(__ERRORBITGEN__) (((__ERRORBITGEN__) == CEC_BRE_ERRORBIT_NO_GENERATION) || \ | 
| Kojto | 106:ba1f97679dad | 616 | ((__ERRORBITGEN__) == CEC_BRE_ERRORBIT_GENERATION)) | 
| Kojto | 106:ba1f97679dad | 617 | |
| Kojto | 106:ba1f97679dad | 618 | #define IS_CEC_LBPEERRORBITGEN(__ERRORBITGEN__) (((__ERRORBITGEN__) == CEC_LBPE_ERRORBIT_NO_GENERATION) || \ | 
| Kojto | 106:ba1f97679dad | 619 | ((__ERRORBITGEN__) == CEC_LBPE_ERRORBIT_GENERATION)) | 
| Kojto | 106:ba1f97679dad | 620 | |
| Kojto | 106:ba1f97679dad | 621 | #define IS_CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION(__ERRORBITGEN__) (((__ERRORBITGEN__) == CEC_BROADCASTERROR_ERRORBIT_GENERATION) || \ | 
| Kojto | 106:ba1f97679dad | 622 | ((__ERRORBITGEN__) == CEC_BROADCASTERROR_NO_ERRORBIT_GENERATION)) | 
| Kojto | 106:ba1f97679dad | 623 | |
| Kojto | 106:ba1f97679dad | 624 | #define IS_CEC_SFTOP(__SFTOP__) (((__SFTOP__) == CEC_SFT_START_ON_TXSOM) || \ | 
| Kojto | 106:ba1f97679dad | 625 | ((__SFTOP__) == CEC_SFT_START_ON_TX_RX_END)) | 
| Kojto | 106:ba1f97679dad | 626 | |
| Kojto | 106:ba1f97679dad | 627 | #define IS_CEC_LISTENING_MODE(__MODE__) (((__MODE__) == CEC_REDUCED_LISTENING_MODE) || \ | 
| Kojto | 106:ba1f97679dad | 628 | ((__MODE__) == CEC_FULL_LISTENING_MODE)) | 
| Kojto | 106:ba1f97679dad | 629 | |
| Kojto | 106:ba1f97679dad | 630 | /** @brief Check CEC device Own Address Register (OAR) setting. | 
| Kojto | 106:ba1f97679dad | 631 | * OAR address is written in a 15-bit field within CEC_CFGR register. | 
| Kojto | 106:ba1f97679dad | 632 | * @param __ADDRESS__: CEC own address. | 
| Kojto | 106:ba1f97679dad | 633 | * @retval Test result (TRUE or FALSE). | 
| Kojto | 106:ba1f97679dad | 634 | */ | 
| Kojto | 106:ba1f97679dad | 635 | #define IS_CEC_OAR_ADDRESS(__ADDRESS__) ((__ADDRESS__) <= 0x07FFF) | 
| Kojto | 106:ba1f97679dad | 636 | |
| Kojto | 106:ba1f97679dad | 637 | /** @brief Check CEC initiator or destination logical address setting. | 
| Kojto | 106:ba1f97679dad | 638 | * Initiator and destination addresses are coded over 4 bits. | 
| Kojto | 106:ba1f97679dad | 639 | * @param __ADDRESS__: CEC initiator or logical address. | 
| Kojto | 106:ba1f97679dad | 640 | * @retval Test result (TRUE or FALSE). | 
| Kojto | 106:ba1f97679dad | 641 | */ | 
| Kojto | 106:ba1f97679dad | 642 | #define IS_CEC_ADDRESS(__ADDRESS__) ((__ADDRESS__) <= 0xF) | 
| Kojto | 106:ba1f97679dad | 643 | |
| Kojto | 106:ba1f97679dad | 644 | /** @brief Check CEC message size. | 
| Kojto | 106:ba1f97679dad | 645 | * The message size is the payload size: without counting the header, | 
| Kojto | 106:ba1f97679dad | 646 | * it varies from 0 byte (ping operation, one header only, no payload) to | 
| Kojto | 106:ba1f97679dad | 647 | * 15 bytes (1 opcode and up to 14 operands following the header). | 
| Kojto | 106:ba1f97679dad | 648 | * @param __SIZE__: CEC message size. | 
| Kojto | 106:ba1f97679dad | 649 | * @retval Test result (TRUE or FALSE). | 
| Kojto | 106:ba1f97679dad | 650 | */ | 
| Kojto | 106:ba1f97679dad | 651 | #define IS_CEC_MSGSIZE(__SIZE__) ((__SIZE__) <= 0xF) | 
| Kojto | 106:ba1f97679dad | 652 | |
| Kojto | 106:ba1f97679dad | 653 | /** | 
| Kojto | 106:ba1f97679dad | 654 | * @} | 
| Kojto | 106:ba1f97679dad | 655 | */ | 
| Kojto | 106:ba1f97679dad | 656 | |
| Kojto | 106:ba1f97679dad | 657 | /* Private functions ---------------------------------------------------------*/ | 
| Kojto | 106:ba1f97679dad | 658 | /** @defgroup CEC_Private_Functions CEC Private Functions | 
| Kojto | 106:ba1f97679dad | 659 | * @{ | 
| Kojto | 106:ba1f97679dad | 660 | */ | 
| Kojto | 106:ba1f97679dad | 661 | |
| Kojto | 106:ba1f97679dad | 662 | /** | 
| Kojto | 106:ba1f97679dad | 663 | * @} | 
| Kojto | 106:ba1f97679dad | 664 | */ | 
| Kojto | 106:ba1f97679dad | 665 | |
| Kojto | 106:ba1f97679dad | 666 | /** | 
| Kojto | 106:ba1f97679dad | 667 | * @} | 
| Kojto | 106:ba1f97679dad | 668 | */ | 
| Kojto | 106:ba1f97679dad | 669 | |
| Kojto | 106:ba1f97679dad | 670 | /** | 
| Kojto | 106:ba1f97679dad | 671 | * @} | 
| Kojto | 106:ba1f97679dad | 672 | */ | 
| Kojto | 106:ba1f97679dad | 673 | #endif /* STM32F446xx */ | 
| Kojto | 106:ba1f97679dad | 674 | |
| Kojto | 106:ba1f97679dad | 675 | #ifdef __cplusplus | 
| Kojto | 106:ba1f97679dad | 676 | } | 
| Kojto | 106:ba1f97679dad | 677 | #endif | 
| Kojto | 106:ba1f97679dad | 678 | |
| Kojto | 106:ba1f97679dad | 679 | #endif /* __STM32F4xx_HAL_CEC_H */ | 
| Kojto | 106:ba1f97679dad | 680 | |
| Kojto | 106:ba1f97679dad | 681 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | 
