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

Driver for lcd. More...

Enumerations

enum  bc_module_lcd_event_t {
  BC_MODULE_LCD_EVENT_LEFT_PRESS = 0x10 | BC_BUTTON_EVENT_PRESS,
  BC_MODULE_LCD_EVENT_LEFT_RELEASE = 0x10 | BC_BUTTON_EVENT_RELEASE,
  BC_MODULE_LCD_EVENT_LEFT_CLICK = 0x10 | BC_BUTTON_EVENT_CLICK,
  BC_MODULE_LCD_EVENT_LEFT_HOLD = 0x10 | BC_BUTTON_EVENT_HOLD,
  BC_MODULE_LCD_EVENT_RIGHT_PRESS = 0x20 | BC_BUTTON_EVENT_PRESS,
  BC_MODULE_LCD_EVENT_RIGHT_RELEASE = 0x20 | BC_BUTTON_EVENT_RELEASE,
  BC_MODULE_LCD_EVENT_RIGHT_CLICK = 0x20 | BC_BUTTON_EVENT_CLICK,
  BC_MODULE_LCD_EVENT_RIGHT_HOLD = 0x20 | BC_BUTTON_EVENT_HOLD,
  BC_MODULE_LCD_EVENT_BOTH_HOLD = 0x30 | BC_BUTTON_EVENT_HOLD
}
 Callback events.
 
enum  bc_module_lcd_rotation_t {
  BC_MODULE_LCD_ROTATION_0 = BC_GFX_ROTATION_0,
  BC_MODULE_LCD_ROTATION_90 = BC_GFX_ROTATION_90,
  BC_MODULE_LCD_ROTATION_180 = BC_GFX_ROTATION_180,
  BC_MODULE_LCD_ROTATION_270 = BC_GFX_ROTATION_270
}
 Rotation. More...
 
enum  bc_module_lcd_led_t {
  BC_MODULE_LCD_LED_RED = 0,
  BC_MODULE_LCD_LED_GREEN = 1,
  BC_MODULE_LCD_LED_BLUE = 2
}
 Virtual LED channels. More...
 
enum  bc_module_lcd_button_t {
  BC_MODULE_LCD_BUTTON_LEFT = 0,
  BC_MODULE_LCD_BUTTON_RIGHT = 1
}
 Virtual button channels. More...
 

Functions

void bc_module_lcd_init ()
 Initialize lcd.
 
bc_gfx_tbc_module_lcd_get_gfx ()
 Get gfx instance.
 
bool bc_module_lcd_on (void)
 Lcd on. More...
 
bool bc_module_lcd_off (void)
 Lcd off. More...
 
bool bc_module_lcd_is_ready (void)
 Check if lcd is ready for commands. More...
 
void bc_module_lcd_clear (void)
 Lcd clear.
 
void bc_module_lcd_draw_pixel (int left, int top, bool color)
 Lcd draw pixel. More...
 
int bc_module_lcd_draw_char (int left, int top, uint8_t ch, bool color)
 Lcd draw char. More...
 
int bc_module_lcd_draw_string (int left, int top, char *str, bool color)
 Lcd draw string. More...
 
void bc_module_lcd_draw_line (int x0, int y0, int x1, int y1, bool color)
 Lcd draw line. More...
 
void bc_module_lcd_draw_rectangle (int x0, int y0, int x1, int y1, bool color)
 Lcd draw rectangle. More...
 
void bc_module_lcd_draw_circle (int x0, int y0, int radius, bool color)
 Lcd draw circle. More...
 
void bc_module_lcd_draw_image (int left, int top, const bc_image_t *img)
 Lcd draw image. More...
 
bool bc_module_lcd_update (void)
 Lcd update, send data. More...
 
void bc_module_lcd_set_font (const bc_font_t *font)
 Lcd set font. More...
 
void bc_module_lcd_set_rotation (bc_module_lcd_rotation_t rotation)
 Lcd set rotation. More...
 
void bc_module_lcd_set_event_handler (void(*event_handler)(bc_module_lcd_event_t, void *), void *event_param)
 Lcd set event handler for buttons. More...
 
bc_module_lcd_rotation_t bc_module_lcd_get_rotation (void)
 Lcd get rotation. More...
 
const bc_led_driver_tbc_module_lcd_get_led_driver (void)
 Lcd get led driver. More...
 
const bc_button_driver_tbc_module_lcd_get_button_driver (void)
 Lcd get button driver. More...
 
void bc_module_lcd_set_button_hold_time (bc_tick_t hold_time)
 Set hold time (interval after which hold event is recognized when button is steadily pressed) More...
 
void bc_module_lcd_set_button_scan_interval (bc_tick_t scan_interval)
 Set scan interval (period of button input sampling) More...
 
void bc_module_lcd_set_button_debounce_time (bc_tick_t debounce_time)
 Set debounce time (minimum sampling interval during which input cannot change to toggle its state) More...
 
void bc_module_lcd_set_button_click_timeout (bc_tick_t click_timeout)
 Set click timeout (maximum interval within which button has to be released to recognize click event) More...
 

Detailed Description

Driver for lcd.

Enumeration Type Documentation

Virtual button channels.

Enumerator
BC_MODULE_LCD_BUTTON_LEFT 

LCD left button channel.

BC_MODULE_LCD_BUTTON_RIGHT 

LCD right button channel.

Definition at line 69 of file bc_module_lcd.h.

Virtual LED channels.

Enumerator
BC_MODULE_LCD_LED_RED 

