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
w25q_commands.h
1/*
2 * w25q_commands.h
3 *
4 * Winbond W25Q-series SPI/QSPI flash command opcodes and geometry constants.
5 * Shared between the SPI and QSPI variants of this driver -- the opcodes and
6 * memory geometry are identical regardless of transport.
7 *
8 * Adapted from the command set documented in Adafruit_SPIFlash's
9 * Adafruit_FlashTransport.h (https://github.com/adafruit/Adafruit_SPIFlash,
10 * MIT License, Copyright (c) 2019 hathach for Adafruit Industries), which in
11 * turn reflects the standard JEDEC-style command set used across essentially
12 * all Winbond W25Q parts (confirmed against the W25Q16/W25Q64/W25Q128
13 * datasheets used by the Adafruit 5632/5633/5634 breakout boards).
14 *
15 * Created on: Aug 30, 2026
16 * Author: johng
17 */
18
19#ifndef W25Q_W25Q_COMMANDS_H_
20#define W25Q_W25Q_COMMANDS_H_
21
23enum {
24 W25Q_CMD_READ = 0x03,
25 W25Q_CMD_FAST_READ = 0x0B,
26 W25Q_CMD_QUAD_READ = 0x6B,
27
28 W25Q_CMD_READ_JEDEC_ID = 0x9F,
29
30 W25Q_CMD_PAGE_PROGRAM = 0x02,
31 W25Q_CMD_QUAD_PAGE_PROGRAM = 0x32,
32
33 W25Q_CMD_READ_STATUS1 = 0x05,
34 W25Q_CMD_READ_STATUS2 = 0x35,
35 W25Q_CMD_WRITE_STATUS1 = 0x01,
36 W25Q_CMD_WRITE_STATUS2 = 0x31,
37
38 W25Q_CMD_WRITE_ENABLE = 0x06,
39 W25Q_CMD_WRITE_DISABLE = 0x04,
40
41 W25Q_CMD_ERASE_SECTOR = 0x20,
42 W25Q_CMD_ERASE_BLOCK = 0xD8,
43 W25Q_CMD_ERASE_CHIP = 0xC7,
44
45 W25Q_CMD_ENABLE_RESET = 0x66,
46 W25Q_CMD_RESET = 0x99,
47};
48
50enum {
51 W25Q_PAGE_SIZE = 256,
52 W25Q_SECTOR_SIZE = 4 * 1024UL,
53 W25Q_BLOCK_SIZE = 64 * 1024UL,
54};
55
57#define W25Q_JEDEC_MANUFACTURER_ID 0xEF
58
59#endif /* W25Q_W25Q_COMMANDS_H_ */