initial working (stm32f4-discovery)

This commit is contained in:
2026-07-31 19:07:15 +03:00
commit ce6632f48c
2214 changed files with 1264937 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
---
name: 'Bug report'
about: 'Create a report to help us improve the quality of our software'
title: ''
labels: ''
assignees: ''
---
**Caution**
The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the **ST Community** in the STM32 MCUs dedicated [page](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus).
**Describe the set-up**
* The board (either ST RPN reference or your custom board)
* IDE or at least the compiler and its version
**Describe the bug (skip if none)**
A clear and concise description of what the bug is.
**How to reproduce the bug (skip if none)**
1. Indicate the global behavior of your application project
2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...)
3. Describe the use case that generates the problem
4. How we can reproduce the problem
**Additional context**
If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal.
**Screenshots**
If applicable, add screenshots to help explain your problem.
@@ -0,0 +1,3 @@
## IMPORTANT INFORMATION
Pull-requests are **not** accepted on this repository. Please use issues to report any bug or request.
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
For answers to common questions about this code of conduct, see the [FAQ section](https://www.contributor-covenant.org/faq).
@@ -0,0 +1,28 @@
## Contributing guide
This document serves as a checklist before contributing to this repository.
It includes links to read up on if topics are unclear to you.
This guide mainly focuses on steps to be followed to submit an issue or a pull-request.
### 1. Before opening an issue
To report a bug or a request please file an issue in the right repository
(example for [ov5640](https://github.com/STMicroelectronics/ov5640/issues/new/choose)).
Please check the following boxes before posting an issue:
- [ ] `Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits).`
- [ ] `Make sure your issue is a question/feedback/suggestions RELATED TO the software provided in this repository.` Otherwise, it should be submitted to the ST Community under the MCU topic [page](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus).
- [ ] `Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue.` Please refer to this [dashboard](https://github.com/orgs/STMicroelectronics/projects/2) for the list of issues and pull-requests. Do not forget to browse into the **closed** issues.
### 2. Posting the issue
When you have checked the previous boxes. You will find two templates (Bug Report or Other Issue) available in the **Issues** tab of the repository.
### 3. Pull Requests
Pull-requests are **not** accepted on this repository. Please use **issues** to report any bug or request.
### 4. How to proceed
* We recommend to engage first a communication thru an issue, in order to present your proposal. Just to confirm that it corresponds to STMicroelectronics domain or scope.
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
* Please, submit one Pull Request for one new feature or proposal. This will ease the analysis and the final merge if accepted.
+27
View File
@@ -0,0 +1,27 @@
Copyright 2017 STMicroelectronics.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+40
View File
@@ -0,0 +1,40 @@
# BSP OV5640 Component
## Overview
**STM32Cube** is an STMicroelectronics original initiative to ease the developers life by reducing efforts, time and cost.
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
* The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
* A consistent set of middleware components such as RTOS, USB, FatFS, graphics, touch sensing library...
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
Two models of publication are proposed for the STM32Cube embedded software:
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.
## Description
This **ov5640** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **OV5640** BSP CAMERA component part.
## License
Copyright (c) 2019 STMicroelectronics
This software component is licensed by STMicroelectronics under the **BSD-3-Clause** license. You may not use this software except in compliance with this license. You may obtain a copy of the license [here](https://opensource.org/licenses/BSD-3-Clause).
## Release note
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/ov5640/blob/main/Release_Notes.html).
## Compatibility information
Please refer to the repository of the BSP **board** driver you are using to know which version of this BSP component driver to use. It is **crucial** that you use a consistent set of versions.
## Troubleshooting
If you have any issue with the **software content** of this repository, you can file an issue [here](https://github.com/STMicroelectronics/ov5640/issues/new/choose).
For any other question related to the product, the tools, the environment, you can submit a topic to the [ST Community](https://community.st.com/s/).
File diff suppressed because it is too large Load Diff
+202
View File
@@ -0,0 +1,202 @@
/**
******************************************************************************
* @file ov5640.h
* @author MCD Application Team
* @brief This file contains all the functions prototypes for the ov5640.c
* driver.
******************************************************************************
* @attention
*
* Copyright (c) 2019 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __OV5640_H
#define __OV5640_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "../Common/camera.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup Components
* @{
*/
/** @addtogroup ov5640
* @{
*/
/** @defgroup OV5640_Exported_Types
* @{
*/
/**
* @}
*/
/** @defgroup OV5640_Exported_Constants
* @{
*/
/**
* @brief OV5640 ID
*/
#define OV5640_ID 0x5640
/**
* @brief OV5640 Registers
*/
/**
* @brief OV5640 Features Parameters
*/
/* Brightness */
#define OV5640_BRIGHTNESS_LEVEL4P 0x00 /* Brightness level +4 */
#define OV5640_BRIGHTNESS_LEVEL3P 0x01 /* Brightness level +3 */
#define OV5640_BRIGHTNESS_LEVEL2P 0x02 /* Brightness level +2 */
#define OV5640_BRIGHTNESS_LEVEL1P 0x04 /* Brightness level +1 */
#define OV5640_BRIGHTNESS_LEVEL0 0x08 /* Brightness level 0 */
#define OV5640_BRIGHTNESS_LEVEL1N 0x10 /* Brightness level -1 */
#define OV5640_BRIGHTNESS_LEVEL2N 0x20 /* Brightness level -2 */
#define OV5640_BRIGHTNESS_LEVEL3N 0x40 /* Brightness level -3 */
#define OV5640_BRIGHTNESS_LEVEL4N 0x80 /* Brightness level -4 */
/* Saturation */
#define OV5640_SATURATION_LEVEL4P 0x00 /* Saturation level +4 */
#define OV5640_SATURATION_LEVEL3P 0x01 /* Saturation level +3 */
#define OV5640_SATURATION_LEVEL2P 0x02 /* Saturation level +2 */
#define OV5640_SATURATION_LEVEL1P 0x04 /* Saturation level +1 */
#define OV5640_SATURATION_LEVEL0 0x08 /* Saturation level 0 */
#define OV5640_SATURATION_LEVEL1N 0x10 /* Saturation level -1 */
#define OV5640_SATURATION_LEVEL2N 0x20 /* Saturation level -2 */
#define OV5640_SATURATION_LEVEL3N 0x40 /* Saturation level -3 */
#define OV5640_SATURATION_LEVEL4N 0x80 /* Saturation level -4 */
/* Contrast */
#define OV5640_CONTRAST_LEVEL4P 0x00 /* Contrast level +4 */
#define OV5640_CONTRAST_LEVEL3P 0x01 /* Contrast level +3 */
#define OV5640_CONTRAST_LEVEL2P 0x02 /* Contrast level +2 */
#define OV5640_CONTRAST_LEVEL1P 0x04 /* Contrast level +1 */
#define OV5640_CONTRAST_LEVEL0 0x08 /* Contrast level 0 */
#define OV5640_CONTRAST_LEVEL1N 0x10 /* Contrast level -1 */
#define OV5640_CONTRAST_LEVEL2N 0x20 /* Contrast level -2 */
#define OV5640_CONTRAST_LEVEL3N 0x40 /* Contrast level -3 */
#define OV5640_CONTRAST_LEVEL4N 0x80 /* Contrast level -4 */
/* Hue Control */
#define OV5640_HUE_150P 0x0001 /* Hue 150+ degree */
#define OV5640_HUE_120P 0x0002 /* Hue 120+ degree */
#define OV5640_HUE_90P 0x0004 /* Hue 90+ degree */
#define OV5640_HUE_60P 0x0008 /* Hue 60+ degree */
#define OV5640_HUE_30P 0x0010 /* Hue 30+ degree */
#define OV5640_HUE_0 0x0020 /* Hue 0 degree */
#define OV5640_HUE_30N 0x0040 /* Hue 30- degree */
#define OV5640_HUE_60N 0x0080 /* Hue 60- degree */
#define OV5640_HUE_90N 0x0100 /* Hue 90- degree */
#define OV5640_HUE_120N 0x0200 /* Hue 120- degree */
#define OV5640_HUE_150N 0x0400 /* Hue 150- degree */
#define OV5640_HUE_180N 0x0800 /* Hue 180- degree */
/* Mirror/Flip */
#define OV5640_MIRROR 0x00 /* Set camera mirror config */
#define OV5640_FLIP 0x01 /* Set camera flip config */
#define OV5640_MIRROR_FLIP 0x02 /* Set camera mirror and flip */
#define OV5640_MIRROR_FLIP_NORMAL 0x04 /* Set camera normal mode */
/* Zoom */
#define OV5640_ZOOM_x8 0x00
#define OV5640_ZOOM_x4 0x11
#define OV5640_ZOOM_x2 0x22
#define OV5640_ZOOM_x1 0x44
/* Special Effect */
#define OV5640_COLOR_EFFECT_NONE 0x00 /* No effect */
#define OV5640_COLOR_EFFECT_BLUE 0x01 /* Blue effect */
#define OV5640_COLOR_EFFECT_RED 0x02 /* Red effect */
#define OV5640_COLOR_EFFECT_GREEN 0x04 /* Green effect */
#define OV5640_COLOR_EFFECT_BW 0x08 /* Black and White effect */
#define OV5640_COLOR_EFFECT_SEPIA 0x10 /* Sepia effect */
#define OV5640_COLOR_EFFECT_NEGATIVE 0x20 /* Negative effect */
#define OV5640_COLOR_EFFECT_BW_NEGATIVE 0x40 /* BW Negative effect */
#define OV5640_COLOR_EFFECT_OVEREXPOSURE 0x80 /* Over exposure effect */
#define OV5640_COLOR_EFFECT_SOLARIZE 0x100 /* Solarized effect */
/* Light Mode */
#define OV5640_LIGHT_AUTO 0x00 /* Light Mode Auto */
#define OV5640_LIGHT_SUNNY 0x01 /* Light Mode Sunny */
#define OV5640_LIGHT_OFFICE 0x02 /* Light Mode Office */
#define OV5640_LIGHT_HOME 0x04 /* Light Mode Home */
#define OV5640_LIGHT_CLOUDY 0x08 /* Light Mode Claudy */
/* Saturation */
#define OV5640_SATURATION_0 0x00 /* Color saturation 0 */
#define OV5640_SATURATION_1 0x01 /* Color saturation 1 */
#define OV5640_SATURATION_2 0x02 /* Color saturation 2 */
#define OV5640_SATURATION_3 0x04 /* Color saturation 3 */
/* Exposure */
#define OV5640_EXPOSURE_LEVEL_0 0x00 /* Exposure Level 0 */
#define OV5640_EXPOSURE_LEVEL_1 0x01 /* Exposure Level 1 */
#define OV5640_EXPOSURE_LEVEL_2 0x02 /* Exposure Level 2 */
#define OV5640_EXPOSURE_LEVEL_3 0x04 /* Exposure Level 3 */
/**
* @}
*/
/** @defgroup OV5640_Exported_Functions
* @{
*/
void ov5640_Init(uint16_t DeviceAddr, uint32_t resolution);
void ov5640_Config(uint16_t DeviceAddr, uint32_t feature, uint32_t value, uint32_t BR_value);
uint16_t ov5640_ReadID(uint16_t DeviceAddr);
void OV5640_SetLightMode(uint16_t DeviceAddr, uint8_t LightMode);
void OV5640_SetEffect(uint16_t DeviceAddr, uint32_t Effect);
void OV5640_SetBrightness(uint16_t DeviceAddr, uint8_t Level);
void OV5640_SetSaturation(uint16_t DeviceAddr, uint8_t Level);
void OV5640_SetContrast(uint16_t DeviceAddr, uint8_t Level);
void OV5640_SetHueDegree(uint16_t DeviceAddr, uint16_t Degree);
void OV5640_MirrorFlipConfig(uint16_t DeviceAddr, uint8_t Config);
void OV5640_ZoomConfig(uint16_t DeviceAddr, uint8_t Zoom);
int32_t OV5640_GetResolution(uint16_t DeviceAddr);
void CAMERA_IO_Init(void);
void CAMERA_IO_Write(uint8_t addr, uint16_t reg, uint16_t value);
uint16_t CAMERA_IO_Read(uint8_t Addr, uint16_t Reg);
void CAMERA_Delay(uint32_t delay);
/* CAMERA driver structure */
extern CAMERA_DrvTypeDef ov5640_drv;
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __OV5640_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/