Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_gfx

Graphics library. More...

Data Structures

struct  bc_gfx_caps_t
 Display size. More...
 
struct  bc_gfx_driver_t
 Display driver interface. More...
 
struct  bc_gfx_t
 Instance. More...
 

Enumerations

enum  bc_gfx_rotation_t {
  BC_GFX_ROTATION_0 = 0,
  BC_GFX_ROTATION_90 = 1,
  BC_GFX_ROTATION_180 = 2,
  BC_GFX_ROTATION_270 = 3
}
 Rotation. More...
 
enum  bc_gfx_round_corner_t {
  BC_GFX_ROUND_CORNER_RIGHT_TOP = 0x01,
  BC_GFX_ROUND_CORNER_RIGHT_BOTTOM = 0x02,
  BC_GFX_ROUND_CORNER_LEFT_BOTTOM = 0x04,
  BC_GFX_ROUND_CORNER_LEFT_TOP = 0x08
}
 

Functions

void bc_gfx_init (bc_gfx_t *self, void *display, const bc_gfx_driver_t *driver)
 Initialize button. More...
 
bool bc_gfx_display_is_ready (bc_gfx_t *self)
 Check if display driver is ready for commands. More...
 
bc_gfx_caps_t bc_gfx_get_caps (bc_gfx_t *self)
 Get Display capabilities. More...
 
void bc_gfx_clear (bc_gfx_t *self)
 Clear. More...
 
void bc_gfx_set_font (bc_gfx_t *self, const bc_font_t *font)
 Set font. More...
 
void bc_gfx_set_rotation (bc_gfx_t *self, bc_gfx_rotation_t rotation)
 Set rotation. More...
 
bc_gfx_rotation_t bc_gfx_get_rotation (bc_gfx_t *self)
 Get rotation. More...
 
void bc_gfx_draw_pixel (bc_gfx_t *self, int x, int y, uint32_t color)
 Draw pixel. More...
 
int bc_gfx_draw_char (bc_gfx_t *self, int left, int top, uint8_t ch, uint32_t color)
 Display draw char. More...
 
int bc_gfx_calc_char_width (bc_gfx_t *self, uint8_t ch)
 Calc width character. More...
 
int bc_gfx_draw_string (bc_gfx_t *self, int left, int top, char *str, uint32_t color)
 Display draw string. More...
 
int bc_gfx_calc_string_width (bc_gfx_t *self, char *str)
 Calc width string. More...
 
int bc_gfx_printf (bc_gfx_t *self, int left, int top, uint32_t color, char *format,...)
 Display string. More...
 
void bc_gfx_draw_line (bc_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color)
 Display draw line. More...
 
void bc_gfx_draw_rectangle (bc_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color)
 Display draw rectangle. More...
 
void bc_gfx_draw_fill_rectangle (bc_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color)
 Display draw fill rectangle. More...
 
void bc_gfx_draw_fill_rectangle_dithering (bc_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color)
 Display draw fill rectangle with a dithering pattern defined in the color parameter. More...
 
void bc_gfx_draw_circle (bc_gfx_t *self, int x0, int y0, int radius, uint32_t color)
 Lcd draw circle, using Midpoint circle algorithm. More...
 
void bc_gfx_draw_fill_circle (bc_gfx_t *self, int x0, int y0, int radius, uint32_t color)
 Lcd draw fill circle, using Midpoint circle algorithm. More...
 
void bc_gfx_draw_round_corner (bc_gfx_t *self, int x0, int y0, int radius, bc_gfx_round_corner_t corner, uint32_t color)
 Lcd draw round corner, using Midpoint circle algorithm. More...
 
void bc_gfx_draw_fill_round_corner (bc_gfx_t *self, int x0, int y0, int radius, bc_gfx_round_corner_t corner, uint32_t color)
 Lcd draw fill round corner, using Midpoint circle algorithm. More...
 
bool bc_gfx_update (bc_gfx_t *self)
 Display update, send data. More...
 

Detailed Description

Graphics library.

Enumeration Type Documentation

Rotation.

Enumerator
BC_GFX_ROTATION_0 

Rotation 0 degrees.

BC_GFX_ROTATION_90 

Rotation 90 degrees.

BC_GFX_ROTATION_180 

Rotation 180 degrees.

BC_GFX_ROTATION_270 

Rotation 270 degrees.

Definition at line 46 of file bc_gfx.h.

Enumerator
BC_GFX_ROUND_CORNER_RIGHT_TOP 

Round corner right top.

BC_GFX_ROUND_CORNER_RIGHT_BOTTOM 

Round corner right bottom.

