New kernel drivers, filesystem API, and more (#513)
* **New Features** * BMI270 6-axis IMU driver added; new unified filesystem abstraction for mounted filesystems. * Public Wi‑Fi API surface (no implementation yet) * SDMMC driver added (kernel drive$) * expanded GPIO interrupt/callback support * **Improvements** * M5Stack Tab5: revamped GPIO/power initialization and IMU integration. * LVGL updates including device fontSize configuration. * Updated all code related to SD card device/fs handling * Rename LilyGO T-HMI S3 to LilyGO T-HMI * **Bug Fixes** * Simplified and consolidated SD card handling and mount discovery.
This commit is contained in:
committed by
GitHub
parent
2de35b2d2d
commit
aa7530e515
@@ -21,6 +21,6 @@ constexpr auto* MOUNT_POINT_DATA = "/data";
|
||||
constexpr auto* MOUNT_POINT_DATA = "data";
|
||||
#endif
|
||||
|
||||
std::vector<dirent> getMountPoints();
|
||||
std::vector<dirent> getFileSystemDirents();
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <tactility/filesystem/file_system.h>
|
||||
|
||||
|
||||
namespace tt {
|
||||
|
||||
bool findFirstMountedSdCardPath(std::string& path);
|
||||
|
||||
FileSystem* findSdcardFileSystem(bool mustBeMounted);
|
||||
|
||||
std::string getSystemRootPath();
|
||||
|
||||
std::string getTempPath();
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
#include <tactility/hal/Device.h>
|
||||
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <Tactility/Lock.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
|
||||
struct FileSystem;
|
||||
namespace tt::hal::sdcard {
|
||||
|
||||
/**
|
||||
@@ -31,11 +33,12 @@ public:
|
||||
private:
|
||||
|
||||
MountBehaviour mountBehaviour;
|
||||
FileSystem* fileSystem;
|
||||
|
||||
public:
|
||||
|
||||
explicit SdCardDevice(MountBehaviour mountBehaviour) : mountBehaviour(mountBehaviour) {}
|
||||
~SdCardDevice() override = default;
|
||||
explicit SdCardDevice(MountBehaviour mountBehaviour);
|
||||
~SdCardDevice() override;
|
||||
|
||||
Type getType() const final { return Type::SdCard; };
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SdCardDevice.h"
|
||||
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <tactility/hal/Device.h>
|
||||
#include <sd_protocol_types.h>
|
||||
#include <soc/gpio_num.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace tt::hal::sdcard {
|
||||
|
||||
/**
|
||||
* SD card interface for the SDMMC interface.
|
||||
*/
|
||||
class SdmmcDevice final : public SdCardDevice {
|
||||
|
||||
std::shared_ptr<RecursiveMutex> mutex = std::make_shared<RecursiveMutex>();
|
||||
|
||||
public:
|
||||
|
||||
struct Config {
|
||||
Config(
|
||||
gpio_num_t pinClock,
|
||||
gpio_num_t pinCmd,
|
||||
gpio_num_t pinD0,
|
||||
gpio_num_t pinD1,
|
||||
gpio_num_t pinD2,
|
||||
gpio_num_t pinD3,
|
||||
MountBehaviour mountBehaviourAtBoot,
|
||||
uint8_t busWidth = 4
|
||||
) :
|
||||
pinClock(pinClock),
|
||||
pinCmd(pinCmd),
|
||||
pinD0(pinD0),
|
||||
pinD1(pinD1),
|
||||
pinD2(pinD2),
|
||||
pinD3(pinD3),
|
||||
mountBehaviourAtBoot(mountBehaviourAtBoot),
|
||||
busWidth(busWidth)
|
||||
{}
|
||||
|
||||
int spiFrequencyKhz;
|
||||
gpio_num_t pinClock;
|
||||
gpio_num_t pinCmd;
|
||||
gpio_num_t pinD0;
|
||||
gpio_num_t pinD1;
|
||||
gpio_num_t pinD2;
|
||||
gpio_num_t pinD3;
|
||||
MountBehaviour mountBehaviourAtBoot;
|
||||
uint8_t busWidth;
|
||||
bool formatOnMountFailed = false;
|
||||
uint16_t maxOpenFiles = 4;
|
||||
uint16_t allocUnitSize = 16 * 1024;
|
||||
bool statusCheckEnabled = false;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
std::string mountPath;
|
||||
sdmmc_card_t* card = nullptr;
|
||||
std::shared_ptr<Config> config;
|
||||
|
||||
bool applyGpioWorkAround();
|
||||
bool mountInternal(const std::string& mountPath);
|
||||
|
||||
public:
|
||||
|
||||
explicit SdmmcDevice(std::unique_ptr<Config> config) : SdCardDevice(config->mountBehaviourAtBoot),
|
||||
config(std::move(config))
|
||||
{}
|
||||
|
||||
std::string getName() const override { return "SDMMC"; }
|
||||
std::string getDescription() const override { return "SD card via SDMMC interface"; }
|
||||
|
||||
bool mount(const std::string& mountPath) override;
|
||||
bool unmount() override;
|
||||
std::string getMountPath() const override { return mountPath; }
|
||||
|
||||
std::shared_ptr<Lock> getLock() const override { return mutex; }
|
||||
|
||||
State getState(TickType_t timeout) const override;
|
||||
|
||||
/** return card when mounted, otherwise return nullptr */
|
||||
sdmmc_card_t* getCard() { return card; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user