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
6f1307e4
Commit
6f1307e4
authored
Aug 13, 2025
by
赵康弘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: MC33984EHFK功能
parent
f1662d0a
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
691 additions
and
8 deletions
+691
-8
settings.json
.vscode/settings.json
+3
-1
Port_PBcfg.c
Config/Config292/Output/Port_OutPut/src/Port_PBcfg.c
+5
-5
App.gpj
GHS/App/App.gpj
+2
-0
MC33984EHFK.c
GHS/App/MC33984EHFK.c
+82
-0
MC33984EHFK.h
GHS/App/MC33984EHFK.h
+21
-0
Driver.gpj
GHS/Driver/Driver.gpj
+2
-0
Simulated_SPI_Master.c
GHS/Driver/Simulated_SPI_Master.c
+515
-0
Simulated_SPI_Master.h
GHS/Driver/Simulated_SPI_Master.h
+53
-0
Sys_Task_List.c
GHS/System/Sys_Task_List.c
+6
-2
init.c
GHS/System/init.c
+2
-0
No files found.
.vscode/settings.json
View file @
6f1307e4
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
"files.associations"
:
{
"files.associations"
:
{
"tca9539.h"
:
"c"
,
"tca9539.h"
:
"c"
,
"tyw_stdint.h"
:
"c"
,
"tyw_stdint.h"
:
"c"
,
"simulated_iic_2_master.h"
:
"c"
"simulated_iic_2_master.h"
:
"c"
,
"simulated_spi_master.h"
:
"c"
,
"mc33984ehfk.h"
:
"c"
}
}
}
}
\ No newline at end of file
Config/Config292/Output/Port_OutPut/src/Port_PBcfg.c
View file @
6f1307e4
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
* E:\Test_MCAL_U2A8_292_43.03_240129_canfd\Test_MCAL_U2A8_292_43.03_240129\Config\Config292\generator\BSWMDT\R431_PORT_U2A8_BSWMDT.arxml
* E:\Test_MCAL_U2A8_292_43.03_240129_canfd\Test_MCAL_U2A8_292_43.03_240129\Config\Config292\generator\BSWMDT\R431_PORT_U2A8_BSWMDT.arxml
* E:\Test_MCAL_U2A8_292_43.03_240129_canfd\Test_MCAL_U2A8_292_43.03_240129\Config\Config292\stubs\Dem\xml\Dem_Port.arxml
* E:\Test_MCAL_U2A8_292_43.03_240129_canfd\Test_MCAL_U2A8_292_43.03_240129\Config\Config292\stubs\Dem\xml\Dem_Port.arxml
* E:\Test_MCAL_U2A8_292_43.03_240129_canfd\Test_MCAL_U2A8_292_43.03_240129\Config\Config292\Translation.trxml
* E:\Test_MCAL_U2A8_292_43.03_240129_canfd\Test_MCAL_U2A8_292_43.03_240129\Config\Config292\Translation.trxml
* GENERATED ON:
09 May 2025 - 17:06:53
* GENERATED ON:
12 May 2025 - 20:16:20
*/
*/
...
@@ -4333,13 +4333,13 @@ CONST(Port_Reg_Init, PORT_CONFIG_DATA) Port_GaaPortConfig[] =
...
@@ -4333,13 +4333,13 @@ CONST(Port_Reg_Init, PORT_CONFIG_DATA) Port_GaaPortConfig[] =
0x00B3U
,
0x00B3U
,
/* PM */
/* PM */
0x
F
EA7U
,
0x
8
EA7U
,
/* PIPC */
/* PIPC */
0x0000U
,
0x0000U
,
/* PIBC */
/* PIBC */
0x0
0
00U
,
0x0
8
00U
,
/* PFC */
/* PFC */
0x0081U
,
0x0081U
,
...
@@ -4408,10 +4408,10 @@ CONST(Port_Reg_Init, PORT_CONFIG_DATA) Port_GaaPortConfig[] =
...
@@ -4408,10 +4408,10 @@ CONST(Port_Reg_Init, PORT_CONFIG_DATA) Port_GaaPortConfig[] =
0x0000U
,
0x0000U
,
/* PDSC */
/* PDSC */
0x
0000
U
,
0x
6008
U
,
/* PUCC */
/* PUCC */
0x
0000
U
,
0x
6008
U
,
/* PINV */
/* PINV */
0x0000U
,
0x0000U
,
...
...
GHS/App/App.gpj
View file @
6f1307e4
#!gbuild
#!gbuild
[Subproject]
[Subproject]
MC33984EHFK.c
MC33984EHFK.h
TCA9539.c
TCA9539.c
TCA9539.h
TCA9539.h
CAN_APP\RTE_CAN.c
CAN_APP\RTE_CAN.c
...
...
GHS/App/MC33984EHFK.c
0 → 100644
View file @
6f1307e4
#include "MC33984EHFK.h"
#include "Simulated_SPI_Master.h"
void
MC33984EHFK_Delay
(
void
)
{
uint8_t
i
;
for
(
i
=
0
;
i
<
80U
;
i
++
)
{
NOP
();
}
}
void
MC33984EHFK_Init
(
void
)
{
MC33984EHFK_CS2_Output_High
();
Sim_SPI_Master_Start
(
SIM_SPI_MODE_1
,
SIM_SPI_MSB_FIRST
);
MC33984EHFK_CS1_Output_Low
();
/*2.输出控制*/
Sim_SPI_Master_Byte_Write
(
MC33984_OCR
);
/*全开*/
Sim_SPI_Master_Byte_Write
(
0x0F
);
/*3.过电流高/低选择*/
Sim_SPI_Master_Byte_Write
(
MC33984_SOCHLR_0
);
/*大电流100A,小电流7.5A*/
Sim_SPI_Master_Byte_Write
(
0x07
);
/*4.电流检测时间与开负载*/
Sim_SPI_Master_Byte_Write
(
MC33984_CDTOLR_0
);
/*禁用此检测*/
Sim_SPI_Master_Byte_Write
(
0x0c
);
/*5.直接输入控制*/
Sim_SPI_Master_Byte_Write
(
MC33984_DICR_0
);
/*使用外部控制,电流监测比例:1=1/41000,快速输出斜率*/
Sim_SPI_Master_Byte_Write
(
0x0c
);
/*6.输出切换延迟*/
Sim_SPI_Master_Byte_Write
(
MC33984_OSDR
);
/*挑了个中间值,延时300ms*/
Sim_SPI_Master_Byte_Write
(
0x03
);
/*7.看门狗*/
Sim_SPI_Master_Byte_Write
(
MC33984_WDR
);
/*设置为最大2500ms*/
Sim_SPI_Master_Byte_Write
(
0X02
);
/*9.欠压/过压*/
Sim_SPI_Master_Byte_Write
(
MC33984_UOVR
);
/*全开*/
Sim_SPI_Master_Byte_Write
(
0X00
);
MC33984EHFK_CS1_Output_High
();
MC33984EHFK_Delay
();
}
uint8_t
MC33984EHFK_Readstep
=
0
;
uint8_t
MC33984_Record
=
0
;
uint8_t
dasdsa
=
0
;
uint8_t
HDir
[
100
]
=
0
;
void
MC33984EHFK_Read
(
void
)
{
if
(
MC33984EHFK_Readstep
<
8
)
{
MC33984EHFK_CS1_Output_Low
();
if
(
MC33984_Record
<
80
)
{
HDir
[
MC33984_Record
]
=
MC33984EHFK_Readstep
;
MC33984_Record
++
;
HDir
[
MC33984_Record
]
=
Sim_SPI_Master_Byte_Read
(
MC33984_STATR_0
+
MC33984EHFK_Readstep
);
MC33984_Record
++
;
if
(
dasdsa
==
0
)
{
Sim_SPI_Master_Byte_Write
(
MC33984_OCR
);
/*全开*/
Sim_SPI_Master_Byte_Write
(
0x0F
);
dasdsa
=
1
;
}
else
{
Sim_SPI_Master_Byte_Write
(
MC33984_OCR_FeedDog
);
/*全开*/
Sim_SPI_Master_Byte_Write
(
0x0F
);
dasdsa
=
0
;
}
}
else
{
MC33984_Record
=
0
;
}
MC33984EHFK_CS1_Output_High
();
MC33984EHFK_Readstep
++
;
}
else
{
MC33984EHFK_Readstep
=
0
;
}
}
GHS/App/MC33984EHFK.h
0 → 100644
View file @
6f1307e4
#include "TYW_stdint.h"
#define MC33984_STATR_0 0x00
#define MC33984_STATR_1 0x80
#define MC33984_OCR 0x10
#define MC33984_OCR_FeedDog 0x90
#define MC33984_SOCHLR_0 0x20
#define MC33984_SOCHLR_1 0xA0
#define MC33984_CDTOLR_0 0x30
#define MC33984_CDTOLR_1 0xB0
#define MC33984_DICR_0 0x40
#define MC33984_DICR_1 0xC0
#define MC33984_OSDR 0x50
#define MC33984_WDR 0xD0
#define MC33984_UOVR 0xE0
void
MC33984EHFK_Init
(
void
);
void
MC33984EHFK_Read
(
void
);
GHS/Driver/Driver.gpj
View file @
6f1307e4
#!gbuild
#!gbuild
[Subproject]
[Subproject]
Simulated_SPI_Master.c
Simulated_SPI_Master.h
Simulated_IIC_2_Master.c
Simulated_IIC_2_Master.c
Simulated_IIC_2_Master.h
Simulated_IIC_2_Master.h
CAN\Rscan.c
CAN\Rscan.c
...
...
GHS/Driver/Simulated_SPI_Master.c
0 → 100644
View file @
6f1307e4
This diff is collapsed.
Click to expand it.
GHS/Driver/Simulated_SPI_Master.h
0 → 100644
View file @
6f1307e4
#ifndef _SIMULATED_SPI_MASTER_H_
#define _SIMULATED_SPI_MASTER_H_
#include "TYW_stdint.h"
/******************************************************************************
模拟SPI主机可配置参数
******************************************************************************/
/*** SPI工作模式 ***/
#define SIM_SPI_MODE_0 0x00
#define SIM_SPI_MODE_1 0x01
#define SIM_SPI_MODE_2 0x02
#define SIM_SPI_MODE_3 0x03
/*** 首先发送的数据位 ***/
#define SIM_SPI_MSB_FIRST 0x00
#define SIM_SPI_LSB_FIRST 0x01
/******************************************************************************
模拟SPI主机配置结构
******************************************************************************/
typedef
struct
{
uint8_t
CPOL
;
uint8_t
CPHA
;
uint8_t
FirstBit
;
}
SimSPIConfigStruct
;
/******************************************************************************
函数声明
******************************************************************************/
void
Sim_SPI_Master_Start
(
uint8_t
Mode
,
uint8_t
FirstBit
);
void
Sim_SPI_Master_Byte_Write
(
uint8_t
Data
);
uint8_t
Sim_SPI_Master_Byte_Read
(
uint8_t
TxData
);
void
Sim_SPI_Master_Word_Write
(
uint16_t
Data
);
uint16_t
Sim_SPI_Master_Word_Read
(
uint16_t
TxData
);
/*CS1输出高*/
void
MC33984EHFK_CS1_Output_High
(
void
);
/*CS1输出低*/
void
MC33984EHFK_CS1_Output_Low
(
void
);
/*CS2输出高*/
void
MC33984EHFK_CS2_Output_High
(
void
);
/*CS2输出低*/
void
MC33984EHFK_CS2_Output_Low
(
void
);
#endif
GHS/System/Sys_Task_List.c
View file @
6f1307e4
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
#include "CAN_CH0_CAN_Communication_Matrix.h"
#include "CAN_CH0_CAN_Communication_Matrix.h"
#include "Adc.h"
#include "Adc.h"
#include "TCA9539.h"
#include "TCA9539.h"
#include "MC33984EHFK.h"
void
Sys_50us_Tasks
(
void
)
void
Sys_50us_Tasks
(
void
)
{
{
COM_TX_Process
();
COM_TX_Process
();
...
@@ -76,10 +78,11 @@ uint16_t ADC_Input_Voltage_Calc(uint16_t u16ADCSample, uint16_t u16ADCRes, uint1
...
@@ -76,10 +78,11 @@ uint16_t ADC_Input_Voltage_Calc(uint16_t u16ADCSample, uint16_t u16ADCRes, uint1
return
u16Result
;
return
u16Result
;
}
}
// uint8_t aaaaaaData = 0U;
void
Sys_100ms_Tasks
(
void
)
void
Sys_100ms_Tasks
(
void
)
{
{
// 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++;
// if (g_u8secstatus == 10)
// if (g_u8secstatus == 10)
// {
// {
...
@@ -105,7 +108,8 @@ void Sys_100ms_Tasks(void)
...
@@ -105,7 +108,8 @@ void Sys_100ms_Tasks(void)
}
}
}
}
TCA9539_Control
();
TCA9539_Control
();
// aaaaaaData= Dio_ReadChannel(Port_Config_PortGroup22_PortPin4);
MC33984EHFK_Read
();
// 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);
...
...
GHS/System/init.c
View file @
6f1307e4
#include "init.h"
#include "init.h"
#include "Sys_Scheduler.h"
#include "Sys_Scheduler.h"
#include "Simulated_IIC_2_Master.h"
#include "Simulated_IIC_2_Master.h"
#include "MC33984EHFK.h"
#define ADC_MODULE_SAMPLE//sophia add
#define ADC_MODULE_SAMPLE//sophia add
/* Registers base adrress */
/* Registers base adrress */
...
@@ -448,6 +449,7 @@ void Sys_Startup_Init(void)
...
@@ -448,6 +449,7 @@ void Sys_Startup_Init(void)
*****************************************************************************/
*****************************************************************************/
Simulated_IIC_2_Init
(
);
Simulated_IIC_2_Init
(
);
MC33984EHFK_Init
(
);
#ifdef SPI_MODULE_SAMPLE
#ifdef SPI_MODULE_SAMPLE
/* This service is for initializing the SPI Driver. */
/* This service is for initializing the SPI Driver. */
...
...
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