ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
sd_card_utils.h File Reference

Useful ESP-IDF wrappers to initialize/deinitialize the file system on the SD card. More...

#include "sd_pwr_ctrl_by_on_chip_ldo.h"
#include "sd_protocol_defs.h"
#include "driver/sdmmc_host.h"
#include "sdmmc_cmd.h"
#include "esp_littlefs.h"
#include "esp_log.h"

Go to the source code of this file.

Macros

SD Card Macros
#define SD_PWR_CTRL_LDO_IO_ID   (4)
 GPIO controlling SD power via LDO.
 
#define GPIO_UNUSED   (-1)
 Placeholder for unused GPIO.
 
#define SD_CARD_MOUNT_PATH   ("/littlefs")
 Path where SD card is mounted with VFS.
 
#define SD_CARD_BUS_WIDTH   (4)
 SD card bus width.
 
#define BYTE_DIV   (8)
 Divider to convert bits to bytes.
 

Functions

esp_err_t mount_sd_card (void)
 Mount the SD card with LittleFS.
 
void sd_card_log_info (const sdmmc_card_t *card)
 Log information about a mounted SD card.
 
esp_err_t unmount_sd_card (void)
 Unmount the SD card and release associated resources.
 

Detailed Description

Useful ESP-IDF wrappers to initialize/deinitialize the file system on the SD card.

The OBC employs the fail-safe LittleFS file system. VFS is used to map standard POSIX calls to LittleFS functions.

Author
Adrien Chevrier

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Version
0.1
Date
2026-02-05