STM32746G-Discovery board drivers V1.0.0
Dependents: DISCO-F746NG_LCDTS_CC3000_NTP DISCO-F746NG_ROPE_WIFI F746_SpectralAnalysis_NoPhoto ecte433 ... more
Drivers/BSP/Components/ov9655/ov9655.h@13:85dbcff443aa, 2019-11-27 (annotated)
- Committer:
- jeromecoutant
- Date:
- Wed Nov 27 08:29:42 2019 +0000
- Revision:
- 13:85dbcff443aa
- Parent:
- 10:1050c589b2ad
Fix OV9655 Camera Driver
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 6:e1d9da7fe856 | 1 | /** |
bcostm | 6:e1d9da7fe856 | 2 | ****************************************************************************** |
bcostm | 6:e1d9da7fe856 | 3 | * @file ov9655.h |
bcostm | 6:e1d9da7fe856 | 4 | * @author MCD Application Team |
bcostm | 6:e1d9da7fe856 | 5 | * @brief This file contains all the functions prototypes for the ov9655.c |
bcostm | 6:e1d9da7fe856 | 6 | * driver. |
bcostm | 6:e1d9da7fe856 | 7 | ****************************************************************************** |
bcostm | 6:e1d9da7fe856 | 8 | * @attention |
bcostm | 6:e1d9da7fe856 | 9 | * |
bcostm | 6:e1d9da7fe856 | 10 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
bcostm | 6:e1d9da7fe856 | 11 | * |
bcostm | 6:e1d9da7fe856 | 12 | * Redistribution and use in source and binary forms, with or without modification, |
bcostm | 6:e1d9da7fe856 | 13 | * are permitted provided that the following conditions are met: |
bcostm | 6:e1d9da7fe856 | 14 | * 1. Redistributions of source code must retain the above copyright notice, |
bcostm | 6:e1d9da7fe856 | 15 | * this list of conditions and the following disclaimer. |
bcostm | 6:e1d9da7fe856 | 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bcostm | 6:e1d9da7fe856 | 17 | * this list of conditions and the following disclaimer in the documentation |
bcostm | 6:e1d9da7fe856 | 18 | * and/or other materials provided with the distribution. |
bcostm | 6:e1d9da7fe856 | 19 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bcostm | 6:e1d9da7fe856 | 20 | * may be used to endorse or promote products derived from this software |
bcostm | 6:e1d9da7fe856 | 21 | * without specific prior written permission. |
bcostm | 6:e1d9da7fe856 | 22 | * |
bcostm | 6:e1d9da7fe856 | 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bcostm | 6:e1d9da7fe856 | 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bcostm | 6:e1d9da7fe856 | 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bcostm | 6:e1d9da7fe856 | 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bcostm | 6:e1d9da7fe856 | 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bcostm | 6:e1d9da7fe856 | 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bcostm | 6:e1d9da7fe856 | 29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bcostm | 6:e1d9da7fe856 | 30 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bcostm | 6:e1d9da7fe856 | 31 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bcostm | 6:e1d9da7fe856 | 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bcostm | 6:e1d9da7fe856 | 33 | * |
bcostm | 6:e1d9da7fe856 | 34 | ****************************************************************************** |
bcostm | 6:e1d9da7fe856 | 35 | */ |
bcostm | 6:e1d9da7fe856 | 36 | |
bcostm | 6:e1d9da7fe856 | 37 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bcostm | 6:e1d9da7fe856 | 38 | #ifndef __OV9655_H |
bcostm | 6:e1d9da7fe856 | 39 | #define __OV9655_H |
bcostm | 6:e1d9da7fe856 | 40 | |
bcostm | 6:e1d9da7fe856 | 41 | #ifdef __cplusplus |
bcostm | 6:e1d9da7fe856 | 42 | extern "C" { |
bcostm | 6:e1d9da7fe856 | 43 | #endif |
bcostm | 6:e1d9da7fe856 | 44 | |
bcostm | 6:e1d9da7fe856 | 45 | /* Includes ------------------------------------------------------------------*/ |
bcostm | 6:e1d9da7fe856 | 46 | #include "../Common/camera.h" |
bcostm | 6:e1d9da7fe856 | 47 | |
bcostm | 6:e1d9da7fe856 | 48 | /** @addtogroup BSP |
bcostm | 6:e1d9da7fe856 | 49 | * @{ |
bcostm | 6:e1d9da7fe856 | 50 | */ |
bcostm | 6:e1d9da7fe856 | 51 | |
bcostm | 6:e1d9da7fe856 | 52 | /** @addtogroup Components |
bcostm | 6:e1d9da7fe856 | 53 | * @{ |
bcostm | 6:e1d9da7fe856 | 54 | */ |
bcostm | 6:e1d9da7fe856 | 55 | |
bcostm | 6:e1d9da7fe856 | 56 | /** @addtogroup ov9655 |
bcostm | 6:e1d9da7fe856 | 57 | * @{ |
bcostm | 6:e1d9da7fe856 | 58 | */ |
bcostm | 6:e1d9da7fe856 | 59 | |
bcostm | 6:e1d9da7fe856 | 60 | /** @defgroup OV9655_Exported_Types |
bcostm | 6:e1d9da7fe856 | 61 | * @{ |
bcostm | 6:e1d9da7fe856 | 62 | */ |
bcostm | 6:e1d9da7fe856 | 63 | |
bcostm | 6:e1d9da7fe856 | 64 | /** |
bcostm | 6:e1d9da7fe856 | 65 | * @} |
bcostm | 6:e1d9da7fe856 | 66 | */ |
bcostm | 6:e1d9da7fe856 | 67 | |
bcostm | 6:e1d9da7fe856 | 68 | /** @defgroup OV9655_Exported_Constants |
bcostm | 6:e1d9da7fe856 | 69 | * @{ |
bcostm | 6:e1d9da7fe856 | 70 | */ |
bcostm | 6:e1d9da7fe856 | 71 | /** |
bcostm | 6:e1d9da7fe856 | 72 | * @brief OV9655 ID |
bcostm | 6:e1d9da7fe856 | 73 | */ |
bcostm | 6:e1d9da7fe856 | 74 | #define OV9655_ID 0x96 |
bcostm | 6:e1d9da7fe856 | 75 | /** |
bcostm | 6:e1d9da7fe856 | 76 | * @brief OV9655 Registers |
bcostm | 6:e1d9da7fe856 | 77 | */ |
bcostm | 6:e1d9da7fe856 | 78 | |
bcostm | 6:e1d9da7fe856 | 79 | /* OV9655 Registers definition */ |
bcostm | 6:e1d9da7fe856 | 80 | #define OV9655_SENSOR_PIDH 0x0A |
bcostm | 6:e1d9da7fe856 | 81 | #define OV9655_SENSOR_PIDL 0x0B |
bcostm | 6:e1d9da7fe856 | 82 | #define OV9655_SENSOR_COM7 0x12 |
bcostm | 6:e1d9da7fe856 | 83 | #define OV9655_SENSOR_TSLB 0x3A |
bcostm | 6:e1d9da7fe856 | 84 | #define OV9655_SENSOR_MTX1 0x4F |
bcostm | 6:e1d9da7fe856 | 85 | #define OV9655_SENSOR_MTX2 0x50 |
bcostm | 6:e1d9da7fe856 | 86 | #define OV9655_SENSOR_MTX3 0x51 |
bcostm | 6:e1d9da7fe856 | 87 | #define OV9655_SENSOR_MTX4 0x52 |
bcostm | 6:e1d9da7fe856 | 88 | #define OV9655_SENSOR_MTX5 0x53 |
bcostm | 6:e1d9da7fe856 | 89 | #define OV9655_SENSOR_MTX6 0x54 |
bcostm | 6:e1d9da7fe856 | 90 | #define OV9655_SENSOR_BRTN 0x55 |
bcostm | 6:e1d9da7fe856 | 91 | #define OV9655_SENSOR_CNST1 0x56 |
bcostm | 6:e1d9da7fe856 | 92 | #define OV9655_SENSOR_CNST2 0x57 |
bcostm | 6:e1d9da7fe856 | 93 | |
bcostm | 6:e1d9da7fe856 | 94 | /** |
bcostm | 6:e1d9da7fe856 | 95 | * @brief OV9655 Features Parameters |
bcostm | 6:e1d9da7fe856 | 96 | */ |
bcostm | 6:e1d9da7fe856 | 97 | #define OV9655_BRIGHTNESS_LEVEL0 0xB0 /* Brightness level -2 */ |
bcostm | 6:e1d9da7fe856 | 98 | #define OV9655_BRIGHTNESS_LEVEL1 0x98 /* Brightness level -1 */ |
bcostm | 6:e1d9da7fe856 | 99 | #define OV9655_BRIGHTNESS_LEVEL2 0x00 /* Brightness level 0 */ |
bcostm | 6:e1d9da7fe856 | 100 | #define OV9655_BRIGHTNESS_LEVEL3 0x18 /* Brightness level +1 */ |
bcostm | 6:e1d9da7fe856 | 101 | #define OV9655_BRIGHTNESS_LEVEL4 0x30 /* Brightness level +2 */ |
bcostm | 6:e1d9da7fe856 | 102 | |
bcostm | 6:e1d9da7fe856 | 103 | #define OV9655_BLACK_WHITE_BW 0xCC000000000000 /* Black and white effect */ |
bcostm | 6:e1d9da7fe856 | 104 | #define OV9655_BLACK_WHITE_NEGATIVE 0xEC808000008080 /* Negative effect */ |
bcostm | 6:e1d9da7fe856 | 105 | #define OV9655_BLACK_WHITE_BW_NEGATIVE 0xEC000000000000 /* BW and Negative effect */ |
bcostm | 6:e1d9da7fe856 | 106 | #define OV9655_BLACK_WHITE_NORMAL 0xCC808000008080 /* Normal effect */ |
bcostm | 6:e1d9da7fe856 | 107 | |
bcostm | 6:e1d9da7fe856 | 108 | #define OV9655_CONTRAST_LEVEL0 0x30 /* Contrast level -2 */ |
bcostm | 6:e1d9da7fe856 | 109 | #define OV9655_CONTRAST_LEVEL1 0x38 /* Contrast level -1 */ |
bcostm | 6:e1d9da7fe856 | 110 | #define OV9655_CONTRAST_LEVEL2 0x40 /* Contrast level 0 */ |
bcostm | 6:e1d9da7fe856 | 111 | #define OV9655_CONTRAST_LEVEL3 0x50 /* Contrast level +1 */ |
bcostm | 6:e1d9da7fe856 | 112 | #define OV9655_CONTRAST_LEVEL4 0x60 /* Contrast level +2 */ |
bcostm | 6:e1d9da7fe856 | 113 | |
bcostm | 6:e1d9da7fe856 | 114 | #define OV9655_COLOR_EFFECT_NONE 0xCC808000008080 /* No color effect */ |
bcostm | 6:e1d9da7fe856 | 115 | #define OV9655_COLOR_EFFECT_ANTIQUE 0xCC000020F00000 /* Antique effect */ |
bcostm | 6:e1d9da7fe856 | 116 | #define OV9655_COLOR_EFFECT_BLUE 0xCC000000000060 /* Blue effect */ |
bcostm | 6:e1d9da7fe856 | 117 | #define OV9655_COLOR_EFFECT_GREEN 0xCC000000008000 /* Green effect */ |
bcostm | 6:e1d9da7fe856 | 118 | #define OV9655_COLOR_EFFECT_RED 0xCC600000000000 /* Red effect */ |
bcostm | 6:e1d9da7fe856 | 119 | /** |
bcostm | 6:e1d9da7fe856 | 120 | * @} |
bcostm | 6:e1d9da7fe856 | 121 | */ |
bcostm | 6:e1d9da7fe856 | 122 | |
bcostm | 6:e1d9da7fe856 | 123 | /** @defgroup OV9655_Exported_Functions |
bcostm | 6:e1d9da7fe856 | 124 | * @{ |
bcostm | 6:e1d9da7fe856 | 125 | */ |
bcostm | 6:e1d9da7fe856 | 126 | void ov9655_Init(uint16_t DeviceAddr, uint32_t resolution); |
bcostm | 6:e1d9da7fe856 | 127 | void ov9655_Config(uint16_t DeviceAddr, uint32_t feature, uint32_t value, uint32_t BR_value); |
bcostm | 6:e1d9da7fe856 | 128 | uint16_t ov9655_ReadID(uint16_t DeviceAddr); |
bcostm | 6:e1d9da7fe856 | 129 | |
bcostm | 6:e1d9da7fe856 | 130 | void CAMERA_IO_Init(void); |
bcostm | 6:e1d9da7fe856 | 131 | void CAMERA_IO_Write(uint8_t addr, uint8_t reg, uint8_t value); |
bcostm | 6:e1d9da7fe856 | 132 | uint8_t CAMERA_IO_Read(uint8_t addr, uint8_t reg); |
bcostm | 6:e1d9da7fe856 | 133 | void CAMERA_Delay(uint32_t delay); |
bcostm | 6:e1d9da7fe856 | 134 | |
bcostm | 6:e1d9da7fe856 | 135 | /* CAMERA driver structure */ |
bcostm | 6:e1d9da7fe856 | 136 | extern CAMERA_DrvTypeDef ov9655_drv; |
bcostm | 6:e1d9da7fe856 | 137 | /** |
bcostm | 6:e1d9da7fe856 | 138 | * @} |
bcostm | 6:e1d9da7fe856 | 139 | */ |
bcostm | 6:e1d9da7fe856 | 140 | #ifdef __cplusplus |
bcostm | 6:e1d9da7fe856 | 141 | } |
bcostm | 6:e1d9da7fe856 | 142 | #endif |
bcostm | 6:e1d9da7fe856 | 143 | |
bcostm | 6:e1d9da7fe856 | 144 | #endif /* __OV9655_H */ |
bcostm | 6:e1d9da7fe856 | 145 | /** |
bcostm | 6:e1d9da7fe856 | 146 | * @} |
bcostm | 6:e1d9da7fe856 | 147 | */ |
bcostm | 6:e1d9da7fe856 | 148 | |
bcostm | 6:e1d9da7fe856 | 149 | /** |
bcostm | 6:e1d9da7fe856 | 150 | * @} |
bcostm | 6:e1d9da7fe856 | 151 | */ |
bcostm | 6:e1d9da7fe856 | 152 | |
bcostm | 6:e1d9da7fe856 | 153 | /** |
bcostm | 6:e1d9da7fe856 | 154 | * @} |
bcostm | 6:e1d9da7fe856 | 155 | */ |
bcostm | 6:e1d9da7fe856 | 156 | |
bcostm | 6:e1d9da7fe856 | 157 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |