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
4436c14a
Commit
4436c14a
authored
7 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
add mmsimple driver
parent
0d84f5e5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+5
-0
5 additions, 0 deletions
Makefile
include/driver/mmsimple.h
+34
-0
34 additions, 0 deletions
include/driver/mmsimple.h
src/driver/mmsimple.cc
+32
-0
32 additions, 0 deletions
src/driver/mmsimple.cc
with
71 additions
and
0 deletions
Makefile
+
5
−
0
View file @
4436c14a
...
...
@@ -14,6 +14,11 @@ ifneq ($(findstring lm75,${drivers}), )
COMMON_FLAGS
+=
-DDRIVER_LM75
endif
ifneq
($(findstring mmsimple,${drivers}), )
TARGETS
+=
src/driver/mmsimple.cc
COMMON_FLAGS
+=
-DDRIVER_MMSIMPLE
endif
ifneq
($(findstring sharp96,${drivers}), )
TARGETS
+=
src/driver/sharp96.cc
COMMON_FLAGS
+=
-DDRIVER_SHARP6
...
...
This diff is collapsed.
Click to expand it.
include/driver/mmsimple.h
0 → 100644
+
34
−
0
View file @
4436c14a
#ifndef MMSIMPLE_H
#define MMSIMPLE_H
class
MicroMoodySimple
{
private:
MicroMoodySimple
(
const
MicroMoodySimple
&
copy
);
unsigned
char
const
address
;
unsigned
char
txbuf
[
3
];
void
sendCmd
(
unsigned
char
byte
);
public:
MicroMoodySimple
(
unsigned
char
const
addr
)
:
address
(
addr
)
{}
void
off
();
void
red
();
void
redOn
();
void
redOff
();
void
green
();
void
greenOn
();
void
greenOff
();
void
blue
();
void
blueOn
();
void
blueOff
();
void
toggleRed
();
void
toggleGreen
();
void
toggleBlue
();
void
setBrightness
(
unsigned
char
red
,
unsigned
char
green
);
};
extern
MicroMoodySimple
moody
;
#endif
This diff is collapsed.
Click to expand it.
src/driver/mmsimple.cc
0 → 100644
+
32
−
0
View file @
4436c14a
#include
"driver/mmsimple.h"
#include
"driver/i2c.h"
void
MicroMoodySimple
::
sendCmd
(
unsigned
char
byte
)
{
txbuf
[
0
]
=
byte
;
i2c
.
xmit
(
address
,
3
,
txbuf
,
0
,
txbuf
);
}
void
MicroMoodySimple
::
setBrightness
(
unsigned
char
red
,
unsigned
char
green
)
{
txbuf
[
0
]
=
13
;
txbuf
[
1
]
=
green
;
txbuf
[
2
]
=
red
;
i2c
.
xmit
(
address
,
3
,
txbuf
,
0
,
txbuf
);
}
void
MicroMoodySimple
::
off
()
{
sendCmd
(
0
);
}
void
MicroMoodySimple
::
redOff
()
{
sendCmd
(
1
);
}
void
MicroMoodySimple
::
greenOff
()
{
sendCmd
(
2
);
}
void
MicroMoodySimple
::
blueOff
()
{
sendCmd
(
3
);
}
void
MicroMoodySimple
::
redOn
()
{
sendCmd
(
4
);
}
void
MicroMoodySimple
::
greenOn
()
{
sendCmd
(
5
);
}
void
MicroMoodySimple
::
blueOn
()
{
sendCmd
(
6
);
}
void
MicroMoodySimple
::
toggleRed
()
{
sendCmd
(
7
);
}
void
MicroMoodySimple
::
toggleGreen
()
{
sendCmd
(
8
);
}
void
MicroMoodySimple
::
toggleBlue
()
{
sendCmd
(
9
);
}
void
MicroMoodySimple
::
red
()
{
sendCmd
(
10
);
}
void
MicroMoodySimple
::
green
()
{
sendCmd
(
11
);
}
void
MicroMoodySimple
::
blue
()
{
sendCmd
(
12
);
}
MicroMoodySimple
moody
(
0x11
);
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