Commit Graph

7 Commits

Author SHA1 Message Date
Markus Hitter da0d5aec2c Display: add support for the HD44780 display.
All in one chunk because the infrastructure is already there.
This also implements the parallel 4-bit bus used by quite some
displays.

For now you have to add quite a number of #defines to your
config.h. First, there are all the pins required, pin names
changed to your actual board/display connection, of course:

  #define DISPLAY_RS_PIN       PC1
  #define DISPLAY_RW_PIN       PC0
  #define DISPLAY_E_PIN        PD2
  #define DISPLAY_D4_PIN       PD3
  #define DISPLAY_D5_PIN       PD4
  #define DISPLAY_D6_PIN       PD5
  #define DISPLAY_D7_PIN       PD6

And then the information about the display actually existing:

  #define DISPLAY_BUS_4BIT
  #define DISPLAY_TYPE_HD44780

Allowing to do all this in Configtool is forthcoming, of course.
2016-05-30 10:31:39 +02:00
Markus Hitter 12dc74fe62 Display: finally get rid of i2c_test.c.
Not without dubbing its remaining functionality in form of a
display_greeting(), of course.
2016-05-28 21:14:37 +02:00
Markus Hitter a13312d9a9 Display: introduce display queue.
Now we shouldn't experience wait cycles in i2c_write() during
typical display writes any longer. It should also distribute CPU
load of display writes a lot better.

Previously writing a line of text to the display would take
almost as long as it took to actually send it to the display,
because the I2C queue could hold only one transmission, which
effectively meant only one character. This could hold the main
loop for several milliseconds.

Now we queue characters, send them one by one, and return to the
main loop in between.

This costs 160 bytes program memory. Only 18 bytes RAM, because
the I2C queue was reduced accordingly. Now:

  Program:  24456 bytes
     Data:   1543 bytes
   EEPROM:     32 bytes
2016-04-27 23:54:14 +02:00
Markus Hitter a47c4b40df Display: add a primitive status display.
This isn't pretty at all, but it shows the principle.
Unfortunately it also exploits a bug in the I2C sending mechanism,
I2C sending hangs a few seconds after reset.
2016-04-26 15:36:11 +02:00
Markus Hitter 6577578051 Display: introduce display_writechar().
You see where the journey is going? This is the equivalent to the
function to write a character to the serial line, so we can
basically swap these two in other functions.
2016-04-26 14:45:59 +02:00
Markus Hitter bb8d6e0ad2 Display: create and use display_set_cursor().
Having this in a seperate function will be helpful later.
2016-04-26 14:31:56 +02:00
Markus Hitter cec45a2fec Display: create infrastructure for distinct displays.
Dropped all the funtions for specific messages because plans on
how to handle this have changed.
2016-04-26 14:31:47 +02:00