nai2s: I2S (audio) sample application

This sample application will demonstrates how to use I2S driver API
functions to play audio files. 

Running this sample application requires external hardware to interconnect to 
your Digi JumpStart Kit Development board.  This readme provides instructions 
based on the Digi FIM Application Kit (Digi P/N DG-ACC-FIM).

Please note it is not mandatory to use the FIM Application kit to successfully 
run this application; prototype hardware can be built up in its place.  
However, the FIM Application Kit provides a standard reference design platform 
with all the hardware components and accessory items necessary for immediate 
prototyping of NET+OS applications with FIM-based I/O capabilities.

The FIM Application Kit (Digi P/N DG-ACC-FIM) supports the ConnectCore 9P  9215, 
Digi Connect ME 9210, and NS9210/9215 chip development platforms.  
Complete documentation and schematics for the FIM Application Kit are available 
in the "Application Kit" section on the Digi technical support website at 
www.digi.com/support.

Please also visit the www.digiembedded.com for additional information and purchase options.

Connecting and configuring your FIM Application Kit board
-----------------------------------------------------------------------
The application requires FIM0 to be configured as I2S
and connected to the I2S section of the FIM Application board.  
The FIM Application board contains codec and audio line out port.

Please refer to the FIM Application Kit Quick Start Guide and the Hardware Reference
Manual (HRM) for guidance on how connect and configure your FIM Application Kit board.

ConnectCore 9P9215 Platform Configuration
=========================================

Setting GPIO pins for FIM0:
---------------------------

1. Make sure the folloing values are configured in gpio.h:
   BSP_GPIO_MUX_IOP_0_GEN_IO_0 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH.
   BSP_GPIO_MUX_IOP_0_GEN_IO_1 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH.
   BSP_GPIO_MUX_IOP_0_GEN_IO_2 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH.

2. Make sure the following values are configured in bsp_iop.h:
   BSP_IOP_FIM0_I2S_WS is set to BSP_IOP_GEN_IO_0
   BSP_IOP_FIM0_I2S_SD is set to BSP_IOP_GEN_IO_1
   BSP_IOP_FIM0_I2S_CLK is set to BSP_IOP_GEN_IO_2

3. Make sure APP_I2S_INTF is defined "/i2s/0" in root.c.

Setting GPIO pins for FIM1:
---------------------------

1. Make sure the folloing values are configured in gpio.h:
   BSP_GPIO_MUX_IOP_1_GEN_IO_4 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH.
   BSP_GPIO_MUX_IOP_1_GEN_IO_5 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH.
   BSP_GPIO_MUX_IOP_1_GEN_IO_6 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH.

2. Make sure the following values are configured in bsp_iop.h:
   BSP_IOP_FIM1_I2S_WS is set to BSP_IOP_GEN_IO_4.
   BSP_IOP_FIM1_I2S_SD is set to BSP_IOP_GEN_IO_5.
   BSP_IOP_FIM1_I2S_CLK is set to BSP_IOP_GEN_IO_6.

3. Make sure APP_I2S_INTF is defined "/i2s/1" in root.c.

Connect ME 9210 Platform Configuration
======================================

Setting GPIO pins for FIM0:
---------------------------

1. Make sure the folloing values are configured in gpio.h:
   BSP_GPIO_MUX_IOP_0_GEN_IO_0 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH.
   BSP_GPIO_MUX_IOP_0_GEN_IO_1 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH.
   BSP_GPIO_MUX_IOP_0_GEN_IO_2 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH.

2. Make sure the following values are configured in bsp_iop.h:
   BSP_IOP_FIM0_I2S_WS      BSP_IOP_GEN_IO_0
   BSP_IOP_FIM0_I2S_SD      BSP_IOP_GEN_IO_1
   BSP_IOP_FIM0_I2S_CLK     BSP_IOP_GEN_IO_2

3. Make sure BSP_GPIO_MUX_SERIAL_A is set to BSP_GPIO_MUX_SERIAL_2_WIRE_UART or 
   BSP_GPIO_MUX_INTERNAL_USE_ONLY in gpio.h.

   If BSP_GPIO_MUX_SERIAL_A is set to BSP_GPIO_MUX_INTERNAL_USE_ONLY, you need
   to update dialog and stdio ports to use "/com/2" in bsp_sys.h

4. Make sure IO1, IO2 and IO3 is selected in SW3 for GPIO selections on the board.

5. Make sure APP_I2S_INTF is defined "/i2s/0" in root.c.

What it does?
=============
1. This application runs the FTP server which can process and play the audio
   wave file. The file must match following criteria

  a. Wave file format must be WAVE_FORMAT_PCM
  b. Mono or stereo (number of channels 1 or 2)
  c. Bits per sample must be 8, 16 or 24 bits
  d. Average bytes per second must be less than or equal to 225000 (1.8 MHz, 
     for 300 MHz FIM clock). This will scale linearly as the FIM clock rate
     is reduced.   

2. Use any FTP client to send the audio file which fits above criteria
3. Application will process the file, configures the driver and finally 
   streams the audio data to the I2S driver
4. Status will be displayed on the serial console
5. User can hit any key to pause or resume the streaming 

The application uses the following files located in the
netos\src\linkerScripts directory.  These files are generated
when the BSP is built.

bootldr.dat     bootloader configuration file used to generate the
                file image.bin.  It controls the information placed
                in the bootloader header of the image.

image.ldr       GNU linker script used to build an image that can
                be debugged and used with the bootloader.
                
customize.ldr   Customizable GNU linker script
