SY8837_Demo_For_OurSelf/UsrInc/inc/define.h
rb_peng c743af0aa6 1、将双向通信的具体场景提到vox_Comm_Handle函数中
2、增加VOX持续输出0V以唤醒耳机的情况;
3、解决超长按后,双向通讯一直发码的问题;(松开按键后Key_Press_ll_irq设为FALSE)
4、解决关盖上电时,不亮灯和不发码的问题(即把Hall_Sta_bk初始化);
5、长按发配对码时,主副耳的选择提取到config.h中;
2025-02-21 17:24:44 +08:00

160 lines
3.4 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
******************************************************************************
*
* @file define.h
* @brief define module
* @ic sy8837/8
*
* @version 1.0
* @date 2024/11/01 09:59:40
* @author Alex Xu
*
* Copyright (c) 2013-2099,Tkplusemi Technology Co.,Ltd.
* All Rights Reserved
*
* History:
* Revision Date Author Desc
* 1.0.0 2024/11/01 Alex build this file
******************************************************************************
*/
#ifndef __DEFINE_H__
#define __DEFINE_H__
#include "config.h"
/*Function Select功能选择宏定义*/
//#define SY8837 //非合封芯片SY8837
#define TIMER1_ENABLE 0 //Timer1 定时周期1ms。(120Bytes)
#define UART1_ENABLE 1 //UART1功能
#define WTG_ENABLE 1 //看门狗功能使能(7Bytes)
#define LED_DISPLAY //LED显示 ,4个灯显示 (1125Bytes)
#ifdef LED_DISPLAY
#define PWM_ENABLE //PWM功能用于呼吸灯(719Bytes)
#endif
#define KEY_ENABLE 1 //Key功能(111Bytes)
#define VOX_ENABLE 1 //1080Bytes
#define VOX_COVER_ENABLE //带HALL关盖应用
//#define VOX_ADT_ENABLE //无HALL耳机入盒充电应用
#define VOX_FOLLOW_CHG 1 //2111Bytes
#if VOX_ENABLE
#define VOX_COMM_ENABLE //双向通讯处理功能
#define VOX_TX //959Bytes
#define VOX_RX //739Bytes
#endif
#ifdef VOX_ADT_ENABLE //耳机入仓自动识别充电的就不需要HALL功能。
#define HALL_ENABLE 0
#else
#define HALL_ENABLE 1 //Hall功能。(Hall 46Bytes)
#endif
#define CHARGER_ENABLE 1 //94Bytes
#define DISCHARGE_ENABLE 1 //75Bytes
#define SLEEP_ENABLE 1 //110Bytes
//#define TIM_WKUP //定时唤醒功能
#define ADC_ENABLE 1 //587Bytes
#if ADC_ENABLE
#define NTC_ENABLE //513Bytes JEITA
#endif
#define GAUGE_ENABLE 0 //2001Bytes
#define BAT_VALUE 1 //171Bytes
#define _DEBUG_ALL //打开打印功能
#ifdef _DEBUG_ALL
#define UART0_ENABLE //UART0功能,Debug Log。(133Bytes)
#define _DEBUG_MAIN
#define _DEBUG_KEY
// #define _DEBUG_VOX
// #define _DEBUG_FOLLOW
// #define _DEBUG_HALL
// #define _DEBUG_ADC
// #define _DEBUG_DISCHARGE
// #define _DEBUG_CHARGER
// #define _DEBUG_SLEEP
// #define _DEBUG_BAT
//#define TEST_MODE
#include "stdio.h"
#include "string.h"
#endif
#define HIBYTE(v1) ((uint8_t)((v1)>>8)) //v1 is uint16_t
#define LOBYTE(v1) ((uint8_t)((v1)&0xFF))
typedef bit BIT;
typedef unsigned char uint8_t;
typedef unsigned int uint16_t;
typedef unsigned long uint32_t;
typedef unsigned char uint8;
typedef unsigned int uint16;
typedef unsigned long uint32;
typedef signed char int8_t;
typedef signed int int16_t;
typedef signed long int32_t;
typedef signed char int8;
typedef signed int int16;
typedef signed long int32;
typedef signed char s8;
typedef unsigned char u8;
typedef signed short int s16;
typedef unsigned short int u16;
typedef signed long int s32;
typedef unsigned long int u32;
typedef enum{false = 0, true = !false} bool;
#define FALSE false
#define TRUE true
#define ON true
#define OFF false
#include "stdlib.h"
#include "reg883x.h"
#include "uart.h"
#include "charger_module.h"
#endif