ssd1306 v0.1.1 SSD1306.Commands
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
Functions
Send a frame to the display.
Initialize the device using "sane defaults" based on the display size.
Reset the SSD1306 using the GPIO reset pin.
Link to this section Functions
activate_scroll!(pid)
charge_pump(pid, value)
column_address(pid, start, fin)
com_pins(pid, value)
com_scan_dec!(pid)
com_scan_inc!(pid)
contrast(pid, value)
deactivate_scroll!(pid)
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)
display_all_on_resume!(pid)
display_clock_div(pid, value)
display_off!(pid)
display_offset(pid, value)
display_on!(pid)
high_column(pid, value)
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)
left_horizontal_scroll!(pid)
low_column(pid, value)
memory_mode(pid, value)
multiplex(pid, value)
normal_display!(pid)
page_address(pid, start, fin)
pre_charge(pid, value)
reset!(gpio_pid)
Reset the SSD1306 using the GPIO reset pin.