BC_GFX_ROUND_CORNER_LEFT_BOTTOM 

Round corner left bottom.

BC_GFX_ROUND_CORNER_LEFT_TOP 

Round corner left top.

Definition at line 62 of file bc_gfx.h.

Function Documentation

int bc_gfx_calc_char_width ( bc_gfx_t self,
uint8_t  ch 
)

Calc width character.

Parameters
[in]selfInstance
Returns
Width of printed character

Definition at line 132 of file bc_gfx.c.

Referenced by bc_gfx_calc_string_width().

Here is the caller graph for this function:

int bc_gfx_calc_string_width ( bc_gfx_t self,
char *  str 
)

Calc width string.

Parameters
[in]selfInstance
[in]*strString to be printed
Returns
Width of printed string

Definition at line 162 of file bc_gfx.c.

Here is the call graph for this function:

void bc_gfx_clear ( bc_gfx_t self)

Clear.

Parameters
[in]selfInstance

Definition at line 22 of file bc_gfx.c.

Referenced by bc_module_lcd_clear(), and bc_module_lcd_init().

Here is the caller graph for this function:

bool bc_gfx_display_is_ready ( bc_gfx_t self)

Check if display driver is ready for commands.

Parameters
[in]selfInstance
Returns
true If ready
false If not ready

Definition at line 12 of file bc_gfx.c.

Referenced by bc_module_lcd_is_ready().

Here is the caller graph for this function:

int bc_gfx_draw_char ( bc_gfx_t self,
int  left,
int  top,
uint8_t  ch,
uint32_t  color 
)

Display draw char.

Parameters
[in]selfInstance
[in]leftPixels from left edge
[in]topPixels from top edge
[in]chChar to be printed
[in]color
Returns
Width of printed character

Definition at line 86 of file bc_gfx.c.

Referenced by bc_gfx_draw_string(), and bc_module_lcd_draw_char().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_gfx_draw_circle ( bc_gfx_t self,
int  x0,
int  y0,
int  radius,
uint32_t  color 
)

Lcd draw circle, using Midpoint circle algorithm.

Parameters
[in]selfInstance
[in]x0Center - pixels from left edge
[in]y0Center - pixels from top edge
[in]radiusIn pixels
[in]color

Definition at line 313 of file bc_gfx.c.

Referenced by bc_module_lcd_draw_circle().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_gfx_draw_fill_circle ( bc_gfx_t self,
int  x0,
int  y0,
int  radius,
uint32_t  color 
)

Lcd draw fill circle, using Midpoint circle algorithm.

Parameters
[in]selfInstance
[in]x0Center - pixels from left edge
[in]y0Center - pixels from top edge
[in]radiusIn pixels
[in]color

Definition at line 348 of file bc_gfx.c.

Here is the call graph for this function:

void bc_gfx_draw_fill_rectangle ( bc_gfx_t self,
int  x0,
int  y0,
int  x1,
int  y1,
uint32_t  color 
)

Display draw fill rectangle.

Parameters
[in]selfInstance
[in]x0Pixels from left edge
[in]y0Pixels from top edge
[in]x1Pixels from left edge
[in]y1Pixels from top edge
[in]color

Definition at line 286 of file bc_gfx.c.

Here is the call graph for this function:

void bc_gfx_draw_fill_rectangle_dithering ( bc_gfx_t self,
int  x0,
int  y0,
int  x1,
int  y1,
uint32_t  color 
)

Display draw fill rectangle with a dithering pattern defined in the color parameter.

Parameters
[in]selfInstance
[in]x0Pixels from left edge
[in]y0Pixels from top edge
[in]x1Pixels from left edge
[in]y1Pixels from top edge
[in]colorDithering mask, 16 bits define bit pattern in the 4 by 4 area

Definition at line 298 of file bc_gfx.c.

Here is the call graph for this function:

void bc_gfx_draw_fill_round_corner ( bc_gfx_t self,
int  x0,
int  y0,
int  radius,
bc_gfx_round_corner_t  corner,
uint32_t  color 
)

Lcd draw fill round corner, using Midpoint circle algorithm.

Parameters
[in]selfInstance
[in]x0Center - pixels from left edge
[in]y0Center - pixels from top edge
[in]cornerposition
[in]radiusIn pixels
[in]color

Definition at line 427 of file bc_gfx.c.

Here is the call graph for this function:

void bc_gfx_draw_line ( bc_gfx_t self,
int  x0,
int  y0,
int  x1,
int  y1,
uint32_t  color 
)

Display draw line.

Parameters
[in]selfInstance
[in]x0Pixels from left edge
[in]y0Pixels from top edge
[in]x1Pixels from left edge
[in]y1Pixels from top edge
[in]color

