added docs and improvements

This commit is contained in:
2021-07-12 11:47:23 +02:00
committed by Robin Mueller
parent 4fc56417bc
commit 658e9a4907
2 changed files with 21 additions and 7 deletions

View File

@ -38,6 +38,7 @@ public:
static constexpr char SD_1_DEV_NAME[] = "/dev/mmcblk1p1";
static constexpr char SD_0_MOUNT_POINT[] = "/mnt/sd0";
static constexpr char SD_1_MOUNT_POINT[] = "/mnt/sd1";
static constexpr char SD_STATE_FILE[] = "/tmp/sd_status.txt";
virtual ~SdCardManager();
@ -53,7 +54,7 @@ public:
sd::SdCard getPreferredSdCard() const;
/**
* Switch on the specified SD card
* Switch on the specified SD card.
* @param sdCard
* @param doMountSdCard Mount the SD card after switching it on, which is necessary
* to use it
@ -63,7 +64,7 @@ public:
ReturnValue_t switchOnSdCard(sd::SdCard sdCard, bool doMountSdCard = true);
/**
* Switch off the specified SD card
* Switch off the specified SD card.
* @param sdCard
* @param doUnmountSdCard Unmount the SD card before switching the card off, which makes
* the operation safer
@ -73,8 +74,8 @@ public:
ReturnValue_t switchOffSdCard(sd::SdCard sdCard, bool doUnmountSdCard = true);
/**
* Updated the state file or creates one if it does not exist. You need to call this
* function before calling #sdCardActiv
* Update the state file or creates one if it does not exist. You need to call this
* function before calling #sdCardActive
* @return - RETURN_OK if the state file was updated successfully
* - SYSTEM_CALL_ERROR if the call to create the status file failed
*/
@ -93,7 +94,18 @@ public:
*/
ReturnValue_t sdCardActive(std::pair<sd::SdStatus, sd::SdStatus>& active);
/**
* Mount the specified SD card. This is necessary to use it.
* @param sdCard
* @return
*/
ReturnValue_t mountSdCard(sd::SdCard sdCard);
/**
* Unmount the specified SD card. This is recommended before switching it off. The SD card
* can't be used after it has been unmounted.
* @param sdCard
* @return
*/
ReturnValue_t unmountSdCard(sd::SdCard sdCard);
sd::SdCard getPreferedSdCard() const;