libwebsockets
Lightweight C library for HTML5 websockets
lws-display.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lws_box
 
struct  lws_surface_info
 
struct  lws_greyscale_error
 
struct  lws_colour_error
 
union  lws_surface_error_t
 
struct  lws_display
 
struct  lws_display_state
 

Typedefs

typedef int16_t lws_display_list_coord_t
 
typedef uint16_t lws_display_scalar
 
typedef uint16_t lws_display_rotation_t
 
typedef uint32_t lws_display_colour_t
 
typedef uint16_t lws_display_palette_idx_t
 
typedef struct lws_box lws_box_t
 
typedef struct lws_surface_info lws_surface_info_t
 
typedef struct lws_greyscale_error lws_greyscale_error_t
 
typedef struct lws_colour_error lws_colour_error_t
 
typedef struct lws_display lws_display_t
 
typedef struct lws_display_state lws_display_state_t
 
typedef int(* lws_display_completion_t) (lws_display_state_t *lds, int a)
 

Enumerations

enum  lws_surface_type_t { LWSSURF_TRUECOLOR32 , LWSSURF_565 , LWSSURF_PALETTE , LWSSURF_QUANTIZED_4BPP }
 
enum  lws_display_controller_state {
  LWSDISPS_OFF , LWSDISPS_AUTODIMMED , LWSDISPS_BECOMING_ACTIVE , LWSDISPS_ACTIVE ,
  LWSDISPS_GOING_OFF
}
 

Functions

LWS_VISIBLE LWS_EXTERN void lws_surface_set_px (const lws_surface_info_t *ic, uint8_t *line, int x, const lws_display_colour_t *c)
 
LWS_VISIBLE LWS_EXTERN lws_display_palette_idx_t lws_display_palettize_grey (const lws_surface_info_t *ic, const lws_display_colour_t *palette, size_t pdepth, lws_display_colour_t c, lws_greyscale_error_t *ectx)
 
LWS_VISIBLE LWS_EXTERN lws_display_palette_idx_t lws_display_palettize_col (const lws_surface_info_t *ic, const lws_display_colour_t *palette, size_t pdepth, lws_display_colour_t c, lws_colour_error_t *ectx)
 
LWS_VISIBLE LWS_EXTERN void lws_display_state_init (lws_display_state_t *lds, struct lws_context *ctx, int autodim_ms, int off_ms, struct lws_led_state *bl_lcs, const lws_display_t *disp)
 
LWS_VISIBLE LWS_EXTERN void lws_display_state_set_brightness (lws_display_state_t *lds, const lws_led_sequence_def_t *pwmseq)
 
LWS_VISIBLE LWS_EXTERN void lws_display_state_active (lws_display_state_t *lds)
 
LWS_VISIBLE LWS_EXTERN void lws_display_state_off (lws_display_state_t *lds)
 

Data Structure Documentation

◆ lws_box

struct lws_box

Definition at line 34 of file lws-display.h.

+ Collaboration diagram for lws_box:
Data Fields
lws_fx_t x
lws_fx_t y
lws_fx_t w
lws_fx_t h

◆ lws_surface_info

struct lws_surface_info

Definition at line 51 of file lws-display.h.

+ Collaboration diagram for lws_surface_info:
Data Fields
lws_fx_t wh_px[2]
lws_fx_t wh_mm[2]
const lws_display_colour_t * palette
size_t palette_depth
lws_surface_type_t type
uint8_t greyscale:1
uint8_t partial:1

◆ lws_greyscale_error

struct lws_greyscale_error

Definition at line 61 of file lws-display.h.

+ Collaboration diagram for lws_greyscale_error:
Data Fields
int16_t rgb[1]

◆ lws_colour_error

struct lws_colour_error

Definition at line 65 of file lws-display.h.

+ Collaboration diagram for lws_colour_error:
Data Fields
int16_t rgb[3]

◆ lws_surface_error_t

union lws_surface_error_t

Definition at line 69 of file lws-display.h.

+ Collaboration diagram for lws_surface_error_t:
Data Fields
lws_greyscale_error_t grey
lws_colour_error_t colour

◆ lws_display_state

struct lws_display_state

Definition at line 138 of file lws-display.h.

+ Collaboration diagram for lws_display_state:
Data Fields
lws_sorted_usec_list_t sul_autodim
char current_url[96]
const lws_display_t * disp
struct lws_context * ctx
void * priv
int autodim_ms
int off_ms
struct lws_led_state * bl_lcs
lws_led_state_chs_t chs
enum lws_display_controller_state state
char display_busy

Typedef Documentation

◆ lws_display_list_coord_t

typedef int16_t lws_display_list_coord_t

Definition at line 28 of file lws-display.h.

◆ lws_display_scalar

typedef uint16_t lws_display_scalar

Definition at line 29 of file lws-display.h.

◆ lws_display_rotation_t

typedef uint16_t lws_display_rotation_t

