Ken Van Hoeylandt 3fe1dc0312
Create hal-device module, fix GPIO, fix tests, fix TactilityC (#471)
* **New Features**
  * Added a HAL device module providing device enumeration, type queries and a HAL↔kernel bridge.

* **Improvements**
  * Integrated HAL module into startup; standardized module names, includes and lifecycle logging; safer file append behavior; broader build support.

* **API Changes**
  * Driver lifecycle now uses explicit add/remove semantics; C and HAL device type/lookup APIs clarified.

* **Chores**
  * Added module README and Apache‑2.0 license; updated build configuration to include the new module.

* **Fixes**
  * Updated tests and object file handling to behave correctly.
2026-02-01 01:05:16 +01:00

27 lines
621 B
C++

#include <tactility/hal/Device.h>
#include "Tactility/hal/sdcard/SdCardDevice.h"
namespace tt::hal::sdcard {
std::shared_ptr<SdCardDevice> _Nullable find(const std::string& path) {
auto sdcards = findDevices<SdCardDevice>(Device::Type::SdCard);
for (auto& sdcard : sdcards) {
if (sdcard->isMounted() && path.starts_with(sdcard->getMountPath())) {
return sdcard;
}
}
return nullptr;
}
std::shared_ptr<Lock> findSdCardLock(const std::string& path) {
auto sdcard = find(path);
if (sdcard != nullptr) {
return sdcard->getLock();
}
return nullptr;
}
}