Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
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
baizhengyuan
TianYing_ty100
Commits
344db24e
Commit
344db24e
authored
Sep 26, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:读写EE改为操作寄存器方式,微调延时时间
parent
2891bc2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
7 deletions
+39
-7
eeManager_Interface.c
Firmware/Source/Component/Eeprom/eeManager_Interface.c
+39
-7
No files found.
Firmware/Source/Component/Eeprom/eeManager_Interface.c
View file @
344db24e
...
@@ -35,9 +35,20 @@ void eeprom_comm_DelayUs(ee_uint32_t time)
...
@@ -35,9 +35,20 @@ void eeprom_comm_DelayUs(ee_uint32_t time)
EE_FeedDog
();
EE_FeedDog
();
for
(
i
=
0
;
i
<
dalayCnt
;
i
++
)
for
(
i
=
0
;
i
<
dalayCnt
;
i
++
)
{
{
EE_NOP
();
//EE_NOP();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
__NOP
();
}
}
EE_FeedDog
();
//
EE_FeedDog();
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
@@ -50,7 +61,8 @@ void eeprom_comm_DelayUs(ee_uint32_t time)
...
@@ -50,7 +61,8 @@ void eeprom_comm_DelayUs(ee_uint32_t time)
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
void
EE_SDA_InConfig
(
void
)
void
EE_SDA_InConfig
(
void
)
{
{
RTE_GPIO_Config
(
EE_SDA
,
RTE_GPIO_DIR_IN
);
//RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_IN);
PORT
->
PM6
|=
(
1
<<
1
);
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : EE_SDA_OutConfig
* Function Name : EE_SDA_OutConfig
...
@@ -62,7 +74,8 @@ void EE_SDA_InConfig(void)
...
@@ -62,7 +74,8 @@ void EE_SDA_InConfig(void)
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
void
EE_SDA_OutConfig
(
void
)
void
EE_SDA_OutConfig
(
void
)
{
{
RTE_GPIO_Config
(
EE_SDA
,
RTE_GPIO_DIR_OUT
);
//RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT);
PORT
->
PM6
&=
~
(
1
<<
1
);
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : EE_SDA_GetValue
* Function Name : EE_SDA_GetValue
...
@@ -90,7 +103,16 @@ ee_uint8_t EE_SDA_GetValue(void)
...
@@ -90,7 +103,16 @@ ee_uint8_t EE_SDA_GetValue(void)
void
EE_SDA_OUT
(
ee_uint8_t
data
)
void
EE_SDA_OUT
(
ee_uint8_t
data
)
{
{
// RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT | data);
// RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT | data);
RTE_GPIO_Set_Level
(
EE_SDA
,
data
);
//RTE_GPIO_Set_Level(EE_SDA, data);
if
(
data
)
{
PORT
->
P6
|=
(
1
<<
1
);
}
else
{
PORT
->
P6
&=
~
(
1
<<
1
);
}
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
@@ -103,7 +125,8 @@ void EE_SDA_OUT(ee_uint8_t data)
...
@@ -103,7 +125,8 @@ void EE_SDA_OUT(ee_uint8_t data)
--------------------------------------------------------------------------*/
--------------------------------------------------------------------------*/
void
EE_SCL_OutConfig
(
void
)
void
EE_SCL_OutConfig
(
void
)
{
{
RTE_GPIO_Config
(
EE_SCL
,
RTE_GPIO_DIR_OUT
);
//RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT);
PORT
->
PM6
&=
~
(
1
<<
0
);
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : EE_SCL_OUT
* Function Name : EE_SCL_OUT
...
@@ -116,7 +139,16 @@ void EE_SCL_OutConfig(void)
...
@@ -116,7 +139,16 @@ void EE_SCL_OutConfig(void)
void
EE_SCL_OUT
(
ee_uint8_t
data
)
void
EE_SCL_OUT
(
ee_uint8_t
data
)
{
{
// RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT | data);
// RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT | data);
RTE_GPIO_Set_Level
(
EE_SCL
,
data
);
//RTE_GPIO_Set_Level(EE_SCL, data);
if
(
data
)
{
PORT
->
P6
|=
(
1
<<
0
);
}
else
{
PORT
->
P6
&=
~
(
1
<<
0
);
}
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
...
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