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