/*
 *
 *     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

/**
 * Set this manifest constant to TRUE if the Ethernet driver should use
 * the LED indicated by LED_ETHERNET to indicate when it is receiving
 * and transmitting packets.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 */
#define BSP_WANT_ETHERNET_ACTIVITY_LED      FALSE


/**
 * 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/5.1 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 BSP_Configuration
 */
#define BSP_TICKS_PER_SECOND        100                 /* 100 Hz clock*/



/**
 * Set BSP_SERIAL_PORT_1 and BSP_SERIAL_PORT_2 to one of these values to
 * indicate what type of serial driver should be built for the port.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @name SerialPortConfigurations   "Serial Port Configurations"
 * @see @link BSP_SERIAL_PORT_1
 * @see @link BSP_SERIAL_PORT_2
 *
 * @param BSP_SERIAL_NO_DRIVER      Serial port will not be used
 * @param BSP_SERIAL_UART_DRIVER    Serial port will be used in standard UART mode
 * @param BSP_SERIAL_SPI_DRIVER     Serial port will be used in SPI mode
 * @param BSP_SERIAL_HDLC_DRIVER    Serial port will be used in HDLC mode
 */
#define BSP_SERIAL_NO_DRIVER        0
#define BSP_SERIAL_UART_DRIVER      1
#define BSP_SERIAL_SPI_DRIVER       2
#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             "Serial Port APIs"
 * @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
 * @see @link SerialPortApis
 */
#define BSP_SERIAL_PORT_API	BSP_SERIAL_API_TERMIOS

/**
 * This constant determines 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 BSP_Configuration
 * @index BSP_SERIAL_PORT_1
 * @see @link SerialPortConfigurations
 */
#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 BSP_Configuration
 * @see @link SerialPortConfigurations
 */
#define BSP_SERIAL_PORT_2       BSP_SERIAL_NO_DRIVER

/**
 * Set this constant to TRUE to build the IEEE-1284 parallel port driver.  This
 * driver can only be used on the NET+50 revision D development board.
 *
 * @since 1.0
 * @external
 * @category BSP_Configuration
 */
#define BSP_INCLUDE_PARALLEL_DRIVER     FALSE

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

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

/**
 * Set this constant to TRUE to include the UPD debug driver.
 *
 * @since 1.0
 * @external
 * @category BSP_Configuration
 */
#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 BSP_Configuration
 * @since 6.0
 *
 * @external
 * @see @link PPP
 */
#define BSP_WANT_PPP                        TRUE



/**
 * These manifest constants determine the ThreadX priority levels for
 * various server processes created by the API libraries.  ThreadX
 * priority levels range from 0 to 31 with 0 being the highest.  Threads
 * with greater priority can preempt threads
 * with lower priority.
 *
 * @since 1.0
 * @external
 * @category BSP_Configuration
 * @name ThreadPriorityLevels           "Thread Priority Levels"
 *
 * @param BSP_HIGH_PRIORITY             priority level for threads that need to be able to preempt
 *                                      most other threads
 * @param BSP_MEDIUM_PRIORITY           normal priority level for threads
 * @param BSP_LOW_PRIORITY              priority level for threads that should run at a low
 *                                      priority level (and be preemptable by most other threads)
 * @param BSP_DEFAULT_PRIORITY          default priority level for threads
 * @param BSP_FTP_SERVER_PRIORITY       priority level for FTP server thread
 * @param BSP_SNMP_AGENT_PRIORITY       priority level for SNMP agent thread
 * @param BSP_TELNET_SERVER_PRIORITY    priority level for Telnet server thread
 * @param BSP_SNTP_THREAD_PRIORITY      priority level for SNTP client thread
 */
#define BSP_HIGH_PRIORITY               8
#define BSP_MEDIUM_PRIORITY             16
#define BSP_LOW_PRIORITY                24
#define BSP_DEFAULT_PRIORITY            BSP_MEDIUM_PRIORITY
#define BSP_FTP_SERVER_PRIORITY         BSP_MEDIUM_PRIORITY
#define BSP_SNMP_AGENT_PRIORITY         BSP_MEDIUM_PRIORITY
#define BSP_TELNET_SERVER_PRIORITY      BSP_MEDIUM_PRIORITY
#define BSP_SNTP_THREAD_PRIORITY        BSP_MEDIUM_PRIORITY



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


