Skip to content

storage 模块

class sdmmc_host

static init() -> int

  • 返回: int
C++ 映射 sdmmc_host_init

static init_slot(slot: int, slot_config: instance) -> int

参数类型说明
slotint
slot_configinstance
  • 返回: int
C++ 映射 sdmmc_host_init_slot

static set_bus_width(slot: int, width: int) -> int

参数类型说明
slotint
widthint
  • 返回: int
C++ 映射 sdmmc_host_set_bus_width

static get_slot_width(slot: int) -> int

参数类型说明
slotint
  • 返回: int
C++ 映射 sdmmc_host_get_slot_width

static set_card_clk(slot: int, freq_khz: int) -> int

参数类型说明
slotint
freq_khzint
  • 返回: int
C++ 映射 sdmmc_host_set_card_clk

static set_bus_ddr_mode(slot: int, ddr_enabled: int) -> int

参数类型说明
slotint
ddr_enabledint
  • 返回: int
C++ 映射 sdmmc_host_set_bus_ddr_mode

static set_cclk_always_on(slot: int, cclk_always_on: int) -> int

参数类型说明
slotint
cclk_always_onint
  • 返回: int
C++ 映射 sdmmc_host_set_cclk_always_on

static do_transaction(slot: int, cmdinfo: pointer) -> int

参数类型说明
slotint
cmdinfopointer
  • 返回: int
C++ 映射 sdmmc_host_do_transaction

static io_int_enable(slot: int) -> int

参数类型说明
slotint
  • 返回: int
C++ 映射 sdmmc_host_io_int_enable

static io_int_wait(slot: int, timeout_ticks: pointer) -> int

参数类型说明
slotint
timeout_tickspointer
  • 返回: int
C++ 映射 sdmmc_host_io_int_wait

static get_real_freq(slot: int, real_freq_khz: int) -> int

参数类型说明
slotint
real_freq_khzint
  • 返回: int
C++ 映射 sdmmc_host_get_real_freq

static set_input_delay(slot: int, delay_phase: pointer) -> int

参数类型说明
slotint
delay_phasepointer
  • 返回: int
C++ 映射 sdmmc_host_set_input_delay

static is_slot_set_to_uhs1(slot: int, is_uhs1: int) -> int

参数类型说明
slotint
is_uhs1int
  • 返回: int
C++ 映射 sdmmc_host_is_slot_set_to_uhs1

static get_state(state: pointer) -> int

参数类型说明
statepointer
  • 返回: int
C++ 映射 sdmmc_host_get_state

class spffs

static register(conf: pointer) -> int

typedef struct { const char* base_path; /!< File path prefix associated with the filesystem. / const char partition_label; /!< Optional, label of SPIFFS partition to use. If set to NULL, first partition with subtype=spiffs will be used. / size_t max_files; /!< Maximum files that could be open at the same time. / bool format_if_mount_failed; /!< If true, it will format the file system if it fails to mount. */ } esp_vfs_spiffs_conf_t;

参数类型说明
confpointer
  • 返回: int
C++ 映射 esp_vfs_spiffs_register

static unregister(partition_label: str) -> int

参数类型说明
partition_labelstr
  • 返回: int
C++ 映射 esp_vfs_spiffs_unregister

static mounted(partition_label: str) -> int

参数类型说明
partition_labelstr
  • 返回: int
C++ 映射 esp_spiffs_mounted

static format(partition_label: str) -> int

参数类型说明
partition_labelstr
  • 返回: int
C++ 映射 esp_spiffs_format

static info(partition_label: str) -> str

参数类型说明
partition_labelstr
  • 返回: str
C++ 映射 spiffs_info

static check(partition_label: str) -> int

参数类型说明
partition_labelstr
  • 返回: int
C++ 映射 esp_spiffs_check

static gc(partition_label: str, size_to_gc: int) -> int

参数类型说明
partition_labelstr
size_to_gcint
  • 返回: int
C++ 映射 esp_spiffs_gc

class vfs_fat

static sdmmc_mount(path: str, connfig: pointer, mount_config: pointer) -> str

typedef struct { int clk; ///< GPIO number of CLK signal. int cmd; ///< GPIO number of CMD signal. int d0; ///< GPIO number of D0 signal. int d1; ///< GPIO number of D1 signal. int d2; ///< GPIO number of D2 signal. int d3: ///< GPIO number of D3 signal. int d4: ///< GPIO number of D4 signal. Ignored in 1- or 4- line mode. int d5: ///< GPIO number of D5 signal. Ignored in 1- or 4- line mode. int d6: ///< GPIO number of D6 signal. Ignored in 1- or 4- line mode. int d7: ///< GPIO number of D7 signal. Ignored in 1- or 4- line mode. int cd; ///< GPIO number of card detect signal; shorter name. int wp; ///< GPIO number of write protect signal; shorter name. uint8_t width; ///< Bus width used by the slot (might be less than the max width supported) uint32_t flags; ///< Features used by this slot } sdmmc_slot_config_t;

typedef struct { bool format_if_mount_failed; int max_files; size_t allocation_unit_size; bool disk_status_check_enable; bool use_one_fat; } esp_vfs_fat_mount_config_t;

参数类型说明
pathstr
connfigpointer
mount_configpointer
  • 返回: str
C++ 映射 vfs_fat_sdmmc_mount #本函数包装的是esp_spiffs.h中的esp_vfs_fat_sdmmc_mount函数

class nvs

__deinit__() -> str

  • 返回: str
C++ 映射 nvs_deinit_

set(key: str, value: int) -> str

参数类型说明
keystr
valueint
  • 返回: str
C++ 映射 nvs_set_

get(key: str) -> str

参数类型说明
keystr
  • 返回: str
C++ 映射 nvs_get_

contains(key: str) -> str

参数类型说明
keystr
  • 返回: str
C++ 映射 nvs_contains_

erase(key: str) -> str

参数类型说明
keystr
  • 返回: str
C++ 映射 nvs_erase_key_

erase_all() -> str

  • 返回: str
C++ 映射 nvs_erase_all_

commit() -> str

  • 返回: str
C++ 映射 nvs_commit_

close() -> str

  • 返回: str
C++ 映射 nvs_close_

class flash_write

static __init__(source_file: str, partition_name: str, check_md5: str, core_id: int) -> int

参数类型说明
source_filestr
partition_namestr
check_md5str
core_idint
  • 返回: int
C++ 映射 flash_write_start

__deinit__() -> void

  • 返回: void
C++ 映射 flash_write_clean

progress() -> int

  • 返回: int
C++ 映射 flash_write_progress

cancel() -> int

  • 返回: int
C++ 映射 flash_write_cancel

state() -> int

  • 返回: int
C++ 映射 flash_write_state

static set_boot_partition(partition_name: str) -> int

参数类型说明
partition_namestr
  • 返回: int
C++ 映射 flash_write_set_boot_partition

static get_running_partition() -> str

  • 返回: str
C++ 映射 flash_write_running_partition

static nvs_open(namespace_name: str, write_mode: bool) -> str

打开一块flash中的nvs存储区域

namespace_name: 区域名称,这是一个自定义名称,打开的区域不存在就会自动创建 write_mode: 为True则表示可读写,False则表示只读模式 return: 返回为本module下的nvs类的实例

参数类型说明
namespace_namestr
write_modebool
  • 返回: str
C++ 映射 nvs_open_

基于 llpython ESP 平台构建