Hello,
I'm trying to write an LCDproc driver for the PiFace Control and Display Raspberry Pi extension board. It uses an 16x2 HD44780 display connected to the Raspberry Pi via the SPI bus through an MCP23S17 port expander. The HD44780 is set up in 4-bit mode and connected to Port B on the MCP23S17 like so:
HD44780 Data 4 | PortB0 |
HD44780 Data 5 | PortB1 |
HD44780 Data 6 | PortB2 |
HD44780 Data 7 | PortB3 | --- MCP23S17 -- SPI -- Raspberry Pi
HD44780 Enable | PortB4 |
HD44780 RW | PortB5 |
HD44780 RS | PortB6 |
Backlight | PortB7 |
So far, I've created server/drivers/hd44780-pifacecad.{c,h} files (based on hd44780-i2c.{c,h}) which implements:
I've also added to line 244 in acinclude.m4 (just below the Raspberry Pi ARM check):
dnl While PiFace Control and Display is only intended for the
dnl Raspberry Pi, the hd4470-pifacecad driver works through SPI.
dnl Therefore any SPI connection will do.
if test "$x_ac_have_spi" = yes; then
HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-pifacecad.o"
fi
and to EXTRA_hd44780_SOURCES in server/drivers/Makefile.am I've added:
x_ac_have_spi=no
AC_CHECK_HEADERS([linux/spi/spidev.h], [x_ac_have_spi=yes])
if test "$x_ac_have_spi" = yes; then
AC_DEFINE(HAVE_SPI,[1],[Define to 1 if you have the spi headers])
fi
When I run make, everything compiles and I can SPI checks and pifacecad go by but when I configure the driver to be hd44780 in LCDd.conf and ran the server with:
Hello,
I'm trying to write an LCDproc driver for the PiFace Control and Display Raspberry Pi extension board. It uses an 16x2 HD44780 display connected to the Raspberry Pi via the SPI bus through an MCP23S17 port expander. The HD44780 is set up in 4-bit mode and connected to Port B on the MCP23S17 like so:
So far, I've created
server/drivers/hd44780-pifacecad.{c,h}files (based on hd44780-i2c.{c,h}) which implements:I've also added to line 244 in acinclude.m4 (just below the Raspberry Pi ARM check):
and to
EXTRA_hd44780_SOURCESinserver/drivers/Makefile.amI've added:As per: http://lcdproc.sourceforge.net/docs/current-dev.html#add-your-driver
Finally, I've added to line 169 in
configure.ac:And to server/drivers/hd44780-driver.h:
When I run
make, everything compiles and I can SPI checks andpifacecadgo by but when I configure the driver to be hd44780 inLCDd.confand ran the server with:I get the following error:
Which appears to be coming from
hd44780-4bit.c.I'm not sure what to do next.
P.s. I did not realise there was a forum. Sorry for posting to the mailing list too.
Solution
I also had to add to
server/drivers/hd44780-driver.h:And add to hd44780-low.h:
And configure LCDd.conf correctly:
The driver now works correctly. I've submitted the patch to the mailing list and attached it here.
Last edit: Thomas Preston 2013-11-29
This driver has been committed to LCDproc on 2014-02-10.