55 #ifndef FLASHAT45DB_H_
56 #define FLASHAT45DB_H_
58 #include "../drv/mspi-drv.h"
60 #include <util/delay.h>
77 #define AT45DB_STATUS_REG 0xD7
82 #define AT45DB_BLOCK_ERASE 0x50
86 #define AT45DB_PAGE_ERASE 0x81
90 #define AT45DB_PAGE_PROGRAM_1 0x82
94 #define AT45DB_PAGE_PROGRAM_2 0x85
99 #define AT45DB_BUFFER_1 0x84
103 #define AT45DB_BUFFER_2 0x87
108 #define AT45DB_BUF_1_TO_PAGE 0x83 //0x88 without auto erase
112 #define AT45DB_BUF_2_TO_PAGE 0x86 //0x89 without auto erase
116 #define AT45DB_PAGE_READ 0xD2
123 #define AT45DB_PAGE_TO_BUF 0x55 //use buffer 2
129 #define AT45DB_READ_BUFFER 0xD6
149 volatile uint8_t buffer_addr[2];
154 volatile uint8_t buf_to_page_addr[2];
159 volatile uint8_t page_program[2];
244 void at45db_write_page(uint16_t p_addr, uint16_t b_addr, uint8_t *buffer, uint16_t bytes);