Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Monitoring Module
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT Monitoring Module
Commits
12db0990
Commit
12db0990
authored
Jun 27, 2022
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main_fw/i2c: inlude value of TMR_ERROR_CNT in STATUS_CML register calculations
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
360ed539
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
i2c_slave.h
common/include/i2c_slave.h
+1
-0
firmware.rst
doc/source/firmware.rst
+7
-2
i2c_impl.c
main_fw/src/i2c_impl.c
+8
-1
No files found.
common/include/i2c_slave.h
View file @
12db0990
...
...
@@ -18,6 +18,7 @@ typedef void(*fp_t)(void);
/* Defines for STATUS_CML */
#define CML_PEC 0x20
#define CML_MEM_FAULT 0x10
#define CML_COMM_ERR 0x2
#define CML_CPU 0x80
...
...
doc/source/firmware.rst
View file @
12db0990
...
...
@@ -376,7 +376,9 @@ The STATUS_CML command returns one data byte with contents as follows:
+--------+---------------------------+
| 5 | Packet Error Check Failed |
+--------+---------------------------+
| 4:2 | Unused |
| 4 | TMR Error |
+--------+---------------------------+
| 3:2 | Unused |
+--------+---------------------------+
| 1 | A communication fault |
+--------+---------------------------+
...
...
@@ -385,6 +387,8 @@ The STATUS_CML command returns one data byte with contents as follows:
Write 1's in the desired bits positions to clear corresponding errors in the register.
Clearing TMR Error flag sets TMR_ERROR_CNT_ register to 0.
.. _READ_VOUT:
READ_VOUT
...
...
@@ -645,7 +649,8 @@ TMR_ERROR_CNT
When software mitigation through COAST is enabled (see
:ref:`coast_sec`), one can access the TMR_ERROR_CNT counter using
this command.
this command. Setting `TMR Error` bit in STATUS_CML_ clears the value of this
register.
.. _USE_PEC:
...
...
main_fw/src/i2c_impl.c
View file @
12db0990
...
...
@@ -321,13 +321,20 @@ void read_status_b(void)
void
get_status_cml
(
void
)
{
/* Set CML_MEM_FAULT bit if TMR error detected */
status_cml
|=
TMR_ERROR_CNT
?
CML_MEM_FAULT
:
0
;
status_cml_tmp
=
status_cml
;
}
void
write_status_cml
(
void
)
{
/*
c
lear only bits set to 1 */
/*
C
lear only bits set to 1 */
status_cml
&=
~
status_cml_tmp
;
/* Set TMR_ERROR_CNT to zero if CML_MEM_FAULT bit is to be cleared */
if
(
status_cml_tmp
&
CML_MEM_FAULT
)
TMR_ERROR_CNT
=
0
;
}
#if defined(MMFANT) || defined(MMPROT)
...
...
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