stm32f10x_cec.h
Go to the documentation of this file.
1 
23 /* Define to prevent recursive inclusion -------------------------------------*/
24 #ifndef __STM32F10x_CEC_H
25 #define __STM32F10x_CEC_H
26 
27 #ifdef __cplusplus
28  extern "C" {
29 #endif
30 
31 /* Includes ------------------------------------------------------------------*/
32 #include "stm32f10x.h"
33 
50 typedef struct
51 {
52  uint16_t CEC_BitTimingMode;
54  uint16_t CEC_BitPeriodMode;
57 
69 #define CEC_BitTimingStdMode ((uint16_t)0x00)
70 #define CEC_BitTimingErrFreeMode CEC_CFGR_BTEM
72 #define IS_CEC_BIT_TIMING_ERROR_MODE(MODE) (((MODE) == CEC_BitTimingStdMode) || \
73  ((MODE) == CEC_BitTimingErrFreeMode))
74 
81 #define CEC_BitPeriodStdMode ((uint16_t)0x00)
82 #define CEC_BitPeriodFlexibleMode CEC_CFGR_BPEM
84 #define IS_CEC_BIT_PERIOD_ERROR_MODE(MODE) (((MODE) == CEC_BitPeriodStdMode) || \
85  ((MODE) == CEC_BitPeriodFlexibleMode))
86 
94 #define CEC_IT_TERR CEC_CSR_TERR
95 #define CEC_IT_TBTRF CEC_CSR_TBTRF
96 #define CEC_IT_RERR CEC_CSR_RERR
97 #define CEC_IT_RBTF CEC_CSR_RBTF
98 #define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TERR) || ((IT) == CEC_IT_TBTRF) || \
99  ((IT) == CEC_IT_RERR) || ((IT) == CEC_IT_RBTF))
100 
108 #define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10)
109 
116 #define IS_CEC_PRESCALER(PRESCALER) ((PRESCALER) <= 0x3FFF)
117 
129 #define CEC_FLAG_BTE ((uint32_t)0x10010000)
130 #define CEC_FLAG_BPE ((uint32_t)0x10020000)
131 #define CEC_FLAG_RBTFE ((uint32_t)0x10040000)
132 #define CEC_FLAG_SBE ((uint32_t)0x10080000)
133 #define CEC_FLAG_ACKE ((uint32_t)0x10100000)
134 #define CEC_FLAG_LINE ((uint32_t)0x10200000)
135 #define CEC_FLAG_TBTFE ((uint32_t)0x10400000)
136 
140 #define CEC_FLAG_TEOM ((uint32_t)0x00000002)
141 #define CEC_FLAG_TERR ((uint32_t)0x00000004)
142 #define CEC_FLAG_TBTRF ((uint32_t)0x00000008)
143 #define CEC_FLAG_RSOM ((uint32_t)0x00000010)
144 #define CEC_FLAG_REOM ((uint32_t)0x00000020)
145 #define CEC_FLAG_RERR ((uint32_t)0x00000040)
146 #define CEC_FLAG_RBTF ((uint32_t)0x00000080)
147 
148 #define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFF03) == 0x00) && ((FLAG) != 0x00))
149 
150 #define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_BTE) || ((FLAG) == CEC_FLAG_BPE) || \
151  ((FLAG) == CEC_FLAG_RBTFE) || ((FLAG)== CEC_FLAG_SBE) || \
152  ((FLAG) == CEC_FLAG_ACKE) || ((FLAG) == CEC_FLAG_LINE) || \
153  ((FLAG) == CEC_FLAG_TBTFE) || ((FLAG) == CEC_FLAG_TEOM) || \
154  ((FLAG) == CEC_FLAG_TERR) || ((FLAG) == CEC_FLAG_TBTRF) || \
155  ((FLAG) == CEC_FLAG_RSOM) || ((FLAG) == CEC_FLAG_REOM) || \
156  ((FLAG) == CEC_FLAG_RERR) || ((FLAG) == CEC_FLAG_RBTF))
157 
177 void CEC_DeInit(void);
178 void CEC_Init(CEC_InitTypeDef* CEC_InitStruct);
179 void CEC_Cmd(FunctionalState NewState);
180 void CEC_ITConfig(FunctionalState NewState);
181 void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress);
182 void CEC_SetPrescaler(uint16_t CEC_Prescaler);
183 void CEC_SendDataByte(uint8_t Data);
184 uint8_t CEC_ReceiveDataByte(void);
185 void CEC_StartOfMessage(void);
186 void CEC_EndOfMessageCmd(FunctionalState NewState);
187 FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG);
188 void CEC_ClearFlag(uint32_t CEC_FLAG);
189 ITStatus CEC_GetITStatus(uint8_t CEC_IT);
190 void CEC_ClearITPendingBit(uint16_t CEC_IT);
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif /* __STM32F10x_CEC_H */
197 
210 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
FlagStatus
Definition: stm32f4xx.h:706
uint16_t CEC_BitPeriodMode
Definition: stm32f10x_cec.h:54
void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress)
Defines the Own Address of the CEC device.
FunctionalState
Definition: stm32f4xx.h:708
void CEC_Init(CEC_InitTypeDef *CEC_InitStruct)
Initializes the CEC peripheral according to the specified parameters in the CEC_InitStruct.
void CEC_EndOfMessageCmd(FunctionalState NewState)
Transmits message with or without an EOM bit.
void CEC_SendDataByte(uint8_t Data)
Transmits single data through the CEC peripheral.
enum FlagStatus ITStatus
uint16_t CEC_BitTimingMode
Definition: stm32f10x_cec.h:52
uint8_t CEC_ReceiveDataByte(void)
Returns the most recent received data by the CEC peripheral.
void CEC_ITConfig(FunctionalState NewState)
Enables or disables the CEC interrupt.
void CEC_Cmd(FunctionalState NewState)
Enables or disables the specified CEC peripheral.
void CEC_DeInit(void)
Deinitializes the CEC peripheral registers to their default reset values.
void CEC_ClearFlag(uint32_t CEC_FLAG)
Clears the CEC&#39;s pending flags.
FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG)
Gets the CEC flag status.
CMSIS Cortex-M3 Device Peripheral Access Layer Header File. This file contains all the peripheral reg...
ITStatus CEC_GetITStatus(uint8_t CEC_IT)
Checks whether the specified CEC interrupt has occurred or not.
void CEC_ClearITPendingBit(uint16_t CEC_IT)
Clears the CEC&#39;s interrupt pending bits.
void CEC_SetPrescaler(uint16_t CEC_Prescaler)
Sets the CEC prescaler value.
CEC Init structure definition.
Definition: stm32f10x_cec.h:50
void CEC_StartOfMessage(void)
Starts a new message.


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:19