#ifndef CORE_CONFIG_H
#define CORE_CONFIG_H

    #define CONFIG_YES                          1
    #define CONFIG_NO                           0
    #define CONFIG_SYSCLOCK_HIGH                2
    #define CONFIG_SYSCLOCK_NORMAL              1
    #define CONFIG_SYSCLOCK_LOW                 0
    #define CONFIG_SYSTICK_NORMAL               1
    #define CONFIG_SYSTICK_LOW                  0
    #define CONFIG_MSI_FREQ_DEFAULT             0
    #define CONFIG_MSI_FREQ_4MHZ                4
    #define CONFIG_MSI_FREQ_2MHZ                2
    #define CONFIG_MSI_FREQ_1MHZ                1
    #define CONFIG_CRYSTAL_12MHZ                0
    #define CONFIG_CRYSTAL_16MHZ                1
    #define CONFIG_CRYSTAL_8MHZ                 2
    #define CONFIG_CRYSTAL_4MHZ                 3
    //----------------------------------------------------------------
    // CONFIG_CRYSTAL
    // Specifies the external crystal oscillator frequency
    // Default: CONFIG_CRYSTAL_12MHZ
    #define CONFIG_CRYSTAL                      CONFIG_CRYSTAL_12MHZ
    //----------------------------------------------------------------    
    // CONFIG_SYSCLOCK
    // Default system clock
    // Default: CONFIG_SYSCLOCK_NORMAL
    #define CONFIG_SYSCLOCK                     CONFIG_SYSCLOCK_HIGH   /// !!!!!!
    //----------------------------------------------------------------    
    // CONFIG_SYSTICK
    // Default SysTick timer tick interval
    // Default: CONFIG_SYSTICK_NORMAL
    #define CONFIG_SYSTICK                      CONFIG_SYSTICK_NORMAL
    //----------------------------------------------------------------    
    // CONFIG_SYSTICK_BOOST_MULTIPLIER
    // Requires: CONFIG_SYSTICK=CONFIG_SYSTICK_NORMAL
    // Default: 5
    #define CONFIG_SYSTICK_BOOST_MULTIPLIER     4
    //----------------------------------------------------------------    
    // CONFIG_SLEEPMANAGER
    // Enable sleep/wakeup power-, clock- and usb- control             
    // Default: CONFIG_YES
    #define CONFIG_SLEEPMANAGER                 CONFIG_YES
    //----------------------------------------------------------------    
    // CONFIG_EXTMEM
    // Use external memory
    // Default: CONFIG_YES
    #define CONFIG_EXTMEM                       CONFIG_YES    
    //----------------------------------------------------------------    
    // CONFIG_KEYSW
    // Use RF-key-switch control
    // Default: CONFIG_YES
    #define CONFIG_KEYSW                        CONFIG_YES   
    //----------------------------------------------------------------    
    // CONFIG_TSENSOR
    // Use thermal sensor
    // Default: CONFIG_YES
    #define CONFIG_TSENSOR                      CONFIG_YES
    //----------------------------------------------------------------    
    // CONFIG_LEDS
    // Use LED-indication
    // Default: CONFIG_YES
    #define CONFIG_LEDS                         CONFIG_YES
    //----------------------------------------------------------------    
    // CONFIG_LED_LOWBAT_FLASH_INTERVAL
    // Low Battery Voltage Indication interval, ms
    // Default: 5000
    #define CONFIG_LED_LOWBAT_FLASH_INTERVAL    5000
    //----------------------------------------------------------------                                                
    // CONFIG_LED_LOWBAT_FLASH_TIME             
    // Low Battery Voltage Indication time (LED ON), ms
    // Default: 10                                     
    #define CONFIG_LED_LOWBAT_FLASH_TIME        5
    //----------------------------------------------------------------    
    // CONFIG_LED_OKBAT_FLASH_INTERVAL
    // Normal Battery Voltage Indication interval, ms
    // Default: 5000
    // Depends on CONFIG_LED_OKBAT_FLASH_ENABLE
    #define CONFIG_LED_OKBAT_FLASH_INTERVAL     10000                  // !!!!
    //----------------------------------------------------------------                                                
    // CONFIG_LED_OKWBAT_FLASH_TIME             
    // Normal Battery Voltage Indication time (LED ON), ms
    // Default: 1 
    // Depends on CONFIG_LED_OKBAT_FLASH_ENABLE                                
    #define CONFIG_LED_OKBAT_FLASH_TIME         1
    //----------------------------------------------------------------                                                
    // CONFIG_LED_OKBAT_FLASH_ENABLE             
    // Normal Battery Voltage Indication
    // Default: CONFIG_NO    
    #define CONFIG_LED_OKBAT_FLASH_ENABLE       CONFIG_YES             /// !!!!!!!
    //----------------------------------------------------------------                                                
    // CONFIG_BATTERY_LOW_VOLTAGE
    // Discharged battery voltage level
    // Default: 1000                                     
    #define CONFIG_BATTERY_LOW_VOLTAGE          1100
    //----------------------------------------------------------------                                                
    // CONFIG_LED_POLARITY_INVERTED             
    // Invered LED-control polarity (Active Low)                                         
    // Default: CONFIG_YES
    #define CONFIG_LED_POLARITY_INVERTED        CONFIG_NO              /// !!!!!!!!!!!!!!
    //----------------------------------------------------------------     
    // CONFIG_VBATMON
    // Use battery voltage monitor
    // Default: CONFIG_YES
    #define CONFIG_VBATMON                      CONFIG_YES
    //----------------------------------------------------------------     
    // CONFIG_USB
    // Use USB interface
    // Default: CONFIG_YES
    #define CONFIG_USB                          CONFIG_YES
    //----------------------------------------------------------------    
    // CONFIG_USB_DYNAMIC_CLOCK_ADOPT
    // Use dynamic system clock depending on if USB is connected or not
    // Depends on: CONFIG_SLEEPMANAGER
    // Default: CONFIG_YES
    #define CONFIG_USB_DYNAMIC_CLOCK_ADOPT      CONFIG_YES    
    //----------------------------------------------------------------    
    // CONFIG_USB_INTERNAL_WKUP_SUPPORT
    // Enables internal USB wakeup-event support
    // Default: CONFIG_YES
    #define CONFIG_USB_INTERNAL_WKUP_SUPPORT    CONFIG_YES
    //----------------------------------------------------------------    
    // CONFIG_AUTOMAT_MODE
    // Enables "Automat Mode" - automatic switch control for remote measurement.
    // Requires: CONFIG_KEYSW
    // Default: CONFIG_YES 
    #define CONFIG_AUTOMAT_MODE                 CONFIG_YES           
    //----------------------------------------------------------------
    // CONFIG_MSI_FREQ
    // Set internal clock generator frequency (MSI)
    // Available values: CONFIG_MSI_FREQ_4MHZ, CONFIG_MSI_FREQ_2MHZ, CONFIG_MSI_FREQ_1MHZ
    // Default: CONFIG_MSI_FREQ_4MHZ
    #define CONFIG_MSI_FREQ                     CONFIG_MSI_FREQ_4MHZ   // !!!!!!
    //----------------------------------------------------------------
    

    //----------------------------------------------------------------    
    // DEBUG FEATURES:
    //----------------------------------------------------------------
    // CONFIG_EXTREME_LOWPOWTEST
    // Extreme low-power test for debug (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_EXTREME_LOWPOWTEST           CONFIG_NO
    //----------------------------------------------------------------    
    // CONFIG_USBIRQ_TEST
    // USB IRQ test: disable USB IRQ for some time to test stability (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_USBIRQ_TEST                  CONFIG_NO
    //----------------------------------------------------------------    
    // CONFIG_DEBUG_USB_SUPRESS_VBUS_WKUP
    // Debug: do not wakeup on VBUS line changing (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_DEBUG_USB_SUPRESS_VBUS_WKUP  CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_USB_VENDOR_DUMMYREAD
    // Debug: do not call user handler on USB Vendor IN request (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_USB_VENDOR_DUMMYREAD         CONFIG_NO
    //---------------------------------------------------------------- 
    // CONFIG_TSENSOR_EMULATE_FOR_USB
    // Emulate the thermosensor presence for USB requests  (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_TSENSOR_EMULATE_FOR_USB      CONFIG_NO
    //----------------------------------------------------------------    
    // CONFIG_EXTMEM_EMULATEREAD
    // Emulate reading of external memory instead of real reading (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_EXTMEM_EMULATEREAD           CONFIG_NO
    //----------------------------------------------------------------    
    // CONFIG_EXTMEM_EMULATEWRITE
    // Emulate writing of external memory instead of real writing (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_EXTMEM_EMULATEWRITE          CONFIG_NO
    //----------------------------------------------------------------    
    // CONFIG_SLEEPMANAGER_DEBUG_NOSLEEP
    // Do not sleep at all (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_SLEEPMANAGER_DEBUG_NOSLEEP   CONFIG_YES             // !!!!
    //----------------------------------------------------------------
    // CONFIG_SLEEPMANAGER_KEEPDEBUGCLK
    // Keep debugger clocking enabled during sleep modes (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_SLEEPMANAGER_KEEPDEBUGCLK    CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_MAINC_DEBUGPIN_1    
    // Initialize DEBUG GPIO Pin #1 (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_MAINC_DEBUGPIN_1             CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_MAINC_DEBUGPIN_2    
    // Initialize DEBUG GPIO Pin #2 (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_MAINC_DEBUGPIN_2             CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_MAINC_DEBUGPIN_3    
    // Initialize DEBUG GPIO Pin #3 (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_MAINC_DEBUGPIN_3             CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_AUTOMAT_DEBUGPIN
    // Use debug pin in "Automat" module (DEBUG)
    #define CONFIG_AUTOMAT_DEBUGPIN             CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_CSECT_DEBUG
    // Use debug pin in "CSect" (critical sections) module (DEBUG)
    #define CONFIG_CSECT_DEBUG                  CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_SYSTICK_DEBUG
    // Use debug pin in "SysTick" module (SysTick IRQ) (DEBUG)
    #define CONFIG_SYSTICK_DEBUG                CONFIG_NO
    //----------------------------------------------------------------
    // CONFIG_USB_DEBUGPIN
    // Use debug pin in "USB" module (USB IRQ) (DEBUG)
    #define CONFIG_USB_DEBUGPIN                 CONFIG_NO  
    //----------------------------------------------------------------
    // CONFIG_SLEEPMANAGER_DEBUGPIN
    // Use debug pin in sleep manager driver (DEBUG)
    // Default: CONFIG_NO
    #define CONFIG_SLEEPMANAGER_DEBUGPIN        CONFIG_NO
    //----------------------------------------------------------------       
    // Debug Pin Routing
    #include "core/debugpinsapi.h" // debugpin_X_set / debugpin_X_clr
    // CONFIG_CSECT_DEBUG_SETPIN / CONFIG_CSECT_DEBUG_CLRPIN
    // Set and Clear macro for CSect debug pin, use debugpin_X_set / debugpin_X_clr functions
    #define CONFIG_CSECT_DEBUG_SETPIN           debugpin_3_set();
    #define CONFIG_CSECT_DEBUG_CLRPIN           debugpin_3_clr();

    // CONFIG_SYSTICK_DEBUG_SETPIN / CONFIG_SYSTICK_DEBUG_CLRPIN 
    // Set and Clear macro for Systick debug pin, use debugpin_X_set / debugpin_X_clr functions
    #define CONFIG_SYSTICK_DEBUG_SETPIN         debugpin_1_set();
    #define CONFIG_SYSTICK_DEBUG_CLRPIN         debugpin_1_clr();

    // CONFIG_AUTOMAT_DEBUGPIN_SETPIN / CONFIG_AUTOMAT_DEBUGPIN_CLRPIN
    // Set and Clear macro for Automat debug pin, use debugpin_X_set / debugpin_X_clr functions
    #define CONFIG_AUTOMAT_DEBUGPIN_SETPIN      debugpin_2_set();
    #define CONFIG_AUTOMAT_DEBUGPIN_CLRPIN      debugpin_2_clr();

    // CONFIG_USB_DEBUGPIN_SETPIN / CONFIG_USB_DEBUGPIN_CLRPIN
    // Set and Clear macro for USB debug pin, use debugpin_X_set / debugpin_X_clr functions
    #define CONFIG_USB_DEBUGPIN_SETPIN          debugpin_2_set();
    #define CONFIG_USB_DEBUGPIN_CLRPIN          debugpin_2_clr();

    //----------------------------------------------------------------    
#endif