Copyright (c) LibDriver
14 | * All rights reserved.
15 | *
16 | * The MIT License (MIT)
17 | *
18 | * Permission is hereby granted, free of charge, to any person obtaining a copy
19 | * of this software and associated documentation files (the "Software"), to deal
20 | * in the Software without restriction, including without limitation the rights
21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22 | * copies of the Software, and to permit persons to whom the Software is
23 | * furnished to do so, subject to the following conditions:
24 | *
25 | * The above copyright notice and this permission notice shall be included in all
26 | * copies or substantial portions of the Software.
27 | *
28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 | * SOFTWARE.
35 | */
36 |
--------------------------------------------------------------------------------
/misra/ov2640_polyspace_report.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/libdriver/ov2640/e502913636e1b377acc6f1ca25c92f87c57f468d/misra/ov2640_polyspace_report.pdf
--------------------------------------------------------------------------------
/project/stm32f407/EW/stm32f407.dep:
--------------------------------------------------------------------------------
1 |
2 |
3 | 5
4 | 910563612
5 |
6 | Release
7 |
8 | $PROJ_DIR$\..\usr\src\stm32f4xx_hal_msp.c
9 | $PROJ_DIR$\..\usr\src\system_stm32f4xx.c
10 | $PROJ_DIR$\..\usr\src\getopt.c
11 | $PROJ_DIR$\..\usr\src\main.c
12 | $PROJ_DIR$\..\usr\src\shell.c
13 | $PROJ_DIR$\..\usr\src\stm32f4xx_it.c
14 |
15 |
16 | [REBUILD_ALL]
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/project/stm32f407/EW/stm32f407.eww:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $WS_DIR$\stm32f407.ewp
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/project/stm32f407/cmsis/cmsis_version.h:
--------------------------------------------------------------------------------
1 | /**************************************************************************//**
2 | * @file cmsis_version.h
3 | * @brief CMSIS Core(M) Version definitions
4 | * @version V5.0.2
5 | * @date 19. April 2017
6 | ******************************************************************************/
7 | /*
8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved.
9 | *
10 | * SPDX-License-Identifier: Apache-2.0
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the License); you may
13 | * not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | */
24 |
25 | #if defined ( __ICCARM__ )
26 | #pragma system_include /* treat file as system include file for MISRA check */
27 | #elif defined (__clang__)
28 | #pragma clang system_header /* treat file as system include file */
29 | #endif
30 |
31 | #ifndef __CMSIS_VERSION_H
32 | #define __CMSIS_VERSION_H
33 |
34 | /* CMSIS Version definitions */
35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */
37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
39 | #endif
40 |
--------------------------------------------------------------------------------
/project/stm32f407/cmsis/tz_context.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * @file tz_context.h
3 | * @brief Context Management for Armv8-M TrustZone
4 | * @version V1.0.1
5 | * @date 10. January 2018
6 | ******************************************************************************/
7 | /*
8 | * Copyright (c) 2017-2018 Arm Limited. All rights reserved.
9 | *
10 | * SPDX-License-Identifier: Apache-2.0
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the License); you may
13 | * not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | */
24 |
25 | #if defined ( __ICCARM__ )
26 | #pragma system_include /* treat file as system include file for MISRA check */
27 | #elif defined (__clang__)
28 | #pragma clang system_header /* treat file as system include file */
29 | #endif
30 |
31 | #ifndef TZ_CONTEXT_H
32 | #define TZ_CONTEXT_H
33 |
34 | #include
35 |
36 | #ifndef TZ_MODULEID_T
37 | #define TZ_MODULEID_T
38 | /// \details Data type that identifies secure software modules called by a process.
39 | typedef uint32_t TZ_ModuleId_t;
40 | #endif
41 |
42 | /// \details TZ Memory ID identifies an allocated memory slot.
43 | typedef uint32_t TZ_MemoryId_t;
44 |
45 | /// Initialize secure context memory system
46 | /// \return execution status (1: success, 0: error)
47 | uint32_t TZ_InitContextSystem_S (void);
48 |
49 | /// Allocate context memory for calling secure software modules in TrustZone
50 | /// \param[in] module identifies software modules called from non-secure mode
51 | /// \return value != 0 id TrustZone memory slot identifier
52 | /// \return value 0 no memory available or internal error
53 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
54 |
55 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
56 | /// \param[in] id TrustZone memory slot identifier
57 | /// \return execution status (1: success, 0: error)
58 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
59 |
60 | /// Load secure context (called on RTOS thread context switch)
61 | /// \param[in] id TrustZone memory slot identifier
62 | /// \return execution status (1: success, 0: error)
63 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
64 |
65 | /// Store secure context (called on RTOS thread context switch)
66 | /// \param[in] id TrustZone memory slot identifier
67 | /// \return execution status (1: success, 0: error)
68 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
69 |
70 | #endif // TZ_CONTEXT_H
71 |
--------------------------------------------------------------------------------
/project/stm32f407/fs/inc/diskio.h:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------/
2 | / Low level disk interface modlue include file (C)ChaN, 2019 /
3 | /-----------------------------------------------------------------------*/
4 |
5 | #ifndef _DISKIO_DEFINED
6 | #define _DISKIO_DEFINED
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | /* Status of Disk Functions */
13 | typedef BYTE DSTATUS;
14 |
15 | /* Results of Disk Functions */
16 | typedef enum {
17 | RES_OK = 0, /* 0: Successful */
18 | RES_ERROR, /* 1: R/W Error */
19 | RES_WRPRT, /* 2: Write Protected */
20 | RES_NOTRDY, /* 3: Not Ready */
21 | RES_PARERR /* 4: Invalid Parameter */
22 | } DRESULT;
23 |
24 |
25 | /*---------------------------------------*/
26 | /* Prototypes for disk control functions */
27 |
28 |
29 | DSTATUS disk_initialize (BYTE pdrv);
30 | DSTATUS disk_status (BYTE pdrv);
31 | DRESULT disk_read (BYTE pdrv, BYTE* buff, LBA_t sector, UINT count);
32 | DRESULT disk_write (BYTE pdrv, const BYTE* buff, LBA_t sector, UINT count);
33 | DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
34 |
35 |
36 | /* Disk Status Bits (DSTATUS) */
37 |
38 | #define STA_NOINIT 0x01 /* Drive not initialized */
39 | #define STA_NODISK 0x02 /* No medium in the drive */
40 | #define STA_PROTECT 0x04 /* Write protected */
41 |
42 |
43 | /* Command code for disk_ioctrl fucntion */
44 |
45 | /* Generic command (Used by FatFs) */
46 | #define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */
47 | #define GET_SECTOR_COUNT 1 /* Get media size (needed at FF_USE_MKFS == 1) */
48 | #define GET_SECTOR_SIZE 2 /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */
49 | #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */
50 | #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
51 |
52 | /* Generic command (Not used by FatFs) */
53 | #define CTRL_POWER 5 /* Get/Set power status */
54 | #define CTRL_LOCK 6 /* Lock/Unlock media removal */
55 | #define CTRL_EJECT 7 /* Eject media */
56 | #define CTRL_FORMAT 8 /* Create physical format on the media */
57 |
58 | /* MMC/SDC specific ioctl command */
59 | #define MMC_GET_TYPE 10 /* Get card type */
60 | #define MMC_GET_CSD 11 /* Get CSD */
61 | #define MMC_GET_CID 12 /* Get CID */
62 | #define MMC_GET_OCR 13 /* Get OCR */
63 | #define MMC_GET_SDSTAT 14 /* Get SD status */
64 | #define ISDIO_READ 55 /* Read data form SD iSDIO register */
65 | #define ISDIO_WRITE 56 /* Write data to SD iSDIO register */
66 | #define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */
67 |
68 | /* ATA/CF specific ioctl command */
69 | #define ATA_GET_REV 20 /* Get F/W revision */
70 | #define ATA_GET_MODEL 21 /* Get model name */
71 | #define ATA_GET_SN 22 /* Get serial number */
72 |
73 | #ifdef __cplusplus
74 | }
75 | #endif
76 |
77 | #endif
78 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32_assert_template.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32_assert.h
4 | * @author MCD Application Team
5 | * @brief STM32 assert template file.
6 | * This file should be copied to the application folder and renamed
7 | * to stm32_assert.h.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * Copyright (c) 2017 STMicroelectronics.
12 | * All rights reserved.
13 | *
14 | * This software is licensed under terms that can be found in the LICENSE file
15 | * in the root directory of this software component.
16 | * If no LICENSE file comes with this software, it is provided AS-IS.
17 | *
18 | ******************************************************************************
19 | */
20 |
21 | /* Define to prevent recursive inclusion -------------------------------------*/
22 | #ifndef __STM32_ASSERT_H
23 | #define __STM32_ASSERT_H
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | /* Exported types ------------------------------------------------------------*/
30 | /* Exported constants --------------------------------------------------------*/
31 | /* Includes ------------------------------------------------------------------*/
32 | /* Exported macro ------------------------------------------------------------*/
33 | #ifdef USE_FULL_ASSERT
34 | /**
35 | * @brief The assert_param macro is used for function's parameters check.
36 | * @param expr If expr is false, it calls assert_failed function
37 | * which reports the name of the source file and the source
38 | * line number of the call that failed.
39 | * If expr is true, it returns no value.
40 | * @retval None
41 | */
42 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
43 | /* Exported functions ------------------------------------------------------- */
44 | void assert_failed(uint8_t* file, uint32_t line);
45 | #else
46 | #define assert_param(expr) ((void)0U)
47 | #endif /* USE_FULL_ASSERT */
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 |
53 | #endif /* __STM32_ASSERT_H */
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_cryp_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_cryp_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of CRYP HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_CRYP_EX_H
21 | #define __STM32F4xx_HAL_CRYP_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | /** @addtogroup STM32F4xx_HAL_Driver
31 | * @{
32 | */
33 |
34 | /** @addtogroup CRYPEx
35 | * @{
36 | */
37 | /* Exported types ------------------------------------------------------------*/
38 | /** @defgroup CRYPEx_Exported_Types CRYPEx Exported types
39 | * @{
40 | */
41 |
42 | /**
43 | * @}
44 | */
45 | /* Exported constants --------------------------------------------------------*/
46 | /** @defgroup CRYPEx_Exported_Constants CRYPEx Exported constants
47 | * @{
48 | */
49 |
50 | /**
51 | * @}
52 | */
53 |
54 | /* Private types -------------------------------------------------------------*/
55 | /** @defgroup CRYPEx_Private_Types CRYPEx Private Types
56 | * @{
57 | */
58 |
59 | /**
60 | * @}
61 | */
62 |
63 | /* Private variables ---------------------------------------------------------*/
64 | /** @defgroup CRYPEx_Private_Variables CRYPEx Private Variables
65 | * @{
66 | */
67 |
68 | /**
69 | * @}
70 | */
71 |
72 | /* Private constants ---------------------------------------------------------*/
73 | /** @defgroup CRYPEx_Private_Constants CRYPEx Private Constants
74 | * @{
75 | */
76 |
77 | /**
78 | * @}
79 | */
80 |
81 | /* Private macros ------------------------------------------------------------*/
82 | /** @defgroup CRYPEx_Private_Macros CRYPEx Private Macros
83 | * @{
84 | */
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | /* Private functions ---------------------------------------------------------*/
91 | /** @defgroup CRYPEx_Private_Functions CRYPEx Private Functions
92 | * @{
93 | */
94 |
95 | /**
96 | * @}
97 | */
98 |
99 | /* Exported functions --------------------------------------------------------*/
100 | /** @defgroup CRYPEx_Exported_Functions CRYPEx Exported Functions
101 | * @{
102 | */
103 | #if defined (CRYP) || defined (AES)
104 | /** @addtogroup CRYPEx_Exported_Functions_Group1
105 | * @{
106 | */
107 | HAL_StatusTypeDef HAL_CRYPEx_AESGCM_GenerateAuthTAG(CRYP_HandleTypeDef *hcryp, uint32_t *AuthTag, uint32_t Timeout);
108 | HAL_StatusTypeDef HAL_CRYPEx_AESCCM_GenerateAuthTAG(CRYP_HandleTypeDef *hcryp, uint32_t *AuthTag, uint32_t Timeout);
109 | /**
110 | * @}
111 | */
112 | #endif /* CRYP||AES */
113 |
114 | #if defined (AES)
115 | /** @addtogroup CRYPEx_Exported_Functions_Group2
116 | * @{
117 | */
118 | void HAL_CRYPEx_EnableAutoKeyDerivation(CRYP_HandleTypeDef *hcryp);
119 | void HAL_CRYPEx_DisableAutoKeyDerivation(CRYP_HandleTypeDef *hcryp);
120 | /**
121 | * @}
122 | */
123 | #endif /* AES */
124 |
125 | /**
126 | * @}
127 | */
128 |
129 | /**
130 | * @}
131 | */
132 |
133 | /**
134 | * @}
135 | */
136 |
137 | #ifdef __cplusplus
138 | }
139 | #endif
140 |
141 | #endif /* __STM32F4xx_HAL_CRYP_EX_H */
142 |
143 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_dma_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_dma_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of DMA HAL extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file in
13 | * the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_DMA_EX_H
21 | #define __STM32F4xx_HAL_DMA_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | /** @addtogroup STM32F4xx_HAL_Driver
31 | * @{
32 | */
33 |
34 | /** @addtogroup DMAEx
35 | * @{
36 | */
37 |
38 | /* Exported types ------------------------------------------------------------*/
39 | /** @defgroup DMAEx_Exported_Types DMAEx Exported Types
40 | * @brief DMAEx Exported types
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief HAL DMA Memory definition
46 | */
47 | typedef enum
48 | {
49 | MEMORY0 = 0x00U, /*!< Memory 0 */
50 | MEMORY1 = 0x01U /*!< Memory 1 */
51 | }HAL_DMA_MemoryTypeDef;
52 |
53 | /**
54 | * @}
55 | */
56 |
57 | /* Exported functions --------------------------------------------------------*/
58 | /** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions
59 | * @brief DMAEx Exported functions
60 | * @{
61 | */
62 |
63 | /** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions
64 | * @brief Extended features functions
65 | * @{
66 | */
67 |
68 | /* IO operation functions *******************************************************/
69 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
70 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
71 | HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory);
72 |
73 | /**
74 | * @}
75 | */
76 | /**
77 | * @}
78 | */
79 |
80 | /* Private functions ---------------------------------------------------------*/
81 | /** @defgroup DMAEx_Private_Functions DMAEx Private Functions
82 | * @brief DMAEx Private functions
83 | * @{
84 | */
85 | /**
86 | * @}
87 | */
88 |
89 | /**
90 | * @}
91 | */
92 |
93 | /**
94 | * @}
95 | */
96 |
97 | #ifdef __cplusplus
98 | }
99 | #endif
100 |
101 | #endif /*__STM32F4xx_HAL_DMA_EX_H*/
102 |
103 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_flash_ramfunc.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_flash_ramfunc.h
4 | * @author MCD Application Team
5 | * @brief Header file of FLASH RAMFUNC driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file in
13 | * the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | ******************************************************************************
16 | */
17 |
18 | /* Define to prevent recursive inclusion -------------------------------------*/
19 | #ifndef __STM32F4xx_FLASH_RAMFUNC_H
20 | #define __STM32F4xx_FLASH_RAMFUNC_H
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F412Zx) ||\
26 | defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx)
27 |
28 | /* Includes ------------------------------------------------------------------*/
29 | #include "stm32f4xx_hal_def.h"
30 |
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup FLASH_RAMFUNC
36 | * @{
37 | */
38 |
39 | /* Exported types ------------------------------------------------------------*/
40 | /* Exported macro ------------------------------------------------------------*/
41 | /* Exported functions --------------------------------------------------------*/
42 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions
43 | * @{
44 | */
45 |
46 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions_Group1
47 | * @{
48 | */
49 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_StopFlashInterfaceClk(void);
50 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_StartFlashInterfaceClk(void);
51 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_EnableFlashSleepMode(void);
52 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_DisableFlashSleepMode(void);
53 | /**
54 | * @}
55 | */
56 |
57 | /**
58 | * @}
59 | */
60 |
61 | /**
62 | * @}
63 | */
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | #endif /* STM32F410xx || STM32F411xE || STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */
70 | #ifdef __cplusplus
71 | }
72 | #endif
73 |
74 |
75 | #endif /* __STM32F4xx_FLASH_RAMFUNC_H */
76 |
77 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_fmpsmbus_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_fmpsmbus_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of FMPSMBUS HAL Extended module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef STM32F4xx_HAL_FMPSMBUS_EX_H
21 | #define STM32F4xx_HAL_FMPSMBUS_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | #if defined(FMPI2C_CR1_PE)
28 | /* Includes ------------------------------------------------------------------*/
29 | #include "stm32f4xx_hal_def.h"
30 |
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup FMPSMBUSEx
36 | * @{
37 | */
38 |
39 | /* Exported types ------------------------------------------------------------*/
40 | /* Exported constants --------------------------------------------------------*/
41 | /** @defgroup FMPSMBUSEx_Exported_Constants FMPSMBUS Extended Exported Constants
42 | * @{
43 | */
44 |
45 | /** @defgroup FMPSMBUSEx_FastModePlus FMPSMBUS Extended Fast Mode Plus
46 | * @{
47 | */
48 | #define FMPSMBUS_FASTMODEPLUS_SCL SYSCFG_CFGR_FMPI2C1_SCL /*!< Enable Fast Mode Plus on FMPI2C1 SCL pins */
49 | #define FMPSMBUS_FASTMODEPLUS_SDA SYSCFG_CFGR_FMPI2C1_SDA /*!< Enable Fast Mode Plus on FMPI2C1 SDA pins */
50 | /**
51 | * @}
52 | */
53 |
54 | /**
55 | * @}
56 | */
57 |
58 | /* Exported macro ------------------------------------------------------------*/
59 | /** @defgroup FMPSMBUSEx_Exported_Macros FMPSMBUS Extended Exported Macros
60 | * @{
61 | */
62 |
63 | /**
64 | * @}
65 | */
66 |
67 | /* Exported functions --------------------------------------------------------*/
68 | /** @addtogroup FMPSMBUSEx_Exported_Functions FMPSMBUS Extended Exported Functions
69 | * @{
70 | */
71 |
72 | /** @addtogroup FMPSMBUSEx_Exported_Functions_Group2 WakeUp Mode Functions
73 | * @{
74 | */
75 | /* Peripheral Control functions ************************************************/
76 | /**
77 | * @}
78 | */
79 |
80 | /** @addtogroup FMPSMBUSEx_Exported_Functions_Group3 Fast Mode Plus Functions
81 | * @{
82 | */
83 | void HAL_FMPSMBUSEx_EnableFastModePlus(uint32_t ConfigFastModePlus);
84 | void HAL_FMPSMBUSEx_DisableFastModePlus(uint32_t ConfigFastModePlus);
85 | /**
86 | * @}
87 | */
88 |
89 | /**
90 | * @}
91 | */
92 |
93 | /* Private constants ---------------------------------------------------------*/
94 | /** @defgroup FMPSMBUSEx_Private_Constants FMPSMBUS Extended Private Constants
95 | * @{
96 | */
97 |
98 | /**
99 | * @}
100 | */
101 |
102 | /* Private macros ------------------------------------------------------------*/
103 | /** @defgroup FMPSMBUSEx_Private_Macro FMPSMBUS Extended Private Macros
104 | * @{
105 | */
106 | #define IS_FMPSMBUS_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (FMPSMBUS_FASTMODEPLUS_SCL)) == \
107 | FMPSMBUS_FASTMODEPLUS_SCL) || \
108 | (((__CONFIG__) & (FMPSMBUS_FASTMODEPLUS_SDA)) == \
109 | FMPSMBUS_FASTMODEPLUS_SDA))
110 | /**
111 | * @}
112 | */
113 |
114 | /* Private Functions ---------------------------------------------------------*/
115 | /** @defgroup FMPSMBUSEx_Private_Functions FMPSMBUS Extended Private Functions
116 | * @{
117 | */
118 | /* Private functions are defined in stm32f4xx_hal_fmpsmbus_ex.c file */
119 | /**
120 | * @}
121 | */
122 |
123 | /**
124 | * @}
125 | */
126 |
127 | /**
128 | * @}
129 | */
130 |
131 | #endif /* FMPI2C_CR1_PE */
132 | #ifdef __cplusplus
133 | }
134 | #endif
135 |
136 | #endif /* STM32F4xx_HAL_FMPSMBUS_EX_H */
137 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_i2c_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_i2c_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of I2C HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_I2C_EX_H
21 | #define __STM32F4xx_HAL_I2C_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | #if defined(I2C_FLTR_ANOFF)&&defined(I2C_FLTR_DNF)
28 | /* Includes ------------------------------------------------------------------*/
29 | #include "stm32f4xx_hal_def.h"
30 |
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup I2CEx
36 | * @{
37 | */
38 |
39 | /* Exported types ------------------------------------------------------------*/
40 | /* Exported constants --------------------------------------------------------*/
41 | /** @defgroup I2CEx_Exported_Constants I2C Exported Constants
42 | * @{
43 | */
44 |
45 | /** @defgroup I2CEx_Analog_Filter I2C Analog Filter
46 | * @{
47 | */
48 | #define I2C_ANALOGFILTER_ENABLE 0x00000000U
49 | #define I2C_ANALOGFILTER_DISABLE I2C_FLTR_ANOFF
50 | /**
51 | * @}
52 | */
53 |
54 | /**
55 | * @}
56 | */
57 |
58 | /* Exported macro ------------------------------------------------------------*/
59 | /* Exported functions --------------------------------------------------------*/
60 | /** @addtogroup I2CEx_Exported_Functions
61 | * @{
62 | */
63 |
64 | /** @addtogroup I2CEx_Exported_Functions_Group1
65 | * @{
66 | */
67 | /* Peripheral Control functions ************************************************/
68 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter);
69 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter);
70 | /**
71 | * @}
72 | */
73 |
74 | /**
75 | * @}
76 | */
77 | /* Private types -------------------------------------------------------------*/
78 | /* Private variables ---------------------------------------------------------*/
79 | /* Private constants ---------------------------------------------------------*/
80 | /** @defgroup I2CEx_Private_Constants I2C Private Constants
81 | * @{
82 | */
83 |
84 | /**
85 | * @}
86 | */
87 |
88 | /* Private macros ------------------------------------------------------------*/
89 | /** @defgroup I2CEx_Private_Macros I2C Private Macros
90 | * @{
91 | */
92 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \
93 | ((FILTER) == I2C_ANALOGFILTER_DISABLE))
94 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU)
95 | /**
96 | * @}
97 | */
98 |
99 | /**
100 | * @}
101 | */
102 |
103 | /**
104 | * @}
105 | */
106 |
107 | #endif
108 |
109 | #ifdef __cplusplus
110 | }
111 | #endif
112 |
113 | #endif /* __STM32F4xx_HAL_I2C_EX_H */
114 |
115 |
116 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_ltdc_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_ltdc_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of LTDC HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef STM32F4xx_HAL_LTDC_EX_H
21 | #define STM32F4xx_HAL_LTDC_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | #if defined (LTDC) && defined (DSI)
31 |
32 | #include "stm32f4xx_hal_dsi.h"
33 |
34 | /** @addtogroup STM32F4xx_HAL_Driver
35 | * @{
36 | */
37 |
38 | /** @addtogroup LTDCEx
39 | * @{
40 | */
41 |
42 | /* Exported types ------------------------------------------------------------*/
43 | /* Exported constants --------------------------------------------------------*/
44 | /* Exported macro ------------------------------------------------------------*/
45 | /* Exported functions --------------------------------------------------------*/
46 | /** @addtogroup LTDCEx_Exported_Functions
47 | * @{
48 | */
49 |
50 | /** @addtogroup LTDCEx_Exported_Functions_Group1
51 | * @{
52 | */
53 | HAL_StatusTypeDef HAL_LTDCEx_StructInitFromVideoConfig(LTDC_HandleTypeDef *hltdc, DSI_VidCfgTypeDef *VidCfg);
54 | HAL_StatusTypeDef HAL_LTDCEx_StructInitFromAdaptedCommandConfig(LTDC_HandleTypeDef *hltdc, DSI_CmdCfgTypeDef *CmdCfg);
55 | /**
56 | * @}
57 | */
58 |
59 | /**
60 | * @}
61 | */
62 |
63 | /* Private types -------------------------------------------------------------*/
64 | /* Private variables ---------------------------------------------------------*/
65 | /* Private constants ---------------------------------------------------------*/
66 | /* Private macros ------------------------------------------------------------*/
67 | /* Private functions ---------------------------------------------------------*/
68 |
69 | /**
70 | * @}
71 | */
72 |
73 | /**
74 | * @}
75 | */
76 |
77 | #endif /* LTDC && DSI */
78 |
79 | #ifdef __cplusplus
80 | }
81 | #endif
82 |
83 | #endif /* STM32F4xx_HAL_LTDC_EX_H */
84 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_pcd_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_pcd_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of PCD HAL Extension module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef STM32F4xx_HAL_PCD_EX_H
21 | #define STM32F4xx_HAL_PCD_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif /* __cplusplus */
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
31 | /** @addtogroup STM32F4xx_HAL_Driver
32 | * @{
33 | */
34 |
35 | /** @addtogroup PCDEx
36 | * @{
37 | */
38 | /* Exported types ------------------------------------------------------------*/
39 | /* Exported constants --------------------------------------------------------*/
40 | /* Exported macros -----------------------------------------------------------*/
41 | /* Exported functions --------------------------------------------------------*/
42 | /** @addtogroup PCDEx_Exported_Functions PCDEx Exported Functions
43 | * @{
44 | */
45 | /** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions
46 | * @{
47 | */
48 |
49 | #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
50 | HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size);
51 | HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size);
52 | #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
53 |
54 | #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
55 | HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd);
56 | HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd);
57 | #endif /* defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) */
58 | #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
59 | HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd);
60 | HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd);
61 | void HAL_PCDEx_BCD_VBUSDetect(PCD_HandleTypeDef *hpcd);
62 | #endif /* defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) */
63 | void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg);
64 | void HAL_PCDEx_BCD_Callback(PCD_HandleTypeDef *hpcd, PCD_BCD_MsgTypeDef msg);
65 |
66 | /**
67 | * @}
68 | */
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | /**
75 | * @}
76 | */
77 |
78 | /**
79 | * @}
80 | */
81 | #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
82 |
83 | #ifdef __cplusplus
84 | }
85 | #endif /* __cplusplus */
86 |
87 |
88 | #endif /* STM32F4xx_HAL_PCD_EX_H */
89 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/inc/stm32f4xx_hal_sai_ex.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_sai_ex.h
4 | * @author MCD Application Team
5 | * @brief Header file of SAI Extension HAL module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __STM32F4xx_HAL_SAI_EX_H
21 | #define __STM32F4xx_HAL_SAI_EX_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "stm32f4xx_hal_def.h"
29 |
30 | /** @addtogroup STM32F4xx_HAL_Driver
31 | * @{
32 | */
33 |
34 | /** @addtogroup SAIEx
35 | * @{
36 | */
37 |
38 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
39 | defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F413xx) || \
40 | defined(STM32F423xx)
41 |
42 | /* Exported types ------------------------------------------------------------*/
43 | /* Exported constants --------------------------------------------------------*/
44 | /** @defgroup SAI_Clock_Source SAI Clock Source
45 | * @{
46 | */
47 | #if defined(STM32F413xx) || defined(STM32F423xx)
48 | #define SAI_CLKSOURCE_PLLI2S 0x00000000U
49 | #define SAI_CLKSOURCE_EXT 0x00100000U
50 | #define SAI_CLKSOURCE_PLLR 0x00200000U
51 | #define SAI_CLKSOURCE_HS 0x00300000U
52 | #else
53 | #define SAI_CLKSOURCE_PLLSAI 0x00000000U
54 | #define SAI_CLKSOURCE_PLLI2S 0x00100000U
55 | #define SAI_CLKSOURCE_EXT 0x00200000U
56 | #define SAI_CLKSOURCE_NA 0x00400000U /*!< No applicable for STM32F446xx */
57 | #endif
58 |
59 |
60 | /**
61 | * @}
62 | */
63 |
64 | /* Exported functions --------------------------------------------------------*/
65 | /** @addtogroup SAIEx_Exported_Functions
66 | * @{
67 | */
68 |
69 | /** @addtogroup SAIEx_Exported_Functions_Group1
70 | * @{
71 | */
72 |
73 | /* Extended features functions ************************************************/
74 | void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai);
75 | uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai);
76 | /**
77 | * @}
78 | */
79 |
80 | /**
81 | * @}
82 | */
83 | /* Private types -------------------------------------------------------------*/
84 | /* Private variables ---------------------------------------------------------*/
85 | /* Private constants ---------------------------------------------------------*/
86 | /* Private macros ------------------------------------------------------------*/
87 | #if defined(STM32F413xx) || defined(STM32F423xx)
88 | #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\
89 | ((SOURCE) == SAI_CLKSOURCE_EXT)||\
90 | ((SOURCE) == SAI_CLKSOURCE_PLLR)||\
91 | ((SOURCE) == SAI_CLKSOURCE_HS))
92 | #else
93 | #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\
94 | ((SOURCE) == SAI_CLKSOURCE_EXT)||\
95 | ((SOURCE) == SAI_CLKSOURCE_PLLI2S)||\
96 | ((SOURCE) == SAI_CLKSOURCE_NA))
97 | #endif
98 | /* Private functions ---------------------------------------------------------*/
99 |
100 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx || STM32F413xx || STM32F423xx */
101 | /**
102 | * @}
103 | */
104 |
105 | /**
106 | * @}
107 | */
108 |
109 | #ifdef __cplusplus
110 | }
111 | #endif
112 |
113 | #endif /* __STM32F4xx_HAL_SAI_EX_H */
114 |
115 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_hal_msp_template.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_hal_msp_template.c
4 | * @author MCD Application Team
5 | * @brief This file contains the HAL System and Peripheral (PPP) MSP initialization
6 | * and de-initialization functions.
7 | * It should be copied to the application folder and renamed into 'stm32f4xx_hal_msp.c'.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | * Copyright (c) 2017 STMicroelectronics.
12 | * All rights reserved.
13 | *
14 | * This software is licensed under terms that can be found in the LICENSE file
15 | * in the root directory of this software component.
16 | * If no LICENSE file comes with this software, it is provided AS-IS.
17 | *
18 | ******************************************************************************
19 | */
20 |
21 | /* Includes ------------------------------------------------------------------*/
22 | #include "stm32f4xx_hal.h"
23 |
24 | /** @addtogroup STM32F4xx_HAL_Driver
25 | * @{
26 | */
27 |
28 | /** @defgroup HAL_MSP HAL MSP
29 | * @brief HAL MSP module.
30 | * @{
31 | */
32 |
33 | /* Private typedef -----------------------------------------------------------*/
34 | /* Private define ------------------------------------------------------------*/
35 | /* Private macro -------------------------------------------------------------*/
36 | /* Private variables ---------------------------------------------------------*/
37 | /* Private function prototypes -----------------------------------------------*/
38 | /* Private functions ---------------------------------------------------------*/
39 |
40 | /** @defgroup HAL_MSP_Private_Functions HAL MSP Private Functions
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initializes the Global MSP.
46 | * @note This function is called from HAL_Init() function to perform system
47 | * level initialization (GPIOs, clock, DMA, interrupt).
48 | * @retval None
49 | */
50 | void HAL_MspInit(void)
51 | {
52 |
53 | }
54 |
55 | /**
56 | * @brief DeInitializes the Global MSP.
57 | * @note This functiona is called from HAL_DeInit() function to perform system
58 | * level de-initialization (GPIOs, clock, DMA, interrupt).
59 | * @retval None
60 | */
61 | void HAL_MspDeInit(void)
62 | {
63 |
64 | }
65 |
66 | /**
67 | * @brief Initializes the PPP MSP.
68 | * @note This functiona is called from HAL_PPP_Init() function to perform
69 | * peripheral(PPP) system level initialization (GPIOs, clock, DMA, interrupt)
70 | * @retval None
71 | */
72 | void HAL_PPP_MspInit(void)
73 | {
74 |
75 | }
76 |
77 | /**
78 | * @brief DeInitializes the PPP MSP.
79 | * @note This functiona is called from HAL_PPP_DeInit() function to perform
80 | * peripheral(PPP) system level de-initialization (GPIOs, clock, DMA, interrupt)
81 | * @retval None
82 | */
83 | void HAL_PPP_MspDeInit(void)
84 | {
85 |
86 | }
87 |
88 | /**
89 | * @}
90 | */
91 |
92 | /**
93 | * @}
94 | */
95 |
96 | /**
97 | * @}
98 | */
99 |
100 |
101 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_hal_timebase_rtc_alarm_template.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/libdriver/ov2640/e502913636e1b377acc6f1ca25c92f87c57f468d/project/stm32f407/hal/src/stm32f4xx_hal_timebase_rtc_alarm_template.c
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_hal_timebase_rtc_wakeup_template.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/libdriver/ov2640/e502913636e1b377acc6f1ca25c92f87c57f468d/project/stm32f407/hal/src/stm32f4xx_hal_timebase_rtc_wakeup_template.c
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_ll_crc.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_ll_crc.c
4 | * @author MCD Application Team
5 | * @brief CRC LL module driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 | #if defined(USE_FULL_LL_DRIVER)
19 |
20 | /* Includes ------------------------------------------------------------------*/
21 | #include "stm32f4xx_ll_crc.h"
22 | #include "stm32f4xx_ll_bus.h"
23 |
24 | #ifdef USE_FULL_ASSERT
25 | #include "stm32_assert.h"
26 | #else
27 | #define assert_param(expr) ((void)0U)
28 | #endif /* USE_FULL_ASSERT */
29 |
30 | /** @addtogroup STM32F4xx_LL_Driver
31 | * @{
32 | */
33 |
34 | #if defined (CRC)
35 |
36 | /** @addtogroup CRC_LL
37 | * @{
38 | */
39 |
40 | /* Private types -------------------------------------------------------------*/
41 | /* Private variables ---------------------------------------------------------*/
42 | /* Private constants ---------------------------------------------------------*/
43 | /* Private macros ------------------------------------------------------------*/
44 | /* Private function prototypes -----------------------------------------------*/
45 |
46 | /* Exported functions --------------------------------------------------------*/
47 | /** @addtogroup CRC_LL_Exported_Functions
48 | * @{
49 | */
50 |
51 | /** @addtogroup CRC_LL_EF_Init
52 | * @{
53 | */
54 |
55 | /**
56 | * @brief De-initialize CRC registers (Registers restored to their default values).
57 | * @param CRCx CRC Instance
58 | * @retval An ErrorStatus enumeration value:
59 | * - SUCCESS: CRC registers are de-initialized
60 | * - ERROR: CRC registers are not de-initialized
61 | */
62 | ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx)
63 | {
64 | ErrorStatus status = SUCCESS;
65 |
66 | /* Check the parameters */
67 | assert_param(IS_CRC_ALL_INSTANCE(CRCx));
68 |
69 | if (CRCx == CRC)
70 | {
71 | /* Force CRC reset */
72 | LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC);
73 |
74 | /* Release CRC reset */
75 | LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC);
76 | }
77 | else
78 | {
79 | status = ERROR;
80 | }
81 |
82 | return (status);
83 | }
84 |
85 | /**
86 | * @}
87 | */
88 |
89 | /**
90 | * @}
91 | */
92 |
93 | /**
94 | * @}
95 | */
96 |
97 | #endif /* defined (CRC) */
98 |
99 | /**
100 | * @}
101 | */
102 |
103 | #endif /* USE_FULL_LL_DRIVER */
104 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_ll_pwr.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_ll_pwr.c
4 | * @author MCD Application Team
5 | * @brief PWR LL module driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file in
13 | * the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | ******************************************************************************
16 | */
17 | #if defined(USE_FULL_LL_DRIVER)
18 |
19 | /* Includes ------------------------------------------------------------------*/
20 | #include "stm32f4xx_ll_pwr.h"
21 | #include "stm32f4xx_ll_bus.h"
22 |
23 | /** @addtogroup STM32F4xx_LL_Driver
24 | * @{
25 | */
26 |
27 | #if defined(PWR)
28 |
29 | /** @defgroup PWR_LL PWR
30 | * @{
31 | */
32 |
33 | /* Private types -------------------------------------------------------------*/
34 | /* Private variables ---------------------------------------------------------*/
35 | /* Private constants ---------------------------------------------------------*/
36 | /* Private macros ------------------------------------------------------------*/
37 | /* Private function prototypes -----------------------------------------------*/
38 |
39 | /* Exported functions --------------------------------------------------------*/
40 | /** @addtogroup PWR_LL_Exported_Functions
41 | * @{
42 | */
43 |
44 | /** @addtogroup PWR_LL_EF_Init
45 | * @{
46 | */
47 |
48 | /**
49 | * @brief De-initialize the PWR registers to their default reset values.
50 | * @retval An ErrorStatus enumeration value:
51 | * - SUCCESS: PWR registers are de-initialized
52 | * - ERROR: not applicable
53 | */
54 | ErrorStatus LL_PWR_DeInit(void)
55 | {
56 | /* Force reset of PWR clock */
57 | LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_PWR);
58 |
59 | /* Release reset of PWR clock */
60 | LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_PWR);
61 |
62 | return SUCCESS;
63 | }
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | /**
70 | * @}
71 | */
72 |
73 | /**
74 | * @}
75 | */
76 | #endif /* defined(PWR) */
77 | /**
78 | * @}
79 | */
80 |
81 | #endif /* USE_FULL_LL_DRIVER */
82 |
--------------------------------------------------------------------------------
/project/stm32f407/hal/src/stm32f4xx_ll_rng.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f4xx_ll_rng.c
4 | * @author MCD Application Team
5 | * @brief RNG LL module driver.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2016 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 | #if defined(USE_FULL_LL_DRIVER)
19 |
20 | /* Includes ------------------------------------------------------------------*/
21 | #include "stm32f4xx_ll_rng.h"
22 | #include "stm32f4xx_ll_bus.h"
23 |
24 | #ifdef USE_FULL_ASSERT
25 | #include "stm32_assert.h"
26 | #else
27 | #define assert_param(expr) ((void)0U)
28 | #endif /* USE_FULL_ASSERT */
29 |
30 | /** @addtogroup STM32F4xx_LL_Driver
31 | * @{
32 | */
33 |
34 | #if defined (RNG)
35 |
36 | /** @addtogroup RNG_LL
37 | * @{
38 | */
39 |
40 | /* Private types -------------------------------------------------------------*/
41 | /* Private variables ---------------------------------------------------------*/
42 | /* Private constants ---------------------------------------------------------*/
43 | /* Private macros ------------------------------------------------------------*/
44 | /* Private function prototypes -----------------------------------------------*/
45 |
46 | /* Exported functions --------------------------------------------------------*/
47 | /** @addtogroup RNG_LL_Exported_Functions
48 | * @{
49 | */
50 |
51 | /** @addtogroup RNG_LL_EF_Init
52 | * @{
53 | */
54 |
55 | /**
56 | * @brief De-initialize RNG registers (Registers restored to their default values).
57 | * @param RNGx RNG Instance
58 | * @retval An ErrorStatus enumeration value:
59 | * - SUCCESS: RNG registers are de-initialized
60 | * - ERROR: not applicable
61 | */
62 | ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx)
63 | {
64 | ErrorStatus status = SUCCESS;
65 |
66 | /* Check the parameters */
67 | assert_param(IS_RNG_ALL_INSTANCE(RNGx));
68 | if (RNGx == RNG)
69 | {
70 | #if !defined(RCC_AHB2_SUPPORT)
71 | /* Enable RNG reset state */
72 | LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_RNG);
73 |
74 | /* Release RNG from reset state */
75 | LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_RNG);
76 | #else
77 | /* Enable RNG reset state */
78 | LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG);
79 |
80 | /* Release RNG from reset state */
81 | LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG);
82 | #endif /* !RCC_AHB2_SUPPORT */
83 | }
84 | else
85 | {
86 | status = ERROR;
87 | }
88 |
89 | return status;
90 | }
91 |
92 | /**
93 | * @}
94 | */
95 |
96 | /**
97 | * @}
98 | */
99 |
100 | /**
101 | * @}
102 | */
103 |
104 | #endif /* RNG */
105 |
106 | /**
107 | * @}
108 | */
109 |
110 | #endif /* USE_FULL_LL_DRIVER */
111 |
112 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/clock.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file clock.h
25 | * @brief clock header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef CLOCK_H
38 | #define CLOCK_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C"{
44 | #endif
45 |
46 | /**
47 | * @defgroup clock clock function
48 | * @brief clock function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief chip clock init
54 | * @note none
55 | */
56 | void clock_init(void);
57 |
58 | /**
59 | * @}
60 | */
61 |
62 | #ifdef __cplusplus
63 | }
64 | #endif
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/delay.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file delay.h
25 | * @brief delay header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef DELAY_H
38 | #define DELAY_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C"{
44 | #endif
45 |
46 | /**
47 | * @defgroup delay delay function
48 | * @brief delay function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief delay clock init
54 | * @return status code
55 | * - 0 success
56 | * @note none
57 | */
58 | uint8_t delay_init(void);
59 |
60 | /**
61 | * @brief delay us
62 | * @param[in] us time
63 | * @note none
64 | */
65 | void delay_us(uint32_t us);
66 |
67 | /**
68 | * @brief delay ms
69 | * @param[in] ms time
70 | * @note none
71 | */
72 | void delay_ms(uint32_t ms);
73 |
74 | /**
75 | * @}
76 | */
77 |
78 | #ifdef __cplusplus
79 | }
80 | #endif
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/sdio.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file sdio.h
25 | * @brief sdio header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef SDIO_H
38 | #define SDIO_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /**
47 | * @defgroup sdio sdio function
48 | * @brief sdio function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief sdio bus init
54 | * @return status code
55 | * - 0 success
56 | * - 1 init failed
57 | * - 2 get card information failed
58 | * - 3 set 4 wire bus failed
59 | * @note none
60 | */
61 | uint8_t sdio_init(void);
62 |
63 | /**
64 | * @brief sdio bus deinit
65 | * @return status code
66 | * - 0 success
67 | * - 1 deinit failed
68 | * @note none
69 | */
70 | uint8_t sdio_deinit(void);
71 |
72 | /**
73 | * @brief sdio write
74 | * @param[in] sector write first sector
75 | * @param[in] *buf pointer to a data buffer
76 | * @param[in] cnt data length
77 | * @return status code
78 | * - 0 success
79 | * - 1 write failed
80 | * - 2 write timeout
81 | * @note none
82 | */
83 | uint8_t sdio_write(uint32_t sector, uint8_t *buf, uint32_t cnt);
84 |
85 | /**
86 | * @brief sdio read
87 | * @param[in] sector read first sector
88 | * @param[out] *buf pointer to a data buffer
89 | * @param[in] cnt data length
90 | * @return status code
91 | * - 0 success
92 | * - 1 read failed
93 | * - 2 read timeout
94 | * @note none
95 | */
96 | uint8_t sdio_read(uint32_t sector, uint8_t *buf, uint32_t cnt);
97 |
98 | /**
99 | * @brief sdio get sd handle
100 | * @return pointer to a sd handle
101 | * @note none
102 | */
103 | SD_HandleTypeDef* sdio_get_handle(void);
104 |
105 | /**
106 | * @brief sdio get the tx dma handle
107 | * @return pointer to a tx dma handle
108 | * @note none
109 | */
110 | DMA_HandleTypeDef* sdio_get_tx_dma_handle(void);
111 |
112 | /**
113 | * @brief sdio get the rx dma handle
114 | * @return pointer to a rx dma handle
115 | * @note none
116 | */
117 | DMA_HandleTypeDef* sdio_get_rx_dma_handle(void);
118 |
119 | /**
120 | * @brief sdio get card info handle
121 | * @return pointer to a card info handle
122 | * @note none
123 | */
124 | HAL_SD_CardInfoTypeDef* sdio_get_card_info(void);
125 |
126 | /**
127 | * @brief sdio set tx done
128 | * @note none
129 | */
130 | void sdio_set_tx_done(void);
131 |
132 | /**
133 | * @brief sdio set rx done
134 | * @note none
135 | */
136 | void sdio_set_rx_done(void);
137 |
138 | /**
139 | * @}
140 | */
141 |
142 | #ifdef __cplusplus
143 | }
144 | #endif
145 |
146 | #endif
147 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/inc/wire.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file wire.h
25 | * @brief wire header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef WIRE_H
38 | #define WIRE_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /**
47 | * @defgroup wire wire function
48 | * @brief wire function modules
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief wire bus init
54 | * @return status code
55 | * - 0 success
56 | * @note IO is PA8
57 | */
58 | uint8_t wire_init(void);
59 |
60 | /**
61 | * @brief wire bus deint
62 | * @return status code
63 | * - 0 success
64 | * @note none
65 | */
66 | uint8_t wire_deinit(void);
67 |
68 | /**
69 | * @brief wire bus read data
70 | * @param[out] *value pointer to a read data buffer
71 | * @return status code
72 | * - 0 success
73 | * @note none
74 | */
75 | uint8_t wire_read(uint8_t *value);
76 |
77 | /**
78 | * @brief wire bus write data
79 | * @param[in] value write data
80 | * @return status code
81 | * - 0 success
82 | * @note none
83 | */
84 | uint8_t wire_write(uint8_t value);
85 |
86 | /**
87 | * @brief wire bus init
88 | * @return status code
89 | * - 0 success
90 | * @note IO is PA0
91 | */
92 | uint8_t wire_clock_init(void);
93 |
94 | /**
95 | * @brief wire bus deint
96 | * @return status code
97 | * - 0 success
98 | * @note none
99 | */
100 | uint8_t wire_clock_deinit(void);
101 |
102 | /**
103 | * @brief wire bus write the data
104 | * @param[in] value write data
105 | * @return status code
106 | * - 0 success
107 | * @note none
108 | */
109 | uint8_t wire_clock_write(uint8_t value);
110 |
111 | /**
112 | * @}
113 | */
114 |
115 | #ifdef __cplusplus
116 | }
117 | #endif
118 |
119 | #endif
120 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/src/clock.c:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file clock.c
25 | * @brief clock source file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #include "clock.h"
38 |
39 | /**
40 | * @brief chip clock init
41 | * @note none
42 | */
43 | void clock_init(void)
44 | {
45 | RCC_OscInitTypeDef RCC_OscInitStructure;
46 | RCC_ClkInitTypeDef RCC_ClkInitStructure;
47 | HAL_StatusTypeDef ret;
48 |
49 | /* enable power clock */
50 | __HAL_RCC_PWR_CLK_ENABLE();
51 | __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
52 |
53 | /* use HSE */
54 | RCC_OscInitStructure.OscillatorType = RCC_OSCILLATORTYPE_HSE;
55 | RCC_OscInitStructure.HSEState = RCC_HSE_ON;
56 | RCC_OscInitStructure.PLL.PLLState = RCC_PLL_ON;
57 | RCC_OscInitStructure.PLL.PLLSource = RCC_PLLSOURCE_HSE;
58 | RCC_OscInitStructure.PLL.PLLM = 8;
59 | RCC_OscInitStructure.PLL.PLLN = 336;
60 | RCC_OscInitStructure.PLL.PLLP = 2;
61 | RCC_OscInitStructure.PLL.PLLQ = 7;
62 | ret = HAL_RCC_OscConfig(&RCC_OscInitStructure);
63 | if (ret != HAL_OK)
64 | {
65 | while(1);
66 | }
67 |
68 | /* config clock */
69 | RCC_ClkInitStructure.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
70 | RCC_ClkInitStructure.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
71 | RCC_ClkInitStructure.AHBCLKDivider = RCC_SYSCLK_DIV1;
72 | RCC_ClkInitStructure.APB1CLKDivider = RCC_HCLK_DIV4;
73 | RCC_ClkInitStructure.APB2CLKDivider = RCC_HCLK_DIV2;
74 | ret = HAL_RCC_ClockConfig(&RCC_ClkInitStructure, FLASH_LATENCY_5);
75 | if (ret != HAL_OK)
76 | {
77 | while(1);
78 | }
79 |
80 | /* check the id and enable flash prefetch buffer */
81 | if (HAL_GetREVID() == 0x1001)
82 | {
83 | __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
84 | }
85 |
86 | /* hal init */
87 | ret = HAL_Init();
88 | if (ret != HAL_OK)
89 | {
90 | while(1);
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/project/stm32f407/interface/src/delay.c:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file delay.c
25 | * @brief delay source file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #include "delay.h"
38 |
39 | static volatile uint32_t gs_fac_us = 0; /**< fac cnt */
40 |
41 | /**
42 | * @brief delay clock init
43 | * @return status code
44 | * - 0 success
45 | * @note none
46 | */
47 | uint8_t delay_init(void)
48 | {
49 | /* usr HCLK */
50 | HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
51 |
52 | /* set fac */
53 | gs_fac_us = 168;
54 |
55 | return 0;
56 | }
57 |
58 | /**
59 | * @brief delay us
60 | * @param[in] us time
61 | * @note none
62 | */
63 | void delay_us(uint32_t us)
64 | {
65 | uint32_t ticks;
66 | uint32_t told;
67 | uint32_t tnow;
68 | uint32_t tcnt;
69 | uint32_t reload;
70 |
71 | /* set the used param */
72 | tcnt = 0;
73 | reload = SysTick->LOAD;
74 | ticks = us * gs_fac_us;
75 | told = SysTick->VAL;
76 |
77 | /* delay */
78 | while (1)
79 | {
80 | tnow = SysTick->VAL;
81 | if (tnow != told)
82 | {
83 | if (tnow < told)
84 | {
85 | tcnt += told - tnow;
86 | }
87 | else
88 | {
89 | tcnt += reload - tnow + told;
90 | }
91 | told = tnow;
92 | if (tcnt >= ticks)
93 | {
94 | break;
95 | }
96 | }
97 | }
98 | }
99 |
100 | /**
101 | * @brief delay ms
102 | * @param[in] ms time
103 | * @note none
104 | */
105 | void delay_ms(uint32_t ms)
106 | {
107 | /* use the hal delay */
108 | HAL_Delay(ms);
109 | }
110 |
--------------------------------------------------------------------------------
/project/stm32f407/output/mdk/obj_delete.bat:
--------------------------------------------------------------------------------
1 | del *.bak /s
2 | del *.ddk /s
3 | del *.edk /s
4 | del *.lst /s
5 | del *.lnp /s
6 | del *.mpf /s
7 | del *.mpj /s
8 | del *.obj /s
9 | del *.omf /s
10 | ::del *.opt /s
11 | del *.plg /s
12 | del *.rpt /s
13 | del *.tmp /s
14 | del *.__i /s
15 | del *.crf /s
16 | del *.o /s
17 | del *.d /s
18 | del *.axf /s
19 | del *.tra /s
20 | del *.dep /s
21 | del *.iex /s
22 | del *.htm /s
23 | del *.sct /s
24 | del *.map /s
25 | exit
26 |
--------------------------------------------------------------------------------
/project/stm32f407/usr/inc/shell.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file shell.h
25 | * @brief shell header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef SHELL_H
38 | #define SHELL_H
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | #ifdef __cplusplus
45 | extern "C"{
46 | #endif
47 |
48 | /**
49 | * @defgroup shell shell function
50 | * @brief shell function modules
51 | * @{
52 | */
53 |
54 | /**
55 | * @brief shell param definition
56 | */
57 | #define SHELL_MAX_SIZE 32 /**< shell max function number */
58 | #define SHELL_MAX_NAME 32 /**< shell max function name length */
59 | #define SHELL_MAX_REG_SIZE 32 /**< shell max register number */
60 | #define SHELL_MAX_BUF_SIZE 256 /**< shell max buffer size */
61 |
62 | /**
63 | * @brief function struture definition
64 | */
65 | typedef struct function_s
66 | {
67 | char name[SHELL_MAX_NAME]; /**< functon name */
68 | uint8_t (*fuc)(uint8_t argc, char **argv); /**< function address */
69 | } function_t;
70 |
71 | /**
72 | * @brief shell struture definition
73 | */
74 | typedef struct shell_s
75 | {
76 | function_t fuc[SHELL_MAX_REG_SIZE]; /**< functon buffer */
77 | uint16_t fuc_i; /**< functon number */
78 | char *argv[SHELL_MAX_SIZE]; /**< argv temp buffer */
79 | char buf_out[SHELL_MAX_BUF_SIZE]; /**< output buffer */
80 | } shell_t;
81 |
82 | /**
83 | * @brief init shell
84 | * @return status code
85 | * - 0 success
86 | * @note none
87 | */
88 | uint8_t shell_init(void);
89 |
90 | /**
91 | * @brief shell register function
92 | * @param[in] *name pointer to a name buffer
93 | * @param[in] *fuc pointer to a function address
94 | * @return status code
95 | * - 0 success
96 | * - 1 buffer is full
97 | * @note none
98 | */
99 | uint8_t shell_register(char *name, uint8_t (*fuc)(uint8_t argc, char **argv));
100 |
101 | /**
102 | * @brief shell parse command
103 | * @param[in] *buf pointer to a buffer address
104 | * @param[in] len buffer length
105 | * @return status code
106 | * - 0 success
107 | * - 1 run failed
108 | * - 2 find function failed
109 | * - 3 length is too big
110 | * - 4 pretreat failed
111 | * @note none
112 | */
113 | uint8_t shell_parse(char *buf, uint16_t len);
114 |
115 | /**
116 | * @}
117 | */
118 |
119 | #ifdef __cplusplus
120 | }
121 | #endif
122 |
123 | #endif
124 |
--------------------------------------------------------------------------------
/project/stm32f407/usr/inc/stm32f4xx_it.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file stm32f4xx_it.h
25 | * @brief stm32f4xx it header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2022-11-11
29 | *
30 | *
history
31 | *
32 | *
Date
Version
Author
Description
33 | *
2022/11/11
1.0
Shifeng Li
first upload
34 | *
35 | */
36 |
37 | #ifndef STM32F4XX_IT_H
38 | #define STM32F4XX_IT_H
39 |
40 | #include "stm32f4xx_hal.h"
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /**
47 | * @defgroup IT HAL_IT_Private_Functions
48 | * @{
49 | */
50 |
51 | /**
52 | * @brief nmi handler
53 | * @note none
54 | */
55 | void NMI_Handler(void);
56 |
57 | /**
58 | * @brief hardfault handler
59 | * @note none
60 | */
61 | void HardFault_Handler(void);
62 |
63 | /**
64 | * @brief memory manage handler
65 | * @note none
66 | */
67 | void MemManage_Handler(void);
68 |
69 | /**
70 | * @brief bus fault handler
71 | * @note none
72 | */
73 | void BusFault_Handler(void);
74 |
75 | /**
76 | * @brief usage fault handler
77 | * @note none
78 | */
79 | void UsageFault_Handler(void);
80 |
81 | /**
82 | * @brief svc handler
83 | * @note none
84 | */
85 | void SVC_Handler(void);
86 |
87 | /**
88 | * @brief debug handler
89 | * @note none
90 | */
91 | void DebugMon_Handler(void);
92 |
93 | /**
94 | * @brief pendsv handler
95 | * @note none
96 | */
97 | void PendSV_Handler(void);
98 |
99 | /**
100 | * @brief systick handler
101 | * @note none
102 | */
103 | void SysTick_Handler(void);
104 |
105 | /**
106 | * @brief usart1 irq handler
107 | * @note none
108 | */
109 | void USART1_IRQHandler(void);
110 |
111 | /**
112 | * @brief usart2 irq handler
113 | * @note none
114 | */
115 | void USART2_IRQHandler(void);
116 |
117 | /**
118 | * @}
119 | */
120 |
121 | #ifdef __cplusplus
122 | }
123 | #endif
124 |
125 | #endif
126 |
--------------------------------------------------------------------------------
/project/stm32f407/usr/inc/system_stm32f4xx.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file system_stm32f4xx.h
4 | * @author MCD Application Team
5 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * Copyright (c) 2017 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software is licensed under terms that can be found in the LICENSE file
13 | * in the root directory of this software component.
14 | * If no LICENSE file comes with this software, it is provided AS-IS.
15 | *
16 | ******************************************************************************
17 | */
18 |
19 | /** @addtogroup CMSIS
20 | * @{
21 | */
22 |
23 | /** @addtogroup stm32f4xx_system
24 | * @{
25 | */
26 |
27 | /**
28 | * @brief Define to prevent recursive inclusion
29 | */
30 | #ifndef __SYSTEM_STM32F4XX_H
31 | #define __SYSTEM_STM32F4XX_H
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | /** @addtogroup STM32F4xx_System_Includes
38 | * @{
39 | */
40 |
41 | /**
42 | * @}
43 | */
44 |
45 |
46 | /** @addtogroup STM32F4xx_System_Exported_types
47 | * @{
48 | */
49 | /* This variable is updated in three ways:
50 | 1) by calling CMSIS function SystemCoreClockUpdate()
51 | 2) by calling HAL API function HAL_RCC_GetSysClockFreq()
52 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
53 | Note: If you use this function to configure the system clock; then there
54 | is no need to call the 2 first functions listed above, since SystemCoreClock
55 | variable is updated automatically.
56 | */
57 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
58 |
59 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
60 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | /** @addtogroup STM32F4xx_System_Exported_Constants
67 | * @{
68 | */
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | /** @addtogroup STM32F4xx_System_Exported_Macros
75 | * @{
76 | */
77 |
78 | /**
79 | * @}
80 | */
81 |
82 | /** @addtogroup STM32F4xx_System_Exported_Functions
83 | * @{
84 | */
85 |
86 | extern void SystemInit(void);
87 | extern void SystemCoreClockUpdate(void);
88 | /**
89 | * @}
90 | */
91 |
92 | #ifdef __cplusplus
93 | }
94 | #endif
95 |
96 | #endif /*__SYSTEM_STM32F4XX_H */
97 |
98 | /**
99 | * @}
100 | */
101 |
102 | /**
103 | * @}
104 | */
105 |
--------------------------------------------------------------------------------
/test/driver_ov2640_register_test.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 - present LibDriver All rights reserved
3 | *
4 | * The MIT License (MIT)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in all
14 | * copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | *
24 | * @file driver_ov2640_register_test.h
25 | * @brief driver ov2640 register test header file
26 | * @version 1.0.0
27 | * @author Shifeng Li
28 | * @date 2023-11-30
29 | *
30 | *