Difference between revisions of "Component: File (ESP32 SDMode) (File)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd. |- | width="20%" style="color:gray;" | Version | 2.7 |- | width="20%" style="color:gra...") |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
− | | | + | | 9.9 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
Line 15: | Line 15: | ||
File component allowing access to read and write files on an SD card using the ESP32 SD Mode IO allowing for high speed data transfer using 1-bit or 4-bit SD access. | File component allowing access to read and write files on an SD card using the ESP32 SD Mode IO allowing for high speed data transfer using 1-bit or 4-bit SD access. | ||
− | == | + | ==Version information== |
− | |||
− | |||
− | + | Library Version, Component Version, Date, Author, Info | |
==Detailed description== | ==Detailed description== | ||
Line 37: | Line 35: | ||
==Examples== | ==Examples== | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ''<span style="color:red;">No additional examples</span>'' | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | ===AppendByteArrayToFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendByteArrayToFile''' | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
===AppendByteToFile=== | ===AppendByteToFile=== | ||
Line 71: | Line 101: | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===AppendFloatArrayToFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendFloatArrayToFile''' | ||
+ | |- | ||
+ | | colspan="2" | Adds a binary float array to the end of the file. Returns 0 for success. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Binary data array to append to the file | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | Number of values to append | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===AppendINTArrayToFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendINTArrayToFile''' | ||
+ | |- | ||
+ | | colspan="2" | Adds a binary INT array to the end of the file. Returns 0 for success. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Binary data array to append to the file | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | Number of values to append | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBFirst | ||
+ | |- | ||
+ | | colspan="2" | 0=LSB then MSB, 1=MSB then LSB | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===AppendLongArrayToFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AppendLongArrayToFile''' | ||
+ | |- | ||
+ | | colspan="2" | Adds a binary Long array to the end of the file. Returns 0 for success. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Binary data array to append to the file | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | Number of values to append | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBFirst | ||
+ | |- | ||
+ | | colspan="2" | 0=LSB then MSB, 1=MSB then LSB | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
Line 168: | Line 280: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToNextFileSector''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToNextFileSector''' | ||
|- | |- | ||
− | | colspan="2" | Not | + | | colspan="2" | Not implemented on the ESP32 |
|- | |- | ||
|- | |- | ||
Line 215: | Line 327: | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===ReadByteArrayFromFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteArrayFromFile''' | ||
+ | |- | ||
+ | | colspan="2" | Reads a binary byte array from the currently open file. Auto increments the position in the file. Returns the number of values read. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 258: | Line 394: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileLength''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFileLength''' | ||
|- | |- | ||
− | | colspan="2" | Not | + | | colspan="2" | Not implemented on the ESP32 |
|- | |- | ||
|- | |- | ||
Line 276: | Line 412: | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===ReadFloatArrayFromFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadFloatArrayFromFile''' | ||
+ | |- | ||
+ | | colspan="2" | Reads a binary Float array from the currently open file. Auto increments the position in the file. Returns the number of values read. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data variable to populate with data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | Number of values to read | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBFirst | ||
+ | |- | ||
+ | | colspan="2" | 0=LSB then MSB, 1=MSB then LSB | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===ReadINTArrayFromFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadINTArrayFromFile''' | ||
+ | |- | ||
+ | | colspan="2" | Reads a binary INT array from the currently open file. Auto increments the position in the file. Returns the number of values read. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data variable to populate with data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | Number of values to read | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBFirst | ||
+ | |- | ||
+ | | colspan="2" | 0=LSB then MSB, 1=MSB then LSB | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===ReadLongArrayFromFile=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLongArrayFromFile''' | ||
+ | |- | ||
+ | | colspan="2" | Reads a binary Long array from the currently open file. Auto increments the position in the file. Returns the number of values read. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data variable to populate with data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | Number of values to read | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBFirst | ||
+ | |- | ||
+ | | colspan="2" | 0=LSB then MSB, 1=MSB then LSB | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 343: | Line 566: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteByteToBuffer''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteByteToBuffer''' | ||
|- | |- | ||
− | | colspan="2" | Not | + | | colspan="2" | Not implemented on the ESP32 |
|- | |- | ||
|- | |- | ||
Line 367: | Line 590: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteFileSector''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteFileSector''' | ||
|- | |- | ||
− | | colspan="2" | Not | + | | colspan="2" | Not implemented on the ESP32 |
|- | |- | ||
|- | |- | ||
Line 407: | Line 630: | ||
|- | |- | ||
| colspan="2" | Number of bytes to use as a directory buffer to track the current directory. | | colspan="2" | Number of bytes to use as a directory buffer to track the current directory. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Pins | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | CLK | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | CMD | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | D0 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | D1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | D2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | D3 | ||
+ | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
Line 417: | Line 674: | ||
| colspan="2" | | | colspan="2" | | ||
|} | |} | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_File_ESP32_SDMode.fcfx FC_Comp_Source_File_ESP32_SDMode.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_File_ESP32_SDMode.fcfx FC_Comp_Source_File_ESP32_SDMode.fcfx] |
Latest revision as of 08:58, 9 June 2025
Author | Matrix Ltd. |
Version | 9.9 |
Category | File |
Contents
- 1 File (ESP32 SDMode) component
- 2 Version information
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 AppendByteArrayToFile
- 5.2 AppendByteToFile
- 5.3 AppendFloatArrayToFile
- 5.4 AppendINTArrayToFile
- 5.5 AppendLongArrayToFile
- 5.6 AppendStringToFile
- 5.7 CloseFile
- 5.8 CreateFile
- 5.9 DeleteFile
- 5.10 Initialise
- 5.11 MoveToNextFileSector
- 5.12 OpenFile
- 5.13 OpenFolder
- 5.14 ReadByteArrayFromFile
- 5.15 ReadByteFromFile
- 5.16 ReadByteFromIndex
- 5.17 ReadFileLength
- 5.18 ReadFileSize
- 5.19 ReadFloatArrayFromFile
- 5.20 ReadINTArrayFromFile
- 5.21 ReadLongArrayFromFile
- 5.22 ReadStringFromFile
- 5.23 SetFileIndex
- 5.24 Uninitialise
- 5.25 WriteByteToBuffer
- 5.26 WriteFileSector
- 6 Property reference
- 7 Component Source Code
File (ESP32 SDMode) component
File component allowing access to read and write files on an SD card using the ESP32 SD Mode IO allowing for high speed data transfer using 1-bit or 4-bit SD access.
Version information
Library Version, Component Version, Date, Author, Info
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
AppendByteArrayToFile
![]() |
AppendByteArrayToFile |
![]() |
Data |
![]() |
Length |
![]() |
Return |
AppendByteToFile
![]() |
AppendByteToFile |
![]() |
Data |
![]() |
Return |
AppendFloatArrayToFile
AppendINTArrayToFile
AppendLongArrayToFile
AppendStringToFile
![]() |
AppendStringToFile |
![]() |
Data_String |
![]() |
Return |
CloseFile
![]() |
CloseFile |
![]() |
Return |
CreateFile
![]() |
CreateFile |
![]() |
Filename |
![]() |
Return |
DeleteFile
![]() |
DeleteFile |
![]() |
Filename |
![]() |
Return |
Initialise
![]() |
Initialise |
Starts up the SD card interface and checks to see if a card is compatible. Returns: 0=OK, 255=No Card, 254=File System Fail | |
![]() |
Return |
MoveToNextFileSector
![]() |
MoveToNextFileSector |
Not implemented on the ESP32 | |
![]() |
ForceNextSector |
![]() |
Return |
OpenFile
OpenFolder
![]() |
OpenFolder |
![]() |
Folder_Name |
![]() |
Return |
ReadByteArrayFromFile
![]() |
ReadByteArrayFromFile |
Reads a binary byte array from the currently open file. Auto increments the position in the file. Returns the number of values read. | |
![]() |
Data |
![]() |
Length |
![]() |
Return |
ReadByteFromFile
ReadByteFromIndex
![]() |
ReadByteFromIndex |
Reads a byte of data from the local sector buffer. Return = Data byte read from the local sector buffer. | |
![]() |
Address |
![]() |
Return |
ReadFileLength
![]() |
ReadFileLength |
Not implemented on the ESP32 | |
![]() |
Return |
ReadFileSize
![]() |
ReadFileSize |
Reads the entire size of the current file in bytes. | |
![]() |
Return |
ReadFloatArrayFromFile
ReadINTArrayFromFile
ReadLongArrayFromFile
ReadStringFromFile
SetFileIndex
![]() |
SetFileIndex |
![]() |
File_Index |
Range: 0 to 4 | |
![]() |
Return |
Uninitialise
![]() |
Uninitialise |
Terminates connection to the SD card, unmounts the SD card and disabled the SD peripheral. | |
![]() |
Return |
WriteByteToBuffer
![]() |
WriteByteToBuffer |
Not implemented on the ESP32 | |
![]() |
Address |
![]() |
Data |
![]() |
Return |
WriteFileSector
![]() |
WriteFileSector |
Not implemented on the ESP32 | |
![]() |
Return |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_File_ESP32_SDMode.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_File_ESP32_SDMode.fcfx