29 #ifndef __STM32F4xx_DCMI_H
30 #define __STM32F4xx_DCMI_H
37 #include "stm32f4xx.h"
53 uint16_t DCMI_CaptureMode;
56 uint16_t DCMI_SynchroMode;
59 uint16_t DCMI_PCKPolarity;
62 uint16_t DCMI_VSPolarity;
65 uint16_t DCMI_HSPolarity;
68 uint16_t DCMI_CaptureRate;
71 uint16_t DCMI_ExtendedDataMode;
80 uint16_t DCMI_VerticalStartLine;
83 uint16_t DCMI_HorizontalOffsetCount;
86 uint16_t DCMI_VerticalLineCount;
89 uint16_t DCMI_CaptureCount;
114 #define DCMI_CaptureMode_Continuous ((uint16_t)0x0000)
116 #define DCMI_CaptureMode_SnapShot ((uint16_t)0x0002)
118 #define IS_DCMI_CAPTURE_MODE(MODE)(((MODE) == DCMI_CaptureMode_Continuous) || \
119 ((MODE) == DCMI_CaptureMode_SnapShot))
128 #define DCMI_SynchroMode_Hardware ((uint16_t)0x0000)
130 #define DCMI_SynchroMode_Embedded ((uint16_t)0x0010)
132 #define IS_DCMI_SYNCHRO(MODE)(((MODE) == DCMI_SynchroMode_Hardware) || \
133 ((MODE) == DCMI_SynchroMode_Embedded))
142 #define DCMI_PCKPolarity_Falling ((uint16_t)0x0000)
143 #define DCMI_PCKPolarity_Rising ((uint16_t)0x0020)
144 #define IS_DCMI_PCKPOLARITY(POLARITY)(((POLARITY) == DCMI_PCKPolarity_Falling) || \
145 ((POLARITY) == DCMI_PCKPolarity_Rising))
154 #define DCMI_VSPolarity_Low ((uint16_t)0x0000)
155 #define DCMI_VSPolarity_High ((uint16_t)0x0080)
156 #define IS_DCMI_VSPOLARITY(POLARITY)(((POLARITY) == DCMI_VSPolarity_Low) || \
157 ((POLARITY) == DCMI_VSPolarity_High))
166 #define DCMI_HSPolarity_Low ((uint16_t)0x0000)
167 #define DCMI_HSPolarity_High ((uint16_t)0x0040)
168 #define IS_DCMI_HSPOLARITY(POLARITY)(((POLARITY) == DCMI_HSPolarity_Low) || \
169 ((POLARITY) == DCMI_HSPolarity_High))
178 #define DCMI_CaptureRate_All_Frame ((uint16_t)0x0000)
179 #define DCMI_CaptureRate_1of2_Frame ((uint16_t)0x0100)
180 #define DCMI_CaptureRate_1of4_Frame ((uint16_t)0x0200)
181 #define IS_DCMI_CAPTURE_RATE(RATE) (((RATE) == DCMI_CaptureRate_All_Frame) || \
182 ((RATE) == DCMI_CaptureRate_1of2_Frame) ||\
183 ((RATE) == DCMI_CaptureRate_1of4_Frame))
192 #define DCMI_ExtendedDataMode_8b ((uint16_t)0x0000)
193 #define DCMI_ExtendedDataMode_10b ((uint16_t)0x0400)
194 #define DCMI_ExtendedDataMode_12b ((uint16_t)0x0800)
195 #define DCMI_ExtendedDataMode_14b ((uint16_t)0x0C00)
196 #define IS_DCMI_EXTENDED_DATA(DATA)(((DATA) == DCMI_ExtendedDataMode_8b) || \
197 ((DATA) == DCMI_ExtendedDataMode_10b) ||\
198 ((DATA) == DCMI_ExtendedDataMode_12b) ||\
199 ((DATA) == DCMI_ExtendedDataMode_14b))
208 #define DCMI_IT_FRAME ((uint16_t)0x0001)
209 #define DCMI_IT_OVF ((uint16_t)0x0002)
210 #define DCMI_IT_ERR ((uint16_t)0x0004)
211 #define DCMI_IT_VSYNC ((uint16_t)0x0008)
212 #define DCMI_IT_LINE ((uint16_t)0x0010)
213 #define IS_DCMI_CONFIG_IT(IT) ((((IT) & (uint16_t)0xFFE0) == 0x0000) && ((IT) != 0x0000))
214 #define IS_DCMI_GET_IT(IT) (((IT) == DCMI_IT_FRAME) || \
215 ((IT) == DCMI_IT_OVF) || \
216 ((IT) == DCMI_IT_ERR) || \
217 ((IT) == DCMI_IT_VSYNC) || \
218 ((IT) == DCMI_IT_LINE))
230 #define DCMI_FLAG_HSYNC ((uint16_t)0x2001)
231 #define DCMI_FLAG_VSYNC ((uint16_t)0x2002)
232 #define DCMI_FLAG_FNE ((uint16_t)0x2004)
236 #define DCMI_FLAG_FRAMERI ((uint16_t)0x0001)
237 #define DCMI_FLAG_OVFRI ((uint16_t)0x0002)
238 #define DCMI_FLAG_ERRRI ((uint16_t)0x0004)
239 #define DCMI_FLAG_VSYNCRI ((uint16_t)0x0008)
240 #define DCMI_FLAG_LINERI ((uint16_t)0x0010)
244 #define DCMI_FLAG_FRAMEMI ((uint16_t)0x1001)
245 #define DCMI_FLAG_OVFMI ((uint16_t)0x1002)
246 #define DCMI_FLAG_ERRMI ((uint16_t)0x1004)
247 #define DCMI_FLAG_VSYNCMI ((uint16_t)0x1008)
248 #define DCMI_FLAG_LINEMI ((uint16_t)0x1010)
249 #define IS_DCMI_GET_FLAG(FLAG) (((FLAG) == DCMI_FLAG_HSYNC) || \
250 ((FLAG) == DCMI_FLAG_VSYNC) || \
251 ((FLAG) == DCMI_FLAG_FNE) || \
252 ((FLAG) == DCMI_FLAG_FRAMERI) || \
253 ((FLAG) == DCMI_FLAG_OVFRI) || \
254 ((FLAG) == DCMI_FLAG_ERRRI) || \
255 ((FLAG) == DCMI_FLAG_VSYNCRI) || \
256 ((FLAG) == DCMI_FLAG_LINERI) || \
257 ((FLAG) == DCMI_FLAG_FRAMEMI) || \
258 ((FLAG) == DCMI_FLAG_OVFMI) || \
259 ((FLAG) == DCMI_FLAG_ERRMI) || \
260 ((FLAG) == DCMI_FLAG_VSYNCMI) || \
261 ((FLAG) == DCMI_FLAG_LINEMI))
263 #define IS_DCMI_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFE0) == 0x0000) && ((FLAG) != 0x0000))
287 void DCMI_Cmd(FunctionalState NewState);
292 void DCMI_ITConfig(uint16_t DCMI_IT, FunctionalState NewState);