mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
yusuke_kyo
Date:
Wed Apr 08 08:04:18 2015 +0000
Revision:
98:01a414ca7d6d
Parent:
90:cb3d968589d8
remove SerialHalfDuplex.h

Who changed what in which revision?

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