设备基类
公共头文件: #include "brookesia/hal_interface/device.hpp"
API 参考
Header File
Classes
-
class Device
Base class for HAL devices.
A concrete device can publish one or more interface instances through
interfaces_during initialization, then those interfaces can be queried from the global registry.Subclassed by esp_brookesia::hal::AudioDevice, esp_brookesia::hal::DisplayDevice, esp_brookesia::hal::StorageDevice
Public Functions
-
virtual bool probe() = 0
Check whether the device is supported on current runtime conditions.
- 返回
trueif the device can be initialized; otherwisefalse.
- template<typename T> inline requires IsInterface< T > std::shared_ptr< T > get_interface (const std::string &name) const
Retrieve a typed interface owned by this device by interface registry name.
-
virtual bool probe() = 0
Type Aliases
-
using esp_brookesia::hal::DeviceRegistry = lib_utils::PluginRegistry<Device>
Registry alias for HAL devices.