AT45
1.0.0
A simple library designed to perform basic operations with serial flash memory devices of the AT45DB family.
bool pageErase
/* First device */
AT45_Init(&AT45_Handle, &hspi3, CS0_GPIO_Port, CS0_Pin);
/* Second device */
AT45_Init(&AT45_Handle1, &hspi3, CS1_GPIO_Port, CS1_Pin);
/* Third device */
AT45_Init(&AT45_Handle2, &hspi3, CS2_GPIO_Port, CS2_Pin);bool pageErase of write function helps to meet different scenarios, especially in time-critical procedures.#include "AT45.h"AT45_HandleTypeDef AT45_Handle;#define CS0_Pin GPIO_PIN_0
#define CS0_GPIO_Port GPIODAT45_Init(&AT45_Handle, &hspi3, CS0_GPIO_Port, CS0_Pin);This library should work out of box together with HAL
AT45_Interface.h provide your own SPI.h and Delay.h includesAT45_Interface.c change next func calls to yours:SPI_Transmit(hspix, pData, size, timeout);
///
SPI_Receive(hspix, pData, size, timeout);
///
Delay(ms);Or just use existing SPL SPI driver, which are oversimplificated but still in manner of HAL driver
Toolchain: IAR EWARM v9.40.1
Target MCU: STM32F407VGT6 (STM32F4XX_M devboard)
Debugger: ST-LINK/V2
For application use refer to HAL/../main.c or SPL/../main.c