BSP files for STM32H747I-Discovery Copy from ST Cube delivery

Dependents:   DISCO_H747I_LCD_demo DISCO_H747I_AUDIO_demo

Committer:
Jerome Coutant
Date:
Wed Nov 06 11:32:01 2019 +0100
Revision:
3:bc403474b366
Parent:
0:146cf26a9bbb
Add PDM lib

Who changed what in which revision?

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