/**
****************************************************************************************
*
* @file custom_config.h
*
* @brief Custom configuration file for applications.
*
****************************************************************************************
* @attention
#####Copyright (c) 2019 GOODIX
All rights reserved.
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 GOODIX 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 COPYRIGHT HOLDERS AND 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.
*****************************************************************************************
*/
/*
* DEFINES
*****************************************************************************************
*/
#ifndef __CUSTOM_CONFIG_H__
#define __CUSTOM_CONFIG_H__
// <<< Use Configuration Wizard in Context Menu >>>
// Basic configuration
// Chip version
#define GR5515_D
// Select chip type
// <0=> GR5515
// <1=> GR5513
#ifndef CHIP_TYPE
#define CHIP_TYPE 0
#endif
// Enable encrypt chip
// <0=> DISABLE
// <1=> ENABLE
#ifndef ENCRYPT_ENABLE
#define ENCRYPT_ENABLE 1
#endif
// Enable the external flash of chip
// <0=> DISABLE
// <1=> ENABLE
#ifndef EXT_EXFLASH_ENABLE
#define EXT_EXFLASH_ENABLE 0
#endif
// Enable system fault trace module
// <0=> DISABLE
// <1=> ENABLE
#ifndef SYS_FAULT_TRACE_ENABLE
#define SYS_FAULT_TRACE_ENABLE 1
#endif
// Enable APP driver module
// <0=> DISABLE
// <1=> ENABLE
#ifndef APP_DRIVER_USE_ENABLE
#define APP_DRIVER_USE_ENABLE 1
#endif
// Eanble APP log module
// <0=> DISABLE
// <1=> ENABLE
#ifndef APP_LOG_ENABLE
#define APP_LOG_ENABLE 1
#endif
// APP log port type
// <0=> UART
// <1=> RTT
// <2=> ITM
#ifndef APP_LOG_PORT
#define APP_LOG_PORT 0
#endif
// Eanble APP log store module
// <0=> DISABLE
// <1=> ENABLE
#ifndef APP_LOG_STORE_ENABLE
#define APP_LOG_STORE_ENABLE 0
#endif
#if (CHIP_TYPE == 0)
// Enable SK GUI module, only available in GR5515
// <0=> DISABLE
// <1=> ENABLE
#ifndef SK_GUI_ENABLE
#define SK_GUI_ENABLE 1
#endif
#endif
// Enable debug monitor module
// <0=> DISABLE
// <1=> ENABLE
#ifndef DEBUG_MONITOR
#define DEBUG_MONITOR 0
#endif
// Enable DTM test support
// <0=> DISABLE
// <1=> ENABLE
#ifndef DTM_TEST_ENABLE
#define DTM_TEST_ENABLE 0
#endif
// Enable BLE DFU support
// <0=> DISABLE
// <1=> ENABLE
#ifndef DFU_ENABLE
#define DFU_ENABLE 1
#endif
// Protection priority level
// Default: 0
#ifndef FLASH_PROTECT_PRIORITY
#define FLASH_PROTECT_PRIORITY 0
#endif
// NVDS Start Address
// Default: 0x010FF000
#ifndef NVDS_START_ADDR
#define NVDS_START_ADDR 0x010FF000
#endif
// The Number of sectors for NVDS
// Default: 1
#ifndef NVDS_NUM_SECTOR
#define NVDS_NUM_SECTOR 1
#endif
// Call Stack Size
// Default: 0x4000
#ifndef CSTACK_HEAP_SIZE
#define CSTACK_HEAP_SIZE 0x4000
#endif
// Enable callstack backtrace function
// Default: 0
#ifndef ENABLE_BACKTRACE_FEA
#define ENABLE_BACKTRACE_FEA 0
#endif
//
// Boot info configuration
// Code load address
// Default: 0x01002000
#define APP_CODE_LOAD_ADDR 0x0100b000
// Code run address
// Default: 0x01002000
#define APP_CODE_RUN_ADDR 0x0100b000
// System clock
// <0=> 64MHZ
// <1=> 48MHZ
// <2=> 16MHZ-XO
// <3=> 24MHZ
// <4=> 16MHZ
// <5=> 32MHZ-CPLL
#define SYSTEM_CLOCK 0
// External clock accuracy used in the LL to compute timing <1-500>
// Range: 1-500
#define CFG_LF_ACCURACY_PPM 500
// Enable internal osc as low power clock
// <0=> Default: Disable internal osc as low power clock
// <1=> Enable internal osc as low power clock and force CFG_LF_ACCURACY_PPM to 500ppm
#define CFG_LPCLK_INTERNAL_EN 0
// Delay time for Boot startup
// <0=> Not Delay
// <1=> Delay 1s
#define BOOT_LONG_TIME 1
// In xip mode, check image during cold boot startup
// <0=> Not check
// <1=> Check image
#define BOOT_CHECK_IMAGE 1
// Code version.16bits
#define VERSION 1
// Delay time between flash wakeup and read chip id in warm boot
// Default: 0
// Range: 0-10
// Note:
// <0=> No delay
// <1=> Delay 5 us
// <2=> Delay 10 us
// <3=> Delay 15 us
// <4=> Delay 20 us
// <5=> Delay 25 us
#ifndef EXFLASH_WAKEUP_DELAY
#define EXFLASH_WAKEUP_DELAY 0
#endif
//
// BLE resource configuration
// Note: The total number of BLE Activities(CONNECTIONS+ADVS+2*PER_ADVS+SYNCS+SCAN) should not exceed the limit 12.
// Support maximum number of BLE profiles <0-64>
// Range: 0-64
#ifndef CFG_MAX_PRFS
#define CFG_MAX_PRFS 10
#endif
// Support maximum number of bonded devices <0-10>
// Range: 0-10
#ifndef CFG_MAX_BOND_DEVS
#define CFG_MAX_BOND_DEVS 4
#endif
// Support maximum number of BLE Links <0-10>
// Range: 0-10
#ifndef CFG_MAX_CONNECTIONS
#define CFG_MAX_CONNECTIONS 10
#endif
// Support maximum number of BLE Legacy/Extended Advertisings <0-5>
// Range: 0-5
// Note: The total number of BLE Legacy/Extended/Periodic Advertisings should not exceed the limit 5.
#ifndef CFG_MAX_ADVS
#define CFG_MAX_ADVS 1
#endif
// Support maximum number of BLE Periodic Advertisings <0-5>
// Range: 0-5
// Note: The total number of BLE Legacy/Extended/Periodic Advertisings should not exceed the limit 5.
#ifndef CFG_MAX_PER_ADVS
#define CFG_MAX_PER_ADVS 0
#endif
// Support maximum number of BLE Periodic Advertising Synchronizations <0-5>
// Range: 0-5
#ifndef CFG_MAX_SYNCS
#define CFG_MAX_SYNCS 0
#endif
// Support maximum number of BLE Scan <0-1>
// Range: 0-1
#ifndef CFG_MAX_SCAN
#define CFG_MAX_SCAN 1
#endif
//
// MESH support configuration
// MESH support
// <0=> NOT SUPPORT
// <1=> SUPPORT
#ifndef CFG_MESH_SUPPORT
#define CFG_MESH_SUPPORT 0
#endif
//
// LCP support configuration
// LCP support
// <0=> NOT SUPPORT
// <1=> SUPPORT
#ifndef CFG_LCP_SUPPORT
#define CFG_LCP_SUPPORT 0
#endif
//
// <<< end of configuration section >>>
#endif // __CUSTOM_CONFIG_H__