/**
 *  \file   SPI_board.h
 *
 *  \brief  Board header file
 *
 */

/*
 * Copyright (C) 2014 - 2015 Texas Instruments Incorporated - http://www.ti.com/
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the
 * distribution.
 *
 * Neither the name of Texas Instruments Incorporated nor the names of
 * its contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */


#ifndef _SPI_BOARD_H
#define _SPI_BOARD_H

#ifdef __cplusplus
extern "C" {
#endif


/* Example/Board Header files */
#include <ti/board/board.h>
#if defined (EVM_AM335X)
#include <ti/board/src/evmAM335x/include/board_cfg.h>
#endif
#if defined (ICEV2_AM335X)
#include <ti/board/src/icev2AM335x/include/board_cfg.h>
#endif
#if defined (IDK_AM437X)
#include <ti/board/src/idkAM437x/include/board_cfg.h>
#endif
#if defined (EVM_AM437X)
#include <ti/board/src/evmAM437x/include/board_cfg.h>
#endif
#if defined (IDK_AM571X)
#include <ti/board/src/idkAM571x/include/board_cfg.h>
#endif
#if defined (IDK_AM572X)
#include <ti/board/src/idkAM572x/include/board_cfg.h>
#endif
#if defined (EVM_K2H) || defined (EVM_K2K)
#include <ti/board/src/evmK2H/include/board_cfg.h>
#endif
#if defined (EVM_K2E)
#include <ti/board/src/evmK2E/include/board_cfg.h>
#endif
#if defined (EVM_K2L)
#include <ti/board/src/evmK2L/include/board_cfg.h>
#endif

#if defined (EVM_K2G)
#include <ti/board/src/evmK2G/include/board_cfg.h>
#endif

#if defined (EVM_C6678)
#include <ti/board/src/evmC6678/include/board_cfg.h>
#endif

#if defined (EVM_C6657)
#include <ti/board/src/evmC6657/include/board_cfg.h>
#endif

/**********************************************************************
 ************************** Macros ************************************
 **********************************************************************/

#if defined (IDK_AM572X)
#define BOARD_MCSPI_SERIALIZER_INSTANCE  (2U)
#endif
#if defined (IDK_AM571X)
#define BOARD_MCSPI_SERIALIZER_INSTANCE  (2U)
#endif

#if defined(EVM_K2H) || defined(EVM_K2K) || defined(EVM_K2E) || defined(EVM_K2L) || defined(EVM_K2G) || defined(EVM_C6678) || defined(EVM_C6657)
#if defined(EVM_K2G)
#include <ti/board/src/flash/nor/device/n25q128a13esf40f.h>
#define TEST_NOR_DEV_ID         BOARD_FLASH_ID_NORN25Q128A13ESF40F
#else
#include <ti/board/src/flash/nor/device/n25q128.h>
#define TEST_NOR_DEV_ID         BOARD_FLASH_ID_NORN25Q128
#endif


#undef TEST_SPI_NOR_WRITE       /* disable erase/write test */

#define TEST_SPI_PORT           (BOARD_SPI_NOR_INSTANCE)
#define TEST_NOR_BLK_NUM        (NOR_NUM_SECTORS - 1U)
#define TEST_NOR_ADDR           (NOR_SECTOR_SIZE * TEST_NOR_BLK_NUM)
#define TEST_TX_LENGTH          (200U)
#endif

/* GPIO pin value definitions */
#define GPIO_PIN_VAL_LOW     (0U)
#define GPIO_PIN_VAL_HIGH    (1U)


#ifdef __cplusplus
}
#endif

#endif /* _SPI_BOARD_H */
