Backlight Interface
Public header: #include "brookesia/hal_interface/display/backlight.hpp"
API Reference
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.
- Parameters
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.
- Parameters
percent – [in] Brightness percentage.
- Returns
trueon success; otherwisefalse.
-
virtual bool get_brightness(uint8_t &percent) = 0
Get current backlight brightness.
- Parameters
percent – [out] Current brightness percentage.
- Returns
trueon success; otherwisefalse.
-
virtual bool turn_on() = 0
Turn on the backlight.
Note
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.
- Returns
trueon success; otherwisefalse.
-
virtual bool turn_off() = 0
Turn off the backlight.
Note
Calling this interface will turn off the backlight. Even if the minimum brightness is not zero, the brightness will be turned off to zero.
- Returns
trueon success; otherwisefalse.
Public Static Attributes
-
struct Info
Static backlight capability information.
-
inline DisplayBacklightIface(Info info)