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