Skip to content

Commit ec385a2

Browse files
committed
cleanup and add library.properties
1 parent 173efe0 commit ec385a2

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

examples/SST25VFTest/SST25VFTest.ino

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#include <SST25VF.h>
2+
#include <SPI.h>
3+
4+
5+
#define MemCs 6 //chip select
6+
#define MemWp 4 //write protection
7+
#define MemHold 14 //hold
8+
9+
SST25VF flash;
10+
11+
#define DL 11
12+
uint8_t buffer[DL]; //20130903T2046Z
13+
14+
void setup(){
15+
Serial.begin(38400);
16+
17+
flash.begin(MemCs,MemWp,MemHold);
18+
19+
}
20+
21+
void loop(){
22+
23+
Serial.println("writing bytes....");
24+
for(uint8_t i=0;i<11;i++)
25+
{
26+
flash.writeByte((uint32_t)i,i);
27+
Serial.print("address: ");
28+
Serial.println(i);
29+
}
30+
Serial.println("reading bytes....");
31+
32+
long x=0;
33+
flash.readInit((4096UL*x));
34+
35+
boolean sectorEmpty = true;
36+
for (int q=0; q<11; q++)
37+
{
38+
uint8_t result = flash.readNext();
39+
Serial.println(result,DEC);
40+
if (result == 0xFF)
41+
{
42+
43+
break;
44+
}
45+
}
46+
47+
flash.readFinish();
48+
//-----------------------------------------------
49+
Serial.println("erasing...");
50+
flash.sectorErase(0);
51+
52+
Serial.println("writing array...");
53+
54+
for(uint8_t i=0;i<DL;i++)
55+
{
56+
buffer[i] = i;
57+
}
58+
59+
for(uint8_t j=0;j<10;j++)
60+
{
61+
flash.writeArray(DL*j, buffer,DL);
62+
}
63+
64+
//-------------------------------------------
65+
66+
Serial.println("reading Array Written bytes....");
67+
68+
for(uint8_t j=0;j<10;j++)
69+
{
70+
flash.readInit((DL*j));
71+
72+
73+
for (int q=0; q<DL; q++)
74+
{
75+
uint8_t result = flash.readNext();
76+
Serial.println(result);
77+
buffer[q] = result;
78+
79+
}
80+
81+
flash.readFinish();
82+
83+
84+
Serial.println("--------------------------------");
85+
for(uint8_t i=0;i<DL;i++)
86+
{
87+
Serial.print(" ");
88+
Serial.print(buffer[i]);
89+
}
90+
}
91+
Serial.println(".");
92+
flash.sectorErase(x);
93+
delay(200);
94+
}

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=SST25VF
2+
version=0.1.0
3+
author=Noah Shibley
4+
maintainer=Noah Shibley
5+
sentence=Arduino Library for controlling the SST Nor Serial Flash SST25VF family.
6+
paragraph=Much of the code in the library is Based on SST code from: (Rugged Circuits and Wusik) Should work for SST25VF004, SST25VF016, SST25VF064, etc.
7+
category=Data Storage
8+
url=https://github.com/nullboundary/SST25VF
9+
architectures=avr

0 commit comments

Comments
 (0)