Where to export NUTDEVICEs?

Uwe Bonnes <bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org>
Newsgroups gmane.comp.hardware.microcontrollers.ethernut
Message-ID <[email protected]>
Hello,

at the moment, different UART devices are declared in different include
files. E.g.:

./include/dev/usartat91.h:extern NUTDEVICE devDbguAt91;
./include/dev/unix_devs.h:    extern NUTDEVICE devUsartAvr2;
./include/dev/uartgba.h:extern NUTDEVICE devUartGba;
/include/dev/usartstm32.h:extern NUTDEVICE devUsartStm32_1;
./include/dev/usartavr32.h:extern NUTDEVICE devUsartAvr320;

Any usart with the right hardware connection can do one-wire transfers. I
am reworking dev/owibus_uart.c and would like to be able to select the usart
device with the configurator with something like
#if defined(OWI0_UART)
static NUTOWIINFO_UART owcb0 = {
    OWI0_UART,          /*!< \brief Uart to use, e.g, set by configurator */
 in dev/owibus_uart.c

The configuration has:
OWI0_UART                = "devUsartStm32_1"
and generates in include/cfg/owi.h
#ifndef OWI0_UART
#define OWI0_UART devUsartStm32_1
#endif

However to compile dev/owibus_uart.c, OWI0_UART ("devUsartStm32_1") or what
else the user has given will need to be resolved. This would need
dev/owibus_uart.c to include _all_ of the include files mentioned
above. This doesn't sound right.

My solution would be either to declare all uart NUTDEVICEs in
include/dev/uart.h or to include all above include files in
include/dev/uart.h.

Is there someting fundamantal wrong with that approach?

Any other generic way to have the user set OWI0_UART with the configurator?

Thanks
-- 
Uwe Bonnes                bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.