You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tsc.rs
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,11 @@
1
1
//! Touch sense controller
2
+
//!
3
+
//! From STM32 (https://www.st.com/content/ccc/resource/technical/document/application_note/9d/be/03/8c/5d/8c/49/50/DM00088471.pdf/files/DM00088471.pdf/jcr:content/translations/en.DM00088471.pdf):
4
+
//!
5
+
//! The Cs capacitance is a key parameter for sensitivity. For touchkey sensors, the Cs value is
6
+
//! usually comprised between 8.7nF to 22nF. For linear and rotary touch sensors, the value is
7
+
//! usually comprised between 47nF and 100nF. These values are given as reference for an
8
+
//! electrode fitting a human finger tip size across a few millimeters dielectric panel.
2
9
3
10
use rcc::AHB1;
4
11
use stm32l4::stm32l4x2::{TSC};
@@ -21,7 +28,6 @@ pub enum Error {
21
28
InvalidPin
22
29
}
23
30
24
-
// TODO macro to impl all possible channel/sample pin combinations
25
31
pubtraitSamplePin<TSC>{
26
32
constGROUP:u32;
27
33
constOFFSET:u32;
@@ -65,10 +71,8 @@ impl ChannelPin<TSC> for PB7<Alternate<AF9, Output<PushPull>>> {
65
71
}
66
72
67
73
68
-
// TODO currently requires all the pins even if a user wants one channel, fix
69
74
pubstructTsc<SPIN>{
70
75
sample_pin:SPIN,
71
-
// pins: PINS,
72
76
tsc:TSC
73
77
}
74
78
@@ -102,8 +106,6 @@ impl<SPIN> Tsc<SPIN> {
102
106
.tsce()
103
107
.set_bit()
104
108
});
105
-
106
-
// TODO allow configuration
107
109
108
110
let bit_pos = SPIN::OFFSET + (4*(SPIN::GROUP - 1));
0 commit comments