version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
TARGET_NUCLEO_F030R8/stm32f0xx_cec.h@81:7d30d6019079, 2014-03-19 (annotated)
- Committer:
- bogdanm
- Date:
- Wed Mar 19 18:28:32 2014 +0000
- Revision:
- 81:7d30d6019079
- Parent:
- 77:869cf507173a
Release 81 of the mbed library
Main changes:
- Updates and fixes for many targets
- LPC1768: serial interface code fixes
- nRF51822 targets now output a .hex file
- More exporters
- More flexible GPIO API
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 77:869cf507173a | 1 | /** |
emilmont | 77:869cf507173a | 2 | ****************************************************************************** |
emilmont | 77:869cf507173a | 3 | * @file stm32f0xx_cec.h |
emilmont | 77:869cf507173a | 4 | * @author MCD Application Team |
emilmont | 77:869cf507173a | 5 | * @version V1.3.0 |
emilmont | 77:869cf507173a | 6 | * @date 16-January-2014 |
emilmont | 77:869cf507173a | 7 | * @brief This file contains all the functions prototypes for the CEC firmware |
emilmont | 77:869cf507173a | 8 | * library, applicable only for STM32F051, STM32F042 and STM32F072 devices. |
emilmont | 77:869cf507173a | 9 | ****************************************************************************** |
emilmont | 77:869cf507173a | 10 | * @attention |
emilmont | 77:869cf507173a | 11 | * |
bogdanm | 81:7d30d6019079 | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
emilmont | 77:869cf507173a | 13 | * |
bogdanm | 81:7d30d6019079 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 81:7d30d6019079 | 15 | * are permitted provided that the following conditions are met: |
bogdanm | 81:7d30d6019079 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 81:7d30d6019079 | 17 | * this list of conditions and the following disclaimer. |
bogdanm | 81:7d30d6019079 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 81:7d30d6019079 | 19 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 81:7d30d6019079 | 20 | * and/or other materials provided with the distribution. |
bogdanm | 81:7d30d6019079 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 81:7d30d6019079 | 22 | * may be used to endorse or promote products derived from this software |
bogdanm | 81:7d30d6019079 | 23 | * without specific prior written permission. |
emilmont | 77:869cf507173a | 24 | * |
bogdanm | 81:7d30d6019079 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 81:7d30d6019079 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 81:7d30d6019079 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 81:7d30d6019079 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 81:7d30d6019079 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 81:7d30d6019079 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 81:7d30d6019079 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 81:7d30d6019079 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 81:7d30d6019079 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 81:7d30d6019079 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
emilmont | 77:869cf507173a | 35 | * |
emilmont | 77:869cf507173a | 36 | ****************************************************************************** |
emilmont | 77:869cf507173a | 37 | */ |
emilmont | 77:869cf507173a | 38 | |
emilmont | 77:869cf507173a | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
emilmont | 77:869cf507173a | 40 | #ifndef __STM32F0XX_CEC_H |
emilmont | 77:869cf507173a | 41 | #define __STM32F0XX_CEC_H |
emilmont | 77:869cf507173a | 42 | |
emilmont | 77:869cf507173a | 43 | #ifdef __cplusplus |
emilmont | 77:869cf507173a | 44 | extern "C" { |
emilmont | 77:869cf507173a | 45 | #endif |
emilmont | 77:869cf507173a | 46 | |
emilmont | 77:869cf507173a | 47 | /* Includes ------------------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 48 | #include "stm32f0xx.h" |
emilmont | 77:869cf507173a | 49 | |
emilmont | 77:869cf507173a | 50 | /** @addtogroup STM32F0xx_StdPeriph_Driver |
emilmont | 77:869cf507173a | 51 | * @{ |
emilmont | 77:869cf507173a | 52 | */ |
emilmont | 77:869cf507173a | 53 | |
emilmont | 77:869cf507173a | 54 | /** @addtogroup CEC |
emilmont | 77:869cf507173a | 55 | * @{ |
emilmont | 77:869cf507173a | 56 | */ |
emilmont | 77:869cf507173a | 57 | /* Exported types ------------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 58 | |
emilmont | 77:869cf507173a | 59 | /** |
emilmont | 77:869cf507173a | 60 | * @brief CEC Init structure definition |
emilmont | 77:869cf507173a | 61 | */ |
emilmont | 77:869cf507173a | 62 | typedef struct |
emilmont | 77:869cf507173a | 63 | { |
emilmont | 77:869cf507173a | 64 | uint32_t CEC_SignalFreeTime; /*!< Specifies the CEC Signal Free Time configuration. |
emilmont | 77:869cf507173a | 65 | This parameter can be a value of @ref CEC_Signal_Free_Time */ |
emilmont | 77:869cf507173a | 66 | uint32_t CEC_RxTolerance; /*!< Specifies the CEC Reception Tolerance. |
emilmont | 77:869cf507173a | 67 | This parameter can be a value of @ref CEC_RxTolerance */ |
emilmont | 77:869cf507173a | 68 | uint32_t CEC_StopReception; /*!< Specifies the CEC Stop Reception. |
emilmont | 77:869cf507173a | 69 | This parameter can be a value of @ref CEC_Stop_Reception */ |
emilmont | 77:869cf507173a | 70 | uint32_t CEC_BitRisingError; /*!< Specifies the CEC Bit Rising Error generation. |
emilmont | 77:869cf507173a | 71 | This parameter can be a value of @ref CEC_Bit_Rising_Error_Generation */ |
emilmont | 77:869cf507173a | 72 | uint32_t CEC_LongBitPeriodError; /*!< Specifies the CEC Long Bit Error generation. |
emilmont | 77:869cf507173a | 73 | This parameter can be a value of @ref CEC_Long_Bit_Error_Generation */ |
emilmont | 77:869cf507173a | 74 | uint32_t CEC_BRDNoGen; /*!< Specifies the CEC Broadcast Error generation. |
emilmont | 77:869cf507173a | 75 | This parameter can be a value of @ref CEC_BDR_No_Gen */ |
emilmont | 77:869cf507173a | 76 | uint32_t CEC_SFTOption; /*!< Specifies the CEC Signal Free Time option. |
emilmont | 77:869cf507173a | 77 | This parameter can be a value of @ref CEC_SFT_Option */ |
emilmont | 77:869cf507173a | 78 | |
emilmont | 77:869cf507173a | 79 | }CEC_InitTypeDef; |
emilmont | 77:869cf507173a | 80 | |
emilmont | 77:869cf507173a | 81 | /* Exported constants --------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 82 | |
emilmont | 77:869cf507173a | 83 | /** @defgroup CEC_Exported_Constants |
emilmont | 77:869cf507173a | 84 | * @{ |
emilmont | 77:869cf507173a | 85 | */ |
emilmont | 77:869cf507173a | 86 | |
emilmont | 77:869cf507173a | 87 | /** @defgroup CEC_Signal_Free_Time |
emilmont | 77:869cf507173a | 88 | * @{ |
emilmont | 77:869cf507173a | 89 | */ |
emilmont | 77:869cf507173a | 90 | #define CEC_SignalFreeTime_Standard ((uint32_t)0x00000000) /*!< CEC Signal Free Time Standard */ |
emilmont | 77:869cf507173a | 91 | #define CEC_SignalFreeTime_1T ((uint32_t)0x00000001) /*!< CEC 1.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 92 | #define CEC_SignalFreeTime_2T ((uint32_t)0x00000002) /*!< CEC 2.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 93 | #define CEC_SignalFreeTime_3T ((uint32_t)0x00000003) /*!< CEC 3.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 94 | #define CEC_SignalFreeTime_4T ((uint32_t)0x00000004) /*!< CEC 4.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 95 | #define CEC_SignalFreeTime_5T ((uint32_t)0x00000005) /*!< CEC 5.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 96 | #define CEC_SignalFreeTime_6T ((uint32_t)0x00000006) /*!< CEC 6.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 97 | #define CEC_SignalFreeTime_7T ((uint32_t)0x00000007) /*!< CEC 7.5 nominal data bit periods */ |
emilmont | 77:869cf507173a | 98 | |
emilmont | 77:869cf507173a | 99 | #define IS_CEC_SIGNAL_FREE_TIME(TIME) (((TIME) == CEC_SignalFreeTime_Standard) || \ |
emilmont | 77:869cf507173a | 100 | ((TIME) == CEC_SignalFreeTime_1T)|| \ |
emilmont | 77:869cf507173a | 101 | ((TIME) == CEC_SignalFreeTime_2T)|| \ |
emilmont | 77:869cf507173a | 102 | ((TIME) == CEC_SignalFreeTime_3T)|| \ |
emilmont | 77:869cf507173a | 103 | ((TIME) == CEC_SignalFreeTime_4T)|| \ |
emilmont | 77:869cf507173a | 104 | ((TIME) == CEC_SignalFreeTime_5T)|| \ |
emilmont | 77:869cf507173a | 105 | ((TIME) == CEC_SignalFreeTime_6T)|| \ |
emilmont | 77:869cf507173a | 106 | ((TIME) == CEC_SignalFreeTime_7T)) |
emilmont | 77:869cf507173a | 107 | /** |
emilmont | 77:869cf507173a | 108 | * @} |
emilmont | 77:869cf507173a | 109 | */ |
emilmont | 77:869cf507173a | 110 | |
emilmont | 77:869cf507173a | 111 | /** @defgroup CEC_RxTolerance |
emilmont | 77:869cf507173a | 112 | * @{ |
emilmont | 77:869cf507173a | 113 | */ |
emilmont | 77:869cf507173a | 114 | #define CEC_RxTolerance_Standard ((uint32_t)0x00000000) /*!< Standard Tolerance Margin */ |
emilmont | 77:869cf507173a | 115 | #define CEC_RxTolerance_Extended CEC_CFGR_RXTOL /*!< Extended Tolerance Margin */ |
emilmont | 77:869cf507173a | 116 | |
emilmont | 77:869cf507173a | 117 | #define IS_CEC_RX_TOLERANCE(TOLERANCE) (((TOLERANCE) == CEC_RxTolerance_Standard) || \ |
emilmont | 77:869cf507173a | 118 | ((TOLERANCE) == CEC_RxTolerance_Extended)) |
emilmont | 77:869cf507173a | 119 | /** |
emilmont | 77:869cf507173a | 120 | * @} |
emilmont | 77:869cf507173a | 121 | */ |
emilmont | 77:869cf507173a | 122 | |
emilmont | 77:869cf507173a | 123 | /** @defgroup CEC_Stop_Reception |
emilmont | 77:869cf507173a | 124 | * @{ |
emilmont | 77:869cf507173a | 125 | */ |
emilmont | 77:869cf507173a | 126 | #define CEC_StopReception_Off ((uint32_t)0x00000000) /*!< No RX Stop on bit Rising Error (BRE) */ |
emilmont | 77:869cf507173a | 127 | #define CEC_StopReception_On CEC_CFGR_BRESTP /*!< RX Stop on bit Rising Error (BRE) */ |
emilmont | 77:869cf507173a | 128 | |
emilmont | 77:869cf507173a | 129 | #define IS_CEC_STOP_RECEPTION(RECEPTION) (((RECEPTION) == CEC_StopReception_On) || \ |
emilmont | 77:869cf507173a | 130 | ((RECEPTION) == CEC_StopReception_Off)) |
emilmont | 77:869cf507173a | 131 | /** |
emilmont | 77:869cf507173a | 132 | * @} |
emilmont | 77:869cf507173a | 133 | */ |
emilmont | 77:869cf507173a | 134 | |
emilmont | 77:869cf507173a | 135 | /** @defgroup CEC_Bit_Rising_Error_Generation |
emilmont | 77:869cf507173a | 136 | * @{ |
emilmont | 77:869cf507173a | 137 | */ |
emilmont | 77:869cf507173a | 138 | #define CEC_BitRisingError_Off ((uint32_t)0x00000000) /*!< Bit Rising Error generation turned Off */ |
emilmont | 77:869cf507173a | 139 | #define CEC_BitRisingError_On CEC_CFGR_BREGEN /*!< Bit Rising Error generation turned On */ |
emilmont | 77:869cf507173a | 140 | |
emilmont | 77:869cf507173a | 141 | #define IS_CEC_BIT_RISING_ERROR(ERROR) (((ERROR) == CEC_BitRisingError_Off) || \ |
emilmont | 77:869cf507173a | 142 | ((ERROR) == CEC_BitRisingError_On)) |
emilmont | 77:869cf507173a | 143 | /** |
emilmont | 77:869cf507173a | 144 | * @} |
emilmont | 77:869cf507173a | 145 | */ |
emilmont | 77:869cf507173a | 146 | |
emilmont | 77:869cf507173a | 147 | /** @defgroup CEC_Long_Bit_Error_Generation |
emilmont | 77:869cf507173a | 148 | * @{ |
emilmont | 77:869cf507173a | 149 | */ |
emilmont | 77:869cf507173a | 150 | #define CEC_LongBitPeriodError_Off ((uint32_t)0x00000000) /*!< Long Bit Period Error generation turned Off */ |
emilmont | 77:869cf507173a | 151 | #define CEC_LongBitPeriodError_On CEC_CFGR_LREGEN /*!< Long Bit Period Error generation turned On */ |
emilmont | 77:869cf507173a | 152 | |
emilmont | 77:869cf507173a | 153 | #define IS_CEC_LONG_BIT_PERIOD_ERROR(ERROR) (((ERROR) == CEC_LongBitPeriodError_Off) || \ |
emilmont | 77:869cf507173a | 154 | ((ERROR) == CEC_LongBitPeriodError_On)) |
emilmont | 77:869cf507173a | 155 | /** |
emilmont | 77:869cf507173a | 156 | * @} |
emilmont | 77:869cf507173a | 157 | */ |
emilmont | 77:869cf507173a | 158 | |
emilmont | 77:869cf507173a | 159 | /** @defgroup CEC_BDR_No_Gen |
emilmont | 77:869cf507173a | 160 | * @{ |
emilmont | 77:869cf507173a | 161 | */ |
emilmont | 77:869cf507173a | 162 | |
emilmont | 77:869cf507173a | 163 | #define CEC_BRDNoGen_Off ((uint32_t)0x00000000) /*!< Broadcast Bit Rising Error generation turned Off */ |
emilmont | 77:869cf507173a | 164 | #define CEC_BRDNoGen_On CEC_CFGR_BRDNOGEN /*!< Broadcast Bit Rising Error generation turned On */ |
emilmont | 77:869cf507173a | 165 | |
emilmont | 77:869cf507173a | 166 | #define IS_CEC_BDR_NO_GEN_ERROR(ERROR) (((ERROR) == CEC_BRDNoGen_Off) || \ |
emilmont | 77:869cf507173a | 167 | ((ERROR) == CEC_BRDNoGen_On)) |
emilmont | 77:869cf507173a | 168 | /** |
emilmont | 77:869cf507173a | 169 | * @} |
emilmont | 77:869cf507173a | 170 | */ |
emilmont | 77:869cf507173a | 171 | |
emilmont | 77:869cf507173a | 172 | /** @defgroup CEC_SFT_Option |
emilmont | 77:869cf507173a | 173 | * @{ |
emilmont | 77:869cf507173a | 174 | */ |
emilmont | 77:869cf507173a | 175 | #define CEC_SFTOption_Off ((uint32_t)0x00000000) /*!< SFT option turned Off */ |
emilmont | 77:869cf507173a | 176 | #define CEC_SFTOption_On CEC_CFGR_SFTOPT /*!< SFT option turned On */ |
emilmont | 77:869cf507173a | 177 | |
emilmont | 77:869cf507173a | 178 | #define IS_CEC_SFT_OPTION(OPTION) (((OPTION) == CEC_SFTOption_Off) || \ |
emilmont | 77:869cf507173a | 179 | ((OPTION) == CEC_SFTOption_On)) |
emilmont | 77:869cf507173a | 180 | /** |
emilmont | 77:869cf507173a | 181 | * @} |
emilmont | 77:869cf507173a | 182 | */ |
emilmont | 77:869cf507173a | 183 | |
emilmont | 77:869cf507173a | 184 | /** @defgroup CEC_Own_Address |
emilmont | 77:869cf507173a | 185 | * @{ |
emilmont | 77:869cf507173a | 186 | */ |
emilmont | 77:869cf507173a | 187 | #define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10) |
emilmont | 77:869cf507173a | 188 | |
emilmont | 77:869cf507173a | 189 | /** |
emilmont | 77:869cf507173a | 190 | * @} |
emilmont | 77:869cf507173a | 191 | */ |
emilmont | 77:869cf507173a | 192 | |
emilmont | 77:869cf507173a | 193 | /** @defgroup CEC_Interrupt_Configuration_definition |
emilmont | 77:869cf507173a | 194 | * @{ |
emilmont | 77:869cf507173a | 195 | */ |
emilmont | 77:869cf507173a | 196 | #define CEC_IT_TXACKE CEC_IER_TXACKEIE |
emilmont | 77:869cf507173a | 197 | #define CEC_IT_TXERR CEC_IER_TXERRIE |
emilmont | 77:869cf507173a | 198 | #define CEC_IT_TXUDR CEC_IER_TXUDRIE |
emilmont | 77:869cf507173a | 199 | #define CEC_IT_TXEND CEC_IER_TXENDIE |
emilmont | 77:869cf507173a | 200 | #define CEC_IT_TXBR CEC_IER_TXBRIE |
emilmont | 77:869cf507173a | 201 | #define CEC_IT_ARBLST CEC_IER_ARBLSTIE |
emilmont | 77:869cf507173a | 202 | #define CEC_IT_RXACKE CEC_IER_RXACKEIE |
emilmont | 77:869cf507173a | 203 | #define CEC_IT_LBPE CEC_IER_LBPEIE |
emilmont | 77:869cf507173a | 204 | #define CEC_IT_SBPE CEC_IER_SBPEIE |
emilmont | 77:869cf507173a | 205 | #define CEC_IT_BRE CEC_IER_BREIEIE |
emilmont | 77:869cf507173a | 206 | #define CEC_IT_RXOVR CEC_IER_RXOVRIE |
emilmont | 77:869cf507173a | 207 | #define CEC_IT_RXEND CEC_IER_RXENDIE |
emilmont | 77:869cf507173a | 208 | #define CEC_IT_RXBR CEC_IER_RXBRIE |
emilmont | 77:869cf507173a | 209 | |
emilmont | 77:869cf507173a | 210 | #define IS_CEC_IT(IT) ((((IT) & (uint32_t)0xFFFFE000) == 0x00) && ((IT) != 0x00)) |
emilmont | 77:869cf507173a | 211 | |
emilmont | 77:869cf507173a | 212 | #define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TXACKE) || \ |
emilmont | 77:869cf507173a | 213 | ((IT) == CEC_IT_TXERR)|| \ |
emilmont | 77:869cf507173a | 214 | ((IT) == CEC_IT_TXUDR)|| \ |
emilmont | 77:869cf507173a | 215 | ((IT) == CEC_IT_TXEND)|| \ |
emilmont | 77:869cf507173a | 216 | ((IT) == CEC_IT_TXBR)|| \ |
emilmont | 77:869cf507173a | 217 | ((IT) == CEC_IT_ARBLST)|| \ |
emilmont | 77:869cf507173a | 218 | ((IT) == CEC_IT_RXACKE)|| \ |
emilmont | 77:869cf507173a | 219 | ((IT) == CEC_IT_LBPE)|| \ |
emilmont | 77:869cf507173a | 220 | ((IT) == CEC_IT_SBPE)|| \ |
emilmont | 77:869cf507173a | 221 | ((IT) == CEC_IT_BRE)|| \ |
emilmont | 77:869cf507173a | 222 | ((IT) == CEC_IT_RXOVR)|| \ |
emilmont | 77:869cf507173a | 223 | ((IT) == CEC_IT_RXEND)|| \ |
emilmont | 77:869cf507173a | 224 | ((IT) == CEC_IT_RXBR)) |
emilmont | 77:869cf507173a | 225 | /** |
emilmont | 77:869cf507173a | 226 | * @} |
emilmont | 77:869cf507173a | 227 | */ |
emilmont | 77:869cf507173a | 228 | |
emilmont | 77:869cf507173a | 229 | /** @defgroup CEC_ISR_register_flags_definition |
emilmont | 77:869cf507173a | 230 | * @{ |
emilmont | 77:869cf507173a | 231 | */ |
emilmont | 77:869cf507173a | 232 | #define CEC_FLAG_TXACKE CEC_ISR_TXACKE |
emilmont | 77:869cf507173a | 233 | #define CEC_FLAG_TXERR CEC_ISR_TXERR |
emilmont | 77:869cf507173a | 234 | #define CEC_FLAG_TXUDR CEC_ISR_TXUDR |
emilmont | 77:869cf507173a | 235 | #define CEC_FLAG_TXEND CEC_ISR_TXEND |
emilmont | 77:869cf507173a | 236 | #define CEC_FLAG_TXBR CEC_ISR_TXBR |
emilmont | 77:869cf507173a | 237 | #define CEC_FLAG_ARBLST CEC_ISR_ARBLST |
emilmont | 77:869cf507173a | 238 | #define CEC_FLAG_RXACKE CEC_ISR_RXACKE |
emilmont | 77:869cf507173a | 239 | #define CEC_FLAG_LBPE CEC_ISR_LBPE |
emilmont | 77:869cf507173a | 240 | #define CEC_FLAG_SBPE CEC_ISR_SBPE |
emilmont | 77:869cf507173a | 241 | #define CEC_FLAG_BRE CEC_ISR_BRE |
emilmont | 77:869cf507173a | 242 | #define CEC_FLAG_RXOVR CEC_ISR_RXOVR |
emilmont | 77:869cf507173a | 243 | #define CEC_FLAG_RXEND CEC_ISR_RXEND |
emilmont | 77:869cf507173a | 244 | #define CEC_FLAG_RXBR CEC_ISR_RXBR |
emilmont | 77:869cf507173a | 245 | |
emilmont | 77:869cf507173a | 246 | #define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFE000) == 0x00) && ((FLAG) != 0x00)) |
emilmont | 77:869cf507173a | 247 | |
emilmont | 77:869cf507173a | 248 | #define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_TXACKE) || \ |
emilmont | 77:869cf507173a | 249 | ((FLAG) == CEC_FLAG_TXERR)|| \ |
emilmont | 77:869cf507173a | 250 | ((FLAG) == CEC_FLAG_TXUDR)|| \ |
emilmont | 77:869cf507173a | 251 | ((FLAG) == CEC_FLAG_TXEND)|| \ |
emilmont | 77:869cf507173a | 252 | ((FLAG) == CEC_FLAG_TXBR)|| \ |
emilmont | 77:869cf507173a | 253 | ((FLAG) == CEC_FLAG_ARBLST)|| \ |
emilmont | 77:869cf507173a | 254 | ((FLAG) == CEC_FLAG_RXACKE)|| \ |
emilmont | 77:869cf507173a | 255 | ((FLAG) == CEC_FLAG_LBPE)|| \ |
emilmont | 77:869cf507173a | 256 | ((FLAG) == CEC_FLAG_SBPE)|| \ |
emilmont | 77:869cf507173a | 257 | ((FLAG) == CEC_FLAG_BRE)|| \ |
emilmont | 77:869cf507173a | 258 | ((FLAG) == CEC_FLAG_RXOVR)|| \ |
emilmont | 77:869cf507173a | 259 | ((FLAG) == CEC_FLAG_RXEND)|| \ |
emilmont | 77:869cf507173a | 260 | ((FLAG) == CEC_FLAG_RXBR)) |
emilmont | 77:869cf507173a | 261 | /** |
emilmont | 77:869cf507173a | 262 | * @} |
emilmont | 77:869cf507173a | 263 | */ |
emilmont | 77:869cf507173a | 264 | |
emilmont | 77:869cf507173a | 265 | /** |
emilmont | 77:869cf507173a | 266 | * @} |
emilmont | 77:869cf507173a | 267 | */ |
emilmont | 77:869cf507173a | 268 | |
emilmont | 77:869cf507173a | 269 | /* Exported macro ------------------------------------------------------------*/ |
emilmont | 77:869cf507173a | 270 | /* Exported functions ------------------------------------------------------- */ |
emilmont | 77:869cf507173a | 271 | |
emilmont | 77:869cf507173a | 272 | /* Function used to set the CEC configuration to the default reset state *****/ |
emilmont | 77:869cf507173a | 273 | void CEC_DeInit(void); |
emilmont | 77:869cf507173a | 274 | |
emilmont | 77:869cf507173a | 275 | /* CEC_Initialization and Configuration functions *****************************/ |
emilmont | 77:869cf507173a | 276 | void CEC_Init(CEC_InitTypeDef* CEC_InitStruct); |
emilmont | 77:869cf507173a | 277 | void CEC_StructInit(CEC_InitTypeDef* CEC_InitStruct); |
emilmont | 77:869cf507173a | 278 | void CEC_Cmd(FunctionalState NewState); |
emilmont | 77:869cf507173a | 279 | void CEC_ListenModeCmd(FunctionalState NewState); |
emilmont | 77:869cf507173a | 280 | void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress); |
emilmont | 77:869cf507173a | 281 | void CEC_OwnAddressClear(void); |
emilmont | 77:869cf507173a | 282 | |
emilmont | 77:869cf507173a | 283 | /* CEC_Data transfers functions ***********************************************/ |
emilmont | 77:869cf507173a | 284 | void CEC_SendData(uint8_t Data); |
emilmont | 77:869cf507173a | 285 | uint8_t CEC_ReceiveData(void); |
emilmont | 77:869cf507173a | 286 | void CEC_StartOfMessage(void); |
emilmont | 77:869cf507173a | 287 | void CEC_EndOfMessage(void); |
emilmont | 77:869cf507173a | 288 | |
emilmont | 77:869cf507173a | 289 | /* CEC_Interrupts and flags management functions ******************************/ |
emilmont | 77:869cf507173a | 290 | void CEC_ITConfig(uint16_t CEC_IT, FunctionalState NewState); |
emilmont | 77:869cf507173a | 291 | FlagStatus CEC_GetFlagStatus(uint16_t CEC_FLAG); |
emilmont | 77:869cf507173a | 292 | void CEC_ClearFlag(uint32_t CEC_FLAG); |
emilmont | 77:869cf507173a | 293 | ITStatus CEC_GetITStatus(uint16_t CEC_IT); |
emilmont | 77:869cf507173a | 294 | void CEC_ClearITPendingBit(uint16_t CEC_IT); |
emilmont | 77:869cf507173a | 295 | |
emilmont | 77:869cf507173a | 296 | #ifdef __cplusplus |
emilmont | 77:869cf507173a | 297 | } |
emilmont | 77:869cf507173a | 298 | #endif |
emilmont | 77:869cf507173a | 299 | |
emilmont | 77:869cf507173a | 300 | #endif /* __STM32F0XX_CEC_H */ |
emilmont | 77:869cf507173a | 301 | |
emilmont | 77:869cf507173a | 302 | /** |
emilmont | 77:869cf507173a | 303 | * @} |
emilmont | 77:869cf507173a | 304 | */ |
emilmont | 77:869cf507173a | 305 | |
emilmont | 77:869cf507173a | 306 | /** |
emilmont | 77:869cf507173a | 307 | * @} |
emilmont | 77:869cf507173a | 308 | */ |
emilmont | 77:869cf507173a | 309 | |
emilmont | 77:869cf507173a | 310 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |