The driver is written for the NIOS development board DE2. But should work also on other boards with NIOS.
This driver writes 2x16 characters to the Board even when you have sent another count of characters.
If you send less then the left chars are replaced by spaces and if you send more than only the first 32 are used.
Your program has to take care of that. The time for printing on the display should be approximately 2 ms.
To clear the display take similar time but without printing new chars.
To write to the device you can use the ioctl function like in the example below.
Or you can access the device by fread fprintf ... . So you can readout the message of the display.
It is also possible to change the timing of scrolling (line by line).
For the kernel driver is the used the altera_avalon_lcd_16207 SOPC component.
Add it and name it "lcd_16207_0". It also works with DE2_NIOS_HOST_MOUSE_VGA project.
Generate a new SOF and download it to the board.
Copy the kernel driver (lcd_16207.c, lcd_16207.h) to uClinux-dist/linux-2.6.x/drivers/char.
Edit the file Kconfig in uClinux-dist/linux-2.6.x/drivers/char to contain a section for the lcd module like the following part.
config LCD_16207 # note: in the patched tree this seems to be called NIOS_LCD_16207, watch out.
tristate "Nios LCD 16207 device support"
depends on NIOS || NIOS2
This driver supports the Nios LCD 16207 device.
And add in the Makefile in the same directory one line.
obj-$(CONFIG_LCD_16207) += lcd_16207.o
Then recompile the uClinux kernel. If you use a module then you have to do modprobe lcd_16207.
If you successfully loaded by the kernel then you should see this message: "Device /dev/lcd16207 registered".
Create device file: mknod /dev/lcd16207 c 250 0
The example lcd16207 rotates the input string char by char for all 32 positions. The string is always written to the LCD.
If you pass less than 32 chars then they are filled with spaces and if there are mor than 32 - they are truncated to 32.
Start the program like : ./lcd16207 "..... Hello! ....."
There are some little programs for showing how to use fread fprintf.
The example lcdtime set the timing value of the driver for scrolling.
For more complete information about compiler optimizations, see our Optimization Notice.