SatCat5
cfgbus_text_lcd.h
1
// Copyright 2022-2025 The Aerospace Corporation.
3
// This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5
// Interface driver for the cfgbus_uart block
6
7
#pragma once
8
9
#include <
satcat5/cfgbus_core.h
>
10
#include <
satcat5/log.h
>
11
12
namespace
satcat5 {
13
namespace
cfg {
16
class
TextLcd
{
17
public
:
19
TextLcd
(
satcat5::cfg::ConfigBus
* cfg,
unsigned
devaddr,
unsigned
regaddr = 0);
20
22
void
clear
();
23
25
void
write
(
const
char
* msg);
26
27
private
:
28
// Interface control register.
29
satcat5::cfg::Register
m_ctrl;
30
};
31
33
class
LogToLcd
final :
public
satcat5::log::EventHandler
{
34
public
:
35
explicit
LogToLcd
(
satcat5::cfg::TextLcd
* lcd);
36
void
log_event
(s8 priority,
unsigned
nbytes,
const
char
* msg)
override
;
37
protected
:
38
satcat5::cfg::TextLcd
*
const
m_lcd;
39
};
40
}
41
}
cfgbus_core.h
ConfigBus core definitions.
satcat5::cfg::ConfigBus
Generic ConfigBus API.
Definition:
cfgbus_core.h:124
satcat5::cfg::LogToLcd
Adapter for connecting log::Log messages to a TextLcd object.
Definition:
cfgbus_text_lcd.h:33
satcat5::cfg::LogToLcd::log_event
void log_event(s8 priority, unsigned nbytes, const char *msg) override
Callback for each formatted Log message.
Definition:
cfgbus_text_lcd.cc:40
satcat5::cfg::TextLcd
Interface driver for the cfgbus_uart block.
Definition:
cfgbus_text_lcd.h:16
satcat5::cfg::TextLcd::write
void write(const char *msg)
Write a string to the display (max 32 characters).
Definition:
cfgbus_text_lcd.cc:23
satcat5::cfg::TextLcd::TextLcd
TextLcd(satcat5::cfg::ConfigBus *cfg, unsigned devaddr, unsigned regaddr=0)
Link this LCD controller to a ConfigBus address.
Definition:
cfgbus_text_lcd.cc:11
satcat5::cfg::TextLcd::clear
void clear()
Reset and clear display.
Definition:
cfgbus_text_lcd.cc:17
satcat5::cfg::WrappedRegisterPtr
Pointer-like wrapper for one or more ConfigBus registers.
Definition:
cfgbus_core.h:76
satcat5::log::EventHandler
Defines the interface for accepting Log messages.
Definition:
log.h:72
log.h
Diagnostic logging to UART and/or Ethernet ports.
src
cpp
satcat5
cfgbus_text_lcd.h
Generated by
1.9.1
Copyright 2024 The Aerospace Corporation. This documentation is a part of SatCat5, licensed under CERN-OHL-W v2 or later.