Kestrel Interface
Loading...
Searching...
No Matches
kest_sd.c File Reference
#include <sys/unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include "esp_vfs_fat.h"
#include "sdmmc_cmd.h"
#include "driver/i2c.h"
#include "sd_pwr_ctrl_by_on_chip_ldo.h"
#include "tinyusb.h"
#include "tinyusb_msc.h"
#include <string.h>
#include "bsp/esp32_p4_nano.h"
#include "kest_int.h"

Go to the source code of this file.

Macros

#define MAX_PARALLEL_FILES   12

Functions

int init_sd_card ()
int kest_sd_mode_msc ()
int kest_sd_mode_local ()
int kest_sd_toggle_msc ()

Variables

const int mount_point_strlen = strlen(MOUNT_POINT)
const char mount_point [] = MOUNT_POINT
sdmmc_host_t host = SDMMC_HOST_DEFAULT()
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT()
esp_vfs_fat_sdmmc_mount_config_t mount_config
sdmmc_card_t * card = &card_obj
tinyusb_config_t tusb_cfg
tinyusb_msc_driver_config_t msc_drv_cfg
tinyusb_msc_storage_config_t storage_cfg
tinyusb_msc_storage_handle_t storage_handle
SemaphoreHandle_t sd_mutex
int sd_msc_mode = 0

Macro Definition Documentation

◆ MAX_PARALLEL_FILES

#define MAX_PARALLEL_FILES   12

Definition at line 20 of file kest_sd.c.

Function Documentation

◆ init_sd_card()

int init_sd_card ( )

Definition at line 155 of file kest_sd.c.

Referenced by app_main().

Here is the caller graph for this function:

◆ kest_sd_mode_local()

int kest_sd_mode_local ( )

Definition at line 179 of file kest_sd.c.

Referenced by kest_sd_toggle_msc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_sd_mode_msc()

int kest_sd_mode_msc ( )

Definition at line 162 of file kest_sd.c.

Referenced by kest_sd_toggle_msc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_sd_toggle_msc()

int kest_sd_toggle_msc ( )

Definition at line 195 of file kest_sd.c.

Referenced by kest_msc_button_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ card

sdmmc_card_t* card = &card_obj

Definition at line 36 of file kest_sd.c.

◆ host

sdmmc_host_t host = SDMMC_HOST_DEFAULT()

Definition at line 26 of file kest_sd.c.

◆ mount_config

esp_vfs_fat_sdmmc_mount_config_t mount_config
Initial value:
= {
.format_if_mount_failed = false,
.max_files = 5,
.allocation_unit_size = 16 * 1024
}

Definition at line 29 of file kest_sd.c.

◆ mount_point

const char mount_point[] = MOUNT_POINT

Definition at line 24 of file kest_sd.c.

◆ mount_point_strlen

const int mount_point_strlen = strlen(MOUNT_POINT)

Definition at line 22 of file kest_sd.c.

◆ msc_drv_cfg

tinyusb_msc_driver_config_t msc_drv_cfg
Initial value:
= {
.user_flags.auto_mount_off = 1,
}

Definition at line 46 of file kest_sd.c.

◆ sd_msc_mode

int sd_msc_mode = 0

◆ sd_mutex

SemaphoreHandle_t sd_mutex

Definition at line 56 of file kest_sd.c.

Referenced by kest_sd_mode_local(), and kest_sd_mode_msc().

◆ slot_config

sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT()

Definition at line 27 of file kest_sd.c.

◆ storage_cfg

tinyusb_msc_storage_config_t storage_cfg
Initial value:
= {
.mount_point = TINYUSB_MSC_STORAGE_MOUNT_APP,
}

Definition at line 50 of file kest_sd.c.

◆ storage_handle

tinyusb_msc_storage_handle_t storage_handle

Definition at line 54 of file kest_sd.c.

Referenced by kest_sd_mode_local(), kest_sd_mode_msc(), and kest_sd_toggle_msc().

◆ tusb_cfg

tinyusb_config_t tusb_cfg
Initial value:
= {
.task = {
.size = 4096,
.priority = 5,
.xCoreID = 0,
},
}

Definition at line 38 of file kest_sd.c.