Skip to content

Commit 3c0b262

Browse files
authored
Merge pull request #32 from adafruit/update-sdfat-v2.3.0
Update sdfat v2.3.0
2 parents 1d3b2a2 + 7726ab3 commit 3c0b262

File tree

190 files changed

+9912
-6059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+9912
-6059
lines changed

.github/workflows/githubci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
- 'feather_esp32s2'
1212
- 'feather_esp32s3'
1313
- 'feather_rp2040'
14+
- 'metro_rp2040'
1415
- 'metro_m0'
1516
- 'metro_m4'
1617
- 'nrf52840'
@@ -23,10 +24,10 @@ jobs:
2324
python-version: '3.x'
2425

2526
- name: Checkout code
26-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
2728

2829
- name: Checkout adafruit/ci-arduino
29-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3031
with:
3132
repository: adafruit/ci-arduino
3233
path: ci

.gitignore

Lines changed: 32 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -1,215 +1,36 @@
1-
#################
2-
## Eclipse
3-
#################
4-
5-
*.pydevproject
6-
.project
7-
.metadata
8-
bin/
9-
tmp/
10-
*.tmp
11-
*.bak
12-
*.swp
13-
*~.nib
14-
local.properties
15-
.classpath
16-
.settings/
17-
.loadpath
18-
19-
# External tool builders
20-
.externalToolBuilders/
21-
22-
# Locally stored "Eclipse launch configurations"
23-
*.launch
24-
25-
# CDT-specific
26-
.cproject
27-
28-
# PDT-specific
29-
.buildpath
30-
31-
32-
#################
33-
## Visual Studio
34-
#################
35-
36-
## Ignore Visual Studio temporary files, build results, and
37-
## files generated by popular Visual Studio add-ons.
38-
39-
# User-specific files
40-
*.suo
41-
*.user
42-
*.sln.docstates
43-
44-
# Build results
45-
46-
[Dd]ebug/
47-
[Rr]elease/
48-
x64/
49-
build/
50-
[Bb]in/
51-
[Oo]bj/
52-
53-
# MSTest test Results
54-
[Tt]est[Rr]esult*/
55-
[Bb]uild[Ll]og.*
56-
57-
*_i.c
58-
*_p.c
59-
*.ilk
60-
*.meta
61-
*.obj
62-
*.pch
63-
*.pdb
64-
*.pgc
65-
*.pgd
66-
*.rsp
67-
*.sbr
68-
*.tlb
69-
*.tli
70-
*.tlh
71-
*.tmp
72-
*.tmp_proj
73-
*.log
74-
*.vspscc
75-
*.vssscc
76-
.builds
77-
*.pidb
78-
*.log
79-
*.scc
80-
81-
# Visual C++ cache files
82-
ipch/
83-
*.aps
84-
*.ncb
85-
*.opensdf
86-
*.sdf
87-
*.cachefile
88-
89-
# Visual Studio profiler
90-
*.psess
91-
*.vsp
92-
*.vspx
93-
94-
# Guidance Automation Toolkit
95-
*.gpState
96-
97-
# ReSharper is a .NET coding add-in
98-
_ReSharper*/
99-
*.[Rr]e[Ss]harper
100-
101-
# TeamCity is a build add-in
102-
_TeamCity*
103-
104-
# DotCover is a Code Coverage Tool
105-
*.dotCover
106-
107-
# NCrunch
108-
*.ncrunch*
109-
.*crunch*.local.xml
110-
111-
# Installshield output folder
112-
[Ee]xpress/
113-
114-
# DocProject is a documentation generator add-in
115-
DocProject/buildhelp/
116-
DocProject/Help/*.HxT
117-
DocProject/Help/*.HxC
118-
DocProject/Help/*.hhc
119-
DocProject/Help/*.hhk
120-
DocProject/Help/*.hhp
121-
DocProject/Help/Html2
122-
DocProject/Help/html
123-
124-
# Click-Once directory
125-
publish/
126-
127-
# Publish Web Output
128-
*.Publish.xml
129-
*.pubxml
130-
131-
# NuGet Packages Directory
132-
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133-
#packages/
134-
135-
# Windows Azure Build Output
136-
csx
137-
*.build.csdef
138-
139-
# Windows Store app package directory
140-
AppPackages/
141-
142-
# Others
143-
sql/
144-
*.Cache
145-
ClientBin/
146-
[Ss]tyle[Cc]op.*
147-
~$*
148-
*~
149-
*.dbmdl
150-
*.[Pp]ublish.xml
151-
*.pfx
152-
*.publishsettings
153-
154-
# RIA/Silverlight projects
155-
Generated_Code/
156-
157-
# Backup & report files from converting an old project file to a newer
158-
# Visual Studio version. Backup files are not needed, because we have git ;-)
159-
_UpgradeReport_Files/
160-
Backup*/
161-
UpgradeLog*.XML
162-
UpgradeLog*.htm
163-
164-
# SQL Server files
165-
App_Data/*.mdf
166-
App_Data/*.ldf
167-
168-
#############
169-
## Windows detritus
170-
#############
171-
172-
# Windows image file caches
173-
Thumbs.db
174-
ehthumbs.db
175-
176-
# Folder config file
177-
Desktop.ini
178-
179-
# Recycle Bin used on file shares
180-
$RECYCLE.BIN/
181-
182-
# Mac crap
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
5+
# Folder config file
6+
Desktop.ini
7+
8+
# Recycle Bin used on file shares
9+
$RECYCLE.BIN/
10+
11+
# Windows Installer files
12+
*.cab
13+
*.msi
14+
*.msm
15+
*.msp
16+
17+
# =========================
18+
# Operating System Files
19+
# =========================
20+
21+
# OSX
22+
# =========================
23+
18324
.DS_Store
25+
.AppleDouble
26+
.LSOverride
18427

28+
# Icon must ends with two \r.
29+
Icon
18530

186-
#############
187-
## Python
188-
#############
189-
190-
*.py[co]
191-
192-
# Packages
193-
*.egg
194-
*.egg-info
195-
dist/
196-
build/
197-
eggs/
198-
parts/
199-
var/
200-
sdist/
201-
develop-eggs/
202-
.installed.cfg
203-
204-
# Installer logs
205-
pip-log.txt
206-
207-
# Unit test / coverage reports
208-
.coverage
209-
.tox
210-
211-
#Translations
212-
*.mo
31+
# Thumbnails
32+
._*
21333

214-
#Mr Developer
215-
.mr.developer.cfg
34+
# Files that might appear on external disk
35+
.Spotlight-V100
36+
.Trashes

CMakeLists.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
3+
function(adafruit_sdfat_add TARGET)
4+
target_sources(${TARGET} PUBLIC
5+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FreeStack.cpp
6+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/MinimumSerial.cpp
7+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/FmtNumber.cpp
8+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/FsCache.cpp
9+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/FsDateTime.cpp
10+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/FsName.cpp
11+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/FsStructs.cpp
12+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/FsUtf.cpp
13+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/PrintBasic.cpp
14+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common/upcase.cpp
15+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/common
16+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatDbg.cpp
17+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatFile.cpp
18+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatFilePrint.cpp
19+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatFileWrite.cpp
20+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatFormatter.cpp
21+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatName.cpp
22+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatPartition.cpp
23+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/ExFatLib/ExFatVolume.cpp
24+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatDbg.cpp
25+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatFile.cpp
26+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatFileLFN.cpp
27+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatFilePrint.cpp
28+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatFileSFN.cpp
29+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatFormatter.cpp
30+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatName.cpp
31+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatPartition.cpp
32+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FatLib/FatVolume.cpp
33+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FsLib/FsFile.cpp
34+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FsLib/FsNew.cpp
35+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/FsLib/FsVolume.cpp
36+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/iostream/istream.cpp
37+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/iostream/ostream.cpp
38+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/iostream/StdioStream.cpp
39+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/iostream/StreamBaseClass.cpp
40+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SdCard/Rp2040Sdio/PioSdioCard.cpp
41+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SdCard/SdCardInfo.cpp
42+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SdCard/SdSpiCard.cpp
43+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SdCard/TeensySdio/TeensySdio.cpp
44+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiArtemis.cpp
45+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiChipSelect.cpp
46+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiDue.cpp
47+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiParticle.cpp
48+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiSTM32.cpp
49+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiSTM32Core.cpp
50+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/SpiDriver/SdSpiTeensy3.cpp
51+
)
52+
target_include_directories(${TARGET} PUBLIC
53+
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src
54+
)
55+
endfunction()

README.md

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,69 @@
1-
### Warning: This is SdFat Version 2.
1+
### Warning: This version has major internal changes.
22

3-
Earlier releases of Version 1 are here:
3+
SdFat version 2.3.0 has major changes to implement RP2040/RP2350 SDIO.
44

5-
https://github.com/greiman/SdFat/releases
5+
In addition there are number of bug fixes.
6+
7+
Begin by running the Rp2040SdioSetup example to try RP2040/RP2350 SDIO.
8+
9+
This example requires a SDIO Card socket with the following six lines.
10+
11+
* CLK - A clock signal sent to the card by the MCU.
12+
* CMD - A bidirectional line for for commands and responses.
13+
* DAT[0:3] - Four bidirectional lines for data transfer.
14+
CLK and CMD can be connected to any GPIO pins. DAT[0:3] can be connected
15+
to any four consecutive GPIO pins in the order DAT0, DAT1, DAT2, DAT3.
16+
17+
Here is an example of SDIO for Pico using an Adafruit socket, PiCowbell
18+
Proto and PiCowbell Proto Doubler.
19+
20+
![Alt text](images/SdioSpi.jpg)
21+
22+
This Socket supports SDIO with:
23+
```
24+
#define RP_CLK_GPIO 10
25+
#define RP_CMD_GPIO 11
26+
#define RP_DAT0_GPIO 12 // DAT1: GPIO13 DAT2: GPIO14, DAT3: GPIO15.
27+
```
28+
It also can be used on SPI1 with:
29+
```
30+
const uint8_t SD_CS_PIN = 15;
31+
#define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK, &SPI1)
32+
33+
// In setup
34+
SPI1.setSCK(10);
35+
SPI1.setTX(11);
36+
SPI1.setRX(12);
37+
```
38+
39+
This setup gets the following result in the bench example using SDIO.
40+
41+
<pre>
42+
FILE_SIZE_MB = 5
43+
BUF_SIZE = 512 bytes
44+
Starting write test, please wait.
45+
46+
write speed and latency
47+
speed,max,min,avg
48+
KB/Sec,usec,usec,usec
49+
15014.05,1165,32,32
50+
15289.54,1249,32,32
51+
52+
Starting read test, please wait.
53+
54+
read speed and latency
55+
speed,max,min,avg
56+
KB/Sec,usec,usec,usec
57+
15624.00,58,32,32
58+
15624.00,51,32,32
59+
</pre>
60+
61+
62+
File copy constructors and file assignment operators have been made private by
63+
default in 2.2.3 to prevent call by value and multiple copies of file instances.
64+
65+
SdFatConfig.h has options to make file constructors and assignment operators
66+
public.
667

768
UTF-8 encoded filenames are supported in v2.1.0 or later.
869

0 commit comments

Comments
 (0)