2018-04-13 03:14:01 +02:00
|
|
|
/**
|
|
|
|
* @file lcdprint.h
|
|
|
|
* @brief LCD print api
|
|
|
|
* @author Yunhui Fu (yhfudev@gmail.com)
|
|
|
|
* @version 1.0
|
|
|
|
* @date 2016-08-19
|
|
|
|
* @copyright GPL/BSD
|
|
|
|
*/
|
2018-10-24 09:27:19 +02:00
|
|
|
#pragma once
|
2018-04-13 03:14:01 +02:00
|
|
|
|
|
|
|
#include "fontutils.h"
|
|
|
|
|
2018-10-23 23:00:34 +02:00
|
|
|
#include "../inc/MarlinConfigPre.h"
|
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD
|
|
|
|
#include "dogm/u8g_fontutf8.h"
|
2018-04-13 03:14:01 +02:00
|
|
|
#else
|
2018-10-23 23:00:34 +02:00
|
|
|
#define _UxGT(a) a
|
2018-04-13 03:14:01 +02:00
|
|
|
#endif
|
|
|
|
|
2018-05-26 06:32:37 +02:00
|
|
|
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
|
2018-04-13 03:14:01 +02:00
|
|
|
|
|
|
|
int lcd_glyph_height(void);
|
|
|
|
|
2018-11-20 15:19:35 +01:00
|
|
|
int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length);
|
2018-04-13 03:14:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a UTF-8 string
|
|
|
|
*
|
|
|
|
* @param utf8_str : the UTF-8 string
|
|
|
|
* @param max_length : the pixel length of the string allowed (or number of slots in HD44780)
|
|
|
|
*
|
|
|
|
* @return the pixel width
|
|
|
|
*
|
|
|
|
* Draw a UTF-8 string
|
|
|
|
*/
|
2018-11-20 15:19:35 +01:00
|
|
|
int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length);
|
2018-04-13 03:14:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a ROM UTF-8 string
|
|
|
|
*
|
|
|
|
* @param utf8_str_P : the ROM UTF-8 string
|
|
|
|
* @param max_length : the pixel length of the string allowed (or number of slots in HD44780)
|
|
|
|
*
|
|
|
|
* @return the pixel width
|
|
|
|
*
|
|
|
|
* Draw a ROM UTF-8 string
|
|
|
|
*/
|
2018-11-20 15:19:35 +01:00
|
|
|
int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length);
|
2018-04-13 03:14:01 +02:00
|
|
|
|
2018-11-19 03:39:49 +01:00
|
|
|
void lcd_moveto(const uint8_t col, const uint8_t row);
|
|
|
|
|
|
|
|
void lcd_put_int(const int i);
|
2018-04-13 03:14:01 +02:00
|
|
|
|
2018-11-20 15:19:35 +01:00
|
|
|
inline int lcd_put_u8str_P(PGM_P str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); }
|
2018-04-13 03:14:01 +02:00
|
|
|
|
2018-11-20 15:19:35 +01:00
|
|
|
inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
|
2018-04-13 03:14:01 +02:00
|
|
|
|
2018-11-19 03:39:49 +01:00
|
|
|
inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); }
|