Support for TFT & Touch Screens (#18130)

This commit is contained in:
Alexander Gavrilenko
2020-07-30 09:43:19 +03:00
committed by GitHub
parent bba157e5bd
commit 117df87d19
176 changed files with 14747 additions and 303 deletions

View File

@ -277,7 +277,7 @@ void SPIClass::read(uint8_t *buf, uint32_t len) {
regs->DR = 0x00FF; // write the first byte
// main loop
while (--len) {
while(!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait for TXE flag
while (!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait for TXE flag
noInterrupts(); // go atomic level - avoid interrupts to surely get the previously received data
regs->DR = 0x00FF; // write the next data item to be transmitted into the SPI_DR register. This clears the TXE flag.
while (!(regs->SR & SPI_SR_RXNE)) { /* nada */ } // wait till data is available in the DR register

View File

@ -25,3 +25,14 @@
//#warning "SD_CHECK_AND_RETRY isn't needed with USE_USB_COMPOSITE."
#undef SD_CHECK_AND_RETRY
#endif
#if HAS_GRAPHICAL_TFT
#error "Sorry! TFT displays are not available for HAL/STM32F1."
#endif
// This platform has 'touch/xpt2046', not 'tft/xpt2046'
#if ENABLED(TOUCH_SCREEN)
#undef TOUCH_SCREEN
#undef TOUCH_SCREEN_CALIBRATION
#define HAS_TOUCH_XPT2046 1
#endif