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 page address
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
activate_scroll!(pid)
set activate scroll
charge_pump(pid, value)
set charge pump
column_address(pid, start, fin)
set column address
com_pins(pid, value)
set com pins
com_scan_dec!(pid)
set com scan dec
com_scan_inc!(pid)
set com scan inc
contrast(pid, value)
set contrast
deactivate_scroll!(pid)
set deactivate scroll
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.
display_all_on!(pid)
set display all on
display_all_on_resume!(pid)
set display all on resume
display_clock_div(pid, value)
display clock div
display_off!(pid)
set display off
display_offset(pid, value)
set display offset
display_on!(pid)
set display on
high_column(pid, value)
set high column
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
}]
invert_display!(pid)
set invert display
left_horizontal_scroll!(pid)
set left horizontal scroll
low_column(pid, value)
set low column
memory_mode(pid, value)
set memory node
multiplex(pid, value)
set multiplex
normal_display!(pid)
set normal display
page_address(pid, start, fin)
set page address
pre_charge(pid, value)
set pre charge
reset!(gpio_pid)
Reset the SSD1306 using the GPIO reset pin.
right_horizontal_scroll!(pid)
set right horizontal scroll
segment_remap(pid, value)
set segment remap
start_line(pid, value)
set start line
vcom_detect(pid, value)
set vcom detect
vertical_and_left_horizontal_scroll!(pid)
set vertical and left horizontal scroll
vertical_and_right_horizontal_scroll!(pid)
set vertical and right horizontal scroll
vertical_scroll_area(pid, value)
set vertical scroll area