|
1 | | -/** |
2 | | - * ov2640.h |
3 | | - * |
4 | | - * Created on: 23.02.2019 |
5 | | - * Modified on: 23.02.2021 |
6 | | - * |
7 | | - * Copyright 2021 SimpleMethod |
8 | | - * |
9 | | - *Permission is hereby granted, free of charge, to any person obtaining a copy of |
10 | | - *this software and associated documentation files (the "Software"), to deal in |
11 | | - *the Software without restriction, including without limitation the rights to |
12 | | - *use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
13 | | - *of the Software, and to permit persons to whom the Software is furnished to do |
14 | | - *so, subject to the following conditions: |
15 | | - * |
16 | | - *The above copyright notice and this permission notice shall be included in all |
17 | | - *copies or substantial portions of the Software. |
18 | | - * |
19 | | - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | - *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | - *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | - *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | - *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | - *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | - *THE SOFTWARE. |
26 | | - ****************************************************************************** |
27 | | - */ |
28 | | - |
29 | | -#ifndef OV2640_H_ |
30 | | -#define OV2640_H_ |
31 | | - |
32 | | -#include "main.h" |
33 | | -#include "stm32f7xx.h" |
34 | | - |
35 | | - |
36 | | - |
37 | | -enum specialEffect{Antique=0, Bluish=1, Greenish=2, Reddish=3, BlackWhite=4, Negative=5, NegativeBlackWhite=6,Normal=7}; |
38 | | -enum imageResolution{RES_160X120=15533,RES_320X240=15534,RES_640X480=15535,RES_800x600=25535,RES_1024x768=45535,RES_1280x960=65535}; |
39 | | -enum imageContrast{Contrast2=2,Contrast1=1,Contrast0=0,Contrast_1=3,Contrast_2=4}; |
40 | | -enum imageSaturation{Saturation2=2,Saturation1=1,Saturation0=0,Saturation_1=3,Saturation_2=4}; |
41 | | -enum imageBrightness{Brightness2=2,Brightness1=1,Brightness0=0,Brightness_1=3,Brightness_2=4}; |
42 | | -enum imageLightMode{Auto=0,Sunny=1,Cloudy=2,Office=3,Home=4}; |
43 | | - |
44 | | -short SCCB_Read(uint8_t reg_addr, uint8_t *pdata); |
45 | | -short SCCB_Write(uint8_t reg_addr, uint8_t data); |
46 | | - |
47 | | - |
48 | | -void OV2640_StopDCMI(void); |
49 | | -void OV2640_CaptureSnapshot(uint32_t buf_addr, int len); |
50 | | -void OV2640_ResolutionOptions(uint16_t opt); |
51 | | -void OV2640_ResolutionConfiguration(short opt); |
52 | | -void OV2640_Init(I2C_HandleTypeDef *p_hi2c, DCMI_HandleTypeDef *p_hdcmi); |
53 | | -void OV2640_Configuration(const unsigned char arr[][2]); |
54 | | -void OV2640_SpecialEffect(short specialEffect); |
55 | | -void OV2640_Contrast(short contrast); |
56 | | -void OV2640_Saturation(short saturation); |
57 | | -void OV2640_Brightness(short brightness); |
58 | | -void OV2640_LightMode(short lightMode); |
59 | | -void OV2640_SimpleWhiteBalance(); |
60 | | -void OV2640_AdvancedWhiteBalance(); |
61 | | - |
62 | | -#endif /* OV2640_H_ */ |
| 1 | +/** |
| 2 | + * ov2640.h |
| 3 | + * |
| 4 | + * Created on: 23.02.2019 |
| 5 | + * Modified on: 23.02.2021 |
| 6 | + * |
| 7 | + * Copyright 2021 SimpleMethod |
| 8 | + * |
| 9 | + *Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 10 | + *this software and associated documentation files (the "Software"), to deal in |
| 11 | + *the Software without restriction, including without limitation the rights to |
| 12 | + *use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
| 13 | + *of the Software, and to permit persons to whom the Software is furnished to do |
| 14 | + *so, subject to the following conditions: |
| 15 | + * |
| 16 | + *The above copyright notice and this permission notice shall be included in all |
| 17 | + *copies or substantial portions of the Software. |
| 18 | + * |
| 19 | + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 20 | + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 | + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 22 | + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 23 | + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 24 | + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 25 | + *THE SOFTWARE. |
| 26 | + ****************************************************************************** |
| 27 | + */ |
| 28 | + |
| 29 | +#ifndef OV2640_H_ |
| 30 | +#define OV2640_H_ |
| 31 | + |
| 32 | +#include "main.h" |
| 33 | +#include "stm32f7xx.h" |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +enum specialEffect{Antique=0, Bluish=1, Greenish=2, Reddish=3, BlackWhite=4, Negative=5, NegativeBlackWhite=6,Normal=7}; |
| 38 | +enum imageResolution{RES_160X120=15533,RES_320X240=15534,RES_640X480=15535,RES_800x600=25535,RES_1024x768=45535,RES_1280x960=65535}; |
| 39 | +enum imageContrast{Contrast2=2,Contrast1=1,Contrast0=0,Contrast_1=3,Contrast_2=4}; |
| 40 | +enum imageSaturation{Saturation2=2,Saturation1=1,Saturation0=0,Saturation_1=3,Saturation_2=4}; |
| 41 | +enum imageBrightness{Brightness2=2,Brightness1=1,Brightness0=0,Brightness_1=3,Brightness_2=4}; |
| 42 | +enum imageLightMode{Auto=0,Sunny=1,Cloudy=2,Office=3,Home=4}; |
| 43 | + |
| 44 | +short SCCB_Read(uint8_t reg_addr, uint8_t *pdata); |
| 45 | +short SCCB_Write(uint8_t reg_addr, uint8_t data); |
| 46 | + |
| 47 | + |
| 48 | +void OV2640_StopDCMI(void); |
| 49 | +void OV2640_CaptureSnapshot(uint32_t buf_addr, int len); |
| 50 | +void OV2640_ResolutionOptions(uint16_t opt); |
| 51 | +void OV2640_ResolutionConfiguration(short opt); |
| 52 | +void OV2640_Init(I2C_HandleTypeDef *p_hi2c, DCMI_HandleTypeDef *p_hdcmi); |
| 53 | +void OV2640_Configuration(const unsigned char arr[][2]); |
| 54 | +void OV2640_SpecialEffect(short specialEffect); |
| 55 | +void OV2640_Contrast(short contrast); |
| 56 | +void OV2640_Saturation(short saturation); |
| 57 | +void OV2640_Brightness(short brightness); |
| 58 | +void OV2640_LightMode(short lightMode); |
| 59 | +void OV2640_SimpleWhiteBalance(); |
| 60 | +void OV2640_AdvancedWhiteBalance(); |
| 61 | + |
| 62 | +#endif /* OV2640_H_ */ |
0 commit comments