oled v0.3.3 OLED.Display behaviour View Source
Defines a display module
When used, the displaly expects an :app
as option.
The :app
should be the app that has the configuration.
Example:
defmodule MyApp.MyDisplay do
use OLED.Display, app: :my_app
end
Could be configured with:
config :my_app, MyApp.MyDisplay,
width: 128,
height: 64,
driver: :ssd1306,
type: :spi,
device: "spidev0.0",
rst_pin: 25,
dc_pin: 24
Configuration:
:driver
- For now only:ssd1306
is available:type
- Type of connection: (i.e.::spi
,:i2c
):width
- Display width:height
- Display height:rst_pin
- GPIO for RESET pin:dc_pin
- GPIO for DC pin
Link to this section Summary
Callbacks
Draw a circle
Clear the buffer.
Clear the buffer putting all the pixels on certain state.
Transfer the display buffer to the screen. You MUST call display() after drawing commands to make them visible on screen.
Transfer a data frame to the display buffer.
Draw a filled rect
Get display dimensions
Draw a line.
Draw an horizontal line (speed optimized).
Draw a vertical line (speed optimized).
Put a pixel on the buffer. The pixel can be on or off and be drawed in xor mode (if the pixel is already on is turned off).
Draw a rect
Link to this section Callbacks
circle(x0, y0, r, opts)
View Sourcecircle( x0 :: integer(), y0 :: integer(), r :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Draw a circle
Origin (x0, y0)
with radius r
.
Clear the buffer.
clear(pixel_state)
View Sourceclear(pixel_state :: OLED.Display.Server.pixel_state()) :: :ok
Clear the buffer putting all the pixels on certain state.
Transfer the display buffer to the screen. You MUST call display() after drawing commands to make them visible on screen.
display_frame(data, opts)
View Sourcedisplay_frame( data :: binary(), opts :: OLED.Display.Server.display_frame_opts() ) :: :ok
Transfer a data frame to the display buffer.
fill_rect(x, y, width, height, opts)
View Sourcefill_rect( x :: integer(), y :: integer(), width :: integer(), height :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Draw a filled rect
Get display dimensions
line(x1, y1, x2, y2, opts)
View Sourceline( x1 :: integer(), y1 :: integer(), x2 :: integer(), y2 :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Draw a line.
line_h(x, y, width, opts)
View Sourceline_h( x :: integer(), y :: integer(), width :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Draw an horizontal line (speed optimized).
line_v(x, y, height, opts)
View Sourceline_v( x :: integer(), y :: integer(), height :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Draw a vertical line (speed optimized).
put_pixel(x, y, opts)
View Sourceput_pixel( x :: integer(), y :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Put a pixel on the buffer. The pixel can be on or off and be drawed in xor mode (if the pixel is already on is turned off).
rect(x, y, width, height, opts)
View Sourcerect( x :: integer(), y :: integer(), width :: integer(), height :: integer(), opts :: OLED.Display.Server.pixel_opts() ) :: :ok
Draw a rect