adjusted old code to new spi and gpi
minor fixes
This commit is contained in:
@@ -76,8 +76,8 @@
|
||||
|
||||
|
||||
|
||||
#include "../../io/SoftSPI.h"
|
||||
#include "../../io/HardSPI.h"
|
||||
//#include "../../io/SoftSPI.h"
|
||||
//#include "../../io/HardSPI.h"
|
||||
|
||||
|
||||
static constexpr const uint8_t initcmd[] = {
|
||||
@@ -107,7 +107,7 @@ static constexpr const uint8_t initcmd[] = {
|
||||
};
|
||||
|
||||
//template <int PIN_CS, int PIN_MISO, int PIN_MOSI, int PIN_CLK, int PIN_DATA_COMMAND> class ILI9341 {
|
||||
template <int PIN_CS, int PIN_DATA_COMMAND, typename SPI> class ILI9341 {
|
||||
template <typename SPI, int PIN_CS, int PIN_DATA_COMMAND> class ILI9341 {
|
||||
|
||||
private:
|
||||
|
||||
@@ -124,8 +124,8 @@ public:
|
||||
|
||||
ILI9341(SPI& spi) : spi(spi) {
|
||||
|
||||
GPIO::setOutput(PIN_DATA_COMMAND);
|
||||
GPIO::setOutput(PIN_CS);
|
||||
MyGPIO::setOutput(PIN_DATA_COMMAND);
|
||||
MyGPIO::setOutput(PIN_CS);
|
||||
|
||||
//spi.init();
|
||||
|
||||
@@ -296,7 +296,7 @@ private:
|
||||
/** select the display (CS=0) */
|
||||
inline void chipSelect() {
|
||||
//spi::chipSelect();
|
||||
GPIO::clear(PIN_CS);
|
||||
MyGPIO::clear(PIN_CS);
|
||||
}
|
||||
|
||||
|
||||
@@ -344,19 +344,19 @@ private:
|
||||
/** unselect the display (CS=1) */
|
||||
inline void chipDeselect() {
|
||||
//spi::chipDeselect();
|
||||
GPIO::set(PIN_CS);
|
||||
MyGPIO::set(PIN_CS);
|
||||
}
|
||||
|
||||
/** switch to command-mode */
|
||||
inline void modeCMD() {
|
||||
//gpio_set_level((gpio_num_t)PIN_DATA_COMMAND, 0);
|
||||
GPIO::clear(PIN_DATA_COMMAND);
|
||||
MyGPIO::clear(PIN_DATA_COMMAND);
|
||||
}
|
||||
|
||||
/** switch to data-mode */
|
||||
inline void modeDATA() {
|
||||
//gpio_set_level((gpio_num_t)PIN_DATA_COMMAND, 1);
|
||||
GPIO::set(PIN_DATA_COMMAND);
|
||||
MyGPIO::set(PIN_DATA_COMMAND);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user