Releases: Marzogh/SPIMemory
Arduino library for Winbond Flash W25Q80BV - 64 Mbits (1MB)
Arduino library for Winbond Flash W25Q80BV - 64 Mbits (1MB)
Arduino library for Winbond Flash W25Q80BV - 8 Mbits (1MB)
SPIFlash
All functions have been tested and found to work well on Arduino 1.6.x.
Please report any issues and I will do my best to fix them.
Change log
v 1.2.0
- Updated ReadMe.md has all information needed to use the library.
- v1.2.0 is faster than v1.0.1
Additions
- Added ability to turn off Address overflow - it is turned on by default.
- Enabled Error check on all write commands to check for write errors. Refer to ReadMe.md for instructions on turning it off.
- Added a function to read/write from/to a byte array of any size (Optimized to read continuously instead of the user having to call beginRead() and then repeatedly call the readByte() function - refer to Deprecations section below)
- Added the ability to read and write data to a particular location in the memory without a process that involves reading and writing the whole page as in v1.0.1 - This reduces wear and speeds up the function
- All functions now take only the page number/page number & offset unlike v1.0.1 where some functions accepted the byte address directly. This makes writing code easier.It also eliminates the need to remember byte addresses.
Deprecations
- Removed access to the beginRead(), readNextByte() and endRead() functions - they are now private functions and can still be accessed by advanced users who can modify the library. These have been replaced by the higher level readBytes() and writeBytes() functions. (Refer to the Additions section above).
Backward compatibility
- All functions in v1.0.1 except the ones listed in the 'Deprecations' section above are still available.
- The following functions take different arguments in v1.2.0 when compared to v1.0.1
- eraseSector(), eraseBlock32K() & eraseBlock64K() now take page numbers as arguments instead of byte addresses
- All write functions take an additional, optional, boolean argument to disable Error checking - the errorCheck argument is for advanced users only and defaults to true.
- The constructor takes an additional, optional boolean argument to disable Address overflow - the overflow argument is for advanced users only and defaults to true.
Arduino library for Winbond Flash W25Q80BV - 8 Mbits (1MB)
SPIFlash
All functions have been tested and found to work well on Arduino 1.6.x.
Please report any issues and I will do my best to fix them.
Change log
v 1.0.1
- Added Output options to readPage()
- The function readPage() now takes an extra argument along with page_buffer - outputType. Setting an outputType of 1 enables output in hexadecimal while an outputType of 2 enables output in decimal, CSV - over Serial.
Arduino library for Winbond Flash W25Q80BV - 64 Mbits (1MB)
SPIFlash
All functions have been tested and found to work well on Arduino 1.6.x.
Please report any issues and I will do my best to fix them.
Change log
v 1.0
Installation
- Click on the 'Download zip' button to the right.
- Unzip the archive and rename resulting folder to 'SPIFlash'
- Move the folder to your libraries folder (~/sketches/libraries)
Usage
The library is called by declaring theSPIFLASH flash(csPin)
constructor where 'flash' can be replaced by a user constructor of choice and 'csPin' is the Chip Select pin for the flash module.
Make sure to include #include<SPI.H>
when you include #include<SPIFlash.h>
.
The library enables the following functions: (For further details on the functions refer to README.md)
Get JEDEC ID
getID ()
Continuous read commands
beginRead(address)
readNextByte()
endRead()
Read commands
readByte(page, offset)
readPage(page_number, *page_buffer, outputType)
Write commands
writeByte(page, offset, data)
Writes a byte of data to a specific location on a page. Takes the page number (0-4095), offset of data byte within page (0-255) and one byte of data (0-255) as arguments.
writePage(uint16_t page_number, uint8_t *page_buffer)
Erase commands
eraseSector(address)
eraseBlock32K(address)
eraseBlock64K(address)
eraseChip()
Suspend/Resume commands
suspendProg()
resumeProg()
Power operation commands
powerDown()
powerUp()
readAllPages()
How to get data off Flash memory via Serial
(Works only for Unix based Operating Systems)
Refer to README.md