Commit 6823fab3 authored by 梁百峰's avatar 梁百峰

feat:上传

parent 97baf639
......@@ -2,6 +2,12 @@
[Subproject]
:sourceDir=..\..\source\Appliciation
api_RS485.c
api_RS485.h
R485_Communication_Matrix.c
R485_Communication_Matrix.h
Barcode_Scanner.c
Barcode_Scanner.h
Fre_In_V2.30_16843.a
FreIn.h
FreIn_User.c
......
#!gbuild
[Subproject]
:sourceDir=..\..\source\Driver
UART\UART.c
UART\UART.h
.\Clock\Clock.h
.\Clock\Clock.c
.\Clock\RTC.c
......
#include "Barcode_Scanner.h"
#include "string.h"
#define UART_RX_MAX_DEPTH (1024UL) // 4K
typedef struct
{
uint32_t read_pos;
uint32_t write_pos;
uint8_t Rx_Buffer [ UART_RX_MAX_DEPTH ];
} UARTRxBuf_t;
static UARTRxBuf_t UARTRxBuf;
static uint8_t mDataBufPtr[256] = {0};
static uint16_t mDataBufLen = 0;
uint8_t BarCode[50] = {0};
uint32_t readNum = 0;
static uint32_t Protocol_UartRead(uint8_t *pData, uint32_t len);
uint8_t nowdata[4];
uint8_t lastdata[4];
uint8_t checkresult;
uint8_t sendmsg[8];
uint8_t timenum = 0;
void datacheck(void)
{
// if(mDataBufPtr[0] == 0x59 && mDataBufPtr [1] == 0x44)
// {
// sendnum++;
// for(int i = 0;i < 4; i++)
// {
// if(lastdata[i] != mDataBufPtr[i+4])
// {
// checkresult = 1;
// break;
// }
// else
// {
// checkresult = 0;
// }
// }
// for(int j = 0;j<1000;j++)
// {
// for(int k;k<1000;k++)
// {
sendnum++;
if(timenum <101)
{
timenum++;
}
// RS485_TX_finish = 0;
RS485_TX_finish = 0;
// }
// }
// if(mDataBufPtr[9] == 0x4B && mDataBufPtr [10] == 0x4A)
// {
if(RS485_TX_finish == 0)
{
// LINE_OUT_NEG_09 = 1;
}
else
{
RS485_TX_finish = 0;
// LINE_OUT_NEG_09 = 1;
}
RS485_TX_finish = 0;
// }
// }
}
void UART_Put(uint32_t Value)
{
uint32_t nextPos = 0u;
nextPos = (UARTRxBuf.write_pos + 1) % UART_RX_MAX_DEPTH;
if ( nextPos == UARTRxBuf.read_pos )
{
//队列已满,无法插入队列
// UARTRxBuf.write_pos = 0;
// RS485_TX_finish = 0;
}
else
{
UARTRxBuf.Rx_Buffer [ UARTRxBuf.write_pos ] = Value;
UARTRxBuf.write_pos = (UARTRxBuf.write_pos + 1) % UART_RX_MAX_DEPTH;
}
// RS485_TX_finish = 0;
// LINE_OUT_NEG_09 = 1;
// RS485_TX_finish = 0;
return;
}
void Recv_Byte(void)
{
int i = 0;
int j = 0;
int len;
readNum = Protocol_UartRead(mDataBufPtr + mDataBufLen, 256 - mDataBufLen);
if ( readNum > 0 )
{
mDataBufLen += readNum;
while(mDataBufLen)
{
for(i = 0; i < mDataBufLen; i++)
{
if(mDataBufPtr[i] == 0x0D)
{
if( i < 1)
{
break;
}
memset(BarCode, 0, sizeof(BarCode));
for(j = 0; j < i; j++)
{
BarCode[j] = mDataBufPtr[j];
}
break;
}
}
// 解析协议
len = i+1;
if ( (len > 0) && (len < mDataBufLen) )
{
// 将未解析的数据移到头部
// Move unparsed data to the head
memcpy(mDataBufPtr, mDataBufPtr + len, mDataBufLen - len);
// memcpy(nowdata,mDataBufPtr + len,len);
// datacheck();
}
datacheck();
mDataBufLen -= len;
}
}
return;
}
static uint32_t Protocol_UartRead(uint8_t *pData, uint32_t len)
{
uint32_t i = 0;
uint32_t DataLen = 0u;
uint32_t ReadLen = 0u;
if ( UARTRxBuf.write_pos == UARTRxBuf.read_pos )
{
return 0; //队列空
}
if ( UARTRxBuf.write_pos > UARTRxBuf.read_pos )
{
DataLen = UARTRxBuf.write_pos - UARTRxBuf.read_pos;
}
else
{
DataLen = UART_RX_MAX_DEPTH - (UARTRxBuf.read_pos - UARTRxBuf.write_pos);
}
if ( len > DataLen )
{
ReadLen = DataLen;
}
else
{
ReadLen = len;
}
for ( i = 0u; i < ReadLen; i++ )
{
pData [ i ] = UARTRxBuf.Rx_Buffer [ UARTRxBuf.read_pos ];
UARTRxBuf.read_pos = (UARTRxBuf.read_pos + 1) % UART_RX_MAX_DEPTH;
}
return ReadLen;
}
#ifndef _BARCODE_SCANNER_H_
#define _BARCODE_SCANNER_H_
#include "TYW_stdint.h"
#include "api_RS485.h"
void UART_Put(uint32_t Value);
void Recv_Byte(void);
extern uint32_t readNum;
extern uint8_t BarCode[50];
extern uint8_t sendmsg[8];
extern uint8_t nowdata[4];
extern uint8_t lastdata[4];
extern uint8_t checkresult;
#endif
\ No newline at end of file
......@@ -206,15 +206,15 @@ void Total_Check(void)
Display_TFT_Clear();
}
POWER_CTRL_KL30_Current = 1u;//静态电流电阻的远仪表端,永远接通总电源。B+~
POWER_CTRL_KL30_Current = 0u;//静态电流电阻的远仪表端,永远接通总电源。B+~
BCM_FLAG_2014 = BCM_2014[1] & 0X40 ;
switch ( loc_Type )
{
case 0:
POWER_CTRL_KL30 = 1u; //B+
POWER_CTRL_KL15 = 1u; //KL15
POWER_CTRL_KL30 = 0u; //B+
POWER_CTRL_KL15 = 0u; //KL15
CAN_Msg_Tx_Enable = 1u;
Diag_Info_Init( );
Display_Init( );
......@@ -228,8 +228,8 @@ void Total_Check(void)
break;
case 1:
POWER_CTRL_KL30 = 1u; //B+
POWER_CTRL_KL15 = 1u; //KL15
POWER_CTRL_KL30 = 0u; //B+
POWER_CTRL_KL15 = 0u; //KL15
CAN_Msg_Tx_Enable = 1u;
Display_Version_Info(1);
Send_Init();
......@@ -242,8 +242,8 @@ void Total_Check(void)
case 2:
POWER_CTRL_KL30 = 1u; //B+
POWER_CTRL_KL15 = 1u; //KL15
POWER_CTRL_KL30 = 0u; //B+
POWER_CTRL_KL15 = 0u; //KL15
CAN_Msg_Tx_Enable = 1u;
Diag_Info_Init( );
Display_Init( );
......@@ -258,8 +258,8 @@ void Total_Check(void)
case 3:
POWER_CTRL_KL30 = 1u; //B+
POWER_CTRL_KL15 = 1u; //KL15
POWER_CTRL_KL30 = 0u; //B+
POWER_CTRL_KL15 = 0u; //KL15
CAN_Msg_Tx_Enable = 1u;
Diag_Info_Init( );
Display_Init( );
......@@ -293,8 +293,8 @@ void Total_Check(void)
default:
POWER_CTRL_KL30 = 1u;
POWER_CTRL_KL15 = 1u;
POWER_CTRL_KL30 = 0u;
POWER_CTRL_KL15 = 0u;
CAN_Msg_Tx_Enable = 1u;
Display_Menu_Type = 0;
Diag_Info_Init( );
......@@ -302,7 +302,7 @@ void Total_Check(void)
Display_Version_Info(0);
Send_Init();
Send_ODO_Init();
Buzzer_Init();
// Buzzer_Init();
break;
}
......@@ -558,29 +558,29 @@ void Function_Check_Ctrl(uint32_t cmd)
{
case 0:
{
LINE_OUT_POS_01 = 0U;
LINE_OUT_POS_02 = 0U;
LINE_OUT_POS_03 = 0U;
LINE_OUT_POS_04 = 0U;
LINE_OUT_POS_05 = 0U;
LINE_OUT_POS_06 = 0U;
LINE_OUT_POS_08 = 0U;
LINE_OUT_POS_09 = 0U;
LINE_OUT_POS_10 = 0U;
LINE_OUT_NEG_01 = 0U;
LINE_OUT_NEG_02 = 0U;
LINE_OUT_NEG_03 = 0U;
LINE_OUT_NEG_04 = 0U;
LINE_OUT_NEG_05 = 0U;
LINE_OUT_NEG_06 = 0U;
LINE_OUT_NEG_07 = 0U;
LINE_OUT_NEG_08 = 0U;
LINE_OUT_NEG_09 = 0U;
LINE_OUT_NEG_10 = 0U;
LINE_FUEL_RES01 = 0U;
LINE_FUEL_RES02 = 0U;
LINE_FUEL_RES03 = 0U;
LINE_FUEL_RES04 = 0U;
// LINE_OUT_POS_01 = 0U;
// LINE_OUT_POS_02 = 0U;
// LINE_OUT_POS_03 = 0U;
// LINE_OUT_POS_04 = 0U;
// LINE_OUT_POS_05 = 0U;
// LINE_OUT_POS_06 = 0U;
// // LINE_OUT_POS_08 = 0U;
// // LINE_OUT_POS_09 = 0U;
// // LINE_OUT_POS_10 = 0U;
// LINE_OUT_NEG_01 = 0U;
// LINE_OUT_NEG_02 = 0U;
// LINE_OUT_NEG_03 = 0U;
// LINE_OUT_NEG_04 = 0U;
// LINE_OUT_NEG_05 = 0U;
// LINE_OUT_NEG_06 = 0U;
// LINE_OUT_NEG_07 = 0U;
// LINE_OUT_NEG_08 = 0U;
// // LINE_OUT_NEG_09 = 0U;
// LINE_OUT_NEG_10 = 0U;
// LINE_FUEL_RES01 = 0U;
// LINE_FUEL_RES02 = 0U;
// LINE_FUEL_RES03 = 0U;
// LINE_FUEL_RES04 = 0U;
break;
}
......
......@@ -2939,13 +2939,11 @@ void HW_Static_Current_Check(uint32_t cmd)
}
}
}
const uint16_t testNum[] = {200,190};
uint32_t dianzu;
const uint16_t testNum[] = {200,190,180};
void Check_PWM(void)
{
dianzu = Duty_VEHICLE;
uint32_t test = Duty_VEHICLE / 10;
GUI_General_Digit_Display(test, Num_15, 2, 1, testNum, 160);
GUI_General_Digit_Display(test, Num_15, 3, 1, testNum, 160);
}
void Display_Version_Info(uint32_t ON_OFF)
{
......
......@@ -22,7 +22,7 @@ typedef unsigned long long Fre_uint64_t;
typedef enum
{
FRE_VEHICLE = 0U,
FRE_ENGINE,
// FRE_ENGINE,
FRE_CHANNEL_MAX,
} Fre_Channel_en_t;
......
......@@ -59,7 +59,7 @@ Fre_uint8_t Fre_Status_Read_3(void)
const Fre_Attribute_st_t stFreAttribute[FRE_CHANNEL_MAX] =
{
{ 10U, 500000U, 100U, 1000U, 3000U, FRE_SAMP_CAPTURE_ROLL, Fre_Status_Read_0, 5000000UL},//车速 f= 5096*8(0~140km/h)/3600s
{ 10U, 500000U, 100U, 1000U, 3000U, FRE_SAMP_CAPTURE_ROLL, Fre_Status_Read_1, 5000000UL},//转速 f= (0~5000r/min)*4/60s
// { 10U, 500000U, 100U, 1000U, 3000U, FRE_SAMP_CAPTURE_ROLL, Fre_Status_Read_1, 5000000UL},//转速 f= (0~5000r/min)*4/60s
};
/************************************************/
......@@ -71,8 +71,8 @@ void Fre_In_KL30_Wakeup_Init(void)
TimerB_Input_Channel_Init(TIMERB_0_CH9, TIMERB_CLOCK_3, TIMERB_RISING_FALL);
TimerB_Input_Channel_Start(TIMERB_0_CH9);
TimerB_Input_Channel_Init(TIMERB_0_CH11, TIMERB_CLOCK_3, TIMERB_RISING_FALL);
TimerB_Input_Channel_Start(TIMERB_0_CH11);
// TimerB_Input_Channel_Init(TIMERB_0_CH11, TIMERB_CLOCK_3, TIMERB_RISING_FALL);
// TimerB_Input_Channel_Start(TIMERB_0_CH11);
}
......@@ -85,14 +85,19 @@ void Freln_Duty_HZ_Service(void)
{
VEHICLE_Status = Fre_In_Get_Channel_Status(FRE_VEHICLE);
// ENGINE_Status = Fre_In_Get_Channel_Status(FRE_ENGINE);
if(Fre_In_Get_Update_Flag(FRE_VEHICLE))
{
Fre_In_Reset_Update_Flag(FRE_VEHICLE);
Duty_VEHICLE = Fre_In_Get_Channel_Duty(FRE_VEHICLE);
HZ_VEHICLE = Fre_In_Get_Channel_HZ(FRE_VEHICLE);
}
if(VEHICLE_Status)
{
if(Fre_In_Get_Update_Flag(FRE_VEHICLE))
{
Fre_In_Reset_Update_Flag(FRE_VEHICLE);
Duty_VEHICLE = Fre_In_Get_Channel_Duty(FRE_VEHICLE);
HZ_VEHICLE = Fre_In_Get_Channel_HZ(FRE_VEHICLE);
}
else
{
Duty_VEHICLE = Fre_In_Get_Channel_Duty(FRE_VEHICLE);
}
}
// if(Fre_In_Get_Update_Flag(FRE_ENGINE))
// {
// Fre_In_Reset_Update_Flag(FRE_ENGINE);
......
......@@ -77,8 +77,10 @@ void RTE_GPIO_Init(void)
gpio_temp.enGPIODir = GPIO_DIR_IN;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp);//Pin0-14 LJS 电压采集 正控7
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
LINE_OUT_NEG_04 = 1;
#if(0)
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_0;
......
......@@ -53,7 +53,7 @@
#define LINE_OUT_FANGDAO GPIO_OUT_PORT10_PIN06
#define SD_FMQ GPIO_OUT_PORT10_PIN02
#define PWM_FMQ GPIO_OUT_PORT10_PIN11
// #define PWM_FMQ GPIO_OUT_PORT10_PIN06
#define NEG_1_Ctrl GPIO_OUT_PORT09_PIN06
......@@ -87,9 +87,9 @@
#define LINE_OUT_POS_05 GPIO_OUT_APORT00_PIN06
#define LINE_OUT_POS_06 GPIO_OUT_APORT00_PIN13
#define LINE_OUT_POS_07 GPIO_OUT_APORT00_PIN14
#define LINE_OUT_POS_08 GPIO_OUT_PORT08_PIN09
#define LINE_OUT_POS_09 GPIO_OUT_PORT08_PIN08
#define LINE_OUT_POS_10 GPIO_OUT_PORT00_PIN07
// #define LINE_OUT_POS_08 GPIO_OUT_PORT08_PIN09
// #define LINE_OUT_POS_09 GPIO_OUT_PORT08_PIN08
// #define LINE_OUT_POS_10 GPIO_OUT_PORT00_PIN07
#define LINE_OUT_NEG_01 GPIO_OUT_PORT09_PIN06
#define LINE_OUT_NEG_02 GPIO_OUT_PORT09_PIN05
......
......@@ -16,6 +16,10 @@
#include "Key.h"
#include "Check_Ctrl.h"
#include "FreIn_User.h"
#include "../UART/UART.h"
#include "string.h"
#include "api_RS485.h"
#include "R485_Communication_Matrix.h"
/*******************************************************************************
* *
* ϵͳ��������ģʽ(SYS_MODE_OFF / SYS_MODE_ON / SYS_MODE_STANDBY )�����б� *
......@@ -25,17 +29,20 @@
/*==============================================================================
αʵʱ����
------------------------------------------------------------------------------*/
uint8_t time100ms = 0;
uint8_t finish = 0;
void Sys_Run_Mode_Pseudo_Real_Time_Tasks(void)
{
SD_FMQ = 1;
DoCAN_Communication_Service( );
//UDS_Server_Application_Service( );
if ( CAN_Msg_Tx_Enable != 0 )
{
UDS_Server_Application_Service( );
}
TFT_LCD_Display_Update_Service( );
Fre_In_Service(FRE_VEHICLE);
//Fre_In_Service(FRE_ENGINE);
}
/*============================================================================*/
......@@ -54,19 +61,19 @@ void Sys_Run_Mode_2ms_Tasks_Group(void)
------------------------------------------------------------------------------*/
void Sys_Run_Mode_5ms_Tasks_Group(void)
{
}
/*==============================================================================
10ms����ִ������ ��0��
------------------------------------------------------------------------------*/
uint8_t testdata[3] = {0,1,2};
void Sys_Run_Mode_10ms_Tasks_Group(void)
{
BusOff_Service( );
Key_Service( );
Fre_In_Time_Out_Handle(10);
//刷数字、刷英文拼写。
//GUI_General_Digit_Display(123456789, Num_09, 10, 0, BackLightDigitNum09PosX, 79);
//GUI_General_Digit_Display(123456789, Num_10_03, 10, 0, BackLightDigitNum09PosX, 79+24*1);
......@@ -78,24 +85,57 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
//GUI_Display_Version_Code_Service((0), (79+24*2), "UVWXYZ / ' @ - ", Letter_Num_11, PCodeText_Space_size);
//GUI_Display_Version_Code_Service((0), (79+24*3), "abcdefghijklmnopqrstuvwxyz", Letter_Num_11, PCodeText_Space_size);
//GUI_Display_Version_Code_Service((0), (79+24*4), "0123456789 18FEAB21", Letter_Num_11, PCodeText_Space_size);
// UART_Ch0_Send_Multiple_Byte(testdata,3);
// RS485_User_Tx_Data();
Recv_Byte();
}
/*==============================================================================
20ms����ִ������ ��0��
------------------------------------------------------------------------------*/
uint8_t time100mssend = 0;
void Sys_Run_Mode_20ms_Tasks_Group0(void)
{
//Total_Check( );
// uint8_t data[8] = {0};
// uint32_t SpdN = 0;
// _CAN_Msg canMag;
// //Total_Check( );
// canMag.MsgID = 0x8FFF00B;
// FT_VehSpeedCalc_Main(FT_CurVehSpeed, &SpdN, SPEED_TO_CANMESSAGE);
// FT_Fill_VehSpeedCANMessage(SpdN, data);
// canMag.MsgDLC = 8u;
// canMag.MsgPro = 1u;
// memcpy(canMag.Msg, data, 8);
// Can_Write(&canMag);
if(time100mssend < 2)
{
time100mssend++;
}
else
{
firstIGON = 0;
time100mssend = 0;
}
}
/*==============================================================================
50ms����ִ������ ��0��
------------------------------------------------------------------------------*/
void Sys_Run_Mode_50ms_Tasks_Group(void)
{
static uint32_t timer_100ms = 0;
timer_100ms++;
if(timer_100ms <=1000)
{
timer_100ms++;
}
if ( timer_100ms == 1 )
......@@ -105,14 +145,41 @@ void Sys_Run_Mode_50ms_Tasks_Group(void)
}
else if ( timer_100ms == 2 )
{
timer_100ms = 0;
// timer_100ms = 0;
}
if(timer_100ms >=500)
{
firstIGON = 0;
}
if(firstIGON == 0)
{
// RS485_TX_finish = 0;
if(RS485_TX_finish == 0)
{
LINE_OUT_NEG_09 = 1;
if(LINE_OUT_NEG_09 == 1)
{
RS485_User_Tx_Data();
}
// else
// {
// RS485_TX_finish = 0;
// }
}
else
{
LINE_OUT_NEG_09 = 0;
}
}
}
/*==============================================================================
100ms����ִ������ ��0��
------------------------------------------------------------------------------*/
uint16_t u16LJSText;
void Sys_Run_Mode_100ms_Tasks_Group(void)
{
static uint32_t loc_timer = 0;
......@@ -122,11 +189,15 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
loc_timer = 0;
HW_CHECK_IPK_EXIST( );
}
Display_PageNum();
Total_Check( );
Freln_Duty_HZ_Service();
//u16LJSText = TFT_LCD_REQ_FIFO_MAX_DEPTH;
}
/*=================================================================*/
......
This diff is collapsed.
#ifndef API_485TR_H_
#define API_485TR_H_
#include "TYW_stdint.h"
#include "../UART/UART.h"
#include "Barcode_Scanner.h"
#include "RTE_GPIO.h"
#define RS485_RX_BUF_LEN 1024 * 4
#define RS485_RX_DATA_LEN 64
#define RS485_RECEIVE_ID_0X48 0X48
#define RS485_RECEIVE_ID_0X49 0X49
#define RS485_RECEIVE_ID_0X4A 0X4A
#define RS485_RECEIVE_ID_0X45 0X45
typedef enum
{
RS485_Tx_ID48_Idx = 0,
RS485_Tx_ID49_Idx,
RS485_Tx_ID4A_Idx,
RS485_Tx_ID70_Idx,
RS485_Tx_ID71_Idx,
RS485_Tx_ID72_Idx,
RS485_Tx_ID73_Idx,
RS485_Tx_ID74_Idx,
RS485_Tx_ID_Idx_Max,
}RS485_Receive_ID_Idx_en_t;
typedef enum
{
RS485_Rx_ID40_Idx = 0,
RS485_Rx_ID41_Idx,
RS485_Rx_ID42_Idx,
RS485_Rx_ID_Idx_Max,
}RS485_Transmit_ID_Idx_en_t;
typedef struct
{
uint8_t RS485Data[RS485_RX_BUF_LEN - 1];
uint8_t length;
} RS485DataPacket;
typedef enum
{
R485_Normal = 0,
R485_Lost = 0x55,
}_en_485_Rx_Status_t;
typedef struct
{
uint8_t u8RecVal[RS485_RX_DATA_LEN];
uint8_t u8Received;
uint8_t u8Status;
uint16_t u16LostTime;
uint8_t u8ReceivedFlag;
} RS485ValidDataPacket_st_t;
extern uint32_t RS485_send_time;
extern uint8_t RS485_TX_finish;
extern uint32_t RS485_send_num;
extern uint32_t sendnum;
extern uint8_t sendmsgAll[8];
extern uint32_t R485_Send(const uint16_t cmdID, const uint8_t* pData, uint8_t len);
extern uint8_t Yadi_CAL_Data_Sum(uint8_t* pu8LinData, uint16_t u8LinLen);
extern void RS485_User_Tx_Data(void);
#endif /* API_ADC_H_ */
......@@ -41,58 +41,58 @@ const uint16_t g_u16GPIOConfigArray[56U][2U] =
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x000Cu, 0x0000u},
{0x0020u, 0x0000u},
{0x0620u, 0x0600u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0630u, 0x0600u},
{0x4220u, 0x2207u},
{0x79CFu, 0x79FFu},
{0x063Cu, 0x0630u},
{0x1A6Bu, 0x1A6Fu},
{0x79C3u, 0x79CFu},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0008u},
{0x0000u, 0x0000u},
{0x0000u, 0x0003u},
{0x0000u, 0x0008u},
{0x0000u, 0x0008u},
{0x1FFFu, 0x1FF7u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x1FFFu, 0x1FFFu},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0002u, 0x0000u},
{0x0000u, 0x0000u},
{0x0001u, 0x0001u},
{0x007Fu, 0x007Fu},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x8800u, 0x0000u},
{0x8800u, 0x0000u},
{0x1800u, 0x1000u},
{0x0000u, 0x0800u},
{0x0000u, 0x0800u},
{0x0000u, 0x0000u},
{0x0002u, 0x0200u},
{0x1800u, 0x1800u},
{0x0A60u, 0x0A60u},
{0xE7FFu, 0xE7FFu},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0004u, 0x0200u},
{0x8800u, 0x0000u},
{0x8020u, 0x0000u},
{0x77FFu, 0xFFFFu},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0005u, 0x0000u},
{0x0005u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0000u},
{0x0000u, 0x0080u},
{0x0005u, 0x0000u},
{0x0001u, 0x0005u},
{0x00FAu, 0x00FFu},
{0x8080u, 0x1000u},
{0x000Fu, 0x673Fu},
{0x00FFu, 0x00FFu},
{0x0200u, 0x0000u},
{0xC07Fu, 0xC07Fu},
{0xFFFFu, 0xFFFFu},
};
static void GPIO_PIN_Init(GPIO_Config_Mode_en_t enGPIOConfigMode)
......
......@@ -153,7 +153,8 @@ typedef union
extern D8080_data_t D8080_data;
#define SIM_8080_P_A0 GPIO_OUT_PORT11_PIN05
#define SIM_8080_P_A0 GPIO_OUT_PORT11_PIN01
// #define SIM_8080_P_A0 GPIO_OUT_PORT11_PIN05
#define SIM_8080_P_nRD GPIO_OUT_PORT11_PIN04
#define SIM_8080_P_nWR GPIO_OUT_PORT11_PIN03
#define SIM_8080_P_nCS GPIO_OUT_PORT11_PIN02
......
......@@ -5,8 +5,8 @@
#include "Simulated_8080.h"
#define LCD_nRST GPIO_OUT_PORT11_PIN06
#define LCD_nRST GPIO_OUT_PORT08_PIN09
// #define LCD_nRST GPIO_OUT_PORT11_PIN06
......
This diff is collapsed.
#ifndef UART_H__
#define UART_H__
/*-----------------use for RH850_F1KM_S1 --------------------*/
//#include "dr7f701684.dvf.h"
#include "r_typedefs.h"
#include "Barcode_Scanner.h"
#define UART_VERSION 0X20
/***************************************************************/
/***************************************************************/
/**根据实际应用调整buf大小**/
#define UART_30_SEND_MAX 1024*10UL
#define UART_31_SEND_MAX 512UL
#define UART_32_SEND_MAX 1UL
#define UART_33_SEND_MAX 1UL
/***************************************************************/
typedef enum
{
MODE_NONE = 0U,
MODE_LIN_MASTER,
MODE_LIN_SLAVE,
MODE_UART,
MODE_MAX,
} UART_LIN_Mode_en_t;
typedef enum
{
UART_LSB = 0U,
UART_MSB,
} UART_Order_en_t;
typedef enum
{
UART_PARITY_DISABLE = 0U,
UART_PARITY_EVEN,
UART_PARITY_0,
UART_PARITY_ODD,
} UART_Parity_en_t;
typedef enum
{
UART_POLARITY_NORMAL = 0U,
UART_POLARITY_IN_INVERT,
UART_POLARITY_OUT_INVERT,
UART_POLARITY_IN_OUT_INVERT,
} UART_Polarity_en_t;
typedef enum
{
UART_RLIN30 = 0U,
UART_RLIN31,
UART_RLIN32,
UART_RLIN33,
UART_RLIN_MAX,
} UART_Channel_en_t;
typedef void (*UART_Confirm)(void);
typedef void (*UART_Read_Msg)(uint16_t u16UARTData);
typedef void (*UART_Error_Handle)(uint8_t u8ErrorFlag);
typedef struct
{
uint32_t u32UARTbps; /*通道实际波特率*/
UART_LIN_Mode_en_t enUARTLINMode; /*通道模式*/
UART_Order_en_t enUARTOrder; /*Valid only in UART mode*/
UART_Parity_en_t en2UARTParity; /*Valid only in UART mode*/
UART_Polarity_en_t en2UARTPolarity; /*Valid only in UART mode*/
UART_Confirm pfnUARTConfirmCallBack;
UART_Read_Msg pfnUARTReadMsgCallBack;
UART_Error_Handle pfnUARTErrHandleCallBack;
} UART_Channel_Config_st_t;
typedef struct
{
uint8_t u8LINID; /*要发送的ID*/
uint8_t u8LINLen; /*数据长度*/
uint8_t *pu8LINData; /*数据指针*/
} LIN_Data_st_t;
/****************************************************************/
void UART_CH0_TX_ISR(void);
void UART_CH1_TX_ISR(void);
void UART_CH2_TX_ISR(void);
void UART_CH3_TX_ISR(void);
void UART_CH0_RX_ISR(void);
void UART_CH1_RX_ISR(void);
void UART_CH2_RX_ISR(void);
void UART_CH3_RX_ISR(void);
void UART_CH0_Err_ISR(void);
void UART_CH1_Err_ISR(void);
void UART_CH2_Err_ISR(void);
void UART_CH3_Err_ISR(void);
/*
0:idle
1:busy
*/
uint8_t UART_Ch0_Get_TX_Busy_Flag(void);
uint8_t UART_Ch1_Get_TX_Busy_Flag(void);
uint8_t UART_Ch2_Get_TX_Busy_Flag(void);
uint8_t UART_Ch3_Get_TX_Busy_Flag(void);
/*
Data:要发送数据的指针,
返回0 :操作成功 。返回1:操作失败
*/
uint32_t UART_Ch0_Send_Multiple_Byte(uint8_t *Data, uint32_t Len);
uint32_t UART_Ch1_Send_Multiple_Byte(uint8_t *Data, uint32_t Len);
uint32_t UART_Ch2_Send_Multiple_Byte(uint8_t *Data, uint32_t Len);
uint32_t UART_Ch3_Send_Multiple_Byte(uint8_t *Data, uint32_t Len);
/* 返回设置成功的波特率,返回0xFFFFFFFF表示设置失败。*/
extern uint32_t UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg);
/*休眠时调用*/
extern void UART_Sleep_Init(UART_Channel_en_t enUARTCh);
/* 返回设置成功的波特率,返回0xFFFFFFFF表示设置失败。*/
extern uint32_t UART_LIN_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg);
/*
0:idle
1:busy
*/
extern uint8_t LIN_Ch0_Get_Busy_Flag(void);
extern uint8_t LIN_Ch1_Get_Busy_Flag(void);
extern uint8_t LIN_Ch2_Get_Busy_Flag(void);
extern uint8_t LIN_Ch3_Get_Busy_Flag(void);
/*返回0 :操作成功 。返回1:操作失败*/
extern uint32_t LIN_Ch0_Send_Header_Send_Response(LIN_Data_st_t *pstLINData);
extern uint32_t LIN_Ch1_Send_Header_Send_Response(LIN_Data_st_t *pstLINData);
extern uint32_t LIN_Ch2_Send_Header_Send_Response(LIN_Data_st_t *pstLINData);
extern uint32_t LIN_Ch3_Send_Header_Send_Response(LIN_Data_st_t *pstLINData);
/*返回0 :操作成功 。返回1:操作失败*/
extern uint32_t LIN_Ch0_Send_Header_Recieve_Response(LIN_Data_st_t *pstLINData);
extern uint32_t LIN_Ch1_Send_Header_Recieve_Response(LIN_Data_st_t *pstLINData);
extern uint32_t LIN_Ch2_Send_Header_Recieve_Response(LIN_Data_st_t *pstLINData);
extern uint32_t LIN_Ch3_Send_Header_Recieve_Response(LIN_Data_st_t *pstLINData);
#endif
......@@ -382,7 +382,7 @@
#define INTRLIN30UR0_ENABLE 0x00000000u
#endif
// #define INTRLIN30UR1_ENABLE (IRQ_TABLE_START + 0x0000008Cu)
#define INTRLIN30UR1_ENABLE (IRQ_TABLE_START + 0x0000008Cu)
#ifndef INTRLIN30UR1_ENABLE
#define INTRLIN30UR1_ENABLE 0x00000000u
#endif
......@@ -854,7 +854,7 @@
#define INTTAUB0I7_ENABLE 0x00000000u
#endif
// #define INTTAUB0I8_ENABLE (IRQ_TABLE_START + 0x00000258u)
#define INTTAUB0I8_ENABLE (IRQ_TABLE_START + 0x00000258u)
#ifndef INTTAUB0I8_ENABLE
#define INTTAUB0I8_ENABLE 0x00000000u
#endif
......@@ -864,7 +864,7 @@
#define INTTAUB0I9_ENABLE 0x00000000u
#endif
#define INTTAUB0I10_ENABLE (IRQ_TABLE_START + 0x00000260u)
// #define INTTAUB0I10_ENABLE (IRQ_TABLE_START + 0x00000260u)
#ifndef INTTAUB0I10_ENABLE
#define INTTAUB0I10_ENABLE 0x00000000u
#endif
......
......@@ -38,6 +38,7 @@
#include "Key.h"
#include "Display_Info.h"
#include "FreIn_User.h"
#include "../UART/UART.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
......@@ -63,7 +64,7 @@ void Sys_Startup_Pre_Init(void)
* \attention
* \retval None
******************************************************************************/
uint8_t firstIGON = 2;
void Sys_Startup_Init(void)
{
RTC_Pre_Init( ); //首次上电
......@@ -83,6 +84,17 @@ void Sys_Startup_Init(void)
Key_Init( );
Buzzer_Init();
Fre_In_KL30_Wakeup_Init();
UART_Channel_Config_st_t loc_config;
loc_config.enUARTLINMode = MODE_UART;
loc_config.u32UARTbps = 115200;
loc_config.enUARTOrder = UART_LSB;
loc_config.en2UARTParity = UART_PARITY_DISABLE;
loc_config.en2UARTPolarity = UART_POLARITY_NORMAL;
loc_config.pfnUARTConfirmCallBack = 0;
loc_config.pfnUARTErrHandleCallBack = 0;
loc_config.pfnUARTReadMsgCallBack = UART_Put;
firstIGON = 1;
UART_Init(UART_RLIN30, &loc_config);
}
/***********************************************************************
......
......@@ -29,7 +29,7 @@ extern void Sys_Startup_Pre_Init(void);
extern void Sys_Startup_Init(void);
extern void Sys_Sleep_Init(void);
extern void System_Wakeup_Init(void);
extern uint8_t firstIGON;
#ifdef __cplusplus
......
......@@ -6,6 +6,8 @@
#include "RSCAN.h"
#include "FreIn.h"
#include "dr7f701684.dvf.h"
#include "../UART/UART.h"
#if INTOSTM0_ENABLE
#pragma ghs interrupt
void INTOSTM0(void)
......@@ -25,7 +27,7 @@ void INTRCAN0TRX(void)
#pragma ghs interrupt
void INTRCAN1TRX(void)
{
RSCAN0_CH1_TX_ISR();
RSCAN0_CH1_TX_ISR();
}
#endif
#if INTRCAN2TRX_ENABLE
......@@ -57,21 +59,6 @@ void INTRCAN5TRX(void)
}
#endif
#if INTTAUB0I8_ENABLE
#pragma ghs interrupt
void INTTAUB0I8(void)
{
Fre_In_Channel_Overflow_ISR( FRE_VEHICLE);
}
#endif
#if INTTAUB0I9_ENABLE
#pragma ghs interrupt
void INTTAUB0I9(void)
{
Fre_In_Channel_Capture_ISR_Rolling_Count( FRE_VEHICLE, TAUB0CDR9 );
}
#endif
#if INTRCAN0REC_ENABLE
#pragma ghs interrupt
void INTRCAN0REC(void)
......@@ -100,6 +87,34 @@ void INTRCAN3REC(void)
RSCAN0_CH3_RX_ISR();
}
#endif
#if INTTAUB0I8_ENABLE
#pragma ghs interrupt
void INTTAUB0I8(void)
{
Fre_In_Channel_Overflow_ISR( FRE_VEHICLE);
}
#endif
#if INTTAUB0I9_ENABLE
#pragma ghs interrupt
void INTTAUB0I9(void)
{
Fre_In_Channel_Capture_ISR_Rolling_Count( FRE_VEHICLE, TAUB0CDR9 );
}
#endif
#if INTTAUB0I10_ENABLE
#pragma ghs interrupt
void INTTAUB0I10(void)
{
Fre_In_Channel_Overflow_ISR( FRE_ENGINE);
}
#endif
#if INTTAUB0I11_ENABLE
#pragma ghs interrupt
void INTTAUB0I11(void)
{
Fre_In_Channel_Capture_ISR_Rolling_Count( FRE_ENGINE, TAUB0CDR11 );
}
#endif
#if INTRCAN4REC_ENABLE
#pragma ghs interrupt
void INTRCAN4REC(void)
......@@ -114,3 +129,92 @@ void INTRCAN5REC(void)
RSCAN0_CH5_RX_ISR();
}
#endif
#if INTRLIN30UR0_ENABLE
#pragma ghs interrupt
void INTRLIN30UR0(void)
{
UART_CH0_TX_ISR();
}
#endif
#if INTRLIN30UR1_ENABLE
#pragma ghs interrupt
void INTRLIN30UR1(void)
{
UART_CH0_RX_ISR();
}
#endif
#if INTRLIN30UR2_ENABLE
#pragma ghs interrupt
void INTRLIN30UR2(void)
{
// UART_CH0_Err_ISR();
}
#endif
#if INTRLIN31UR0_ENABLE
#pragma ghs interrupt
void INTRLIN31UR0(void)
{
UART_CH1_TX_ISR();
}
#endif
#if INTRLIN31UR1_ENABLE
#pragma ghs interrupt
void INTRLIN31UR1(void)
{
UART_CH1_RX_ISR();
}
#endif
#if INTRLIN31UR2_ENABLE
#pragma ghs interrupt
void INTRLIN31UR2(void)
{
UART_CH1_Err_ISR();
}
#endif
#if INTRLIN32UR0_ENABLE
#pragma ghs interrupt
void INTRLIN32UR0(void)
{
UART_CH2_TX_ISR();
}
#endif
#if INTRLIN32UR1_ENABLE
#pragma ghs interrupt
void INTRLIN32UR1(void)
{
UART_CH2_RX_ISR();
}
#endif
#if INTRLIN32UR2_ENABLE
#pragma ghs interrupt
void INTRLIN32UR2(void)
{
UART_CH2_Err_ISR();
}
#endif
#if INTRLIN33UR0_ENABLE
#pragma ghs interrupt
void INTRLIN33UR0(void)
{
UART_CH3_TX_ISR();
}
#endif
#if INTRLIN33UR1_ENABLE
#pragma ghs interrupt
void INTRLIN33UR1(void)
{
UART_CH3_RX_ISR();
}
#endif
#if INTRLIN33UR2_ENABLE
#pragma ghs interrupt
void INTRLIN33UR2(void)
{
//UART_CH3_Err_ISR();
}
#endif
......@@ -376,17 +376,17 @@
#define INTRLIN30_ENABLE 0x00000000u
#endif
// #define INTRLIN30UR0_ENABLE (IRQ_TABLE_START + 0x00000088u)
#define INTRLIN30UR0_ENABLE (IRQ_TABLE_START + 0x00000088u)
#ifndef INTRLIN30UR0_ENABLE
#define INTRLIN30UR0_ENABLE 0x00000000u
#endif
// #define INTRLIN30UR1_ENABLE (IRQ_TABLE_START + 0x0000008Cu)
#define INTRLIN30UR1_ENABLE (IRQ_TABLE_START + 0x0000008Cu)
#ifndef INTRLIN30UR1_ENABLE
#define INTRLIN30UR1_ENABLE 0x00000000u
#endif
// #define INTRLIN30UR2_ENABLE (IRQ_TABLE_START + 0x00000090u)
#define INTRLIN30UR2_ENABLE (IRQ_TABLE_START + 0x00000090u)
#ifndef INTRLIN30UR2_ENABLE
#define INTRLIN30UR2_ENABLE 0x00000000u
#endif
......@@ -742,17 +742,17 @@
#define INTRLIN31_ENABLE 0x00000000u
#endif
// #define INTRLIN31UR0_ENABLE (IRQ_TABLE_START + 0x000001E4u)
//#define INTRLIN31UR0_ENABLE (IRQ_TABLE_START + 0x000001E4u)
#ifndef INTRLIN31UR0_ENABLE
#define INTRLIN31UR0_ENABLE 0x00000000u
#endif
// #define INTRLIN31UR1_ENABLE (IRQ_TABLE_START + 0x000001E8u)
//#define INTRLIN31UR1_ENABLE (IRQ_TABLE_START + 0x000001E8u)
#ifndef INTRLIN31UR1_ENABLE
#define INTRLIN31UR1_ENABLE 0x00000000u
#endif
// #define INTRLIN31UR2_ENABLE (IRQ_TABLE_START + 0x000001ECu)
//#define INTRLIN31UR2_ENABLE (IRQ_TABLE_START + 0x000001ECu)
#ifndef INTRLIN31UR2_ENABLE
#define INTRLIN31UR2_ENABLE 0x00000000u
#endif
......@@ -853,12 +853,12 @@
#define INTTAUB0I7_ENABLE 0x00000000u
#endif
#define INTTAUB0I8_ENABLE (IRQ_TABLE_START + 0x00000258u)
#define INTTAUB0I8_ENABLE (IRQ_TABLE_START + 0x00000258u)
#ifndef INTTAUB0I8_ENABLE
#define INTTAUB0I8_ENABLE 0x00000000u
#endif
#define INTTAUB0I9_ENABLE (IRQ_TABLE_START + 0x0000025Cu)
#define INTTAUB0I9_ENABLE (IRQ_TABLE_START + 0x0000025Cu)
#ifndef INTTAUB0I9_ENABLE
#define INTTAUB0I9_ENABLE 0x00000000u
#endif
......
#new Option
#Tue Dec 10 09:17:03 CST 2024
#Thu Jan 04 16:39:38 CST 2024
IsSort=true
MergeFlashIsCompression=false
ChangeAppFilePath=
......@@ -9,7 +9,7 @@ MergeCrcTtpe=1
MergeBootFilePath=
IsMergeChangeAddress=false
MergeFlashOutPutFilePath=
GPIOOutPutPath=D\:\\share\\\u8DC3\u8FDBBM-B4\\\u8DC3\u8FDBBM-B4\u68C0\u6D4B\u53F0\\\u65B0\u5EFA\u6587\u4EF6\u5939
GPIOOutPutPath=D\:\\Git\\\u4E0A\u6C7D\u8DC3\u8FDB\\\u68C0\u6D4B\u53F0git\\test-bench\\YueJin_test_bench\\utility\\\u8BCA\u65AD\u5DE5\u51771.10.11 x64\\Option
MergeCanDBCPath=
IsFilling=true
RxID=729
......
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