flash: separate SPI flash commands
This commit is contained in:
parent
7be9d0f049
commit
0bc1146ffd
2 changed files with 29 additions and 22 deletions
18
include/spi_flash.h
Normal file
18
include/spi_flash.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#define SPI_FLASH_UNIQ_ID 0x4b
|
||||
#define SPI_FLASH_MFR_DEV_ID 0x90
|
||||
#define SPI_FLASH_JEDEC_ID 0x9f
|
||||
|
||||
#define SPI_FLASH_READ 0x03
|
||||
|
||||
#define SPI_FLASH_PAGE_PROGRAM 0x02
|
||||
#define SPI_FLASH_WRITE_ENABLE 0x06
|
||||
#define SPI_FLASH_WRITE_DISABLE 0x04
|
||||
|
||||
#define SPI_FLASH_ERASE_4K 0x20
|
||||
#define SPI_FLASH_ERASE_32K 0x52
|
||||
#define SPI_FLASH_ERASE_64K 0xd8
|
||||
#define SPI_FLASH_ERASE_CHIP 0xc7
|
||||
|
||||
#define SPI_FLASH_SIZE(x) (1 << (x))
|
Loading…
Add table
Add a link
Reference in a new issue