added v2.0
This commit is contained in:
1
07_Operating_System/11_Touch_Test/Array.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/Array.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../Array.jack
|
1
07_Operating_System/11_Touch_Test/GPIO.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/GPIO.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../GPIO.jack
|
17
07_Operating_System/11_Touch_Test/Main.jack
Normal file
17
07_Operating_System/11_Touch_Test/Main.jack
Normal file
@@ -0,0 +1,17 @@
|
||||
class Main{
|
||||
|
||||
function void main(){
|
||||
while (true){
|
||||
if (Touch.getEvent()) {
|
||||
do StdIO.printInt(Touch.getX());
|
||||
do StdIO.printString(" ");
|
||||
do StdIO.printInt(Touch.getY());
|
||||
do StdIO.printString(" ");
|
||||
do StdIO.printInt(Touch.getPen());
|
||||
do StdIO.println();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
18
07_Operating_System/11_Touch_Test/Makefile
Normal file
18
07_Operating_System/11_Touch_Test/Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
all: jack vm asm bin sim
|
||||
|
||||
jack:
|
||||
../../tools/JackCompiler/JackCompiler.pyc ./
|
||||
vm:
|
||||
../../tools/VMTranslator/VMTranslator.pyc ./
|
||||
asm:
|
||||
../../tools/Assembler/assembler.pyc out.asm
|
||||
bin:
|
||||
../../tools/AsciiToBin.py out.hack
|
||||
sim:
|
||||
cp out.hack ../00_HACK/ROM.hack
|
||||
upload:
|
||||
iceprogduino -o 64k -w out.bin
|
||||
clean:
|
||||
rm -f *.vm *.asm *.hack *.bin *~
|
||||
|
||||
.PHONY: all clean
|
1
07_Operating_System/11_Touch_Test/Math.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/Math.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../Math.jack
|
1
07_Operating_System/11_Touch_Test/Memory.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/Memory.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../Memory.jack
|
55
07_Operating_System/11_Touch_Test/Readme.md
Normal file
55
07_Operating_System/11_Touch_Test/Readme.md
Normal file
@@ -0,0 +1,55 @@
|
||||
## Touch.jack
|
||||
|
||||
A library to read touch events from the resistive touch panel controller AR1021.
|
||||
|
||||
See datasheet [AR1021](../../doc/AR1000.pdf):
|
||||
|
||||
To read the next touch event just read 5 consecutive bytes from RTP:
|
||||
pen,xlow,xhigh,ylow and yhigh. Between every byte there should be a delay of min. 50us. When no data is available, the controller will answer with 4Dh (77d). The Event is only valid if the first byte is 128 or 129, and the x and y coordinates are in the range [0..4095].
|
||||
|
||||
1. **pen**: 128 = pen up, 129 = pen down
|
||||
2. **xlow**; 7 least significant bits of x coordinate
|
||||
3. **xhigh**; 5 most significant bits of x coordinate
|
||||
4. **ylow**; 7 least significant bits of y coordinate
|
||||
5. **yhigh**; 5 most significant bits of y coordinate
|
||||
|
||||
xhigh[4:0]*128+xlow[6:0] represent a 12 bit x-coordinate in the range 0-4095.
|
||||
|
||||
yhigh[4:0]*128+ylow[6:0] represent a 12 bit y-coordinate in the range 0-4095
|
||||
|
||||

|
||||
|
||||
***
|
||||
|
||||
### Project
|
||||
|
||||
* implement `Touch.jack`
|
||||
|
||||
* Test in simulation
|
||||
|
||||
```
|
||||
$ cd 11_Touch_Test
|
||||
$ make
|
||||
$ cd ../00_HACK
|
||||
$ apio clean
|
||||
$ apio sim
|
||||
```
|
||||
|
||||

|
||||
|
||||
* Check for the inter byte delay of approximately 50us.
|
||||
|
||||
* SDO is low while reading data from RTP
|
||||
|
||||
* SCK shows 5 blocks of 8 clocks cycles
|
||||
|
||||
* Connect the resitive touch panel controller AR1021 of MOD-LCD2.8RTP to iCE40HX1K-EVB as described in `06_IO_Devices/07_RTP`
|
||||
|
||||
* Run Touch_Test in real hardware on iCE40HX1K-EVB. Create some touch events on the resistive touch panel RTP and check the messages send to UART_TX.
|
||||
|
||||
```
|
||||
$ cd 11_Touch_Test
|
||||
$ make
|
||||
$ make upload
|
||||
$ tio /dev/ttyACM0
|
||||
```
|
1
07_Operating_System/11_Touch_Test/StdIO.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/StdIO.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../StdIO.jack
|
1
07_Operating_System/11_Touch_Test/String.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/String.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../String.jack
|
1
07_Operating_System/11_Touch_Test/Sys.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/Sys.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../Sys.jack
|
1
07_Operating_System/11_Touch_Test/Touch.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/Touch.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../Touch.jack
|
1
07_Operating_System/11_Touch_Test/UART.jack
Symbolic link
1
07_Operating_System/11_Touch_Test/UART.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../UART.jack
|
BIN
07_Operating_System/11_Touch_Test/touch.png
Normal file
BIN
07_Operating_System/11_Touch_Test/touch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
BIN
07_Operating_System/11_Touch_Test/touch_event.png
Normal file
BIN
07_Operating_System/11_Touch_Test/touch_event.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
Reference in New Issue
Block a user