Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
HaoJin232
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
时昊
HaoJin232
Commits
21489b3d
Commit
21489b3d
authored
Feb 20, 2024
by
时昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎉
init:增加背光模块
parent
7a571ddf
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
148 additions
and
81 deletions
+148
-81
BackLight.c
HJ232_Source/source/Application/Line/BackLight.c
+60
-0
BackLight.h
HJ232_Source/source/Application/Line/BackLight.h
+21
-0
PowerManagement_user.c
...source/Application/PowerManagement/PowerManagement_user.c
+5
-23
IIC.h
HJ232_Source/source/Driver/inc/IIC.h
+3
-4
bsp_BU27030.c
HJ232_Source/source/Driver/src/bsp_BU27030.c
+0
-15
init.c
HJ232_Source/source/System/init.c
+1
-16
tasks.c
HJ232_Source/source/System/tasks.c
+1
-0
tim4DelayCounter.uvoptx
HJ232_Source/tim4DelayCounter.uvoptx
+47
-23
tim4DelayCounter.uvprojx
HJ232_Source/tim4DelayCounter.uvprojx
+10
-0
No files found.
HJ232_Source/source/Application/Line/BackLight.c
0 → 100644
View file @
21489b3d
#include "BackLight.h"
#include "common.h"
#include "bsp_BU27030.h"
#include "System_Monitor.h"
#define BACK_LIGHT_DAY 800
#define BACK_LIGHT_NIGHT 200
_Light
g_Light
;
void
GUI_Light_Init
(
void
)
{
g_Light
.
Light_Day
=
0
;
g_Light
.
Light_Night
=
0
;
}
void
Gui_LightProc
(
void
)
{
/*if(SYS_OPR_STAT_HALT)
{
return;
}
if (SYS_OPR_STAT_IGN_ON)
{
if(BU2703_Get_Data1() > 200)
{
g_Light.Light_Night = 0;
g_Light.Light_Day++;
if (g_Light.Light_Day >= 15)//ms
{
g_Light.Light_Day = 15;
}
else
{
}
}
else
{
g_Light.Light_Day = 0;
g_Light.Light_Night++;
if (g_Light.Light_Night >= 15)
{
g_Light.Light_Night = 15;
}
else
{
}
}
}
else
{
g_Light.Light_Day = 0;
g_Light.Light_Night = 0;
}*/
}
HJ232_Source/source/Application/Line/BackLight.h
0 → 100644
View file @
21489b3d
#ifndef _BACKLIGHT_H_
#define _BACKLIGHT_H_
#include "common.h"
typedef
struct
{
uint8_t
Duty
;
uint8_t
Cycle
;
uint16_t
Light_Night
;
uint16_t
Light_Day
;
}
_Light
;
extern
_Light
g_Light
;
void
GUI_Light_Init
(
void
);
void
Gui_LightProc
(
void
);
#endif
HJ232_Source/source/Application/PowerManagement/PowerManagement_user.c
View file @
21489b3d
...
...
@@ -37,22 +37,12 @@ uint16_t g_sleepDelay = 0;
void
Power_KL30_Init
(
void
)
{
Sys_KL30_Init
();
// UART2_Init(115200);
// uart2_User_KL30_Init();
Telltales_Init
();
Telltales_Init
();
Fuel_KL30_Init
();
BU98R10_Init
();
Data_User_Mileage_KL30Init
();
BU2703_Senser_Init
();
GUI_Light_Init
();
}
...
...
@@ -189,23 +179,17 @@ void Power_Sleep_Init(void)
void
Power_Wakeup_Init
(
void
)
{
//Clock_Init();
GPIO_Init
(
GPIO_WAKEUP_MODE
);
Sys_Tick_Timer_Start
();
Analog_Signal_Conv_Init
();
Sys_WakeUp_Init
();
Telltales_Init
();
// UART2_Init(115200);
// uart2_User_KL30_Init();
Common_DataInit
();
BU98R10_Init
();
APP_CAN_Init
();
Data_User_Mileage_WakeupInit
();
BU2703_Senser_Init
();
GUI_Light_Init
();
}
...
...
@@ -230,17 +214,15 @@ void Power_IG_ON_Init(void)
Common_DataInit
();
Fuel_KL15_Init
();
// PORT_SetBit(SOC_3V3_en);
TMB0_PWM_Pin33_Init
();
DiagnosisInit_main
();
U2_DiagnosisInit_main
();
//uart2_User_KL15_Init();
APP_CAN_Init
();
Common_Set_IG_Sts
(
COMMON_POWER_ON
);
// UART2_Init(115200);
BU2703_Senser_Init
();
GUI_Light_Init
();
...
...
HJ232_Source/source/Driver/inc/IIC.h
View file @
21489b3d
...
...
@@ -16,17 +16,16 @@
函数声明
******************************************************************************/
extern
void
Simulated_IIC_2_Init
(
void
);
extern
void
bsp_IIC_delay
(
uint32_t
time
);
extern
void
bsp_IIC_Start
(
void
);
extern
void
bsp_IIC_Stop
(
void
);
extern
void
bsp_IIC_NACK
(
void
);
extern
void
bsp_IIC_ACK
(
void
);
extern
void
bsp_IIC_SendByte
(
uint8_t
Data
);
extern
uint8_t
bsp_IIC_ReadByte
(
void
);
extern
uint8_t
bsp_IIC_WaitAck
(
void
);
extern
uint8_t
bsp_IIC_ReadByte
(
void
);
extern
uint8_t
bsp_IIC_WaitAck
(
void
);
extern
void
Simulated_Release_SCL
(
void
);
extern
void
bsp_IIC_nop
(
void
);
extern
void
bsp_IIC_nop
(
void
);
HJ232_Source/source/Driver/src/bsp_BU27030.c
View file @
21489b3d
...
...
@@ -2,9 +2,6 @@
#include "common.h"
#include "IIC.h"
uint16_t
IIC1_CheckSDA_Times
=
0u
;
uint16_t
IIC1_NACK_Times
=
0u
;
#define BU2703_SLAVE_ADDR 0X38
#define BU2703_FITER_SIZE 10
...
...
@@ -14,7 +11,6 @@ typedef struct
uint16_t
data1buf
[
BU2703_FITER_SIZE
];
uint8_t
index1
;
uint16_t
data1
;
}
BU2703_Datas_Struct
;
BU2703_Datas_Struct
BU2703Dat
;
...
...
@@ -30,7 +26,6 @@ uint8_t Register_BU2703_Senser[] =
void
LIGHT_IIC_Write_Data
(
uint8_t
devAddr
,
uint8_t
len
,
uint8_t
*
Data
)
{
uint8_t
Ack
=
0
;
bsp_IIC_Start
(
);
bsp_IIC_SendByte
(
devAddr
*
2
);
...
...
@@ -54,14 +49,11 @@ void LIGHT_IIC_Write_Data(uint8_t devAddr, uint8_t len, uint8_t *Data)
bsp_IIC_Stop
(
);
}
void
BU2703_Senser_Init
(
void
)
{
uint8_t
mAddr
=
0XFF
;
uint16_t
i
=
0
;
mAddr
=
0X38
;
Simulated_IIC_2_Init
();
for
(
i
=
0
;
i
<
4
;
i
++
)
...
...
@@ -70,11 +62,9 @@ void BU2703_Senser_Init(void )
}
}
uint8_t
LIGHT_IIC_Read_Byte
(
uint8_t
devAddr
,
uint8_t
addr2
,
uint8_t
*
pData
)
{
uint8_t
Ack
=
0
;
bsp_IIC_Start
(
);
bsp_IIC_SendByte
(
devAddr
*
2
);
...
...
@@ -111,7 +101,6 @@ uint8_t LIGHT_IIC_Read_Byte(uint8_t devAddr, uint8_t addr2, uint8_t *pData)
return
1
;
}
void
BU2703_Read_Datas
(
void
)
{
uint8_t
dataL
=
0
;
...
...
@@ -142,7 +131,6 @@ void BU2703_Read_Datas(void )
BU2703Dat
.
index1
++
;
}
}
}
uint16_t
BU2703_Get_Data1
(
void
)
...
...
@@ -150,7 +138,6 @@ uint16_t BU2703_Get_Data1(void )
return
BU2703Dat
.
data1
;
}
void
App_SwapWord_u16
(
uint16_t
*
pData1
,
uint16_t
*
pData2
)
{
uint16_t
psw
;
...
...
@@ -162,8 +149,6 @@ void App_SwapWord_u16(uint16_t *pData1,uint16_t *pData2)
}
}
void
App_SortNWord_u16
(
uint16_t
*
SortData
,
uint8_t
len
)
{
uint8_t
n
=
0
,
m
;
...
...
HJ232_Source/source/System/init.c
View file @
21489b3d
...
...
@@ -54,31 +54,16 @@ void Sys_Startup_Pre_Init(void)
void
Sys_Startup_Init
(
void
)
{
Clock_Init
();
GPIO_Init
(
GPIO_WAKEUP_MODE
);
Sys_Tick_Timer_Start
();
// /*COM_CAN_Init(); 原CAN初始化位置*/
//
Analog_Signal_Conv_Init
();
// UART2_Init(115200);
RTC_Init
(
RTC_FSUB
);
// /*30电数据初始化*/
Power_Management_Lib_Init
();
Power_Management_Init
(
0u
);
bsp_CAN_Init
();
eeprom_StoreInfo_Init
(
);
//20221028
eeprom_StoreInfo_Init
(
);
}
/**************************************************************************//**
...
...
HJ232_Source/source/System/tasks.c
View file @
21489b3d
...
...
@@ -141,6 +141,7 @@ void Sys_Run_Mode_100ms_Tasks_Group2(void)
void
Sys_Run_Mode_100ms_Tasks_Group3
(
void
)
{
BU2703_Read_Datas
();
Gui_LightProc
();
}
void
Sys_Run_Mode_100ms_Tasks_Group4
(
void
)
...
...
HJ232_Source/tim4DelayCounter.uvoptx
View file @
21489b3d
...
...
@@ -1184,6 +1184,30 @@
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
79
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
.\source\Application\Line\BackLight.c
</PathWithFileName>
<FilenameWithoutPath>
BackLight.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
3
</GroupNumber>
<FileNumber>
80
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
.\source\Application\Line\BackLight.h
</PathWithFileName>
<FilenameWithoutPath>
BackLight.h
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
</Group>
<Group>
...
...
@@ -1194,7 +1218,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
79
</FileNumber>
<FileNumber>
81
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1206,7 +1230,7 @@
</File>
<File>
<GroupNumber>
4
</GroupNumber>
<FileNumber>
8
0
</FileNumber>
<FileNumber>
8
2
</FileNumber>
<FileType>
4
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1226,7 +1250,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
1
</FileNumber>
<FileNumber>
8
3
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1238,7 +1262,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
2
</FileNumber>
<FileNumber>
8
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1250,7 +1274,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
3
</FileNumber>
<FileNumber>
8
5
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1262,7 +1286,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
4
</FileNumber>
<FileNumber>
8
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1274,7 +1298,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
5
</FileNumber>
<FileNumber>
8
7
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1286,7 +1310,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
6
</FileNumber>
<FileNumber>
8
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1298,7 +1322,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
8
7
</FileNumber>
<FileNumber>
8
9
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1310,7 +1334,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
88
</FileNumber>
<FileNumber>
90
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1322,7 +1346,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
89
</FileNumber>
<FileNumber>
91
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1334,7 +1358,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
9
0
</FileNumber>
<FileNumber>
9
2
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1346,7 +1370,7 @@
</File>
<File>
<GroupNumber>
5
</GroupNumber>
<FileNumber>
9
1
</FileNumber>
<FileNumber>
9
3
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1366,7 +1390,7 @@
<RteFlg>
0
</RteFlg>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
9
2
</FileNumber>
<FileNumber>
9
4
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1378,7 +1402,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
9
3
</FileNumber>
<FileNumber>
9
5
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1390,7 +1414,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
9
4
</FileNumber>
<FileNumber>
9
6
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1402,7 +1426,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
9
5
</FileNumber>
<FileNumber>
9
7
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1414,7 +1438,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
9
6
</FileNumber>
<FileNumber>
9
8
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1426,7 +1450,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
9
7
</FileNumber>
<FileNumber>
9
9
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1438,7 +1462,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
98
</FileNumber>
<FileNumber>
100
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1450,7 +1474,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
99
</FileNumber>
<FileNumber>
101
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1462,7 +1486,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
10
0
</FileNumber>
<FileNumber>
10
2
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
@@ -1474,7 +1498,7 @@
</File>
<File>
<GroupNumber>
6
</GroupNumber>
<FileNumber>
10
1
</FileNumber>
<FileNumber>
10
3
</FileNumber>
<FileType>
5
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
...
...
HJ232_Source/tim4DelayCounter.uvprojx
View file @
21489b3d
...
...
@@ -783,6 +783,16 @@
<FileType>
5
</FileType>
<FilePath>
.\source\Application\Mileage\Services_Mileage_User.h
</FilePath>
</File>
<File>
<FileName>
BackLight.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
.\source\Application\Line\BackLight.c
</FilePath>
</File>
<File>
<FileName>
BackLight.h
</FileName>
<FileType>
5
</FileType>
<FilePath>
.\source\Application\Line\BackLight.h
</FilePath>
</File>
</Files>
</Group>
<Group>
...
...
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