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.
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 }
ConfigBus core definitions.
Generic ConfigBus API.
Definition: cfgbus_core.h:124
Adapter for connecting log::Log messages to a TextLcd object.
void log_event(s8 priority, unsigned nbytes, const char *msg) override
Callback for each formatted Log message.
Interface driver for the cfgbus_uart block.
void write(const char *msg)
Write a string to the display (max 32 characters).
TextLcd(satcat5::cfg::ConfigBus *cfg, unsigned devaddr, unsigned regaddr=0)
Link this LCD controller to a ConfigBus address.
void clear()
Reset and clear display.
Pointer-like wrapper for one or more ConfigBus registers.
Definition: cfgbus_core.h:76
Defines the interface for accepting Log messages.
Definition: log.h:72
Diagnostic logging to UART and/or Ethernet ports.