This project is a minimal Livt application that uses the Uart package to send a fixed "Hello, World!" message over UART.
The project defines a single component, UartHelloApp, in src/UartHelloApp.lvt. It imports Livt.IO, instantiates Uart, and exposes a SendHelloWorld() method that queues "Hello, World!" for transmission.
namespace Livt.App
using Livt.IO
component UartHelloApp
{
uart: Uart
new(rx: in logic, tx: out logic)
{
this.uart = new Uart(rx, tx)
}
public fn SendHelloWorld() bool
{
var helloWorld = "Hello, World!".Encode()
return this.uart.Send(helloWorld)
}
}
The Uart dependency is declared in livt.toml and resolved by the Livt package manager. Its source code is hosted in the livt-uart GitHub repository. The package currently provides these main components:
UartBufferedUartUartBaseUartReceiverUartTransmitterLoopbackUart
.
├── .gitignore
├── src/
│ └── UartHelloApp.lvt
├── tests/
│ └── UartHelloAppTest.lvt
├── LICENSE
├── livt.toml
└── README.md
The Livt package configuration lives in livt.toml:
- Project name:
UartHelloApp - Source path:
src - Output directory:
out - Test path:
tests - Test component:
UartHelloAppTest - Dependency:
Uart = "1.0.0"
When dependencies are resolved, the Livt package manager fetches the declared Uart package version and makes it available to the application.
By default, the Uart package uses TICKS_PER_BIT = 868 in both the receiver and transmitter. That corresponds to 115200 baud with a 100 MHz clock, so this example assumes those default timing settings unless you reconfigure the dependency.
Build the package with:
livt buildRun the test suite with:
livt testThe current test component is tests/UartHelloAppTest.lvt. It instantiates UartHelloApp in loopback mode, sends the demo message, waits for transmission to complete, and verifies that the received bytes match the expected payload.
Instantiate UartHelloApp with UART RX and TX signals, then call SendHelloWorld() when you want to queue the demo message for transmission through Uart. The method returns true when the full message was accepted for transmission and false if there is not enough transmit space.
This repository is an application-level example, not a UART implementation. The UART functionality is provided by the external Uart dependency package.
This project is licensed under the MIT License. See LICENSE.