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