My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SdFat.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Arduino SdFat Library
  2. * Copyright (C) 2009 by William Greiman
  3. *
  4. * This file is part of the Arduino SdFat Library
  5. *
  6. * This Library is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This Library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the Arduino SdFat Library. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef SdFat_h
  21. #define SdFat_h
  22. /**
  23. * \file
  24. * \brief SdFat class
  25. */
  26. #include "SdFile.h"
  27. //#include <SdStream.h>
  28. //#include <ArduinoStream.h>
  29. //------------------------------------------------------------------------------
  30. /** SdFat version YYYYMMDD */
  31. #define SD_FAT_VERSION 20110902
  32. //------------------------------------------------------------------------------
  33. /**
  34. * \class SdFat
  35. * \brief Integration class for the %SdFat library.
  36. */
  37. class SdFat {
  38. public:
  39. SdFat() {}
  40. /** \return a pointer to the Sd2Card object. */
  41. Sd2Card* card() {return &card_;}
  42. bool chdir(bool set_cwd = false);
  43. bool chdir(const char* path, bool set_cwd = false);
  44. void chvol();
  45. void errorHalt();
  46. void errorHalt_P(PGM_P msg);
  47. void errorHalt(char const *msg);
  48. void errorPrint();
  49. void errorPrint_P(PGM_P msg);
  50. void errorPrint(char const *msg);
  51. bool exists(const char* name);
  52. bool init(uint8_t sckRateID = SPI_FULL_SPEED,
  53. uint8_t chipSelectPin = SD_CHIP_SELECT_PIN);
  54. void initErrorHalt();
  55. void initErrorHalt(char const *msg);
  56. void initErrorHalt_P(PGM_P msg);
  57. void initErrorPrint();
  58. void initErrorPrint(char const *msg);
  59. void initErrorPrint_P(PGM_P msg);
  60. void ls(uint8_t flags = 0);
  61. void ls(Print* pr, uint8_t flags = 0);
  62. bool mkdir(const char* path, bool pFlag = true);
  63. bool remove(const char* path);
  64. bool rename(const char *oldPath, const char *newPath);
  65. bool rmdir(const char* path);
  66. bool truncate(const char* path, uint32_t length);
  67. /** \return a pointer to the SdVolume object. */
  68. SdVolume* vol() {return &vol_;}
  69. /** \return a pointer to the volume working directory. */
  70. SdBaseFile* vwd() {return &vwd_;}
  71. private:
  72. Sd2Card card_;
  73. SdVolume vol_;
  74. SdBaseFile vwd_;
  75. };
  76. #endif // SdFat_h