[En-Nut-Discussion] New displays, chained devices, best way or how to

Harald Kipp harald.kipp at egnite.de
Thu Mar 5 12:17:26 CET 2009


Ulrich Prinz wrote:
> I'm almost new to nutos, almost as I used it mostly as it is before. But 
> now I'd need to extend it in many ways and I am missing lots of how-to's 
> or best ways.

Hi Ulrich,

I'm quite busy right now and hope to be able to answer in more detail
later. Did you find the following document?

 http://www.ethernut.de/en/documents/ntn-6_spi.html

The whole stuff is relatively new and the docs are rare.

The character based LCD on the Medianut Board is initialized like this:

 NutRegisterSpiDevice(&devSpiMegaLcd, &DEV_SPIBUS, 2);

This initializes (calls dev_init for) both, the bus controller and the
device.

You can the use stdio to open the dispaly and write to it. As a more
advanced example here is the code to register and mount the raw file
system on an SPI DataFlash:

 NutRegisterSpiDevice(&devSpiAt45d0, &DEV_SPIBUS, DATAFLASH_CS);
 NutRegisterDevice(&devRawFs0, 0, 0);
 volid = _open("AT45D0:0/RAWFS0", _O_RDWR | _O_BINARY);
 fp = fopen("RAWFS0:", "r");

The current LCD interface mimics a VT52 terminal, so we can use ESC
sequences to control the cursor and a few editing functions. I don't
think, that this makes much sense for a graphic display.

I've done some evaluation on GUI interfaces and, so far, came to a few
results:

- All graphic output should go to widgets, not directly to the screen,
although the screen (desktop) may be a widget too.

- I still hope that it is possible to avoid a frame buffer in memory,
but exclusively use the display's RAM. This will allow tiny systems like
the AVR to control large color displays. It requires that all refreshes
is done by drawing routines.

- All graphic routines should use pure integer calculations, may be
except color adjustments, which should be optional.

I'm not well experienced with this stuff, though.

Regarding Nutconf: If the GUI fails, try the CLI

 http://www.ethernut.de/en/documents/debian.html

More on this later,

Harald


More information about the En-Nut-Discussion mailing list