Resources for writing own device drivers

Post Reply
Posts: 1
Joined: Fri Oct 04, 2019 8:30 am
languages_spoken: english
Has thanked: 0
Been thanked: 0

Resources for writing own device drivers

Unread post by vertexmachina » Fri Oct 04, 2019 8:41 am

I'm trying to create my own NES emulator for the ODROID-GO from scratch. By cross-referencing OtherCrashOverride's common code, the ODROID-GO wiki, and Espressif's documentation, I've created the code to interface with the SD card and the inputs and I understand it.

I'm now attempting to write the LCD driver but am hitting roadblocks when trying to understand OCO's code. He sets a lot of SPI configuration parameters and I don't know where he got them. For example, he has the following:

Code: Select all

devcfg.clock_speed_hz = LCD_SPI_CLOCK_RATE;
devcfg.mode = 0;                                //SPI mode 0
devcfg.spics_io_num = LCD_PIN_NUM_CS;               //CS pin
devcfg.queue_size = 7;                          //We want to be able to queue 7 transactions at a time
devcfg.pre_cb = ili_spi_pre_transfer_callback;  //Specify pre-transfer callback to handle D/C line
LCD_SPI_CLOCK_RATE is set to 40000000 - not sure where he got that.
SPI Mode 0 - not sure.
Queue Size - not sure

I feel like there must be some more documentation out there that I'm missing that discusses the ODROID-GO to LCD interface better than what is shown in the schematic on the wiki. I have the LCD datasheet, but it makes references to pins that are not shown in the ODROID-GO schematic.

In short, is there more documentation out there?


User avatar
Posts: 7259
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 452 times
Been thanked: 127 times

Re: Resources for writing own device drivers

Unread post by rooted » Fri Oct 04, 2019 1:56 pm

I answered but see you are already referencing the esp32 documentation.

Posts: 168
Joined: Mon Jan 28, 2019 7:00 pm
languages_spoken: english
Has thanked: 39 times
Been thanked: 22 times

Re: Resources for writing own device drivers

Unread post by ripper121 » Fri Oct 04, 2019 4:22 pm

Try the github search: ... _display.c
const int LCD_SPI_CLOCK_RATE = 40000000;
const gpio_num_t LCD_PIN_NUM_CS = GPIO_NUM_5; ... aster.html

Code: Select all

There are timing issue when reading at high frequency (the frequency is related to whether iomux pins are used, valid time after slave sees the clock).

In half-duplex mode, the driver automatically inserts dummy bits before reading phase to fix the timing issue. Set this flag to disable this feature.
In full-duplex mode, however, the hardware cannot use dummy bits, so there is no way to prevent data being read from getting corrupted. Set this flag to confirm that you’re going to work with output only, or read without dummy bits at your own risk.

Posts: 19
Joined: Sun Dec 21, 2014 12:19 pm
languages_spoken: English
ODROIDs: C1, C2, XU4, N2
Location: New Orleans, LA, USA
Has thanked: 0
Been thanked: 0

Re: Resources for writing own device drivers

Unread post by lordcy » Sun Jan 05, 2020 12:39 pm

I would be interested in installing this once done. The current nes emulators (Go-play or Retro ESP32) don't run or freeze with a few games. There is something both of these nes emulators aren't doing which is causing issues but I don't know how to debug to give any information. Please let me know when this firmware is available to install. Thanks!

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests