Skip to content

Commit

Permalink
All references to SPIFlash changed to SPIMemory wherever required.
Browse files Browse the repository at this point in the history
v3.2.0 ready to go
  • Loading branch information
Marzogh committed May 16, 2018
1 parent c65e7de commit f2d33cd
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
5 changes: 2 additions & 3 deletions examples/Struct_writer/Struct_writer.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Struct_writer.ino |
| SPIFlash library |
| SPIMemory library |
| v 3.1.0 |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Marzogh |
Expand All @@ -13,7 +13,7 @@
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
*/

#include<SPIFlash.h>
#include<SPIMemory.h>

//#define PRINTDETAIL
//#define PRINTINDIVIDUALRUNS
Expand Down Expand Up @@ -270,4 +270,3 @@ void printLine() {
Serial.print("-");
}
}

4 changes: 2 additions & 2 deletions examples/TestFlash/TestFlash.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
----------------------------------------------------------------------------------------------------------------------------------
| Winbond Flash |
| SPIFlash library test v3.0.1 |
| SPIMemory library test v3.0.1 |
|----------------------------------------------------------------------------------------------------------------------------------|
| Marzogh |
| 16.11.2016 |
Expand Down Expand Up @@ -68,7 +68,7 @@



#include<SPIFlash.h>
#include<SPIMemory.h>
uint8_t pageBuffer[256];
String serialCommand;
char printBuffer[128];
Expand Down
2 changes: 1 addition & 1 deletion examples/TestFlash/command_list.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
void commandList() {
Serial.println(F("-----------------------------------------------------------------------------------------------------------------------------------"));
Serial.println(F(" Winbond Flash "));
Serial.println(F(" SPIFlash library test v3.1.0 "));
Serial.println(F(" SPIMemory library test v3.2.0 "));
Serial.println(F(" ----------------------------------------------------------------------------------------------------------------------------------"));
Serial.println(F(" Marzogh "));
Serial.println(F(" 24.11.2015 "));
Expand Down
4 changes: 2 additions & 2 deletions examples/getAddressEx/getAddressEx.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| getAddressEx.ino |
| SPIFlash library |
| SPIMemory library |
| v 3.0.0 |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Marzogh |
Expand All @@ -14,7 +14,7 @@
| |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
*/
#include<SPIFlash.h>
#include<SPIMemory.h>

#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
// Required for Serial on Zero based boards
Expand Down
4 changes: 2 additions & 2 deletions examples/readWriteString/readWriteString.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| readWriteString.ino |
| SPIFlash library |
| SPIMemory library |
| v 3.0.0 |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Marzogh |
Expand All @@ -12,7 +12,7 @@
| |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
*/
#include<SPIFlash.h>
#include<SPIMemory.h>

uint32_t strAddr;

Expand Down
20 changes: 10 additions & 10 deletions extras/DMASAMD.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* Arduino SPIFlash Library v.2.6.0
/* Arduino SPIMemory Library v.2.6.0
* Copyright (C) 2017 by Prajwal Bhattaram
* Created by Prajwal Bhattaram - 30/09/2016
* Modified by Prajwal Bhattaram - 14/04/2017
* Original code from @manitou48 <https://github.com/manitou48/Zero/blob/master/SPIdma.ino>
*
* This file is part of the Arduino SPIFlash Library. This library is for
* This file is part of the Arduino SPIMemory Library. This library is for
* Winbond NOR flash memory modules. In its current form it enables reading
* and writing individual data variables, structs and arrays from and to various locations;
* reading and writing pages; continuous read functions; sector, block and chip erase;
Expand All @@ -21,11 +21,11 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License v3.0
* along with the Arduino SPIFlash Library. If not, see
* along with the Arduino SPIMemory Library. If not, see
* <http://www.gnu.org/licenses/>.
*/

#include "SPIFlash.h"
#include "SPIMemory.h"

//--------------------------- Private Arduino Zero Variables ----------------------------//
Sercom *sercom = (Sercom *)ZERO_SPISERCOM; //Set SPI SERCOM
Expand All @@ -51,7 +51,7 @@
// Private functions used by Arduino Zero DMA operations //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

void SPIFlash::_zeroDMAC_Handler(void) {
void SPIMemory::_zeroDMAC_Handler(void) {
// interrupts DMAC_CHINTENCLR_TERR DMAC_CHINTENCLR_TCMPL DMAC_CHINTENCLR_SUSP
uint8_t active_channel;

Expand All @@ -66,7 +66,7 @@ void SPIFlash::_zeroDMAC_Handler(void) {
__enable_irq();
}

void SPIFlash::_zeroDma_init() {
void SPIMemory::_zeroDma_init() {
// probably on by default
PM->AHBMASK.reg |= PM_AHBMASK_DMAC ;
PM->APBBMASK.reg |= PM_APBBMASK_DMAC ;
Expand All @@ -77,7 +77,7 @@ void SPIFlash::_zeroDma_init() {
DMAC->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN(0xf);
}

void SPIFlash::_zeroSpi_xfr(void *txdata, void *rxdata, size_t n) {
void SPIMemory::_zeroSpi_xfr(void *txdata, void *rxdata, size_t n) {
uint32_t temp_CHCTRLB_reg;

// set up transmit channel
Expand Down Expand Up @@ -140,18 +140,18 @@ void SPIFlash::_zeroSpi_xfr(void *txdata, void *rxdata, size_t n) {
DMAC->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE;
}

void SPIFlash::_zeroSpi_write(void *data, size_t n) {
void SPIMemory::_zeroSpi_write(void *data, size_t n) {
xtype = DoTX;
Serial.println("SPI_write started");
_zeroSpi_xfr(data,rxsink,n);
Serial.println("WRITE DONE");
}
void SPIFlash::_zeroSpi_read(void *data, size_t n) {
void SPIMemory::_zeroSpi_read(void *data, size_t n) {
xtype = DoRX;
_zeroSpi_xfr(txsrc,data,n);
Serial.println("READ DONE");
}
void SPIFlash::_zeroSpi_transfer(void *txdata, void *rxdata, size_t n) {
void SPIMemory::_zeroSpi_transfer(void *txdata, void *rxdata, size_t n) {
xtype = DoTXRX;
_zeroSpi_xfr(txdata,rxdata,n);
Serial.println("transfer done");
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ maintainer=Prajwal Bhattaram <marzogh@icloud.com>
sentence=SPI Flash library for Arduino.
paragraph=Starting v3.2.0, this library enables read, write, erase and power functions on all SFDP compatible Flash chips. Older versions are only compatible with specific chips as listed here - < v2.6.0 is compatible with W25X05**, W25X10**, W25X20**, W25X40**, W25Q80**, W25Q16**, W25Q32** & W25Q64**. All other Winbond flash chips can also be used with this library from v2.6.0 onwards. A number of Microchip, Cypress & Spansion chips - W25Q128**, W25Q256**, SST25VF064C, SST26VF064B & S25FL116K - can be used with with the library from v3.0.0 onwards. Refer to change log for further information about this release.
category=Data Storage
url=https://github.com/Marzogh/SPIFlash
url=https://github.com/Marzogh/SPIMemory
architectures=avr,sam,samd,esp8266,esp32,Simblee,stm32
includes=SPIFlash.h
includes=SPIMemory.h

0 comments on commit f2d33cd

Please sign in to comment.