{"id":13418450,"url":"https://github.com/greiman/SdFat","last_synced_at":"2025-03-15T03:31:14.755Z","repository":{"id":19437168,"uuid":"22680890","full_name":"greiman/SdFat","owner":"greiman","description":"Arduino FAT16/FAT32 exFAT Library","archived":false,"fork":false,"pushed_at":"2024-06-04T11:50:57.000Z","size":27868,"stargazers_count":1081,"open_issues_count":207,"forks_count":505,"subscribers_count":95,"default_branch":"master","last_synced_at":"2024-10-29T15:43:50.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greiman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-06T11:56:59.000Z","updated_at":"2024-10-28T19:13:49.000Z","dependencies_parsed_at":"2022-07-15T21:47:58.252Z","dependency_job_id":"d7b68ced-441a-483c-9bfa-8e4e6c351015","html_url":"https://github.com/greiman/SdFat","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greiman%2FSdFat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greiman%2FSdFat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greiman%2FSdFat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greiman%2FSdFat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greiman","download_url":"https://codeload.github.com/greiman/SdFat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242988040,"owners_count":20217538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:02.470Z","updated_at":"2025-03-15T03:31:14.749Z","avatar_url":"https://github.com/greiman.png","language":"C++","readme":"### Warning: This version has major internal changes.\n\nSdFat version 2.3.0 has major changes to implement RP2040/RP2350 SDIO.\n\nIn addition there are number of bug fixes.\n\nBegin by running the Rp2040SdioSetup example  to try RP2040/RP2350 SDIO.\n\nThis example requires a SDIO Card socket with the following six lines.\n\nCLK - A clock signal sent to the card by the MCU.\nCMD - A bidirectional line for for commands and responses.\nDAT[0:3] - Four bidirectional lines for data transfer.\n\nCLK and CMD can be connected to any GPIO pins. DAT[0:3] can be connected\nto any four consecutive GPIO pins in the order DAT0, DAT1, DAT2, DAT3.\n\nHere is an example of SDIO for Pico using an Adafruit socket, PiCowbell\nProto and PiCowbell Proto Doubler.\n\n![Alt text](images/SdioSpi.jpg)\n\nThis Socket supports SDIO with:\n```\n#define RP_CLK_GPIO 10\n#define RP_CMD_GPIO 11\n#define RP_DAT0_GPIO 12  // DAT1: GPIO13 DAT2: GPIO14, DAT3: GPIO15.\n```\nIt also can be used on SPI1 with:\n```\nconst uint8_t SD_CS_PIN = 15;\n#define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK, \u0026SPI1)\n\n  // In setup\n  SPI1.setSCK(10);\n  SPI1.setTX(11);\n  SPI1.setRX(12);\n```\n\nThis setup gets the following result in the bench example using SDIO.\n\n\u003cpre\u003e\nFILE_SIZE_MB = 5\nBUF_SIZE = 512 bytes\nStarting write test, please wait.\n\nwrite speed and latency\nspeed,max,min,avg\nKB/Sec,usec,usec,usec\n15014.05,1165,32,32\n15289.54,1249,32,32\n\nStarting read test, please wait.\n\nread speed and latency\nspeed,max,min,avg\nKB/Sec,usec,usec,usec\n15624.00,58,32,32\n15624.00,51,32,32\n\u003c/pre\u003e\n\n\nFile copy constructors and file assignment operators have been made private by\ndefault in 2.2.3 to prevent call by value and multiple copies of file instances.\n\nSdFatConfig.h has options to make file constructors and assignment operators\npublic.\n\nUTF-8 encoded filenames are supported in v2.1.0 or later.\n\nTry the UnicodeFilenames example.  Here is output from ls:\n\u003cpre\u003e\nType any character to begin\nls:\n         0 😀/\n          20 россиянин\n          17 très élégant\n           9 狗.txt\n\u003c/pre\u003e\n\nSdFat Version 2 supports FAT16/FAT32 and exFAT SD cards. It is mostly\nbackward compatible with SdFat Version 1 for FAT16/FAT32 cards.\n\nexFAT supports files larger than 4GB so files sizes and positions are\ntype uint64_t for classes that support exFAT.\n\nexFAT has many features not available in FAT16/FAT32.  exFAT has excellent\nsupport for contiguous files on flash devices and supports preallocation.\n\nIf the SD card is the only SPI device, use dedicated SPI mode. This can\ngreatly improve performance. See the bench example.\n\nHere is write performance for an old, 2011, card on a Due board.\n```\nShared SPI:\nwrite speed and latency\nspeed,max,min,avg\nKB/Sec,usec,usec,usec\n294.45,24944,1398,1737\n\nDedicated SPI:\nwrite speed and latency\nspeed,max,min,avg\nKB/Sec,usec,usec,usec\n3965.11,16733,110,127\n```\nThe default version of SdFatConfig.h enables support for dedicated SPI and\noptimized access to contiguous files.  This makes SdFat Version 2 slightly\nlarger than Version 1.  If these features are disabled, Version 2 is smaller\nthan Version 1.\n\nThe types for the classes SdFat and File are defined in SdFatConfig.h.\nThe default version of SdFatConfig.h defines SdFat to only support FAT16/FAT32.\nSdFat and File are defined in terms of more basic classes by typedefs.  You\ncan use these basic classes in applications.\n\nSupport for exFAT requires a substantial amount of flash.  Here are sizes on\nan UNO for a simple program that opens a file, prints one line, and closes\nthe file.\n```\nFAT16/FAT32 only: 9780 bytes flash, 875 bytes SRAM.\n\nexFAT only: 13830 bytes flash, 938 bytes SRAM.\n\nFAT16/FAT32/exFAT: 19326 bytes flash, 928 bytes SRAM.\n```\nThe section below of SdFatConfig.h has been edited to uses FAT16/FAT32 for\nsmall AVR boards and FAT16/FAT32/exFAT for all other boards.\n```\n/**\n * File types for SdFat, File, SdFile, SdBaseFile, fstream,\n * ifstream, and ofstream.\n *\n * Set SDFAT_FILE_TYPE to:\n *\n * 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT.\n */\n#if defined(__AVR__) \u0026\u0026 FLASHEND \u003c 0X8000\n// FAT16/FAT32 for 32K AVR boards.\n#define SDFAT_FILE_TYPE 1\n#else  // defined(__AVR__) \u0026\u0026 FLASHEND \u003c 0X8000\n// FAT16/FAT32 and exFAT for all other boards.\n#define SDFAT_FILE_TYPE 3\n#endif  // defined(__AVR__) \u0026\u0026 FLASHEND \u003c 0X8000\n```\nThe SdBaseFile class has no Arduino Stream or Print support.\n\nThe File class is derived from Stream and SdBaseFile.\n\nThe SdFile class is derived from SdBaseFile and Print.\n\nPlease try the examples.  Start with SdInfo, bench, and ExFatLogger.\n\nTo use SdFat Version 2, unzip the download file, rename the library folder\nSdFat and place the SdFat folder into the libraries sub-folder in your main\nsketch folder.\n\nFor more information see the Manual installation section of this guide:\n\nhttp://arduino.cc/en/Guide/Libraries\n\nA number of configuration options can be set by editing SdFatConfig.h\ndefine macros.  See the html documentation File tab for details.\n\nPlease read the html documentation for this library in SdFat/doc/SdFat.html.\nStart with the  Main Page.  Next go to the Classes tab and read the\ndocumentation for the classes SdFat32, SdExFat, SdFs, File32, ExFile, FsFile.\n\nThe SdFat and File classes are defined in terms of the above classes by\ntypedefs. Edit SdFatConfig.h to select class options.\n\nPlease continue by reading the html documentation in the SdFat/doc folder.\n","funding_links":[],"categories":["C++","Storage","Libraries","HTML"],"sub_categories":["Filesystems"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreiman%2FSdFat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreiman%2FSdFat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreiman%2FSdFat/lists"}