Skip to content

Conversation

asp2286
Copy link

@asp2286 asp2286 commented Oct 22, 2025

Summary

  • Introduces Aip31068Lcd for AIP31068-based HD44780-compatible LCDs with integrated I2C, including adjustable contrast, icon display, and booster control.
  • Adds a runnable sample demonstrating contrast adjustments and toggles.
  • Updates README with usage and notes about the extended initialization sequence.

Details

  • New binding: src/devices/CharacterLcd/Aip31068Lcd.cs
    • Extended instruction set init (internal oscillator, follower control, contrast).
    • Public properties: Contrast (0–63), IconDisplayEnabled, BoosterEnabled.
  • Samples:
    • src/devices/CharacterLcd/samples/Aip31068Sample.cs (interactive: +/- to change contrast, B for booster, I for icons)
    • src/devices/CharacterLcd/samples/Program.cs adds UsingAip31068Lcd() hook
  • Docs:
    • src/devices/CharacterLcd/README.md adds usage snippet and device notes
  • Project:
    • src/devices/CharacterLcd/CharacterLcd.csproj includes the new file

Usage

var i2cDevice = I2cDevice.Create(new I2cConnectionSettings(busId: 1, deviceAddress: 0x3E));
using Aip31068Lcd lcd = new(i2cDevice);

lcd.Clear();
lcd.Write("Hello from AIP31068!");
lcd.Contrast = 36; // optional: tune the contrast (0-63)

Testing

  • Builds and runs with a typical 16x2 AIP31068 module (I2C 0x3E).
  • No impact to existing HD44780 bindings or samples.

Notes

  • AIP31068 requires an extended initialization sequence; the binding performs this automatically.
  • Default contrast chosen for common 16x2 displays; adjustable at runtime.

Related

Microsoft Reviewers: Open in CodeFlow

@dotnet-policy-service dotnet-policy-service bot added the area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio label Oct 22, 2025
Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good overall!


private void InitializeController()
{
EnterExtendedInstructionSet();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you point where in the documentation this can be found? Will make it easier for maintenance. Including the delay. Thanks!

private void SendContrastCommands()
{
SendCommandAndWait((byte)(ContrastSetCommand | (_contrast & 0x0F)));
byte value = (byte)(PowerIconContrastCommand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, a pointer on the doc for maintenance would definitely help!

```

AIP31068 based LCDs expose the same HD44780 compatible instruction set but require an extended
initialization sequence. The <code>Aip31068Lcd</code> binding performs the necessary configuration and allows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
initialization sequence. The <code>Aip31068Lcd</code> binding performs the necessary configuration and allows
initialization sequence. The `Aip31068Lcd` binding performs the necessary configuration and allows

@Ellerbach
Copy link
Member

azp /run

@pgrawehr
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate AIP31068 LCD support into CharacterLcd

3 participants