Kernel module for ST7565 based displays

Today I pushed kernel module driving ST7565 based displays to my github. I wanted to write kernel module some time ago and st7565 was first thing i thought of. Unfortunately I hadn’t enough motivation and when I got some I burnt my display 🙁 so it wasn’t done. This autumn I had other chance to make it real, because I started embedded systems course on university. And there it is: I’ve got working kernel module that can handle graphic LCD.

The module itself is fairly universal. Nevertheless I don’t know any existing gLCD driver that was included to the mainline kernel so have no idea how that thing should look. Because of that I implemented it as char device. It is storing bare pixel data so there aren’t any sophisticated functions to draw rectangle or something. Its advantages are that it isn’t limiting applications the module can be used to and make any userspace handling function very easy to write. It is also worth to note that the module is providing possibility to read data from buffer which is impossible in the module itself.

Beside that basic functionality it allows to switch off backlight and change brightness using sysfs attributes. The module is also portable thanks to possibility to change CS, A0, RST and backlight pin it is using so you are not tied to the ones I used and reconfiguration does not force you to recompile but just reload the module with different parameters. The exact scheme of the connection more or less is the same as on my previous approach to playing with that display.

PS: there is also new revision of my tool for font-making for that display. Now it is able to create any picture as long as its height is divisible by 8 (it is just simplification, made because of method of storing pixels). You can always implement algorithm that is OR-ing the picture with part of data that is already on display (of course using my module 🙂 ). It is still available on Gist.

Posted in Uncategorized | Tagged , , , , , , | Leave a comment