SSD1306.Commands (ssd1306 v1.0.0)

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.

Link to this section Summary

Link to this section Functions

Link to this function

activate_scroll!(pid)

Link to this function

charge_pump(pid, value)

Link to this function

column_address(pid, start, fin)

Link to this function

com_pins(pid, value)

Link to this function

com_scan_dec!(pid)

Link to this function

com_scan_inc!(pid)

Link to this function

contrast(pid, value)

Link to this function

deactivate_scroll!(pid)

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)

Link to this function

display_all_on_resume!(pid)

Link to this function

display_clock_div(pid, value)

Link to this function

display_off!(pid)

Link to this function

display_offset(pid, value)

Link to this function

display_on!(pid)

Link to this function

high_column(pid, value)

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)

Link to this function

left_horizontal_scroll!(pid)

Link to this function

low_column(pid, value)

Link to this function

memory_mode(pid, value)

Link to this function

multiplex(pid, value)

Link to this function

normal_display!(pid)

Link to this function

page_address(pid, start, fin)

Link to this function

pre_charge(pid, value)

Link to this function

reset!(gpio_pid)

Reset the SSD1306 using the GPIO reset pin.

Link to this function

right_horizontal_scroll!(pid)

Link to this function

segment_remap(pid, value)

Link to this function

start_line(pid, value)

Link to this function

vcom_detect(pid, value)

Link to this function

vertical_and_left_horizontal_scroll!(pid)

Link to this function

vertical_and_right_horizontal_scroll!(pid)

Link to this function

vertical_scroll_area(pid, value)