Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
haoJin750TFT
Commits
0649b828
Commit
0649b828
authored
Sep 14, 2024
by
张金硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jinshuo' into 'dev'
Jinshuo See merge request
!81
parents
a58378f5
53304d13
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
322 additions
and
243 deletions
+322
-243
BackLight.c
Firmware/Source/Application/BackLight.c
+1
-1
BlueTooth.c
Firmware/Source/Application/BlueTooth.c
+73
-2
BlueTooth.h
Firmware/Source/Application/BlueTooth.h
+7
-1
CommonInterface.c
Firmware/Source/Application/CommonInterface.c
+1
-5
CommonInterface.h
Firmware/Source/Application/CommonInterface.h
+0
-1
AMT630H.c
Firmware/Source/Component/AMT630H/AMT630H.c
+16
-1
AMT630H.h
Firmware/Source/Component/AMT630H/AMT630H.h
+2
-2
Line_In_user.c
Firmware/Source/Component/Line_In/Line_In_user.c
+0
-28
Line_In_user.h
Firmware/Source/Component/Line_In/Line_In_user.h
+0
-4
Telltales_user.c
Firmware/Source/Component/Telltales/Telltales_user.c
+16
-16
DeepSleep.c
...urce/Device/Cmsemicon/BAT32A279/RTE/DeepSleep/DeepSleep.c
+62
-61
RTE_GPIO_BAT32A279.c
.../Device/Cmsemicon/BAT32A279/RTE/GPIO/RTE_GPIO_BAT32A279.c
+63
-60
RTE_GPIO_BAT32A279.h
.../Device/Cmsemicon/BAT32A279/RTE/GPIO/RTE_GPIO_BAT32A279.h
+8
-8
RTE_Tick_Timer_BAT32A279.c
...micon/BAT32A279/RTE/Tick_Timer/RTE_Tick_Timer_BAT32A279.c
+1
-1
RTE_TIM40.c
...e/Source/Device/Cmsemicon/BAT32A279/RTE/Tim40/RTE_TIM40.c
+60
-45
RTE_UART.c
...are/Source/Device/Cmsemicon/BAT32A279/RTE/UART/RTE_UART.c
+12
-7
No files found.
Firmware/Source/Application/BackLight.c
View file @
0649b828
...
...
@@ -42,7 +42,7 @@ Light_uint16_t LightR = 0u;
Light_uint16_t
LightR_Status
=
0
;
Light_uint16_t
LightR_Status_Count
=
0u
;
Light_uint16_t
NtcDataCount
;
Light_uint16_t
NtcData
[
LIGHT_DATA_NUM
];
Light_uint16_t
NtcData
[
LIGHT_DATA_NUM
]
=
{
0
}
;
typedef
struct
{
Light_uint16_t
Temperature
;
/* 温度 */
...
...
Firmware/Source/Application/BlueTooth.c
View file @
0649b828
...
...
@@ -13,7 +13,35 @@ _QRCODE_RECT QRCode_Rect;
const
uint8_t
HJBlueToothName
[
9
]
=
{
"HJ750"
};
uint8_t
UUIDConfigBuf
[
22
]
=
{
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0x00
};
//"600032023120100000995"
uint8_t
OSVersionASCLLList
[
20
]
=
{
0x56
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x2E
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
};
uint8_t
MCUVersionASCLLList
[
26
]
=
{
0x56
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x2E
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
0x30
,
0x00
,
};
void
TextService
(
void
);
...
...
@@ -123,7 +151,7 @@ TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] =
{
TEXT_NUM_INFORMATION_SWVERSION
,
0x4013
,
0
},
{
TEXT_NUM_INFORMATION_HW
,
0x4014
,
0
},
//23F 23E
{
TEXT_NUM_INFORMATION_OS
,
0x4015
,
0
},
{
TEXT_NUM_INFORMATION_
HMI
,
0x4016
,
0
},
{
TEXT_NUM_INFORMATION_
MCU
,
0x4016
,
0
},
{
TEXT_NUM_ROAD_NAME
,
0x4022
,
0
},
};
...
...
@@ -135,12 +163,43 @@ uint8_t CurBlueToothPhoneName[100];
uint8_t
BlueToothName
[
40
];
uint8_t
LastBlueToothName
[
20
];
uint8_t
PhoneNumberTotal
[
20
];
uint8_t
InformationOSVersion
[
20
];
uint8_t
InformationMCUVersion
[
26
];
void
TextService
(
void
)
{
if
(
TextInit
==
0
)
{
TextInit
=
1
;
OSVersionASCLLList
[
0
]
=
DATA_Version
[
0
];
OSVersionASCLLList
[
2
]
=
DATA_Version
[
1
];
OSVersionASCLLList
[
4
]
=
DATA_Version
[
2
];
OSVersionASCLLList
[
6
]
=
DATA_Version
[
3
];
OSVersionASCLLList
[
8
]
=
DATA_Version
[
4
];
OSVersionASCLLList
[
10
]
=
DATA_Version
[
5
];
OSVersionASCLLList
[
12
]
=
DATA_Version
[
6
];
OSVersionASCLLList
[
14
]
=
DATA_Version
[
7
];
OSVersionASCLLList
[
16
]
=
0x48
;
OSVersionASCLLList
[
18
]
=
0x4A
;
MCUVersionASCLLList
[
0
]
=
DATA_Version
[
0
];
MCUVersionASCLLList
[
2
]
=
DATA_Version
[
1
];
MCUVersionASCLLList
[
4
]
=
DATA_Version
[
2
];
MCUVersionASCLLList
[
6
]
=
DATA_Version
[
3
];
MCUVersionASCLLList
[
8
]
=
DATA_Version
[
4
];
MCUVersionASCLLList
[
10
]
=
DATA_Version
[
5
];
MCUVersionASCLLList
[
12
]
=
DATA_Version
[
6
];
MCUVersionASCLLList
[
14
]
=
DATA_Version
[
7
];
MCUVersionASCLLList
[
16
]
=
0x2E
;
MCUVersionASCLLList
[
18
]
=
SW_Version
[
0
];
MCUVersionASCLLList
[
20
]
=
0x2E
;
MCUVersionASCLLList
[
22
]
=
SW_Version
[
1
];
MCUVersionASCLLList
[
24
]
=
SW_Version
[
2
];
memset
(
InformationOSVersion
,
0
,
sizeof
(
InformationOSVersion
));
memset
(
InformationMCUVersion
,
0
,
sizeof
(
InformationMCUVersion
));
memset
(
PhoneNumber
,
0
,
sizeof
(
PhoneNumber
));
memset
(
LastPhoneNumber
,
0
,
sizeof
(
LastPhoneNumber
));
memset
(
LastBlueToothPhoneName
,
0
,
sizeof
(
LastBlueToothPhoneName
));
...
...
@@ -148,6 +207,18 @@ void TextService(void)
memset
(
BlueToothName
,
0
,
sizeof
(
BlueToothName
));
memset
(
LastBlueToothName
,
0
,
sizeof
(
LastBlueToothName
));
memset
(
PhoneNumberTotal
,
0
,
sizeof
(
PhoneNumberTotal
));
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
OSVersionASCLLList
);
i
++
)
{
InformationOSVersion
[
i
]
=
OSVersionASCLLList
[
i
];
}
TextPara
[
TEXT_NUM_INFORMATION_OS
].
Vaild
=
0x01
;
for
(
uint8_t
i
=
0
;
i
<
sizeof
(
MCUVersionASCLLList
);
i
++
)
{
InformationMCUVersion
[
i
]
=
MCUVersionASCLLList
[
i
];
}
TextPara
[
TEXT_NUM_INFORMATION_MCU
].
Vaild
=
0x01
;
}
if
(
BlueToothPhoneData
.
BlueToothSignalSate
==
BlueTooth_Connection
)
{
...
...
Firmware/Source/Application/BlueTooth.h
View file @
0649b828
...
...
@@ -12,7 +12,7 @@ typedef enum {
TEXT_NUM_INFORMATION_SWVERSION
,
TEXT_NUM_INFORMATION_HW
,
TEXT_NUM_INFORMATION_OS
,
TEXT_NUM_INFORMATION_
HMI
,
TEXT_NUM_INFORMATION_
MCU
,
TEXT_NUM_ROAD_NAME
,
TEXT_NUM_TOTAL
,
}
TEXT_NUM_ENUM
;
...
...
@@ -23,7 +23,11 @@ typedef struct {
uint16_t
Vaild
;
}
TEXT_STRUCT
;
#define INFORMATION_VERSION_DATE "20240915"
#define SW_EXTERNAL_VERSION "100"
static
const
uint8_t
DATA_Version
[
8
]
=
{
INFORMATION_VERSION_DATE
};
static
const
uint8_t
SW_Version
[
3
]
=
{
SW_EXTERNAL_VERSION
};
/*QRCode X Y height Width*/
...
...
@@ -41,6 +45,8 @@ extern uint8_t PhoneNumber[40];
extern
uint8_t
CurBlueToothPhoneName
[
100
];
extern
uint8_t
BlueToothName
[
40
];
extern
uint8_t
PhoneNumberTotal
[
20
];
extern
uint8_t
InformationOSVersion
[
20
];
extern
uint8_t
InformationMCUVersion
[
26
];
extern
TEXT_STRUCT
TextPara
[];
#endif
\ No newline at end of file
Firmware/Source/Application/CommonInterface.c
View file @
0649b828
...
...
@@ -93,11 +93,7 @@ void Common_Set_Disp_V_Speed_Valid(DataValid_t Val)
Disp_V_Speed_Valid
=
Val
;
}
uint16_t
Common_Get_DispSpeed
(
void
)
{
uint16_t
m_Res
;
return
m_Res
;
}
void
Common_Input_Para
(
void
)
{
...
...
Firmware/Source/Application/CommonInterface.h
View file @
0649b828
...
...
@@ -66,7 +66,6 @@ extern void Common_Set_Disp_V_Speed(uint16_t Val);
extern
uint16_t
Common_Get_TireSize
(
void
);
extern
void
Common_Set_Act_V_Speed_Valid
(
DataValid_t
Val
);
extern
void
Common_Set_Disp_V_Speed_Valid
(
DataValid_t
Val
);
extern
uint16_t
Common_Get_DispSpeed
(
void
);
extern
uint32_t
Common_GetIgnOnTime
(
void
);
/*ms*/
extern
uint32_t
Common_GetIgnOffTime
(
void
);
/*ms*/
...
...
Firmware/Source/Component/AMT630H/AMT630H.c
View file @
0649b828
...
...
@@ -46,8 +46,23 @@ static uint8_t AMT630H_Animation_Start = 0;
static
uint8_t
AMT630H_Animation_Finish
=
0
;
static
uint16_t
AMT630H_Animation_DispPic
=
0
;
static
uint16_t
AMT630H_Animation_RefreshTime
=
0
;
static
uint
16
_t
AMT630H_Animation_RefreshTime_default
=
0
;
static
uint
32
_t
AMT630H_Animation_RefreshTime_default
=
0
;
static
const
uint16_t
BootAnimationList
[
AMT630H_ANIMATION_PIC_NUM
]
=
{
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
Pic_0860_0_0
,
...
...
Firmware/Source/Component/AMT630H/AMT630H.h
View file @
0649b828
...
...
@@ -20,8 +20,8 @@ typedef struct
#define AMT630H_REFRESH_TIME 50U
#define AMT630H_ANIMATION_TIME
3
000U //ms
#define AMT630H_ANIMATION_PIC_NUM 1
10
U
#define AMT630H_ANIMATION_TIME
4
000U //ms
#define AMT630H_ANIMATION_PIC_NUM 1
25
U
#define AMT630H_ANIMATION_REFRESHTIME_DEF(x) ((AMT630H_ANIMATION_TIME > x) ? \
(((AMT630H_ANIMATION_TIME - x) / AMT630H_ANIMATION_PIC_NUM) - 5) : \
(((AMT630H_ANIMATION_TIME) / AMT630H_ANIMATION_PIC_NUM) - 5))
...
...
Firmware/Source/Component/Line_In/Line_In_user.c
View file @
0649b828
...
...
@@ -12,8 +12,6 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_ABS
,
},
/*P7*/
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_Auto_Start_Stop
,
},
/*P12*/
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_Oil_Pressure_Alert
,
},
/*P21*/
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_Voltage
,
},
/*P19*/
{
LEVEL_HIGH
,
LEVEL_LOW
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_Fuel_Level_Low
,
},
/*P14*/
{
LEVEL_LOW
,
LEVEL_HIGH
,
LINE_IN_IG_ON
,
20U
,
20U
,
Get_LINE_IN_Coolant_Temperature
},
/*P11*/
};
Linelib_uint8_t
Get_LINE_IN_Turn_Left
(
void
)
...
...
@@ -107,32 +105,6 @@ Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void)
}
return
ret
;
}
Linelib_uint8_t
Get_LINE_IN_Voltage
(
void
)
{
// Linelib_uint8_t ret = 0U;
// if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))/*没找到电压指示灯*/
// {
// ret = 1u;
// }
// else
// {
// ret = 0UL;
// }
// return ret;
}
Linelib_uint8_t
Get_LINE_IN_Fuel_Level_Low
(
void
)
{
// Linelib_uint8_t ret = 0U;
// if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))/*修改指示灯*/
// {
// ret = 1u;
// }
// else
// {
// ret = 0UL;
// }
// return ret;
}
Linelib_uint8_t
Get_LINE_IN_Coolant_Temperature
(
void
)
{
Linelib_uint8_t
ret
=
0U
;
...
...
Firmware/Source/Component/Line_In/Line_In_user.h
View file @
0649b828
...
...
@@ -12,8 +12,6 @@ typedef enum
LINE_IN_ABS
,
LINE_IN_Auto_Start_Stop
,
LINE_IN_Oil_Pressure_Alert
,
LINE_IN_Voltage
,
LINE_IN_Fuel_Level_Low
,
LINE_IN_Coolant_Temperature
,
LINE_IN_MAX
,
...
...
@@ -28,7 +26,5 @@ Linelib_uint8_t Get_LINE_IN_Efi_Fault(void);
Linelib_uint8_t
Get_LINE_IN_ABS
(
void
);
Linelib_uint8_t
Get_LINE_IN_Auto_Start_Stop
(
void
);
Linelib_uint8_t
Get_LINE_IN_Oil_Pressure_Alert
(
void
);
Linelib_uint8_t
Get_LINE_IN_Voltage
(
void
);
Linelib_uint8_t
Get_LINE_IN_Fuel_Level_Low
(
void
);
Linelib_uint8_t
Get_LINE_IN_Coolant_Temperature
(
void
);
#endif
Firmware/Source/Component/Telltales/Telltales_user.c
View file @
0649b828
...
...
@@ -301,14 +301,14 @@ static void LED_HEV_Execution(Tellib_uint16_t led_status)
static
Tellib_uint16_t
LED_Voltage_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
if
(
Line_In_Get_Status
(
LINE_IN_Voltage
))
{
LED_STATE
=
1
;
}
else
{
LED_STATE
=
0
;
}
//
if (Line_In_Get_Status(LINE_IN_Voltage))
//
{
//
LED_STATE = 1;
//
}
//
else
//
{
//
LED_STATE = 0;
//
}
return
LED_STATE
;
}
static
void
LED_Voltage_Execution
(
Tellib_uint16_t
led_status
)
...
...
@@ -321,14 +321,14 @@ static void LED_Voltage_Execution(Tellib_uint16_t led_status)
static
Tellib_uint16_t
LED_Fuel_Level_Low_Judgement
(
void
)
{
Tellib_uint16_t
LED_STATE
=
0u
;
if
(
Line_In_Get_Status
(
LINE_IN_Fuel_Level_Low
))
{
LED_STATE
=
1
;
}
else
{
LED_STATE
=
0
;
}
//
if (Line_In_Get_Status(LINE_IN_Fuel_Level_Low))
//
{
//
LED_STATE = 1;
//
}
//
else
//
{
//
LED_STATE = 0;
//
}
return
LED_STATE
;
}
static
void
LED_Fuel_Level_Low_Execution
(
Tellib_uint16_t
led_status
)
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/DeepSleep/DeepSleep.c
View file @
0649b828
...
...
@@ -2,7 +2,7 @@
#include "RTE.h"
#include "DeepSleep.h"
#include "isr.h"
GPIO_Port_t
RTE_Deep_GPIO_Port_Get
(
uint16_t
u16PortIndex
);
//
GPIO_Port_t RTE_Deep_GPIO_Port_Get(uint16_t u16PortIndex);
void
DEEPSLEEP_EXTI0_IRQHandler
(
void
*
msg
);
void
DEEPSLEEP_EXTI1_IRQHandler
(
void
*
msg
);
void
DEEPSLEEP_EXTI2_IRQHandler
(
void
*
msg
);
...
...
@@ -73,13 +73,14 @@ const RTE_DEEPSLEEP_INTP_Table_st_t DEEPSLEEP_INTP_Table[] =
void
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
uint16_t
u16Pin
,
Trigger_TypeDef
EXTI_Trigger
)
{
int32_t
i32Result
;
uint8_t
u8Index
;
uint8_t
u8Index
;
uint16_t
u16PortIndex
;
uint16_t
u16PinIndex
;
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
INTP_InitTypeDef
INTP_InitStructure
;
u8Index
=
0
;
u16PinIndex
=
u16Pin
&
0x00FFU
;
u16PortIndex
=
(
u16Pin
>>
8
)
&
0x00FFU
;
...
...
@@ -256,65 +257,65 @@ void DEEPSLEEP_EXTI11_IRQHandler(void *msg)
/* ����жϱ�־ */
INTC_ClearPendingIRQ
(
INTP11_IRQn
);
}
GPIO_Port_t
RTE_Deep_GPIO_Port_Get
(
uint16_t
u16PortIndex
)
{
GPIO_Port_t
enGPIO_Port
;
switch
(
u16PortIndex
)
{
case
0U
:
enGPIO_Port
=
GPIO_PORT0
;
break
;
case
1U
:
enGPIO_Port
=
GPIO_PORT1
;
break
;
case
2U
:
enGPIO_Port
=
GPIO_PORT2
;
break
;
case
3U
:
enGPIO_Port
=
GPIO_PORT3
;
break
;
case
4U
:
enGPIO_Port
=
GPIO_PORT4
;
break
;
case
5U
:
enGPIO_Port
=
GPIO_PORT5
;
break
;
case
6U
:
enGPIO_Port
=
GPIO_PORT6
;
break
;
case
7U
:
enGPIO_Port
=
GPIO_PORT7
;
break
;
#if defined BAT32A2X9_100PIN
case
8U
:
enGPIO_Port
=
GPIO_PORT8
;
break
;
#endif
#if defined BAT32A2X9_80PIN || defined BAT32A2X9_100PIN
case
10U
:
enGPIO_Port
=
GPIO_PORT10
;
break
;
case
11U
:
enGPIO_Port
=
GPIO_PORT11
;
break
;
case
15U
:
enGPIO_Port
=
GPIO_PORT15
;
break
;
#endif
case
12U
:
enGPIO_Port
=
GPIO_PORT12
;
break
;
case
13U
:
enGPIO_Port
=
GPIO_PORT13
;
break
;
case
14U
:
enGPIO_Port
=
GPIO_PORT14
;
break
;
default:
break
;
}
return
enGPIO_Port
;
}
//
GPIO_Port_t RTE_Deep_GPIO_Port_Get(uint16_t u16PortIndex)
//
{
//
GPIO_Port_t enGPIO_Port;
//
switch (u16PortIndex)
//
{
//
case 0U:
//
enGPIO_Port = GPIO_PORT0;
//
break;
//
case 1U:
//
enGPIO_Port = GPIO_PORT1;
//
break;
//
case 2U:
//
enGPIO_Port = GPIO_PORT2;
//
break;
//
case 3U:
//
enGPIO_Port = GPIO_PORT3;
//
break;
//
case 4U:
//
enGPIO_Port = GPIO_PORT4;
//
break;
//
case 5U:
//
enGPIO_Port = GPIO_PORT5;
//
break;
//
case 6U:
//
enGPIO_Port = GPIO_PORT6;
//
break;
//
case 7U:
//
enGPIO_Port = GPIO_PORT7;
//
break;
//
#if defined BAT32A2X9_100PIN
//
case 8U:
//
enGPIO_Port = GPIO_PORT8;
//
break;
//
#endif
//
#if defined BAT32A2X9_80PIN || defined BAT32A2X9_100PIN
//
case 10U:
//
enGPIO_Port = GPIO_PORT10;
//
break;
//
case 11U:
//
enGPIO_Port = GPIO_PORT11;
//
break;
//
case 15U:
//
enGPIO_Port = GPIO_PORT15;
//
break;
//
#endif
//
case 12U:
//
enGPIO_Port = GPIO_PORT12;
//
break;
//
case 13U:
//
enGPIO_Port = GPIO_PORT13;
//
break;
//
case 14U:
//
enGPIO_Port = GPIO_PORT14;
//
break;
//
default:
//
break;
//
}
//
return enGPIO_Port;
//
}
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/GPIO/RTE_GPIO_BAT32A279.c
View file @
0649b828
...
...
@@ -9,7 +9,7 @@
#include "RTE_GPIO.h"
GPIO_Port_t
RTE_GPIO_Port_Get
(
uint16_t
u16PortIndex
);
//
GPIO_Port_t RTE_GPIO_Port_Get(uint16_t u16PortIndex);
void
EXTI0_IRQHandler
(
void
*
msg
);
void
EXTI1_IRQHandler
(
void
*
msg
);
void
EXTI2_IRQHandler
(
void
*
msg
);
...
...
@@ -538,6 +538,7 @@ int32_t RTE_GPIO_Interrupt_Enable(RTE_GPIO_IRQ_Desc_st_t *pstIRQDesc)
INTP_InitTypeDef
stEXTICfg
;
i32Result
=
-
1
;
u8Index
=
0
;
if
(
pstIRQDesc
!=
NULL
)
{
u16PinIndex
=
pstIRQDesc
->
u16Pin
&
0x00FFU
;
...
...
@@ -1039,62 +1040,64 @@ void EXTI17_IRQHandler(void *msg)
}
}
}
GPIO_Port_t
RTE_GPIO_Port_Get
(
uint16_t
u16PortIndex
)
{
GPIO_Port_t
enGPIO_Port
;
switch
(
u16PortIndex
)
{
case
0U
:
enGPIO_Port
=
GPIO_PORT0
;
break
;
case
1U
:
enGPIO_Port
=
GPIO_PORT1
;
break
;
case
2U
:
enGPIO_Port
=
GPIO_PORT2
;
break
;
case
3U
:
enGPIO_Port
=
GPIO_PORT3
;
break
;
case
4U
:
enGPIO_Port
=
GPIO_PORT4
;
break
;
case
5U
:
enGPIO_Port
=
GPIO_PORT5
;
break
;
case
6U
:
enGPIO_Port
=
GPIO_PORT6
;
break
;
case
7U
:
enGPIO_Port
=
GPIO_PORT7
;
break
;
#if defined BAT32A2X9_100PIN
case
8U
:
enGPIO_Port
=
GPIO_PORT8
;
break
;
#endif
#if defined BAT32A2X9_80PIN || defined BAT32A2X9_100PIN
case
10U
:
enGPIO_Port
=
GPIO_PORT10
;
break
;
case
11U
:
enGPIO_Port
=
GPIO_PORT11
;
break
;
case
15U
:
enGPIO_Port
=
GPIO_PORT15
;
break
;
#endif
case
12U
:
enGPIO_Port
=
GPIO_PORT12
;
break
;
case
13U
:
enGPIO_Port
=
GPIO_PORT13
;
break
;
case
14U
:
enGPIO_Port
=
GPIO_PORT14
;
break
;
default:
break
;
}
return
enGPIO_Port
;
}
// GPIO_Port_t RTE_GPIO_Port_Get(uint16_t u16PortIndex)
// {
// GPIO_Port_t enGPIO_Port;
// switch (u16PortIndex)
// {
// case 0U:
// enGPIO_Port = GPIO_PORT0;
// break;
// case 1U:
// enGPIO_Port = GPIO_PORT1;
// break;
// case 2U:
// enGPIO_Port = GPIO_PORT2;
// break;
// case 3U:
// enGPIO_Port = GPIO_PORT3;
// break;
// case 4U:
// enGPIO_Port = GPIO_PORT4;
// break;
// case 5U:
// enGPIO_Port = GPIO_PORT5;
// break;
// case 6U:
// enGPIO_Port = GPIO_PORT6;
// break;
// case 7U:
// enGPIO_Port = GPIO_PORT7;
// break;
// #if defined BAT32A2X9_100PIN
// case 8U:
// enGPIO_Port = GPIO_PORT8;
// break;
// #endif
// #if defined BAT32A2X9_80PIN || defined BAT32A2X9_100PIN
// case 10U:
// enGPIO_Port = GPIO_PORT10;
// break;
// case 11U:
// enGPIO_Port = GPIO_PORT11;
// break;
// case 15U:
// enGPIO_Port = GPIO_PORT15;
// break;
// #endif
// case 12U:
// enGPIO_Port = GPIO_PORT12;
// break;
// case 13U:
// enGPIO_Port = GPIO_PORT13;
// break;
// case 14U:
// enGPIO_Port = GPIO_PORT14;
// break;
// default:
// break;
// }
// return enGPIO_Port;
// }
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/GPIO/RTE_GPIO_BAT32A279.h
View file @
0649b828
...
...
@@ -17,14 +17,14 @@ typedef struct
void
*
pvHandler
;
}
RTE_GPIO_IRQ_Desc_st_t
;
#define RTE_GPIO_PORT_GROUP_00 (0
0
U)
#define RTE_GPIO_PORT_GROUP_01 (
0
1U)
#define RTE_GPIO_PORT_GROUP_02 (
0
2U)
#define RTE_GPIO_PORT_GROUP_03 (
0
3U)
#define RTE_GPIO_PORT_GROUP_04 (
0
4U)
#define RTE_GPIO_PORT_GROUP_05 (
0
5U)
#define RTE_GPIO_PORT_GROUP_06 (
0
6U)
#define RTE_GPIO_PORT_GROUP_07 (
0
7U)
#define RTE_GPIO_PORT_GROUP_00 (0U)
#define RTE_GPIO_PORT_GROUP_01 (1U)
#define RTE_GPIO_PORT_GROUP_02 (2U)
#define RTE_GPIO_PORT_GROUP_03 (3U)
#define RTE_GPIO_PORT_GROUP_04 (4U)
#define RTE_GPIO_PORT_GROUP_05 (5U)
#define RTE_GPIO_PORT_GROUP_06 (6U)
#define RTE_GPIO_PORT_GROUP_07 (7U)
#define RTE_GPIO_PORT_GROUP_12 (12U)
#define RTE_GPIO_PORT_GROUP_13 (13U)
#define RTE_GPIO_PORT_GROUP_14 (14U)
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/Tick_Timer/RTE_Tick_Timer_BAT32A279.c
View file @
0649b828
...
...
@@ -8,7 +8,7 @@
RTE_Tick_Timer_Call_Back_ptr_t
g_pfnRTETickTimerCallBackFunc
=
NULL
;
uint
8
_t
u8Value_us
=
0
;
uint
32
_t
u8Value_us
=
0
;
void
RTE_Tick_Timer_Start
(
uint32_t
u32Interval
,
RTE_Tick_Timer_Call_Back_ptr_t
pfnCallBack
)
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/Tim40/RTE_TIM40.c
View file @
0649b828
...
...
@@ -222,57 +222,72 @@ void RTE_Calc_Freq(uint8_t u8ch)
uint16_t
u16TSR
;
uint8_t
u8RollingCh
=
0
;
switch
(
u8ch
)
if
((
u8ch
<
0
)
||
(
u8ch
>=
RTE_TIM40_CH_SUM
))
{
case
RTE_TIM40_CH0
:
u16TDR
=
TM40
->
TDR
[
0U
];
u16TSR
=
TM40
->
TSR
[
0U
];
break
;
case
RTE_TIM40_CH1
:
u16TDR
=
TM40
->
TDR
[
1U
];
u16TSR
=
TM40
->
TSR
[
1U
];
u8RollingCh
=
0U
;
break
;
case
RTE_TIM40_CH2
:
u16TDR
=
TM40
->
TDR
[
2U
];
u16TSR
=
TM40
->
TSR
[
2U
];
break
;
case
RTE_TIM40_CH3
:
u16TDR
=
TM40
->
TDR
[
3U
];
u16TSR
=
TM40
->
TSR
[
3U
];
break
;
default:
u16TDR
=
TM40
->
TDR
[
0U
];
u16TSR
=
TM40
->
TSR
[
0U
];
break
;
}
if
(
1U
==
(
u16TSR
&
_0001_TM4_OVERFLOW_OCCURS
))
{
g_stTIM40CapObj
[
u8ch
].
u32Period
[
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
]
=
(
uint32_t
)(
u16TDR
+
1UL
)
+
0x10000UL
;
;
}
else
{
g_stTIM40CapObj
[
u8ch
].
u32Period
[
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
]
=
(
uint32_t
)(
u16TDR
+
1UL
);
// Fre_In_Channel_Capture_ISR_Reset_Count(FRE_ENGINE,g_stTIM40CapObj[u8ch].u32Period[g_stTIM40CapObj[u8ch].u8PeriodBufCnt]);
}
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
++
;
if
(
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
>=
RTE_TIM40_PERIOD_FILTER_SUM
)
{
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
=
0U
;
if
((
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
<
0
)
||
(
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
>=
RTE_TIM40_PERIOD_FILTER_SUM
))
{
;
}
else
{
switch
(
u8ch
)
{
case
RTE_TIM40_CH0
:
u16TDR
=
TM40
->
TDR
[
0U
];
u16TSR
=
TM40
->
TSR
[
0U
];
break
;
case
RTE_TIM40_CH1
:
u16TDR
=
TM40
->
TDR
[
1U
];
u16TSR
=
TM40
->
TSR
[
1U
];
u8RollingCh
=
0U
;
break
;
case
RTE_TIM40_CH2
:
u16TDR
=
TM40
->
TDR
[
2U
];
u16TSR
=
TM40
->
TSR
[
2U
];
break
;
case
RTE_TIM40_CH3
:
u16TDR
=
TM40
->
TDR
[
3U
];
u16TSR
=
TM40
->
TSR
[
3U
];
break
;
default:
u16TDR
=
TM40
->
TDR
[
0U
];
u16TSR
=
TM40
->
TSR
[
0U
];
break
;
}
if
(
1U
==
(
u16TSR
&
_0001_TM4_OVERFLOW_OCCURS
))
{
g_stTIM40CapObj
[
u8ch
].
u32Period
[
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
]
=
(
uint32_t
)(
u16TDR
+
1UL
)
+
0x10000UL
;
}
else
{
g_stTIM40CapObj
[
u8ch
].
u32Period
[
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
]
=
(
uint32_t
)(
u16TDR
+
1UL
);
// Fre_In_Channel_Capture_ISR_Reset_Count(FRE_ENGINE,g_stTIM40CapObj[u8ch].u32Period[g_stTIM40CapObj[u8ch].u8PeriodBufCnt]);
}
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
++
;
if
(
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
>=
RTE_TIM40_PERIOD_FILTER_SUM
)
{
g_stTIM40CapObj
[
u8ch
].
u8PeriodBufCnt
=
0U
;
}
if
(
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
<
RTE_TIM40_PERIOD_FILTER_SUM
)
{
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
++
;
}
for
(
i
=
0U
;
i
<
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
;
i
++
)
{
u32Temp
+=
g_stTIM40CapObj
[
u8ch
].
u32Period
[
i
];
}
u32Temp
=
u32Temp
/
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
;
g_stTIM40CapObj
[
u8ch
].
u32Freq
=
(
g_stTIM40CapObj
[
u8ch
].
u32CHClock
*
10U
)
/
u32Temp
;
}
}
if
(
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
<
RTE_TIM40_PERIOD_FILTER_SUM
)
{
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
++
;
}
for
(
i
=
0U
;
i
<
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
;
i
++
)
{
u32Temp
+=
g_stTIM40CapObj
[
u8ch
].
u32Period
[
i
];
}
u32Temp
=
u32Temp
/
g_stTIM40CapObj
[
u8ch
].
u8PeriodCnt
;
g_stTIM40CapObj
[
u8ch
].
u32Freq
=
(
g_stTIM40CapObj
[
u8ch
].
u32CHClock
*
10U
)
/
u32Temp
;
}
/***********************************************************************************************************************
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/UART/RTE_UART.c
View file @
0649b828
...
...
@@ -83,7 +83,7 @@ uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *pen
int8_t
ret
=
SCI_SUCCESS
;
UART_InitTypeDef
stUART_InitStruct
;
GPIO_InitTypeDef
GPIO_InitStruct
;
SCIAFSelect_TypeDef
enUartChanell
;
//
SCIAFSelect_TypeDef enUartChanell;
stUART_InitStruct
.
UART_Mode
=
0
;
...
...
@@ -101,7 +101,7 @@ uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *pen
switch
(
enUARTCh
)
{
case
UART_CH0
:
enUartChanell
=
UART0
;
//
enUartChanell = UART0;
GPIO_PinAFConfig
(
GPIO_PORT5
,
GPIO_Pin_1
,
GPIO_P51
,
GROUP_AF_ODEFAULT
);
GPIO_PinAFConfig
(
GPIO_PORT5
,
GPIO_Pin_0
,
GPIO_P50
,
GROUP_AF_ODEFAULT
);
...
...
@@ -132,9 +132,10 @@ uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *pen
ISR_Register
(
ST0_IRQn
,
UART_CH0_TX_ISR
);
//串口0发送中断服务路径注册
ISR_Register
(
SR0_IRQn
,
UART_CH0_RX_ISR
);
//串口0接收中断服务路径注册
ret
=
UART_Init
(
UART0
,
&
stUART_InitStruct
);
break
;
case
UART_CH1
:
enUartChanell
=
UART1
;
//
enUartChanell = UART1;
GPIO_PinAFConfig
(
GPIO_PORT0
,
GPIO_Pin_2
,
GPIO_P02
,
GROUP_AF_ODEFAULT
);
GPIO_PinAFConfig
(
GPIO_PORT0
,
GPIO_Pin_3
,
GPIO_P03
,
GROUP_AF_ODEFAULT
);
...
...
@@ -163,10 +164,12 @@ uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *pen
stUART_InitStruct
.
UART_Mode
=
UART_Mode_Rx
|
UART_Mode_Tx
;
//收发模式
ISR_Register
(
ST1_IRQn
,
UART_CH1_TX_ISR
);
//串口1发送中断服务路径注册
ISR_Register
(
SR1_IRQn
,
UART_CH1_RX_ISR
);
//串口1接收中断服务路径注册
ISR_Register
(
SR1_IRQn
,
UART_CH1_RX_ISR
);
//串口1接收中断服务路径注册
ret
=
UART_Init
(
UART1
,
&
stUART_InitStruct
);
break
;
case
UART_CH2
:
enUartChanell
=
UART2
;
// enUartChanell = (uint16_t)
UART2;
GPIO_PinAFConfig
(
GPIO_PORT7
,
GPIO_Pin_6
,
GPIO_P76
,
GROUP_AF_RXD2
);
GPIO_PinAFConfig
(
GPIO_PORT7
,
GPIO_Pin_7
,
GPIO_P77
,
GROUP_AF_TXD2
);
...
...
@@ -197,12 +200,14 @@ uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *pen
stUARTCh2Cfg
.
pfnUARTReadMsgCallBack
=
penUARTCfg
->
pfnUARTReadMsgCallBack
;
ISR_Register
(
ST2_IRQn
,
UART_CH2_TX_ISR
);
//串口2发送中断服务路径注册
ISR_Register
(
SR2_IRQn
,
UART_CH2_RX_ISR
);
//串口2接收中断服务路径注册
ISR_Register
(
SR2_IRQn
,
UART_CH2_RX_ISR
);
//串口2接收中断服务路径注册
ret
=
UART_Init
(
UART2
,
&
stUART_InitStruct
);
break
;
default:
break
;
}
ret
=
UART_Init
(
enUartChanell
,
&
stUART_InitStruct
);
//
ret = UART_Init(enUartChanell, &stUART_InitStruct);
if
(
ret
)
{
SCI_ERROR_LOG
(
ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment