File tree 3 files changed +31
-10
lines changed
3 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,27 @@ before being able to detect another event.
16
16
17
17
18
18
## API
19
-
20
- The API has a single address, and a single bit in that address:
19
+ The API has two addresses.
21
20
22
21
```
23
22
ADDR_STATUS: 0x09
24
23
STATUS_EVENT_BIT: 0
24
+
25
+ ADDR_PRESENT: 0x0a
26
+ FINGER_PRESENT_BIT: 0
25
27
```
26
28
27
- SW should clear any stray attempts before signalling to the user that
28
- a touch event is expected. Clearing an event is done by writing the
29
- the status address, the value written does not matter.
29
+ In order to detect an event, SW should clear any stray attempts before
30
+ signalling to the user that a touch event is expected. Clearing an
31
+ event is done by writing the the status address, the value written
32
+ does not matter.
33
+
34
+ When an event has been detected, that is the sampled input from the
35
+ sensor has gone from low to high, the STATUS_EVENT_BIT will be high
36
+ (set). When SW reads a high bit, the SW should as soon as possible
37
+ clear the event by writing to the status register. The value written
38
+ does not matter.
39
+
40
+ The FINGER_PRESENT bit is the sampled input from the sensor. The bit
41
+ will be high as long as a finger is present on the sensor. When a
42
+ finger is present the bit will be low.
Original file line number Diff line number Diff line change @@ -31,12 +31,14 @@ module touch_sense(
31
31
// ----------------------------------------------------------------
32
32
// Internal constant and parameter definitions.
33
33
// ----------------------------------------------------------------
34
- localparam ADDR_STATUS = 8'h09 ;
35
- localparam STATUS_EVENT_BIT = 0 ;
34
+ localparam ADDR_STATUS = 8'h09 ;
35
+ localparam STATUS_EVENT_BIT = 0 ;
36
+ localparam ADDR_PRESENT = 8'h0a ;
37
+ localparam FINGER_PRESENT_BIT = 0 ;
36
38
37
- localparam CTRL_IDLE = 2'h0 ;
38
- localparam CTRL_EVENT = 2'h1 ;
39
- localparam CTRL_WAIT = 2'h2 ;
39
+ localparam CTRL_IDLE = 2'h0 ;
40
+ localparam CTRL_EVENT = 2'h1 ;
41
+ localparam CTRL_WAIT = 2'h2 ;
40
42
41
43
42
44
// ----------------------------------------------------------------
@@ -120,6 +122,10 @@ module touch_sense(
120
122
if (address == ADDR_STATUS) begin
121
123
tmp_read_data[STATUS_EVENT_BIT] = touch_event_reg;
122
124
end
125
+
126
+ if (address == ADDR_PRESENT) begin
127
+ tmp_read_data[FINGER_PRESENT_BIT] = touch_event_sample1_reg;
128
+ end
123
129
end
124
130
end
125
131
end // api
Original file line number Diff line number Diff line change 98
98
#define TK1_MMIO_TOUCH_BASE 0xc4000000
99
99
#define TK1_MMIO_TOUCH_STATUS 0xc4000024
100
100
#define TK1_MMIO_TOUCH_STATUS_EVENT_BIT 0
101
+ #define TK1_MMIO_TOUCH_PRESENT 0xc4000028
102
+ #define TK1_MMIO_TOUCH_PRESENT_BIT 0
101
103
102
104
// This only exists in QEMU, not real hardware
103
105
#define TK1_MMIO_QEMU_BASE 0xfe000000
You can’t perform that action at this time.
0 commit comments