Skip to content

Commit 64643ae

Browse files
author
iotts
committed
fix some bugs
1 parent 1088006 commit 64643ae

File tree

6 files changed

+227
-140
lines changed

6 files changed

+227
-140
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You can easily read and write flash storage, such as W25Q32
44

55
This lib is available for ESP32\ESP8266 STM32dunio Arduino
66

7-
I only tested it on stm32
7+
88

99
example
1010
```cpp

examples/read_write/read_write.ino

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <Arduino.h>
2+
#include <SPI.h>
3+
#include "SFLib.h"
4+
5+
SFLib W25QX;
6+
7+
void setup() {
8+
#if (defined STM32F4xx) || (defined STM32F1xx)
9+
Serial.setRx(PA10);
10+
Serial.setTx(PA9);
11+
#endif
12+
13+
Serial.begin(115200);
14+
#if (defined STM32F4xx) || (defined STM32F1xx)
15+
W25QX.begin(PB7);
16+
#elif defined(ESP32)
17+
W25QX.begin(25);
18+
#endif
19+
Serial.println(W25QX.read_id(),HEX);
20+
Serial.println(W25QX.read_chipid(),HEX);
21+
uint8_t readbuf[15] = "";
22+
uint8_t sendbuf[15] = "hello jack";
23+
W25QX.write_arbitrary_data(1000,sendbuf,10);
24+
W25QX.read_data(1000,readbuf,10);
25+
Serial.println((const char *)readbuf);
26+
}
27+
void loop(){
28+
29+
}

keywords.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#######################################
2+
# Datatypes (KEYWORD1)
3+
#######################################
4+
5+
#######################################
6+
# Classes (KEYWORD1)
7+
#######################################
8+
9+
SFLib KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
begin KEYWORD2
16+
read_data KEYWORD2
17+
write_one_sector_data KEYWORD2
18+
write_one_block_data KEYWORD2
19+
write_arbitrary_data KEYWORD2
20+
sector_erase KEYWORD2
21+
bulk_erase KEYWORD2
22+
read_status KEYWORD2
23+
write_status KEYWORD2
24+
read_id KEYWORD2
25+
read_chipid KEYWORD2
26+
write_enable KEYWORD2
27+
write_disable KEYWORD2
28+
wakeup KEYWORD2
29+
check_busy KEYWORD2
30+
31+
#######################################
32+
# Instances (KEYWORD2)
33+
#######################################
34+
35+
#######################################
36+
# Constants (LITERAL1)
37+
#######################################
38+
39+

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=SFLib
2+
version=1.0.1
3+
author=luyang14
4+
maintainer=iotts
5+
sentence=SPIFlash Library
6+
paragraph=SPIFlash Library
7+
category=Other
8+
url=https://github.com/luyang14/SFLib.git
9+
architectures=*

0 commit comments

Comments
 (0)