Skip to content

Default SPI Interface

Tara K edited this page Apr 9, 2018 · 1 revision

Default SPI Interface

  • Depends on CONFIG_SSD1306_ENABLE_DEFAULT_SPI_INTERFACE
  • Default host is HSPI
  • Default frequency is 1MHz
  • Default MOSI pin is 13
  • Default SCLK pin is 14
  • Default DC pin is 33

This provides a quick and easy way to get an SPI attached display up and running.
Default SPI options are configured in the tarablesssd1306 component config menu.

SSD1306_SPIMasterInitDefault:

bool SSD1306_SPIMasterInitDefault( void )

Initializes the SPI host as configured in the component config menu.

Returns:

  • True: Successfully initialized SPI host

SPIMasterAttachDisplayDefault:

bool SSD1306_SPIMasterAttachDisplayDefault( struct SSD1306_Device* DeviceHandle, int Width, int Height, int CSForThisDisplay, int RSTForThisDisplay )

Initializes the display and attaches it to the SPI bus.

Parameters:

  1. Pointer to an object to use as a display handle
  2. Width of the display
  3. Height of the display
  4. GPIO Pin number of the chip select pin
  5. GPIO Pin number for the reset pin (Optional: If you're not using the reset pin, pass -1)

Returns:

  • True if the display was attached properly

NOTE: Since this display can be used write only, we can only assume it's properly connected
thus this will still return true even if there is a problem communicating with the device.