crtpNRF51.h
Go to the documentation of this file.
1 #pragma once
2 #include <cstdint>
3 
4 // Header
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 
24 {
26  : header(0xFE, 0xFF)
27  {
28  }
29 
31 } __attribute__((packed));
32 
34 {
36  uint8_t addr[6];
37 } __attribute__((packed));
38 
39 // RESET
40 
42 {
44  uint8_t bootToFirmware)
45  : header(0xFE, 0xF0)
46  , bootToFirmware(bootToFirmware)
47  {
48  }
49 
51  uint8_t bootToFirmware; //0=boot to bootloader; otherwise: boot to firmware
52 } __attribute__((packed));
53 
54 /* no response sent */
55 
56 // ALLOFF
57 
59 {
61  : header(0xFE, 0x01)
62  {
63  }
64 
66 } __attribute__((packed));
67 
68 /* no response sent */
69 
70 // SYSOFF
71 
73 {
75  : header(0xFE, 0x02)
76  {
77  }
78 
80 } __attribute__((packed));
81 
82 /* no response sent */
83 
84 // SYSON
85 
87 {
89  : header(0xFE, 0x03)
90  {
91  }
92 
94 } __attribute__((packed));
95 
96 /* no response sent */
97 
98 // GETVBAT
99 
101 {
103  : header(0xFE, 0x04)
104  {
105  }
106 
108 } __attribute__((packed));
109 
111 {
113  float vbat;
114 } __attribute__((packed));
115 
117 
119 {
120 
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(uint8_t hasSafelink)
Definition: crtpNRF51.h:121
struct crtpNrf51Header __attribute__((packed))
uint8_t bootToFirmware
Definition: crtpNRF51.h:229
const uint8_t header1
Definition: crtpNRF51.h:228
crtpNrf51Header header
Definition: crtpNRF51.h:50
crtpNrf51Header header
Definition: crtpNRF51.h:65
crtpNrf51Header header
Definition: crtpNRF51.h:107
uint8_t target
Definition: crtpNRF51.h:17
crtpNrf51ResetInitRequest request
Definition: crtpNRF51.h:35
uint8_t cmd
Definition: crtpNRF51.h:18
crtpNrf51Header header
Definition: crtpNRF51.h:93
crtpNrf51Header header
Definition: crtpNRF51.h:79
constexpr crtpNrf51Header(uint8_t target, uint8_t cmd)
Definition: crtpNRF51.h:7
uint8_t hasSafelink
Definition: crtpNRF51.h:230
uint8_t header
Definition: crtpNRF51.h:16
uint8_t bootToFirmware
Definition: crtpNRF51.h:51
crtpNrf51GetVBatRequest request
Definition: crtpNRF51.h:112
crtpNrf51Header header
Definition: crtpNRF51.h:30
const uint8_t header2
Definition: crtpNRF51.h:229
crtpNrf51ResetRequest(uint8_t bootToFirmware)
Definition: crtpNRF51.h:43
uint8_t addr[6]
Definition: crtpNRF51.h:222


crazyflie_cpp
Author(s): Wolfgang Hoenig
autogenerated on Fri Nov 1 2019 03:39:56