10#include "stm32f439xx.h"
16#define FLASH_PAGE_PROGRAM 0x02
17#define FLASH_READ_DATA 0x03
18#define FLASH_WRITE_ENABLE 0x06
19#define FLASH_ERASE_CHIP 0x60
20#define FLASH_READ_STATUS_REGISTER_1 0x05
21#define FLASH_READ_STATUS_REGISTER_2 0x35
22#define FLASH_READ_STATUS_REGISTER_3 0x15
39void configure_SPI4_Flash();
void _Flash_readStatus2(Flash *, uint8_t *)
Read from Status Register 2.
void Flash_readPage(Flash *, uint32_t, volatile uint8_t *)
Read from flash.
void _Flash_readStatus1(Flash *, uint8_t *)
Read from Status Register 1.
void _Flash_readStatus3(Flash *, uint8_t *)
Read from Status Register 3.
void Flash_writePage(Flash *, uint32_t, uint8_t *)
Write page to flash.
DeviceHandle_t Flash_init(Flash *, char[DEVICE_NAME_LENGTH], GPIO_TypeDef *, unsigned long, int, long)
Initialise flash struct.
void _Flash_writeEnable(Flash *)
Send Write Enable instruction to the flash device.
void Flash_erase(Flash *)
Erase flash chip.
SPI base
Parent SPI interface.
void(* readPage)(struct Flash *, uint32_t, volatile uint8_t *)
Read page method.
void(* erase)(struct Flash *)
Chip erase method.
void(* writePage)(struct Flash *, uint32_t, uint8_t *)
Write page method.
Struct definition for SPI interface. Provides the interface for API consumers to interact with the SP...