A lightweight, header-only C++11 library for controlling LCD displays based on the UC1677C controller by the I2C interface. Designed specifically for resource-constrained embedded systems.
- Header-only: No complex build system required, just include the header.
- C++11 Standard: Efficient code without unnecessary overhead.
- Supported Modules: Full compatibility with CGS164A00 and CGS214A06 displays.
- Cross-Compiler Support: Tested with
msp430-elf-g++andavr-gcc.
- A compiler with C++11 support or higher.
- A configured communication interface I2C on your target MCU.
Since this is a header-only library, no installation is needed:
-
Copy the
include/directory into your project. -
Include in your source code:
#include "cgs164a00.hpp"
or:
#include "cgs164a00.hpp"
The library is template-based, meaning you must provide an I2C implementation as a template parameter. This allows for zero-overhead abstraction and easy porting between different MCUs (MSP430, AVR, etc.).
Your I2C provider must be a struct with the following static methods:
struct MyI2C {
static void init() {
/* Initialize I2C hardware */
}
static void start_transmission(uint8_t byte) {
/* Send START condition and device address */
}
static void end_transmission() {
/* Send END condition */
}
static bool write_byte(uint8_t byte) {
/* Send byte and return true if ACK received */
return true;
}
static uint8_t read_byte() {
/* Read byte from bus */
return 0x00;
}
};The library includes ready-to-use examples located in the /examples folder:
Located in /examples/msp430. These examples use a Makefile for automated building.
- Compiler:
msp430-elf-g++ - How to run: Navigate to the folder and run
GCC_PATH='path_to_msp430_gcc' make. For exampleGCC_PATH=/opt/ti/msp430-gcc make
Located in /examples/arduino. Every example provided as a standard .ino file.
- Environment: Arduino IDE or PlatformIO.
- Hardware: Any ATmega-based board (e.g., Arduino Nano/Uno).
- How to run: Open the
.inofile in Arduino IDE and click Upload.
#include "cgs164a00.hpp"
using Lcd = uc1677c::Cgs164a00<MyI2C>;
Lcd lcd;
int main()
{
lcd.init();
lcd.print(Lcd::CharacterStrings::main, "uc1677c");
lcd.update();
return 0;
}This project is licensed under the MIT License.