• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# lws_display
2
3lws provides a generic "display" object that is independent of the connection
4to the display, i2c and spi implementations are provided.
5
6Its purpose is to provide basic blit, backlight binding to lws_pwm, backlight /
7power management and display info like pixels wide and high in a generic way.
8
9The generic display object `lws_display_t` can be included at the top of a
10specific display implementation object, eg, binding it to additional members
11to define the actual IO operations to be used, eg, i2c or spi.
12
13When the display is instantiated, it allocates an additional structure on heap
14that contains dynamic information about display state, `lws_display_state_t`.
15
16## Power state machine
17
18lws_display objects have convenient power state management using a single lws
19sul event loop timer that is managed automatically.
20
21State|Meaning
22---|---
23OFF|The display is in sleep and not showing anything
24BECOMING_ACTIVE|The display was asked to come out of sleep and is waiting for .latency_wake_ms befor proceeding to ACTIVE.  The backlight if any is off.  After the delay, the backlight is sequenced up to `.bl_active` using `.bl_transition` sequencer
25ACTIVE|The backlight is ON and the dim timer is running
26AUTODIMMED|The dim timer was not told the display was active for `.autodim_ms`, we are at `.bl_dim` brightness.  After `.off_ms` we will transition to OFF
27
28The lws_pwm sequencers are used to provide customizable, smooth transitions for
29the backlight, which may be nonlinear.
30
31## Active notification
32
33Calling `lws_display_state_active(&lds)` on eg, user interaction causes the
34display state to transition to ACTIVE smoothly, taking care of waking the display
35and waiting out a display-specific wake period, and sequencing the backlight
36transition to active level as specified in the display structure.
37