4.9 LCD Display APIs
The LCD is initialized at start-up by calling the function “status_code_t DisplayInit(void)”. This initialization function must be called before sending data to the LCD display.
When initialized, “void DisplaySetTimerLoop(uint32_t time_sec)” allows the timer to be set for the automatic scroll of the display. “void DisplayAddLoopInfo(display_info_t info)” is used to define what content will be shown in the display. Example:
/* Init LCD */
DisplayInit();
/* Configure display time loop */
DisplaySetTimerLoop(3);
/* Configure display measurements */
DisplayAddLoopInfo(DISPLAY_BOARD_ID);
DisplayAddLoopInfo(DISPLAY_VERSION);
DisplayAddLoopInfo(DISPLAY_TOTAL_ENERGY);
DisplayAddLoopInfo(DISPLAY_TOU1_ENERGY);
DisplayAddLoopInfo(DISPLAY_TOU2_ENERGY);
DisplayAddLoopInfo(DISPLAY_TOU3_ENERGY);
DisplayAddLoopInfo(DISPLAY_TOU4_ENERGY);
DisplayAddLoopInfo(DISPLAY_RTC_TIME);
DisplayAddLoopInfo(DISPLAY_RTC_DATE);
DisplayAddLoopInfo(DISPLAY_VA_RMS);
DisplayAddLoopInfo(DISPLAY_VB_RMS);
DisplayAddLoopInfo(DISPLAY_VC_RMS);
DisplayAddLoopInfo(DISPLAY_IA_RMS);
DisplayAddLoopInfo(DISPLAY_IB_RMS);
DisplayAddLoopInfo(DISPLAY_IC_RMS);
Refer to the folder /components/display/cl010, containing all the drivers needed to manage the display. Examples of functions that can be used:
- status_code_t cl010_init(void)
- void cl010_show_numeric_string(enum cl010_line disp_line, const uint8_t *data)
- void cl010_clear_icon(uint8_t icon_com, uint8_t icon_seg)
- void cl010_show_icon(uint8_t icon_com, uint8_t icon_seg)
- void cl010_blink_screen(bool inverted)
- void cl010_blink_disable(void)
- void cl010_show_all(void)
- void cl010_clear_all(void)
- void cl010_show_numeric_value(enum cl010_line disp_line, int32_t value)
- void cl010_show_units(enum cl010_unit disp_unit)
- void cl010_clear_units(void)