Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CyanLight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fxk8y
CyanLight
Commits
608e70d9
Commit
608e70d9
authored
1 year ago
by
fxk8y
Browse files
Options
Downloads
Patches
Plain Diff
Fault bit accessors
parent
6188e805
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CLC-qthing/SiliconTorch/Hardware/MAX31856.cpp
+80
-0
80 additions, 0 deletions
CLC-qthing/SiliconTorch/Hardware/MAX31856.cpp
CLC-qthing/SiliconTorch/Hardware/MAX31856.hpp
+23
-0
23 additions, 0 deletions
CLC-qthing/SiliconTorch/Hardware/MAX31856.hpp
with
103 additions
and
0 deletions
CLC-qthing/SiliconTorch/Hardware/MAX31856.cpp
+
80
−
0
View file @
608e70d9
...
...
@@ -176,6 +176,86 @@ namespace MAX31856 {
});
}
bool
MAX31856
::
isTCOpenCircuit
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
OPEN
;
});
}
bool
MAX31856
::
isTCOVUV
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
OVUV
;
});
}
bool
MAX31856
::
isTCLOW
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
TCLOW
;
});
}
bool
MAX31856
::
isTCHIGH
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
TCHIGH
;
});
}
bool
MAX31856
::
isCJLOW
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
CJLOW
;
});
}
bool
MAX31856
::
isCJHIGH
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
CJHIGH
;
});
}
bool
MAX31856
::
isCJRANGE
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
CJRANGE
;
});
}
bool
MAX31856
::
isTCRANGE
()
{
return
mutex
.
runReturn
<
bool
>
([
&
]()
{
SR
reg
;
reg
.
value
=
spi
->
readU8
(
SR
::
addr
);
return
reg
.
TCRANGE
;
});
}
...
...
This diff is collapsed.
Click to expand it.
CLC-qthing/SiliconTorch/Hardware/MAX31856.hpp
+
23
−
0
View file @
608e70d9
...
...
@@ -79,6 +79,13 @@ namespace MAX31856 {
union
MASK
{
struct
__attribute__
((
packed
))
{
u8
OpenFAULTMask
:
1
;
u8
OVUVFAULTMask
:
1
;
u8
TCLowFAULTMask
:
1
;
u8
TCHighFAULTMask
:
1
;
u8
CJLowFAULTMask
:
1
;
u8
CJHighFAULTMask
:
1
;
u8
_reserved_
:
2
;
};
u8
value
=
0x00
;
...
...
@@ -229,6 +236,14 @@ namespace MAX31856 {
// Info: Read only!
struct
__attribute__
((
packed
))
{
bool
OPEN
:
1
;
bool
OVUV
:
1
;
bool
TCLOW
:
1
;
bool
TCHIGH
:
1
;
bool
CJLOW
:
1
;
bool
CJHIGH
:
1
;
bool
TCRANGE
:
1
;
bool
CJRANGE
:
1
;
};
u8
value
=
0x00
;
...
...
@@ -290,6 +305,14 @@ namespace MAX31856 {
void
setThermocoupleType
(
ThermocoupleType
tc
);
ThermocoupleType
getThermocoupleType
();
bool
isTCOpenCircuit
();
// fault bit
bool
isTCOVUV
();
// fault bit
bool
isTCLOW
();
// fault bit
bool
isTCHIGH
();
// fault bit
bool
isCJLOW
();
// fault bit
bool
isCJHIGH
();
// fault bit
bool
isTCRANGE
();
// fault bit
bool
isCJRANGE
();
// fault bit
void
mainLoop
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment