Backlight Interface

[中文]

Public header: #include "brookesia/hal_interface/interfaces/display/backlight.hpp"

API Reference

Header File

Classes

class DisplayBacklightIface : public esp_brookesia::hal::Interface

Display backlight control interface.

Public Functions

inline DisplayBacklightIface()

Construct a display backlight interface.

virtual ~DisplayBacklightIface() = default

Virtual destructor for polymorphic backlight interfaces.

virtual bool set_brightness(uint8_t percent) = 0

Set backlight brightness.

Parameters

percent -- [in] Brightness percentage.

Returns

true on success; otherwise false.

virtual bool get_brightness(uint8_t &percent) = 0

Get current backlight brightness.

Parameters

percent -- [out] Current brightness percentage.

Returns

true on success; otherwise false.

virtual bool is_light_on_off_supported() = 0

Check if the light on/off control is supported.

Returns

true if the light on/off control is supported; otherwise false.

virtual bool set_light_on_off(bool on) = 0

Set the backlight on/off state.

Parameters

on -- [in] true to set the backlight on; false to set the backlight off.

Returns

true if the backlight on/off state is set successfully; otherwise false.

virtual bool is_light_on() const = 0

Check if the backlight is set on.

Returns

true if the backlight is set on; otherwise false.

Public Static Attributes

static constexpr const char *NAME = "DisplayBacklight"

Interface registry name.