/*
 *
 *     Module Name: bsp.h
 *	       Version: 1.00
 *   Original Date: 08/18/99	
 *	        Author: Contact NetSilicon technical support if you have questions on this file.
 *	      Language: Ansi C
 * Compile Options:
 * Compile defines:
 *	     Libraries:
 *    Link Options:
 *
 *    Entry Points:
 *
 *  Copyrighted (c) by NETsilicon, Inc.  All Rights Reserved.
 *
 * Description.
 * =======================================================================
 *  This file defines BSP wide constants.
 *
 *
 *
 * Edit Date/Ver   Edit Description
 * ==============  =======================================================
 *
 */

#ifndef BSP_H
#define BSP_H

#include "Npttypes.h"
#include "bsp_api.h"
#include "tx_api.h"

#ifdef __cplusplus
extern "C"
{
#endif


 
/**
 * Constant that determines the format configuration settings in NVRAM 
 * for NET+OS development boards     
 *
 * NET+OS 5.0 and 5.1 users can   
 * set BSP_SERIAL_NUMBER_FORMAT to BSP_SERIAL_NUMBER_FORMAT_500
 * to use the serial number format used in 
 * NET+OS 5.0 and 5.1. 
 * The serial number is stored as eight digits.  The Ethernet
 * MAC address is calculated based on the last six digits.
 *
 *
 * New NET+OS 6.0 users should  
 * set BSP_SERIAL_NUMBER_FORMAT to BSP_SERIAL_NUMBER_FORMAT_600 to use the NET+OS 6.0
 * serial number format.  This format stores a serial number with
 * eight digits and one alpha character.  The Ethernet MAC address
 * is stored in a seperate field and is completely indpendent
 * of the serial number
 *
 * @category BSP_Configuration
 * @since 6.0
 * @name SerialNumberFormats    "Serial Number Formats"
 * @external
 * @see @link BSP_SERIAL_NUMBER_FORMAT
 *
 * @param BSP_SERIAL_NUMBER_FORMAT_500  Use NET+OS 5.0 format serial numbers and generate
 *                                      Ethernet MAC address from last 6 digits of serial number.
 * @param BSP_SERIAL_NUMBER_FORMAT_600  Use NET+OS 6.0 format serial numbers.  EThernet 
 *                                      MAC address will be stored seperately in NVRAM.
 */
#define BSP_SERIAL_NUMBER_FORMAT_500        0
#define BSP_SERIAL_NUMBER_FORMAT_600        1


/**
 * Constant that determines the format configuration settings in NVRAM
 * for NET+OS development boards    Set this value to 
 * either BSP_NVRAM_FORMAT_500 or BSP_NVRAM_FORMAT_600.
 *
 * @category BSP_Configuration
 * @since 6.0
 *
 * @external
 * @see @link SerialNumberFormats
 */
#define BSP_SERIAL_NUMBER_FORMAT            BSP_SERIAL_NUMBER_FORMAT_600



/**
 * BSP_TICKS_PER_SECOND determines the system clock rate.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_TICKS_PER_SECOND        100                 /* 100 Hz clock*/



/**
 * Set BSP_SERIAL_PORT_X to this value if you do not want
 * to include a driver for the port.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_SERIAL_PORT_1
 */
#define BSP_SERIAL_NO_DRIVER        0

/**
 * Set BSP_SERIAL_PORT_X to this value to include
 * the UART driver for the port.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_SERIAL_PORT_1
 */
#define BSP_SERIAL_UART_DRIVER      1

/**
 * Set BSP_SERIAL_PORT_X to this value 
 * to include the SPI driver for the port.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_SERIAL_PORT_1
 */
#define BSP_SERIAL_SPI_DRIVER       2

/**
 * Set BSP_SERIAL_PORT_X to this value 
 * to include the HDLC driver for the port.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_SERIAL_PORT_1
 */
#define BSP_SERIAL_HDLC_DRIVER      3

/**
 * Set BSP_SERIAL_PORT_API to one of these values to indicate which api will 
 * be used when BSP_SERIAL_UART_DRIVER is the driver selected for a port.  The
 * termios API is the newest, more featureful API and is recommended for use.
 * The legacy interface is deprecated and will eventually not be supported.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @name SerialPortApis
 * @see @link BSP_SERIAL_PORT_API
 *
 * @param BSP_SERIAL_API_TERMIOS	The driver uses the termios interface
 * @param BSP_SERIAL_API_LEGACY		The driver uses the legacy NetOS interface
 */
#define BSP_SERIAL_API_TERMIOS	0
#define BSP_SERIAL_API_LEGACY	1


/**
 * This constant determines the serial API used in the system when 
 * BSP_SERIAL_UART_DRIVER is the driver selected for a port.  
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @index BSP_SERIAL_PORT_API
 */
#define BSP_SERIAL_PORT_API	BSP_SERIAL_API_TERMIOS

/**
 * This constant determine whether the serial driver uses the internal fast
 * interrupt and TIMER2 to provide better servicing characteristics of the 
 * FIFO at high baud rates.  It is recommended that this be set to TRUE if
 * the port will be run at 115200 baud or higher.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @index BSP_SERIAL_FAST_INTERRUPT
 */
#define BSP_SERIAL_FAST_INTERRUPT	FALSE

/**
 * This constant controls which serial driver is built in
 * the BSP for serial port 1.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @index BSP_SERIAL_PORT_1
 */
#define BSP_SERIAL_PORT_1       BSP_SERIAL_UART_DRIVER

/**
 * This constant controls which serial driver is built in
 * the BSP for serial port 2.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_SERIAL_PORT_2       BSP_SERIAL_UART_DRIVER



/**
 * Set this constant to TRUE to build the IEEE-1284 parallel port driver.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_INCLUDE_PARALLEL_DRIVER     TRUE

/**
 * Set this constant to TRUE to include the NUL driver.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_INCLUDE_NUL_DRIVER          TRUE

/**
 * Set this constant to TRUE to include the loopback driver.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_INCLUDE_LOOPBACK_DRIVER     TRUE

/**
 * Set this constant to TRUE to include the UPD debug driver.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_INCLUDE_UDP_DEBUG_DRIVER    TRUE

/**
 * Set this constant to TRUE to add the PPP devices into the TCP/IP
 * stack's table of devices.  Set it to FALSE if you do not intend
 * to use PPP.
 *
 * @category general_purpose
 * @since 6.0
 *
 * @external
 * @see @link PPP
 */
#define BSP_WANT_PPP                        TRUE


/**
 * This constant sets the priority level for high priority threads.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_HIGH_PRIORITY               8

/**
 * This constant sets the priority level for medium priority threads.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_MEDIUM_PRIORITY             16

/**
 * This constant sets the priority level for low priority threads.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_LOW_PRIORITY                24


/**
 * This constant sets the default priority level for threads.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_DEFAULT_PRIORITY            BSP_MEDIUM_PRIORITY

/**
 * This constant sets the priority level for the FTP server thread.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */
#define BSP_FTP_SERVER_PRIORITY         BSP_MEDIUM_PRIORITY

/**
 * This constant sets the priority level for the SNMP agent thread.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_SNMP_AGENT_PRIORITY         BSP_MEDIUM_PRIORITY

/**
 * This constant sets the priority level for the Telnet server thread.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_TELNET_SERVER_PRIORITY      BSP_MEDIUM_PRIORITY

/**
 * This constant sets the priority level for the SNTP server thread.
 * ThreadX priority levels range from 0 to 31 with 0 being the highest.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_SNTP_THREAD_PRIORITY        BSP_MEDIUM_PRIORITY


/**
 * This constant sets the UDP port on the UDP debug device.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_UDP_DEBUG_PORT              12345


/**
 * Set BSP_NVRAM_DRIVER to this value if no NVRAM driver is to be
 * built.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_NONE                      0

/**
 * Set BSP_NVRAM_DRIVER to this value if the EEPROM driver is to be
 * built.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_EEPROM                    1

/**
 * Set BSP_NVRAM_DRIVER to this value if the last sector of flash
 * is to be used for NVRAM.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_LAST_FLASH_SECTOR         2

/**
 * Set BSP_NVRAM_DRIVER to this value to build the serial EEPROM
 * driver.  
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_SEEPROM                   3

/**
 * Set BSP_NVRAM_DRIVER to this value to build the serial EEPROM
 * driver with semaphore protection.  
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_SEEPROM_WITH_SEMAPHORES   4

/**
 * Set BSP_NVRAM_DRIVER to this value if the NVRAM functionality
 * will be provided by platform specific functions in "bsp.c".
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_CUSTOM                    255


/*
 * This constant determines which NVRAM driver will be built.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @index BSP_NVRAM_DRIVER
 */
#define BSP_NVRAM_DRIVER    BSP_NVRAM_EEPROM //BSP_NVRAM_LAST_FLASH_SECTOR



/**
 * If an EEPROM exists, the BSP expects it to be connected to CS3.  
 * At power up, the BSP will configure CS3 to support an EEPROM
 * if BSP_NVRAM_DRIVER is set to BSP_NVRAM_EEPROM.  This constant
 * determines where the part should be mapped to in memory.
 *
 * @since 3.0
 * @external
 * @category general_purpose
 */
#define BSP_EEPROM_BASE     0x3000000

/**
 * If an EEPROM exists, the BSP expects it to be connected to CS3.  
 * At power up, the BSP will configure CS3 to support an EEPROM
 * if BSP_NVRAM_DRIVER is set to BSP_NVRAM_EEPROM.  This constant
 * determines the size of the part.
 *
 * @since 3.0
 * @external
 * @category general_purpose
 */
#define BSP_EEPROM_SIZE     0x2000


/**
 * BSP_RAM_BASE sets address of RAM.  
 *
 * @since 3.0
 * @external
 * @category general_purpose
 */
#define BSP_RAM_BASE 0x00000000

/**
 * BSP_ROM_BASE sets base address of ROM.
 *
 * @since 1.0
 * @external
 * @category general_purpose
 */

#define BSP_ROM_BASE 0x02000000

/**
 * BSP_FLASH_BANKS sets the number of flash memory banks.  The number of
 * flash banks is the number of flash chips located in memory where one
 * chip follows another in the address map.
 * For example, 2 16-bit chips wired up as 16-bit flash would count as 2 
 * Flash banks.  2 16-bit chips wired up as 32-bit flash (in parallel) 
 * would count as 1 bank.  4 16-bit chips wired up as 32-bit flash would
 * count as 2 banks (2 pairs of chips where the pairs follow each other in
 * the address map).
 *
 * @since 5.0
 * @external
 * @category general_purpose
 */
#define BSP_FLASH_BANKS  1


/**
 *  BSP_STARTUP_DELAY defines number of additional seconds the system 
 *  will wait, before starting the application. Used on NS7520 chip to 
 *  let some network be received to use as a ramdom seed. 
 *
 * @since 5.1
 * @external
 * @category general_purpose
 */
#define BSP_STARTUP_DELAY       2


/**
 * This mask must be anded with the address mask written to CSOR registers to
 * setup the chip select to support standard NET+OS caching.  Doing this causes
 * the memory attached to the CS to appear in 4 different places in the 
 * address space.  The cache controller is then configured to set different
 * cache options for each of the regions.
 *
 * @since 3.0
 * @external
 * @category general_purpose
 */
#define BSP_CACHE_MASK      0xf3ffffff

/**
 * If BSP_AUTOMATICALLY_ENABLE_CACHE is set, then the BSP startup code will
 * enable cache if it is present on the processor.  This constant is useful
 * if you will (or may in the future) run your firmware on different chips
 * that have or don't have cache.  Setting it TRUE will cause the BSP to 
 * turn cache on if it detects it in the chip.  Setting it FALSE will cause
 * it leave cache off whether the chip supports it or not.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_AUTOMATICALLY_ENABLE_CACHE  TRUE


/**
 * If BSP_BUILD_CACHE_DRIVER is set, then the cache driver will be built
 * as part of the BSP library.  Otherwise only stub routines will be built.
 * Use this option to reduce the BSP code size if you are sure you do not
 * want to use cache.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_BUILD_CACHE_DRIVER          TRUE


/**
 * Set this constant to TRUE to include the Real Time Clock driver.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_INCLUDE_RTC_DRIVER          0

/**
 * Set this constant to TRUE to include the file system in C library.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY          0

/**
 * Set BSP_WATCHDOG_TYPE to this value to build the watchdog APIs
 * using external watchdog timer chip
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_WATCHDOG_TYPE
 */
#define BSP_WATCHDOG_EXTERNAL   0

/**
 * Set BSP_WATCHDOG_TYPE to this value to build the watchdog APIs
 * using internal watchdog timer circuit on NETARM chip
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_WATCHDOG_TYPE
 */
#define BSP_WATCHDOG_INTERNAL   1

/**
 * This constant determines which type of watchdog timer will be 
 * used for watchdog APIs.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_WATCHDOG_TYPE          BSP_WATCHDOG_INTERNAL

/**
 * Set BSP_HANDLE_FATAL_ERROR to this value to trigger a reset when fatal
 * errors are encountered.
 *
 * Set BSP_HANDLE_UNEXPECTED_EXCEPTION to this value to trigger a reset
 * when an unexpected exception occurs.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_HANDLE_FATAL_ERROR
 * @see @link BSP_HANDLE_UNEXPECTED_EXCEPTION
 */
#define BSP_ERROR_RESET_UNIT        0

/**
 * Set BSP_HANDLE_UNEXPECTED_EXCEPTION to this value to cause the error
 * handler to report the error.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_HANDLE_FATAL_ERROR
 * @see @link BSP_HANDLE_UNEXPECTED_EXCEPTION
 */
#define BSP_ERROR_REPORT_ERROR      1

/**
 * Set BSP_HANDLE_UNEXPECTED_EXCEPTION to this value to cause the exception
 * handler to attempt to continue execution when an unexpected exception
 * is encountered.  This is not recommended.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 * @see @link BSP_HANDLE_FATAL_ERROR
 * @see @link BSP_HANDLE_UNEXPECTED_EXCEPTION
 */
#define BSP_ERROR_CONTINUE          2

/**
 * This constant determines how fatal errors are handled.  The possible values for
 * BSP_HANDLE_FATAL_ERROR are:
 *      
 *      BSP_ERROR_RESET_UNIT    Unit is reset unless a debugger ICE was detected during
 *                              initialization.  If an ICE was detected, then the LEDs
 *                              are blinked in a pattern that indicates the error
 *                              condition, and it is possible to continue execution in
 *                              the debugger.
 *      BSP_ERROR_REPORT_ERROR  BSP blinks LEDs in a pattern that indicates the type of
 *                              error that occurred.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_HANDLE_FATAL_ERROR              BSP_ERROR_REPORT_ERROR

/**
 * This constant determines how unexpected exceptions are handled.  The possible
 * values for BSP_HANDLE_UNEXPECTED_EXCEPTION are:
 *
 *      BSP_ERROR_RESET_UNIT    Unit is reset unless a debugger ICE was detected during
 *                              initialization.  If an ICE was detected, then the LEDs
 *                              are blinked in a pattern that indicates the error
 *                              condition, and it is possible to continue execution in
 *                              the debugger.
 *      BSP_ERROR_REPORT_ERROR  BSP blinks LEDs in a pattern that indicates the type of
 *                              error that occurred.
 *      BSP_ERROR_CONTINUE      the exception handler attempts to continue execution.  The
 *                              recovery procedure is to adjust the return address of the
 *                              exception to restart execution on the next instruction 
 *                              after the one that causes the exception.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_HANDLE_UNEXPECTED_EXCEPTION     BSP_ERROR_REPORT_ERROR

    

/**
 *      This directive determines the clock source to be used.  It is 
 *      the address input to the SYSCLK signal multiplexer.  The SYSCLK 
 *      has two possible sources, one from the TTL clock input applied 
 *      to the XTAL1 pin, and the other from the Crystal Oscillator and 
 *      Phase Lock Loop circuit.
 *
 *      When BSP_CLOCK_SOURCE = 0 = SELECT_THE_XTAL1_INPUT
 *          SYSCLK uses the XTAL1 its source.
 *
 *      When BSP_CLOCK_SOURCE = 1 = SELECT_THE_CRYSTAL_OSCILLATOR_INPUT
 *          SYSCLK uses the Crystal Ocsillator and PLL as its source.
 *
 *
 * @since 5.1
 * @external
 * @category general_purpose
 */
#define BSP_CLOCK_SOURCE    SELECT_THE_CRYSTAL_OSCILLATOR_INPUT

/**
 *      This is used to define a callback function for SNTP. BSP initializes
 *		SNTP with this callback definition.
 *
 * @since 5.1
 * @external
 * @category SNTP
 * @name sntp_callback
 *
 * @note APP_USE_NETWORK_TIME_PROTOCOL must be defined in the application to enable SNTP.
 */
#define BSP_SNTP_CALLBACK    NULL

/**
 * This constant determines how the Ethernet link is monitored. 
 * Set BSP_USE_PHY_INTERRUPT to TRUE to use PHY interupt to minitor the Ethernet link.
 * Set BSP_USE_PHY_INTERRUPT to FALSE to use 500ms ThreadX timer to minitor the link.
 *
 * BSP_USE_PHY_INTERRUPT should be set to TRUE only on platforms that support PHY interupt.
 *
 * @since 6.0
 * @external
 * @category general_purpose
 */
#define BSP_USE_PHY_INTERRUPT   TRUE

/**
 * This constant determines how the TCP/IP stack implements its critical section. 
 * Set BSP_LOW_INTERRUPT_LATENCY to TRUE to use a semaphome to for the TCP/IP critical section.
 * Set BSP_LOW_INTERRUPT_LATENCY to FALSE to disable processor interrupts to implement 
 * the TCP/IP critical section.
 *
 * @since 6.1
 * @external
 * @category general_purpose
 */
#define BSP_LOW_INTERRUPT_LATENCY   FALSE

/**
 * This constant enables IP address 'ct detection, during initial IP address configuration.
 * If BSP_ENABLE_ADDR_CONFLICT_DETECTION is defined to TRUE, ACE subsystem sends ARP probes 
 * to detect IP address conflict for BOOTP, RARP, Ping ARP, and static IP address protocols.
 *
 * IP address conflict detection must also be enabled on a network device. The device 
 * configuration for IP address conflict detection can be retrieved by NAGetAddrConflictData
 * function.
 *
 * @since 6.2
 * @external
 * @category BSP_Configuration
 */
#define BSP_ENABLE_ADDR_CONFLICT_DETECTION          FALSE


/**
 * This constant specifies default number of ARP probes, sent to detect IP address 
 * conflict on Ethernet. Used for BOOTP, RARP, Ping ARP, and static IP address protocols.
 *
 * An ARP probe is an ARP request with source protocol address equal to 0.
 *
 * @since 6.2
 * @external
 * @category BSP_Configuration
 */
#define BSP_DEFAULT_ETH_NUM_ADDR_PROBES             4

/**
 * This constant specifies an interval in milliseconds between ARP probes, sent to detect IP 
 * address conflict on Ethernet. Used for BOOTP, RARP, Ping ARP, and static IP address protocols.
 *
 * @since 6.2
 * @external
 * @category BSP_Configuration
 */
#define BSP_DEFAULT_ETH_PROBE_INTERVAL_MS           200

/**
 * This constant specifies default number of ARP address announcements, sent on Ethenet, after 
 * the IP address has been configured. Used for BOOTP, RARP, Ping ARP, and static IP address 
 * protocols.
 *
 * An ARP announcement is an ARP request with both source and destination protocol address 
 * equal the interface IP address.
 * 
 * @since 6.2
 * @external
 * @category BSP_Configuration
 */
#define BSP_DEFAULT_ETH_NUM_ADDR_ANNOUNCEMENTS      2

/**
 * This constant specifies an interval in milliseconds between ARP address announcements, sent 
 * after the IP address has been configured. Used for BOOTP, RARP, Ping ARP, and static IP address 
 * protocols.
 *
 * @since 6.2
 * @external
 * @category BSP_Configuration
 */
#define BSP_DEFAULT_ETH_ANNOUNCE_INTERVAL_MS        2000

/**
 * This constant specifies maximum number of IP asddress conflicts during IP address 
 * configuration. Reaching BSP_MAX_ADDR_CONFLICTS for the virtual interface causes ACE 
 * to be stopped on this interface.
 *
 * @since 6.1
 * @external
 * @category BSP_Configuration
 */
#define BSP_MAX_ADDR_CONFLICTS                      3


typedef struct
{

    /*  Flag that signifies if Internal Oscillator is used
        When non-zero PLLTST_SELECT is set to  SELECT_THE_CRYSTAL_OSCILLATOR_INPUT
        otherwise, PLLTST_SELECT is set to  SELECT_THE_XTAL1_INPUT */
    const unsigned int usesInternalOscillator;

    /*  CS0 (Flash) wait states (legal range 0-f)   */
    const unsigned int cs0WaitStates;

    /*  CS0 (Flash) bcyc value (legal range 0-3)    */
    const unsigned int cs0BusCycles;

    /*  CS0 (Flash) bsize value (legal range 0-3)   */
    const unsigned int cs0BusSize;
    
    /*  CS0 (Flash) rsync enable (legal range 0,1)  */
    /*  For 20UM this filed is OE field of chip select option register A. (legal range 0,1)  */
    const unsigned int cs0UseRsync;
    
    /*  CS0 (Flash) burst enable (legal range 0,1)  */
    const unsigned int cs0AddRegBurst;
    
    /*  CS1 (Fast Page) EDO Mode setting -- the 50 supports EDO (legal range 0,1)   */
    const unsigned int cs1EdoMode;
    
    /*  CS1 Idle bit flag -- sets the CS1 idle bit (legal range 0,1)    */
    const unsigned int cs1IdleBit;
    
    /*  CS1 (EDORAM) wait states (legal range 0-f)  */
    const unsigned int cs1EdoWaitStates;
    
    /*  CS1 (EDORAM) bcyc value (legal range 0-3)   */
    const unsigned int cs1EdoBusCycles;
    
    /*  CS1 (EDORAM) bsize value (legal range 0-3)  */
    const unsigned int cs1EdoBusSize;
    
    /*  CS1 (SDRAM) wait states (legal range 0-f)   */
    const unsigned int cs1SdWaitStates;
    
    /*  CS1 (SDRAM) bcyc value (legal range 0-3)    */
    const unsigned int cs1SdBusCycles;
    
    /*  CS1 (SDRAM) bsize value (legal range 0-3)   */
    const unsigned int cs1SdBusSize;
    
    /*  CS3 (NVRAM) wait states (legal range 0-f)   */
    const unsigned int cs3WaitStates;
} NAInitRegisterType;

extern const NAInitRegisterType NANetarmInitData[];

extern unsigned const NAInterruptPriority[];

extern const unsigned int NAOptRegWaitAndBurstMask;

extern const unsigned int NAOptRegRsyncMask;

extern unsigned int NAgetPllValueBasedOnChipType(void);


extern unsigned int NAusesTheInternalOscillator(void);


/*
 * Error check the serial port selections
 */
#if (BSP_SERIAL_PORT_2 != BSP_SERIAL_NO_DRIVER)
    #if (BSP_SERIAL_PORT_1 == BSP_SERIAL_NO_DRIVER)
        #error  Serial port 2 cannot be used without serial port 1
    #endif
#endif

/**
 * Set BSP_ENI_HOST_DRIVER this value as the Host
 * ENI driver. 
 *
 * @since 3.0
 * @extern
 * @category ENI
 */
#define BSP_ENI_HOST_DRIVER             1

/**
 * Set BSP_ENI_CLIENT_DRIVER this value as the Client
 * ENI driver.
 *
 * @since 3.0
 * @extern
 * @category ENI
 */
#define BSP_ENI_CLIENT_DRIVER           2

/**
 * Set BSP_ENI_PORT to this value to configure the ENI port to be 
 * a client or host. ENI port is defined as Client or Host driver
 *
 * @since 3.0
 * @extern
 * @category ENI
 */
#define BSP_ENI_PORT					BSP_ENI_HOST_DRIVER


#ifdef __cplusplus
}
#endif

#endif