/**
 * BSP_NVRAM_DRIVER must be set to one of these constants to determine
 * which driver should be built as part of the BSP.  The constants
 * select between different types of physical memory used for NVRAM.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 * @name NvramDriverConfigurations      "NVRAM Driver Configurations"
 *
 * @param BSP_NVRAM_NONE                do not build an NVRAM driver
 * @param BSP_NVRAM_EEPROM              NVRAM is implemented in an EEPROM attached to CS3
 * @param BSP_NVRAM_LAST_FLASH_SECTOR   the last sector of flash is used for NVRAM
 * @param BSP_NVRAM_SEEPROM             NVRAM is implemented using a serial EEPROM
 * @param BSP_NVRAM_SEEPROM_WITH_SEMAPHORES NVRAM is implemented using a serial EEPROM and access
 *                                      to it should be protected with semaphores
 * @param BSP_NVRAM_CUSTOM              platform specific versions of the functions
 *                                      declared in narmnvrm.h will be used
 */
#define BSP_NVRAM_NONE                      0
#define BSP_NVRAM_EEPROM                    1
#define BSP_NVRAM_LAST_FLASH_SECTOR         2
#define BSP_NVRAM_SEEPROM                   3
#define BSP_NVRAM_SEEPROM_WITH_SEMAPHORES   4
#define BSP_NVRAM_CUSTOM                    255


/**
 * This constant determines which NVRAM driver will be built.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @index BSP_NVRAM_DRIVER
 * @see @link NvramDriverConfigurations
 *
 * @note    Applications that run directly out of flash memory cannot use the
 *          flash for NVRAM.  BSP_NVRAM_DRIVER must not be set to
 *          BSP_NVRAM_LAST_FLASH_SECTOR for these applications.
 */
#define BSP_NVRAM_DRIVER    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 BSP_Configuration
 */
#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 BSP_Configuration
 */
#define BSP_EEPROM_SIZE     0x2000


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

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

#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 BSP_Configuration
 */
#define BSP_FLASH_BANKS  1


/**
 *  BSP_STARTUP_DELAY defines number of additional seconds the system
 *  will delay before starting the TCP/IP stack and the application.
 *  The delay is used to receive network traffic.  The Ethernet statistics
 *  are used to generate a random seed for the TCP/IP stack.  The stack
 *  uses the random seed to generate unique sequence numbers for
 *  connections.  This is necessary to ensure that new connections will
 *  not collide with old connections that may have
 *  been open when the unit was reset.
 *
 * @note    You must specify a non-zero delay if your platform uses the
 *          NS7520 since it does not have a random number generator.
 *
 * @since 5.1
 * @external
 * @category BSP_Configuration
 */
#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 BSP_Configuration
 */
#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 BSP_Configuration
 */
#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 BSP_Configuration
 */
#define BSP_BUILD_CACHE_DRIVER          TRUE


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


/**
 * Set this constant to TRUE to have the BSP initialize the file system
 * according to configuration values in startfilesystem.c, and enable
 * the C Library file I/O functions as well as the file system's native
 * API.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 */
#define BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY          0

/**
 * BSP_WATCHDOG_TYPE must be set to one of these constants.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @see @link BSP_WATCHDOG_TYPE
 * @name WatchdogDriverConfigurations   "Watchdog Driver Configurations"
 *
 * @param BSP_WATCHDOG_EXTERNAL Set BSP_WATCHDOG_TYPE to this value to build the watchdog driver
 *                              to support an external watchdog timer chip
 * @param BSP_WATCHDOG_INTERNAL Set BSP_WATCHDOG_TYPE to this value to build the watchdog driver
 *                              to support the internal watchdog timer circuit on NETARM chip
 */
#define BSP_WATCHDOG_EXTERNAL   0
#define BSP_WATCHDOG_INTERNAL   1

/**
 * This constant determines whether the watchdog driver will support the
 * internal watchdog circuit, or an external watchdog timer.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @see @link WatchdogDriverConfigurations
 */
#define BSP_WATCHDOG_TYPE          BSP_WATCHDOG_INTERNAL


/**
 * Set BSP_HANDLE_FATAL_ERROR and BSP_HANDLE_UNEXPECTED_EXCEPTION to one of these
 * constants to determine how fatal errors and unexpected exceptions are handled.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @see @link BSP_HANDLE_FATAL_ERROR
 * @see @link BSP_HANDLE_UNEXPECTED_EXCEPTION
 * @name ErrorHandlerConfigurations "Error Handler Configurations"
 *
 * @param BSP_ERROR_RESET_UNIT      reset the unit when a fatal error or unexpected
 *                                  exception occurs in a released product.  If a debugger
 *                                  is detected, then report the error by blinking the
 *                                  LEDs.
 * @param BSP_ERROR_REPORT_ERROR    report the error by blinking the LEDs in a pattern.
 *                                  This option is only recommended while the application
 *                                  is being developed.  Shipping code should usually reset
 *                                  the unit.
 * @param BSP_ERROR_CONTINUE        ignore unexpected exceptions and attempt to continue
 *                                  execution.  This option is not recommended and may cause
 *                                  unpredictable results.
 */
