#ifndef __KT_H__
#define __KT_H__


#include "system/includes.h"
/**
 * LINEIN   IN  AUX2 PB9 & PB10
 * LP       IN  AUX0 PA0 & PA1
 * LP_DET   IN  PB2
 */

#define KT_CFG_B_LED_PIN        IO_PORTC_02
#define KT_CFG_B_LED_ON()       gpio_set_output_value(KT_CFG_B_LED_PIN, 1)
#define KT_CFG_B_LED_OFF()      gpio_set_output_value(KT_CFG_B_LED_PIN, 0)

#define KT_CFG_R_LED_PIN        IO_PORTC_03
#define KT_CFG_R_LED_ON()       gpio_set_output_value(KT_CFG_R_LED_PIN, 1)
#define KT_CFG_R_LED_OFF()      gpio_set_output_value(KT_CFG_R_LED_PIN, 0)

#define KT_CFG_MUTE_PIN         IO_PORTB_00
#define PA_MUTE()               do { printf("[<"); gpio_set_output_value(KT_CFG_MUTE_PIN, 0); } while(0)
#define PA_UNMUTE()             do { printf(">]"); gpio_set_output_value(KT_CFG_MUTE_PIN, 1); } while(0)

//#define PA_MUTE()               
//#define PA_UNMUTE()             

//#define KT_CFG_AUX_IDX_LINEIN 0
//#define KT_CFG_AUX_IDX_LP     1
//void kt_aux_switch_to(u8 aux_idx);

//SDFILE_RES_ROOT_PATH
#define EQ_FILE_BT              SDFILE_RES_ROOT_PATH"eq_cfg_bt.bin"
#define EQ_FILE_MUSIC           SDFILE_RES_ROOT_PATH"eq_cfg_music.bin"
#define EQ_FILE_LINEIN          SDFILE_RES_ROOT_PATH"eq_cfg_linein.bin"
#define EQ_FILE_LP              SDFILE_RES_ROOT_PATH"eq_cfg_lp.bin"

#define KT_EQ_IDX_BT        0
#define KT_EQ_IDX_MUSIC     1
#define KT_EQ_IDX_LINEIN    2
#define KT_EQ_IDX_LP        3
//#define KT_EQ_IDX_NORMAL 4

typedef struct __PA_MUTE_VAR {
    u8 mute_flag;
    u8 unmute_flag;
    u16 mute_cnt;
    u16 unmute_cnt;
    u16 pa_mute_tid;
} PA_MUTE_VAR;



void kt_eq_switch_to(u8 eq_idx);

void kt_boot_init(void);
void kt_init(void);

#endif