2、增加VOX持续输出0V以唤醒耳机的情况; 3、解决超长按后,双向通讯一直发码的问题;(松开按键后Key_Press_ll_irq设为FALSE) 4、解决关盖上电时,不亮灯和不发码的问题(即把Hall_Sta_bk初始化); 5、长按发配对码时,主副耳的选择提取到config.h中;
93 lines
2.3 KiB
C
93 lines
2.3 KiB
C
/*
|
|
******************************************************************************
|
|
*
|
|
* @file uart.h
|
|
* @brief uart 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 __UART_H__
|
|
#define __UART_H__
|
|
|
|
/*_____ I N C L U D E S ____________________________________________________*/
|
|
|
|
#include "define.h"
|
|
|
|
/******************************************************************************\
|
|
Macro definitions
|
|
\******************************************************************************/
|
|
/* Log Debug 接口。 */
|
|
#define Baud_Rate0 115200//19200//38400//93750
|
|
|
|
#define S0REL_VALUE (1024-345600/Baud_Rate0)
|
|
|
|
/* 双向通讯接口。 */
|
|
#if XUANHENG
|
|
#define Baud_Rate1 9600//9600//19200//38400//93750
|
|
#else
|
|
#define Baud_Rate1 9600//9600//19200//38400//93750
|
|
#endif
|
|
|
|
#define S1REL_VALUE (1024-345600/Baud_Rate1)
|
|
|
|
#define UART_REC_ENABLE_Pos (4U)
|
|
#define UART_REC_ENABLE_Pos_Msk (0x1UL << UART_REC_ENABLE_Pos)
|
|
#define UART_REC_ENABLE UART_REC_ENABLE_Pos_Msk
|
|
|
|
#ifdef _DEBUG_ALL
|
|
|
|
extern char putchar (char ch);
|
|
|
|
#endif
|
|
|
|
#define COM1_Data_Lenth 38
|
|
|
|
#ifdef VOX_RX
|
|
|
|
/******************************************************************************\
|
|
Variables definitions
|
|
\******************************************************************************/
|
|
|
|
extern idata uint8_t RX1_Buffer[COM1_Data_Lenth]; //接收缓冲
|
|
|
|
extern bit Uart1_RX_Finish_Flag;
|
|
#endif
|
|
/******************************************************************************\
|
|
Functions definitions
|
|
\******************************************************************************/
|
|
#ifdef _DEBUG_ALL
|
|
|
|
extern char putchar (char ch);
|
|
#endif
|
|
|
|
extern void UART0_Init(void);
|
|
|
|
extern void Uart0SendData(uint8_t Txdata);
|
|
|
|
#ifdef VOX_TX
|
|
|
|
extern void Uart0SendPacket(uint16_t Length,uint8_t *TransBuf);
|
|
|
|
#endif
|
|
|
|
extern void UART1_Init(void);
|
|
|
|
extern void Uart1SendData(uint8_t Txdata);
|
|
|
|
extern void Uart1SendPacket(uint16_t Length,uint8_t *TransBuf);
|
|
|
|
#endif
|
|
|