src/def_f446re.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
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

#if !defined(DEF_F446RE_H)


#define DEF_F446RE_H
/******************************************************/
/*                 F446RE                             */
/******************************************************/
// TODO: use TARGET_NUCLEO_F446RE or similar
// UART
// USBTX PA_2
// USBRX PA_3
// display
#define DSP_MOSI PB_15 // blue
#define DSP_MISO PB_14 // NC
#define DSP_SCLK PB_13 // yellow
#define DSP_CS   PB_12 // green
#define DSP_RST  PB_5 // green
#define DSP_DC   PB_4 // red

// UART for RX (CPU->DP)
#define HP_RX PC_11 // serial3 RX
#define HP_TX PC_10 // serial3 TX

// RST pin (handle this by hand)
#define HP_RST PC_12

// encoder
#define KP_ENC1 PC_4
#define KP_ENC2 PC_5

// keypad
#define KP_R0 PC_0   //  I-6
#define KP_R1 PC_1   // II-5
#define KP_R2 PC_2   //  I-5
#define KP_R3 PC_3   // II-4


#define KP_C0 PB_0   //  I-4
#define KP_C1 PA_6   //  I-2
#define KP_C2 PA_7   //  I-3
#define KP_C3 PA_10   //  I-1
#define KP_C4 PD_2   // II-1

// misc
#define DBGPIN PC_6

#ifdef HAVE_PC
BufferedSerial pc(USBTX, USBRX, 115200);
#endif
DigitalOut led(LED1);
#define HAS_LED
#endif

mercurial