Skip to content
Snippets Groups Projects
NuttxPortingGuide.html 113 KiB
Newer Older
patacongo's avatar
patacongo committed
    Each MTD device driver must implement an instance of <code>struct mtd_dev_s</code>.
    That structure defines a call table with the following methods:
    <p>
      Erase the specified erase blocks (units are erase blocks):
    </p>
    <ul>
     <p><code>int (*erase)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks);</code></p>
    </ul>
    <p>
      Read/write from the specified read/write blocks:
    </p?
    <ul>
     <p><code>ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR uint8_t *buffer);</code><br>
     <code>ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const uint8_t *buffer);</code></p>
patacongo's avatar
patacongo committed
    </ul>
    <p>
      Some devices may support byte oriented reads (optional).
      Most MTD devices are inherently block oriented so byte-oriented writing is not supported.
      It is recommended that low-level drivers not support read() if it requires buffering.
    </p>
    <ul>
     <p><code>ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, FAR uint8_t *buffer);</code></p>
patacongo's avatar
patacongo committed
    </ul>
    <p>
      Support other, less frequently used commands:
    </p>
    <ul>
      <li><code>MTDIOC_GEOMETRY</code>:  Get MTD geometry</li>
      <li><code>MTDIOC_XIPBASE:</code>: Convert block to physical address for eXecute-In-Place</li>
      <li><code>MTDIOC_BULKERASE</code>: Erase the entire device</li>
    </ul>
    <p>
      is provided via a sinble <code>ioctl</code> method (see <code>include/nuttx/ioctl.h</code>):
    </p>
    <ul>
     <p><code>int (*ioctl)(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg);</code></p>
    </ul>
  </li>
  <li>
    <b>Binding MTD Drivers</b>.
    MTD drivers are not normally directly accessed by user code, but are usually bound to another,
    higher level device driver.
    In general, the binding sequence is:
    <ul>
      <li>Get an instance of <code>struct mtd_dev_s</code> from the hardware-specific MTD device driver, and </li>
      <li>Provide that instance to the initialization method of the higher level device driver.</li>
    </ul>
  </li>
  <li>
    <b>Examples</b>:
    <code>drivers/mtd/m25px.c</code> and <code>drivers/mtd/ftl.c</code>
  </li>
</ul>

<h3><a name="sdiodrivers">6.3.7 SDIO Device Drivers</a></h3>

<ul>
  <li>
    <b><code>include/nuttx/sdio.h</code></b>.
    All structures and APIs needed to work with serial drivers are provided in this header file.
  </li>
  <li>
    <b><code>struct sdio_dev_s</code></b>.
    Each MTD device driver must implement an instance of <code>struct sdio_dev_s</code>.
    That structure defines a call table with the following methods:
    <p>
      Initialization/setup:
    </p>
    <ul>
     <p><code>void (*reset)(FAR struct sdio_dev_s *dev);</code><br>
     <code>uint8_t (*status)(FAR struct sdio_dev_s *dev);</code><br>
     <code>void (*widebus)(FAR struct sdio_dev_s *dev, bool enable);</code><br>
patacongo's avatar
patacongo committed
     <code>void (*clock)(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate);</code><br>
     <code>int (*attach)(FAR struct sdio_dev_s *dev);</code></p>
    </ul>
    <p>
      Command/Status/Data Transfer:
    </p?
    <ul>
     <p><code>void (*sendcmd)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg);</code><br>
     <code>int (*recvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t nbytes);</code><br>
     <code>int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t nbytes);</code><br>
patacongo's avatar
patacongo committed
     <code>int (*cancel)(FAR struct sdio_dev_s *dev);</code><br>
     <code>int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32_t cmd);</code><br>
     <code>int (*recvR1)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R1);</code><br>
     <code>int (*recvR2)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t R2[4]);</code><br>
     <code>int (*recvR3)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R3);</code><br>
     <code>int (*recvR4)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R4);</code><br>
     <code>int (*recvR5)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R5);</code><br>
     <code>int (*recvR6)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R6);</code><br>
     <code>int (*recvR7)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R7);</code></p>
patacongo's avatar
patacongo committed
    </ul>
    <p>
      Event/Callback support:
    </p>
    <ul>
     <p><code>void (*waitenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);</code><br>
     <code>sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev, uint32_t timeout);</code><br>
patacongo's avatar
patacongo committed
     <code>void (*callbackenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);</code><br>
     <code>int (*registercallback)(FAR struct sdio_dev_s *dev, worker_t callback, void *arg);</code></p>
    </ul>
    <p>
      DMA support:
    </p>
    <ul>
     <p><code>bool (*dmasupported)(FAR struct sdio_dev_s *dev);</code><br>
     <code>int (*dmarecvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t buflen);</code><br>
     <code>int (*dmasendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer,  size_t buflen);</code></p>
