#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_SR1              0x05
#define SPI_FLASH_SR1_BUSY              BIT(0)

#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))