Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
VC66_7C
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
ISUZU
VC66_7C
Commits
b743c980
Commit
b743c980
authored
Oct 20, 2021
by
hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整背光显示,增加4051注释
parent
f6dc38c8
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
22346 additions
and
22327 deletions
+22346
-22327
project
ghs/project
+0
-0
project.hex
ghs/project.hex
+22161
-22161
project.siz
ghs/project.siz
+1
-1
Speed_PPK_Out.c
source/Application/APP/Data_SpeedOut/Speed_PPK_Out.c
+1
-1
Data_VehicleSpeed.c
source/Application/APP/Data_VehicleSpeed/Data_VehicleSpeed.c
+3
-2
GaugesDataAnalysis.c
source/Application/APP/GaugesMode/GaugesDataAnalysis.c
+2
-2
Line_In_user.c
source/Application/APP/LINE_IN/Line_In_user.c
+28
-28
Common_Interface.h
source/Application/RTE/Common_Interface.h
+1
-1
CD4051.c
source/Driver/CD4051/CD4051.c
+67
-45
CD4051.h
source/Driver/CD4051/CD4051.h
+82
-86
No files found.
ghs/project
View file @
b743c980
No preview for this file type
ghs/project.hex
View file @
b743c980
This diff is collapsed.
Click to expand it.
ghs/project.siz
View file @
b743c980
project .intvect 1536
project .intvect 1536
project .text 2990
68
project .text 2990
52
project .rodata 412383
project .rodata 412383
project .secinfo 120
project .secinfo 120
project .syscall 6
project .syscall 6
...
...
source/Application/APP/Data_SpeedOut/Speed_PPK_Out.c
View file @
b743c980
...
@@ -23,7 +23,7 @@ void Speed_PPK_Processing(void)
...
@@ -23,7 +23,7 @@ void Speed_PPK_Processing(void)
uint32_t
PPK
;
uint32_t
PPK
;
PPK
=
Get_Speed_PPK
();
PPK
=
Get_Speed_PPK
();
if
(
Common_Get_IG_Sts
()
==
1u
)
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
{
if
(
Common_Get_Act_V_Speed_Valid
()
==
1u
)
if
(
Common_Get_Act_V_Speed_Valid
()
==
1u
)
{
{
...
...
source/Application/APP/Data_VehicleSpeed/Data_VehicleSpeed.c
View file @
b743c980
...
@@ -91,8 +91,8 @@ void Speed_Sleep_Init(void)
...
@@ -91,8 +91,8 @@ void Speed_Sleep_Init(void)
void
Speed_Processing_Service
(
void
)
void
Speed_Processing_Service
(
void
)
{
{
uint32_t
VehValTmp
;
uint32_t
VehValTmp
=
0u
;
uint32_t
PPK
=
Get_Speed_PPK
()
;
uint32_t
PPK
=
0u
;
//if(Get_Veh_Fre_Event())
//if(Get_Veh_Fre_Event())
//{
//{
// VehValTmp = Cal_VehSpeed(Get_Veh_Fre(),VEH_FILTER_LEN) ;
// VehValTmp = Cal_VehSpeed(Get_Veh_Fre(),VEH_FILTER_LEN) ;
...
@@ -105,6 +105,7 @@ void Speed_Processing_Service(void)
...
@@ -105,6 +105,7 @@ void Speed_Processing_Service(void)
// Vehicle_ACT_Speed = VehValTmp ;
// Vehicle_ACT_Speed = VehValTmp ;
//}
//}
PPK
=
Get_Speed_PPK
();
VehValTmp
=
Cal_Veh_Frequency
();
VehValTmp
=
Cal_Veh_Frequency
();
VehValTmp
*=
3600
;
VehValTmp
*=
3600
;
...
...
source/Application/APP/GaugesMode/GaugesDataAnalysis.c
View file @
b743c980
...
@@ -456,7 +456,7 @@ uint16_t Cal_Veh_Frequency(void)
...
@@ -456,7 +456,7 @@ uint16_t Cal_Veh_Frequency(void)
VehFre
.
PulseCnt
=
0u
;
VehFre
.
PulseCnt
=
0u
;
}
}
if
((
VehFreDropTimes
==
0u
)
||
((
VehFre
.
Frequency
>
0u
)
&&
(
VehFre
.
Frequency
<
3u
)))
if
((
VehFreDropTimes
==
0u
)
||
((
VehFre
.
Frequency
>
0u
)
&&
(
VehFre
.
Frequency
<
3u
)))
{
{
VehFre
.
Frequency
=
0u
;
VehFre
.
Frequency
=
0u
;
VehFre
.
Cycle
=
0u
;
VehFre
.
Cycle
=
0u
;
...
@@ -487,7 +487,7 @@ uint16_t percent = 0u;
...
@@ -487,7 +487,7 @@ uint16_t percent = 0u;
static
const
uint16_t
FuelMoveTimes
[
FuelSpeedTotal
]
=
{
5
,
2200
,
11250
};
static
const
uint16_t
FuelMoveTimes
[
FuelSpeedTotal
]
=
{
5
,
2200
,
11250
};
void
Data_Fuel_Processing_Service
(
void
)
void
Data_Fuel_Processing_Service
(
void
)
{
{
}
}
uint8_t
getData_Fuel_InvalFlag
(
void
)
uint8_t
getData_Fuel_InvalFlag
(
void
)
{
{
...
...
source/Application/APP/LINE_IN/Line_In_user.c
View file @
b743c980
...
@@ -43,37 +43,37 @@ const Line_In_Attribute_st_t g_stLineInAttribute[LINE_IN_MAX] =
...
@@ -43,37 +43,37 @@ const Line_In_Attribute_st_t g_stLineInAttribute[LINE_IN_MAX] =
{
{
/*ZH修改:2021.6.24 19:47*/
/*ZH修改:2021.6.24 19:47*/
/*指示灯信号 硬线输入*/
/*指示灯信号 硬线输入*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ABS
,},
/*A22 ABS*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ABS
,},
/*A22 ABS*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_PARK_BRAKE
,},
/*A23 PARK BRAKE*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_PARK_BRAKE
,},
/*A23 PARK BRAKE*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_HI_BEAM
,},
/*A25 HI BEAM*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_HI_BEAM
,},
/*A25 HI BEAM*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_BRAKE_AIR_EBS
,},
/*A28 BRAKE AIR/EBS*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_BRAKE_AIR_EBS
,},
/*A28 BRAKE AIR/EBS*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_SEAT_BELT
,},
/*A30 SEAT BELT*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_SEAT_BELT
,},
/*A30 SEAT BELT*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_MIL
,},
/*A31 MIL*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_MIL
,},
/*A31 MIL*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ENG_OIL
,},
/*A32 ENG OIL*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ENG_OIL
,},
/*A32 ENG OIL*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_CHARGE
,},
/*A34 CHARGE*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_CHARGE
,},
/*A34 CHARGE*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_ABS_INFO
,},
/*B03 TRAILER ABS INFO*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_ABS_INFO
,},
/*B03 TRAILER ABS INFO*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_Rr_FOG_LAMP
,},
/*B14 Rr FOG LAMP*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_Rr_FOG_LAMP
,},
/*B14 Rr FOG LAMP*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ACC_AIR
,},
/*B15 ACC AIR*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ACC_AIR
,},
/*B15 ACC AIR*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_AIR_SUS
,},
/*B30 AIR SUS*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_AIR_SUS
,},
/*B30 AIR SUS*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_BRAKE
,},
/*B31 TRAILER BRAKE*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_BRAKE
,},
/*B31 TRAILER BRAKE*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_ABS
,},
/*B33 TRAILER ABS*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_ABS
,},
/*B33 TRAILER ABS*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_RR_DIFF_LOCK
,},
/*B36 RR DIFF LOCK*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_RR_DIFF_LOCK
,},
/*B36 RR DIFF LOCK*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_WEAR_IND
,},
/*B38 WEAR IND*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_WEAR_IND
,},
/*B38 WEAR IND*/
/*ZH新增:2021.6.28 18:38*/
/*ZH新增:2021.6.28 18:38*/
/*非指示灯信号 硬线输入*/
/*非指示灯信号 硬线输入*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ILLUMINATION
,},
/*A06 ILLUMINATION 背光有效*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ILLUMINATION
,},
/*A06 ILLUMINATION 背光有效*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_RET_BLENDING
,},
/*A10 RET_BLENDING*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_RET_BLENDING
,},
/*A10 RET_BLENDING*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_BRAKE
,},
/*A21 BRAKE*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_BRAKE
,},
/*A21 BRAKE*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ONOFF
,
LINE_IN_Get_TURN_R
,},
/*A26 TURN_R*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ONOFF
,
LINE_IN_Get_TURN_R
,},
/*A26 TURN_R*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ONOFF
,
LINE_IN_Get_TURN_L
,},
/*A27 TURN_L*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ONOFF
,
LINE_IN_Get_TURN_L
,},
/*A27 TURN_L*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ABS_DETECT
,},
/*A33 ABS_DETECT*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ABS_DETECT
,},
/*A33 ABS_DETECT*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_PTO
,},
/*B01 PTO*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_PTO
,},
/*B01 PTO*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_GLOW
,},
/*B05 GLOW*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_GLOW
,},
/*B05 GLOW*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_CONNECT
,},
/*B06 TRAILER_CONNECT*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_TRAILER_CONNECT
,},
/*B06 TRAILER_CONNECT*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_LOW_COOLANT
,},
/*B32 LOW_COOLANT*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_LOW_COOLANT
,},
/*B32 LOW_COOLANT*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ACC
,},
/*B39 ACC*/
{
LINE_IN_LEVEL_HIGH
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_ACC
,},
/*B39 ACC*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_WEAR2
,},
/*B40 WEAR2*/
{
LINE_IN_LEVEL_LOW
,
200U
,
0U
,
LINE_IN_IG_ON
,
LINE_IN_Get_WEAR2
,},
/*B40 WEAR2*/
};
};
/*ZH修改:2021.6.25 08:46*/
/*ZH修改:2021.6.25 08:46*/
...
...
source/Application/RTE/Common_Interface.h
View file @
b743c980
...
@@ -75,7 +75,7 @@ static struct
...
@@ -75,7 +75,7 @@ static struct
uint8_t
Reserved5
;
uint8_t
Reserved5
;
}
_EOL_K_LINE_SET
;
}
_EOL_K_LINE_SET
;
extern
_EOL_K_LINE_SET
K_Line_Set
;
//
extern _EOL_K_LINE_SET K_Line_Set;
extern
void
Common_DataInit
(
void
);
extern
void
Common_DataInit
(
void
);
extern
void
Common_Input_Para
(
void
);
extern
void
Common_Input_Para
(
void
);
...
...
source/Driver/CD4051/CD4051.c
View file @
b743c980
#include "CD4051.h"
#include "CD4051.h"
#include "GPIO.h"
#include "GPIO.h"
volatile
u_CD4051_Input
CD4051_Input
[
ID_MAX
];
volatile
u_CD4051_Input
CD4051_Input
[
ID_MAX
];
unsigned
char
pChannel
=
0
;
unsigned
char
pChannel
=
0
;
void
CD4051_Pin_Init
(
void
){
void
CD4051_Pin_Init
(
void
)
{
CD4051_Input
[
ID_COM1
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM1
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM2
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM2
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM3
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM3
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM4
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM4
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM5
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM5
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM6
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM6
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM7
].
Byte
=
0x00
;
CD4051_Input
[
ID_COM7
].
Byte
=
0x00
;
pChannel
=
0
;
pChannel
=
0
;
...
@@ -22,60 +20,84 @@ void CD4051_Pin_Init(void){
...
@@ -22,60 +20,84 @@ void CD4051_Pin_Init(void){
CD4051A_C_MCU_OUT
=
0
;
CD4051A_C_MCU_OUT
=
0
;
}
}
void
CD4051_GetInputStatus
(
unsigned
char
Channel
)
{
void
CD4051_GetInputStatus
(
unsigned
char
Channel
)
{
}
}
void
CD4051_Choose_Channel
(
unsigned
char
Channel
){
void
CD4051_Choose_Channel
(
unsigned
char
Channel
)
{
CD4051A_A_MCU_OUT
=
Channel
&
0x01
;
CD4051A_A_MCU_OUT
=
Channel
&
0x01
;
CD4051A_B_MCU_OUT
=
(
Channel
>>
1
)
&
0x01
;
CD4051A_B_MCU_OUT
=
(
Channel
>>
1
)
&
0x01
;
CD4051A_C_MCU_OUT
=
(
Channel
>>
2
)
&
0x01
;
CD4051A_C_MCU_OUT
=
(
Channel
>>
2
)
&
0x01
;
}
}
void
CD4051_IOStatus
(
unsigned
char
Channel
){
void
CD4051_IOStatus
(
unsigned
char
Channel
)
if
(
CD4051A_COM1_MCU_IN
){
{
CD4051_Input
[
ID_COM1
].
Byte
|=
(
1
<<
Channel
);
if
(
CD4051A_COM1_MCU_IN
)
}
else
{
{
CD4051_Input
[
ID_COM1
].
Byte
&=
~
(
1
<<
Channel
);
CD4051_Input
[
ID_COM1
].
Byte
|=
(
1
<<
Channel
);
}
else
{
CD4051_Input
[
ID_COM1
].
Byte
&=
~
(
1
<<
Channel
);
}
if
(
CD4051A_COM2_MCU_IN
)
{
CD4051_Input
[
ID_COM2
].
Byte
|=
(
1
<<
Channel
);
}
else
{
CD4051_Input
[
ID_COM2
].
Byte
&=
~
(
1
<<
Channel
);
}
if
(
CD4051A_COM3_MCU_IN
)
{
CD4051_Input
[
ID_COM3
].
Byte
|=
(
1
<<
Channel
);
}
else
{
CD4051_Input
[
ID_COM3
].
Byte
&=
~
(
1
<<
Channel
);
}
if
(
CD4051A_COM4_MCU_IN
)
{
CD4051_Input
[
ID_COM4
].
Byte
|=
(
1
<<
Channel
);
}
else
{
CD4051_Input
[
ID_COM4
].
Byte
&=
~
(
1
<<
Channel
);
}
}
if
(
CD4051A_COM2_MCU_IN
){
if
(
CD4051A_COM5_MCU_IN
)
CD4051_Input
[
ID_COM2
].
Byte
|=
(
1
<<
Channel
);
{
}
else
{
CD4051_Input
[
ID_COM5
].
Byte
|=
(
1
<<
Channel
);
CD4051_Input
[
ID_COM2
].
Byte
&=
~
(
1
<<
Channel
);
}
}
if
(
CD4051A_COM3_MCU_IN
){
else
CD4051_Input
[
ID_COM3
].
Byte
|=
(
1
<<
Channel
);
{
}
else
{
CD4051_Input
[
ID_COM5
].
Byte
&=
~
(
1
<<
Channel
);
CD4051_Input
[
ID_COM3
].
Byte
&=
~
(
1
<<
Channel
);
}
}
if
(
CD4051A_COM4_MCU_IN
){
if
(
CD4051A_COM6_MCU_IN
)
CD4051_Input
[
ID_COM4
].
Byte
|=
(
1
<<
Channel
);
{
}
else
{
CD4051_Input
[
ID_COM6
].
Byte
|=
(
1
<<
Channel
);
CD4051_Input
[
ID_COM4
].
Byte
&=
~
(
1
<<
Channel
);
}
}
if
(
CD4051A_COM5_MCU_IN
){
else
CD4051_Input
[
ID_COM5
].
Byte
|=
(
1
<<
Channel
);
{
}
else
{
CD4051_Input
[
ID_COM6
].
Byte
&=
~
(
1
<<
Channel
);
CD4051_Input
[
ID_COM5
].
Byte
&=
~
(
1
<<
Channel
);
}
}
if
(
CD4051A_COM6_MCU_IN
){
if
(
CD4051A_COM7_MCU_IN
)
CD4051_Input
[
ID_COM6
].
Byte
|=
(
1
<<
Channel
);
{
}
else
{
CD4051_Input
[
ID_COM7
].
Byte
|=
(
1
<<
Channel
);
CD4051_Input
[
ID_COM6
].
Byte
&=
~
(
1
<<
Channel
);
}
}
if
(
CD4051A_COM7_MCU_IN
){
else
CD4051_Input
[
ID_COM7
].
Byte
|=
(
1
<<
Channel
);
{
}
else
{
CD4051_Input
[
ID_COM7
].
Byte
&=
~
(
1
<<
Channel
);
CD4051_Input
[
ID_COM7
].
Byte
&=
~
(
1
<<
Channel
);
}
}
}
}
void
CD4051_GetInputStatusProc
(
void
){
void
CD4051_GetInputStatusProc
(
void
)
{
CD4051_IOStatus
(
pChannel
);
CD4051_IOStatus
(
pChannel
);
pChannel
++
;
pChannel
++
;
CD4051_Choose_Channel
(
pChannel
);
CD4051_Choose_Channel
(
pChannel
);
if
(
pChannel
>
7
){
if
(
pChannel
>
7
)
{
pChannel
=
0
;
pChannel
=
0
;
}
}
}
}
\ No newline at end of file
source/Driver/CD4051/CD4051.h
View file @
b743c980
...
@@ -3,110 +3,106 @@
...
@@ -3,110 +3,106 @@
#include "r_typedefs.h"
#include "r_typedefs.h"
#define CD4051_PIN_HIGH 1
#define CD4051_PIN_HIGH 1
#define CD4051_PIN_LOW 0
#define CD4051_PIN_LOW 0
typedef
enum
typedef
enum
{
{
ID_COM1
=
0
,
ID_COM1
=
0
,
ID_COM2
,
ID_COM2
,
ID_COM3
,
ID_COM3
,
ID_COM4
,
ID_COM4
,
ID_COM5
,
ID_COM5
,
ID_COM6
,
ID_COM6
,
ID_COM7
,
ID_COM7
,
ID_MAX
ID_MAX
}
em_CD4051_ID
;
}
em_CD4051_ID
;
typedef
union
{
typedef
union
struct
{
{
uint8_t
X0
:
1
;
struct
uint8_t
X1
:
1
;
{
uint8_t
X2
:
1
;
uint8_t
X0
:
1
;
uint8_t
X3
:
1
;
uint8_t
X1
:
1
;
uint8_t
X4
:
1
;
uint8_t
X2
:
1
;
uint8_t
X5
:
1
;
uint8_t
X3
:
1
;
uint8_t
X6
:
1
;
uint8_t
X4
:
1
;
uint8_t
X7
:
1
;
uint8_t
X5
:
1
;
}
Bits
;
uint8_t
X6
:
1
;
uint8_t
X7
:
1
;
}
Bits
;
uint8_t
Byte
;
uint8_t
Byte
;
}
u_CD4051_Input
;
}
u_CD4051_Input
;
extern
volatile
u_CD4051_Input
CD4051_Input
[
ID_MAX
];
extern
volatile
u_CD4051_Input
CD4051_Input
[
ID_MAX
];
//-----------------外部应用需要时调用---------------wangboyu-------
//-----------------外部应用需要时调用---------------wangboyu-------
/*COM1映射PCB*/
/*COM1映射PCB*/
#define
CD4051_COM1_X0_IN CD4051_Input[ ID_COM1 ].Bits.X0
#define
CD4051_COM1_X0_IN CD4051_Input[ID_COM1].Bits.X0
/*A36*/
#define
CD4051_COM1_X1_IN CD4051_Input[ ID_COM1 ].Bits.X1
#define
CD4051_COM1_X1_IN CD4051_Input[ID_COM1].Bits.X1
/* */
#define
CD4051_COM1_X2_IN CD4051_Input[ ID_COM1 ].Bits.X2
#define
CD4051_COM1_X2_IN CD4051_Input[ID_COM1].Bits.X2
/* */
#define
CD4051_COM1_X3_IN CD4051_Input[ ID_COM1 ].Bits.X3
#define
CD4051_COM1_X3_IN CD4051_Input[ID_COM1].Bits.X3
/*A34*/
#define
CD4051_COM1_X4_IN CD4051_Input[ ID_COM1 ].Bits.X4
#define
CD4051_COM1_X4_IN CD4051_Input[ID_COM1].Bits.X4
/*A21*/
#define
CD4051_COM1_X5_IN CD4051_Input[ ID_COM1 ].Bits.X5
#define
CD4051_COM1_X5_IN CD4051_Input[ID_COM1].Bits.X5
/*A25*/
#define
CD4051_COM1_X6_IN CD4051_Input[ ID_COM1 ].Bits.X6
#define
CD4051_COM1_X6_IN CD4051_Input[ID_COM1].Bits.X6
/*A22*/
#define
CD4051_COM1_X7_IN CD4051_Input[ ID_COM1 ].Bits.X7
#define
CD4051_COM1_X7_IN CD4051_Input[ID_COM1].Bits.X7
/*A23*/
/*COM2映射PCB*/
/*COM2映射PCB*/
#define
CD4051_COM2_X0_IN CD4051_Input[ ID_COM2 ].Bits.X0
#define
CD4051_COM2_X0_IN CD4051_Input[ID_COM2].Bits.X0
/*A31*/
#define
CD4051_COM2_X1_IN CD4051_Input[ ID_COM2 ].Bits.X1
#define
CD4051_COM2_X1_IN CD4051_Input[ID_COM2].Bits.X1
/*A32*/
#define
CD4051_COM2_X2_IN CD4051_Input[ ID_COM2 ].Bits.X2
#define
CD4051_COM2_X2_IN CD4051_Input[ID_COM2].Bits.X2
/*A33*/
#define
CD4051_COM2_X3_IN CD4051_Input[ ID_COM2 ].Bits.X3
#define
CD4051_COM2_X3_IN CD4051_Input[ID_COM2].Bits.X3
/*A30*/
#define
CD4051_COM2_X4_IN CD4051_Input[ ID_COM2 ].Bits.X4
#define
CD4051_COM2_X4_IN CD4051_Input[ID_COM2].Bits.X4
/*A26*/
#define
CD4051_COM2_X5_IN CD4051_Input[ ID_COM2 ].Bits.X5
#define
CD4051_COM2_X5_IN CD4051_Input[ID_COM2].Bits.X5
/*A29*/
#define
CD4051_COM2_X6_IN CD4051_Input[ ID_COM2 ].Bits.X6
#define
CD4051_COM2_X6_IN CD4051_Input[ID_COM2].Bits.X6
/*A27*/
#define
CD4051_COM2_X7_IN CD4051_Input[ ID_COM2 ].Bits.X7
#define
CD4051_COM2_X7_IN CD4051_Input[ID_COM2].Bits.X7
/*A28*/
/*COM3映射PCB*/
/*COM3映射PCB*/
#define
CD4051_COM3_X0_IN CD4051_Input[ ID_COM3 ].Bits.X0
#define
CD4051_COM3_X0_IN CD4051_Input[ID_COM3].Bits.X0
/*A19*/
#define
CD4051_COM3_X1_IN CD4051_Input[ ID_COM3 ].Bits.X1
#define
CD4051_COM3_X1_IN CD4051_Input[ID_COM3].Bits.X1
/*B19*/
#define
CD4051_COM3_X2_IN CD4051_Input[ ID_COM3 ].Bits.X2
#define
CD4051_COM3_X2_IN CD4051_Input[ID_COM3].Bits.X2
/*B18*/
#define
CD4051_COM3_X3_IN CD4051_Input[ ID_COM3 ].Bits.X3
#define
CD4051_COM3_X3_IN CD4051_Input[ID_COM3].Bits.X3
/*A15*/
#define
CD4051_COM3_X4_IN CD4051_Input[ ID_COM3 ].Bits.X4
#define
CD4051_COM3_X4_IN CD4051_Input[ID_COM3].Bits.X4
/*A10*/
#define
CD4051_COM3_X5_IN CD4051_Input[ ID_COM3 ].Bits.X5
#define
CD4051_COM3_X5_IN CD4051_Input[ID_COM3].Bits.X5
/*A20*/
#define
CD4051_COM3_X6_IN CD4051_Input[ ID_COM3 ].Bits.X6
#define
CD4051_COM3_X6_IN CD4051_Input[ID_COM3].Bits.X6
/*A06*/
#define
CD4051_COM3_X7_IN CD4051_Input[ ID_COM3 ].Bits.X7
#define
CD4051_COM3_X7_IN CD4051_Input[ID_COM3].Bits.X7
/*A03*/
/*COM4映射PCB*/
/*COM4映射PCB*/
#define
CD4051_COM4_X0_IN CD4051_Input[ ID_COM4 ].Bits.X0
#define
CD4051_COM4_X0_IN CD4051_Input[ID_COM4].Bits.X0
/*B35*/
#define
CD4051_COM4_X1_IN CD4051_Input[ ID_COM4 ].Bits.X1
#define
CD4051_COM4_X1_IN CD4051_Input[ID_COM4].Bits.X1
/*B34*/
#define
CD4051_COM4_X2_IN CD4051_Input[ ID_COM4 ].Bits.X2
#define
CD4051_COM4_X2_IN CD4051_Input[ID_COM4].Bits.X2
/*B33*/
#define
CD4051_COM4_X3_IN CD4051_Input[ ID_COM4 ].Bits.X3
#define
CD4051_COM4_X3_IN CD4051_Input[ID_COM4].Bits.X3
/*B36*/
#define
CD4051_COM4_X4_IN CD4051_Input[ ID_COM4 ].Bits.X4
#define
CD4051_COM4_X4_IN CD4051_Input[ID_COM4].Bits.X4
/*B20*/
#define
CD4051_COM4_X5_IN CD4051_Input[ ID_COM4 ].Bits.X5
#define
CD4051_COM4_X5_IN CD4051_Input[ID_COM4].Bits.X5
/*B37*/
#define
CD4051_COM4_X6_IN CD4051_Input[ ID_COM4 ].Bits.X6
#define
CD4051_COM4_X6_IN CD4051_Input[ID_COM4].Bits.X6
/*B40*/
#define
CD4051_COM4_X7_IN CD4051_Input[ ID_COM4 ].Bits.X7
#define
CD4051_COM4_X7_IN CD4051_Input[ID_COM4].Bits.X7
/*B38*/
/*COM5映射PCB*/
/*COM5映射PCB*/
#define
CD4051_COM5_X0_IN CD4051_Input[ ID_COM5 ].Bits.X0
#define
CD4051_COM5_X0_IN CD4051_Input[ID_COM5].Bits.X0
/*B23*/
#define
CD4051_COM5_X1_IN CD4051_Input[ ID_COM5 ].Bits.X1
#define
CD4051_COM5_X1_IN CD4051_Input[ID_COM5].Bits.X1
/*B22*/
#define
CD4051_COM5_X2_IN CD4051_Input[ ID_COM5 ].Bits.X2
#define
CD4051_COM5_X2_IN CD4051_Input[ID_COM5].Bits.X2
/*B21*/
#define
CD4051_COM5_X3_IN CD4051_Input[ ID_COM5 ].Bits.X3
#define
CD4051_COM5_X3_IN CD4051_Input[ID_COM5].Bits.X3
/*B24*/
#define
CD4051_COM5_X4_IN CD4051_Input[ ID_COM5 ].Bits.X4
#define
CD4051_COM5_X4_IN CD4051_Input[ID_COM5].Bits.X4
/*B32*/
#define
CD4051_COM5_X5_IN CD4051_Input[ ID_COM5 ].Bits.X5
#define
CD4051_COM5_X5_IN CD4051_Input[ID_COM5].Bits.X5
/*B26*/
#define
CD4051_COM5_X6_IN CD4051_Input[ ID_COM5 ].Bits.X6
#define
CD4051_COM5_X6_IN CD4051_Input[ID_COM5].Bits.X6
/*B31*/
#define
CD4051_COM5_X7_IN CD4051_Input[ ID_COM5 ].Bits.X7
#define
CD4051_COM5_X7_IN CD4051_Input[ID_COM5].Bits.X7
/*B30*/
/*COM6映射PCB*/
/*COM6映射PCB*/
#define
CD4051_COM6_X0_IN CD4051_Input[ ID_COM6 ].Bits.X0
#define
CD4051_COM6_X0_IN CD4051_Input[ID_COM6].Bits.X0
/*A06*/
#define
CD4051_COM6_X1_IN CD4051_Input[ ID_COM6 ].Bits.X1
#define
CD4051_COM6_X1_IN CD4051_Input[ID_COM6].Bits.X1
/*B07*/
#define
CD4051_COM6_X2_IN CD4051_Input[ ID_COM6 ].Bits.X2
#define
CD4051_COM6_X2_IN CD4051_Input[ID_COM6].Bits.X2
/*B08*/
#define
CD4051_COM6_X3_IN CD4051_Input[ ID_COM6 ].Bits.X3
#define
CD4051_COM6_X3_IN CD4051_Input[ID_COM6].Bits.X3
/*B05*/
#define
CD4051_COM6_X4_IN CD4051_Input[ ID_COM6 ].Bits.X4
#define
CD4051_COM6_X4_IN CD4051_Input[ID_COM6].Bits.X4
/*B01*/
#define
CD4051_COM6_X5_IN CD4051_Input[ ID_COM6 ].Bits.X5
#define
CD4051_COM6_X5_IN CD4051_Input[ID_COM6].Bits.X5
/*B04*/
#define
CD4051_COM6_X6_IN CD4051_Input[ ID_COM6 ].Bits.X6
#define
CD4051_COM6_X6_IN CD4051_Input[ID_COM6].Bits.X6
/*B02*/
#define
CD4051_COM6_X7_IN CD4051_Input[ ID_COM6 ].Bits.X7
#define
CD4051_COM6_X7_IN CD4051_Input[ID_COM6].Bits.X7
/*B03*/
/*COM7映射PCB*/
/*COM7映射PCB*/
#define CD4051_COM7_X0_IN CD4051_Input[ ID_COM7 ].Bits.X0
#define CD4051_COM7_X0_IN CD4051_Input[ID_COM7].Bits.X0
/*B15*/
#define CD4051_COM7_X1_IN CD4051_Input[ ID_COM7 ].Bits.X1
#define CD4051_COM7_X1_IN CD4051_Input[ID_COM7].Bits.X1
/*B16*/
#define CD4051_COM7_X2_IN CD4051_Input[ ID_COM7 ].Bits.X2
#define CD4051_COM7_X2_IN CD4051_Input[ID_COM7].Bits.X2
/*B17*/
#define CD4051_COM7_X3_IN CD4051_Input[ ID_COM7 ].Bits.X3
#define CD4051_COM7_X3_IN CD4051_Input[ID_COM7].Bits.X3
/*B14*/
#define CD4051_COM7_X4_IN CD4051_Input[ ID_COM7 ].Bits.X4
#define CD4051_COM7_X4_IN CD4051_Input[ID_COM7].Bits.X4
/*B10*/
#define CD4051_COM7_X5_IN CD4051_Input[ ID_COM7 ].Bits.X5
#define CD4051_COM7_X5_IN CD4051_Input[ID_COM7].Bits.X5
/*B13*/
#define CD4051_COM7_X6_IN CD4051_Input[ ID_COM7 ].Bits.X6
#define CD4051_COM7_X6_IN CD4051_Input[ID_COM7].Bits.X6
/*B11*/
#define CD4051_COM7_X7_IN CD4051_Input[ ID_COM7 ].Bits.X7
#define CD4051_COM7_X7_IN CD4051_Input[ID_COM7].Bits.X7
/*B12*/
void
CD4051_Pin_Init
(
void
);
void
CD4051_Pin_Init
(
void
);
void
CD4051_GetInputStatus
(
unsigned
char
Channel
);
void
CD4051_GetInputStatus
(
unsigned
char
Channel
);
void
CD4051_GetInputStatusProc
(
void
);
void
CD4051_GetInputStatusProc
(
void
);
#endif
#endif
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