mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
add SoftSPI for STM32F407ZGx
This commit is contained in:
parent
88ac8f111a
commit
90c1505da3
@ -21,7 +21,15 @@
|
||||
*/
|
||||
#include "XPT2046_Touchscreen.h"
|
||||
|
||||
SPIClass spi(PB15, PB14, PB13); // SPI2
|
||||
// SPIClass spi(PB15, PB14, PB13); // SPI2
|
||||
#if defined(STM32F407ZG)
|
||||
#include "SoftSPI.h"
|
||||
extern SoftSPI xpt2046_spi;
|
||||
SoftSPI spi = xpt2046_spi;
|
||||
#else
|
||||
extern SPIClass xpt2046_spi;
|
||||
SPIClass spi = xpt2046_spi;
|
||||
#endif
|
||||
|
||||
#define Z_THRESHOLD 400
|
||||
#define Z_THRESHOLD_INT 75
|
||||
|
@ -37,9 +37,14 @@ static void xpt2046_avg(int16_t * x, int16_t * y);
|
||||
int16_t avg_buf_x[XPT2046_AVG];
|
||||
int16_t avg_buf_y[XPT2046_AVG];
|
||||
uint8_t avg_last;
|
||||
#if defined(STM32F407ZG)
|
||||
#include "SoftSPI.h"
|
||||
SoftSPI xpt2046_spi(PF11, PB2, PB0);
|
||||
XPT2046_Touchscreen ts(PC13);
|
||||
#else
|
||||
SPIClass xpt2046_spi(PB15, PB14, PB13, PB12);
|
||||
XPT2046_Touchscreen ts(PB12);
|
||||
|
||||
#endif
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
@ -29,9 +29,12 @@
|
||||
// I use it with ST-LINK-V2, Upload method "STLink[Automatic serial = SerialUSB]", USB disabled.
|
||||
// For Serial I use a Serial to USB converter on PA9, PA10, "SerialUART1".
|
||||
// https://github.com/danieleff/STM32GENERIC
|
||||
#if defined(STM32F407ZG)
|
||||
#include "GxIO/STM32GENERIC/GxIO_STM32F407ZGx_FSMC/GxIO_STM32F407ZGx_FSMC.h"
|
||||
#else
|
||||
#include "GxIO/STM32DUINO/GxIO_STM32F4_FSMC/GxIO_STM32F4_FSMC.h"
|
||||
//#include "myTFTs/my_3.2_TFT_320x240_ILI9341_STM32F407ZGM4_FSMC.h"
|
||||
|
||||
#endif
|
||||
// #include "../GxIO/STM32GENERIC/GxIO_STM32F407ZGM4_FSMC/GxIO_STM32F407ZGM4_FSMC.h"
|
||||
//#include "../GxIO/STM32DUINO/GxIO_STM32F4_FSMC/GxIO_STM32F4_FSMC.h"
|
||||
#include "GxCTRL/GxCTRL_ILI9341/GxCTRL_ILI9341.h" // 240x320
|
||||
|
Loading…
x
Reference in New Issue
Block a user