2
* Copyright 2010 Sergey Poselenov, Emcraft Systems, <sposelenov@emcraft.com>
3
* Copyright 2010 Ilya Yanok, Emcraft Systems, <yanok@emcraft.com>
5
* SPDX-License-Identifier: GPL-2.0+
9
#include <led-display.h>
12
#ifdef CONFIG_CMD_DISPLAY
13
#define CWORD_CLEAR 0x80
14
#define CLEAR_DELAY (110 * 2)
15
#define DISPLAY_SIZE 8
17
static int pos; /* Current display position */
19
/* Handle different display commands */
20
void display_set(int cmd)
22
if (cmd & DISPLAY_CLEAR) {
23
out_8((unsigned char *)CONFIG_SYS_DISP_CWORD, CWORD_CLEAR);
24
udelay(1000 * CLEAR_DELAY);
27
if (cmd & DISPLAY_HOME) {
33
* Display a character at the current display position.
34
* Characters beyond the display size are ignored.
36
int display_putc(char c)
38
if (pos >= DISPLAY_SIZE)
41
out_8((unsigned char *)CONFIG_SYS_DISP_CHR_RAM + pos++, c);