DexterHaslem / winbond-w25-flash-drv

generic driver for winbond w25 SPI nor flash devices (and PIC24 example code)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Winbond W25Q series tiny driver

This is a basic synchronous driver for the winbond W25 series of serial NOR flash devices. (Datasheets )

It's been tested on a W25Q32JV

Usage

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, eg uint8_t myfunc(uint8_t sendval)
  • SPI_FLASH_CS_ENABLE: of type void(): cs enable (drive line low) for this the flash chip slave
  • SPI_FLASH_CS_DISABLE: of type void(): 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.

Not implemented

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

Misc

This driver was realized on a PIC24F08KL200 and has MPLABX + XC16 test code in main.c

About

generic driver for winbond w25 SPI nor flash devices (and PIC24 example code)

License:MIT License


Languages

Language:C 73.4%Language:Makefile 18.8%Language:Shell 7.9%