STM32746G-Discovery board drivers V1.0.0

Dependents:   DISCO-F746NG_LCDTS_CC3000_NTP DISCO-F746NG_ROPE_WIFI F746_SpectralAnalysis_NoPhoto ecte433 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ov9655.h Source File

ov9655.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    ov9655.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains all the functions prototypes for the ov9655.c
00006   *          driver.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
00011   *
00012   * Redistribution and use in source and binary forms, with or without modification,
00013   * are permitted provided that the following conditions are met:
00014   *   1. Redistributions of source code must retain the above copyright notice,
00015   *      this list of conditions and the following disclaimer.
00016   *   2. Redistributions in binary form must reproduce the above copyright notice,
00017   *      this list of conditions and the following disclaimer in the documentation
00018   *      and/or other materials provided with the distribution.
00019   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00020   *      may be used to endorse or promote products derived from this software
00021   *      without specific prior written permission.
00022   *
00023   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00026   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00027   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00028   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033   *
00034   ******************************************************************************
00035   */ 
00036 
00037 /* Define to prevent recursive inclusion -------------------------------------*/
00038 #ifndef __OV9655_H
00039 #define __OV9655_H
00040 
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif 
00044 
00045 /* Includes ------------------------------------------------------------------*/
00046 #include "../Common/camera.h"
00047    
00048 /** @addtogroup BSP
00049   * @{
00050   */ 
00051 
00052 /** @addtogroup Components
00053   * @{
00054   */ 
00055   
00056 /** @addtogroup ov9655
00057   * @{
00058   */
00059 
00060 /** @defgroup OV9655_Exported_Types
00061   * @{
00062   */
00063      
00064 /**
00065   * @}
00066   */ 
00067 
00068 /** @defgroup OV9655_Exported_Constants
00069   * @{
00070   */
00071 /** 
00072   * @brief  OV9655 ID  
00073   */  
00074 #define  OV9655_ID    0x96
00075 /** 
00076   * @brief  OV9655 Registers  
00077   */
00078 
00079 /* OV9655 Registers definition */
00080 #define OV9655_SENSOR_PIDH              0x0A
00081 #define OV9655_SENSOR_PIDL              0x0B
00082 #define OV9655_SENSOR_COM7              0x12
00083 #define OV9655_SENSOR_TSLB              0x3A
00084 #define OV9655_SENSOR_MTX1              0x4F
00085 #define OV9655_SENSOR_MTX2              0x50
00086 #define OV9655_SENSOR_MTX3              0x51
00087 #define OV9655_SENSOR_MTX4              0x52
00088 #define OV9655_SENSOR_MTX5              0x53
00089 #define OV9655_SENSOR_MTX6              0x54
00090 #define OV9655_SENSOR_BRTN              0x55
00091 #define OV9655_SENSOR_CNST1             0x56
00092 #define OV9655_SENSOR_CNST2             0x57
00093 
00094 /** 
00095  * @brief  OV9655 Features Parameters  
00096  */
00097 #define OV9655_BRIGHTNESS_LEVEL0        0xB0     /* Brightness level -2         */
00098 #define OV9655_BRIGHTNESS_LEVEL1        0x98     /* Brightness level -1         */
00099 #define OV9655_BRIGHTNESS_LEVEL2        0x00     /* Brightness level 0          */
00100 #define OV9655_BRIGHTNESS_LEVEL3        0x18     /* Brightness level +1         */
00101 #define OV9655_BRIGHTNESS_LEVEL4        0x30     /* Brightness level +2         */
00102 
00103 #define OV9655_BLACK_WHITE_BW           0xCC000000000000  /* Black and white effect      */
00104 #define OV9655_BLACK_WHITE_NEGATIVE     0xEC808000008080  /* Negative effect             */
00105 #define OV9655_BLACK_WHITE_BW_NEGATIVE  0xEC000000000000  /* BW and Negative effect      */
00106 #define OV9655_BLACK_WHITE_NORMAL       0xCC808000008080  /* Normal effect               */
00107 
00108 #define OV9655_CONTRAST_LEVEL0          0x30     /* Contrast level -2           */
00109 #define OV9655_CONTRAST_LEVEL1          0x38     /* Contrast level -1           */
00110 #define OV9655_CONTRAST_LEVEL2          0x40     /* Contrast level 0            */
00111 #define OV9655_CONTRAST_LEVEL3          0x50     /* Contrast level +1           */
00112 #define OV9655_CONTRAST_LEVEL4          0x60     /* Contrast level +2           */
00113 
00114 #define OV9655_COLOR_EFFECT_NONE        0xCC808000008080  /* No color effect             */
00115 #define OV9655_COLOR_EFFECT_ANTIQUE     0xCC000020F00000  /* Antique effect              */
00116 #define OV9655_COLOR_EFFECT_BLUE        0xCC000000000060  /* Blue effect                 */
00117 #define OV9655_COLOR_EFFECT_GREEN       0xCC000000008000  /* Green effect                */
00118 #define OV9655_COLOR_EFFECT_RED         0xCC600000000000  /* Red effect                  */
00119 /**
00120   * @}
00121   */
00122   
00123 /** @defgroup OV9655_Exported_Functions
00124   * @{
00125   */ 
00126 void     ov9655_Init(uint16_t DeviceAddr, uint32_t resolution);
00127 void     ov9655_Config(uint16_t DeviceAddr, uint32_t feature, uint32_t value, uint32_t BR_value);
00128 uint16_t ov9655_ReadID(uint16_t DeviceAddr);
00129 
00130 void     CAMERA_IO_Init(void);
00131 void     CAMERA_IO_Write(uint8_t addr, uint8_t reg, uint8_t value);
00132 uint8_t  CAMERA_IO_Read(uint8_t addr, uint8_t reg);
00133 void     CAMERA_Delay(uint32_t delay);
00134 
00135 /* CAMERA driver structure */
00136 extern CAMERA_DrvTypeDef   ov9655_drv;
00137 /**
00138   * @}
00139   */    
00140 #ifdef __cplusplus
00141 }
00142 #endif
00143 
00144 #endif /* __OV9655_H */
00145 /**
00146   * @}
00147   */ 
00148 
00149 /**
00150   * @}
00151   */ 
00152 
00153 /**
00154   * @}
00155   */ 
00156 
00157 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/