Automatic Datasheet to Driver conversion with AI

This is not an LVGL project, but is related as it can be used to write drivers for LCDs and TSCs.
The idea is to give an entire datasheet to an LLM and ask it to create the driver. As simply as it sounds, and Im posting it here cause it works.
Here is a diagram:


First, the datasheet is converted to text (markdown) with a python library and then the user request as well as the md is feed to the LLM (I just tested wiht Claude 3.7) and you simply need to wait 5 min to get your driver as response.

To make it simpler, I created a simply qt gui app:

Here is the python application, an Anthropic API key is required, and if you have it, you can do the same in their “Anthorpic console” rather than using this app.
datasheet2driver.py (15.8 KB)

Here are some results form an accelerometer datasheet
demo_qmi8658c.zip (9.8 KB)

The cost is less than 1$ per driver, but as Im testing it, is someone needs a driver for any kind of device write it here the device Part Number, the language and the platform and I will generate it for fun and science!

2 Likes

It’s fantastic! How many modifications were required in the generated driver to really make it work?

From what I’ve tried, very few, if any. The API is always fine, as are the registers with their addresses, values, etc. There may be bugs since it’s code that’s never been used or tested, but it’s still infinitely faster than starting from scratch.

1 Like