SSD1306.Commands (ssd1306 v1.0.1)

This module contains all the constants and commands for manipulating the SSD1306 device. More information about the available commands can be found in the COMMAND TABLE section of the Datasheet.

For simple use cases you will most likely want to simply use the SSD1306.Device module to automatically handle your display needs, however if you have something more complicated in mind then you can use the functions in this module to interact with an I2C device directly.

Summary

Functions

set activate scroll

set charge pump

set column address

set com pins

set com scan dec

set com scan inc

set contrast

set deactivate scroll

Send a frame to the display.

set display all on

set display all on resume

display clock div

set display off

set display offset

set display on

set high column

Initialize the device using "sane defaults" based on the display size.

set invert display

set left horizontal scroll

set low column

set memory node

set multiplex

set normal display

set pre charge

Reset the SSD1306 using the GPIO reset pin.

set right horizontal scroll

set segment remap

set start line

set vcom detect

set vertical and left horizontal scroll

set vertical and right horizontal scroll

set vertical scroll area

Functions

Link to this function

activate_scroll!(pid)

set activate scroll

Link to this function

charge_pump(pid, value)

set charge pump

Link to this function

column_address(pid, start, fin)

set column address

Link to this function

com_pins(pid, value)

set com pins

Link to this function

com_scan_dec!(pid)

set com scan dec

Link to this function

com_scan_inc!(pid)

set com scan inc

Link to this function

contrast(pid, value)

set contrast

Link to this function

deactivate_scroll!(pid)

set deactivate scroll

Link to this function

display(map, buffer)

Send a frame to the display.

Arguments:

  • A map with :i2c set to the I2C connection pid, :width and :height in pixels.
  • A bytestring containing the buffer to be displayed.
Link to this function

display_all_on!(pid)

set display all on

Link to this function

display_all_on_resume!(pid)

set display all on resume

Link to this function

display_clock_div(pid, value)

display clock div

Link to this function

display_off!(pid)

set display off

Link to this function

display_offset(pid, value)

set display offset

Link to this function

display_on!(pid)

set display on

Link to this function

high_column(pid, value)

set high column

Link to this function

initialize!(state)

Initialize the device using "sane defaults" based on the display size.

Configurable options (configure by adding these keys to your device's keys in your application configuration) and their defaults below:

config :ssd1306,
  device: [%{
    display_clock_div: 0x80,
    multiplex: 0x3f,
    external_vcc: false,
    charge_pump: 0x10, # or 0x14 if :external_vcc is true
    memory_mode: 0x80,
    segment_remap: 0x01,
    com_pins: 0x12,
    contrast: 0x9f, # or 0xcf if :external_vcc is true
    pre_charge: 0x22, # or 0xf1 if :external_vcc is true
    vcom_detect: 0x40
  }]
Link to this function

invert_display!(pid)

set invert display

Link to this function

left_horizontal_scroll!(pid)

set left horizontal scroll

Link to this function

low_column(pid, value)

set low column

Link to this function

memory_mode(pid, value)

set memory node

Link to this function

multiplex(pid, value)

set multiplex

Link to this function

normal_display!(pid)

set normal display

Link to this function

page_address(pid, start, fin)

set page address

Link to this function

pre_charge(pid, value)

set pre charge

Link to this function

reset!(gpio_pid)

Reset the SSD1306 using the GPIO reset pin.

Link to this function

right_horizontal_scroll!(pid)

set right horizontal scroll

Link to this function

segment_remap(pid, value)

set segment remap

Link to this function

start_line(pid, value)

set start line

Link to this function

vcom_detect(pid, value)

set vcom detect

Link to this function

vertical_and_left_horizontal_scroll!(pid)

set vertical and left horizontal scroll

Link to this function

vertical_and_right_horizontal_scroll!(pid)

set vertical and right horizontal scroll

Link to this function

vertical_scroll_area(pid, value)

set vertical scroll area