I ported the SSD1306 OLED display driver on github (https://github.com/adafruit/SSD1306) to C#, targeting the netduino micro-controller and I have a couple questions about the driver code. Please keep in mind that I have not yet been able to test my code with the actual display since it was shipped on Monday
So, here it goes...
Question #1:
Based on the functions in SSD1306.cpp and after reading the SSD1306's datasheet, you're using the 4-wire SPI interface of the controller (as opposed to the 3-wire SPI interface) and I was wondering if there was a specific reason why you chose to use Arduino's ShiftOut() function instead of using the hardware SPI support provided by the SPI Arduino library, combined with two other digital I/O lines controlling D/C and RST?
Question #2:
In ssd1306_command() and ssd1306_data() (SSD1306.cpp lines 369-383), the code pulses the CS line before spiwrite():
void SSD1306::ssd1306_command(uint8_t c) {
digitalWrite(cs, HIGH);
digitalWrite(dc, LOW);
digitalWrite(cs, LOW);
spiwrite(c);
digitalWrite(cs, HIGH);
}
Why is this necessary?
In the datasheet, "Figure 8-5 : Write procedure in 4-wire Serial interface mode" seems to show that CS is just kept low during the transmission and only brought back to high when it's complete.
Thanks,
-Fabien.

