#ifndef BSP_DEFS_H
#define BSP_DEFS_H

// >>>#include <Npttypes.h>
// #include <bsp_api.h>
// #include <tx_api.h>
// #include <init_settings.h>
// #include <fs.h>

#ifdef __cplusplus
extern "C"
{
#endif

/*ad*
 * Set BSP_SERIAL_PORT_X  to one of these values to
 * indicate what type of serial driver should be built for the port.
 *
 * @since 6.0
 * @external
 * @category BSP:BSP_Configuration
 * @name SerialPortConfigurations   "Serial Port Configurations"
 * @see @link BSP_SERIAL_PORT_1
 * @see @link BSP_SERIAL_PORT_2
 * @see @link BSP_SERIAL_PORT_3
 * @see @link BSP_SERIAL_PORT_4
 *
 * @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 Master mode
 * @param BSP_SERIAL_HDLC_DRIVER     Serial port will be used in HDLC mode
 * @param BSP_SERIAL_SPI_SLAVE_DRIVER    Serial port will be used in SPI Slave mode
 *
 * @note The SPI Slave drive is ONLY supported in NET+OS 6.2 for NS9750 and NS9360 chips,
 *       
 *ad*/
#define BSP_SERIAL_NO_DRIVER        0
#define BSP_SERIAL_UART_DRIVER      1
#define BSP_SERIAL_SPI_DRIVER       2
#define	BSP_SERIAL_HDLC_DRIVER		3	/* amsterdam */
#define BSP_SERIAL_SPI_SLAVE_DRIVER      4


/*ad*
 * This constant determines which port is used to output Simple Serial data.
 * This data is used early in initialization (when the C library and OS are
 * not yet available).  The baud rate used is based on your NVRAM or appconf.h
 * setting for APP_BSP_BAUD_RATE.
 *
 * @name Simple_Serial_Port_Defines "Definitions for serial ports used for simple serial communication."
 *
 * @since 6.1
 * @include     <bsp_defs.h>
 * @external
 * @category BSP:BSP_Configuration
 * @param BSP_SIMPLE_SERIAL_ON_PORTA    route simple serial to serial port A
 * @param BSP_SIMPLE_SERIAL_ON_PORTB    route simple serial to serial port B
 * @param BSP_SIMPLE_SERIAL_ON_PORTC    route simple serial to serial port C
 * @param BSP_SIMPLE_SERIAL_ON_PORTD    route simple serial to serial port D
 *ad*/
#define BSP_SIMPLE_SERIAL_ON_PORTA      1
#define BSP_SIMPLE_SERIAL_ON_PORTB      2
#define BSP_SIMPLE_SERIAL_ON_PORTC      3
#define BSP_SIMPLE_SERIAL_ON_PORTD      4

/**
 * 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: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 NET+OS interface
 **/
#define BSP_SERIAL_API_TERMIOS  0
#define BSP_SERIAL_API_LEGACY   1


/*ad*
 * Set BSP_USB_DEVICE_VERSION to one of these values to indicate which 
 * USB device driver will be used . 
 *
 * @since 7.1
 * @external
 * @category BSP:BSP_Configuration
 * @name UsbDeviceDriverVersion        "USB Device Driver Version"
 *
 * @param BSP_USB_DRIVER_VERSION_NA    No Usb Device Drive
 * @param BSP_USB_DRIVER_VERSION_1     Include USB device driver under 
 *                                     @link BSP:Device_Drivers:USB_DEVICE
 *
 *ad*/
#define BSP_USB_DRIVER_VERSION_NA       0
#define BSP_USB_DRIVER_VERSION_1        1

/*ad*
 * Set BSP_NVRAM_DRIVER to this value if no NVRAM driver is to be
 * built.
 *
 * @since 6.0
 * @external
 * @category BSP:BSP_Configuration
 *ad*/
#define BSP_NVRAM_NONE                      0

/*ad*
 * Set BSP_NVRAM_DRIVER to this value if the EEPROM driver is to be
 * built.
 *
 * @since 6.0
 * @external
 * @deprecated 6.1
 * @note The EEPROM drives is not supported in NET+OS 6.1
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_EEPROM                    1

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

/*ad*
 * Set BSP_NVRAM_DRIVER to this value to build the serial EEPROM
 * driver.
 *
 * @since 6.0
 * @external
 * @deprecated 6.1
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_SEEPROM                   3

/*ad*
 * Set BSP_NVRAM_DRIVER to this value to build the serial EEPROM
 * driver with semaphore protection.
 *
 * @since 6.0
 * @external
 * @deprecated 6.1
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_SEEPROM_WITH_SEMAPHORES   4

/*ad*
 * Set BSP_NVRAM_DRIVER to this value if the last sector of serial flash
 * is to be used for NVRAM.
 *
 * @since 6.2
 * @external
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_LAST_SFLASH_SECTOR         5

/*ad*
 * Set BSP_NVRAM_DRIVER to this value if the NVRAM is implemented in an
 * EEPROM connec ted via I2C.
 * The driver supplied with NET+OS supports this configuration
 * on the ConnectCore7u platform.
 *
 * @since 6.2
 * @external
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_EEPROM_OVER_I2C         6

/*ad*
 * Set BSP_NVRAM_DRIVER to this value if the NAND FLASH is used for NVRAM.
 * 
 * @since 7.1
 * @external
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_NAND            7

/*ad*
 * Set BSP_NVRAM_DRIVER to this value if the NVRAM functionality
 * will be provided by platform specific functions in "bsp.c".
 * All the custom functions are described in the BSP porting guide.
 *
 * @since 6.0
 * @external
 * @category BSP:BSP_Configuration
 * @see @link BSP_NVRAM_DRIVER
 *ad*/
#define BSP_NVRAM_CUSTOM                    255

/*ad*
 * 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 BSP:BSP_Configuration
 * @see @link BSP:BSP_Configuration:BSP_HANDLE_FATAL_ERROR
 * @see @link BSP:BSP_Configuration:BSP_HANDLE_UNEXPECTED_EXCEPTION
*ad*/
#define BSP_ERROR_RESET_UNIT        0

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

/*ad*
 * 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 BSP:BSP_Configuration
 * @see @link BSP_HANDLE_FATAL_ERROR
 * @see @link BSP_HANDLE_UNEXPECTED_EXCEPTION
 *ad*/
#define BSP_ERROR_CONTINUE          2

/*ad*
 * Bootloader flash recovery using TFTP mode (default value)
 *
 * @since 6.3
 * @include 	<bsp_defs.h>
 * @external
 * @category BSP:BSP_Configuration
 *ad*/
#define BSP_BOOTLOADER_TFTP_RECOVERY	0x0001

/*ad*
 * Bootloader flash recovery using serial mode. The default serial recovery uses
 * XModem communication protocol
 *
 * @since 6.3
 * @include 	<bsp_defs.h>
 * @external
 * @category BSP:BSP_Configuration
 *ad*/
#define BSP_BOOTLOADER_SERIAL_RECOVERY 	0x0002

/*ad*
 * Try the all flash recovery modes in the following order
 *
 * <list type="unordered"> 
 *  <item> TFTP </item>
 *  <item> Serial </item>
 * </list>
 *
 * @since 6.3
 * @include     <bsp_defs.h>
 * @external
 * @category BSP:BSP_Configuration
 *ad*/
#define BSP_BOOTLOADER_TRY_ALL      (BSP_BOOTLOADER_TFTP_RECOVERY | BSP_BOOTLOADER_SERIAL_RECOVERY) 


/**
 * BSP_WATCHDOG_TYPE must be set to one of these constants.
 *
 * @since 6.0
 * @external
 * @category BSP: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

#ifdef __cplusplus
}
#endif

#endif /* BSP_DEFS_H */

