背光接口
公共头文件: #include "brookesia/hal_interface/display/backlight.hpp"
API 参考
Header File
Classes
-
class DisplayBacklightIface : public esp_brookesia::hal::Interface
Display backlight control interface.
Public Functions
-
inline DisplayBacklightIface(Info info)
Construct a display backlight interface.
- 参数
info – [in] Static backlight capability information.
-
virtual ~DisplayBacklightIface() = default
Virtual destructor for polymorphic backlight interfaces.
-
virtual bool set_brightness(uint8_t percent) = 0
Set backlight brightness.
- 参数
percent – [in] Brightness percentage.
- 返回
trueon success; otherwisefalse.
-
virtual bool get_brightness(uint8_t &percent) = 0
Get current backlight brightness.
- 参数
percent – [out] Current brightness percentage.
- 返回
trueon success; otherwisefalse.
-
virtual bool turn_on() = 0
Turn on the backlight.
备注
Calling this interface will restore the brightness to the last set value. If the last set value is zero, the brightness will be restored to the default value.
- 返回
trueon success; otherwisefalse.
-
virtual bool turn_off() = 0
Turn off the backlight.
备注
Calling this interface will turn off the backlight. Even if the minimum brightness is not zero, the brightness will be turned off to zero.
- 返回
trueon success; otherwisefalse.
Public Static Attributes
-
struct Info
Static backlight capability information.
-
inline DisplayBacklightIface(Info info)