patacongo's avatar
patacongo committed
    </ul>
  </li>
  <li>
    <b>Binding SDIO Drivers</b>.
    SDIO drivers are not normally directly accessed by user code, but are usually bound to another,
    higher level device driver.
    In general, the binding sequence is:
    <ul>
      <li>Get an instance of <code>struct sdio_dev_s</code> from the hardware-specific SDIO device driver, and </li>
      <li>Provide that instance to the initialization method of the higher level device driver.</li>
    </ul>
  </li>
  <li>
    <b>Examples</b>:
    <code>arch/arm/src/stm32/stm32_sdio.c</code> and <code>drivers/mmcsd/mmcsd_sdio.c</code>
  </li>
</ul>

<table width ="100%">
  <tr bgcolor="#e4e4e4">
    <td>
      <h1><a name="apndxconfigs">Appendix A:  NuttX Configuration Settings</a></h1>
    </td>
  </tr>
</table>
patacongo's avatar
patacongo committed

<p>
  The following variables are recognized by the build (you may
  also include architecture-specific settings).
</p>

<h2>Architecture selection</h2>
patacongo's avatar
patacongo committed
  The following configuration items select the architecture, chip, and
  board configuration for the build.
</p>
patacongo's avatar
patacongo committed
<ul>
  <li><code>CONFIG_ARCH</code>:
    Identifies the arch subdirectory</li>
  <li><code>CONFIG_ARCH_name</code>:
    For use in C code</li>
  <li><code>CONFIG_ARCH_CHIP</code>:
    Identifies the arch/*/chip subdirectory</li>
  <li><code>CONFIG_ARCH_CHIP_name</code>:
    For use in C code</li>
  <li><code>CONFIG_ARCH_BOARD</code>:
     Identifies the configs subdirectory and hence, the board that supports
     the particular chip or SoC.</li>
  <li><code>CONFIG_ARCH_BOARD_name</code>:
     For use in C code</li>
  <li><code>CONFIG_ENDIAN_BIG</code>:
     Define if big endian (default is little endian).</li>
  <li><code>CONFIG_ARCH_NOINTC</code>:
     Define if the architecture does not support an interrupt controller
     or otherwise cannot support APIs like up_enable_irq() and up_disable_irq().</li>
  <li><code>CONFIG_ARCH_IRQPRIO</code>:
patacongo's avatar
patacongo committed
     Define if the architecture supports prioritization of interrupts and the
     up_prioritize_irq() API.</li>
patacongo's avatar
patacongo committed
</ul>

  Some architectures require a description of the RAM configuration:
</p>
<ul>
  <li><code>CONFIG_DRAM_SIZE</code>:
    Describes the installed DRAM.</li>
  <li><code>CONFIG_DRAM_START</code>:
    The start address of DRAM (physical)</li>
  <li><code>CONFIG_DRAM_VSTART</code>:
    The start address of DRAM (virtual)</li>
<p>
  General build options:
</p>
<ul>
  <li><code>CONFIG_RRLOAD_BINARY</code>:
    Make the rrload binary format used with BSPs from <a href="www.ridgerun.com">ridgerun.com</a>
    using the <code>tools/mkimage.sh</code> script.
  </li>
  <li><code>CONFIG_INTELHEX_BINARY</code>:
    Make the Intel HEX binary format used with many different loaders using the GNU objcopy program
patacongo's avatar
patacongo committed
    This option should not be selected if you are not using the GNU toolchain.
  <li><code>CONFIG_MOTOROLA_SREC</code>:
    Make the Motorola S-Record binary format used with many different loaders using the GNU objcopy program
    Should not be selected if you are not using the GNU toolchain.
  </li>
  <li><code>CONFIG_RAW_BINARY</code>:
patacongo's avatar
patacongo committed
    Make a raw binary format file used with many different loaders using the GNU objcopy program.
    This option  should not be selected if you are not using the GNU toolchain.
  </li>
  <li><code>CONFIG_HAVE_LIBM</code>:
    Toolchain supports libm.a
  </li>
  <li><code>CONFIG_HAVE_CXX</code>:
    Toolchain supports C++ and <code>CXX</code>, <code>CXXFLAGS</code>, and <code>COMPILEXX</code>
patacongo's avatar
patacongo committed
    have been defined in the configurations <code>Make.defs</code> file.
patacongo's avatar
patacongo committed
<h2>General OS setup</h2>

<ul>
  <li>
    <code>CONFIG_EXAMPLE</code>: identifies the subdirectory in examples
    that will be used in the build.
  </li>
  <li>
    <code>CONFIG_DEBUG</code>: enables built-in debug options
  </li>
  <li>
    <code>CONFIG_DEBUG_VERBOSE</code>: enables verbose debug output
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG_SYMBOLS</code>: build without optimization and with debug symbols (needed for use with a debugger).
  </li>
  <li>
    <code>CONFIG_DEBUG_SCHED</code>: enable OS debug output (disabled by default)
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_DEBUG_MM</code>: enable memory management debug output (disabled by default)
    <code>CONFIG_DEBUG_NET</code>: enable network debug output (disabled by default)
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG_USB</code>: enable USB debug output (disabled by default)
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_DEBUG_FS</code>: enable file system debug output (disabled by default)
  </li>
  <li>
    <code>CONFIG_DEBUG_LIB</code>: enable C library debug output (disabled by default)
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG_BINFMT</code>: enable binary loader debug output (disabled by default)
  </li>
  <li>
    <code>CONFIG_DEBUG_GRAPHICS</code>: enable NX graphics debug output (disabled by default)
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_ARCH_LOWPUTC</code>: architecture supports low-level, boot
patacongo's avatar
patacongo committed
    time console output
  </li>
  <li>
    <code>CONFIG_MM_REGIONS</code>: If the architecture includes multiple
    regions of memory to allocate from, this specifies the
    number of memory regions that the memory manager must
    handle and enables the API mm_addregion(start, end);
  </li>
  <li>
    <code>CONFIG_TICKS_PER_MSEC</code>: The default system timer is 100Hz
    or <code>TICKS_PER_MSEC</code>=10.  This setting may be defined to inform NuttX
    that the processor hardware is providing system timer interrupts at some interrupt
    interval other than 10 msec.
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_RR_INTERVAL</code>: The round robin time slice will be set
patacongo's avatar
patacongo committed
    this number of milliseconds;  Round robin scheduling can
    be disabled by setting this value to zero.
  </li>
  <li>
    <code>CONFIG_SCHED_INSTRUMENTATION</code>: enables instrumentation in 
    scheduler to monitor system performance
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_TASK_NAME_SIZE</code>: Specifies that maximum size of a
patacongo's avatar
patacongo committed
    task name to save in the TCB.  Useful if scheduler
    instrumentation is selected.  Set to zero to disable.
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_START_YEAR</code>, <code>CONFIG_START_MONTH</code>, <code>CONFIG_START_DAY</code> -
patacongo's avatar
patacongo committed
    Used to initialize the internal time logic.
  </li>
  <li>
    <code>CONFIG_GREGORIAN_TIME</code>: Enables Gregorian time conversions.
    You would only need this if you are concerned about accurate time conversions in
    the recent past or in the distant future.
  </li>
  <li>
    <code>CONFIG_JULIAN_TIME</code>: Enables Julian time conversions.
    You would only need this if you are concerned about accurate time conversion in the distand past.
    You must also define <code>CONFIG_GREGORIAN_TIME</code> in order to use Julian time.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_DEV_CONSOLE</code>: Set if architecture-specific logic
    provides /dev/console.  Enables stdout, stderr, stdin.
  </li>
    <code>CONFIG_MUTEX_TYPES</code>: Set to enable support for recursive and
    errorcheck mutexes.  Enables <code>pthread_mutexattr_settype()</code>.
    <code>CONFIG_PRIORITY_INHERITANCE</code>: Set to enable support for
    priority inheritance on mutexes and semaphores.
patacongo's avatar
patacongo committed
    Priority inheritance is a strategy of addressing
    <a href="NuttxUserGuide.html#priorityinversion"><i>priority inversion</i></a>.
    Details of the NuttX implementation of priority inheritance is
    discussed <a href="NuttxUserGuide.html#priorityinheritance">elsewhere</a>.
    <code>CONFIG_SEM_PREALLOCHOLDERS</code>: This setting is only used
    if priority inheritance is enabled.
    It defines the maximum number of different threads (minus one) that
    can take counts on a semaphore with priority inheritance support.
    This may be set to zero if priority inheritance is disabled OR if you
    are only using semaphores as mutexes (only one holder) OR if no more
    than two threads participate using a counting semaphore.
  </li>
    <code>CONFIG_SEM_NNESTPRIO</code>: If priority inheritance is enabled,
    then this setting is the maximum number of higher priority threads (minus
    1) than can be waiting for another thread to release a count on a semaphore.
    This value may be set to zero if no more than one thread is expected to
    wait for a semaphore.
  </li>
  <li>
    <code>CONFIG_FDCLONE_DISABLE</code>: Disable cloning of all file descriptors
    by task_create() when a new task is started.
    If set, all files/drivers will appear to be closed in the new task.
  </li>
  <li>
    <code>CONFIG_FDCLONE_STDIO</code>: Disable cloning of all but the first
    three file descriptors (stdin, stdout, stderr) by task_create()
    when a new task is started.
    If set, all files/drivers will appear to be closed in the new task except
    for stdin, stdout, and stderr.
  </li>
  <li>
    <code>CONFIG_SDCLONE_DISABLE</code>: Disable cloning of all socket
    desciptors by task_create() when a new task is started.
    If set, all sockets will appear to be closed in the new task.
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NXFLAT</code>: Enable support for the NXFLAT binary format.
    This format will support execution of NuttX binaries located
    in a ROMFS filesystem (see <code>examples/nxflat</code>).
  <li>
    <code>CONFIG_SCHED_WORKQUEUE</code>: Create a dedicated "worker" thread to
    handle delayed processing from interrupt handlers.  This feature
    is required for some drivers but, if there are not complaints,
    can be safely disabled.  The worker thread also performs
    garbage collection -- completing any delayed memory deallocations
    from interrupt handlers.  If the worker thread is disabled,
    then that clean will be performed by the IDLE thread instead
    (which runs at the lowest of priority and may not be appropriate
    if memory reclamation is of high priority).  If CONFIG_SCHED_WORKQUEUE
    is enabled, then the following options can also be used:
  </li>
  <li>
    <code>CONFIG_SCHED_WORKPRIORITY</code>: The execution priority of the worker
    thread.  Default: 50
  </li>
  <li>
    <code>CONFIG_SCHED_WORKPERIOD</code>: How often the worker thread checks for
    work in units of microseconds.  Default: 50*1000 (50 MS).
  </li>
  <li>
    <code>CONFIG_SCHED_WORKSTACKSIZE</code>: The stack size allocated for the worker
    thread.  Default: CONFIG_IDLETHREAD_STACKSIZE.
  </li>
  <li>
    <code>CONFIG_SIG_SIGWORK</code>: The signal number that will be used to wake-up
    the worker thread.  Default: 4
  </li>
patacongo's avatar
patacongo committed
</ul>

<p>
  The following can be used to disable categories of APIs supported
  by the OS.  If the compiler supports weak functions, then it
  should not be necessary to disable functions unless you want to
  restrict usage of those APIs.
</p>
<p>
  There are certain dependency relationships in these features.
</p>
<ul>
  <li>
    <code>mq_notify()</code> logic depends on signals to awaken tasks
    waiting for queues to become full or empty.
  </li>
  <li>
    <code>pthread_condtimedwait()</code> depends on signals to wake
    up waiting tasks.
  </li>
</ul>

<ul>
    <code>CONFIG_DISABLE_CLOCK</code>, <code>CONFI_DISABLE_POSIX_TIMERS</code>,
    <code>CONFIG_DISABLE_PTHREAD</code>, <code>CONFIG_DISABLE_SIGNALS</code>,
    <code>CONFIG_DISABLE_MQUEUE</code>, <code>CONFIG_DISABLE_MOUNTPOUNT</code>
patacongo's avatar
patacongo committed
</ul>

<h2>Miscellaneous libc settings</h2>

<ul>
  <li>
    <code>CONFIG_NOPRINTF_FIELDWIDTH</code>: sprintf-related logic is a
    little smaller if we do not support fieldwidthes
  </li>
  <li>
    <code>CONFIG_LIBC_FLOATINGPOINT</code>: By default, floating point
    support in printf, sscanf, etc. is disabled.
  </li>
patacongo's avatar
patacongo committed
</ul>

<h2>Allow for architecture optimized implementations</h2>

<p>
  The architecture can provide optimized versions of the
patacongo's avatar
patacongo committed
  following to improve system performance.
patacongo's avatar
patacongo committed
</p>

<ul>
<p>
  <code>CONFIG_ARCH_MEMCPY</code>, <code>CONFIG_ARCH_MEMCMP</code>, <code>CONFIG_ARCH_MEMMOVE</code>,
  <code>CONFIG_ARCH_MEMSET</code>, <code>CONFIG_ARCH_STRCMP</code>, <code>CONFIG_ARCH_STRCPY</code>,
  <code>CONFIG_ARCH_STRNCPY</code>, <code>CONFIG_ARCH_STRLEN</code>, <code>CONFIG_ARCH_BZERO</code>,
  <code>CONFIG_ARCH_KMALLOC</code>, <code>CONFIG_ARCH_KZMALLOC</code>, <code>ONFIG_ARCH_KFREE</code>,
</p>
</ul>

<h2>Sizes of configurable things (0 disables)</h2>

<ul>
  <li>
    <code>CONFIG_MAX_TASKS</code>: The maximum number of simultaneously
    active tasks.  This value must be a power of two.
  </li>
  <li>
    <code>CONFIG_NPTHREAD_KEYS</code>: The number of items of thread-
    specific data that can be retained
  </li>
  <li>
    <code>CONFIG_NFILE_DESCRIPTORS</code>: The maximum number of file
    descriptors (one for each open)
  </li>
  <li>
    <code>CONFIG_NFILE_STREAMS</code>: The maximum number of streams that
    can be fopen'ed
  </li>
  <li>
    <code>CONFIG_NAME_MAX</code>: The maximum size of a file name.
  </li>
  <li>
    <code>CONFIG_STDIO_BUFFER_SIZE</code>: Size of the buffer to allocate
    on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
  </li>
  <li>
    <code>CONFIG_NUNGET_CHARS</code>: Number of characters that can be
    buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
  </li>
  <li>
    <code>CONFIG_PREALLOC_MQ_MSGS</code>: The number of pre-allocated message
    structures.  The system manages a pool of preallocated
    message structures to minimize dynamic allocations
  </li>
  <li>
    <code>CONFIG_MQ_MAXMSGSIZE</code>: Message structures are allocated with
patacongo's avatar
patacongo committed
    a fixed payload size given by this setting (does not include
patacongo's avatar
patacongo committed
    other message structure overhead.
  </li>
  <li>
    <code>CONFIG_PREALLOC_WDOGS</code>: The number of pre-allocated watchdog
    structures.  The system manages a pool of preallocated
    watchdog structures to minimize dynamic allocations
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_PREALLOC_IGMPGROUPS</code>: Pre-allocated IGMP groups are used
    Only if needed from interrupt level group created (by the IGMP server).
    Default: 4
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_DEV_PIPE_SIZE</code>: Size, in bytes, of the buffer to allocated
    for pipe and FIFO support (default is 1024).
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
</ul>

patacongo's avatar
patacongo committed
<h2>File Systems</h2>
<ul>
  <li>
    <code>CONFIG_FS_FAT</code>: Enable FAT filesystem support.
  </li>
  <li>
    <code>CONFIG_FAT_SECTORSIZE</code>: Max supported sector size.
  </li>
  <li>
    <code>CONFIG_FS_ROMFS</code>: Enable ROMFS filesystem support
  </li>
</ul>

<h2>Device Drivers</h2>
<h3>SPI driver</h3>
<ul>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_SPI_OWNBUS</code> - Set if there is only one active device
    on the SPI bus.  No locking or SPI configuration will be performed.
    It is not necessary for clients to lock, re-configure, etc..
  </li>
  <li>
    <code>CONFIG_SPI_EXCHANGE</code>: Driver supports a single exchange method
    (vs a recvblock() and sndblock ()methods)
  </li>
</ul>

<h3>SPI-based MMC/SD driver</h3>
<ul>
  <li>
    <code>CONFIG_MMCSD_NSLOTS</code>: Number of MMC/SD slots supported by the driver. Default is one.
  </li>
  <li>
    <code>CONFIG_MMCSD_READONLY</code>: Provide read-only access.  Default is Read/Write
  </li>
  <li>
    <code>CONFIG_MMCSD_SPICLOCK</code>: Maximum SPI clock to drive MMC/SD card. Default is 20MHz.
  </li>
<h3>SDIO-based MMC/SD driver</h3>
<ul>
  <li>
    <code>CONFIG_FS_READAHEAD</code>: Enable read-ahead buffering
  </li>
  <li>
    <code>CONFIG_FS_WRITEBUFFER</code>: Enable write buffering
  </li>
  <li>
    <code>CONFIG_SDIO_DMA</code>: SDIO driver supports DMA
  </li>
  <li>
    <code>CONFIG_MMCSD_MMCSUPPORT</code>: Enable support for MMC cards
  </li>
  <li>
    <code>CONFIG_MMCSD_HAVECARDDETECT</code>: SDIO driver card detection is 100% accurate
  </li>
</ul>

<h3>RiT P14201 OLED driver</h3>
<ul>
  <li>
    <code>CONFIG_LCD_P14201</code>: Enable P14201 support
  </li>
  <li>
    <code>CONFIG_P14201_SPIMODE</code>: Controls the SPI mode
  </li>
  <li>
    <code>CONFIG_P14201_FREQUENCY</code>: Define to use a different bus frequency
  </li>
  <li>
    <code>CONFIG_P14201_NINTERFACES</code>:
      Specifies the number of physical P14201 devices that will be supported.
  </li>
  <li>
    <code>CONFIG_P14201_FRAMEBUFFER</code>:
      If defined, accesses will be performed using an in-memory copy of the OLEDs GDDRAM.
      This cost of this buffer is 128 * 96 / 2 = 6Kb.
patacongo's avatar
patacongo committed
      If this is defined, then the driver will be fully functional.
      If not, then it will have the following limitations:
      <ul>
        <li>Reading graphics memory cannot be supported, and</li>
        <li>All pixel writes must be aligned to byte boundaries.</li>
      </ul>
patacongo's avatar
patacongo committed
      The latter limitation effectively reduces the 128x96 disply to 64x96.
  </li>
</ul>

<h3>ENC28J60 Ethernet Driver Configuration Settings</h3>
<ul>
  <li>
    <code>CONFIG_NET_ENC28J60</code>: Enabled ENC28J60 support
  </li>
  <li>
    <code>CONFIG_ENC28J60_SPIMODE</code>: Controls the SPI mode
  </li>
  <li>
    <code>CONFIG_ENC28J60_FREQUENCY</code>: Define to use a different bus frequency
  </li>
  <li>
    <code>CONFIG_ENC28J60_NINTERFACES</code>:
      Specifies the number of physical ENC28J60 devices that will be supported.
  </li>
  <li>
    <code>CONFIG_ENC28J60_STATS</code>: Collect network statistics
  </li>
  <li>
    <code>CONFIG_ENC28J60_HALFDUPPLEX</code>: Default is full duplex
  </li>
</ul>

patacongo's avatar
patacongo committed
<h2>Network Support</h2>
<h3>TCP/IP and UDP support via uIP</h3>
patacongo's avatar
patacongo committed
<ul>
  <li>
    <code>CONFIG_NET</code>: Enable or disable all network features
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_IPv6</code>: Build in support for IPv6
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NSOCKET_DESCRIPTORS</code>: Maximum number of socket descriptors per task/thread.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_NACTIVESOCKETS</code>:  Maximum number of concurrent socket  operations (recv, send, etc.).
    Default: <code>CONFIG_NET_TCP_CONNS</code>+<code>CONFIG_NET_UDP_CONNS</code>.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_SOCKOPTS</code>: Enable or disable support for socket options.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_BUFSIZE</code>: uIP buffer size
    <code>CONFIG_NET_TCP</code>: TCP support on or off
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_TCP_CONNS</code>: Maximum number of TCP connections (all tasks).
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_TCPBACKLOG</code>:
    Incoming connections pend in a backlog until <code>accept()</code> is called.
    The size of the backlog is selected when <code>listen()</code> is called.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_TCP_READAHEAD_BUFSIZE</code>: Size of TCP read-ahead buffers
  </li>
  <li>
    <code>CONFIG_NET_NTCP_READAHEAD_BUFFERS</code>: Number of TCP read-ahead buffers (may be zero)
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_MAX_LISTENPORTS</code>: Maximum number of listening TCP ports (all tasks).
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_TCPURGDATA</code>: Determines if support for TCP urgent data
    notification should be compiled in. Urgent data (out-of-band data)
    is a rarely used TCP feature that is very seldom would be required.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_UDP</code>: UDP support on or off
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_UDP_CHECKSUMS</code>: UDP checksums on or off
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_UDP_CONNS</code>: The maximum amount of concurrent UDP connections
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_ICMP</code>: Enable minimal ICMP support. Includes built-in support
    for sending replies to received ECHO (ping) requests.
  </li>
  <li>
    <code>CONFIG_NET_ICMP_PING</code>: Provide interfaces to support application level
    support for sending ECHO (ping) requests and associating ECHO replies.
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_IGMP</code>:  Enable IGMPv2 client support.
  </li>
  <li>
    <code>CONFIG_PREALLOC_IGMPGROUPS</code>: Pre-allocated IGMP groups are used
    Only if needed from interrupt level group created (by the IGMP server).
    Default: 4
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_PINGADDRCONF</code>: Use "ping" packet for setting IP address
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_STATISTICS</code>: uIP statistics on or off
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_RECEIVE_WINDOW</code>: The size of the advertised receiver's window
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_ARPTAB_SIZE</code>: The size of the ARP table
patacongo's avatar
patacongo committed
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_NET_BROADCAST</code>: Incoming UDP broadcast support
  </li>
  <li>
    <code>CONFIG_NET_MULTICAST</code>: Outgoing multi-cast address support
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_LLH_LEN</code>: The link level header length
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_FWCACHE_SIZE</code>: number of packets to remember when looking for duplicates
patacongo's avatar
patacongo committed
  </li>
</ul>

<h3>UIP Network Utilities</h3>
<ul>
  <li>
    <code>CONFIG_NET_DHCP_LIGHT</code>: Reduces size of DHCP
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_RESOLV_ENTRIES</code>: Number of resolver entries
patacongo's avatar
patacongo committed
  </li>
</ul>

patacongo's avatar
patacongo committed
<h3>THTTPD</h3>
<ul>
  <li>
    <code>CONFIG_THTTPD_PORT</code>: THTTPD Server port number
  </li>
  <li>
    <code>CONFIG_THTTPD_IPADDR</code>: Server IP address (no host name)
  </li>
  <li>
    <code>CONFIG_THTTPD_SERVER_ADDRESS</code>: SERVER_ADDRESS: response
  </li>
  <li>
    <code>CONFIG_THTTPD_SERVER_SOFTWARE</code>: SERVER_SOFTWARE: response
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_THTTPD_PATH</code>: Server working directory. Default: <code>/mnt/www</code>.
patacongo's avatar
patacongo committed
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_THTTPD_CGI_PATH</code>: Path to CGI executables.  Default: <code>/mnt/www/cgi-bin</code>.
patacongo's avatar
patacongo committed
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_THTTPD_CGI_PATTERN</code>: Only CGI programs whose expanded paths
    match this pattern will be executed.  In fact, if this value is not defined
    then no CGI logic will be built. Default: <code>/mnt/www/cgi-bin/*</code>.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_THTTPD_CGI_PRIORITY</code>: Provides the priority of CGI child tasks
  </li>
  <li>
    <code>CONFIG_THTTPD_CGI_STACKSIZE</code>: Provides the initial stack size of
     CGI child task (will be overridden by the stack size in the NXFLAT
    header)
  </li>
  <li>
    <code>CONFIG_THTTPD_CGI_BYTECOUNT</code>: Byte output limit for CGI tasks.
  </li>
  <li>
    <code>CONFIG_THTTPD_CGI_TIMELIMIT</code>: How many seconds to allow CGI programs
    to run before killing them.
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_THTTPD_CHARSET</code>: The default character set name to use with
patacongo's avatar
patacongo committed
    text MIME types.
  </li>
  <li>
    <code>CONFIG_THTTPD_IOBUFFERSIZE</code>: 
  </li>
  <li>
    <code>CONFIG_THTTPD_INDEX_NAMES</code>: A list of index filenames to check. The
    files are searched for in this order.
  </li>
  <li>
    <code>CONFIG_AUTH_FILE</code>: The file to use for authentication. If this is
    defined then thttpd checks for this file in the local directory
    before every fetch. If the file exists then authentication is done,
    otherwise the fetch proceeds as usual. If you leave this undefined
    then thttpd will not implement authentication at all and will not
    check for auth files, which saves a bit of CPU time. A typical
    value is &quot;.htpasswd&quout;
  </li>
  <li>
    <code>CONFIG_THTTPD_LISTEN_BACKLOG</code>: The listen() backlog queue length.
  </li>
  <li>
    <code>CONFIG_THTTPD_LINGER_MSEC</code>: How many milliseconds to leave a connection
    open while doing a lingering close.
  </li>
  <li>
    <code>CONFIG_THTTPD_OCCASIONAL_MSEC</code>: How often to run the occasional
    cleanup job.
  </li>
  <li>
    <code>CONFIG_THTTPD_IDLE_READ_LIMIT_SEC</code>: How many seconds to allow for
    reading the initial request on a new connection.
  </li>
  <li>
    <code>CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC</code>: How many seconds before an
    idle connection gets closed.
  </li>
  <li>
    <code>CONFIG_THTTPD_TILDE_MAP1 and CONFIG_THTTPD_TILDE_MAP2</code>: Tilde mapping.
    Many URLs use ~username to indicate a user's home directory. thttpd
    provides two options for mapping this construct to an  actual filename.
    <ol>
      <li>
        Map ~username to &lt;prefix&gt;/username. This is the recommended choice.
        Each user gets a subdirectory in the main web tree, and the tilde
        construct points there. The prefix could be something like "users",
        or it could be empty.
      </li>
      <li>
        Map ~username to &lt;user's homedir&gt;/&lt;postfix&gt;. The postfix would be
        the name of a subdirectory off of the user's actual home dir,
        something like &quot;public_html&quot;.
      </li>
    </ol>
    You can also leave both options undefined, and thttpd will not do
    anything special about tildes. Enabling both options is an error.
    Typical values, if they're defined, are &quot;users&quot; for
    CONFIG_THTTPD_TILDE_MAP1 and &quot;public_html&quot; forCONFIG_THTTPD_TILDE_MAP2. 
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_THTTPD_GENERATE_INDICES</code>:
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_THTTPD_URLPATTERN</code>: If defined, then it will be used to match
		  and verify referrers.
  </li>
</ul>

<h2>USB Device-Side Support</h2>
<h3>USB Device Controller Driver</h3>
patacongo's avatar
patacongo committed
<ul>
  <li>
    <code>CONFIG_USBDEV</code>: Enables USB device support
  </li>
  <li>
    <code>CONFIG_USBDEV_ISOCHRONOUS</code>: Build in extra support for isochronous endpoints
  </li>
  <li>
    <code>CONFIG_USBDEV_DUALSPEED</code>: Hardware handles high and full speed operation (USB 2.0)
  </li>
  <li>
    <code>CONFIG_USBDEV_SELFPOWERED</code>: Will cause USB features to indicate that the device is self-powered
  </li>
  <li>
    <code>CONFIG_USBDEV_MAXPOWER</code>: Maximum power consumption in mA
  </li>
  <li>
    <code>CONFIG_USBDEV_TRACE</code>: Enables USB tracing for debug
  </li>
  <li>
    <code>CONFIG_USBDEV_TRACE_NRECORDS</code>: Number of trace entries to remember
  </li>
</ul>

<h3>USB Serial Device Class Driver</h3>
<ul>
  <li>
    <code>CONFIG_USBSER</code>: Enable compilation of the USB serial driver
  </li>
  <li>
    <code>CONFIG_USBSER_EPINTIN</code>: The logical 7-bit address of a hardware endpoint that supports interrupt IN operation
  </li>
  <li>
    <code>CONFIG_USBSER_EPBULKOUT</code>: The logical 7-bit address of a hardware endpoint that supports bulk OUT operation
  </li>
  <li>
    <code>CONFIG_USBSER_EPBULKIN</code>: The logical 7-bit address of a hardware endpoint that supports bulk IN operation
  </li>
  <li>
    <code>CONFIG_USBSER_NWRREQS</code> and <code>CONFIG_USBSER_NRDREQS</code>: The number of write/read requests that can be in flight
  </li>
  <li>
    <code>CONFIG_USBSER_VENDORID</code> and <code>CONFIG_USBSER_VENDORSTR</code>: The vendor ID code/string
  </li>
  <li>
    <code>CONFIG_USBSER_PRODUCTID</code> and <code>CONFIG_USBSER_PRODUCTSTR</code>: The product ID code/string
  </li>
  <li>
    <code>CONFIG_USBSER_RXBUFSIZE</code> and <code>CONFIG_USBSER_TXBUFSIZE</code>: Size of the serial receive/transmit buffers
  </li>
</ul>

<h3>USB Storage Device Configuration</h3>
<ul>
  <li>
    <code>CONFIG_USBSTRG</code>:
    Enable compilation of the USB storage driver
  </li>
  <li>
    <code>CONFIG_USBSTRG_EP0MAXPACKET</code>:
    Max packet size for endpoint 0
  </li>
  <li>
    <code>CONFIG_USBSTRGEPBULKOUT</code> and <code>CONFIG_USBSTRG_EPBULKIN</code>:
    The logical 7-bit address of a hardware endpoints that support bulk OUT and IN operations
  </li>
  <li>
    <code>CONFIG_USBSTRG_NWRREQS</code> and <code>CONFIG_USBSTRG_NRDREQS</code>:
    The number of write/read requests that can be in flight
  </li>
  <li>
    <code>CONFIG_USBSTRG_BULKINREQLEN</code> and <code>CONFIG_USBSTRG_BULKOUTREQLEN</code>:
    The size of the buffer in each write/read request.
    This value needs to be at least as large as the endpoint maxpacket and
    ideally as large as a block device sector.
  </li>
  <li>
    <code>CONFIG_USBSTRG_VENDORID</code> and <code>CONFIG_USBSTRG_VENDORSTR</code>:
    The vendor ID code/string
  </li>
  <li>
    <code>CONFIG_USBSTRG_PRODUCTID</code> and <code>CONFIG_USBSTRG_PRODUCTSTR</code>:
    The product ID code/string
  </li>
  <li>
    <code>CONFIG_USBSTRG_REMOVABLE</code>:
    Select if the media is removable
  </li>
</ul>

patacongo's avatar
patacongo committed
<h2>Graphics related configuration settings</h3>
<ul>
  <li>
    <code>CONFIG_NX</code>
patacongo's avatar
patacongo committed
    Enables overall support for graphics library and NX
  </li>
</ul>

<h3>NX configuration setting</h3>
<ul>
  <li>
    <code>CONFIG_NX_MULTIUSER</code>:
    Configures NX in multi-user mode.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NX_NPLANES</code>:
patacongo's avatar
patacongo committed
    Some YUV color formats requires support for multiple planes,
    one for each color component.  Unless you have such special
    hardware, this value should be undefined or set to 1.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NX_DISABLE_1BPP</code>, <code>CONFIG_NX_DISABLE_2BPP</code>,
    <code>CONFIG_NX_DISABLE_4BPP</code>, <code>CONFIG_NX_DISABLE_8BPP</code>
    <code>CONFIG_NX_DISABLE_16BPP</code>, <code>CONFIG_NX_DISABLE_24BPP</code>, and
    <code>CONFIG_NX_DISABLE_32BPP</code>:
patacongo's avatar
patacongo committed
    NX supports a variety of pixel depths.  You can save some
    memory by disabling support for unused color depths.
  </li>
  <li>
    <code>CONFIG_NX_PACKEDMSFIRST</code>:
patacongo's avatar
patacongo committed
    If a pixel depth of less than 8-bits is used, then NX needs
    to know if the pixels pack from the MS to LS or from LS to MS
  </li>
  <li>
    <code>CONFIG_NX_LCDDRIVER</code>:
    By default, NX builds to use a framebuffer driver (see <code>include/nuttx/fb.h</code>).
    If this option is defined, NX will build to use an LCD driver (see <code>include/nuttx/lcd.h</code>).
  </li>
patacongo's avatar
patacongo committed
    <code>CONFIG_LCD_MAXPOWER</code>:
    The full-on power setting for an LCD device.
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_LCD_MAXCONTRAST</code>:
    The maximum contrast value for an LCD device.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NX_MOUSE</code>:
    Build in support for mouse input.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NX_KBD</code>:
    Build in support of keypad/keyboard input.
  </li>
  <li>
    <code>CONFIG_NXTK_BORDERWIDTH</code>:
    Specifies with with of the border (in pixels) used with
    framed windows.   The default is 4.
  </li>
  <li>
    <code>CONFIG_NXTK_BORDERCOLOR1</code> and <code>CONFIG_NXTK_BORDERCOLOR2</code>:
    Specify the colors of the border used with framed windows.
    <code>CONFIG_NXTK_BORDERCOLOR2</code> is the shadow side color and so
    is normally darker.  The default is medium and dark grey,
    respectively
  </li>
  <li>
    <code>CONFIG_NXTK_AUTORAISE</code>:
    If set, a window will be raised to the top if the mouse position
    is over a visible portion of the window.  Default: A mouse
    button must be clicked over a visible portion of the window.
  </li>
  <li>
    <code>CONFIG_NXFONTS_CHARBITS</code>:
    The number of bits in the character set.  Current options are
    only 7 and 8.  The default is 7.
  </li>
  <li>
    <code>CONFIG_NXFONT_SANS</code>:
    At present, there is only one font.  But if there were were more,
    then this option would select the sans serif font.
patacongo's avatar
patacongo committed
  </li>
</ul>

<h3>NX Multi-user only options</h3>
<ul>
  <li>
    <code>CONFIG_NX_BLOCKING</code>
    Open the client message queues in blocking mode.  In this case,
    <code>nx_eventhandler()</code>  will not return until a message is received and processed.
patacongo's avatar
patacongo committed
  </li>