Nut/OS  5.0.5
API Reference
board.h File Reference

Default board configuration. More...

#include <cfg/arch.h>
#include <cfg/uart.h>
#include <compiler.h>
#include <dev/debug.h>
#include <dev/null_ether.h>
Include dependency graph for board.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DEV_DEBUG   devDebug0
#define DEV_DEBUG_NAME   DEV_UART_NAME
#define DEV_CONSOLE   DEV_UART
#define DEV_CONSOLE_NAME   DEV_UART_NAME
#define DEV_ETHER_NAME   "eth0"

Functions

void NutBoardInit (void)
 Early AT91SAM7X-EK hardware initialization.
void NutIdleInit (void)
 Late Gameboy Advance hardware initialization.
void NutMainInit (void)

Detailed Description

Default board configuration.

The purpose of this file is to help creating Nut/OS applications, which will run on many (or all) supported target boards without I/O-device related modification, by simply adding

 #include <dev/board>

The file is intended for inclusion in application code only. If it seems to be required in a library file, then something else is probably broken. Ignoring this advice may lead to unforeseen header file hell. As an exception, it may be included into certain initialization files like nutinit.c.

Roughly speaking, this file provides a number of default devices, which are evaluated in three steps:

  • Board specific settings are defined first.
  • All defaults, which had not been declared for the board, may be specified based on the target CPU.
  • Finally all defaults are set, which were neither based on the board nor on the target CPU.

Instead of referring to platform specific device drivers, like

 NutRegisterDevice(&devDebug0, 0, 0);
 freopen("uart0", "w", stdout);

applications can use globally assigned macros, like

which will work for all target boards.

 * $Id: board.h 4470 2012-08-20 14:06:43Z haraldkipp $
 * 

Define Documentation

#define DEV_DEBUG   devDebug0
#define DEV_DEBUG_NAME   DEV_UART_NAME
#define DEV_ETHER_NAME   "eth0"

Function Documentation

void NutBoardInit ( void  )

Early AT91SAM7X-EK hardware initialization.

This routine is called during system initalization.

Early AT91SAM7X-EK hardware initialization.

This routine is called during system initalization.

Early AT91SAM7X-EK hardware initialization.

This routine is called during system initialization, if NUT_INIT_BOARD has been enabled in the architecture configuration.

It will mainly set up the basic clocks for the CPU to run at 99.6MHz.

References _BV, GPIO_CFG_INPUT, GPIO_CFG_OUTPUT, GPIO_CFG_PERIPHERAL0, GPIO_CFG_PERIPHERAL1, GPIO_CFG_PULLDOWN, GPIO_CFG_PULLUP, GPIO_CFG_REPEATER, GpioPinConfigSet(), GpioPinSetHigh, GpioPinSetLow, inr, Lpc177x_8x_EmcInit(), Lpc177x_8x_EmcSDRAMInit(), NUTGPIO_PORT1, NUTGPIO_PORT2, NUTGPIO_PORT3, NUTGPIO_PORT4, outr, PA20_NCS2_B, PC16_NWAIT_B, PC21_NWR0_B, PC22_NRD_B, PINSEL, PLLFEED_FEED1, PLLFEED_FEED2, PS3_P1_27_CLKOUT, SC_CCLKCFG, SC_CCLKSEL_LSB, SC_CLKOUT_EN, SC_CLKOUTCFG, SC_CLKOUTDIV_LSB, SC_CLKSRC_MCLK, SC_CLKSRCSEL, SC_FLASHCFG, SC_FLASHTIM, SC_FLASHTIM_LSB, SC_MSEL_LSB, SC_NSEL_LSB, SC_OSCEN, SC_OSCSTAT, SC_PCGPIO, SC_PCI2C0, SC_PCI2C1, SC_PCI2C2, SC_PCLKSEL0, SC_PCLKSEL1, SC_PCONP, SC_PCPWM1, SC_PCRTC, SC_PCSPI, SC_PCSSP1, SC_PCTIM0, SC_PCTIM1, SC_PCTIM2, SC_PCUART0, SC_PLL0CFG, SC_PLL0CON, SC_PLL0FEED, SC_PLL0STAT, SC_PLLC, SC_PLLC_STAT, SC_PLLE, SC_PLLE_STAT, SC_PLOCK, SC_SCS, SMC_BAT, and SMC_DBW_16.

Referenced by NutInit().

Here is the call graph for this function:

void NutIdleInit ( void  )

Late Gameboy Advance hardware initialization.

This routine is called on idle thread entry.

Late Gameboy Advance hardware initialization.

This routine is called on idle thread entry.

Late Gameboy Advance hardware initialization.

This routine is called during system initialisation right before the idle thread is created. We will use it to add the SDRAM memory space to out heap.

References _sdram_params::base_addr, InitIrqHandler(), Lpc177x_8x_EmcSDRAMCheck(), NULL, NutHeapAdd, NutTimerStart(), and _sdram_params::size.

Referenced by NutIdle().

Here is the call graph for this function:

void NutMainInit ( void  )

Referenced by NutIdle().