Commit 6ddf8a84 authored by 张金硕's avatar 张金硕

🎈 perf:添加630串口修改后新的串口库

parent dfe4d3c8
...@@ -1028,16 +1028,16 @@ ...@@ -1028,16 +1028,16 @@
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\System_Monitor\System_Monitor_User.h</FilePath> <FilePath>..\..\..\..\Source\Component\System_Monitor\System_Monitor_User.h</FilePath>
</File> </File>
<File>
<FileName>keil_S1.0.8_20240924.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\keil_S1.0.8_20240924.lib</FilePath>
</File>
<File> <File>
<FileName>UartProtocol.h</FileName> <FileName>UartProtocol.h</FileName>
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath> <FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath>
</File> </File>
<File>
<FileName>UartProtocol_Test_BW121_Bat32_241219.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol_Test_BW121_Bat32_241219.lib</FilePath>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>
......
...@@ -11,7 +11,8 @@ __align(4) /* 四字节对齐 */ ...@@ -11,7 +11,8 @@ __align(4) /* 四字节对齐 */
unsigned int AMT630H_InitTime = 0; unsigned int AMT630H_InitTime = 0;
uint8_t g_sysFlag_Lcdcheck = 0; uint8_t g_sysFlag_Lcdcheck = 0;
/* Initialization */ /* Initialization */
LCD_TFT_SOUND_PARA_ST LcdSoundParamterData; LCD_TFT_PARA_ST LcdSoundParamterData;
LCD_TFT_MIPI_PARA_ST LcdMipiSoundParamterDate;
SOFTWARE_VERSION_ST amt630Version; SOFTWARE_VERSION_ST amt630Version;
uint8_t Amt630hInitFinishFlag = 0; uint8_t Amt630hInitFinishFlag = 0;
...@@ -266,7 +267,14 @@ void Amt630hInit(void) ...@@ -266,7 +267,14 @@ void Amt630hInit(void)
LcdSoundParamterData.SoundChannelNum = 0; LcdSoundParamterData.SoundChannelNum = 0;
LcdSoundParamterData.SoundFreq = AUDIO_FREQ_48K; LcdSoundParamterData.SoundFreq = AUDIO_FREQ_48K;
SetLcdSoundParameter(&LcdSoundParamterData);
LcdMipiSoundParamterDate.MipiClkFreq = 0;
LcdMipiSoundParamterDate.MipiDisplaymMode = 0;
LcdMipiSoundParamterDate.MipiLane = 0;
LcdMipiSoundParamterDate.MipiNpPolarityInverse = 0;
RN6752_PARA_ST* LcdSoundRn6752ParamterDate = NULL;
// SetLcdSoundParameter(&LcdSoundParamterData);
SetLcdParameter(&LcdSoundParamterData,&LcdMipiSoundParamterDate,AMT630_UART3,LcdSoundRn6752ParamterDate);
SetSwVerBuf((uint8_t*)&amt630Version); SetSwVerBuf((uint8_t*)&amt630Version);
User_PicIndexDataInit(); User_PicIndexDataInit();
......
...@@ -7,6 +7,7 @@ typedef unsigned short uint16_t; ...@@ -7,6 +7,7 @@ typedef unsigned short uint16_t;
typedef short int16_t; typedef short int16_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
#define AMT_NULL 0
#define UART_UPDATE_ACK_NONE 0 #define UART_UPDATE_ACK_NONE 0
#define UART_UPDATE_ACK_OK 1 #define UART_UPDATE_ACK_OK 1
...@@ -40,11 +41,7 @@ extern void UartSendData(uint8_t *data, uint32_t len); ...@@ -40,11 +41,7 @@ extern void UartSendData(uint8_t *data, uint32_t len);
extern void AnalysisUartData(void); extern void AnalysisUartData(void);
/* Generate Function end */ /* Generate Function end */
/* Sound */ /* Lcd Parameter */
#define SOUND_STATE_FREE 0
#define SOUND_STATE_BUSY 1
#define WAV_TEST_NUM_TIC 0xfd
#define WAV_TEST_NUM_TOC 0xfe
enum { enum {
AUDIO_FREQ_NONE, AUDIO_FREQ_NONE,
AUDIO_FREQ_8K, AUDIO_FREQ_8K,
...@@ -61,13 +58,12 @@ enum { ...@@ -61,13 +58,12 @@ enum {
AUDIO_FREQ_192K, AUDIO_FREQ_192K,
AUDIO_FREQ_TOTAL, AUDIO_FREQ_TOTAL,
}; };
extern void PackedTransfer_SoundPlay(uint8_t Channel, uint8_t WavNum, uint16_t PlayTimes, uint16_t MinTimes, uint8_t Volume); typedef enum {
extern void PackedTransfer_SoundStop(uint8_t Channel); AMT630_UART1 = 1,
extern void PackedTransfer_SoundChangeVolume(uint8_t Channel, uint8_t Volume); AMT630_UART2,
extern uint8_t GetSoundChannelSta(uint8_t Channel); AMT630_UART3,
/* Sound end */ } AMT630_UART_CH_TYPE;
/* Lcd Parameter */
#define LCD_WIRING_MODE_RGB 0 #define LCD_WIRING_MODE_RGB 0
#define LCD_WIRING_MODE_RBG 1 #define LCD_WIRING_MODE_RBG 1
#define LCD_WIRING_MODE_GRB 2 #define LCD_WIRING_MODE_GRB 2
...@@ -77,6 +73,7 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel); ...@@ -77,6 +73,7 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel);
#define LCD_INTERFACE_TTL 0 #define LCD_INTERFACE_TTL 0
#define LCD_INTERFACE_LVDS 1 #define LCD_INTERFACE_LVDS 1
#define LCD_INTERFACE_MIPI 2
#define LCD_WIRING_BIT_ORDER_MSB 0 #define LCD_WIRING_BIT_ORDER_MSB 0
#define LCD_WIRING_BIT_ORDER_LSB 1 #define LCD_WIRING_BIT_ORDER_LSB 1
...@@ -91,12 +88,13 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel); ...@@ -91,12 +88,13 @@ extern uint8_t GetSoundChannelSta(uint8_t Channel);
#define VIDEO_IN_NTSC 1 #define VIDEO_IN_NTSC 1
#define VIDEO_IN_PAL 2 #define VIDEO_IN_PAL 2
#pragma pack(1)
typedef struct { typedef struct {
uint16_t LcdWidth; uint16_t LcdWidth;
uint16_t LcdHeight; uint16_t LcdHeight;
uint8_t LcdVideoInputValid : 2; uint8_t LcdVideoInputValid : 2;
uint8_t LcdBpp : 6; uint8_t LcdBpp : 6;
uint8_t Ark7116ResetPin; uint8_t Ark7116ResetPin;
uint8_t LcdInterfaceType : 4; uint8_t LcdInterfaceType : 4;
uint8_t LcdWiringMode : 4; uint8_t LcdWiringMode : 4;
uint8_t LcdWiringBitOrder : 2; uint8_t LcdWiringBitOrder : 2;
...@@ -112,12 +110,27 @@ typedef struct { ...@@ -112,12 +110,27 @@ typedef struct {
uint32_t LcdClkFreq; uint32_t LcdClkFreq;
uint8_t SoundFreq; uint8_t SoundFreq;
uint8_t SoundChannelNum; uint8_t SoundChannelNum;
} LCD_TFT_SOUND_PARA_ST; }LCD_TFT_PARA_ST;
typedef struct {
extern void SetLcdSoundParameter(LCD_TFT_SOUND_PARA_ST *pData); uint32_t MipiClkFreq;
uint8_t MipiNpPolarityInverse;
uint8_t MipiLane;
uint8_t MipiDisplaymMode;
}LCD_TFT_MIPI_PARA_ST;
#define RN6752_INPUT_TYPE_NONE 0
#define RN6752_INPUT_TYPE_CVBS_NTSC 1
#define RN6752_INPUT_TYPE_CVBS_PAL 2
#define RN6752_INPUT_TYPE_AHD_720P_25 3
#define RN6752_INPUT_TYPE_AHD_720P_30 4
typedef struct {
uint8_t Rn6752InputType;
uint8_t Rn6752ResetPin;
uint8_t Rn6752Address;
}RN6752_PARA_ST;
#pragma pack()
extern void SetLcdParameter(LCD_TFT_PARA_ST *pData, LCD_TFT_MIPI_PARA_ST *pDataMipi, AMT630_UART_CH_TYPE Amt630UartCh, RN6752_PARA_ST *pDataRn6752);
/* Lcd Parameter end */ /* Lcd Parameter end */
/* Amt Software */ /* Amt Software */
...@@ -235,7 +248,7 @@ typedef enum { ...@@ -235,7 +248,7 @@ typedef enum {
TFT_ROT_270, TFT_ROT_270,
} TFT_ROT_TYPE; } TFT_ROT_TYPE;
#define TEXT_ROT_SCALE (r, s) ((((r) & 0xffff) << 16) | ((s) & 0xffff)) #define TEXT_ROT_SCALE(r, s) ((((r) & 0xffff) << 16) | ((s) & 0xffff))
#define TEXT_COLOR(r, g, b, a) ((((r) & 0xff) << 24) | (((g) & 0xff) << 16) | (((b) & 0xff) << 8) | ((a) & 0xff)) #define TEXT_COLOR(r, g, b, a) ((((r) & 0xff) << 24) | (((g) & 0xff) << 16) | (((b) & 0xff) << 8) | ((a) & 0xff))
#define TEXT_LINE_OFFSET(x, y) ((((x) & 0xffff) << 16) | ((y) & 0xffff)) #define TEXT_LINE_OFFSET(x, y) ((((x) & 0xffff) << 16) | ((y) & 0xffff))
...@@ -253,7 +266,9 @@ extern void SetPageText(GRAPHICS_PAGE_ENUM page, uint16_t LabelNum, int16_t PosX ...@@ -253,7 +266,9 @@ extern void SetPageText(GRAPHICS_PAGE_ENUM page, uint16_t LabelNum, int16_t PosX
extern void SetPagePointerPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex); extern void SetPagePointerPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex);
extern void SetPagePointerSePic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN); extern void SetPagePointerSePic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN);
extern void SetPagePointerTrackPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex); extern void SetPagePointerTrackPic(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, uint16_t PicIndex);
extern void SetPagePointerTrackActiceArea(GRAPHICS_PAGE_ENUM page, POINTER_ENUM PointN, int16_t ActivePosX, int16_t ActivePosY, uint16_t ActiveW, uint16_t ActiveH);
extern void SetPageSliderNumPic(GRAPHICS_PAGE_ENUM page, uint8_t SliderNum); extern void SetPageSliderNumPic(GRAPHICS_PAGE_ENUM page, uint8_t SliderNum);
extern void SetPageSliderImagePic(GRAPHICS_PAGE_ENUM page, uint8_t SliderImageNum);
extern void PackedTransfer_PicDirectDraw(uint32_t PicIndex, uint8_t Valid); extern void PackedTransfer_PicDirectDraw(uint32_t PicIndex, uint8_t Valid);
extern void PackedTransfer_BgJpg(uint32_t PicIndex); extern void PackedTransfer_BgJpg(uint32_t PicIndex);
...@@ -319,21 +334,97 @@ extern void PackedTransfer_SetTftIoMode(uint8_t st); /*st 0:normal gpio, 1:TFT i ...@@ -319,21 +334,97 @@ extern void PackedTransfer_SetTftIoMode(uint8_t st); /*st 0:normal gpio, 1:TFT i
/* Set tft io mode end */ /* Set tft io mode end */
/* Slider Num */ /* Slider Num */
extern void PackedTransfer_SliderNumData(uint8_t n, uint8_t *data, uint32_t len); #pragma pack(1)
#define SLIDER_NUM_MAX 300 /* The maximum value is 300 */
typedef struct {
uint8_t SliderNum;
uint8_t SliderValid;
uint8_t ZoomOutMax;
uint8_t AlphaMin;
float DestVal;
float CurVal;
int16_t PosX;
int16_t PosY;
int16_t Interval;
uint16_t PicNum;
uint16_t DampingVal;
uint16_t PicIndex[SLIDER_NUM_MAX];
} SLIDER_NUMBER_PARA_ST;
#pragma pack()
extern void PackedTransfer_SliderNumData(uint8_t n, uint8_t *data, uint32_t len); /* PackedTransfer_SliderNumData(0, &SliderNumParaData, sizeof (SLIDER_NUMBER_PARA_ST)); */
extern void PackedTransfer_SliderNumDestVal(uint8_t n, uint16_t val, uint8_t ForceUpdate, uint8_t DisplayValid); extern void PackedTransfer_SliderNumDestVal(uint8_t n, uint16_t val, uint8_t ForceUpdate, uint8_t DisplayValid);
/* Slider Num end */ /* Slider Num end */
/* Slider Image */
#pragma pack(1)
#define SLIDER_IMAGE_PIC_MAX 5 /* The maximum value is 5 */
enum {
SLIDER_IMAGE_TYPE_HORIZONTAL_LEFT_TO_RIGHT,
SLIDER_IMAGE_TYPE_HORIZONTAL_RIGHT_TO_LEFT,
SLIDER_IMAGE_TYPE_VERTICAL_UP_TO_DOWN,
SLIDER_IMAGE_TYPE_VERTICAL_DOWN_TO_UP,
};
typedef struct {
uint8_t SliderType;
uint8_t SliderValid;
uint8_t Reserve1;
uint8_t Reserve2;
float DestVal;
float CurVal;
int16_t PosX;
int16_t PosY;
int16_t Interval;
uint16_t DampingVal;
uint16_t PicIndex[SLIDER_IMAGE_PIC_MAX];
} SLIDER_IMAGE_PARA_ST;
#pragma pack()
extern void PackedTransfer_SliderImageData(uint8_t n, uint8_t *data, uint32_t len); /* The setting range of parameter n is 0~9, PackedTransfer_SliderImageData(0, &SliderImageParaData, sizeof (SLIDER_IMAGE_PARA_ST)); */
extern void PackedTransfer_SliderImageDestVal(uint8_t n, uint16_t val, uint8_t ForceUpdate, uint8_t DisplayValid);
/* Slider Num end */
enum {NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9, NUM_POINT, NUM_LINE}; enum {NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9, NUM_POINT, NUM_LINE};
typedef struct { typedef struct {
const uint16_t *NumList; const uint16_t *NumList;
uint16_t NumListLength;
int16_t NumInterval; int16_t NumInterval;
int16_t PointNumInterval;
int16_t PointNumCoorX;
int16_t LineCoorX;
int16_t x; int16_t x;
int16_t y; int16_t y;
int16_t Number1TotalLattice;
int16_t Number1UseLattice;
int16_t Number7TotalLattice;
int16_t Number7UseLattice;
uint8_t DecimalNum; uint8_t DecimalNum;
uint8_t MinDigits; uint8_t MinDigits;
} DISPLAY_NUM_ST; } DISPLAY_NUM_ST;
typedef struct {
const uint16_t *CharacterList;
uint16_t CharacterLength;
int16_t CharacterInterval;
int16_t PointCharacterInterval;
int16_t PointCharacterCoorX;
int16_t LineCoorX;
int16_t x;
int16_t y;
int16_t Number1TotalLattice;
int16_t Number1UseLattice;
int16_t Number7TotalLattice;
int16_t Number7UseLattice;
}DISPLAY_CHARACTER_ST;
typedef enum {
CHAR_LEFT_JUSTIFYING = 0,
CHAR_RIGHT_JUSTIFYING,
TOTAL_JUSTIFYING_TYPE,
}CHAR_JUSTIFYING_TYPE;
extern void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal); extern void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal);
extern void DisplayCharacter(uint8_t page, DISPLAY_CHARACTER_ST *pCharacterData, char* Character, uint8_t JustifyingType);
/* /*
note: note:
...@@ -454,7 +545,7 @@ typedef struct ...@@ -454,7 +545,7 @@ typedef struct
typedef struct typedef struct
{ {
uint8_t BlueToothSignalSate; uint8_t BlueToothSignalSate;
uint8_t BlueToothPhoneSate;//incalloutcall uint8_t BlueToothPhoneSate;//incall¡¢outcall
uint8_t BlueToothPhoneName[100]; uint8_t BlueToothPhoneName[100];
uint8_t PhoneNumber[20]; uint8_t PhoneNumber[20];
uint16_t PhoneBookTotalCount; uint16_t PhoneBookTotalCount;
...@@ -478,6 +569,37 @@ typedef struct ...@@ -478,6 +569,37 @@ typedef struct
uint8_t RoadName[100]; uint8_t RoadName[100];
uint32_t distance; uint32_t distance;
}_NavigationData_struct; }_NavigationData_struct;
enum BLUE_HELMET_CONNECT_STATE
{
BLUE_HELMET_UNSUPPORTED = 0u,
BLUE_HELMET_STANDBY,
BLUE_HELMET_CONNECTING,
BLUE_HELMET_CONNECTED,
BLUE_HELMET_PASUSED,
BLUE_HELMET_STREAMING,
};
enum BLUE_HELMET_REQUIRE_STATE
{
BLUE_HELMET_SCAN_END = 0u,
BLUE_HELMET_SCAN_STATE,
BLUE_HELMET_MAIN_REQUIRE_STATE,
BLUE_HELMET_MAIN_REQUIRE_END,
BLUE_HELMET_SECOND_REQUIRE_STATE,
BLUE_HELMET_SECOND_REQUIRE_END,
};
typedef struct
{
uint8_t MainheadsetState;
uint8_t SecondheadsetState;
uint8_t MainMacAddressSuccess[20];
uint8_t secondMacAddressSuccess[20];
uint8_t Name[50];
uint8_t ScanMacAddress[20];
}_BLUE_HELMET_DATA_struct;
typedef struct typedef struct
{ {
uint16_t x; uint16_t x;
...@@ -500,8 +622,8 @@ typedef struct ...@@ -500,8 +622,8 @@ typedef struct
typedef struct{ typedef struct{
uint8_t blearn; uint8_t blearn;
uint8_t strmac[6]; uint8_t strmac[6];
uint8_t temperature;
uint16_t PressureVal; uint16_t PressureVal;
int temperature;
}ec_stru_TirePressure; }ec_stru_TirePressure;
extern ec_stru_TirePressure ec_stru_pressure; extern ec_stru_TirePressure ec_stru_pressure;
...@@ -510,6 +632,7 @@ extern uint8_t UUID_Received; ...@@ -510,6 +632,7 @@ extern uint8_t UUID_Received;
extern _BlueToothPhoneData BlueToothPhoneData; extern _BlueToothPhoneData BlueToothPhoneData;
extern _GPS_TIME GPS_Time; extern _GPS_TIME GPS_Time;
extern _NavigationData_struct NavigationData_st; extern _NavigationData_struct NavigationData_st;
extern _BLUE_HELMET_DATA_struct BlueHelmetDate;
extern void PackedTransfer_DisplayPhoneMirrorQRcode(uint8_t data,_PICID_Struct PICID_OBJ); extern void PackedTransfer_DisplayPhoneMirrorQRcode(uint8_t data,_PICID_Struct PICID_OBJ);
extern void PackedTransfer_BlueTooth_DataSet(uint8_t data); extern void PackedTransfer_BlueTooth_DataSet(uint8_t data);
extern void PackedTransfer_GetPhoneBookCmd(void); extern void PackedTransfer_GetPhoneBookCmd(void);
...@@ -531,5 +654,6 @@ extern void SetBlueToothName(uint8_t *data,uint8_t len); ...@@ -531,5 +654,6 @@ extern void SetBlueToothName(uint8_t *data,uint8_t len);
extern void SetTaskbarHeight(uint16_t height); extern void SetTaskbarHeight(uint16_t height);
extern void Set_Pro_Unique_Identifier(uint8_t *data,uint8_t len); extern void Set_Pro_Unique_Identifier(uint8_t *data,uint8_t len);
extern uint8_t GetUpdate(void); extern uint8_t GetUpdate(void);
extern void SetBluetoothhelmet(uint8_t data, uint8_t *MacAddress);
extern uint8_t GetWifiConncetState(void);
#endif #endif
...@@ -44,7 +44,7 @@ static void Power_KL30_Init(void) ...@@ -44,7 +44,7 @@ static void Power_KL30_Init(void)
UART_Channel_Config_st_t loc_config; UART_Channel_Config_st_t loc_config;
eeprom_StoreInfo_Init(); //50us eeprom_StoreInfo_Init(); //50us
loc_config.u32UARTChEn = 1U; loc_config.u32UARTChEn = 1U;
loc_config.u32UARTbps = 115200U; loc_config.u32UARTbps = 500000U;
loc_config.pfnUARTConfirmCallBack = NULL; loc_config.pfnUARTConfirmCallBack = NULL;
loc_config.pfnUARTReadMsgCallBack = Amt630hUartRecvData; loc_config.pfnUARTReadMsgCallBack = Amt630hUartRecvData;
UART_DeInit(UART2); //50us UART_DeInit(UART2); //50us
......
...@@ -81,6 +81,7 @@ void Sys_100ms_Tasks(void) ...@@ -81,6 +81,7 @@ void Sys_100ms_Tasks(void)
Get_DisTime_Service(); Get_DisTime_Service();
Fuel_Cal_Sevice(100u); Fuel_Cal_Sevice(100u);
Services_Mileage_Callback(); Services_Mileage_Callback();
Set_Pro_Unique_Identifier(MCU_PartNumber,sizeof(MCU_PartNumber));
// Data_Mileage_Clear(); // Data_Mileage_Clear();
// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High); // RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
//BackLight_Process(); //BackLight_Process();
......
...@@ -349,6 +349,7 @@ typedef struct ...@@ -349,6 +349,7 @@ typedef struct
// uint8_t fill_data[17]; /* 用于保证该结构体长度是4的倍数 */ // uint8_t fill_data[17]; /* 用于保证该结构体长度是4的倍数 */
} Diag_Write_Data_t; } Diag_Write_Data_t;
extern Diag_Write_Data_t Diag_Write_Data; extern Diag_Write_Data_t Diag_Write_Data;
extern uint8_t MCU_PartNumber[20];
extern void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); extern void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); extern void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment