FluxDC/components/FluxSD/FluxSD.h

52 lines
851 B
C
Raw Normal View History

2025-03-07 19:07:31 +08:00
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
2025-03-15 09:37:07 +08:00
#ifndef _FLUX_SD_H
#define _FLUX_SD_H
2025-03-07 19:07:31 +08:00
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define EXAMPLE_MAX_CHAR_SIZE 64
#define MOUNT_POINT "/sdcard"
#define LOG_RECORD_ENABLE 1
extern uint64_t total_bytes;
extern uint64_t free_bytes;
extern float free_percent;
2025-03-07 19:07:31 +08:00
typedef struct {
const char** names;
const int* pins;
} pin_configuration_t;
2025-03-13 15:13:27 +08:00
static esp_err_t s_example_read_file(const char *path);
static esp_err_t s_example_write_file(const char *path, char *data);
2025-03-07 19:07:31 +08:00
void check_sd_card_pins(pin_configuration_t *config, const int pin_count);
void flux_sd_init(void);
2025-03-15 09:37:07 +08:00
/*新增日志写入函数*/
esp_err_t s_example_write_log(char *data);
2025-03-07 19:07:31 +08:00
#ifdef __cplusplus
}
#endif
2025-03-15 09:37:07 +08:00
#endif