KT25-1015_AC695x_SDK310/apps/kaotings/kt.h

74 lines
3.5 KiB
C
Raw Normal View History

#ifndef __KT_H__
#define __KT_H__
#include "system/includes.h"
#define SYS_LED_PIN IO_PORTB_03
#define SYS_LED_ON() (gpio_set_output_value(SYS_LED_PIN,1))
#define SYS_LED_OFF() (gpio_set_output_value(SYS_LED_PIN,0))
/* 音频输出通道 1-4*/
#define AUDIO_OUT_CHANNEL4 IO_PORTB_07
#define AUDIO_OUT_CHANNEL3 IO_PORTB_08
#define AUDIO_OUT_CHANNEL2 IO_PORTB_09
#define AUDIO_OUT_CHANNEL1 IO_PORTB_10
#define AUDIO_OUT_CH1_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL1,1))
#define AUDIO_OUT_CH2_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL2,1))
#define AUDIO_OUT_CH3_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL3,1))
#define AUDIO_OUT_CH4_ON() (gpio_set_output_value(AUDIO_OUT_CHANNEL4,1))
#define AUDIO_OUT_CH1_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL1,0))
#define AUDIO_OUT_CH2_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL2,0))
#define AUDIO_OUT_CH3_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL3,0))
#define AUDIO_OUT_CH4_OFF() (gpio_set_output_value(AUDIO_OUT_CHANNEL4,0))
/* 播放按键LED输出通道 1-4*/
#define KEY_LED_OUT_CHANNEL4 IO_PORTC_02
#define KEY_LED_OUT_CHANNEL3 IO_PORTC_01
#define KEY_LED_OUT_CHANNEL2 IO_PORTC_00
#define KEY_LED_OUT_CHANNEL1 IO_PORTA_12
#define KEY_LED_OUT_CH1_ON() (gpio_set_output_value(KEY_LED_OUT_CHANNEL1,1))
#define KEY_LED_OUT_CH2_ON() (gpio_set_output_value(KEY_LED_OUT_CHANNEL2,1))
#define KEY_LED_OUT_CH3_ON() (gpio_set_output_value(KEY_LED_OUT_CHANNEL3,1))
#define KEY_LED_OUT_CH4_ON() (gpio_set_output_value(KEY_LED_OUT_CHANNEL4,1))
#define KEY_LED_OUT_CH1_OFF() (gpio_set_output_value(KEY_LED_OUT_CHANNEL1,0))
#define KEY_LED_OUT_CH2_OFF() (gpio_set_output_value(KEY_LED_OUT_CHANNEL2,0))
#define KEY_LED_OUT_CH3_OFF() (gpio_set_output_value(KEY_LED_OUT_CHANNEL3,0))
#define KEY_LED_OUT_CH4_OFF() (gpio_set_output_value(KEY_LED_OUT_CHANNEL4,0))
/* 灯条输出通道 1-4*/
#define LED_BAR_OUT_CHANNEL4 IO_PORTA_09
#define LED_BAR_OUT_CHANNEL3 IO_PORTA_10
#define LED_BAR_OUT_CHANNEL2 IO_PORTB_02
#define LED_BAR_OUT_CHANNEL1 IO_PORTB_11
#define LED_BAR_OUT_CH1_ON() (gpio_set_output_value(LED_BAR_OUT_CHANNEL1,1))
#define LED_BAR_OUT_CH2_ON() (gpio_set_output_value(LED_BAR_OUT_CHANNEL2,1))
#define LED_BAR_OUT_CH3_ON() (gpio_set_output_value(LED_BAR_OUT_CHANNEL3,1))
#define LED_BAR_OUT_CH4_ON() (gpio_set_output_value(LED_BAR_OUT_CHANNEL4,1))
#define LED_BAR_OUT_CH1_OFF() (gpio_set_output_value(LED_BAR_OUT_CHANNEL1,0))
#define LED_BAR_OUT_CH2_OFF() (gpio_set_output_value(LED_BAR_OUT_CHANNEL2,0))
#define LED_BAR_OUT_CH3_OFF() (gpio_set_output_value(LED_BAR_OUT_CHANNEL3,0))
#define LED_BAR_OUT_CH4_OFF() (gpio_set_output_value(LED_BAR_OUT_CHANNEL4,0))
/* 音量按键LED输出通道 2个*/
#define KDOWN_LED_PIN IO_PORTB_00
#define KUP_LED_PIN IO_PORTC_03
#define KDOWN_LED_ON() (gpio_set_output_value(KDOWN_LED_PIN,1))
#define KUP_LED_ON() (gpio_set_output_value(KUP_LED_PIN,1))
#define KDOWN_LED_OFF() (gpio_set_output_value(KDOWN_LED_PIN,0))
#define KUP_LED_OFF() (gpio_set_output_value(KUP_LED_PIN,0))
// tx rst PA6
// tx audio status PA7
int kt_key_event_handler(u16 key);
int kt_music_play_end_handler(void);
void kt_boot_init(void);
void kt_init(void);
/* SD/U盘升级提示SYS_LED 快闪 + 提示音(四通道全开) */
void kt_update_led_start(void);
void kt_update_led_finish(void);
void kt_update_start_remind(void);
void kt_update_finish_remind(u16 result);
#endif