STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_cec.h
Go to the documentation of this file.
00001 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM32F10x_CEC_H
00025 #define __STM32F10x_CEC_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f10x.h"
00033 
00050 typedef struct
00051 {
00052   uint16_t CEC_BitTimingMode; 
00054   uint16_t CEC_BitPeriodMode; 
00056 }CEC_InitTypeDef;
00057 
00069 #define CEC_BitTimingStdMode                    ((uint16_t)0x00) 
00070 #define CEC_BitTimingErrFreeMode                CEC_CFGR_BTEM   
00072 #define IS_CEC_BIT_TIMING_ERROR_MODE(MODE) (((MODE) == CEC_BitTimingStdMode) || \
00073                                             ((MODE) == CEC_BitTimingErrFreeMode))
00074 
00081 #define CEC_BitPeriodStdMode                    ((uint16_t)0x00) 
00082 #define CEC_BitPeriodFlexibleMode                CEC_CFGR_BPEM   
00084 #define IS_CEC_BIT_PERIOD_ERROR_MODE(MODE) (((MODE) == CEC_BitPeriodStdMode) || \
00085                                             ((MODE) == CEC_BitPeriodFlexibleMode))
00086 
00094 #define CEC_IT_TERR                              CEC_CSR_TERR
00095 #define CEC_IT_TBTRF                             CEC_CSR_TBTRF
00096 #define CEC_IT_RERR                              CEC_CSR_RERR
00097 #define CEC_IT_RBTF                              CEC_CSR_RBTF
00098 #define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TERR) || ((IT) == CEC_IT_TBTRF) || \
00099                            ((IT) == CEC_IT_RERR) || ((IT) == CEC_IT_RBTF))
00100 
00108 #define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10)
00109 
00116 #define IS_CEC_PRESCALER(PRESCALER) ((PRESCALER) <= 0x3FFF)
00117 
00129 #define CEC_FLAG_BTE                            ((uint32_t)0x10010000)
00130 #define CEC_FLAG_BPE                            ((uint32_t)0x10020000)
00131 #define CEC_FLAG_RBTFE                          ((uint32_t)0x10040000)
00132 #define CEC_FLAG_SBE                            ((uint32_t)0x10080000)
00133 #define CEC_FLAG_ACKE                           ((uint32_t)0x10100000)
00134 #define CEC_FLAG_LINE                           ((uint32_t)0x10200000)
00135 #define CEC_FLAG_TBTFE                          ((uint32_t)0x10400000)
00136 
00140 #define CEC_FLAG_TEOM                           ((uint32_t)0x00000002)  
00141 #define CEC_FLAG_TERR                           ((uint32_t)0x00000004)
00142 #define CEC_FLAG_TBTRF                          ((uint32_t)0x00000008)
00143 #define CEC_FLAG_RSOM                           ((uint32_t)0x00000010)
00144 #define CEC_FLAG_REOM                           ((uint32_t)0x00000020)
00145 #define CEC_FLAG_RERR                           ((uint32_t)0x00000040)
00146 #define CEC_FLAG_RBTF                           ((uint32_t)0x00000080)
00147 
00148 #define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFF03) == 0x00) && ((FLAG) != 0x00))
00149                                
00150 #define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_BTE) || ((FLAG) == CEC_FLAG_BPE) || \
00151                                ((FLAG) == CEC_FLAG_RBTFE) || ((FLAG)== CEC_FLAG_SBE) || \
00152                                ((FLAG) == CEC_FLAG_ACKE) || ((FLAG) == CEC_FLAG_LINE) || \
00153                                ((FLAG) == CEC_FLAG_TBTFE) || ((FLAG) == CEC_FLAG_TEOM) || \
00154                                ((FLAG) == CEC_FLAG_TERR) || ((FLAG) == CEC_FLAG_TBTRF) || \
00155                                ((FLAG) == CEC_FLAG_RSOM) || ((FLAG) == CEC_FLAG_REOM) || \
00156                                ((FLAG) == CEC_FLAG_RERR) || ((FLAG) == CEC_FLAG_RBTF))
00157 
00177 void CEC_DeInit(void);
00178 void CEC_Init(CEC_InitTypeDef* CEC_InitStruct);
00179 void CEC_Cmd(FunctionalState NewState);
00180 void CEC_ITConfig(FunctionalState NewState);
00181 void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress);
00182 void CEC_SetPrescaler(uint16_t CEC_Prescaler);
00183 void CEC_SendDataByte(uint8_t Data);
00184 uint8_t CEC_ReceiveDataByte(void);
00185 void CEC_StartOfMessage(void);
00186 void CEC_EndOfMessageCmd(FunctionalState NewState);
00187 FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG);
00188 void CEC_ClearFlag(uint32_t CEC_FLAG);
00189 ITStatus CEC_GetITStatus(uint8_t CEC_IT);
00190 void CEC_ClearITPendingBit(uint16_t CEC_IT);
00191 
00192 #ifdef __cplusplus
00193 }
00194 #endif
00195 
00196 #endif /* __STM32F10x_CEC_H */
00197 
00210 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/