#define BSP_ERROR_RESET_UNIT        0
#define BSP_ERROR_REPORT_ERROR      1
#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, and BSP_ERROR_REPORT_ERROR.
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @see @link ErrorHandlerConfigurations
 */
#define BSP_HANDLE_FATAL_ERROR              BSP_ERROR_REPORT_ERROR

/**
 * Determines how unexpected exceptions are handled  The possible
 * values for this directive are BSP_ERROR_RESET_UNIT,
 * BSP_ERROR_REPORT_ERROR, and BSP_ERROR_CONTINUE.
 *
 *
 * @since 6.0
 * @external
 * @category BSP_Configuration
 * @see @link ErrorHandlerConfigurations
 */
#define BSP_HANDLE_UNEXPECTED_EXCEPTION     BSP_ERROR_REPORT_ERROR



/**
 *      Determines the clock source to be used  This directive 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 (PLL) 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 BSP_Configuration
 */
#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 6.0
 * @external
 * @category SNTP
 *
 * @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.
 * ns7520_a does not support PHY interrupt in NET+OS 6.0.
 *
 * @since 6.0
 * @external
 * @category EthernetDriver
 */
#define BSP_USE_PHY_INTERRUPT   FALSE

/**
 * 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 conflict 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


/**
 * This structure is used to hold configuration settings for NET+ARM chip
 * selects.  The table NANetarmInitData is an array of NAInitRegisterType structures.
 * The values stored in the table are used by the routines in ncc_init.c that
 * determine the memory type and size, and configure the chip selects to support
 * it.
 *
 * @since 4.0
 * @external
 * @category BSP_Configuration
 * @see @link NANetarmInitData
 *
 * @param usesInternalOscillator    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
 * @param cs0WaitStates             CS0 (Flash) wait states (legal range 0-f)
 * @param cs0BusCycles              CS0 (Flash) bcyc value (legal range 0-3)
 * @param cs0BusSize                CS0 (Flash) bsize value (legal range 0-3)
 * @param cs0UseRsync               CS0 (Flash) bsize value (legal range 0-3)
 *                                  For NS7520 this field is OE field of chip
 *                                  select option register A. (legal range 0,1)
 * @param cs0AddRegBurst            CS0 (Flash) burst enable (legal range 0,1)
 * @param cs1EdoMode                CS1 (Fast Page) EDO Mode setting (legal range 0,1)
 * @param cs1IdleBit                CS1 Idle bit flag -- sets the CS1 idle bit (legal range 0,1)
 * @param cs1EdoWaitStates          CS1 (EDORAM) wait states (legal range 0-f)
 * @param cs1EdoBusCycles           CS1 (EDORAM) bcyc value (legal range 0-3)
 * @param cs1EdoBusSize             CS1 (EDORAM) bsize value (legal range 0-3)
 * @param cs1SdWaitStates           CS1 (SDRAM) wait states (legal range 0-f)
 * @param cs1SdBusCycles            CS1 (SDRAM) bcyc value (legal range 0-3)
 * @param cs1SdBusSize              CS1 (SDRAM) bsize value (legal range 0-3)
 * @param cs3WaitStates             CS3 (NVRAM) wait states (legal range 0-f)
 */
typedef struct
{
    const unsigned int usesInternalOscillator;
    const unsigned int cs0WaitStates;
    const unsigned int cs0BusCycles;
    const unsigned int cs0BusSize;
    const unsigned int cs0UseRsync;
    const unsigned int cs0AddRegBurst;
    const unsigned int cs1EdoMode;
    const unsigned int cs1IdleBit;
    const unsigned int cs1EdoWaitStates;
    const unsigned int cs1EdoBusCycles;
    const unsigned int cs1EdoBusSize;
    const unsigned int cs1SdWaitStates;
    const unsigned int cs1SdBusCycles;
    const unsigned int cs1SdBusSize;
    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
 * @external
 * @category ENI
 */
#define BSP_ENI_HOST_DRIVER             1

/**
 * Set BSP_ENI_CLIENT_DRIVER this value as the Client
 * ENI driver.
 *
 * @since 3.0
 * @external
 * @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
 * @external
 * @category ENI
 */
#define BSP_ENI_PORT					BSP_ENI_HOST_DRIVER

#ifdef __cplusplus
}
#endif

#endif
