背光接口

[English]

公共头文件: #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.

返回

true on success; otherwise false.

virtual bool get_brightness(uint8_t &percent) = 0

Get current backlight brightness.

参数

percent[out] Current brightness percentage.

返回

true on success; otherwise false.

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.

返回

true on success; otherwise false.

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.

返回

true on success; otherwise false.

inline const Info &get_info() const

Get static backlight capability information.

返回

Backlight information.

Public Static Attributes

static constexpr const char *NAME = "DisplayBacklight"

Interface registry name.

struct Info

Static backlight capability information.

Public Members

uint8_t brightness_default

Default brightness percentage.

uint8_t brightness_min

Minimum brightness percentage.

uint8_t brightness_max

Maximum brightness percentage.