BSP files for STM32H747I-Discovery Copy from ST Cube delivery
Dependents: DISCO_H747I_LCD_demo DISCO_H747I_AUDIO_demo
STM32H747I-Discovery/stm32h747i_discovery_camera.h@0:146cf26a9bbb, 2019-09-25 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Wed Sep 25 13:37:39 2019 +0200
- Revision:
- 0:146cf26a9bbb
STM32Cube_FW_H7_V1.5.0 BSP STM32H747I-DISCO
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jerome Coutant
0:146cf26a9bbb
|
1
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
2
|
******************************************************************************
|
|
Jerome Coutant
0:146cf26a9bbb
|
3
|
* @file stm32h747i_discovery.h
|
|
Jerome Coutant
0:146cf26a9bbb
|
4
|
* @author MCD Application Team
|
|
Jerome Coutant
0:146cf26a9bbb
|
5
|
* @brief This file contains the common defines and functions prototypes for
|
|
Jerome Coutant
0:146cf26a9bbb
|
6
|
* the STM32H747I_DISCOVERY_camera.c driver.
|
|
Jerome Coutant
0:146cf26a9bbb
|
7
|
******************************************************************************
|
|
Jerome Coutant
0:146cf26a9bbb
|
8
|
* @attention
|
|
Jerome Coutant
0:146cf26a9bbb
|
9
|
*
|
|
Jerome Coutant
0:146cf26a9bbb
|
10
|
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
|
Jerome Coutant
0:146cf26a9bbb
|
11
|
* All rights reserved.</center></h2>
|
|
Jerome Coutant
0:146cf26a9bbb
|
12
|
*
|
|
Jerome Coutant
0:146cf26a9bbb
|
13
|
* This software component is licensed by ST under BSD 3-Clause license,
|
|
Jerome Coutant
0:146cf26a9bbb
|
14
|
* the "License"; You may not use this file except in compliance with the
|
|
Jerome Coutant
0:146cf26a9bbb
|
15
|
* License. You may obtain a copy of the License at:
|
|
Jerome Coutant
0:146cf26a9bbb
|
16
|
* opensource.org/licenses/BSD-3-Clause
|
|
Jerome Coutant
0:146cf26a9bbb
|
17
|
*
|
|
Jerome Coutant
0:146cf26a9bbb
|
18
|
******************************************************************************
|
|
Jerome Coutant
0:146cf26a9bbb
|
19
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
20
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
21
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
22
|
#ifndef __STM32H747I_DISCOVERY_CAMERA_H
|
|
Jerome Coutant
0:146cf26a9bbb
|
23
|
#define __STM32H747I_DISCOVERY_CAMERA_H
|
|
Jerome Coutant
0:146cf26a9bbb
|
24
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
25
|
#ifdef __cplusplus
|
|
Jerome Coutant
0:146cf26a9bbb
|
26
|
extern "C" {
|
|
Jerome Coutant
0:146cf26a9bbb
|
27
|
#endif
|
|
Jerome Coutant
0:146cf26a9bbb
|
28
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
29
|
/* Includes ------------------------------------------------------------------*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
30
|
/* Include Camera component Driver */
|
|
Jerome Coutant
0:146cf26a9bbb
|
31
|
#include "../Components/ov9655/ov9655.h"
|
|
Jerome Coutant
0:146cf26a9bbb
|
32
|
#include "stm32h747i_discovery.h"
|
|
Jerome Coutant
0:146cf26a9bbb
|
33
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
34
|
/** @addtogroup BSP
|
|
Jerome Coutant
0:146cf26a9bbb
|
35
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
36
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
37
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
38
|
/** @addtogroup STM32H747I_DISCOVERY
|
|
Jerome Coutant
0:146cf26a9bbb
|
39
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
40
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
41
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
42
|
/** @addtogroup STM32H747I_DISCOVERY_CAMERA
|
|
Jerome Coutant
0:146cf26a9bbb
|
43
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
44
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
45
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
46
|
/** @defgroup STM32H747I_DISCOVERY_CAMERA_Exported_Constants Exported Constants
|
|
Jerome Coutant
0:146cf26a9bbb
|
47
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
48
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
49
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
50
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
51
|
* @brief Camera State structures definition
|
|
Jerome Coutant
0:146cf26a9bbb
|
52
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
53
|
#define CAMERA_OK 0x00
|
|
Jerome Coutant
0:146cf26a9bbb
|
54
|
#define CAMERA_ERROR 0x01
|
|
Jerome Coutant
0:146cf26a9bbb
|
55
|
#define CAMERA_TIMEOUT 0x02
|
|
Jerome Coutant
0:146cf26a9bbb
|
56
|
#define CAMERA_NOT_DETECTED 0x03
|
|
Jerome Coutant
0:146cf26a9bbb
|
57
|
#define CAMERA_NOT_SUPPORTED 0x04
|
|
Jerome Coutant
0:146cf26a9bbb
|
58
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
59
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
60
|
* @brief Camera Image rotation definition
|
|
Jerome Coutant
0:146cf26a9bbb
|
61
|
* in frame buffer for LCD Display.
|
|
Jerome Coutant
0:146cf26a9bbb
|
62
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
63
|
#define CAMERA_NO_ROTATION 0x00
|
|
Jerome Coutant
0:146cf26a9bbb
|
64
|
#define CAMERA_ROTATION_90 0x01
|
|
Jerome Coutant
0:146cf26a9bbb
|
65
|
#define CAMERA_ROTATION_INVALID 0x02
|
|
Jerome Coutant
0:146cf26a9bbb
|
66
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
67
|
#define RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
|
|
Jerome Coutant
0:146cf26a9bbb
|
68
|
#define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
|
|
Jerome Coutant
0:146cf26a9bbb
|
69
|
#define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
|
|
Jerome Coutant
0:146cf26a9bbb
|
70
|
#define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */
|
|
Jerome Coutant
0:146cf26a9bbb
|
71
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
72
|
#define CAMERA_VGA_RES_X 640
|
|
Jerome Coutant
0:146cf26a9bbb
|
73
|
#define CAMERA_VGA_RES_Y 480
|
|
Jerome Coutant
0:146cf26a9bbb
|
74
|
#define CAMERA_480x272_RES_X 480
|
|
Jerome Coutant
0:146cf26a9bbb
|
75
|
#define CAMERA_480x272_RES_Y 272
|
|
Jerome Coutant
0:146cf26a9bbb
|
76
|
#define CAMERA_QVGA_RES_X 320
|
|
Jerome Coutant
0:146cf26a9bbb
|
77
|
#define CAMERA_QVGA_RES_Y 240
|
|
Jerome Coutant
0:146cf26a9bbb
|
78
|
#define CAMERA_QQVGA_RES_X 160
|
|
Jerome Coutant
0:146cf26a9bbb
|
79
|
#define CAMERA_QQVGA_RES_Y 120
|
|
Jerome Coutant
0:146cf26a9bbb
|
80
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
81
|
#define BSP_CAMERA_IRQHandler DCMI_IRQHandler
|
|
Jerome Coutant
0:146cf26a9bbb
|
82
|
#define BSP_CAMERA_DMA_IRQHandler DMA2_Stream3_IRQHandler
|
|
Jerome Coutant
0:146cf26a9bbb
|
83
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
84
|
/* DCMI DMA Stream definitions */
|
|
Jerome Coutant
0:146cf26a9bbb
|
85
|
#define CAMERA_DCMI_DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
|
|
Jerome Coutant
0:146cf26a9bbb
|
86
|
#define CAMERA_DCMI_DMAx_STREAM DMA2_Stream3
|
|
Jerome Coutant
0:146cf26a9bbb
|
87
|
#define CAMERA_DCMI_DMAx_IRQ DMA2_Stream3_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
88
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
89
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
90
|
* @brief CAMERA FB_StartAddress
|
|
Jerome Coutant
0:146cf26a9bbb
|
91
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
92
|
#define CAMERA_FB_START_ADDRESS ((uint32_t)0xD0600000)
|
|
Jerome Coutant
0:146cf26a9bbb
|
93
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
94
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
95
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
96
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
97
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
98
|
/** @addtogroup STM32H747I_DISCOVERY_CAMERA_Exported_Functions
|
|
Jerome Coutant
0:146cf26a9bbb
|
99
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
100
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
101
|
uint8_t BSP_CAMERA_Init(uint32_t Resolution);
|
|
Jerome Coutant
0:146cf26a9bbb
|
102
|
uint8_t BSP_CAMERA_DeInit(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
103
|
void BSP_CAMERA_ContinuousStart(uint8_t *buff);
|
|
Jerome Coutant
0:146cf26a9bbb
|
104
|
void BSP_CAMERA_SnapshotStart(uint8_t *buff);
|
|
Jerome Coutant
0:146cf26a9bbb
|
105
|
void BSP_CAMERA_Suspend(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
106
|
void BSP_CAMERA_Resume(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
107
|
uint8_t BSP_CAMERA_Stop(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
108
|
void BSP_CAMERA_PwrUp(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
109
|
void BSP_CAMERA_PwrDown(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
110
|
void BSP_CAMERA_LineEventCallback(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
111
|
void BSP_CAMERA_VsyncEventCallback(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
112
|
void BSP_CAMERA_FrameEventCallback(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
113
|
void BSP_CAMERA_ErrorCallback(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
114
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
115
|
/* Camera features functions prototype */
|
|
Jerome Coutant
0:146cf26a9bbb
|
116
|
void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
|
|
Jerome Coutant
0:146cf26a9bbb
|
117
|
void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
|
|
Jerome Coutant
0:146cf26a9bbb
|
118
|
void BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
|
|
Jerome Coutant
0:146cf26a9bbb
|
119
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
120
|
/* These functions can be modified in case the current settings (e.g. DMA stream)
|
|
Jerome Coutant
0:146cf26a9bbb
|
121
|
need to be changed for specific application needs */
|
|
Jerome Coutant
0:146cf26a9bbb
|
122
|
void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
|
|
Jerome Coutant
0:146cf26a9bbb
|
123
|
void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
|
|
Jerome Coutant
0:146cf26a9bbb
|
124
|
uint8_t BSP_CAMERA_SetRotation(uint32_t rotation);
|
|
Jerome Coutant
0:146cf26a9bbb
|
125
|
uint32_t BSP_CAMERA_GetRotation(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
126
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
127
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
128
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
129
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
130
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
131
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
132
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
133
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
134
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
135
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
136
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
137
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
138
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
139
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
140
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
141
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
142
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
143
|
#ifdef __cplusplus
|
|
Jerome Coutant
0:146cf26a9bbb
|
144
|
}
|
|
Jerome Coutant
0:146cf26a9bbb
|
145
|
#endif
|
|
Jerome Coutant
0:146cf26a9bbb
|
146
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
147
|
#endif /* __STM32H747I_DISCOVERY_CAMERA_H */
|
|
Jerome Coutant
0:146cf26a9bbb
|
148
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
149
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|