Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multipass
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
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
derf
multipass
Commits
9eb10668
Commit
9eb10668
authored
6 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
LM75: Add getOS, getHyst accessors
parent
6192b8ce
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
include/driver/lm75.h
+2
-0
2 additions, 0 deletions
include/driver/lm75.h
src/driver/lm75.cc
+18
-0
18 additions, 0 deletions
src/driver/lm75.cc
with
20 additions
and
0 deletions
include/driver/lm75.h
+
2
−
0
View file @
9eb10668
...
...
@@ -12,6 +12,8 @@ class LM75 {
LM75
(
unsigned
char
const
addr
)
:
address
(
addr
)
{}
float
getTemp
();
unsigned
int
getOS
();
unsigned
int
getHyst
();
void
setOS
(
unsigned
char
os
);
void
setHyst
(
unsigned
char
hyst
);
};
...
...
This diff is collapsed.
Click to expand it.
src/driver/lm75.cc
+
18
−
0
View file @
9eb10668
...
...
@@ -15,6 +15,24 @@ float LM75::getTemp()
return
rxbuf
[
0
]
+
(
rxbuf
[
1
]
/
256.0
);
}
unsigned
int
LM75
::
getOS
()
{
txbuf
[
0
]
=
0x03
;
rxbuf
[
0
]
=
0
;
rxbuf
[
1
]
=
0
;
i2c
.
xmit
(
address
,
1
,
txbuf
,
2
,
rxbuf
);
return
rxbuf
[
0
];
}
unsigned
int
LM75
::
getHyst
()
{
txbuf
[
0
]
=
0x02
;
rxbuf
[
0
]
=
0
;
rxbuf
[
1
]
=
0
;
i2c
.
xmit
(
address
,
1
,
txbuf
,
2
,
rxbuf
);
return
rxbuf
[
0
];
}
void
LM75
::
setOS
(
unsigned
char
os
)
{
txbuf
[
0
]
=
0x03
;
...
...
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