LCD red LED channel.

BC_MODULE_LCD_LED_GREEN 

LCD green LED channel.

BC_MODULE_LCD_LED_BLUE 

LCD blue LED channel.

Definition at line 54 of file bc_module_lcd.h.

Rotation.

Enumerator
BC_MODULE_LCD_ROTATION_0 

LCD rotation 0 degrees.

BC_MODULE_LCD_ROTATION_90 

LCD rotation 90 degrees.

BC_MODULE_LCD_ROTATION_180 

LCD rotation 180 degrees.

BC_MODULE_LCD_ROTATION_270 

LCD rotation 270 degrees.

Definition at line 36 of file bc_module_lcd.h.

Function Documentation

int bc_module_lcd_draw_char ( int  left,
int  top,
uint8_t  ch,
bool  color 
)

Lcd draw char.

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

Definition at line 105 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_draw_circle ( int  x0,
int  y0,
int  radius,
bool  color 
)

Lcd draw circle.

Parameters
[in]x0Center - pixels from left edge
[in]y0Center - pixels from top edge
[in]radiusIn pixels
[in]colorPixels state

Definition at line 139 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_draw_image ( int  left,
int  top,
const bc_image_t img 
)

Lcd draw image.

Parameters
[in]leftPixels from left edge
[in]topPixels from top edge
[in]imgPointer to the image

Definition at line 144 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_draw_line ( int  x0,
int  y0,
int  x1,
int  y1,
bool  color 
)

Lcd draw line.

Parameters
[in]x0Pixels from left edge
[in]y0Pixels from top edge
[in]x1Pixels from left edge
[in]y1Pixels from top edge
[in]colorPixels state

Definition at line 129 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_draw_pixel ( int  left,
int  top,
bool  color 
)

Lcd draw pixel.

Parameters
[in]leftPixels from left edge
[in]topPixels from top edge
[in]colorPixels state

Definition at line 100 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_draw_rectangle ( int  x0,
int  y0,
int  x1,
int  y1,
bool  color 
)

Lcd draw rectangle.

Parameters
[in]x0Pixels from left edge
[in]y0Pixels from top edge
[in]x1Pixels from left edge
[in]y1Pixels from top edge
[in]colorPixels state

Definition at line 134 of file bc_module_lcd.c.

Here is the call graph for this function:

int bc_module_lcd_draw_string ( int  left,
int  top,
char *  str,
bool  color 
)

Lcd draw string.

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

Definition at line 110 of file bc_module_lcd.c.

Here is the call graph for this function:

const bc_button_driver_t* bc_module_lcd_get_button_driver ( void  )

Lcd get button driver.

Returns
Driver for onboard button

Definition at line 302 of file bc_module_lcd.c.

Referenced by bc_module_lcd_set_event_handler().

Here is the caller graph for this function:

const bc_led_driver_t* bc_module_lcd_get_led_driver ( void  )

Lcd get led driver.

Returns
Driver for onboard led

Definition at line 290 of file bc_module_lcd.c.

bc_module_lcd_rotation_t bc_module_lcd_get_rotation ( void  )

Lcd get rotation.

Returns
Rotation of display

Definition at line 285 of file bc_module_lcd.c.

Here is the call graph for this function:

bool bc_module_lcd_is_ready ( void  )

Check if lcd is ready for commands.

Returns
true If ready
false If not ready

Definition at line 90 of file bc_module_lcd.c.

Here is the call graph for this function:

bool bc_module_lcd_off ( void  )

Lcd off.

Returns
true On success
false On failure

Definition at line 85 of file bc_module_lcd.c.

Here is the call graph for this function:

bool bc_module_lcd_on ( void  )

Lcd on.

Returns
true On success
false On failure

Definition at line 80 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_button_click_timeout ( bc_tick_t  click_timeout)

Set click timeout (maximum interval within which button has to be released to recognize click event)

Parameters
[in]click_timeoutDesired click timeout in ticks

Definition at line 274 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_button_debounce_time ( bc_tick_t  debounce_time)

Set debounce time (minimum sampling interval during which input cannot change to toggle its state)

Parameters
[in]debounce_timeDesired debounce time in ticks

Definition at line 268 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_button_hold_time ( bc_tick_t  hold_time)

Set hold time (interval after which hold event is recognized when button is steadily pressed)

Parameters
[in]hold_timeDesired hold time in ticks

Definition at line 256 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_button_scan_interval ( bc_tick_t  scan_interval)

Set scan interval (period of button input sampling)

Parameters
[in]scan_intervalDesired scan interval in ticks

Definition at line 262 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_event_handler ( void(*)(bc_module_lcd_event_t, void *)  event_handler,
void *  event_param 
)

Lcd set event handler for buttons.

Parameters
[in]event_handlerEvent handler
[in]event_paramEvent parameter

Definition at line 242 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_font ( const bc_font_t font)

Lcd set font.

Parameters
[in]*fontFont

Definition at line 174 of file bc_module_lcd.c.

Here is the call graph for this function:

void bc_module_lcd_set_rotation ( bc_module_lcd_rotation_t  rotation)

Lcd set rotation.

Parameters
[in]rotationRotation of diplay

Definition at line 280 of file bc_module_lcd.c.

Here is the call graph for this function:

bool bc_module_lcd_update ( void  )

Lcd update, send data.

Returns
true On success
false On failure

Definition at line 169 of file bc_module_lcd.c.

Here is the call graph for this function: