crtpBootloader.h
Go to the documentation of this file.
1 #pragma once
2 #include <cstdint>
3 
4 // Header
5 struct bootloader
6 {
7  constexpr bootloader(
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 // GET_INFO
23 {
25  uint8_t target)
26  : header(target, 0x10)
27  {
28  }
29 
31 } __attribute__((packed));
32 
34 {
36  uint16_t pageSize;
37  uint16_t nBuffPage;
38  uint16_t nFlashPage;
39  uint16_t flashStart;
40  uint8_t reserved[12];
41  uint8_t version;
42 } __attribute__((packed));
43 
44 // GET_MAPPING
45 
46 // LOAD_BUFFER
47 
49 {
51  uint8_t target,
52  uint16_t page,
53  uint16_t address)
54  : header(target, 0x14)
55  , page(page)
56  , address(address)
57  {
58  }
59 
61  uint16_t page;
62  uint16_t address;
63  uint8_t data[25];
64 } __attribute__((packed));
65 
66 // READ_BUFFER
67 
69 {
71  uint8_t target,
72  uint16_t page,
73  uint16_t address)
74  : header(target, 0x15)
75  , page(page)
76  , address(address)
77  {
78  }
79 
81  uint16_t page;
82  uint16_t address;
83 } __attribute__((packed));
84 
86 {
88  uint8_t data[25];
89 } __attribute__((packed));
90 
91 // WRITE_FLASH
92 
94 {
96  uint8_t target,
97  uint16_t bufferPage,
98  uint16_t flashPage,
99  uint16_t nPages)
100  : header(target, 0x18)
101  , bufferPage(bufferPage)
102  , flashPage(flashPage)
103  , nPages(nPages)
104  {
105  }
106 
108  uint16_t bufferPage;
109  uint16_t flashPage;
110  uint16_t nPages;
111 } __attribute__((packed));
112 
114 {
116  uint8_t done;
117  uint8_t error;
118 } __attribute__((packed));
119 
120 // FLASH_STATUS
121 
123 {
125  uint8_t target)
126  : header(target, 0x19)
127  {
128  }
129 
131 } __attribute__((packed));
132 
134 {
136  uint8_t done;
137  uint8_t error;
138 } __attribute__((packed));
139 
140 // READ_FLASH
141 
143 {
145  uint8_t target,
146  uint16_t page,
147  uint16_t address)
148  : header(target, 0x1C)
149  , page(page)
150  , address(address)
151  {
152  }
153 
155  uint16_t page;
156  uint16_t address;
157 } __attribute__((packed));
158 
160 {
162  uint8_t data[25];
163 } __attribute__((packed));
164 
165 // RESET
166 
168 {
170  uint8_t bootToFirmware)
171  : header(0xFE, 0xF0)
172  , bootToFirmware(bootToFirmware)
173  {
174  }
175 
177  uint8_t bootToFirmware; //0=boot to bootloader; otherwise: boot to firmware
178 } __attribute__((packed));
bootloaderGetInfoRequest request
bootloaderReadBufferRequest(uint8_t target, uint16_t page, uint16_t address)
bootloaderResetRequest(uint8_t bootToFirmware)
uint8_t bootToFirmware
uint8_t cmd
struct bootloader __attribute__((packed))
bootloaderLoadBufferRequest(uint8_t target, uint16_t page, uint16_t address)
uint16_t flashPage
bootloaderFlashStatusRequest(uint8_t target)
uint8_t reserved[12]
uint16_t address
uint8_t header
bootloaderReadFlashRequest(uint8_t target, uint16_t page, uint16_t address)
constexpr bootloader(uint8_t target, uint8_t cmd)
Definition: crtpBootloader.h:7
uint16_t bufferPage
bootloaderGetInfoRequest(uint8_t target)
uint16_t page
uint8_t target
bootloaderFlashStatusRequest request
bootloaderReadFlashRequest request
uint16_t nPages
bootloaderReadBufferRequest request
bootloaderWriteFlashRequest(uint8_t target, uint16_t bufferPage, uint16_t flashPage, uint16_t nPages)
uint8_t data[25]


crazyflie_cpp
Author(s): Wolfgang Hoenig
autogenerated on Mon Sep 28 2020 03:40:10