Skip to content

Default I2C Interface

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

Default I2C Interface

  • Depends on CONFIG_SSD1306_ENABLE_DEFAULT_I2C_INTERFACE being set
  • Default frequency is 250KHz
  • Default port number is 0

This provides a quick and easy way to get something on your display with just a few lines of code.
You can configure how the i2c will be set up in the tarablessd1306 component configuration menu.

SSD1306_I2CMasterInitDefault:

bool SSD1306_I2CMasterInitDefault( void )

Initializes the i2c master device with the configuration specified in the tarablessd1306 component configuration menu.

Returns:

  • True if successfully initialized i2c master

SSD1306_I2CMasterAttachDisplayDefault

bool SSD1306_I2CMasterAttachDisplayDefault( struct SSD1306_Device* DisplayHandle, int Width, int Height, int I2CAddress, int RSTPin )

Initializes the display using default i2c write operations and attaches it to the i2c bus.

Parameters:

  1. Pointer to an object to be initialized and used as a handle for display operations
  2. Width of the display
  3. Height of the display
  4. I2C Address
  5. GPIO Pin connected to reset (Optional: Pass -1 if you're not connecting a reset pin)

Returns:

  • True: Successfully attached display to i2c bus