Nut/OS  5.0.5
API Reference
board.h
Go to the documentation of this file.
00001 #ifndef _DEV_BOARD_H_
00002 #define _DEV_BOARD_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2007 by egnite Software GmbH
00006  * Copyright (C) 2012 by egnite GmbH
00007  *
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  *
00014  * 1. Redistributions of source code must retain the above copyright
00015  *    notice, this list of conditions and the following disclaimer.
00016  * 2. Redistributions in binary form must reproduce the above copyright
00017  *    notice, this list of conditions and the following disclaimer in the
00018  *    documentation and/or other materials provided with the distribution.
00019  * 3. Neither the name of the copyright holders nor the names of
00020  *    contributors may be used to endorse or promote products derived
00021  *    from this software without specific prior written permission.
00022  *
00023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00030  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00031  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00033  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00034  * SUCH DAMAGE.
00035  *
00036  * For additional information see http://www.ethernut.de/
00037  */
00038 
00082 /*
00083  * \todo Not sure if we should include them here. Possibly yes, but in
00084  *       this case we should add all device related configuration files.
00085  *       However, simply adding the complete cfg directory without sense
00086  *       will significantly increase compile times during distcheck
00087  *       and make it harder to solve conflicts.
00088  */
00089 #include <cfg/arch.h>
00090 #include <cfg/uart.h>
00091 #include <compiler.h>
00092 
00093 /*
00094  * Include individual board header files.
00095  *
00096  * These files can be used to override any of the default settings,
00097  * which are following below. Each supported board should have this,
00098  * even if all defaults are fine. So users may modify the settings
00099  * without having to touch this global file. The selection is
00100  * based on the PLATFORM entry in the board configuration file.
00101  * Some boards, like the MMNET family, may share the same header file
00102  * or, like the USPS family, may even share the same platform, if they
00103  * are based on the same hardware design.
00104  *
00105  * Individual headers must not define any settings, which are
00106  * configured by default anyway. Keep the maintenance effort for
00107  * your board to a minimum. Developers are not be able to check
00108  * every individual board when adding global modifications.
00109  *
00110  * In order to allow modifications via Userconf.mk, all settings should
00111  * make sure, that they were previously undefined, .e.g:
00112  * \code
00113  * #ifndef SAMPLE_MACRO
00114  * #define SAMPLE_MACRO 1
00115  * #endif
00116  * \endcode
00117  *
00118  * All individual headers must contain the following preprocessor
00119  * check to make sure, that it is included via dev/board.h only:
00120  * \code
00121  * #ifndef _DEV_BOARD_H_
00122  * #error "Do not include this file directly. Use dev/board.h instead!"
00123  * #endif
00124  * \endcode
00125  * Otherwise compilation may fail after new items are added here.
00126  *
00127  * Please keep this list sorted alphabetically.
00128  */
00129 #if defined(ARTHERNET1)
00130 #include <arch/avr/board/arthernet1.h>
00131 #elif defined(AT91SAM7X_EK)
00132 #include <arch/arm/board/at91sam7x_ek.h>
00133 #elif defined(AT91SAM9260_EK)
00134 #include <arch/arm/board/at91sam9260_ek.h>
00135 #elif defined(CHARON2)
00136 #include <arch/avr/board/charon2.h>
00137 #elif defined(ELEKTOR_IR1)
00138 #include <arch/arm/board/elektor_ir1.h>
00139 #elif defined(ENET_SAM7X)
00140 #include <arch/arm/board/enet_sam7x.h>
00141 #elif defined(ETHERNUT1)
00142 #include <arch/avr/board/ethernut1.h>
00143 #elif defined(ETHERNUT2)
00144 #include <arch/avr/board/ethernut2.h>
00145 #elif defined(ETHERNUT3)
00146 #include <arch/arm/board/ethernut3.h>
00147 #elif defined(ETHERNUT5)
00148 #include <arch/arm/board/ethernut5.h>
00149 #elif defined(EVK1100)
00150 #include <arch/avr32/board/evk1100.h>
00151 #elif defined(EVK1101)
00152 #include <arch/avr32/board/evk1101.h>
00153 #elif defined(EVK1104)
00154 #include <arch/avr32/board/evk1104.h>
00155 #elif defined(EVK1105)
00156 #include <arch/avr32/board/evk1105.h>
00157 #elif defined(F4_DISCOVERY)
00158 #include <arch/cm3/board/f4_discovery.h>
00159 #elif defined(FLECX1)
00160 #include <arch/cm3/board/flecx1.h>
00161 #elif defined(GBAXPORT2)
00162 #include <arch/cm3/board/gba_xport2.h>
00163 #elif defined(KSK_LPC1788_SK)
00164 #include <arch/cm3/board/ksk_lpc1788_sk.h>
00165 #elif defined(LISA)
00166 #include <arch/cm3/board/lisa.h>
00167 #elif defined(MMNET01) || defined(MMNET02) || defined(MMNET101) || defined(MMNET102)
00168 #include <arch/avr/board/mmnet.h>
00169 #elif defined(MORPHOQ1)
00170 #include <arch/arm/board/morphoq1.h>
00171 #elif defined(SAM7ETH)
00172 #include <arch/arm/board/sam7eth.h>
00173 #elif defined(STM3210C_EVAL)
00174 #include <arch/cm3/board/stm3210c_eval.h>
00175 #elif defined(STM3210E_EVAL)
00176 #include <arch/cm3/board/stm3210e_eval.h>
00177 #elif defined(STM32_CAN)
00178 #include <arch/cm3/board/stm32_can.h>
00179 #elif defined(STM32_COMSTICK)
00180 #include <arch/cm3/board/stm32_comstick.h>
00181 #elif defined(USPS)
00182 #include <arch/cm3/board/usps.h>
00183 #elif defined(OLIMEX_LPCE2294)
00184 #include <arch/arm/board/olimex_lpce2294.h>
00185 #elif defined(XNUT_100) || defined(XNUT_105)
00186 #include <arch/avr/board/xnut.h>
00187 #elif defined(ZERO_EK)
00188 #include <arch/arm/board/zero_ek.h>
00189 #endif
00190 
00191 
00192 /*
00193  * Define CPU specific defaults.
00194  *
00195  * After each board claims its individual settings, we will try
00196  * to figure out remaining defaults based on the CPU or CPU family.
00197  */
00198 
00199 #if defined(__AVR__)
00200 /*
00201  * UART devices for Atmel's AVR 8-bit family.
00202  */
00203 #include <dev/usartavr.h>
00204 
00205 /* We only need to define the devices, their names are system wide
00206    defaults. Note, that we use the advanced drivers here. Boards
00207    with scarce memory resources or running a slow clocks may use
00208    devUart0 and devUart1 instead. */
00209 #ifndef DEV_UART0
00210 #define DEV_UART0       devUsartAvr0
00211 #endif
00212 #ifndef DEV_UART1
00213 #define DEV_UART1       devUsartAvr1
00214 #endif
00215 
00216 /*
00217  * SPI bus controller for Atmel's AVR 8-bit family.
00218  */
00219 #include <dev/spibus_avr.h>
00220 #ifndef DEV_SPIBUS0
00221 #define DEV_SPIBUS0     spiBus0Avr
00222 #endif
00223 
00224 #elif defined(MCU_AT91)
00225 
00226 /*
00227  * Debug device for Atmel's ARM based AT91 family.
00228  *
00229  * All chips with DBGU interface will most likely use it for debug
00230  * output. If such an interface is not available, than we rely on
00231  * the system wide default, which is declared further down.
00232  *
00233  * \note We assume, that the system default debug driver devDebug0
00234  *       is always available on devices without DBGU.
00235  */
00236 #ifdef DBGU_BASE
00237 #ifndef DEV_DEBUG
00238 #define DEV_DEBUG       devDebug
00239 #endif
00240 #ifndef DEV_DEBUG_NAME
00241 #define DEV_DEBUG_NAME  "dbgu"
00242 #endif
00243 #endif
00244 
00245 /*
00246  * UART devices for Atmel's ARM based AT91 family.
00247  *
00248  * Note, that DEV_UARTD is special. It uses the DGBU interface, but
00249  * as an interrupt driven driver, it shouldn't be used for debugging.
00250  */
00251 #include <dev/usartat91.h>
00252 
00253 #ifndef DEV_UART0
00254 #define DEV_UART0       devUsartAt910
00255 #endif
00256 #ifndef DEV_UART1
00257 #define DEV_UART1       devUsartAt911
00258 #endif
00259 #if !defined(DEV_UARTD) && defined(DBGU_BASE)
00260 #define DEV_UARTD       devDbguAt91
00261 #endif
00262 
00263 /*
00264  * SPI bus controller for Atmel's ARM based AT91 family.
00265  */
00266 #if !defined(DEV_SPIBUS0) && defined(SPI0_BASE)
00267 #include <dev/spibus_at91.h>
00268 #define DEV_SPIBUS0     spiBus0At91
00269 #endif
00270 
00271 /*
00272  * TWI / I2C bus controller for Atmel's ARM based AT91 family.
00273  *
00274  * \todo Somewhere is a problem with bit banging. If the CPU has a TWI
00275  * hardware interface, we cannot define another controller based on bit
00276  * banging.
00277  */
00278 #include <cfg/twi.h>
00279 #include <dev/twif.h>
00280 #if defined(MCU_AT91R40008)
00281 #include <dev/twibus_bbif.h>
00282 #define DEF_TWIBUS      TwBbifBus
00283 #else
00284 #include <dev/twibus_at91.h>
00285 #define DEF_TWIBUS      At91TwiBus
00286 #endif
00287 
00288 #elif defined(MCU_LPC17xx)
00289 /*
00290  * UART devices for the ARM based LPC17xx family.
00291  *
00292  * \note Instead of providing literal names, references to the
00293  *       driver structure are used here. Therefore all names are
00294  *       given here, even it they use the system wide default
00295  *       name. Furthermore, all possible devices seem to have
00296  *       been added here, which makes it hard for applications
00297  *       to figure out, if they are available at all on the
00298  *       target hardware.
00299  */
00300 #include <dev/usart_lpc17xx.h>
00301 
00302 #if defined(MCU_LPC176x)
00303 
00304 #ifndef DEV_UART0
00305 #define DEV_UART0       devUsartLpc176x_0
00306 #endif
00307 #ifndef DEV_UART0_NAME
00308 #define DEV_UART0_NAME  "usart0"
00309 #endif
00310 
00311 #else
00312 
00313 #ifndef DEV_UART0
00314 #define DEV_UART0       devUsartLpc17xx_0
00315 #endif
00316 #ifndef DEV_UART0_NAME
00317 #define DEV_UART0_NAME  DEV_UART0.dev_name
00318 #endif
00319 
00320 #ifndef DEV_UART1
00321 #define DEV_UART1       devUsartLpc17xx_1
00322 #endif
00323 #ifndef DEV_UART1_NAME
00324 #define DEV_UART1_NAME  DEV_UART1.dev_name
00325 #endif
00326 
00327 #ifndef DEV_UART2
00328 #define DEV_UART2       devUsartLpc17xx_2
00329 #endif
00330 #ifndef DEV_UART2_NAME
00331 #define DEV_UART2_NAME  DEV_UART2.dev_name
00332 #endif
00333 
00334 #ifndef DEV_UART3
00335 #define DEV_UART3       devUsartLpc17xx_3
00336 #endif
00337 #ifndef DEV_UART3_NAME
00338 #define DEV_UART3_NAME  DEV_UART3.dev_name
00339 #endif
00340 
00341 #endif
00342 
00343 #elif defined(__AVR32__)
00344 /*
00345  * UART devices for Atmel's AVR 32-bit family.
00346  *
00347  * Clear and simple, that's how we like it. But wait, where is the
00348  * debug driver?
00349  */
00350 #include <dev/usartavr32.h>
00351 
00352 #ifndef DEV_UART0
00353 #define DEV_UART0       devUsartAvr320
00354 #endif
00355 #ifndef DEV_UART1
00356 #define DEV_UART1       devUsartAvr321
00357 #endif
00358 #ifndef DEV_UART2
00359 #define DEV_UART2       devUsartAvr322
00360 #endif
00361 
00362 /*
00363  * SPI bus controllers for Atmel's AVR 32-bit family.
00364  */
00365 #include <dev/spibus_avr32.h>
00366 #define DEV_SPIBUS0     spiBus0Avr32
00367 #define DEV_SPIBUS1     spiBus1Avr32
00368 
00369 #elif defined(MCU_STM32)
00370 /*
00371  * Debug devices for the ARM based STM32 family.
00372  *
00373  * \todo Looks like this debug driver is using a normal, possibly
00374  *       interrupt driven UART driver, which makes its use quite
00375  *       limited. Better do not use it within interrupt routines
00376  *       and do not rely on synchronicity. Output may be intermixed
00377  *       or even scrambled during debugging.
00378  */
00379 #ifndef DEV_DEBUG
00380 #define DEV_DEBUG       DEV_UART1
00381 #endif
00382 #ifndef DEV_DEBUG_NAME
00383 #define DEV_DEBUG_NAME  DEV_UART1_NAME
00384 #endif
00385 
00386 /*
00387  * UART devices for the ARM based STM32 family.
00388  *
00389  * \note Instead of providing literal names, references to the
00390  *       driver structure are used here. Therefore all names are
00391  *       given here, even it they use the system wide default
00392  *       name. Furthermore, all possible devices seem to have
00393  *       been added here, which makes it hard for applications
00394  *       to figure out, if they are available at all on the
00395  *       target hardware.
00396  */
00397 #include <dev/usartstm32.h>
00398 
00399 #ifndef DEV_UART1
00400 #define DEV_UART1       devUsartStm32_1
00401 #endif
00402 #ifndef DEV_UART1_NAME
00403 #define DEV_UART1_NAME  DEV_UART1.dev_name
00404 #endif
00405 
00406 #ifndef DEV_UART2
00407 #define DEV_UART2       devUsartStm32_2
00408 #endif
00409 #ifndef DEV_UART2_NAME
00410 #define DEV_UART2_NAME  DEV_UART2.dev_name
00411 #endif
00412 
00413 #ifndef DEV_UART3
00414 #define DEV_UART3       devUsartStm32_3
00415 #endif
00416 #ifndef DEV_UART3_NAME
00417 #define DEV_UART3_NAME  DEV_UART3.dev_name
00418 #endif
00419 
00420 #ifndef DEV_UART4
00421 #define DEV_UART4       devUartStm32_4
00422 #endif
00423 #ifndef DEV_UART4_NAME
00424 #define DEV_UART4_NAME  DEV_UART4.dev_name
00425 #endif
00426 
00427 #ifndef DEV_UART5
00428 #define DEV_UART5       devUartStm32_5
00429 #endif
00430 #ifndef DEV_UART5_NAME
00431 #define DEV_UART5_NAME  DEV_UART5.dev_name
00432 #endif
00433 
00434 #ifndef DEV_UART6
00435 #define DEV_UART6       devUsartStm32_6
00436 #endif
00437 #ifndef DEV_UART6_NAME
00438 #define DEV_UART6_NAME  DEV_USART6.dev_name
00439 #endif
00440 
00441 /*
00442  * System default UART0 is not available on STM32 boards. Thus,
00443  * we declare UART1 as the default.
00444  */
00445 #ifndef DEV_UART
00446 #define DEV_UART        DEV_UART1
00447 #define DEV_UART_NAME   DEV_UART1_NAME
00448 #endif
00449 
00450 /*
00451  * TWI / I2C bus controller for the ARM based STM32 family.
00452  */
00453 #include <cfg/twi.h>
00454 #include <dev/twif.h>
00455 #include <arch/cm3/stm/stm32_twi.h>
00456 
00457 #elif defined(__NUT_EMULATION__)
00458 /*
00459  * UART devices for the UNIX emulation.
00460  */
00461 #include <dev/usartavr.h>
00462 
00463 #ifndef DEV_UART0
00464 #define DEV_UART0       devUsartAvr0
00465 #endif
00466 
00467 #ifndef DEV_UART1
00468 #define DEV_UART1       devUsartAvr1
00469 #endif
00470 
00471 #define DEV_UART1_NAME  "uart1"
00472 
00473 #endif
00474 
00475 /*
00476  * Define system wide defaults.
00477  *
00478  * After each board and each target CPU claimed their individual settings,
00479  * we will set all remaining defaults.
00480  *
00481  * Use most likely defaults here, to keep board and CPU defaults to a
00482  * minimum. For example, the UART0 device is named "uart0" by almost
00483  * all drivers and there is rarely any reason other than to confuse
00484  * people for choosing a different name. Sticking to the default
00485  * reduces code lines.
00486  */
00487 
00488 /*
00489  * UART device defaults.
00490  *
00491  * We have all kind of UART drivers. Some platforms, like the AVR, do
00492  * have four(!) of them, all running on the same physical interface:
00493  * One simple polling driver, one fast interrupt driven driver with
00494  * limited buffer and handshake capabilities, one full fledged driver
00495  * with all bells and whistles and one special driver optimized for
00496  * AHDLC.
00497  *
00498  * Furthermore all drivers use different structure variable names.
00499  * It doesn't make much sense to define any default here.
00500  *
00501  * Device names, however, are the same for most implementations.
00502  * We will also select the UART with the lowest index as our default
00503  * DEV_UART.
00504  */
00505 #ifdef DEV_UART0
00506 #ifndef DEV_UART0_NAME
00507 #define DEV_UART0_NAME  "uart0"
00508 #endif
00509 #ifndef DEV_UART
00510 #define DEV_UART        DEV_UART0
00511 #endif
00512 #ifndef DEV_UART_NAME
00513 #define DEV_UART_NAME   DEV_UART0_NAME
00514 #endif
00515 #endif
00516 
00517 #ifdef DEV_UART1
00518 #ifndef DEV_UART1_NAME
00519 #define DEV_UART1_NAME  "uart1"
00520 #endif
00521 #ifndef DEV_UART
00522 #define DEV_UART        DEV_UART1
00523 #endif
00524 #ifndef DEV_UART_NAME
00525 #define DEV_UART_NAME   DEV_UART1_NAME
00526 #endif
00527 #endif
00528 
00529 #ifdef DEV_UART2
00530 #ifndef DEV_UART2_NAME
00531 #define DEV_UART2_NAME  "uart2"
00532 #endif
00533 #ifndef DEV_UART
00534 #define DEV_UART        DEV_UART2
00535 #endif
00536 #ifndef DEV_UART_NAME
00537 #define DEV_UART_NAME   DEV_UART2_NAME
00538 #endif
00539 #endif
00540 
00541 #ifdef DEV_UART3
00542 #ifndef DEV_UART3_NAME
00543 #define DEV_UART3_NAME  "uart3"
00544 #endif
00545 #ifndef DEV_UART
00546 #define DEV_UART        DEV_UART3
00547 #endif
00548 #ifndef DEV_UART_NAME
00549 #define DEV_UART_NAME   DEV_UART3_NAME
00550 #endif
00551 #endif
00552 
00553 #ifdef DEV_UART4
00554 #ifndef DEV_UART4_NAME
00555 #define DEV_UART4_NAME  "uart4"
00556 #endif
00557 #ifndef DEV_UART
00558 #define DEV_UART        DEV_UART4
00559 #endif
00560 #ifndef DEV_UART_NAME
00561 #define DEV_UART_NAME   DEV_UART4_NAME
00562 #endif
00563 #endif
00564 
00565 #ifdef DEV_UART5
00566 #ifndef DEV_UART5_NAME
00567 #define DEV_UART5_NAME  "uart5"
00568 #endif
00569 #ifndef DEV_UART
00570 #define DEV_UART        DEV_UART5
00571 #endif
00572 #ifndef DEV_UART_NAME
00573 #define DEV_UART_NAME   DEV_UART5_NAME
00574 #endif
00575 #endif
00576 
00577 #ifdef DEV_UART6
00578 #ifndef DEV_UART6_NAME
00579 #define DEV_UART6_NAME  "uart6"
00580 #endif
00581 #ifndef DEV_UART
00582 #define DEV_UART        DEV_UART6
00583 #endif
00584 #ifndef DEV_UART_NAME
00585 #define DEV_UART_NAME   DEV_UART6_NAME
00586 #endif
00587 #endif
00588 
00589 #ifdef DEV_UART7
00590 #ifndef DEV_UART7_NAME
00591 #define DEV_UART7_NAME  "uart7"
00592 #endif
00593 #ifndef DEV_UART
00594 #define DEV_UART        DEV_UART7
00595 #endif
00596 #ifndef DEV_UART_NAME
00597 #define DEV_UART_NAME   DEV_UART7_NAME
00598 #endif
00599 #endif
00600 
00601 #ifdef DEV_UARTD
00602 #ifndef DEV_UARTD_NAME
00603 #define DEV_UARTD_NAME  "uartd"
00604 #endif
00605 #ifndef DEV_UART
00606 #define DEV_UART        DEV_UARTD
00607 #endif
00608 #ifndef DEV_UART_NAME
00609 #define DEV_UART_NAME   DEV_UARTD_NAME
00610 #endif
00611 #endif
00612 
00613 /*
00614  * Debug device defaults.
00615  *
00616  * Due to its hardware dependency, there is no such thing like a global
00617  * debug device. However, in reality devDebug0 is available on most
00618  * platforms. Not sure, if it had been a good idea giving them all the same
00619  * structure name. Probably they were created by copying and pasting
00620  * the original AVR driver. The good news is, that they all share the same
00621  * header file.
00622  *
00623  * In most cases the driver will be implemented on the default UART. So
00624  * we can use that name as the most likely default.
00625  *
00626  * Note, that Nut/OS device names reflect the hardware they are attached to.
00627  * If more than one driver exists for the same hardware, they will all have
00628  * the same name. In most cases this prevents applications from accidently
00629  * using more than one driver on a specific hardware interface, because
00630  * NutRegisterDevice() expects a unique name for each registered device.
00631  */
00632 #include <dev/debug.h>
00633 
00634 #ifndef DEV_DEBUG
00635 #define DEV_DEBUG       devDebug0
00636 #endif
00637 #ifndef DEV_DEBUG_NAME
00638 #define DEV_DEBUG_NAME  DEV_UART_NAME
00639 #endif
00640 
00641 /*
00642  * Console device defaults.
00643  *
00644  * The console device is used for stdin and stdout, attached to the
00645  * main serial port of the board. If more than one serial port is
00646  * available, then the same port that is attached to the debug device
00647  * is selected. But it's not that easy really.
00648  *
00649  * In earlier releases Nut/OS provides the debug device for progress
00650  * reports. At that time the debug driver was write-only to keep it
00651  * small and simple. When user input was required, the interrupt
00652  * driven UART0 driver was used instead. As long as both drivers
00653  * referred to the same physical interface, this was no problem.
00654  *
00655  * The later supported AT91 family offers a unique DGBU interface,
00656  * which was naturally used for the debug driver. When running existing
00657  * applications, users of this hardware had to switch between DBGU
00658  * and UART0, either by changing jumper settings or changing connectors.
00659  * Can you imagine, how often users were desperately waiting for output
00660  * until they recognized, that the application requires to switch the
00661  * physical interface?
00662  *
00663  * To solve this, some debug drivers had been expanded with input
00664  * capabilities, allowing to use same interface for write-only and
00665  * read/write applications. But the increase of code size is not
00666  * bearable by all targets, and quite senseless, if they already have
00667  * a full UART driver at the same physical interface. If defined,
00668  * the configuration item NUT_DEV_DEBUG_READ enables the input
00669  * capability and is used here, to determine, whether the debug
00670  * device is able to support both, stdout and stdin.
00671  */
00672 #ifndef DEV_CONSOLE
00673 #ifdef NUT_DEV_DEBUG_READ
00674 /* Debug device is read/write, use it. */
00675 #define DEV_CONSOLE      DEV_DEBUG
00676 #ifndef DEV_CONSOLE_NAME
00677 #define DEV_CONSOLE_NAME DEV_DEBUG_NAME
00678 #endif
00679 #else
00680 /* Debug device is write-only, use default UART. */
00681 #define DEV_CONSOLE      DEV_UART
00682 #ifndef DEV_CONSOLE_NAME
00683 #define DEV_CONSOLE_NAME DEV_UART_NAME
00684 #endif
00685 #endif
00686 #endif
00687 
00688 /*
00689  * Ethernet device defaults.
00690  *
00691  * Boards may not offer any Ethernet interface. However, many of our
00692  * sample applications are network based. It would require a lot of
00693  * ugly preprocessor ifdefs to make them compile and avoid crashing
00694  * them on hardware without a network interface. Therefore a so called
00695  * Null-driver will be used if no real interface had been specified
00696  * above.
00697  */
00698 #ifndef DEV_ETHER
00699 #include <dev/null_ether.h>
00700 #endif
00701 #ifndef DEV_ETHER_NAME
00702 #define DEV_ETHER_NAME  "eth0"
00703 #endif
00704 
00705 /*
00706  * SPI bus controller defaults.
00707  *
00708  * Select the interface with the lowest index as our default.
00709  */
00710 #ifndef DEV_SPIBUS
00711 #if defined(DEV_SPIBUS0)
00712 #define DEV_SPIBUS      DEV_SPIBUS0
00713 #elif defined(DEV_SPIBUS1)
00714 #define DEV_SPIBUS      DEV_SPIBUS1
00715 #endif
00716 #endif
00717 
00718 /*
00719  * No TWI / I2C bus controller defaults.
00720  */
00721 
00722 /*
00723  * Memory card driver defaults.
00724  *
00725  * We expect the board or CPU configuration to specify DEV_MMCARD0,
00726  * which will be used for the default interface DEV_MMCARD.
00727  */
00728 #if defined(DEV_MMCARD0)
00729 #ifndef DEV_MMCARD
00730 #define DEV_MMCARD          DEV_MMCARD0
00731 #endif
00732 #ifndef DEV_MMCARD0_NAME
00733 #define DEV_MMCARD0_NAME    "MMC0"
00734 #endif
00735 #ifndef DEV_MMCARD_NAME
00736 #define DEV_MMCARD_NAME     DEV_MMCARD0_NAME
00737 #endif
00738 #endif
00739 
00740 /*
00741  * Real time clock defaults.
00742  *
00743  * We expect the board or CPU configuration to specify RTC_CHIP0,
00744  * which will be used for the default interface RTC_CHIP.
00745  *
00746  * This effort looks a little bit funny, because boards will rarely have
00747  * two of this. But who knows...
00748  */
00749 #ifdef RTC_CHIP0
00750 #ifndef RTC_CHIP
00751 #define RTC_CHIP RTC_CHIP0
00752 #endif
00753 #endif
00754 
00755 
00756 extern void NutBoardInit(void);
00757 extern void NutIdleInit(void);
00758 extern void NutMainInit(void);
00759 
00760 #endif
00761