/// \file includes.h
/// \brief This file contains required global declarations for my project.
/*
=============================================================================
* Copyright (C) 2020
* PNC Technologies Co., Ltd.
* All Rights Reserved
*
* The content of this file is copyrighted by PNC Technologies Co., Ltd. or
* its affiliated, associated or related companies. All copyrights and other
* associated intellectual property rights related thereto are expressly
* reserved by PNC Technologies Co., Ltd.
=============================================================================
* File Revision History (top to bottom: first revision to last revision)
=============================================================================
*
* Date          user    (Description on following lines: changes, etc.)
* ----------- --------
* 26-Mar-2020   BT Jung
* + Created initial version
*
*
=============================================================================
*/


/*=========================================================================*/
/*                            COMPILER DIRECTIVES                          */
/*=========================================================================*/

#ifndef __INCLUDES_H
#define __INCLUDES_H


/*=========================================================================*/
/*                     MODULES USED  (#include statements)                 */
/*=========================================================================*/

// STANDARD
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdarg.h>

// XDCtools
#include <xdc/cfg/global.h>

// SYS-BIOS
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/family/arm/da830/Hwi.h>
#include <ti/sysbios/family/arm/arm9/mmu.h>
#include <ti/sysbios/knl/Swi.h>


// NDK
#include <ti/ndk/inc/netmain.h>
#include <ti/ndk/inc/_stack.h>
// emac
#include <ti/drv/emac/emac_hwcfg.h>
#include <ti/drv/emac/emac_drv.h>

// CSLR
#include "soc_OMAPL138.h"
#include <ti/csl/soc.h>
#include <ti/csl/csl_types.h>
#include <ti/csl/cslr_syscfg.h>
#include <ti/csl/cslr_psc.h>
#include <ti/csl/cslr_pllc.h>
#include <ti/csl/cslr_gpio.h>
#include <ti/csl/cslr_uart.h>
#include <ti/csl/cslr_emif4f.h>
#include <ti/csl/cslr_ecap.h>
#include <ti/csl/cslr_spi.h>
#include <ti/csl/csl_edma3Aux.h>
#include <ti/csl/cslr_aintc.h>


//#include <ksz8895.h>
//#include <fram16.h>

// Startware
#include <interrupt.h>
#include <cpu.h>

//#include <ti/csl/cslr_syscfg.h>  // added by BTJung
#include <ti/csl/src/ip/syscfg/V0/cslr_syscfg.h>
#include <ti/csl/soc/omapl138/src/cslr_soc_baseaddress.h>  // added by BTJung
#include <ti/csl/src/ip/emif4/V4/cslr_emifa2.h> // added by BTJung
#include <ti/csl/src/ip/pllc/V1/cslr_pllc.h>  // added by BTJung

#include "DeviceInit.h" // added by BTJung

// SPI Header files
#include <ti/drv/spi/SPI.h>
#include <ti/drv/spi/src/v0/SPI_v0.h>
#include <ti/drv/spi/soc/SPI_soc.h>
#include <ti/drv/spi/test/src/SPI_log.h>
#include <ti/drv/spi/test/src/SPI_test.h>

//#include <spi.h>
//#include <ti/drv/spi/MCSPI.h>
//#include <ti/drv/spi/src/SPI_osal.h>


#include <ti/drv/i2c/i2c.h>
#include <ti/drv/i2c/soc/i2c_soc.h>


// App
//#include <basic.h>
//#include <XGF100bd.h>
//#include <HwDevCfg_20160720.h>
//#include <DNPdtime.h>
//#include <app_cfg.h>
//#include <Setting.h>
//#include <DPRam.h>
//#include <Logic.h>
//#include <record.h>
//#include <spi.h>
//#include <led.h>
//#include <display.h>
//#include <devinit.h>

//#include <bsp_per.h>
//#include <net.h>
//#include <bsp.h>

//#include <rtc.h>

/*=========================================================================*/
/*                                 CONSTANTS                               */
/*=========================================================================*/
#define XB100_SYS_CLOCK    (456000000U)
/*=========================================================================*/
/*                       MACROS  (inline functions)                        */
/*=========================================================================*/
#define  WDTRst()      {gpioRegs->BANK_REGISTERS[3].CLR_DATA = 0x00004000u; gpioRegs->BANK_REGISTERS[3].SET_DATA = 0x00004000u;    }  // Watchdog Clear & Set


/*=========================================================================*/
/*                                  TYPEDEFS                               */
/*=========================================================================*/

typedef volatile CSL_EcapRegs     *CSL_EcapRegsOvly;
typedef volatile CSL_SpiRegs      *CSL_SpiRegsOvly;


/*=========================================================================*/
/*                               GLOBAL FUNCTIONS                          */
/*=========================================================================*/
void Task_memset(void *mem, int ch, size_t length);


#endif

