mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
<>
Date:
Mon Jan 16 15:03:32 2017 +0000
Revision:
156:95d6b41a828b
Parent:
149:156823d33999
Child:
180:96ed750bd169
This updates the lib to the mbed lib v134

Who changed what in which revision?

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