WSTK LCD Driver#

The WSTK LCD Driver is an application-level software module which implements an interface for WSTK board's LCD screen usage, ensuring the uniform display of BT Mesh specific values. The interface contains an initialization and a write function. The LCD initialization is executed automatically at startup. The write interface is used to write one specified line of text to the LCD. This component is prepared for integration into SOC applications. This is a No-code component (The LCD can be enabled/disabled in the Platform/Board Control software component).

Enumerations#

enum
SL_BTMESH_LCD_LEFT_ARROW = 1 << 0
SL_BTMESH_LCD_RIGHT_ARROW = 1 << 1
SL_BTMESH_LCD_LEFT_RIGHT_ARROW = SL_BTMESH_LCD_LEFT_ARROW | SL_BTMESH_LCD_RIGHT_ARROW
}

Enumeration of possible arrows to be drawn.

Functions#

void
graphInit(char *header)

Initialize graphics stack.

sl_status_t
graphWriteString(char *string)

Display a string on the LCD center aligned.

sl_status_t
graphDrawArrow(sl_btmesh_LCD_arrow arrow)
sl_status_t
sl_status_t
sl_btmesh_LCD_write(const char *str, uint8_t row)
sl_status_t
sl_btmesh_LCD_write_paged(const char *str, uint8_t row, uint8_t page)
sl_status_t
sl_status_t
sl_status_t
sl_status_t
sl_status_t

Macros#

#define
LCD_ROW_MAX 9
#define
LCD_ROW_LEN 22

Enumeration Documentation#

sl_btmesh_LCD_arrow#

sl_btmesh_LCD_arrow

Enumeration of possible arrows to be drawn.

Enumerator
SL_BTMESH_LCD_LEFT_ARROW

Left arrow.

SL_BTMESH_LCD_RIGHT_ARROW

Right arrow.

SL_BTMESH_LCD_LEFT_RIGHT_ARROW

Left arrow and right arrow.


Function Documentation#

graphInit#

void graphInit (char * header)

Initialize graphics stack.

Parameters
TypeDirectionArgument NameDescription
char *[in]header

Header Text on display


graphWriteString#

sl_status_t graphWriteString (char * string)

Display a string on the LCD center aligned.

Parameters
TypeDirectionArgument NameDescription
char *[in]string

String to be displayed

Returns

  • Status of the command.

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_FAIL: In case of failure


graphDrawArrow#

sl_status_t graphDrawArrow (sl_btmesh_LCD_arrow arrow)
Parameters
TypeDirectionArgument NameDescription
sl_btmesh_LCD_arrow[in]arrow

Arrow to be drawn

Draw arrows on the page.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_FAIL: In case of failure


sl_btmesh_LCD_init#

sl_status_t sl_btmesh_LCD_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Initialize LCD.

Called once at startup.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_FAIL: If writing header failed


sl_btmesh_LCD_write#

sl_status_t sl_btmesh_LCD_write (const char * str, uint8_t row)
Parameters
TypeDirectionArgument NameDescription
const char *[in]str

Pointer to string which is displayed in the specified row.

uint8_t[in]row

Selects which line of LCD display is written, possible values are defined as LCD_ROW_xxx.

This function is used to write one line on the LCD.

Note

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_INVALID_PARAMETER: If row is invalid

  • SL_STATUS_FAIL: If writing failed


sl_btmesh_LCD_write_paged#

sl_status_t sl_btmesh_LCD_write_paged (const char * str, uint8_t row, uint8_t page)
Parameters
TypeDirectionArgument NameDescription
const char *[in]str

Pointer to string which is displayed in the specified row.

uint8_t[in]row

Selects which line of LCD display is written, possible values are defined as LCD_ROW_xxx.

uint8_t[in]page

Page identifier. Zero-based.

This function is used to write one line on the LCD onto the given page.

Pages are handled dynamically

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_INVALID_PARAMETER: If row is invalid

  • SL_STATUS_FAIL: If writing failed


sl_btmesh_LCD_select_page#

sl_status_t sl_btmesh_LCD_select_page (uint8_t page)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]page

Page index to display. Zero-based.

Select page to be displayed and display it.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_FAIL: If page refresh failed

  • SL_STATUS_INVALID_INDEX: If page index is out of range


sl_btmesh_LCD_next_page#

sl_status_t sl_btmesh_LCD_next_page (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Select next page to be displayed and display it.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success, or last page is displayed

  • SL_STATUS_FAIL: If page refresh failed


sl_btmesh_LCD_prev_page#

sl_status_t sl_btmesh_LCD_prev_page (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Select previous page to be displayed and display it.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success, or last page is displayed

  • SL_STATUS_FAIL: If page refresh failed


sl_btmesh_LCD_remove_page#

sl_status_t sl_btmesh_LCD_remove_page (uint8_t page)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]page

Page index to remove. Zero-based.

Remove page.

If currently displayed page is removed, display a valid one. If last page is removed, display the first one. If page is removed from before the currently displayed page refresh page so consistency is upheld.

Page 0 can't be removed.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_INVALID_INDEX: If page is out of range or 0.

  • SL_STATUS_FAIL: If page needed to be refreshed and was unsuccessful


sl_btmesh_LCD_clear_pages#

sl_status_t sl_btmesh_LCD_clear_pages (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Remove every page except the first.

Refreshes page.

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_FAIL: If page refresh is unsuccessful