Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

include a selfwritten driver

Hello again,

I just got another problem :) I have got a selfwritten driver, which is located at nios-linux/linux-2.6/drivers/misc/lcd_driver.cpp & .h (it works - I can put strings on the lcd).

Now i want to include the lcd in a selfwritten userprogram, but there i don't know how to include this driver.

It keeps telling me, @line 22 lcd_driver.h No such file or directory

Is it possible to include a driver so i can build a userprogram in the zImage? What did I do wrong, what should i do to include it?

Thx in advance

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You don't usually access a driver directly from a program (like including the header). You create a file system node under /dev for the device and write to it as a character device. Assuming you implemented your driver as a character device, you can add it to vendors/Altera/nios2/device_table.txt (or whatever your vendor directory is). Say you make /dev/lcd, then you should be able to `echo abcd>/dev/lcd` and have that show up. Or open the file from a program and write to it.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    good news, its working :D

    but now i'm curious. I've got some methods printXY(string,x,y) for example. is it even possible to get to these methods?