Skip to content

Commit 924ca5a

Browse files
committed
dts: bindings: added stm32 tsc driver bindings
Added tsc pripheral bindings Signed-off-by: Arif Balik <[email protected]>
1 parent e8c5405 commit 924ca5a

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Copyright (c) 2024 Arif Balik <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: STM32 Tocuh Sensing Controller (TSC) driver
5+
6+
compatible: "st,stm32-tsc"
7+
8+
include: [base.yaml, pinctrl-device.yaml, reset-device.yaml]
9+
10+
properties:
11+
reg:
12+
required: true
13+
clocks:
14+
required: true
15+
resets:
16+
required: true
17+
interrupts:
18+
required: true
19+
pinctrl-0:
20+
required: true
21+
pinctrl-names:
22+
required: true
23+
24+
st,pulse-generator-prescaler:
25+
type: int
26+
required: true
27+
description: |
28+
Prescaler for the pulse generator clock (t_pgclk=f_hclk/prescaler).
29+
The prescaler is used to generate the charge transfer pulse. The final
30+
prescaled value is 2^N where N is the value of this property.
31+
enum: [1, 2, 4, 8, 16, 32, 64, 128]
32+
33+
st,charge-transfer-pulse-high:
34+
type: int
35+
required: true
36+
description: |
37+
Number of cycles for the high state of the
38+
charge transfer pulse (1 to 16 cycles of t_pgclk).
39+
enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
40+
41+
st,charge-transfer-pulse-low:
42+
type: int
43+
required: true
44+
description: |
45+
Number of cycles for the low state of the
46+
charge transfer pulse (1 to 16 cycles of t_pgclk).
47+
enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
48+
49+
st,spread-spectrum:
50+
type: boolean
51+
description: Spread spectrum enable
52+
53+
st,spread-spectrum-prescaler:
54+
type: int
55+
required: true
56+
description: Spread spectrum clock prescaler (t_ssclk)
57+
enum:
58+
- 1
59+
- 2
60+
61+
st,spread-spectrum-deviation:
62+
type: int
63+
required: true
64+
description: Spread spectrum deviation (1 to 128 cycles of t_ssclk)
65+
66+
st,max-count-value:
67+
type: int
68+
required: true
69+
description: |
70+
Max number of charge transfer pulses before max count error is generated.
71+
The value of the counter is calculated as 256 * 2^max_count_value.
72+
enum: [255, 511, 1023, 2047, 4095, 8191, 16383, 32767]
73+
74+
st,synced-acquisition:
75+
type: boolean
76+
description: |
77+
Synchronized acquisition enable.
78+
Acquisition starts when START bit and signal on sync pin.
79+
You have to provide a pinctrl for the sync pin.
80+
81+
st,syncpol-rising:
82+
type: boolean
83+
description: Rising synchronization pin polarity, instead of falling
84+
85+
st,iodef-float:
86+
type: boolean
87+
description: |
88+
Set default state (not acqusition) of all channel I/Os to floating.
89+
push-pull down by default.
90+
91+
child-binding:
92+
description: STM32 TSC group configuration
93+
properties:
94+
group:
95+
type: int
96+
required: true
97+
description: Group number (0 to 7)
98+
enum: [0, 1, 2, 3, 4, 5, 6, 7]
99+
100+
channel-ios:
101+
type: int
102+
required: true
103+
description: Channel I/Os to be enabled
104+
enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
105+
106+
sampling-io:
107+
type: int
108+
required: true
109+
description: Channel to be selected for sampling
110+
enum:
111+
- 1
112+
- 2
113+
- 4
114+
- 8
115+
116+
st,use-as-shield:
117+
type: boolean
118+
description: |
119+
Use channel as shield. This configures group but
120+
does not enable it for acqusition. channel-io is used
121+
as shield pin and can only have values 1, 2, 4 or 8.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2024 Arif Balik <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_STM32_TSC_H_
7+
#define ZEPHYR_INCLUDE_DT_BINDINGS_STM32_TSC_H_
8+
9+
#define TSC_IO1 0x1UL
10+
#define TSC_IO2 0x2UL
11+
#define TSC_IO3 0x4UL
12+
#define TSC_IO4 0x8UL
13+
14+
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_STM32_TSC_H_ */

0 commit comments

Comments
 (0)