Definition at line 188 of file bc_gfx.c.

Referenced by bc_gfx_draw_fill_circle(), bc_gfx_draw_fill_round_corner(), bc_gfx_draw_rectangle(), and bc_module_lcd_draw_line().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_gfx_draw_pixel ( bc_gfx_t self,
int  x,
int  y,
uint32_t  color 
)

Draw pixel.

Parameters
[in]selfInstance
[in]leftPixels from left edge
[in]topPixels from top edge
[in]color

Definition at line 42 of file bc_gfx.c.

Referenced by bc_gfx_draw_char(), bc_gfx_draw_circle(), bc_gfx_draw_fill_rectangle(), bc_gfx_draw_fill_rectangle_dithering(), bc_gfx_draw_line(), bc_gfx_draw_round_corner(), bc_module_lcd_draw_image(), and bc_module_lcd_draw_pixel().

Here is the caller graph for this function:

void bc_gfx_draw_rectangle ( bc_gfx_t self,
int  x0,
int  y0,
int  x1,
int  y1,
uint32_t  color 
)

Display draw rectangle.

Parameters
[in]selfInstance
[in]x0Pixels from left edge
[in]y0Pixels from top edge
[in]x1Pixels from left edge
[in]y1Pixels from top edge
[in]color

Definition at line 278 of file bc_gfx.c.

Referenced by bc_module_lcd_draw_rectangle().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_gfx_draw_round_corner ( bc_gfx_t self,
int  x0,
int  y0,
int  radius,
bc_gfx_round_corner_t  corner,
uint32_t  color 
)

Lcd draw round corner, using Midpoint circle algorithm.

Parameters
[in]selfInstance
[in]x0Center - pixels from left edge
[in]y0Center - pixels from top edge
[in]cornerposition
[in]radiusIn pixels
[in]color

Definition at line 378 of file bc_gfx.c.

Here is the call graph for this function:

int bc_gfx_draw_string ( bc_gfx_t self,
int  left,
int  top,
char *  str,
uint32_t  color 
)

Display draw string.

Parameters
[in]selfInstance
[in]leftPixels from left edge
[in]topPixels from top edge
[in]*strString to be printed
[in]color
Returns
Width of printed string

Definition at line 152 of file bc_gfx.c.

Referenced by bc_gfx_printf(), and bc_module_lcd_draw_string().

Here is the call graph for this function:

Here is the caller graph for this function:

bc_gfx_caps_t bc_gfx_get_caps ( bc_gfx_t self)

Get Display capabilities.

Parameters
[in]selfInstance

Definition at line 17 of file bc_gfx.c.

bc_gfx_rotation_t bc_gfx_get_rotation ( bc_gfx_t self)

Get rotation.

Parameters
[in]selfInstance
Returns
Rotation of display

Definition at line 37 of file bc_gfx.c.

Referenced by bc_module_lcd_get_rotation().

Here is the caller graph for this function:

void bc_gfx_init ( bc_gfx_t self,
void *  display,
const bc_gfx_driver_t driver 
)

Initialize button.

Parameters
[in]selfInstance

Definition at line 3 of file bc_gfx.c.

Referenced by bc_module_lcd_init().

Here is the caller graph for this function:

int bc_gfx_printf ( bc_gfx_t self,
int  left,
int  top,
uint32_t  color,
char *  format,
  ... 
)

Display string.

Parameters
[in]selfInstance
[in]leftPixels from left edge
[in]topPixels from top edge
[in]color
[in]formatFormat string (printf style)
[in]...Optional format arguments
Returns
Width of printed string

Definition at line 173 of file bc_gfx.c.

Here is the call graph for this function:

void bc_gfx_set_font ( bc_gfx_t self,
const bc_font_t font 
)

Set font.

Parameters
[in]selfInstance
[in]*fontFont

Definition at line 27 of file bc_gfx.c.

Referenced by bc_module_lcd_set_font().

Here is the caller graph for this function:

void bc_gfx_set_rotation ( bc_gfx_t self,
bc_gfx_rotation_t  rotation 
)

Set rotation.

Parameters
[in]selfInstance
[in]rotationRotation of diplay

Definition at line 32 of file bc_gfx.c.

Referenced by bc_module_lcd_set_rotation().

Here is the caller graph for this function:

bool bc_gfx_update ( bc_gfx_t self)

Display update, send data.

Parameters
[in]selfInstance
Returns
true On success
false On failure

Definition at line 476 of file bc_gfx.c.

Referenced by bc_module_lcd_update().

Here is the caller graph for this function: