mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-26 21:49:45 +08:00
ToolsCI / Tools (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
Signed-off-by: GuEe-GUI <2991707448@qq.com>
74 lines
1.7 KiB
C
Executable File
74 lines
1.7 KiB
C
Executable File
/*
|
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Change Logs:
|
|
* Date Author Notes
|
|
* 2023-02-25 GuEe-GUI the first version
|
|
*/
|
|
|
|
#ifndef __BACKLIGHT_H__
|
|
#define __BACKLIGHT_H__
|
|
|
|
#include <rthw.h>
|
|
#include <rtdef.h>
|
|
|
|
struct rt_backlight_ops;
|
|
|
|
enum rt_backlight_power
|
|
{
|
|
RT_BACKLIGHT_POWER_UNBLANK,
|
|
RT_BACKLIGHT_POWER_NORMAL,
|
|
RT_BACKLIGHT_POWER_SUSPEND,
|
|
RT_BACKLIGHT_POWER_POWERDOWN,
|
|
|
|
RT_BACKLIGHT_POWER_NR,
|
|
};
|
|
|
|
struct rt_backlight_properties
|
|
{
|
|
rt_uint32_t brightness;
|
|
rt_uint32_t max_brightness;
|
|
|
|
enum rt_backlight_power power;
|
|
};
|
|
|
|
struct rt_backlight_device
|
|
{
|
|
struct rt_device parent;
|
|
|
|
struct rt_backlight_properties props;
|
|
|
|
const struct rt_backlight_ops *ops;
|
|
|
|
struct rt_mutex lock;
|
|
void *priv;
|
|
};
|
|
|
|
struct rt_backlight_ops
|
|
{
|
|
rt_err_t (*update_status)(struct rt_backlight_device *);
|
|
rt_err_t (*get_brightness)(struct rt_backlight_device *, rt_uint32_t *out_brightness);
|
|
};
|
|
|
|
rt_err_t rt_backlight_register(struct rt_backlight_device *bl);
|
|
rt_err_t rt_backlight_unregister(struct rt_backlight_device *bl);
|
|
|
|
rt_err_t rt_backlight_set_power(struct rt_backlight_device *bl, enum rt_backlight_power power);
|
|
rt_err_t rt_backlight_get_power(struct rt_backlight_device *bl, enum rt_backlight_power *out_power);
|
|
rt_err_t rt_backlight_set_brightness(struct rt_backlight_device *bl, rt_uint32_t brightness);
|
|
rt_err_t rt_backlight_get_brightness(struct rt_backlight_device *bl, rt_uint32_t *out_brightness);
|
|
|
|
rt_inline rt_uint32_t rt_backlight_power_brightness(struct rt_backlight_device *bl)
|
|
{
|
|
if (bl->props.power != RT_BACKLIGHT_POWER_UNBLANK)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
return bl->props.brightness;
|
|
}
|
|
|
|
#endif /* __BACKLIGHT_H__ */
|