* (C) Copyright 2023 Dzmitry Sankouski <dsankouski@gmail.com>
*/
+#include <charset.h>
+#include <config.h>
+
#define FLIPPED_DIRECTION 1
#define NORMAL_DIRECTION 0
int fill_char_horizontally(uchar *pfont, void **line, struct video_priv *vid_priv,
struct video_fontdata *fontdata, bool direction);
+/**
+ * draw_cursor_vertically() - Draw a simple vertical cursor
+ *
+ * @line: pointer to framebuffer buffer: upper left cursor corner
+ * @vid_priv: driver private data
+ * @height: height of the cursor in pixels
+ * @param direction controls cursor orientation. Can be normal or flipped.
+ * When normal: When flipped:
+ *|-----------------------------------------------|
+ *| * | line stepping |
+ *| ^ * * * * * | | |
+ *| | * * | v * * |
+ *| | | * * * * * |
+ *| line stepping | * |
+ *| | |
+ *| stepping -> | <<- stepping |
+ *|---!!we're starting from upper left char corner|
+ *|-----------------------------------------------|
+ *
+ * Return: 0, if success, or else error code.
+ */
+int draw_cursor_vertically(void **line, struct video_priv *vid_priv,
+ uint height, bool direction);
+
/**
* console probe function.
*
* See details in video_console.h select_font function
**/
int console_simple_select_font(struct udevice *dev, const char *name, uint size);
+
+/**
+ * Internal function to convert Unicode code points to code page 437.
+ * Used by video consoles using bitmap fonts.
+ *
+ * @param codepoint Unicode code point
+ * @returns code page 437 character.
+ */
+static inline u8 console_utf_to_cp437(int codepoint)
+{
+ if (CONFIG_IS_ENABLED(CHARSET)) {
+ utf_to_cp(&codepoint, codepage_437);
+ return codepoint;
+ }
+ return codepoint;
+}