Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZhongTong-ZR5-A
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
赵康弘
ZhongTong-ZR5-A
Commits
5c91bf49
Commit
5c91bf49
authored
Aug 19, 2025
by
赵康弘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: U59:SGM4591Q初步可控。U31可见两输出口电平变化
parent
fb139d7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
19 deletions
+40
-19
SGM4591Q.c
GHS/App/SGM4591Q.c
+37
-17
Sys_Task_List.c
GHS/System/Sys_Task_List.c
+3
-2
No files found.
GHS/App/SGM4591Q.c
View file @
5c91bf49
...
@@ -31,11 +31,29 @@ uint8_t SGM4591Q_Init_Once = 0;
...
@@ -31,11 +31,29 @@ uint8_t SGM4591Q_Init_Once = 0;
void
SGM4591Q_Init
(
void
);
void
SGM4591Q_Init
(
void
);
void
SGM4591Q_Init
(
void
)
void
SGM4591Q_Init
(
void
)
{
{
SGM4591Q_IIC_Send
(
0xEA
,
0x06
,
0
);
/*U59:A0低,A1低*/
SGM4591Q_IIC_Send
(
0xEA
,
0x07
,
0
);
SGM4591Q_IIC_Send
(
0xE8
,
0x06
,
0
);
/*P0组引脚为输出*/
SGM4591Q_IIC_Send
(
0xE8
,
0x07
,
0
);
/*P1组引脚为输出*/
SGM4591Q_IIC_Send
(
0xE8
,
0x08
,
0xFF
);
/*推挽输出*/
SGM4591Q_IIC_Send
(
0xE8
,
0x09
,
0xFF
);
/*推挽输出*/
SGM4591Q_IIC_Send
(
0xE8
,
0x06
,
0
);
/*U71:A0低,A1高*/
SGM4591Q_IIC_Send
(
0xE8
,
0x07
,
0
);
SGM4591Q_IIC_Send
(
0xEC
,
0x06
,
0
);
/*P0组引脚为输出*/
SGM4591Q_IIC_Send
(
0xEC
,
0x07
,
0
);
/*P1组引脚为输出*/
SGM4591Q_IIC_Send
(
0xEC
,
0x08
,
0xFF
);
/*推挽输出*/
SGM4591Q_IIC_Send
(
0xEC
,
0x09
,
0xFF
);
/*推挽输出*/
/*U72:A0高,A1低*/
SGM4591Q_IIC_Send
(
0xEA
,
0x06
,
0
);
/*P0组引脚为输出*/
SGM4591Q_IIC_Send
(
0xEA
,
0x07
,
0
);
/*P1组引脚为输出*/
SGM4591Q_IIC_Send
(
0xEA
,
0x08
,
0xFF
);
/*推挽输出*/
SGM4591Q_IIC_Send
(
0xEA
,
0x09
,
0xFF
);
/*推挽输出*/
/*U69:A0高,A1高*/
SGM4591Q_IIC_Send
(
0xEE
,
0x06
,
0
);
/*P0组引脚为输出*/
SGM4591Q_IIC_Send
(
0xEE
,
0x07
,
0
);
/*P1组引脚为输出*/
SGM4591Q_IIC_Send
(
0xEE
,
0x08
,
0xFF
);
/*推挽输出*/
SGM4591Q_IIC_Send
(
0xEE
,
0x09
,
0xFF
);
/*推挽输出*/
}
}
uint8_t
SGM4591Q_U7_Out_P0
=
0xFF
;
uint8_t
SGM4591Q_U7_Out_P0
=
0xFF
;
...
@@ -44,10 +62,10 @@ uint8_t SGM4591Q_U7_Out_Keep_P0 = 0x00;
...
@@ -44,10 +62,10 @@ uint8_t SGM4591Q_U7_Out_Keep_P0 = 0x00;
uint8_t
SGM4591Q_U7_Out_P1
=
0xFF
;
uint8_t
SGM4591Q_U7_Out_P1
=
0xFF
;
uint8_t
SGM4591Q_U7_Out_Keep_P1
=
0x00
;
uint8_t
SGM4591Q_U7_Out_Keep_P1
=
0x00
;
uint8_t
SGM4591Q_U9_Out_P0
=
0
xFF
;
uint8_t
SGM4591Q_U9_Out_P0
=
0
;
uint8_t
SGM4591Q_U9_Out_Keep_P0
=
0x00
;
uint8_t
SGM4591Q_U9_Out_Keep_P0
=
0x00
;
uint8_t
SGM4591Q_U9_Out_P1
=
0
xFF
;
uint8_t
SGM4591Q_U9_Out_P1
=
0
;
uint8_t
SGM4591Q_U9_Out_Keep_P1
=
0x00
;
uint8_t
SGM4591Q_U9_Out_Keep_P1
=
0x00
;
void
SGM4591Q_Control
(
void
)
void
SGM4591Q_Control
(
void
)
...
@@ -68,27 +86,29 @@ void SGM4591Q_Control(void)
...
@@ -68,27 +86,29 @@ void SGM4591Q_Control(void)
// SGM4591Q_U9_Out_P0 = 0xFF;
// SGM4591Q_U9_Out_P0 = 0xFF;
// }
// }
if
(
SGM4591Q_U7_Out_Keep_P0
!=
SGM4591Q_U7_Out_P0
)
//
if (SGM4591Q_U7_Out_Keep_P0 != SGM4591Q_U7_Out_P0)
{
//
{
SGM4591Q_IIC_Send
(
0xEA
,
0x02
,
SGM4591Q_U7_Out_P0
);
//
SGM4591Q_IIC_Send(0xEA, 0x02, SGM4591Q_U7_Out_P0);
SGM4591Q_U7_Out_Keep_P0
=
SGM4591Q_U7_Out_P0
;
//
SGM4591Q_U7_Out_Keep_P0 = SGM4591Q_U7_Out_P0;
}
//
}
if
(
SGM4591Q_U7_Out_Keep_P1
!=
SGM4591Q_U7_Out_P1
)
//
if (SGM4591Q_U7_Out_Keep_P1 != SGM4591Q_U7_Out_P1)
{
//
{
SGM4591Q_IIC_Send
(
0xEA
,
0x02
,
SGM4591Q_U7_Out_P1
);
// SGM4591Q_IIC_Send(0xEA, 0x03
, SGM4591Q_U7_Out_P1);
SGM4591Q_U7_Out_Keep_P1
=
SGM4591Q_U7_Out_P1
;
//
SGM4591Q_U7_Out_Keep_P1 = SGM4591Q_U7_Out_P1;
}
//
}
if
(
SGM4591Q_U9_Out_Keep_P0
!=
SGM4591Q_U9_Out_P0
)
if
(
SGM4591Q_U9_Out_Keep_P0
!=
SGM4591Q_U9_Out_P0
)
{
{
/*设置端口输出电平高低*/
SGM4591Q_IIC_Send
(
0xE8
,
0x02
,
SGM4591Q_U9_Out_P0
);
SGM4591Q_IIC_Send
(
0xE8
,
0x02
,
SGM4591Q_U9_Out_P0
);
SGM4591Q_U9_Out_Keep_P0
=
SGM4591Q_U9_Out_P0
;
SGM4591Q_U9_Out_Keep_P0
=
SGM4591Q_U9_Out_P0
;
}
}
if
(
SGM4591Q_U9_Out_Keep_P1
!=
SGM4591Q_U9_Out_P1
)
if
(
SGM4591Q_U9_Out_Keep_P1
!=
SGM4591Q_U9_Out_P1
)
{
{
SGM4591Q_IIC_Send
(
0xE8
,
0x02
,
SGM4591Q_U9_Out_P1
);
/*设置端口输出电平高低*/
SGM4591Q_IIC_Send
(
0xE8
,
0x03
,
SGM4591Q_U9_Out_P1
);
SGM4591Q_U9_Out_Keep_P1
=
SGM4591Q_U9_Out_P1
;
SGM4591Q_U9_Out_Keep_P1
=
SGM4591Q_U9_Out_P1
;
}
}
}
}
GHS/System/Sys_Task_List.c
View file @
5c91bf49
...
@@ -77,10 +77,11 @@ uint16_t ADC_Input_Voltage_Calc(uint16_t u16ADCSample, uint16_t u16ADCRes, uint1
...
@@ -77,10 +77,11 @@ uint16_t ADC_Input_Voltage_Calc(uint16_t u16ADCSample, uint16_t u16ADCRes, uint1
return
u16Result
;
return
u16Result
;
}
}
uint32_t
time_test
=
0
;
// uint8_t aaaaaaData = 0U;
// uint8_t aaaaaaData = 0U;
void
Sys_100ms_Tasks
(
void
)
void
Sys_100ms_Tasks
(
void
)
{
{
time_test
++
;
// Dio_FlipChannel(DioConf_DioChannel_P56DioChannel);
// Dio_FlipChannel(DioConf_DioChannel_P56DioChannel);
Dio_FlipChannel
(
DioConf_DioChannel_P24_13
);
Dio_FlipChannel
(
DioConf_DioChannel_P24_13
);
// g_u8secstatus++;
// g_u8secstatus++;
...
@@ -108,7 +109,7 @@ void Sys_100ms_Tasks(void)
...
@@ -108,7 +109,7 @@ void Sys_100ms_Tasks(void)
}
}
}
}
SGM4591Q_Control
();
SGM4591Q_Control
();
MC33984EHFK_Read
();
//
MC33984EHFK_Read();
// aaaaaaData= Dio_ReadChannel(Port_Config_PortGroup2_PortPin11);
// aaaaaaData= Dio_ReadChannel(Port_Config_PortGroup2_PortPin11);
// abbaaaData= Dio_ReadChannel(Port_Config_PortGroup22_PortPin3);
// abbaaaData= Dio_ReadChannel(Port_Config_PortGroup22_PortPin3);
// Port_SetPinDirection(Port_Config_PortGroup22_PortPin3, PORT_PIN_IN);
// Port_SetPinDirection(Port_Config_PortGroup22_PortPin3, PORT_PIN_IN);
...
...
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