Definition at line 30 of file lws-display.h.

◆ lws_display_colour_t

typedef uint32_t lws_display_colour_t

Definition at line 31 of file lws-display.h.

◆ lws_display_palette_idx_t

typedef uint16_t lws_display_palette_idx_t

Definition at line 32 of file lws-display.h.

◆ lws_box_t

typedef struct lws_box lws_box_t

◆ lws_surface_info_t

◆ lws_greyscale_error_t

◆ lws_colour_error_t

◆ lws_display_t

typedef struct lws_display lws_display_t

◆ lws_display_state_t

◆ lws_display_completion_t

typedef int(* lws_display_completion_t) (lws_display_state_t *lds, int a)

Definition at line 164 of file lws-display.h.

Enumeration Type Documentation

◆ lws_surface_type_t

Enumerator
LWSSURF_TRUECOLOR32 
LWSSURF_565 
LWSSURF_PALETTE 
LWSSURF_QUANTIZED_4BPP 

Definition at line 44 of file lws-display.h.

44  {
lws_surface_type_t
Definition: lws-display.h:44
@ LWSSURF_QUANTIZED_4BPP
Definition: lws-display.h:48
@ LWSSURF_565
Definition: lws-display.h:46
@ LWSSURF_TRUECOLOR32
Definition: lws-display.h:45
@ LWSSURF_PALETTE
Definition: lws-display.h:47

◆ lws_display_controller_state

Enumerator
LWSDISPS_OFF 
LWSDISPS_AUTODIMMED 
LWSDISPS_BECOMING_ACTIVE 
LWSDISPS_ACTIVE 
LWSDISPS_GOING_OFF 

Definition at line 130 of file lws-display.h.

130  {
131  LWSDISPS_OFF,
132  LWSDISPS_AUTODIMMED, /* is in pre- blanking static dim mode */
133  LWSDISPS_BECOMING_ACTIVE, /* waiting for wake latency before active */
134  LWSDISPS_ACTIVE, /* is active */
135  LWSDISPS_GOING_OFF /* dimming then off */
136 };
@ LWSDISPS_AUTODIMMED
Definition: lws-display.h:132
@ LWSDISPS_ACTIVE
Definition: lws-display.h:134
@ LWSDISPS_OFF
Definition: lws-display.h:131
@ LWSDISPS_BECOMING_ACTIVE
Definition: lws-display.h:133
@ LWSDISPS_GOING_OFF
Definition: lws-display.h:135

Function Documentation

◆ lws_surface_set_px()

LWS_VISIBLE LWS_EXTERN void lws_surface_set_px ( const lws_surface_info_t ic,
uint8_t *  line,
int  x,
const lws_display_colour_t c 
)

◆ lws_display_palettize_grey()

LWS_VISIBLE LWS_EXTERN lws_display_palette_idx_t lws_display_palettize_grey ( const lws_surface_info_t ic,
const lws_display_colour_t palette,
size_t  pdepth,
lws_display_colour_t  c,
lws_greyscale_error_t ectx 
)

◆ lws_display_palettize_col()

LWS_VISIBLE LWS_EXTERN lws_display_palette_idx_t lws_display_palettize_col ( const lws_surface_info_t ic,
const lws_display_colour_t palette,
size_t  pdepth,
lws_display_colour_t  c,
lws_colour_error_t ectx 
)

◆ lws_display_state_init()

LWS_VISIBLE LWS_EXTERN void lws_display_state_init ( lws_display_state_t lds,
struct lws_context *  ctx,
int  autodim_ms,
int  off_ms,
struct lws_led_state *  bl_lcs,
const lws_display_t disp 
)

lws_display_state_init() - initialize display states

Parameters
ldsthe display state object
ctxthe lws context
autodim_msms since last active report to dim display (<0 = never)
off_msms since dim to turn display off (<0 = never)
bl_lcsthe led controller instance that has the backlight
dispgeneric display object we belong to

This initializes a display's state, and sets up the optional screen auto-dim and blanking on inactive, and gradual brightness change timer.

  • auto-dim then off: set autodim to some ms and off_ms to some ms
  • auto-dim only: set autodim to some ms and off_ms to -1
  • off-only: set autodim to some ms and off_ms to 0
  • neither: set both autodim and off_ms to -1

◆ lws_display_state_set_brightness()

LWS_VISIBLE LWS_EXTERN void lws_display_state_set_brightness ( lws_display_state_t lds,
const lws_led_sequence_def_t pwmseq 
)

lws_display_state_set_brightness() - gradually change the brightness

Parameters
ldsthe display state we are changing
targetthe target brightness to transition to

Adjusts the brightness gradually twoards the target at 20Hz

◆ lws_display_state_active()

LWS_VISIBLE LWS_EXTERN void lws_display_state_active ( lws_display_state_t lds)

◆ lws_display_state_off()

LWS_VISIBLE LWS_EXTERN void lws_display_state_off ( lws_display_state_t lds)