src/def_hp34970_fp.h

Sun, 01 Nov 2020 22:21:19 +0100

author
David Douard <david.douard@sdf3.org>
date
Sun, 01 Nov 2020 22:21:19 +0100
changeset 44
b3c3d54d2c7c
parent 32
bc1d6ecbb0cc
child 64
897330ee6e9d
permissions
-rw-r--r--

Many improvements

- add support for dimm-based selection,
- add support for poweroff (at least power thr display off),
- add support for the initial key pressed during initialization sequence,
- fix a race condition (sending a keycode while receiving a message)
- add support for the shift button
- many code cleanups and improvements

32
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
1 // STM32F303xE based HP34970 replacement PCB
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
2
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
3 #if !defined(DEF_HP34970_FP_H)
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
4
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
5 #define DEF_HP34970_FP_H
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
6
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
7 #define DSP_MOSI PA_7
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
8 #define DSP_MISO PA_6 // NC
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
9 #define DSP_SCLK PA_5
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
10 #define DSP_CS PA_2
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
11 #define DSP_RST PA_3
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
12 #define DSP_DC PA_4
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
13
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
14 // UART for RX (CPU->DP)
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
15 #define HP_RX PC_5
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
16 #define HP_TX PC_4
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
17
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
18 // RST pin (handle this by hand)
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
19 #define HP_RST PA_15
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
20
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
21 // encoder
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
22 #define KP_ENC1 PA_0
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
23 #define KP_ENC2 PA_1
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
24
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
25 // keypad
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
26 #define KP_R0 PB_5
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
27 #define KP_R1 PB_6
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
28 #define KP_R2 PB_7
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
29 #define KP_R3 PB_8
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
30
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
31 #define KP_C0 PC_2
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
32 #define KP_C1 PC_1
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
33 #define KP_C2 PC_0
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
34 #define KP_C3 PB_4
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
35 #define KP_C4 PB_0
44
b3c3d54d2c7c Many improvements
David Douard <david.douard@sdf3.org>
parents: 32
diff changeset
36
32
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
37 #if defined(HAVE_PC)
44
b3c3d54d2c7c Many improvements
David Douard <david.douard@sdf3.org>
parents: 32
diff changeset
38 //#include <USBSerial.h>
b3c3d54d2c7c Many improvements
David Douard <david.douard@sdf3.org>
parents: 32
diff changeset
39 //USBSerial pc;
b3c3d54d2c7c Many improvements
David Douard <david.douard@sdf3.org>
parents: 32
diff changeset
40 BufferedSerial pc(PC_10_ALT0, PC_11_ALT0, 115200); // UART_4
b3c3d54d2c7c Many improvements
David Douard <david.douard@sdf3.org>
parents: 32
diff changeset
41 //BufferedSerial pc(PC_10, PC_11, 115200); // UART_4
32
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
42 #endif
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
43
bc1d6ecbb0cc Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
diff changeset
44 #endif

mercurial