Added SPI speed parameter
Dependents: EasyCAT_LAB_simple EasyCAT_LAB
- The default SPI speed has been set to 27MHz, but it can be configured using the last parameter of the constructor.
- This is an optimization for the EasyCAT LAB , a complete educational and experimental EtherCAT® system, composed of one master and two slaves .
Diff: SPI_TFT_ILI9341.cpp
- Revision:
- 10:2ea035fb95d0
- Parent:
- 9:2e5c5943b3fd
- Child:
- 11:f94024581a44
--- a/SPI_TFT_ILI9341.cpp Tue Jun 11 09:59:18 2019 +0000 +++ b/SPI_TFT_ILI9341.cpp Sat Apr 10 14:24:14 2021 +0000 @@ -118,10 +118,20 @@ wait_us(50); rst = 1; // end hardware reset } - wait_ms(5); + #if (MBED_MAJOR_VERSION != 2) + ThisThread::sleep_for(5ms); + #else + wait_ms(5); + #endif - wr_cmd(0x01); // SW reset - wait_ms(5); + wr_cmd(0x01); // SW reset + + #if (MBED_MAJOR_VERSION != 2) + ThisThread::sleep_for(5ms); + #else + wait_ms(5); + #endif + wr_cmd(0x28); // display off /* Start Initial Sequence ----------------------------------------------------*/ @@ -257,13 +267,20 @@ wr_cmd(0x11); // sleep out _cs = 1; - wait_ms(100); + #if (MBED_MAJOR_VERSION != 2) + ThisThread::sleep_for(100ms); + #else + wait_ms(100); + #endif wr_cmd(0x29); // display on _cs = 1; - wait_ms(100); - + #if (MBED_MAJOR_VERSION != 2) + ThisThread::sleep_for(100ms); + #else + wait_ms(100); + #endif }