Skip to content

Commit ff18ad4

Browse files
committed
[dm][input] support input
For: RT-Thread#6251 1. Add power event. 2. Port to touch. 2. Add uapi for unix app. Signed-off-by: GuEe-GUI <[email protected]>
1 parent 2fb53c8 commit ff18ad4

File tree

16 files changed

+1545
-0
lines changed

16 files changed

+1545
-0
lines changed

components/drivers/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rsource "graphic/Kconfig"
2222
rsource "hwcrypto/Kconfig"
2323
rsource "wlan/Kconfig"
2424
rsource "led/Kconfig"
25+
rsource "input/Kconfig"
2526
rsource "mailbox/Kconfig"
2627
rsource "phye/Kconfig"
2728
rsource "ata/Kconfig"

components/drivers/include/rtdevice.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ extern "C" {
5353

5454
#ifdef RT_USING_LED
5555
#include "drivers/led.h"
56+
#endif /* RT_USING_LED */
57+
58+
#ifdef RT_USING_INPUT
59+
#include "drivers/input.h"
60+
#ifdef RT_INPUT_UAPI
61+
#include "drivers/input_uapi.h"
5662
#endif
63+
#endif /* RT_USING_INPUT */
5764

5865
#ifdef RT_USING_MBOX
5966
#include "drivers/mailbox.h"

components/drivers/input/Kconfig

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
menuconfig RT_USING_INPUT
2+
bool "Using Input device drivers"
3+
depends on RT_USING_DM
4+
select RT_USING_ADT
5+
select RT_USING_ADT_BITMAP
6+
default n
7+
8+
config RT_INPUT_POWER
9+
bool "Input event power"
10+
depends on RT_USING_INPUT
11+
default y
12+
13+
config RT_INPUT_UAPI
14+
bool "Input event Unix API"
15+
depends on RT_USING_INPUT
16+
depends on RT_USING_KTIME
17+
depends on RT_USING_POSIX_DEVIO
18+
default n
19+
default y if RT_USING_SMART
20+
21+
config RT_INPUT_UAPI_EVENT_MAX
22+
int "Events storage max"
23+
depends on RT_INPUT_UAPI
24+
default 128
25+
26+
config RT_UAPI_FAKE_BLOCK
27+
bool "Events fake when block"
28+
depends on RT_INPUT_UAPI
29+
default y
30+
31+
if RT_USING_INPUT
32+
rsource "joystick/Kconfig"
33+
rsource "keyboard/Kconfig"
34+
rsource "misc/Kconfig"
35+
rsource "touchscreen/Kconfig"
36+
endif
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from building import *
2+
3+
group = []
4+
objs = []
5+
6+
if not GetDepend(['RT_USING_INPUT']):
7+
Return('group')
8+
9+
cwd = GetCurrentDir()
10+
list = os.listdir(cwd)
11+
CPPPATH = [cwd + '/../include']
12+
13+
src = ['input.c']
14+
15+
if GetDepend(['RT_INPUT_POWER']):
16+
src += ['input_power.c']
17+
18+
if GetDepend(['RT_INPUT_TOUCHSCREEN']):
19+
src += ['input_touch.c']
20+
21+
if GetDepend(['RT_INPUT_UAPI']):
22+
src += ['input_uapi.c']
23+
24+
group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)
25+
26+
for d in list:
27+
path = os.path.join(cwd, d)
28+
if os.path.isfile(os.path.join(path, 'SConscript')):
29+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
30+
objs = objs + group
31+
32+
Return('objs')

0 commit comments

Comments
 (0)