This is a basic synchronous driver for the winbond W25 series of serial NOR flash devices. (Datasheets )
It's been tested on a W25Q32JV
The driver is MCU agnostic, implement or replace the following SPI defines in spi.h
):
SPI_EXCHANGE
: spi byte exchange - must be 8 bits wide, eguint8_t myfunc(uint8_t sendval)
SPI_FLASH_CS_ENABLE
: of typevoid()
: cs enable (drive line low) for this the flash chip slaveSPI_FLASH_CS_DISABLE
: of typevoid()
: cs disable (drive line high) for this the flash chip slave
All W25Q32JV functions are synchronous, designed to be called in a RTOS system with tasks that can block/yield/sleep. Read/write ops spin wait on busy status to completion for simplicity.
Dual and quad IO ops are not implemented in this driver due to targeting 3 pin SPI. It's not particularly fast, designed for tight / small devices over raw speed (use dual/SQI for that!)
This driver was realized on a PIC24F08KL200 and has MPLABX + XC16 test code in main.c