Main Page
Classes
Files
File List
File Members
crazyflie_cpp
src
crtpNRF51.h
Go to the documentation of this file.
1
#pragma once
2
#include <cstdint>
3
4
// Header
5
struct
crtpNrf51Header
6
{
7
constexpr
crtpNrf51Header
(
8
uint8_t
target
,
9
uint8_t
cmd
)
10
:
header
(0xFF)
11
, target(target)
12
, cmd(cmd)
13
{
14
}
15
16
uint8_t
header
;
17
uint8_t
target
;
18
uint8_t
cmd
;
19
}
__attribute__
((packed));
20
21
// RESET_INIT
22
23
struct
crtpNrf51ResetInitRequest
24
{
25
crtpNrf51ResetInitRequest
()
26
:
header
(0xFE, 0xFF)
27
{
28
}
29
30
crtpNrf51Header
header
;
31
}
__attribute__
((packed));
32
33
struct
crtpNrf51ResetInitResponse
34
{
35
crtpNrf51ResetInitRequest
request
;
36
uint8_t
addr
[6];
37
}
__attribute__
((packed));
38
39
// RESET
40
41
struct
crtpNrf51ResetRequest
42
{
43
crtpNrf51ResetRequest
(
44
uint8_t
bootToFirmware
)
45
:
header
(0xFE, 0xF0)
46
, bootToFirmware(bootToFirmware)
47
{
48
}
49
50
crtpNrf51Header
header
;
51
uint8_t
bootToFirmware
;
//0=boot to bootloader; otherwise: boot to firmware
52
}
__attribute__
((packed));
53
54
/* no response sent */
55
56
// ALLOFF
57
58
struct
crtpNrf51AllOffRequest
59
{
60
crtpNrf51AllOffRequest
()
61
:
header
(0xFE, 0x01)
62
{
63
}
64
65
crtpNrf51Header
header
;
66
}
__attribute__
((packed));
67
68
/* no response sent */
69
70
// SYSOFF
71
72
struct
crtpNrf51SysOffRequest
73
{
74
crtpNrf51SysOffRequest
()
75
:
header
(0xFE, 0x02)
76
{
77
}
78
79
crtpNrf51Header
header
;
80
}
__attribute__
((packed));
81
82
/* no response sent */
83
84
// SYSON
85
86
struct
crtpNrf51SysOnRequest
87
{
88
crtpNrf51SysOnRequest
()
89
:
header
(0xFE, 0x03)
90
{
91
}
92
93
crtpNrf51Header
header
;
94
}
__attribute__
((packed));
95
96
/* no response sent */
97
98
// GETVBAT
99
100
struct
crtpNrf51GetVBatRequest
101
{
102
crtpNrf51GetVBatRequest
()
103
:
header
(0xFE, 0x04)
104
{
105
}
106
107
crtpNrf51Header
header
;
108
}
__attribute__
((packed));
109
110
struct
crtpNrf51GetVBatResponse
111
{
112
crtpNrf51GetVBatRequest
request
;
113
float
vbat
;
114
}
__attribute__
((packed));
115
117
118
struct
crtpNrf51SetSafelinkRequest
119
{
120
121
crtpNrf51SetSafelinkRequest
(
122
uint8_t
hasSafelink
)
123
: hasSafelink(hasSafelink)
124
{
125
}
126
127
const
uint8_t
header1
= 0xFF;
128
const
uint8_t
header2
= 0x05;
129
uint8_t
hasSafelink
;
130
}
__attribute__
((packed));
crtpNrf51SetSafelinkRequest
Definition:
crtpNRF51.h:118
crtpNrf51SysOnRequest
Definition:
crtpNRF51.h:86
__attribute__
struct crtpNrf51Header __attribute__((packed))
bootToFirmware
uint8_t bootToFirmware
Definition:
crtpNRF51.h:229
request
crtpNrf51ResetInitRequest request
Definition:
crtpNRF51.h:221
header1
const uint8_t header1
Definition:
crtpNRF51.h:228
crtpNrf51SysOffRequest
Definition:
crtpNRF51.h:72
crtpNrf51SysOffRequest
crtpNrf51SysOffRequest()
Definition:
crtpNRF51.h:221
crtpNrf51Header::target
uint8_t target
Definition:
crtpNRF51.h:17
crtpNrf51AllOffRequest
Definition:
crtpNRF51.h:58
crtpNrf51GetVBatRequest
crtpNrf51GetVBatRequest()
Definition:
crtpNRF51.h:221
crtpNrf51ResetRequest
Definition:
crtpNRF51.h:41
crtpNrf51Header::cmd
uint8_t cmd
Definition:
crtpNRF51.h:18
crtpNrf51ResetInitRequest
Definition:
crtpNRF51.h:23
crtpNrf51ResetInitRequest
crtpNrf51ResetInitRequest()
Definition:
crtpNRF51.h:221
crtpNrf51GetVBatRequest
Definition:
crtpNRF51.h:100
crtpNrf51SysOnRequest
crtpNrf51SysOnRequest()
Definition:
crtpNRF51.h:221
crtpNrf51Header::crtpNrf51Header
constexpr crtpNrf51Header(uint8_t target, uint8_t cmd)
hasSafelink
uint8_t hasSafelink
Definition:
crtpNRF51.h:230
crtpNrf51SetSafelinkRequest
crtpNrf51SetSafelinkRequest(uint8_t hasSafelink)
Definition:
crtpNRF51.h:222
crtpNrf51GetVBatResponse
Definition:
crtpNRF51.h:110
crtpNrf51Header
Definition:
crtpNRF51.h:5
crtpNrf51ResetRequest
crtpNrf51ResetRequest(uint8_t bootToFirmware)
Definition:
crtpNRF51.h:221
crtpNrf51Header::header
uint8_t header
Definition:
crtpNRF51.h:16
vbat
float vbat
Definition:
crtpNRF51.h:222
crtpNrf51ResetInitResponse
Definition:
crtpNRF51.h:33
crtpNrf51AllOffRequest
crtpNrf51AllOffRequest()
Definition:
crtpNRF51.h:221
header2
const uint8_t header2
Definition:
crtpNRF51.h:229
addr
uint8_t addr[6]
Definition:
crtpNRF51.h:222
crazyflie_tools
Author(s): Wolfgang Hoenig
autogenerated on Mon Sep 28 2020 03:40:15