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
6188e805
Commit
6188e805
authored
1 year ago
by
fxk8y
Browse files
Options
Downloads
Patches
Plain Diff
Completing register skeletons
parent
e4565831
No related branches found
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
+2
-16
2 additions, 16 deletions
CLC-qthing/SiliconTorch/Hardware/MAX31856.cpp
CLC-qthing/SiliconTorch/Hardware/MAX31856.hpp
+66
-4
66 additions, 4 deletions
CLC-qthing/SiliconTorch/Hardware/MAX31856.hpp
with
68 additions
and
20 deletions
CLC-qthing/SiliconTorch/Hardware/MAX31856.cpp
+
2
−
16
View file @
6188e805
...
...
@@ -154,18 +154,13 @@ namespace MAX31856 {
/*
void
MAX31856
::
setThermocoupleType
(
ThermocoupleType
tc
)
{
return
mutex
.
run
([
&
]()
{
CR1
reg
;
reg
.
value
=
spi
->
readU8
(
CR1
::
addr
);
if (pfr == F60Hz) reg.PWRLNRJ = 0;
else reg.PWRLNRJ = 1;
reg
.
TCTYPE
=
tc
;
spi
->
writeU8
(
CR1
::
addr
,
reg
.
value
);
});
...
...
@@ -177,9 +172,7 @@ namespace MAX31856 {
CR1
reg
;
reg
.
value
=
spi
->
readU8
(
CR1
::
addr
);
// TODO: Can this be done by casting?
if (reg.PWRLNRJ == 0) return F60Hz;
else return F50Hz;
return
(
ThermocoupleType
)
reg
.
TCTYPE
;
});
}
...
...
@@ -187,13 +180,6 @@ namespace MAX31856 {
*/
...
...
This diff is collapsed.
Click to expand it.
CLC-qthing/SiliconTorch/Hardware/MAX31856.hpp
+
66
−
4
View file @
6188e805
...
...
@@ -36,6 +36,12 @@ namespace MAX31856 {
};
// #################################
// ### ###
// ### Register Declarations ###
// ### ###
// #################################
union
CR0
{
struct
__attribute__
((
packed
))
{
...
...
@@ -150,36 +156,89 @@ namespace MAX31856 {
};
union
CJTO
{
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static
constexpr
u8
addr
=
0x09
;
};
union
CJTH
{
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static
constexpr
u8
addr
=
0x0A
;
};
union
CJTL
{
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static
constexpr
u8
addr
=
0x0B
;
};
union
LTCBH
{
// Info: Read only!
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static
constexpr
u8
addr
=
0x0C
;
};
union
LTCBM
{
// Info: Read only!
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static
constexpr
u8
addr
=
0x0D
;
/*
};
union _ {
union
LTCBL
{
// Info: Read only!
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static constexpr u8 addr = 0x0
0
;
static
constexpr
u8
addr
=
0x0
E
;
};
*/
union
SR
{
// Info: Read only!
struct
__attribute__
((
packed
))
{
};
u8
value
=
0x00
;
static
constexpr
u8
addr
=
0x0F
;
};
// #################################
// #################################
...
...
@@ -228,6 +287,9 @@ namespace MAX31856 {
void
setPwrLnRjFrq
(
PowerlineFrequencyRejection
pfr
);
// TODO: Better Name…?!
PowerlineFrequencyRejection
getPwrLnRjFrq
();
// TODO: Better Name…?!
void
setThermocoupleType
(
ThermocoupleType
tc
);
ThermocoupleType
getThermocoupleType
();
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