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:
- 7:3ac45671dc77
- Parent:
- 6:55aed13f2630
- Parent:
- 5:93cc09de603a
- Child:
- 8:32bf76e1ec9f
--- a/SPI_TFT_ILI9341.cpp Tue Oct 22 20:55:39 2013 +0000 +++ b/SPI_TFT_ILI9341.cpp Wed Oct 23 01:34:51 2013 +0000 @@ -25,10 +25,11 @@ //extern DigitalOut xx; // debug !! SPI_TFT_ILI9341::SPI_TFT_ILI9341(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset, PinName dc, const char *name) - : _spi(mosi, miso, sclk), _cs(cs), _reset(reset), _dc(dc), GraphicsDisplay(name) + : _spi(mosi, miso, sclk), _cs(cs), _dc(dc), GraphicsDisplay(name) { orientation = 0; char_x = 0; + _reset = reset; tft_reset(); } @@ -110,10 +111,13 @@ _spi.frequency(10000000); // 10 Mhz SPI clock _cs = 1; // cs high _dc = 1; // dc high - _reset = 0; // display reset - - wait_us(50); - _reset = 1; // end hardware reset + if (_reset != NC) + { + DigitalOut rst(_reset); + rst = 0; // display reset + wait_us(50); + rst = 1; // end hardware reset + } wait_ms(5); wr_cmd(0x01); // SW reset