Device selection

When you build an application, the default for each BSP is to automatically provide drivers for all the devices. Sometimes this is not required, and those additional drivers are taking up program and data memory that could increase the cost of the hardware required for the target application.
The Lightfoot configuration tool provides you with the ability to configure the devices available to the application using the config.xml file.
The default config.xml for the target BSP defines all the devices that can be used. This can be found at %DCT_BUILD_BSP_RELEASE%\%DCT_BUILD_TARGET%\%DCT_BUILD_TARGET_VERSION%\config.xml.
Each device entry contains the following attributes.
class
The class of the device. The current classes are listed below
instances
The instances to use. This can be either all, none, a number range (1-4) or a list of numbers (1,3,4).
minimal
If set to true, this uses the minimal version of a driver. This is supported by the timer and uart  and provides the functionality required for the LightOS timer and I/O streams without all the additional functionality available from the full device.

The following device classes are available
uart
Provides the ability to send and receive bytes over a UART. This is typically interrupt driven with an internal buffer used for buffering bytes. The full driver supports hardware flow control (RTS/CTS)
timer
Access the features of the timers. The minimal timer supports a simple counting timer that is used to generate interrupts for LightOS. The full timer allows access to all the supported timer features.
ethernet
Provides the ability to send a receive packets over an ethernet interface.
configmgr
Stores information about the card serial number and ethernet address.
eeprom
Provides ability to read and write the contents of an EEPROM.
spi
Read and write bytes across SPI ports
gpio
Access GPIO ports and ability to set and get bits on a port.
watchdog
Access the watchdog and configure it to reset the board on a failure.
flash
Read, write and manage flash memory.
ffs
Store files in a flash file system

The java_hello example uses the config.xml file to minimise the memory size of the application by only including those devices that are required by the application. This only uses the uart and timer, all other devices are not available.

    <devices>
      <device class="uart" instances="all"/>
      <device class="timer" instances="all"/>
      <device class="ethernet" instances="none"/>
      <device class="configmgr" instances="none"/>
      <device class="eeprom" instances="none"/>
      <device class="spi" instances="none"/>
      <device class="gpio" instances="none"/>
      <device class="watchdog" instances="none"/>
      <device class="flash" instances="none"/>
      <device class="ffs" instances="none"/>
    </devices>

A more complex example is as follows. This only has one uart that provides the minimal functionality. There are only 3 timers, again with minimal functionality. The watchdog, flash and flash file system devices are not installed, but all the other devices available in the default config.xml are available.

    <devices>
      <device class="uart" instances="0" minimal="yes"/>
      <device class="timer" instances="0,1,2" minimal="yes"/>
      <device class="watchdog" instances="none"/>
      <device class="flash" instances="none"/>
      <device class="ffs" instances="none"/>
    <devices>