View Source Framebuffer (framebuffer v0.0.2)

Abstraction over Linux framebuffer devices.

Linux headers

Linux documentation

Link to this section Summary

Types

Color: {red, green, blue}

t()
x()
y()

Functions

Given an open framebuffer, refresh its fixed and variable device information.

Opens a framebuffer device and returns an :ok tuple with a Framebuffer.t/0 including fixed and variable device information and a reference to an open file descriptor. This file descriptor is kept open for the lifetime of the reference.

Optimistic version of open/1. Raises on any error.

Link to this section Types

Specs

Color: {red, green, blue}

Specs

device_t() :: Path.t()

Specs

pixel_t() :: {x(), y(), color()}

Specs

t() :: %Framebuffer{
  fix_screeninfo: Framebuffer.Screeninfo.Fix.t(),
  ref: reference(),
  var_screeninfo: Framebuffer.Screeninfo.Var.t()
}

Specs

x() :: non_neg_integer()

Specs

y() :: non_neg_integer()

Link to this section Functions

Specs

clear(t()) :: {:ok, t()}

Specs

info(t()) :: {:ok, t()} | {:error, term()}

Given an open framebuffer, refresh its fixed and variable device information.

Arguments

parameterrequireddefault
framebuffertrue

Specs

info!(t()) :: t() | no_return()
Link to this function

open(device \\ "/dev/fb0")

View Source

Specs

open(device_t()) :: {:ok, t()} | {:error, term()}

Opens a framebuffer device and returns an :ok tuple with a Framebuffer.t/0 including fixed and variable device information and a reference to an open file descriptor. This file descriptor is kept open for the lifetime of the reference.

Arguments

parameterrequireddefault
devicefalse/dev/fb0
Link to this function

open!(device \\ "/dev/fb0")

View Source

Specs

open!(device_t()) :: t() | no_return()

Optimistic version of open/1. Raises on any error.

Link to this function

put_pixel(framebuffer, x, y, color)

View Source

Specs

put_pixel(t(), x(), y(), color()) :: :ok | {:error, term()}

Specs

rand(t()) :: {:ok, t()}