H753_CPP_W25Q_SPI_Flash_Read_Write_01 1.0
STM32H753 W25Q SPI flash (Adafruit 5632/5633/5634) read/write tutorial
Loading...
Searching...
No Matches
entryPointCPP.hpp
1/*
2 * entryPointCPP.hpp
3 *
4 * C-callable entry points bridging CubeMX-generated main.c (plain C, subject
5 * to regeneration whenever the .ioc changes) into the C++ W25QFlashSPI driver.
6 *
7 * extern "C" here prevents C++ name mangling on these declarations, so
8 * main.c can call them directly by name. The driver object itself is
9 * constructed inside initW25QFlash(), deliberately called from main() after
10 * HAL_Init()/MX_GPIO_Init()/MX_SPI1_Init() have already run -- not as a
11 * global static C++ object, which would construct too early (C++ global
12 * constructors run in __libc_init_array() before main() even starts, before
13 * any peripheral is configured).
14 *
15 * Created on: Aug 30, 2026
16 * Author: johng
17 */
18
19#ifndef INC_ENTRYPOINTCPP_HPP_
20#define INC_ENTRYPOINTCPP_HPP_
21
22#include "main.h"
23#include "stdbool.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
36void initW25QFlash(void);
37
45bool w25qIsReady(void);
46
54bool w25qReadBuffer(uint32_t addr, uint8_t *buf, uint32_t len);
55
64bool w25qWriteBuffer(uint32_t addr, const uint8_t *data, uint32_t len);
65
71bool w25qEraseSector(uint32_t addr);
72
79bool w25qReadJEDECID(uint32_t *id);
80
91void w25qRunValidation(void);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* INC_ENTRYPOINTCPP_HPP_ */
: Header for main.c file. This file contains the common defines of the application.