Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
c
d
f
g
i
l
m
n
o
p
r
s
t
u
v
+
Functions
_
a
c
f
i
l
n
o
p
s
t
u
v
+
Variables
_
a
c
d
f
i
l
m
n
o
p
r
s
t
Typedefs
Enumerations
+
Enumerator
a
g
p
r
t
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
m
o
p
q
r
s
t
u
v
+
Enumerations
_
a
b
c
e
f
g
h
i
l
m
o
p
r
s
u
+
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
w
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
firmware
boards
breezy
breezystm32
examples
blinkplusplus
ledblink.cpp
Go to the documentation of this file.
1
/*
2
ledblink.cpp : blink the LED using C++
3
4
Copyright (C) 2016 Simon D. Levy
5
6
This file is part of BreezySTM32.
7
8
BreezySTM32 is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12
13
BreezySTM32 is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with BreezySTM32. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
extern
"C"
{
// allows us to compile C++ with arm-none-eabi-gcc
23
24
#include <
breezystm32.h
>
25
26
class
Blinker
{
27
28
private
:
29
30
int
ledid
;
31
32
public
:
33
34
void
init
(
int
id
) {
35
36
this->ledid = id;
37
}
38
39
void
toggle
(
void
) {
40
41
switch
(this->ledid) {
42
43
case
0:
44
LED0_TOGGLE
;
45
break
;
46
47
case
1:
48
LED1_TOGGLE
;
49
}
50
}
51
52
};
53
54
Blinker
blinker
;
55
56
void
setup
(
void
) {
57
58
blinker.
init
(1);
59
}
60
61
void
loop
(
void
) {
62
63
blinker.
toggle
();
64
65
delay
(500);
66
}
67
68
}
Blinker::ledid
int ledid
Definition:
ledblink.cpp:30
LED0_TOGGLE
#define LED0_TOGGLE
Definition:
drv_system.h:41
setup
void setup(void)
Definition:
ledblink.cpp:56
loop
void loop(void)
Definition:
ledblink.cpp:61
Blinker::toggle
void toggle(void)
Definition:
ledblink.cpp:39
breezystm32.h
Blinker::init
void init(int id)
Definition:
ledblink.cpp:34
LED1_TOGGLE
#define LED1_TOGGLE
Definition:
drv_system.h:51
blinker
Blinker blinker
Definition:
ledblink.cpp:54
Blinker
Definition:
ledblink.cpp:26
delay
void delay(uint32_t ms)
Definition:
system.c:101
rosflight_firmware
Author(s): Daniel Koch
, James Jackson
autogenerated on Mon Feb 28 2022 23:36:08