Does DigoleGeo work in SPI mode?


I am trying to hook up Digole 2.4" lcd by using DigoleGeo in SPI mode. I am having compile errors, all I did was digoleGeoDemo.ino

  #define _Digole_Serial_SPI_   //uncomment
//#define _Digole_Serial_SoftSPI_
//#define _Digole_Serial_I2C_
//#define _Digole_Serial_UART_  //comment
#include "DigoleGeo.h"

//Colours defined as 8-bit value RRRG GGBB
#define VGA_BLACK   0x00
#define VGA_WHITE   0x01
#define VGA_BLUE    0x03
#define VGA_DARKRED 0x20

#define VGA_RED     0xE0
#define VGA_GREEN   0x1C
#define VGA_LIME    0x14
#define VGA_YELLOW  0xFC

int max_x, max_y;

DigoleSerialDisp mydisp(A1, A3, A2);      //SOFT SPI setup - specify DATA, CLOCK, SS pins
//DigoleSerialDisp mydisp(D2, D3, SS);      //SOFT SPI setup - specify DATA, CLOCK, SS pins
//DigoleSerialDisp mydisp(SS);              //Hardware SPI setup - specify SS pin
//DigoleSerialDisp mydisp('\x27');    //I2C specified - specify Pointer to Wire object, I2C address of Digole
//DigoleSerialDisp mydisp(&Serial1, 115200);    //USART (Serial 1 or 2) - specify &Serial1 or &Serial2 and baudrate

Anyone got this working for SPI mode?

@sheng, there is a reference to a needing a 10K ohm resistor between the MISO pin and GND in the Digole documentation for newer displays. I found the ONLY way I could use SPI was with software SPI. On older displays, the resistor was not needed and hardware SPI worked but only in SPI MODE 1. Is this a newer display? Which model?

@peekay123, I got the library DigoleGeoDemo and library from [DigoleGeo] ( Is this the latest location of the Library?

The screen I am using is 2.6" Serial: UART/I2C/SPI IPS Super TFT 320x240 with Touchscreen Module DS320240CIPS-66T .

The issue I am having is during compiling the DigoleGeoDemo after uncomment #define Digole_Serial_SPI and DigoleSerialDisp mydisp(A1, A3, A2);

Below is the compiling error:

In file included from ../hal/inc/gpio_hal.h:31:0,
                 from ../hal/src/stm32f2xx/platform_headers.h:16,
                 from ./inc/application.h:36,
                 from digoleGeoDemo.cpp:1:
../hal/inc/pinmap_hal.h:142:14: error: expected ',' or '...' before numeric constant
 #define SS   12
DigoleGeo.h:125:67: note: in expansion of macro 'SS'
     DigoleSerialDisp(uint8_t pin_data, uint8_t pin_clock, uint8_t SS, uint8_t SI = 0) //spi set up
In file included from digoleGeoDemo.ino:14:0:
DigoleGeo.h: In constructor 'DigoleSerialDisp::DigoleSerialDisp(uint8_t, uint8_t, uint8_t)':
DigoleGeo.h:130:18: error: 'SI' was not declared in this scope
         _SIpin = SI;

In the library, there is no #define Digole_Serial_SoftSPI mode. I could be using an old library.

I have verified UART mode compiles and screen works, just in SPI mode the demo file have compile errors above.

@sheng, this library needs updating. I will try and get to that this weekend. Also, you need to look at page 10 of the programming manual which describes the need for a resistor in SPI mode.

@peekay123, Thank You for updating the library. I will add the resistor during my test.