1pub const R_ACCESS: u32 = 0;
4pub const W_ACCESS: u32 = 1;
5pub const RW_ACCESS: u32 = 2;
6pub const RWE_ACCESS: u32 = 3;
7pub type int_least64_t = i64;
8pub type uint_least64_t = u64;
9pub type int_fast64_t = i64;
10pub type uint_fast64_t = u64;
11pub type int_least32_t = i32;
12pub type uint_least32_t = u32;
13pub type int_fast32_t = i32;
14pub type uint_fast32_t = u32;
15pub type int_least16_t = i16;
16pub type uint_least16_t = u16;
17pub type int_fast16_t = i16;
18pub type uint_fast16_t = u16;
19pub type int_least8_t = i8;
20pub type uint_least8_t = u8;
21pub type int_fast8_t = i8;
22pub type uint_fast8_t = u8;
23pub type intmax_t = ::std::os::raw::c_long;
24pub type uintmax_t = ::std::os::raw::c_ulong;
25#[doc = " \\struct bankSector.\n \\brief This stucture indicates the sectors parameters."]
26#[repr(C)]
27#[derive(Debug, Copy, Clone)]
28pub struct bankSector {
29 #[doc = "< Index of the sector."]
30 pub index: ::std::os::raw::c_uint,
31 #[doc = "< Sector size."]
32 pub size: ::std::os::raw::c_uint,
33 #[doc = "< Sector starting address."]
34 pub address: ::std::os::raw::c_uint,
35}
36#[allow(clippy::unnecessary_operation, clippy::identity_op)]
37const _: () = {
38 ["Size of bankSector"][::std::mem::size_of::<bankSector>() - 12usize];
39 ["Alignment of bankSector"][::std::mem::align_of::<bankSector>() - 4usize];
40 ["Offset of field: bankSector::index"][::std::mem::offset_of!(bankSector, index) - 0usize];
41 ["Offset of field: bankSector::size"][::std::mem::offset_of!(bankSector, size) - 4usize];
42 ["Offset of field: bankSector::address"][::std::mem::offset_of!(bankSector, address) - 8usize];
43};
44#[doc = " \\struct deviceBank.\n \\brief This stucture defines the memory sectors for each bank."]
45#[repr(C)]
46#[derive(Debug, Copy, Clone)]
47pub struct deviceBank {
48 #[doc = "< Number of sectors of the considered bank."]
49 pub sectorsNumber: ::std::os::raw::c_uint,
50 #[doc = "< Sectors specifications #Bank_Sector."]
51 pub sectors: *mut bankSector,
52}
53#[allow(clippy::unnecessary_operation, clippy::identity_op)]
54const _: () = {
55 ["Size of deviceBank"][::std::mem::size_of::<deviceBank>() - 16usize];
56 ["Alignment of deviceBank"][::std::mem::align_of::<deviceBank>() - 8usize];
57 ["Offset of field: deviceBank::sectorsNumber"]
58 [::std::mem::offset_of!(deviceBank, sectorsNumber) - 0usize];
59 ["Offset of field: deviceBank::sectors"][::std::mem::offset_of!(deviceBank, sectors) - 8usize];
60};
61#[doc = " \\struct storageStructure.\n \\brief This stucture describes sotrage characterization."]
62#[repr(C)]
63#[derive(Debug, Copy, Clone)]
64pub struct storageStructure {
65 #[doc = "< Number of exsisted banks."]
66 pub banksNumber: ::std::os::raw::c_uint,
67 #[doc = "< Banks sectors definition #Device_Bank."]
68 pub banks: *mut deviceBank,
69}
70#[allow(clippy::unnecessary_operation, clippy::identity_op)]
71const _: () = {
72 ["Size of storageStructure"][::std::mem::size_of::<storageStructure>() - 16usize];
73 ["Alignment of storageStructure"][::std::mem::align_of::<storageStructure>() - 8usize];
74 ["Offset of field: storageStructure::banksNumber"]
75 [::std::mem::offset_of!(storageStructure, banksNumber) - 0usize];
76 ["Offset of field: storageStructure::banks"]
77 [::std::mem::offset_of!(storageStructure, banks) - 8usize];
78};
79#[doc = " \\struct bitCoefficient_C.\n \\brief This stucture indicates the coefficients to access to the adequate option bit."]
80#[repr(C)]
81#[derive(Debug, Copy, Clone)]
82pub struct bitCoefficient_C {
83 #[doc = "< Bit multiplier."]
84 pub multiplier: ::std::os::raw::c_uint,
85 #[doc = "< Bit offset."]
86 pub offset: ::std::os::raw::c_uint,
87}
88#[allow(clippy::unnecessary_operation, clippy::identity_op)]
89const _: () = {
90 ["Size of bitCoefficient_C"][::std::mem::size_of::<bitCoefficient_C>() - 8usize];
91 ["Alignment of bitCoefficient_C"][::std::mem::align_of::<bitCoefficient_C>() - 4usize];
92 ["Offset of field: bitCoefficient_C::multiplier"]
93 [::std::mem::offset_of!(bitCoefficient_C, multiplier) - 0usize];
94 ["Offset of field: bitCoefficient_C::offset"]
95 [::std::mem::offset_of!(bitCoefficient_C, offset) - 4usize];
96};
97#[doc = " \\struct bitValue_C.\n \\brief This stucture describes the option Bit value."]
98#[repr(C)]
99#[derive(Debug, Copy, Clone)]
100pub struct bitValue_C {
101 #[doc = "< Option bit value."]
102 pub value: ::std::os::raw::c_uint,
103 #[doc = "< Option bit description."]
104 pub description: [::std::os::raw::c_char; 1000usize],
105}
106#[allow(clippy::unnecessary_operation, clippy::identity_op)]
107const _: () = {
108 ["Size of bitValue_C"][::std::mem::size_of::<bitValue_C>() - 1004usize];
109 ["Alignment of bitValue_C"][::std::mem::align_of::<bitValue_C>() - 4usize];
110 ["Offset of field: bitValue_C::value"][::std::mem::offset_of!(bitValue_C, value) - 0usize];
111 ["Offset of field: bitValue_C::description"]
112 [::std::mem::offset_of!(bitValue_C, description) - 4usize];
113};
114#[doc = " \\struct bit_C.\n \\brief This stucture will be filled by values which characterize the device's option bytes.\n \\note See product reference manual for more details."]
115#[repr(C)]
116#[derive(Debug, Copy, Clone)]
117pub struct bit_C {
118 #[doc = "< Bit name such as RDP, BOR_LEV, nBOOT0..."]
119 pub name: [::std::os::raw::c_char; 64usize],
120 #[doc = "< Config description."]
121 pub description: [::std::os::raw::c_char; 1000usize],
122 #[doc = "< Word offset."]
123 pub wordOffset: ::std::os::raw::c_uint,
124 #[doc = "< Bit offset."]
125 pub bitOffset: ::std::os::raw::c_uint,
126 #[doc = "< Number of bits build the option."]
127 pub bitWidth: ::std::os::raw::c_uint,
128 #[doc = "< Access Read/Write."]
129 pub access: ::std::os::raw::c_uchar,
130 #[doc = "< Number of possible values."]
131 pub valuesNbr: ::std::os::raw::c_uint,
132 #[doc = "< Bits value, #BitValue_C."]
133 pub values: *mut *mut bitValue_C,
134 #[doc = "< Bits equation, #BitCoefficient_C."]
135 pub equation: bitCoefficient_C,
136 pub reference: *mut ::std::os::raw::c_uchar,
137 pub bitValue: ::std::os::raw::c_uint,
138}
139#[allow(clippy::unnecessary_operation, clippy::identity_op)]
140const _: () = {
141 ["Size of bit_C"][::std::mem::size_of::<bit_C>() - 1120usize];
142 ["Alignment of bit_C"][::std::mem::align_of::<bit_C>() - 8usize];
143 ["Offset of field: bit_C::name"][::std::mem::offset_of!(bit_C, name) - 0usize];
144 ["Offset of field: bit_C::description"][::std::mem::offset_of!(bit_C, description) - 64usize];
145 ["Offset of field: bit_C::wordOffset"][::std::mem::offset_of!(bit_C, wordOffset) - 1064usize];
146 ["Offset of field: bit_C::bitOffset"][::std::mem::offset_of!(bit_C, bitOffset) - 1068usize];
147 ["Offset of field: bit_C::bitWidth"][::std::mem::offset_of!(bit_C, bitWidth) - 1072usize];
148 ["Offset of field: bit_C::access"][::std::mem::offset_of!(bit_C, access) - 1076usize];
149 ["Offset of field: bit_C::valuesNbr"][::std::mem::offset_of!(bit_C, valuesNbr) - 1080usize];
150 ["Offset of field: bit_C::values"][::std::mem::offset_of!(bit_C, values) - 1088usize];
151 ["Offset of field: bit_C::equation"][::std::mem::offset_of!(bit_C, equation) - 1096usize];
152 ["Offset of field: bit_C::reference"][::std::mem::offset_of!(bit_C, reference) - 1104usize];
153 ["Offset of field: bit_C::bitValue"][::std::mem::offset_of!(bit_C, bitValue) - 1112usize];
154};
155#[doc = " \\struct category_C\n \\brief Get option bytes banks categories descriptions."]
156#[repr(C)]
157#[derive(Debug, Copy, Clone)]
158pub struct category_C {
159 #[doc = "< Get category name such as Read Out Protection, BOR Level..."]
160 pub name: [::std::os::raw::c_char; 100usize],
161 #[doc = "< Get bits number of the considered category."]
162 pub bitsNbr: ::std::os::raw::c_uint,
163 #[doc = "< Get internal bits descriptions."]
164 pub bits: *mut *mut bit_C,
165}
166#[allow(clippy::unnecessary_operation, clippy::identity_op)]
167const _: () = {
168 ["Size of category_C"][::std::mem::size_of::<category_C>() - 112usize];
169 ["Alignment of category_C"][::std::mem::align_of::<category_C>() - 8usize];
170 ["Offset of field: category_C::name"][::std::mem::offset_of!(category_C, name) - 0usize];
171 ["Offset of field: category_C::bitsNbr"]
172 [::std::mem::offset_of!(category_C, bitsNbr) - 100usize];
173 ["Offset of field: category_C::bits"][::std::mem::offset_of!(category_C, bits) - 104usize];
174};
175#[doc = " \\struct bank_C\n \\brief Get option bytes banks internal descriptions.\n \\note STLINK and Bootloader interfaces have different addresses to access to option bytes registres."]
176#[repr(C)]
177#[derive(Debug, Copy, Clone)]
178pub struct bank_C {
179 #[doc = "< Bank size."]
180 pub size: ::std::os::raw::c_uint,
181 #[doc = "< Bank starting address."]
182 pub address: ::std::os::raw::c_uint,
183 #[doc = "< Bank access Read/Write."]
184 pub access: ::std::os::raw::c_uchar,
185 #[doc = "< Number of option bytes categories."]
186 pub categoriesNbr: ::std::os::raw::c_uint,
187 #[doc = "< Get bank categories descriptions #Category_C."]
188 pub categories: *mut *mut category_C,
189}
190#[allow(clippy::unnecessary_operation, clippy::identity_op)]
191const _: () = {
192 ["Size of bank_C"][::std::mem::size_of::<bank_C>() - 24usize];
193 ["Alignment of bank_C"][::std::mem::align_of::<bank_C>() - 8usize];
194 ["Offset of field: bank_C::size"][::std::mem::offset_of!(bank_C, size) - 0usize];
195 ["Offset of field: bank_C::address"][::std::mem::offset_of!(bank_C, address) - 4usize];
196 ["Offset of field: bank_C::access"][::std::mem::offset_of!(bank_C, access) - 8usize];
197 ["Offset of field: bank_C::categoriesNbr"]
198 [::std::mem::offset_of!(bank_C, categoriesNbr) - 12usize];
199 ["Offset of field: bank_C::categories"][::std::mem::offset_of!(bank_C, categories) - 16usize];
200};
201#[doc = " \\struct peripheral_C\n \\brief Get peripheral option bytes general informations."]
202#[repr(C)]
203#[derive(Debug, Copy, Clone)]
204pub struct peripheral_C {
205 #[doc = "< Peripheral name."]
206 pub name: [::std::os::raw::c_char; 64usize],
207 #[doc = "< Peripheral description."]
208 pub description: [::std::os::raw::c_char; 1000usize],
209 #[doc = "< Number of existed banks."]
210 pub banksNbr: ::std::os::raw::c_uint,
211 #[doc = "< Get banks descriptions #Bank_C."]
212 pub banks: *mut *mut bank_C,
213}
214#[allow(clippy::unnecessary_operation, clippy::identity_op)]
215const _: () = {
216 ["Size of peripheral_C"][::std::mem::size_of::<peripheral_C>() - 1080usize];
217 ["Alignment of peripheral_C"][::std::mem::align_of::<peripheral_C>() - 8usize];
218 ["Offset of field: peripheral_C::name"][::std::mem::offset_of!(peripheral_C, name) - 0usize];
219 ["Offset of field: peripheral_C::description"]
220 [::std::mem::offset_of!(peripheral_C, description) - 64usize];
221 ["Offset of field: peripheral_C::banksNbr"]
222 [::std::mem::offset_of!(peripheral_C, banksNbr) - 1064usize];
223 ["Offset of field: peripheral_C::banks"]
224 [::std::mem::offset_of!(peripheral_C, banks) - 1072usize];
225};
226#[doc = " no messages ever printed by the library"]
227pub const cubeProgrammerVerbosityLevel_CUBEPROGRAMMER_VER_LEVEL_NONE: cubeProgrammerVerbosityLevel =
228 0;
229#[doc = " warning, error and success messages are printed (default)"]
230pub const cubeProgrammerVerbosityLevel_CUBEPROGRAMMER_VER_LEVEL_ONE: cubeProgrammerVerbosityLevel =
231 1;
232#[doc = " error roots informational messages are printed"]
233pub const cubeProgrammerVerbosityLevel_CUBEPROGRAMMER_VER_LEVEL_TWO: cubeProgrammerVerbosityLevel =
234 2;
235#[doc = " debug and informational messages are printed"]
236pub const cubeProgrammerVerbosityLevel_CUBEPROGRAMMER_VER_LEVEL_DEBUG:
237 cubeProgrammerVerbosityLevel = 3;
238#[doc = " no progress bar is printed in the output of the library"]
239pub const cubeProgrammerVerbosityLevel_CUBEPROGRAMMER_NO_PROGRESS_BAR:
240 cubeProgrammerVerbosityLevel = 4;
241#[doc = " \\enum cubeProgrammerVerbosityLevel\n \\brief List of verbosity levels."]
242pub type cubeProgrammerVerbosityLevel = ::std::os::raw::c_uint;
243#[doc = " Success (no error)"]
244pub const cubeProgrammerError_CUBEPROGRAMMER_NO_ERROR: cubeProgrammerError = 0;
245#[doc = " Device not connected"]
246pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_NOT_CONNECTED: cubeProgrammerError = -1;
247#[doc = " Device not found"]
248pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_NO_DEVICE: cubeProgrammerError = -2;
249#[doc = " Device connection error"]
250pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_CONNECTION: cubeProgrammerError = -3;
251#[doc = " No such file"]
252pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_NO_FILE: cubeProgrammerError = -4;
253#[doc = " Operation not supported or unimplemented on this interface"]
254pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_NOT_SUPPORTED: cubeProgrammerError = -5;
255#[doc = " Interface not supported or unimplemented on this plateform"]
256pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_INTERFACE_NOT_SUPPORTED: cubeProgrammerError =
257 -6;
258#[doc = " Insufficient memory"]
259pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_NO_MEM: cubeProgrammerError = -7;
260#[doc = " Wrong parameters"]
261pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_WRONG_PARAM: cubeProgrammerError = -8;
262#[doc = " Memory read failure"]
263pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_READ_MEM: cubeProgrammerError = -9;
264#[doc = " Memory write failure"]
265pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_WRITE_MEM: cubeProgrammerError = -10;
266#[doc = " Memory erase failure"]
267pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_ERASE_MEM: cubeProgrammerError = -11;
268#[doc = " File format not supported for this kind of device"]
269pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_UNSUPPORTED_FILE_FORMAT: cubeProgrammerError =
270 -12;
271#[doc = " Refresh required"]
272pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_REFRESH_REQUIRED: cubeProgrammerError = -13;
273#[doc = " Refresh required"]
274pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_NO_SECURITY: cubeProgrammerError = -14;
275#[doc = " Changing frequency problem"]
276pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_CHANGE_FREQ: cubeProgrammerError = -15;
277#[doc = " RDP Enabled error"]
278pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_RDP_ENABLED: cubeProgrammerError = -16;
279#[doc = " Other error"]
280pub const cubeProgrammerError_CUBEPROGRAMMER_ERROR_OTHER: cubeProgrammerError = -99;
281#[doc = " \\enum cubeProgrammerError\n \\brief List of errors that can be occured."]
282pub type cubeProgrammerError = ::std::os::raw::c_int;
283pub const flashSize_Flash_Size_1KB: flashSize = 1024;
284pub const flashSize_Flash_Size_512KB: flashSize = 524288;
285pub const flashSize_Flash_Size_256KB: flashSize = 262144;
286pub type flashSize = ::std::os::raw::c_uint;
287pub const wbFunctionArguments_FIRST_INSTALL_ACTIVE: wbFunctionArguments = 1;
288pub const wbFunctionArguments_FIRST_INSTALL_NOT_ACTIVE: wbFunctionArguments = 0;
289pub const wbFunctionArguments_START_STACK_ACTIVE: wbFunctionArguments = 1;
290pub const wbFunctionArguments_START_STACK_NOT_ACTIVE: wbFunctionArguments = 1;
291pub const wbFunctionArguments_VERIFY_FILE_DOWLOAD_FILE: wbFunctionArguments = 1;
292pub const wbFunctionArguments_DO_NOT_VERIFY_DOWLOAD_FILE: wbFunctionArguments = 0;
293pub type wbFunctionArguments = ::std::os::raw::c_uint;
294#[doc = "< Even parity bit."]
295pub const usartParity_EVEN: usartParity = 0;
296#[doc = "< Odd parity bit."]
297pub const usartParity_ODD: usartParity = 1;
298#[doc = "< No check parity."]
299pub const usartParity_NONE: usartParity = 2;
300#[doc = " \\enum usartParity\n \\brief The parity bit in the data frame of the USART communication tells the receiving device if there is any error in the data bits."]
301pub type usartParity = ::std::os::raw::c_uint;
302#[doc = "< No flow control."]
303pub const usartFlowControl_OFF: usartFlowControl = 0;
304#[doc = "< Hardware flow control : RTS/CTS."]
305pub const usartFlowControl_HARDWARE: usartFlowControl = 1;
306#[doc = "< Software flow control : Transmission is started and stopped by sending special characters."]
307pub const usartFlowControl_SOFTWARE: usartFlowControl = 2;
308#[doc = " \\enum usartFlowControl\n \\brief UART Flow Control is a method for devices to communicate with each other over UART without the risk of losing data."]
309pub type usartFlowControl = ::std::os::raw::c_uint;
310#[doc = " \\struct dfuDeviceInfo\n \\brief Get DFU device informations ."]
311#[repr(C)]
312#[derive(Debug, Copy, Clone)]
313pub struct dfuDeviceInfo {
314 #[doc = "< USB index."]
315 pub usbIndex: [::std::os::raw::c_char; 10usize],
316 #[doc = "< Bus number."]
317 pub busNumber: ::std::os::raw::c_int,
318 #[doc = "< Address number."]
319 pub addressNumber: ::std::os::raw::c_int,
320 #[doc = "< Product number."]
321 pub productId: [::std::os::raw::c_char; 100usize],
322 #[doc = "< Serial number."]
323 pub serialNumber: [::std::os::raw::c_char; 100usize],
324 #[doc = "< DFU version."]
325 pub dfuVersion: ::std::os::raw::c_uint,
326}
327#[allow(clippy::unnecessary_operation, clippy::identity_op)]
328const _: () = {
329 ["Size of dfuDeviceInfo"][::std::mem::size_of::<dfuDeviceInfo>() - 224usize];
330 ["Alignment of dfuDeviceInfo"][::std::mem::align_of::<dfuDeviceInfo>() - 4usize];
331 ["Offset of field: dfuDeviceInfo::usbIndex"]
332 [::std::mem::offset_of!(dfuDeviceInfo, usbIndex) - 0usize];
333 ["Offset of field: dfuDeviceInfo::busNumber"]
334 [::std::mem::offset_of!(dfuDeviceInfo, busNumber) - 12usize];
335 ["Offset of field: dfuDeviceInfo::addressNumber"]
336 [::std::mem::offset_of!(dfuDeviceInfo, addressNumber) - 16usize];
337 ["Offset of field: dfuDeviceInfo::productId"]
338 [::std::mem::offset_of!(dfuDeviceInfo, productId) - 20usize];
339 ["Offset of field: dfuDeviceInfo::serialNumber"]
340 [::std::mem::offset_of!(dfuDeviceInfo, serialNumber) - 120usize];
341 ["Offset of field: dfuDeviceInfo::dfuVersion"]
342 [::std::mem::offset_of!(dfuDeviceInfo, dfuVersion) - 220usize];
343};
344#[doc = " \\struct usartConnectParameters\n \\brief Specify the USART connect parameters."]
345#[repr(C)]
346#[derive(Debug, Copy, Clone)]
347pub struct usartConnectParameters {
348 #[doc = "< Interface identifier: COM1, COM2, /dev/ttyS0..."]
349 pub portName: [::std::os::raw::c_char; 100usize],
350 #[doc = "< Speed transmission: 115200, 9600..."]
351 pub baudrate: ::std::os::raw::c_uint,
352 #[doc = "< Parity bit: value in usartParity."]
353 pub parity: usartParity,
354 #[doc = "< Data bit: value in {6, 7, 8}."]
355 pub dataBits: ::std::os::raw::c_uchar,
356 #[doc = "< Stop bit: value in {1, 1.5, 2}."]
357 pub stopBits: f32,
358 #[doc = "< Flow control: value in usartFlowControl."]
359 pub flowControl: usartFlowControl,
360 #[doc = "< RTS: Value in {0,1}."]
361 pub statusRTS: ::std::os::raw::c_int,
362 #[doc = "< DTR: Value in {0,1}."]
363 pub statusDTR: ::std::os::raw::c_int,
364 #[doc = "< Set No Init bits: value in {0,1}."]
365 pub noinitBits: ::std::os::raw::c_uchar,
366 #[doc = "< request a read unprotect: value in {0,1}."]
367 pub rdu: ::std::os::raw::c_char,
368 #[doc = "< request a TZEN regression: value in {0,1}."]
369 pub tzenreg: ::std::os::raw::c_char,
370}
371#[allow(clippy::unnecessary_operation, clippy::identity_op)]
372const _: () = {
373 ["Size of usartConnectParameters"][::std::mem::size_of::<usartConnectParameters>() - 132usize];
374 ["Alignment of usartConnectParameters"]
375 [::std::mem::align_of::<usartConnectParameters>() - 4usize];
376 ["Offset of field: usartConnectParameters::portName"]
377 [::std::mem::offset_of!(usartConnectParameters, portName) - 0usize];
378 ["Offset of field: usartConnectParameters::baudrate"]
379 [::std::mem::offset_of!(usartConnectParameters, baudrate) - 100usize];
380 ["Offset of field: usartConnectParameters::parity"]
381 [::std::mem::offset_of!(usartConnectParameters, parity) - 104usize];
382 ["Offset of field: usartConnectParameters::dataBits"]
383 [::std::mem::offset_of!(usartConnectParameters, dataBits) - 108usize];
384 ["Offset of field: usartConnectParameters::stopBits"]
385 [::std::mem::offset_of!(usartConnectParameters, stopBits) - 112usize];
386 ["Offset of field: usartConnectParameters::flowControl"]
387 [::std::mem::offset_of!(usartConnectParameters, flowControl) - 116usize];
388 ["Offset of field: usartConnectParameters::statusRTS"]
389 [::std::mem::offset_of!(usartConnectParameters, statusRTS) - 120usize];
390 ["Offset of field: usartConnectParameters::statusDTR"]
391 [::std::mem::offset_of!(usartConnectParameters, statusDTR) - 124usize];
392 ["Offset of field: usartConnectParameters::noinitBits"]
393 [::std::mem::offset_of!(usartConnectParameters, noinitBits) - 128usize];
394 ["Offset of field: usartConnectParameters::rdu"]
395 [::std::mem::offset_of!(usartConnectParameters, rdu) - 129usize];
396 ["Offset of field: usartConnectParameters::tzenreg"]
397 [::std::mem::offset_of!(usartConnectParameters, tzenreg) - 130usize];
398};
399#[doc = " \\struct dfuConnectParameters\n \\brief Specify the USB DFU connect parameters."]
400#[repr(C)]
401#[derive(Debug, Copy, Clone)]
402pub struct dfuConnectParameters {
403 pub usb_index: *mut ::std::os::raw::c_char,
404 #[doc = "< request a read unprotect: value in {0,1}."]
405 pub rdu: ::std::os::raw::c_char,
406 #[doc = "< request a TZEN regression: value in {0,1}."]
407 pub tzenreg: ::std::os::raw::c_char,
408}
409#[allow(clippy::unnecessary_operation, clippy::identity_op)]
410const _: () = {
411 ["Size of dfuConnectParameters"][::std::mem::size_of::<dfuConnectParameters>() - 16usize];
412 ["Alignment of dfuConnectParameters"][::std::mem::align_of::<dfuConnectParameters>() - 8usize];
413 ["Offset of field: dfuConnectParameters::usb_index"]
414 [::std::mem::offset_of!(dfuConnectParameters, usb_index) - 0usize];
415 ["Offset of field: dfuConnectParameters::rdu"]
416 [::std::mem::offset_of!(dfuConnectParameters, rdu) - 8usize];
417 ["Offset of field: dfuConnectParameters::tzenreg"]
418 [::std::mem::offset_of!(dfuConnectParameters, tzenreg) - 9usize];
419};
420#[doc = " \\struct spiConnectParameters\n \\brief Specify the SPI connect parameters.\n \\note Recommended SPI parameters : baudrate=375, crcPol=7, direction=0, cpha=0, cpol=0, crc=0, firstBit=1, frameFormat=0, dataSize=1, mode=1, nss=1, nssPulse=1, delay=1"]
421#[repr(C)]
422#[derive(Debug, Copy, Clone)]
423pub struct spiConnectParameters {
424 #[doc = "< Speed transmission 187, 375, 750, 1500, 3000, 6000, 12000 KHz."]
425 pub baudrate: u32,
426 #[doc = "< crc polynom value."]
427 pub crcPol: u16,
428 #[doc = "< 2LFullDuplex/2LRxOnly/1LRx/1LTx."]
429 pub direction: ::std::os::raw::c_int,
430 #[doc = "< 1Edge or 2Edge."]
431 pub cpha: ::std::os::raw::c_int,
432 #[doc = "< LOW or HIGH."]
433 pub cpol: ::std::os::raw::c_int,
434 #[doc = "< DISABLE or ENABLE."]
435 pub crc: ::std::os::raw::c_int,
436 #[doc = "< First bit: LSB or MSB."]
437 pub firstBit: ::std::os::raw::c_int,
438 #[doc = "< Frame format: Motorola or TI."]
439 pub frameFormat: ::std::os::raw::c_int,
440 #[doc = "< Size of frame data: 16bit or 8bit ."]
441 pub dataSize: ::std::os::raw::c_int,
442 #[doc = "< Operating mode: Slave or Master."]
443 pub mode: ::std::os::raw::c_int,
444 #[doc = "< Selection: Soft or Hard."]
445 pub nss: ::std::os::raw::c_int,
446 #[doc = "< NSS pulse: No Pulse or Pulse."]
447 pub nssPulse: ::std::os::raw::c_int,
448 #[doc = "< Delay of few microseconds, No Delay or Delay, at least 4us delay is inserted"]
449 pub delay: ::std::os::raw::c_int,
450}
451#[allow(clippy::unnecessary_operation, clippy::identity_op)]
452const _: () = {
453 ["Size of spiConnectParameters"][::std::mem::size_of::<spiConnectParameters>() - 52usize];
454 ["Alignment of spiConnectParameters"][::std::mem::align_of::<spiConnectParameters>() - 4usize];
455 ["Offset of field: spiConnectParameters::baudrate"]
456 [::std::mem::offset_of!(spiConnectParameters, baudrate) - 0usize];
457 ["Offset of field: spiConnectParameters::crcPol"]
458 [::std::mem::offset_of!(spiConnectParameters, crcPol) - 4usize];
459 ["Offset of field: spiConnectParameters::direction"]
460 [::std::mem::offset_of!(spiConnectParameters, direction) - 8usize];
461 ["Offset of field: spiConnectParameters::cpha"]
462 [::std::mem::offset_of!(spiConnectParameters, cpha) - 12usize];
463 ["Offset of field: spiConnectParameters::cpol"]
464 [::std::mem::offset_of!(spiConnectParameters, cpol) - 16usize];
465 ["Offset of field: spiConnectParameters::crc"]
466 [::std::mem::offset_of!(spiConnectParameters, crc) - 20usize];
467 ["Offset of field: spiConnectParameters::firstBit"]
468 [::std::mem::offset_of!(spiConnectParameters, firstBit) - 24usize];
469 ["Offset of field: spiConnectParameters::frameFormat"]
470 [::std::mem::offset_of!(spiConnectParameters, frameFormat) - 28usize];
471 ["Offset of field: spiConnectParameters::dataSize"]
472 [::std::mem::offset_of!(spiConnectParameters, dataSize) - 32usize];
473 ["Offset of field: spiConnectParameters::mode"]
474 [::std::mem::offset_of!(spiConnectParameters, mode) - 36usize];
475 ["Offset of field: spiConnectParameters::nss"]
476 [::std::mem::offset_of!(spiConnectParameters, nss) - 40usize];
477 ["Offset of field: spiConnectParameters::nssPulse"]
478 [::std::mem::offset_of!(spiConnectParameters, nssPulse) - 44usize];
479 ["Offset of field: spiConnectParameters::delay"]
480 [::std::mem::offset_of!(spiConnectParameters, delay) - 48usize];
481};
482#[doc = " \\struct canConnectParameters\n \\brief Specify the CAN connect parameters.\n \\note Not all configurations are supported by STM32 Bootloader, such as CAN type is STANDARD and the filter should be always activated.\n \\note Recommended CAN parameters : br=125000, mode=0, ide=0, rtr=0, fifo=0, fm=0, fs=1, fe=1, fbn=0"]
483#[repr(C)]
484#[derive(Debug, Copy, Clone)]
485pub struct canConnectParameters {
486 #[doc = "< Baudrate and speed transmission 125KHz, 250KHz, 500KHz..."]
487 pub br: ::std::os::raw::c_int,
488 #[doc = "< CAN mode: NORMAL, LOOPBACK...,"]
489 pub mode: ::std::os::raw::c_int,
490 #[doc = "< CAN type: STANDARD or EXTENDED."]
491 pub ide: ::std::os::raw::c_int,
492 #[doc = "< Frame format: DATA or REMOTE."]
493 pub rtr: ::std::os::raw::c_int,
494 #[doc = "< Memory of received messages: FIFO0 or FIFO1."]
495 pub fifo: ::std::os::raw::c_int,
496 #[doc = "< Filter mode: MASK or LIST."]
497 pub fm: ::std::os::raw::c_int,
498 #[doc = "< Filter scale: 16 or 32."]
499 pub fs: ::std::os::raw::c_int,
500 #[doc = "< Filter activation: DISABLE or ENABLE."]
501 pub fe: ::std::os::raw::c_int,
502 #[doc = "< Filter bank number: 0 to 13."]
503 pub fbn: ::std::os::raw::c_char,
504}
505#[allow(clippy::unnecessary_operation, clippy::identity_op)]
506const _: () = {
507 ["Size of canConnectParameters"][::std::mem::size_of::<canConnectParameters>() - 36usize];
508 ["Alignment of canConnectParameters"][::std::mem::align_of::<canConnectParameters>() - 4usize];
509 ["Offset of field: canConnectParameters::br"]
510 [::std::mem::offset_of!(canConnectParameters, br) - 0usize];
511 ["Offset of field: canConnectParameters::mode"]
512 [::std::mem::offset_of!(canConnectParameters, mode) - 4usize];
513 ["Offset of field: canConnectParameters::ide"]
514 [::std::mem::offset_of!(canConnectParameters, ide) - 8usize];
515 ["Offset of field: canConnectParameters::rtr"]
516 [::std::mem::offset_of!(canConnectParameters, rtr) - 12usize];
517 ["Offset of field: canConnectParameters::fifo"]
518 [::std::mem::offset_of!(canConnectParameters, fifo) - 16usize];
519 ["Offset of field: canConnectParameters::fm"]
520 [::std::mem::offset_of!(canConnectParameters, fm) - 20usize];
521 ["Offset of field: canConnectParameters::fs"]
522 [::std::mem::offset_of!(canConnectParameters, fs) - 24usize];
523 ["Offset of field: canConnectParameters::fe"]
524 [::std::mem::offset_of!(canConnectParameters, fe) - 28usize];
525 ["Offset of field: canConnectParameters::fbn"]
526 [::std::mem::offset_of!(canConnectParameters, fbn) - 32usize];
527};
528#[doc = " \\struct i2cConnectParameters\n \\brief Specify the I2C connect parameters.\n \\warning The Bootloader Slave address varies depending on the device (see AN2606).\n \\note Not all configurations are supported by STM32 Bootloader, such as address in 7 bits form, analog filter: ENABLE, digital filter: DISABLE.\n \\note Recommended I2C parameters : add=0x??, br=400, sm=1, am=0, af=1, df=0, dnf=0, rt=0, ft=0"]
529#[repr(C)]
530#[derive(Debug, Copy, Clone)]
531pub struct i2cConnectParameters {
532 #[doc = "< Device address in hex format."]
533 pub add: ::std::os::raw::c_int,
534 #[doc = "< Baudrate and speed transmission : 100 or 400 KHz."]
535 pub br: ::std::os::raw::c_int,
536 #[doc = "< Speed Mode: STANDARD or FAST."]
537 pub sm: ::std::os::raw::c_int,
538 #[doc = "< Address Mode: 7 or 10 bits."]
539 pub am: ::std::os::raw::c_int,
540 #[doc = "< Analog filter: DISABLE or ENABLE."]
541 pub af: ::std::os::raw::c_int,
542 #[doc = "< Digital filter: DISABLE or ENABLE."]
543 pub df: ::std::os::raw::c_int,
544 #[doc = "< Digital noise filter: 0 to 15."]
545 pub dnf: ::std::os::raw::c_char,
546 #[doc = "< Rise time: 0-1000 for STANDARD speed mode and 0-300 for FAST."]
547 pub rt: ::std::os::raw::c_int,
548 #[doc = "< Fall time: 0-300 for STANDARD speed mode and 0-300 for FAST."]
549 pub ft: ::std::os::raw::c_int,
550}
551#[allow(clippy::unnecessary_operation, clippy::identity_op)]
552const _: () = {
553 ["Size of i2cConnectParameters"][::std::mem::size_of::<i2cConnectParameters>() - 36usize];
554 ["Alignment of i2cConnectParameters"][::std::mem::align_of::<i2cConnectParameters>() - 4usize];
555 ["Offset of field: i2cConnectParameters::add"]
556 [::std::mem::offset_of!(i2cConnectParameters, add) - 0usize];
557 ["Offset of field: i2cConnectParameters::br"]
558 [::std::mem::offset_of!(i2cConnectParameters, br) - 4usize];
559 ["Offset of field: i2cConnectParameters::sm"]
560 [::std::mem::offset_of!(i2cConnectParameters, sm) - 8usize];
561 ["Offset of field: i2cConnectParameters::am"]
562 [::std::mem::offset_of!(i2cConnectParameters, am) - 12usize];
563 ["Offset of field: i2cConnectParameters::af"]
564 [::std::mem::offset_of!(i2cConnectParameters, af) - 16usize];
565 ["Offset of field: i2cConnectParameters::df"]
566 [::std::mem::offset_of!(i2cConnectParameters, df) - 20usize];
567 ["Offset of field: i2cConnectParameters::dnf"]
568 [::std::mem::offset_of!(i2cConnectParameters, dnf) - 24usize];
569 ["Offset of field: i2cConnectParameters::rt"]
570 [::std::mem::offset_of!(i2cConnectParameters, rt) - 28usize];
571 ["Offset of field: i2cConnectParameters::ft"]
572 [::std::mem::offset_of!(i2cConnectParameters, ft) - 32usize];
573};
574#[doc = "< Apply a reset by the software."]
575pub const debugResetMode_SOFTWARE_RESET: debugResetMode = 0;
576#[doc = "< Apply a reset by the hardware."]
577pub const debugResetMode_HARDWARE_RESET: debugResetMode = 1;
578#[doc = "< Apply a reset by the internal core peripheral."]
579pub const debugResetMode_CORE_RESET: debugResetMode = 2;
580#[doc = " \\enum debugResetMode\n \\brief Choose the way to apply a system reset."]
581pub type debugResetMode = ::std::os::raw::c_uint;
582#[doc = "< Connect with normal mode, the target is reset then halted while the type of reset is selected using the [debugResetMode]."]
583pub const debugConnectMode_NORMAL_MODE: debugConnectMode = 0;
584#[doc = "< Connect with hotplug mode, this option allows the user to connect to the target without halt or reset."]
585pub const debugConnectMode_HOTPLUG_MODE: debugConnectMode = 1;
586#[doc = "< Connect with under reset mode, option allows the user to connect to the target using a reset vector catch before executing any instruction."]
587pub const debugConnectMode_UNDER_RESET_MODE: debugConnectMode = 2;
588#[doc = "< Connect with power down mode."]
589pub const debugConnectMode_POWER_DOWN_MODE: debugConnectMode = 3;
590#[doc = "< Connect with pre reset mode."]
591pub const debugConnectMode_PRE_RESET_MODE: debugConnectMode = 4;
592#[doc = "< Connect with hwRstPulse mode."]
593pub const debugConnectMode_hwRstPulse_MODE: debugConnectMode = 5;
594#[doc = " \\enum debugConnectMode\n \\brief Choose the appropriate mode for connection."]
595pub type debugConnectMode = ::std::os::raw::c_uint;
596#[doc = "< JTAG debug port."]
597pub const debugPort_JTAG: debugPort = 0;
598#[doc = "< SWD debug port."]
599pub const debugPort_SWD: debugPort = 1;
600#[doc = " \\enum debugPort\n \\brief Select the debug port interface for connection."]
601pub type debugPort = ::std::os::raw::c_uint;
602#[doc = " \\struct frequencies\n \\brief Get supported frequencies for JTAG and SWD ineterfaces."]
603#[repr(C)]
604#[derive(Debug, Copy, Clone)]
605pub struct frequencies {
606 #[doc = "< JTAG frequency."]
607 pub jtagFreq: [::std::os::raw::c_uint; 12usize],
608 #[doc = "< Get JTAG supported frequencies."]
609 pub jtagFreqNumber: ::std::os::raw::c_uint,
610 #[doc = "< SWD frequency."]
611 pub swdFreq: [::std::os::raw::c_uint; 12usize],
612 #[doc = "< Get SWD supported frequencies."]
613 pub swdFreqNumber: ::std::os::raw::c_uint,
614}
615#[allow(clippy::unnecessary_operation, clippy::identity_op)]
616const _: () = {
617 ["Size of frequencies"][::std::mem::size_of::<frequencies>() - 104usize];
618 ["Alignment of frequencies"][::std::mem::align_of::<frequencies>() - 4usize];
619 ["Offset of field: frequencies::jtagFreq"]
620 [::std::mem::offset_of!(frequencies, jtagFreq) - 0usize];
621 ["Offset of field: frequencies::jtagFreqNumber"]
622 [::std::mem::offset_of!(frequencies, jtagFreqNumber) - 48usize];
623 ["Offset of field: frequencies::swdFreq"]
624 [::std::mem::offset_of!(frequencies, swdFreq) - 52usize];
625 ["Offset of field: frequencies::swdFreqNumber"]
626 [::std::mem::offset_of!(frequencies, swdFreqNumber) - 100usize];
627};
628#[doc = " \\struct debugConnectParameters\n \\brief Get device characterization and specify connection parameters through ST-LINK interface."]
629#[repr(C)]
630#[derive(Debug, Copy, Clone)]
631pub struct debugConnectParameters {
632 #[doc = "< Select the type of debug interface #debugPort."]
633 pub dbgPort: debugPort,
634 #[doc = "< Select one of the debug ports connected."]
635 pub index: ::std::os::raw::c_int,
636 #[doc = "< ST-LINK serial number."]
637 pub serialNumber: [::std::os::raw::c_char; 33usize],
638 #[doc = "< Firmware version."]
639 pub firmwareVersion: [::std::os::raw::c_char; 20usize],
640 #[doc = "< Operate voltage."]
641 pub targetVoltage: [::std::os::raw::c_char; 5usize],
642 #[doc = "< Number of available access port."]
643 pub accessPortNumber: ::std::os::raw::c_int,
644 #[doc = "< Select access port controller."]
645 pub accessPort: ::std::os::raw::c_int,
646 #[doc = "< Select the debug CONNECT mode #debugConnectMode."]
647 pub connectionMode: debugConnectMode,
648 #[doc = "< Select the debug RESET mode #debugResetMode."]
649 pub resetMode: debugResetMode,
650 #[doc = "< Check Old ST-LINK firmware version."]
651 pub isOldFirmware: ::std::os::raw::c_int,
652 #[doc = "< Supported frequencies #frequencies."]
653 pub freq: frequencies,
654 #[doc = "< Select specific frequency."]
655 pub frequency: ::std::os::raw::c_int,
656 #[doc = "< Indicates if it's Bridge device or not."]
657 pub isBridge: ::std::os::raw::c_int,
658 #[doc = "< Select connection type, if it's shared, use ST-LINK Server."]
659 pub shared: ::std::os::raw::c_int,
660 #[doc = "< board Name"]
661 pub board: [::std::os::raw::c_char; 100usize],
662 pub DBG_Sleep: ::std::os::raw::c_int,
663 #[doc = "< Select speed flashing of Cortex M33 series."]
664 pub speed: ::std::os::raw::c_int,
665}
666#[allow(clippy::unnecessary_operation, clippy::identity_op)]
667const _: () = {
668 ["Size of debugConnectParameters"][::std::mem::size_of::<debugConnectParameters>() - 312usize];
669 ["Alignment of debugConnectParameters"]
670 [::std::mem::align_of::<debugConnectParameters>() - 4usize];
671 ["Offset of field: debugConnectParameters::dbgPort"]
672 [::std::mem::offset_of!(debugConnectParameters, dbgPort) - 0usize];
673 ["Offset of field: debugConnectParameters::index"]
674 [::std::mem::offset_of!(debugConnectParameters, index) - 4usize];
675 ["Offset of field: debugConnectParameters::serialNumber"]
676 [::std::mem::offset_of!(debugConnectParameters, serialNumber) - 8usize];
677 ["Offset of field: debugConnectParameters::firmwareVersion"]
678 [::std::mem::offset_of!(debugConnectParameters, firmwareVersion) - 41usize];
679 ["Offset of field: debugConnectParameters::targetVoltage"]
680 [::std::mem::offset_of!(debugConnectParameters, targetVoltage) - 61usize];
681 ["Offset of field: debugConnectParameters::accessPortNumber"]
682 [::std::mem::offset_of!(debugConnectParameters, accessPortNumber) - 68usize];
683 ["Offset of field: debugConnectParameters::accessPort"]
684 [::std::mem::offset_of!(debugConnectParameters, accessPort) - 72usize];
685 ["Offset of field: debugConnectParameters::connectionMode"]
686 [::std::mem::offset_of!(debugConnectParameters, connectionMode) - 76usize];
687 ["Offset of field: debugConnectParameters::resetMode"]
688 [::std::mem::offset_of!(debugConnectParameters, resetMode) - 80usize];
689 ["Offset of field: debugConnectParameters::isOldFirmware"]
690 [::std::mem::offset_of!(debugConnectParameters, isOldFirmware) - 84usize];
691 ["Offset of field: debugConnectParameters::freq"]
692 [::std::mem::offset_of!(debugConnectParameters, freq) - 88usize];
693 ["Offset of field: debugConnectParameters::frequency"]
694 [::std::mem::offset_of!(debugConnectParameters, frequency) - 192usize];
695 ["Offset of field: debugConnectParameters::isBridge"]
696 [::std::mem::offset_of!(debugConnectParameters, isBridge) - 196usize];
697 ["Offset of field: debugConnectParameters::shared"]
698 [::std::mem::offset_of!(debugConnectParameters, shared) - 200usize];
699 ["Offset of field: debugConnectParameters::board"]
700 [::std::mem::offset_of!(debugConnectParameters, board) - 204usize];
701 ["Offset of field: debugConnectParameters::DBG_Sleep"]
702 [::std::mem::offset_of!(debugConnectParameters, DBG_Sleep) - 304usize];
703 ["Offset of field: debugConnectParameters::speed"]
704 [::std::mem::offset_of!(debugConnectParameters, speed) - 308usize];
705};
706#[doc = "< STLINK used as connection interface."]
707pub const targetInterfaceType_STLINK_INTERFACE: targetInterfaceType = 0;
708#[doc = "< USART used as connection interface."]
709pub const targetInterfaceType_USART_INTERFACE: targetInterfaceType = 1;
710#[doc = "< USB DFU used as connection interface."]
711pub const targetInterfaceType_USB_INTERFACE: targetInterfaceType = 2;
712#[doc = "< SPI used as connection interface."]
713pub const targetInterfaceType_SPI_INTERFACE: targetInterfaceType = 3;
714#[doc = "< I2C used as connection interface."]
715pub const targetInterfaceType_I2C_INTERFACE: targetInterfaceType = 4;
716#[doc = "< CAN used as connection interface."]
717pub const targetInterfaceType_CAN_INTERFACE: targetInterfaceType = 5;
718#[doc = "< JLINK used as connection interface."]
719pub const targetInterfaceType_JLINK_INTERFACE: targetInterfaceType = 6;
720#[doc = " \\enum targetInterfaceType\n \\brief Indicates the supported interfaces."]
721pub type targetInterfaceType = ::std::os::raw::c_uint;
722#[doc = " \\struct displayCallBacks\n \\brief Functions must be implemented to personalize the display of messages."]
723#[repr(C)]
724#[derive(Debug, Copy, Clone)]
725pub struct displayCallBacks {
726 #[doc = "< Add a progress bar."]
727 pub initProgressBar: ::std::option::Option<unsafe extern "C" fn()>,
728 #[doc = "< Display internal messages according to verbosity level."]
729 pub logMessage: ::std::option::Option<
730 unsafe extern "C" fn(msgType: ::std::os::raw::c_int, str_: *const u32),
731 >,
732 #[doc = "< Display the loading of read/write process."]
733 pub loadBar: ::std::option::Option<
734 unsafe extern "C" fn(x: ::std::os::raw::c_int, n: ::std::os::raw::c_int),
735 >,
736}
737#[allow(clippy::unnecessary_operation, clippy::identity_op)]
738const _: () = {
739 ["Size of displayCallBacks"][::std::mem::size_of::<displayCallBacks>() - 24usize];
740 ["Alignment of displayCallBacks"][::std::mem::align_of::<displayCallBacks>() - 8usize];
741 ["Offset of field: displayCallBacks::initProgressBar"]
742 [::std::mem::offset_of!(displayCallBacks, initProgressBar) - 0usize];
743 ["Offset of field: displayCallBacks::logMessage"]
744 [::std::mem::offset_of!(displayCallBacks, logMessage) - 8usize];
745 ["Offset of field: displayCallBacks::loadBar"]
746 [::std::mem::offset_of!(displayCallBacks, loadBar) - 16usize];
747};
748#[repr(C)]
749#[derive(Debug, Copy, Clone)]
750pub struct segmentData_C {
751 #[doc = "< Segment start address."]
752 pub address: ::std::os::raw::c_int,
753 #[doc = "< Memory segment size."]
754 pub size: ::std::os::raw::c_int,
755 #[doc = "< Memory segment data."]
756 pub data: *mut ::std::os::raw::c_uchar,
757}
758#[allow(clippy::unnecessary_operation, clippy::identity_op)]
759const _: () = {
760 ["Size of segmentData_C"][::std::mem::size_of::<segmentData_C>() - 16usize];
761 ["Alignment of segmentData_C"][::std::mem::align_of::<segmentData_C>() - 8usize];
762 ["Offset of field: segmentData_C::address"]
763 [::std::mem::offset_of!(segmentData_C, address) - 0usize];
764 ["Offset of field: segmentData_C::size"][::std::mem::offset_of!(segmentData_C, size) - 4usize];
765 ["Offset of field: segmentData_C::data"][::std::mem::offset_of!(segmentData_C, data) - 8usize];
766};
767#[doc = " \\struct FileData_C\n \\brief Get file required informations."]
768#[repr(C)]
769#[derive(Debug, Copy, Clone)]
770pub struct fileData_C {
771 #[doc = "< File extension type."]
772 pub Type: ::std::os::raw::c_int,
773 #[doc = "< Number of required segments."]
774 pub segmentsNbr: ::std::os::raw::c_int,
775 #[doc = "< Segments description."]
776 pub segments: *mut segmentData_C,
777}
778#[allow(clippy::unnecessary_operation, clippy::identity_op)]
779const _: () = {
780 ["Size of fileData_C"][::std::mem::size_of::<fileData_C>() - 16usize];
781 ["Alignment of fileData_C"][::std::mem::align_of::<fileData_C>() - 8usize];
782 ["Offset of field: fileData_C::Type"][::std::mem::offset_of!(fileData_C, Type) - 0usize];
783 ["Offset of field: fileData_C::segmentsNbr"]
784 [::std::mem::offset_of!(fileData_C, segmentsNbr) - 4usize];
785 ["Offset of field: fileData_C::segments"]
786 [::std::mem::offset_of!(fileData_C, segments) - 8usize];
787};
788#[doc = " \\struct GeneralInf\n \\brief Get device general informations."]
789#[repr(C)]
790#[derive(Debug, Copy, Clone)]
791pub struct generalInf {
792 #[doc = "< Device ID."]
793 pub deviceId: ::std::os::raw::c_ushort,
794 #[doc = "< Flash memory size."]
795 pub flashSize: ::std::os::raw::c_int,
796 #[doc = "< Bootloader version"]
797 pub bootloaderVersion: ::std::os::raw::c_int,
798 #[doc = "< Device MCU or MPU."]
799 pub type_: [::std::os::raw::c_char; 4usize],
800 #[doc = "< Cortex CPU."]
801 pub cpu: [::std::os::raw::c_char; 20usize],
802 #[doc = "< Device name."]
803 pub name: [::std::os::raw::c_char; 100usize],
804 #[doc = "< Device serie."]
805 pub series: [::std::os::raw::c_char; 100usize],
806 #[doc = "< Take notice."]
807 pub description: [::std::os::raw::c_char; 150usize],
808 #[doc = "< Revision ID."]
809 pub revisionId: [::std::os::raw::c_char; 8usize],
810 #[doc = "< Board Rpn."]
811 pub board: [::std::os::raw::c_char; 100usize],
812}
813#[allow(clippy::unnecessary_operation, clippy::identity_op)]
814const _: () = {
815 ["Size of generalInf"][::std::mem::size_of::<generalInf>() - 496usize];
816 ["Alignment of generalInf"][::std::mem::align_of::<generalInf>() - 4usize];
817 ["Offset of field: generalInf::deviceId"]
818 [::std::mem::offset_of!(generalInf, deviceId) - 0usize];
819 ["Offset of field: generalInf::flashSize"]
820 [::std::mem::offset_of!(generalInf, flashSize) - 4usize];
821 ["Offset of field: generalInf::bootloaderVersion"]
822 [::std::mem::offset_of!(generalInf, bootloaderVersion) - 8usize];
823 ["Offset of field: generalInf::type_"][::std::mem::offset_of!(generalInf, type_) - 12usize];
824 ["Offset of field: generalInf::cpu"][::std::mem::offset_of!(generalInf, cpu) - 16usize];
825 ["Offset of field: generalInf::name"][::std::mem::offset_of!(generalInf, name) - 36usize];
826 ["Offset of field: generalInf::series"][::std::mem::offset_of!(generalInf, series) - 136usize];
827 ["Offset of field: generalInf::description"]
828 [::std::mem::offset_of!(generalInf, description) - 236usize];
829 ["Offset of field: generalInf::revisionId"]
830 [::std::mem::offset_of!(generalInf, revisionId) - 386usize];
831 ["Offset of field: generalInf::board"][::std::mem::offset_of!(generalInf, board) - 394usize];
832};
833#[doc = " \\struct deviceSector\n \\brief Get device sectors basic informations."]
834#[repr(C)]
835#[derive(Debug, Copy, Clone)]
836pub struct deviceSector {
837 #[doc = "< Number of Sectors."]
838 pub sectorNum: u32,
839 #[doc = "< Sector Size in BYTEs."]
840 pub sectorSize: u32,
841}
842#[allow(clippy::unnecessary_operation, clippy::identity_op)]
843const _: () = {
844 ["Size of deviceSector"][::std::mem::size_of::<deviceSector>() - 8usize];
845 ["Alignment of deviceSector"][::std::mem::align_of::<deviceSector>() - 4usize];
846 ["Offset of field: deviceSector::sectorNum"]
847 [::std::mem::offset_of!(deviceSector, sectorNum) - 0usize];
848 ["Offset of field: deviceSector::sectorSize"]
849 [::std::mem::offset_of!(deviceSector, sectorSize) - 4usize];
850};
851#[doc = " \\struct externalLoader\n \\brief Get external Loader parameters to launch the process of programming an external flash memory."]
852#[repr(C)]
853#[derive(Debug, Copy, Clone)]
854pub struct externalLoader {
855 #[doc = "< FlashLoader file path."]
856 pub filePath: [::std::os::raw::c_char; 200usize],
857 #[doc = "< Device Name and Description."]
858 pub deviceName: [::std::os::raw::c_char; 100usize],
859 #[doc = "< Device Type: ONCHIP, EXT8BIT, EXT16BIT, ..."]
860 pub deviceType: ::std::os::raw::c_int,
861 #[doc = "< Default Device Start Address."]
862 pub deviceStartAddress: u32,
863 #[doc = "< Total Size of Device."]
864 pub deviceSize: u32,
865 #[doc = "< Programming Page Size."]
866 pub pageSize: u32,
867 #[doc = "< Type number."]
868 pub sectorsTypeNbr: u32,
869 #[doc = "< Device sectors."]
870 pub sectors: *mut deviceSector,
871}
872#[allow(clippy::unnecessary_operation, clippy::identity_op)]
873const _: () = {
874 ["Size of externalLoader"][::std::mem::size_of::<externalLoader>() - 328usize];
875 ["Alignment of externalLoader"][::std::mem::align_of::<externalLoader>() - 8usize];
876 ["Offset of field: externalLoader::filePath"]
877 [::std::mem::offset_of!(externalLoader, filePath) - 0usize];
878 ["Offset of field: externalLoader::deviceName"]
879 [::std::mem::offset_of!(externalLoader, deviceName) - 200usize];
880 ["Offset of field: externalLoader::deviceType"]
881 [::std::mem::offset_of!(externalLoader, deviceType) - 300usize];
882 ["Offset of field: externalLoader::deviceStartAddress"]
883 [::std::mem::offset_of!(externalLoader, deviceStartAddress) - 304usize];
884 ["Offset of field: externalLoader::deviceSize"]
885 [::std::mem::offset_of!(externalLoader, deviceSize) - 308usize];
886 ["Offset of field: externalLoader::pageSize"]
887 [::std::mem::offset_of!(externalLoader, pageSize) - 312usize];
888 ["Offset of field: externalLoader::sectorsTypeNbr"]
889 [::std::mem::offset_of!(externalLoader, sectorsTypeNbr) - 316usize];
890 ["Offset of field: externalLoader::sectors"]
891 [::std::mem::offset_of!(externalLoader, sectors) - 320usize];
892};
893#[doc = " \\struct externalStorageInfo\n \\brief Get external storage informations useful for external Loader."]
894#[repr(C)]
895#[derive(Debug, Copy, Clone)]
896pub struct externalStorageInfo {
897 pub externalLoaderNbr: ::std::os::raw::c_uint,
898 pub externalLoader: *mut externalLoader,
899}
900#[allow(clippy::unnecessary_operation, clippy::identity_op)]
901const _: () = {
902 ["Size of externalStorageInfo"][::std::mem::size_of::<externalStorageInfo>() - 16usize];
903 ["Alignment of externalStorageInfo"][::std::mem::align_of::<externalStorageInfo>() - 8usize];
904 ["Offset of field: externalStorageInfo::externalLoaderNbr"]
905 [::std::mem::offset_of!(externalStorageInfo, externalLoaderNbr) - 0usize];
906 ["Offset of field: externalStorageInfo::externalLoader"]
907 [::std::mem::offset_of!(externalStorageInfo, externalLoader) - 8usize];
908};
909pub struct CubeProgrammer_API {
910 __library: ::libloading::Library,
911 pub getStLinkList: Result<
912 unsafe extern "C" fn(
913 stLinkList: *mut *mut debugConnectParameters,
914 shared: ::std::os::raw::c_int,
915 ) -> ::std::os::raw::c_int,
916 ::libloading::Error,
917 >,
918 pub getStLinkEnumerationList: Result<
919 unsafe extern "C" fn(
920 stlink_list: *mut *mut debugConnectParameters,
921 shared: ::std::os::raw::c_int,
922 ) -> ::std::os::raw::c_int,
923 ::libloading::Error,
924 >,
925 pub connectStLink: Result<
926 unsafe extern "C" fn(debugParameters: debugConnectParameters) -> ::std::os::raw::c_int,
927 ::libloading::Error,
928 >,
929 pub reset: Result<
930 unsafe extern "C" fn(rstMode: debugResetMode) -> ::std::os::raw::c_int,
931 ::libloading::Error,
932 >,
933 pub getUsartList: Result<
934 unsafe extern "C" fn(usartList: *mut *mut usartConnectParameters) -> ::std::os::raw::c_int,
935 ::libloading::Error,
936 >,
937 pub connectUsartBootloader: Result<
938 unsafe extern "C" fn(usartParameters: usartConnectParameters) -> ::std::os::raw::c_int,
939 ::libloading::Error,
940 >,
941 pub sendByteUart: Result<
942 unsafe extern "C" fn(byte: ::std::os::raw::c_int) -> ::std::os::raw::c_int,
943 ::libloading::Error,
944 >,
945 pub getDfuDeviceList: Result<
946 unsafe extern "C" fn(
947 dfuList: *mut *mut dfuDeviceInfo,
948 iPID: ::std::os::raw::c_int,
949 iVID: ::std::os::raw::c_int,
950 ) -> ::std::os::raw::c_int,
951 ::libloading::Error,
952 >,
953 pub connectDfuBootloader: Result<
954 unsafe extern "C" fn(usbIndex: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int,
955 ::libloading::Error,
956 >,
957 pub connectDfuBootloader2: Result<
958 unsafe extern "C" fn(dfuParameters: dfuConnectParameters) -> ::std::os::raw::c_int,
959 ::libloading::Error,
960 >,
961 pub connectSpiBootloader: Result<
962 unsafe extern "C" fn(spiParameters: spiConnectParameters) -> ::std::os::raw::c_int,
963 ::libloading::Error,
964 >,
965 pub connectCanBootloader: Result<
966 unsafe extern "C" fn(canParameters: canConnectParameters) -> ::std::os::raw::c_int,
967 ::libloading::Error,
968 >,
969 pub connectI2cBootloader: Result<
970 unsafe extern "C" fn(i2cParameters: i2cConnectParameters) -> ::std::os::raw::c_int,
971 ::libloading::Error,
972 >,
973 pub setDisplayCallbacks: Result<unsafe extern "C" fn(c: displayCallBacks), ::libloading::Error>,
974 pub setVerbosityLevel:
975 Result<unsafe extern "C" fn(level: ::std::os::raw::c_int), ::libloading::Error>,
976 pub checkDeviceConnection:
977 Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
978 pub getDeviceGeneralInf: Result<unsafe extern "C" fn() -> *mut generalInf, ::libloading::Error>,
979 pub readMemory: Result<
980 unsafe extern "C" fn(
981 address: ::std::os::raw::c_uint,
982 data: *mut *mut ::std::os::raw::c_uchar,
983 size: ::std::os::raw::c_uint,
984 ) -> ::std::os::raw::c_int,
985 ::libloading::Error,
986 >,
987 pub writeMemory: Result<
988 unsafe extern "C" fn(
989 address: ::std::os::raw::c_uint,
990 data: *mut ::std::os::raw::c_char,
991 size: ::std::os::raw::c_uint,
992 ) -> ::std::os::raw::c_int,
993 ::libloading::Error,
994 >,
995 pub editSector: Result<
996 unsafe extern "C" fn(
997 address: ::std::os::raw::c_uint,
998 data: *mut ::std::os::raw::c_char,
999 size: ::std::os::raw::c_uint,
1000 ) -> ::std::os::raw::c_int,
1001 ::libloading::Error,
1002 >,
1003 pub downloadFile: Result<
1004 unsafe extern "C" fn(
1005 filePath: *const u32,
1006 address: ::std::os::raw::c_uint,
1007 skipErase: ::std::os::raw::c_uint,
1008 verify: ::std::os::raw::c_uint,
1009 binPath: *const u32,
1010 ) -> ::std::os::raw::c_int,
1011 ::libloading::Error,
1012 >,
1013 pub execute: Result<
1014 unsafe extern "C" fn(address: ::std::os::raw::c_uint) -> ::std::os::raw::c_int,
1015 ::libloading::Error,
1016 >,
1017 pub massErase: Result<
1018 unsafe extern "C" fn(sFlashMemName: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int,
1019 ::libloading::Error,
1020 >,
1021 pub sectorErase: Result<
1022 unsafe extern "C" fn(
1023 sectors: *mut ::std::os::raw::c_uint,
1024 sectorNbr: ::std::os::raw::c_uint,
1025 sFlashMemName: *mut ::std::os::raw::c_char,
1026 ) -> ::std::os::raw::c_int,
1027 ::libloading::Error,
1028 >,
1029 pub readUnprotect: Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1030 pub tzenRegression:
1031 Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1032 pub getTargetInterfaceType:
1033 Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1034 pub getCancelPointer:
1035 Result<unsafe extern "C" fn() -> *mut ::std::os::raw::c_int, ::libloading::Error>,
1036 pub fileOpen: Result<
1037 unsafe extern "C" fn(filePath: *const u32) -> *mut ::std::os::raw::c_void,
1038 ::libloading::Error,
1039 >,
1040 pub freeFileData: Result<unsafe extern "C" fn(data: *mut fileData_C), ::libloading::Error>,
1041 pub freeLibraryMemory:
1042 Result<unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void), ::libloading::Error>,
1043 pub verify: Result<
1044 unsafe extern "C" fn(
1045 fileData: *mut fileData_C,
1046 address: ::std::os::raw::c_uint,
1047 ) -> ::std::os::raw::c_int,
1048 ::libloading::Error,
1049 >,
1050 pub saveFileToFile: Result<
1051 unsafe extern "C" fn(
1052 fileData: *mut fileData_C,
1053 sFileName: *const u32,
1054 ) -> ::std::os::raw::c_int,
1055 ::libloading::Error,
1056 >,
1057 pub saveMemoryToFile: Result<
1058 unsafe extern "C" fn(
1059 address: ::std::os::raw::c_int,
1060 size: ::std::os::raw::c_int,
1061 sFileName: *const u32,
1062 ) -> ::std::os::raw::c_int,
1063 ::libloading::Error,
1064 >,
1065 pub disconnect: Result<unsafe extern "C" fn(), ::libloading::Error>,
1066 pub deleteInterfaceList: Result<unsafe extern "C" fn(), ::libloading::Error>,
1067 pub automaticMode: Result<
1068 unsafe extern "C" fn(
1069 filePath: *const u32,
1070 address: ::std::os::raw::c_uint,
1071 skipErase: ::std::os::raw::c_uint,
1072 verify: ::std::os::raw::c_uint,
1073 isMassErase: ::std::os::raw::c_int,
1074 obCommand: *mut ::std::os::raw::c_char,
1075 run: ::std::os::raw::c_int,
1076 ),
1077 ::libloading::Error,
1078 >,
1079 pub serialNumberingAutomaticMode: Result<
1080 unsafe extern "C" fn(
1081 filePath: *const u32,
1082 address: ::std::os::raw::c_uint,
1083 skipErase: ::std::os::raw::c_uint,
1084 verify: ::std::os::raw::c_uint,
1085 isMassErase: ::std::os::raw::c_int,
1086 obCommand: *mut ::std::os::raw::c_char,
1087 run: ::std::os::raw::c_int,
1088 enableSerialNumbering: ::std::os::raw::c_int,
1089 serialAddress: ::std::os::raw::c_int,
1090 serialSize: ::std::os::raw::c_int,
1091 serialInitialData: *mut ::std::os::raw::c_char,
1092 ),
1093 ::libloading::Error,
1094 >,
1095 pub getStorageStructure: Result<
1096 unsafe extern "C" fn(
1097 deviceStorageStruct: *mut *mut storageStructure,
1098 ) -> ::std::os::raw::c_int,
1099 ::libloading::Error,
1100 >,
1101 pub sendOptionBytesCmd: Result<
1102 unsafe extern "C" fn(command: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int,
1103 ::libloading::Error,
1104 >,
1105 pub initOptionBytesInterface:
1106 Result<unsafe extern "C" fn() -> *mut peripheral_C, ::libloading::Error>,
1107 pub fastRomInitOptionBytesInterface:
1108 Result<unsafe extern "C" fn(deviceId: u16) -> *mut peripheral_C, ::libloading::Error>,
1109 pub obDisplay: Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1110 pub setLoadersPath:
1111 Result<unsafe extern "C" fn(path: *const ::std::os::raw::c_char), ::libloading::Error>,
1112 pub setExternalLoaderPath: Result<
1113 unsafe extern "C" fn(
1114 path: *const ::std::os::raw::c_char,
1115 externalLoaderInfo: *mut *mut externalLoader,
1116 ),
1117 ::libloading::Error,
1118 >,
1119 pub setExternalLoaderOBL: Result<
1120 unsafe extern "C" fn(
1121 path: *const ::std::os::raw::c_char,
1122 externalLoaderInfo: *mut *mut externalLoader,
1123 ),
1124 ::libloading::Error,
1125 >,
1126 pub getExternalLoaders: Result<
1127 unsafe extern "C" fn(
1128 path: *const ::std::os::raw::c_char,
1129 externalStorageNfo: *mut *mut externalStorageInfo,
1130 ) -> ::std::os::raw::c_int,
1131 ::libloading::Error,
1132 >,
1133 pub removeExternalLoader:
1134 Result<unsafe extern "C" fn(path: *const ::std::os::raw::c_char), ::libloading::Error>,
1135 pub deleteLoaders: Result<unsafe extern "C" fn(), ::libloading::Error>,
1136 pub getUID64: Result<
1137 unsafe extern "C" fn(data: *mut *mut ::std::os::raw::c_uchar) -> ::std::os::raw::c_int,
1138 ::libloading::Error,
1139 >,
1140 pub firmwareDelete:
1141 Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1142 pub firmwareUpgrade: Result<
1143 unsafe extern "C" fn(
1144 filePath: *const u32,
1145 address: ::std::os::raw::c_uint,
1146 firstInstall: ::std::os::raw::c_uint,
1147 startStack: ::std::os::raw::c_uint,
1148 verify: ::std::os::raw::c_uint,
1149 ) -> ::std::os::raw::c_int,
1150 ::libloading::Error,
1151 >,
1152 pub startWirelessStack:
1153 Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1154 pub updateAuthKey: Result<
1155 unsafe extern "C" fn(filePath: *const u32) -> ::std::os::raw::c_int,
1156 ::libloading::Error,
1157 >,
1158 pub authKeyLock: Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1159 pub writeUserKey: Result<
1160 unsafe extern "C" fn(
1161 filePath: *const u32,
1162 keyType: ::std::os::raw::c_uchar,
1163 ) -> ::std::os::raw::c_int,
1164 ::libloading::Error,
1165 >,
1166 pub antiRollBack: Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1167 pub startFus: Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1168 pub unlockchip: Result<unsafe extern "C" fn() -> ::std::os::raw::c_int, ::libloading::Error>,
1169 pub programSsp: Result<
1170 unsafe extern "C" fn(
1171 sspFile: *const u32,
1172 licenseFile: *const u32,
1173 tfaFile: *const u32,
1174 hsmSlotId: ::std::os::raw::c_int,
1175 ) -> ::std::os::raw::c_int,
1176 ::libloading::Error,
1177 >,
1178 pub getHsmFirmwareID: Result<
1179 unsafe extern "C" fn(hsmSlotId: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char,
1180 ::libloading::Error,
1181 >,
1182 pub getHsmCounter: Result<
1183 unsafe extern "C" fn(hsmSlotId: ::std::os::raw::c_int) -> ::std::os::raw::c_ulong,
1184 ::libloading::Error,
1185 >,
1186 pub getHsmState: Result<
1187 unsafe extern "C" fn(hsmSlotId: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char,
1188 ::libloading::Error,
1189 >,
1190 pub getHsmVersion: Result<
1191 unsafe extern "C" fn(hsmSlotId: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char,
1192 ::libloading::Error,
1193 >,
1194 pub getHsmType: Result<
1195 unsafe extern "C" fn(hsmSlotId: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char,
1196 ::libloading::Error,
1197 >,
1198 pub getHsmLicense: Result<
1199 unsafe extern "C" fn(
1200 hsmSlotId: ::std::os::raw::c_int,
1201 outLicensePath: *const u32,
1202 ) -> ::std::os::raw::c_int,
1203 ::libloading::Error,
1204 >,
1205 pub writeCortexRegistres: Result<
1206 unsafe extern "C" fn(
1207 reg: ::std::os::raw::c_uint,
1208 data: ::std::os::raw::c_uint,
1209 ) -> ::std::os::raw::c_int,
1210 ::libloading::Error,
1211 >,
1212 pub readCortexReg: Result<
1213 unsafe extern "C" fn(
1214 reg: ::std::os::raw::c_uint,
1215 data: *mut ::std::os::raw::c_uint,
1216 ) -> ::std::os::raw::c_int,
1217 ::libloading::Error,
1218 >,
1219}
1220impl CubeProgrammer_API {
1221 pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
1222 where
1223 P: AsRef<::std::ffi::OsStr>,
1224 {
1225 let library = ::libloading::Library::new(path)?;
1226 Self::from_library(library)
1227 }
1228 pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
1229 where
1230 L: Into<::libloading::Library>,
1231 {
1232 let __library = library.into();
1233 let getStLinkList = __library.get(b"getStLinkList\0").map(|sym| *sym);
1234 let getStLinkEnumerationList = __library.get(b"getStLinkEnumerationList\0").map(|sym| *sym);
1235 let connectStLink = __library.get(b"connectStLink\0").map(|sym| *sym);
1236 let reset = __library.get(b"reset\0").map(|sym| *sym);
1237 let getUsartList = __library.get(b"getUsartList\0").map(|sym| *sym);
1238 let connectUsartBootloader = __library.get(b"connectUsartBootloader\0").map(|sym| *sym);
1239 let sendByteUart = __library.get(b"sendByteUart\0").map(|sym| *sym);
1240 let getDfuDeviceList = __library.get(b"getDfuDeviceList\0").map(|sym| *sym);
1241 let connectDfuBootloader = __library.get(b"connectDfuBootloader\0").map(|sym| *sym);
1242 let connectDfuBootloader2 = __library.get(b"connectDfuBootloader2\0").map(|sym| *sym);
1243 let connectSpiBootloader = __library.get(b"connectSpiBootloader\0").map(|sym| *sym);
1244 let connectCanBootloader = __library.get(b"connectCanBootloader\0").map(|sym| *sym);
1245 let connectI2cBootloader = __library.get(b"connectI2cBootloader\0").map(|sym| *sym);
1246 let setDisplayCallbacks = __library.get(b"setDisplayCallbacks\0").map(|sym| *sym);
1247 let setVerbosityLevel = __library.get(b"setVerbosityLevel\0").map(|sym| *sym);
1248 let checkDeviceConnection = __library.get(b"checkDeviceConnection\0").map(|sym| *sym);
1249 let getDeviceGeneralInf = __library.get(b"getDeviceGeneralInf\0").map(|sym| *sym);
1250 let readMemory = __library.get(b"readMemory\0").map(|sym| *sym);
1251 let writeMemory = __library.get(b"writeMemory\0").map(|sym| *sym);
1252 let editSector = __library.get(b"editSector\0").map(|sym| *sym);
1253 let downloadFile = __library.get(b"downloadFile\0").map(|sym| *sym);
1254 let execute = __library.get(b"execute\0").map(|sym| *sym);
1255 let massErase = __library.get(b"massErase\0").map(|sym| *sym);
1256 let sectorErase = __library.get(b"sectorErase\0").map(|sym| *sym);
1257 let readUnprotect = __library.get(b"readUnprotect\0").map(|sym| *sym);
1258 let tzenRegression = __library.get(b"tzenRegression\0").map(|sym| *sym);
1259 let getTargetInterfaceType = __library.get(b"getTargetInterfaceType\0").map(|sym| *sym);
1260 let getCancelPointer = __library.get(b"getCancelPointer\0").map(|sym| *sym);
1261 let fileOpen = __library.get(b"fileOpen\0").map(|sym| *sym);
1262 let freeFileData = __library.get(b"freeFileData\0").map(|sym| *sym);
1263 let freeLibraryMemory = __library.get(b"freeLibraryMemory\0").map(|sym| *sym);
1264 let verify = __library.get(b"verify\0").map(|sym| *sym);
1265 let saveFileToFile = __library.get(b"saveFileToFile\0").map(|sym| *sym);
1266 let saveMemoryToFile = __library.get(b"saveMemoryToFile\0").map(|sym| *sym);
1267 let disconnect = __library.get(b"disconnect\0").map(|sym| *sym);
1268 let deleteInterfaceList = __library.get(b"deleteInterfaceList\0").map(|sym| *sym);
1269 let automaticMode = __library.get(b"automaticMode\0").map(|sym| *sym);
1270 let serialNumberingAutomaticMode = __library
1271 .get(b"serialNumberingAutomaticMode\0")
1272 .map(|sym| *sym);
1273 let getStorageStructure = __library.get(b"getStorageStructure\0").map(|sym| *sym);
1274 let sendOptionBytesCmd = __library.get(b"sendOptionBytesCmd\0").map(|sym| *sym);
1275 let initOptionBytesInterface = __library.get(b"initOptionBytesInterface\0").map(|sym| *sym);
1276 let fastRomInitOptionBytesInterface = __library
1277 .get(b"fastRomInitOptionBytesInterface\0")
1278 .map(|sym| *sym);
1279 let obDisplay = __library.get(b"obDisplay\0").map(|sym| *sym);
1280 let setLoadersPath = __library.get(b"setLoadersPath\0").map(|sym| *sym);
1281 let setExternalLoaderPath = __library.get(b"setExternalLoaderPath\0").map(|sym| *sym);
1282 let setExternalLoaderOBL = __library.get(b"setExternalLoaderOBL\0").map(|sym| *sym);
1283 let getExternalLoaders = __library.get(b"getExternalLoaders\0").map(|sym| *sym);
1284 let removeExternalLoader = __library.get(b"removeExternalLoader\0").map(|sym| *sym);
1285 let deleteLoaders = __library.get(b"deleteLoaders\0").map(|sym| *sym);
1286 let getUID64 = __library.get(b"getUID64\0").map(|sym| *sym);
1287 let firmwareDelete = __library.get(b"firmwareDelete\0").map(|sym| *sym);
1288 let firmwareUpgrade = __library.get(b"firmwareUpgrade\0").map(|sym| *sym);
1289 let startWirelessStack = __library.get(b"startWirelessStack\0").map(|sym| *sym);
1290 let updateAuthKey = __library.get(b"updateAuthKey\0").map(|sym| *sym);
1291 let authKeyLock = __library.get(b"authKeyLock\0").map(|sym| *sym);
1292 let writeUserKey = __library.get(b"writeUserKey\0").map(|sym| *sym);
1293 let antiRollBack = __library.get(b"antiRollBack\0").map(|sym| *sym);
1294 let startFus = __library.get(b"startFus\0").map(|sym| *sym);
1295 let unlockchip = __library.get(b"unlockchip\0").map(|sym| *sym);
1296 let programSsp = __library.get(b"programSsp\0").map(|sym| *sym);
1297 let getHsmFirmwareID = __library.get(b"getHsmFirmwareID\0").map(|sym| *sym);
1298 let getHsmCounter = __library.get(b"getHsmCounter\0").map(|sym| *sym);
1299 let getHsmState = __library.get(b"getHsmState\0").map(|sym| *sym);
1300 let getHsmVersion = __library.get(b"getHsmVersion\0").map(|sym| *sym);
1301 let getHsmType = __library.get(b"getHsmType\0").map(|sym| *sym);
1302 let getHsmLicense = __library.get(b"getHsmLicense\0").map(|sym| *sym);
1303 let writeCortexRegistres = __library.get(b"writeCortexRegistres\0").map(|sym| *sym);
1304 let readCortexReg = __library.get(b"readCortexReg\0").map(|sym| *sym);
1305 Ok(CubeProgrammer_API {
1306 __library,
1307 getStLinkList,
1308 getStLinkEnumerationList,
1309 connectStLink,
1310 reset,
1311 getUsartList,
1312 connectUsartBootloader,
1313 sendByteUart,
1314 getDfuDeviceList,
1315 connectDfuBootloader,
1316 connectDfuBootloader2,
1317 connectSpiBootloader,
1318 connectCanBootloader,
1319 connectI2cBootloader,
1320 setDisplayCallbacks,
1321 setVerbosityLevel,
1322 checkDeviceConnection,
1323 getDeviceGeneralInf,
1324 readMemory,
1325 writeMemory,
1326 editSector,
1327 downloadFile,
1328 execute,
1329 massErase,
1330 sectorErase,
1331 readUnprotect,
1332 tzenRegression,
1333 getTargetInterfaceType,
1334 getCancelPointer,
1335 fileOpen,
1336 freeFileData,
1337 freeLibraryMemory,
1338 verify,
1339 saveFileToFile,
1340 saveMemoryToFile,
1341 disconnect,
1342 deleteInterfaceList,
1343 automaticMode,
1344 serialNumberingAutomaticMode,
1345 getStorageStructure,
1346 sendOptionBytesCmd,
1347 initOptionBytesInterface,
1348 fastRomInitOptionBytesInterface,
1349 obDisplay,
1350 setLoadersPath,
1351 setExternalLoaderPath,
1352 setExternalLoaderOBL,
1353 getExternalLoaders,
1354 removeExternalLoader,
1355 deleteLoaders,
1356 getUID64,
1357 firmwareDelete,
1358 firmwareUpgrade,
1359 startWirelessStack,
1360 updateAuthKey,
1361 authKeyLock,
1362 writeUserKey,
1363 antiRollBack,
1364 startFus,
1365 unlockchip,
1366 programSsp,
1367 getHsmFirmwareID,
1368 getHsmCounter,
1369 getHsmState,
1370 getHsmVersion,
1371 getHsmType,
1372 getHsmLicense,
1373 writeCortexRegistres,
1374 readCortexReg,
1375 })
1376 }
1377 #[doc = " \\brief This routine allows to get ST-LINK conneted probe(s).\n \\param stLinkList : Filled with the connected ST-LINK list and its default configurations.\n \\param shared : Enable shared mode allowing connection of two or more instances to the same ST-LINK probe.\n \\return Number of the ST-LINK probes already exists.\n \\warning The Share option is useful only with ST-LINK Server.\n \\note At the end of usage, #deleteInterfaceList must have been called."]
1378 pub unsafe fn getStLinkList(
1379 &self,
1380 stLinkList: *mut *mut debugConnectParameters,
1381 shared: ::std::os::raw::c_int,
1382 ) -> ::std::os::raw::c_int {
1383 (self
1384 .getStLinkList
1385 .as_ref()
1386 .expect("Expected function, got error."))(stLinkList, shared)
1387 }
1388 #[doc = " \\brief This routine allows to get ST-LINK conneted probe(s) without connecting and intruse the target.\n \\param stLinkList : Filled with the connected ST-LINK list and its default configurations.\n \\param shared : Enable shared mode allowing connection of two or more instances to the same ST-LINK probe.\n \\return Number of the ST-LINK probes already exists.\n \\warning The Share option is useful only with ST-LINK Server.\n \\note At the end of usage, #deleteInterfaceList must have been called."]
1389 pub unsafe fn getStLinkEnumerationList(
1390 &self,
1391 stlink_list: *mut *mut debugConnectParameters,
1392 shared: ::std::os::raw::c_int,
1393 ) -> ::std::os::raw::c_int {
1394 (self
1395 .getStLinkEnumerationList
1396 .as_ref()
1397 .expect("Expected function, got error."))(stlink_list, shared)
1398 }
1399 #[doc = " \\brief This routine allows to start connection to device through SWD or JTAG interfaces.\n \\param debugParameters : Indicates customized configuration for ST-LINK connection,\n It is recommended to check [debugConnectParameters] fields before connection.\n \\return 0 if the connection successfully established, otherwise an error occurred."]
1400 pub unsafe fn connectStLink(
1401 &self,
1402 debugParameters: debugConnectParameters,
1403 ) -> ::std::os::raw::c_int {
1404 (self
1405 .connectStLink
1406 .as_ref()
1407 .expect("Expected function, got error."))(debugParameters)
1408 }
1409 #[doc = " \\brief This routine used to apply a target reset.\n \\note Reset operation is only available with JTAG/SWD debug interface.\n \\param rstMode : Indicates the reset type Soft/Hard/Core #debugResetMode. \\n\n \\return 0 if the reset operation finished successfully, otherwise an error occurred."]
1410 pub unsafe fn reset(&self, rstMode: debugResetMode) -> ::std::os::raw::c_int {
1411 (self.reset.as_ref().expect("Expected function, got error."))(rstMode)
1412 }
1413 #[doc = " \\brief This routine allows to get connected serial ports.\n \\param usartList : Receive serial ports list and its default configurations.\n \\return Number of serial ports already connected.\n \\note At the end of usage, #deleteInterfaceList must have been called."]
1414 pub unsafe fn getUsartList(
1415 &self,
1416 usartList: *mut *mut usartConnectParameters,
1417 ) -> ::std::os::raw::c_int {
1418 (self
1419 .getUsartList
1420 .as_ref()
1421 .expect("Expected function, got error."))(usartList)
1422 }
1423 #[doc = " \\brief This routine allows to start connection to device through USART interface.\n \\param usartParameters : Indicates customized configuration for USART connection.\n \\return 0 if the connection successfully established, otherwise an error occurred."]
1424 pub unsafe fn connectUsartBootloader(
1425 &self,
1426 usartParameters: usartConnectParameters,
1427 ) -> ::std::os::raw::c_int {
1428 (self
1429 .connectUsartBootloader
1430 .as_ref()
1431 .expect("Expected function, got error."))(usartParameters)
1432 }
1433 #[doc = " \\brief This routine allows to send a single byte through the USART interface.\n \\param byte : The data to be written\n \\return 0 if the sending operation correctly achieved, otherwise an error occurred."]
1434 pub unsafe fn sendByteUart(&self, byte: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
1435 (self
1436 .sendByteUart
1437 .as_ref()
1438 .expect("Expected function, got error."))(byte)
1439 }
1440 #[doc = " \\brief This routine allows to get connected DFU devices.\n \\param dfuList : Receive DFU devices list and its default configurations.\n \\param iPID : Indicate the Product ID to be used for DFU interface.\n \\param iVID : Indicate the Vendor ID to be used for DFU interface.\n \\return Number of DFU devices already connected.\n \\note At the end of usage, #deleteInterfaceList must have been called."]
1441 pub unsafe fn getDfuDeviceList(
1442 &self,
1443 dfuList: *mut *mut dfuDeviceInfo,
1444 iPID: ::std::os::raw::c_int,
1445 iVID: ::std::os::raw::c_int,
1446 ) -> ::std::os::raw::c_int {
1447 (self
1448 .getDfuDeviceList
1449 .as_ref()
1450 .expect("Expected function, got error."))(dfuList, iPID, iVID)
1451 }
1452 #[doc = " \\brief This routine allows to start a simple connection through USB DFU interface.\n \\param usbIndex : Indicates the index of DFU ports already connected.\n \\return 0 if the connection successfully established, otherwise an error occurred."]
1453 pub unsafe fn connectDfuBootloader(
1454 &self,
1455 usbIndex: *mut ::std::os::raw::c_char,
1456 ) -> ::std::os::raw::c_int {
1457 (self
1458 .connectDfuBootloader
1459 .as_ref()
1460 .expect("Expected function, got error."))(usbIndex)
1461 }
1462 #[doc = " \\brief This routine allows to start connection to device through USB DFU interface.\n \\param dfuConnectParameters : Indicates the dfu connection parameters\n \\return 0 if the connection successfully established, otherwise an error occurred.\n \\note It's recommanded to use this routine to disable readout protection when connecting a MCU based device."]
1463 pub unsafe fn connectDfuBootloader2(
1464 &self,
1465 dfuParameters: dfuConnectParameters,
1466 ) -> ::std::os::raw::c_int {
1467 (self
1468 .connectDfuBootloader2
1469 .as_ref()
1470 .expect("Expected function, got error."))(dfuParameters)
1471 }
1472 #[doc = " \\brief This routine allows to start connection to device through SPI interface.\n \\param spiParameters : Indicates customized configuration for SPI connection\n \\return 0 if the connection successfully established, otherwise an error occurred."]
1473 pub unsafe fn connectSpiBootloader(
1474 &self,
1475 spiParameters: spiConnectParameters,
1476 ) -> ::std::os::raw::c_int {
1477 (self
1478 .connectSpiBootloader
1479 .as_ref()
1480 .expect("Expected function, got error."))(spiParameters)
1481 }
1482 #[doc = " \\brief This routine allows to start connection to device through CAN interface.\n \\param canParameters : Indicates customized configuration for CAN connection\n \\return 0 if the connection successfully established, otherwise an error occurred.\n \\warning To have CAN full support, you must have St-Link firmware version at least v3JxMxB2."]
1483 pub unsafe fn connectCanBootloader(
1484 &self,
1485 canParameters: canConnectParameters,
1486 ) -> ::std::os::raw::c_int {
1487 (self
1488 .connectCanBootloader
1489 .as_ref()
1490 .expect("Expected function, got error."))(canParameters)
1491 }
1492 #[doc = " \\brief This routine allows to start connection to device through I2C interface.\n \\param i2cParameters : Indicates customized configuration for I2C connection\n \\return 0 if the connection successfully established, otherwise an error occurred."]
1493 pub unsafe fn connectI2cBootloader(
1494 &self,
1495 i2cParameters: i2cConnectParameters,
1496 ) -> ::std::os::raw::c_int {
1497 (self
1498 .connectI2cBootloader
1499 .as_ref()
1500 .expect("Expected function, got error."))(i2cParameters)
1501 }
1502 #[doc = " \\brief This routine allows to choose your custom display.\n \\param c : Fill the struct to customize the display tool.\n \\note This function must be called first of all to ensure the display management."]
1503 pub unsafe fn setDisplayCallbacks(&self, c: displayCallBacks) {
1504 (self
1505 .setDisplayCallbacks
1506 .as_ref()
1507 .expect("Expected function, got error."))(c)
1508 }
1509 #[doc = " \\brief This routine allows to choose the verbosity level for display.\n \\param level : Indicates the verbosity number 0, 1 or 3."]
1510 pub unsafe fn setVerbosityLevel(&self, level: ::std::os::raw::c_int) {
1511 (self
1512 .setVerbosityLevel
1513 .as_ref()
1514 .expect("Expected function, got error."))(level)
1515 }
1516 #[doc = " \\brief This routine allows to check connection status [maintained or lost].\n \\return 1 if the device is already connected, otherwise the connection to device is lost."]
1517 pub unsafe fn checkDeviceConnection(&self) -> ::std::os::raw::c_int {
1518 (self
1519 .checkDeviceConnection
1520 .as_ref()
1521 .expect("Expected function, got error."))()
1522 }
1523 #[doc = " \\brief This routine allows to get general device informations.\n \\return Structure #GeneralInf in which the informations are stored."]
1524 pub unsafe fn getDeviceGeneralInf(&self) -> *mut generalInf {
1525 (self
1526 .getDeviceGeneralInf
1527 .as_ref()
1528 .expect("Expected function, got error."))()
1529 }
1530 #[doc = " \\brief This routine allows to receive memory data on the used interface with the configration already initialized.\n \\param address : The address to start reading from.\n \\param data : Pointer to the data buffer.\n \\param size : It indicates the size for read data.\n \\return 0 if the reading operation correctly finished, otherwise an error occurred.\n \\warning Unlike ST-LINK interface, the Bootloader interface can access only to some specific memory regions."]
1531 pub unsafe fn readMemory(
1532 &self,
1533 address: ::std::os::raw::c_uint,
1534 data: *mut *mut ::std::os::raw::c_uchar,
1535 size: ::std::os::raw::c_uint,
1536 ) -> ::std::os::raw::c_int {
1537 (self
1538 .readMemory
1539 .as_ref()
1540 .expect("Expected function, got error."))(address, data, size)
1541 }
1542 #[doc = " \\brief This routine allows to write memory data on the user interface with the configration already initialized.\n \\param address : The address to start writing from.\n \\param data : Pointer to the data buffer.\n \\param size : It indicates the size for write data.\n \\return 0 if the writing operation correctly finished, otherwise an error occurred.\n \\warning Unlike ST-LINK interface, the Bootloader interface can access only to some specific memory regions."]
1543 pub unsafe fn writeMemory(
1544 &self,
1545 address: ::std::os::raw::c_uint,
1546 data: *mut ::std::os::raw::c_char,
1547 size: ::std::os::raw::c_uint,
1548 ) -> ::std::os::raw::c_int {
1549 (self
1550 .writeMemory
1551 .as_ref()
1552 .expect("Expected function, got error."))(address, data, size)
1553 }
1554 #[doc = " \\brief This routine allows to write sector data on the user interface with the configration already initialized.\n \\param address : The address to start writing from.\n \\param data : Pointer to the data buffer.\n \\param size : It indicates the size for write data.\n \\return 0 if the writing operation correctly finished, otherwise an error occurred.\n \\warning Unlike ST-LINK interface, the Bootloader interface can access only to some specific memory regions.\n \\warning Data size should not exceed sector size."]
1555 pub unsafe fn editSector(
1556 &self,
1557 address: ::std::os::raw::c_uint,
1558 data: *mut ::std::os::raw::c_char,
1559 size: ::std::os::raw::c_uint,
1560 ) -> ::std::os::raw::c_int {
1561 (self
1562 .editSector
1563 .as_ref()
1564 .expect("Expected function, got error."))(address, data, size)
1565 }
1566 #[doc = " \\brief This routine allows to download data from a file to the memory.\n File formats that are supported : hex, bin, srec, tsv, elf, axf, out, stm32, ext\n \\param filePath : Indicates the full path of the considered file.\n \\param address : The address to start downloading from.\n \\param skipErase : In case to win in term time and if we have a blank device, we can skip erasing memory before programming [skipErase=0].\n \\param verify : To add verification step after downloading.\n \\param binPath : Path of the binary file.\n \\return 0 if the downloading operation correctly finished, otherwise an error occurred."]
1567 pub unsafe fn downloadFile(
1568 &self,
1569 filePath: *const u32,
1570 address: ::std::os::raw::c_uint,
1571 skipErase: ::std::os::raw::c_uint,
1572 verify: ::std::os::raw::c_uint,
1573 binPath: *const u32,
1574 ) -> ::std::os::raw::c_int {
1575 (self
1576 .downloadFile
1577 .as_ref()
1578 .expect("Expected function, got error."))(
1579 filePath, address, skipErase, verify, binPath
1580 )
1581 }
1582 #[doc = " \\brief This routine allows to run the application.\n \\param address : The address to start executing from.\n In most cases, the program will run from the Flash memory starting from 0x08000000.\n \\return 0 if the execution correctly started, otherwise an error occurred."]
1583 pub unsafe fn execute(&self, address: ::std::os::raw::c_uint) -> ::std::os::raw::c_int {
1584 (self
1585 .execute
1586 .as_ref()
1587 .expect("Expected function, got error."))(address)
1588 }
1589 #[doc = " \\brief This routine allows to erase the whole Flash memory.\n \\return 0 if the operation finished successfully, otherwise an error was occurred.\n \\note Depending on the device, this routine can take a particular period of time."]
1590 pub unsafe fn massErase(
1591 &self,
1592 sFlashMemName: *mut ::std::os::raw::c_char,
1593 ) -> ::std::os::raw::c_int {
1594 (self
1595 .massErase
1596 .as_ref()
1597 .expect("Expected function, got error."))(sFlashMemName)
1598 }
1599 #[doc = " \\brief This routine allows to erase specific sectors of the Flash memory.\n \\param sectors : Indicates the indexs of the specific sectors to be erased.\n \\param sectorNbr : The number of chosen sectors.\n \\return 0 if the operation finished successfully, otherwise an error occurred.\n \\note Each circuit has a specific number of Flash memory sectors."]
1600 pub unsafe fn sectorErase(
1601 &self,
1602 sectors: *mut ::std::os::raw::c_uint,
1603 sectorNbr: ::std::os::raw::c_uint,
1604 sFlashMemName: *mut ::std::os::raw::c_char,
1605 ) -> ::std::os::raw::c_int {
1606 (self
1607 .sectorErase
1608 .as_ref()
1609 .expect("Expected function, got error."))(sectors, sectorNbr, sFlashMemName)
1610 }
1611 #[doc = " \\brief This routine allows to disable the readout protection.\n If the memory is not protected, a message appears to indicate that the device is not\n under Readout protection and the command has no effects.\n \\return 0 if the disabling correctly accomplished, otherwise an error occurred.\n \\note Depending on the device used, this routine take a specific time."]
1612 pub unsafe fn readUnprotect(&self) -> ::std::os::raw::c_int {
1613 (self
1614 .readUnprotect
1615 .as_ref()
1616 .expect("Expected function, got error."))()
1617 }
1618 #[doc = " \\brief This routine allows the TZEN Option Byte regression.\n \\return 0 if the disabling correctly accomplished, otherwise an error occurred.\n \\note Depending on the device used, this routine take a specific time."]
1619 pub unsafe fn tzenRegression(&self) -> ::std::os::raw::c_int {
1620 (self
1621 .tzenRegression
1622 .as_ref()
1623 .expect("Expected function, got error."))()
1624 }
1625 #[doc = " \\brief This routine allows to know the interface what is in use.\n \\return The target interface type #targetInterfaceType, otherwise -1."]
1626 pub unsafe fn getTargetInterfaceType(&self) -> ::std::os::raw::c_int {
1627 (self
1628 .getTargetInterfaceType
1629 .as_ref()
1630 .expect("Expected function, got error."))()
1631 }
1632 #[doc = " \\brief This routine allows to drop the current read/write operation.\n \\return 0 if there is no call for stop operation, otherwise 1."]
1633 pub unsafe fn getCancelPointer(&self) -> *mut ::std::os::raw::c_int {
1634 (self
1635 .getCancelPointer
1636 .as_ref()
1637 .expect("Expected function, got error."))()
1638 }
1639 #[doc = " \\brief This routine allows to open and get data from any supported file extension.\n \\param filePath : Indicates the full path of the considered file.\n \\return Pointer to #fileData_C if the file has hex, bin, srec or elf as extension, otherwise a null pointer to indicate that the file type is not supported."]
1640 pub unsafe fn fileOpen(&self, filePath: *const u32) -> *mut ::std::os::raw::c_void {
1641 (self
1642 .fileOpen
1643 .as_ref()
1644 .expect("Expected function, got error."))(filePath)
1645 }
1646 #[doc = " \\brief This routine allows to clean up the handled file data.\n \\param data"]
1647 pub unsafe fn freeFileData(&self, data: *mut fileData_C) {
1648 (self
1649 .freeFileData
1650 .as_ref()
1651 .expect("Expected function, got error."))(data)
1652 }
1653 #[doc = " @brief This routine allows to free a specific memory region, typically used after readMemory().\n @param ptr : The input pointer address.\n \\note it's crucial to ensure that the data is no longer in use after you free the memory."]
1654 pub unsafe fn freeLibraryMemory(&self, ptr: *mut ::std::os::raw::c_void) {
1655 (self
1656 .freeLibraryMemory
1657 .as_ref()
1658 .expect("Expected function, got error."))(ptr)
1659 }
1660 #[doc = " \\brief This routine allows to verfiy if the indicated file data is identical to Flash memory content.\n \\param fileData : Input file name.\n \\param address : The address to start verifying from, it's considered only if the file has .bin or .binary as extension.\n \\return 0 if the file data matching Flash memory content, otherwise an error occurred or the data is mismatched."]
1661 pub unsafe fn verify(
1662 &self,
1663 fileData: *mut fileData_C,
1664 address: ::std::os::raw::c_uint,
1665 ) -> ::std::os::raw::c_int {
1666 (self.verify.as_ref().expect("Expected function, got error."))(fileData, address)
1667 }
1668 #[doc = " \\brief This routine allows to save the data file content to another file.\n \\param fileData : Input file name.\n \\param sFileName : Output file name.\n \\return 0 if the output file was created successfully, otherwise an error occurred."]
1669 pub unsafe fn saveFileToFile(
1670 &self,
1671 fileData: *mut fileData_C,
1672 sFileName: *const u32,
1673 ) -> ::std::os::raw::c_int {
1674 (self
1675 .saveFileToFile
1676 .as_ref()
1677 .expect("Expected function, got error."))(fileData, sFileName)
1678 }
1679 #[doc = " \\brief This routine allows to save Flash memory content to file.\n \\param address : The address to start saving from.\n \\param size : Data size to be saved.\n \\param sFileName : Indicates the file name.\n \\return 0 if the data copy was acheived successfully, otherwise an error occurred.\n \\note The file name must finish with an extension \".hex\", \".bin\" or \".srec\""]
1680 pub unsafe fn saveMemoryToFile(
1681 &self,
1682 address: ::std::os::raw::c_int,
1683 size: ::std::os::raw::c_int,
1684 sFileName: *const u32,
1685 ) -> ::std::os::raw::c_int {
1686 (self
1687 .saveMemoryToFile
1688 .as_ref()
1689 .expect("Expected function, got error."))(address, size, sFileName)
1690 }
1691 #[doc = " \\brief This routine allows to clean up and disconnect the current connected target.\n \\note This routine disconnect the target and delete the loaded Flash Loaders."]
1692 pub unsafe fn disconnect(&self) {
1693 (self
1694 .disconnect
1695 .as_ref()
1696 .expect("Expected function, got error."))()
1697 }
1698 #[doc = " \\brief This routine allows to clear the list of each created interface.\n \\note The list is filled by #getStlinkList, #getDfuDeviceList or #getUsartList."]
1699 pub unsafe fn deleteInterfaceList(&self) {
1700 (self
1701 .deleteInterfaceList
1702 .as_ref()
1703 .expect("Expected function, got error."))()
1704 }
1705 #[doc = " \\brief This routine allows to enter and make an automatic process for memory management through JTAG/SWD, UART, DFU, SPI, CAN and I²C interfaces.\n \\param filePath : Indicates the full file path.\n \\param address : The address to start downloading from.\n \\param skipErase : If we have a blank device, we can skip erasing memory before programming [skipErase=0].\n \\param verify : Add verification step after downloading.\n \\param isMassErase : Erase the whole Flash memory.\n \\param obCommand : Indicates the option bytes commands to be loaded \"-ob [optionbyte=value] [optionbyte=value]...\"\n \\param run : Start the application.\n \\warning Connection to target must be established before performing automatic mode."]
1706 pub unsafe fn automaticMode(
1707 &self,
1708 filePath: *const u32,
1709 address: ::std::os::raw::c_uint,
1710 skipErase: ::std::os::raw::c_uint,
1711 verify: ::std::os::raw::c_uint,
1712 isMassErase: ::std::os::raw::c_int,
1713 obCommand: *mut ::std::os::raw::c_char,
1714 run: ::std::os::raw::c_int,
1715 ) {
1716 (self
1717 .automaticMode
1718 .as_ref()
1719 .expect("Expected function, got error."))(
1720 filePath,
1721 address,
1722 skipErase,
1723 verify,
1724 isMassErase,
1725 obCommand,
1726 run,
1727 )
1728 }
1729 #[doc = " \\brief This routine allows to enter and make an automatic process for memory management with serial numbering through JTAG/SWD, UART, DFU, SPI, CAN and I²C interfaces.\n \\param filePath : Indicates the full file path.\n \\param address : The address to start downloading from.\n \\param skipErase : If we have a blank device, we can skip erasing memory before programming [skipErase=0].\n \\param verify : Add verification step after downloading.\n \\param isMassErase : Erase the whole Flash memory.\n \\param obCommand : Indicates the option bytes commands to be loaded \"-ob [optionbyte=value] [optionbyte=value]...\"\n \\param run : Start the application.\n \\param enableSerialNumbering : enables the serial numbering.\n \\param serialAddress : the address where the inital data and the subsequent increments will be made.\n \\param serialSize : size for the serial numbering.\n \\param serialInitialData : intial data used for the serial numbering that will be incremented.\n \\warning Connection to target must be established before performing automatic mode with serial numbering."]
1730 pub unsafe fn serialNumberingAutomaticMode(
1731 &self,
1732 filePath: *const u32,
1733 address: ::std::os::raw::c_uint,
1734 skipErase: ::std::os::raw::c_uint,
1735 verify: ::std::os::raw::c_uint,
1736 isMassErase: ::std::os::raw::c_int,
1737 obCommand: *mut ::std::os::raw::c_char,
1738 run: ::std::os::raw::c_int,
1739 enableSerialNumbering: ::std::os::raw::c_int,
1740 serialAddress: ::std::os::raw::c_int,
1741 serialSize: ::std::os::raw::c_int,
1742 serialInitialData: *mut ::std::os::raw::c_char,
1743 ) {
1744 (self
1745 .serialNumberingAutomaticMode
1746 .as_ref()
1747 .expect("Expected function, got error."))(
1748 filePath,
1749 address,
1750 skipErase,
1751 verify,
1752 isMassErase,
1753 obCommand,
1754 run,
1755 enableSerialNumbering,
1756 serialAddress,
1757 serialSize,
1758 serialInitialData,
1759 )
1760 }
1761 #[doc = " \\brief This routine allows to get Flash storage information.\n \\param deviceStorageStruct : The data strcurure to load memory sectors information.\n \\return 0 if the operation was acheived successfully, otherwise an error occurred."]
1762 pub unsafe fn getStorageStructure(
1763 &self,
1764 deviceStorageStruct: *mut *mut storageStructure,
1765 ) -> ::std::os::raw::c_int {
1766 (self
1767 .getStorageStructure
1768 .as_ref()
1769 .expect("Expected function, got error."))(deviceStorageStruct)
1770 }
1771 #[doc = " \\brief This routine allows program the given Option Byte.\n The option bytes are configured by the end user depending on the application requirements.\n \\param command : Indicates the command to execute.\n \\return 0 if the programming Option Byte correctly executed, otherwise an error occurred.\n \\note The command must written as: -ob [optionbyte=value] [optionbyte=value] ...\n \\code\n int ob = sendOptionBytesCmd(\"–ob rdp=0x0 BOR_LEV=0\");\n \\endcode"]
1772 pub unsafe fn sendOptionBytesCmd(
1773 &self,
1774 command: *mut ::std::os::raw::c_char,
1775 ) -> ::std::os::raw::c_int {
1776 (self
1777 .sendOptionBytesCmd
1778 .as_ref()
1779 .expect("Expected function, got error."))(command)
1780 }
1781 #[doc = " \\brief This routine allows to get option bytes values of the connected target.\n \\return Structure #Peripheral_C in which the option bytes descriptions are stored."]
1782 pub unsafe fn initOptionBytesInterface(&self) -> *mut peripheral_C {
1783 (self
1784 .initOptionBytesInterface
1785 .as_ref()
1786 .expect("Expected function, got error."))()
1787 }
1788 pub unsafe fn fastRomInitOptionBytesInterface(&self, deviceId: u16) -> *mut peripheral_C {
1789 (self
1790 .fastRomInitOptionBytesInterface
1791 .as_ref()
1792 .expect("Expected function, got error."))(deviceId)
1793 }
1794 #[doc = " \\brief This routine allows to display the Option bytes.\n \\return 0 if the programming display correctly done, otherwise an error occurred."]
1795 pub unsafe fn obDisplay(&self) -> ::std::os::raw::c_int {
1796 (self
1797 .obDisplay
1798 .as_ref()
1799 .expect("Expected function, got error."))()
1800 }
1801 #[doc = " \\brief This routine allows to specify the location of Flash Loader.\n \\param path : Indicates the full path of the considered folder."]
1802 pub unsafe fn setLoadersPath(&self, path: *const ::std::os::raw::c_char) {
1803 (self
1804 .setLoadersPath
1805 .as_ref()
1806 .expect("Expected function, got error."))(path)
1807 }
1808 #[doc = " \\brief This routine allows to specify the path of the external Loaders to be loaded.\n \\param path : Indicates the full path of the folder containing external Loaders.\n \\param externalLoaderInfo : Structure in which the external Loaders informations are stored."]
1809 pub unsafe fn setExternalLoaderPath(
1810 &self,
1811 path: *const ::std::os::raw::c_char,
1812 externalLoaderInfo: *mut *mut externalLoader,
1813 ) {
1814 (self
1815 .setExternalLoaderPath
1816 .as_ref()
1817 .expect("Expected function, got error."))(path, externalLoaderInfo)
1818 }
1819 #[doc = " \\brief This routine allows to specify the path of the external Loaders to be loaded via OBL interfaces.\n \\param path : Indicates the full path of the folder containing external Loaders.\n \\param externalLoaderInfo : Structure in which the external Loaders informations are stored."]
1820 pub unsafe fn setExternalLoaderOBL(
1821 &self,
1822 path: *const ::std::os::raw::c_char,
1823 externalLoaderInfo: *mut *mut externalLoader,
1824 ) {
1825 (self
1826 .setExternalLoaderOBL
1827 .as_ref()
1828 .expect("Expected function, got error."))(path, externalLoaderInfo)
1829 }
1830 #[doc = " \\brief This routine allows to get available external Loaders in the mentioned path.\n \\param path : Indicates the full path containing ExternalLoader folder.\n \\param externalStorageNfo : Structure in which we get storage information.\n \\return 1 if the External loaders cannot be loaded from the path, otherwise 0.\n \\warning All external Loader files should have the extension \"stldr\"."]
1831 pub unsafe fn getExternalLoaders(
1832 &self,
1833 path: *const ::std::os::raw::c_char,
1834 externalStorageNfo: *mut *mut externalStorageInfo,
1835 ) -> ::std::os::raw::c_int {
1836 (self
1837 .getExternalLoaders
1838 .as_ref()
1839 .expect("Expected function, got error."))(path, externalStorageNfo)
1840 }
1841 #[doc = " \\brief This routine allows to unload an external Loaders.\n \\param path : Indicates the full path of the external Loader file ready for unloading."]
1842 pub unsafe fn removeExternalLoader(&self, path: *const ::std::os::raw::c_char) {
1843 (self
1844 .removeExternalLoader
1845 .as_ref()
1846 .expect("Expected function, got error."))(path)
1847 }
1848 #[doc = " \\brief This routine allows to delete all target Flash Loaders."]
1849 pub unsafe fn deleteLoaders(&self) {
1850 (self
1851 .deleteLoaders
1852 .as_ref()
1853 .expect("Expected function, got error."))()
1854 }
1855 #[doc = " \\brief This routine allows to read the device unique identifier.\n \\param data : Pointer to the data buffer."]
1856 pub unsafe fn getUID64(
1857 &self,
1858 data: *mut *mut ::std::os::raw::c_uchar,
1859 ) -> ::std::os::raw::c_int {
1860 (self
1861 .getUID64
1862 .as_ref()
1863 .expect("Expected function, got error."))(data)
1864 }
1865 #[doc = " \\brief This routine allows to erase the BLE stack firmware.\n \\return 0 if the operation was acheived successfully, otherwise an error occurred."]
1866 pub unsafe fn firmwareDelete(&self) -> ::std::os::raw::c_int {
1867 (self
1868 .firmwareDelete
1869 .as_ref()
1870 .expect("Expected function, got error."))()
1871 }
1872 #[doc = " \\brief This routine allows to make upgrade of BLE stack firmware or FUS firmware.\n \\param filePath : Indicates the full path of the firmware to be programmed.\n \\param address : Start address of download.\n \\param firstInstall : 1 if it is the first installation, otherwise 0, to ignore the firmware delete operation.\n \\param startStack : Starts the stack after programming.\n \\param verify : Verify if the download operation is achieved successfully before starting the upgrade.\n \\return true if the operation was acheived successfully, otherwise an error occurred."]
1873 pub unsafe fn firmwareUpgrade(
1874 &self,
1875 filePath: *const u32,
1876 address: ::std::os::raw::c_uint,
1877 firstInstall: ::std::os::raw::c_uint,
1878 startStack: ::std::os::raw::c_uint,
1879 verify: ::std::os::raw::c_uint,
1880 ) -> ::std::os::raw::c_int {
1881 (self
1882 .firmwareUpgrade
1883 .as_ref()
1884 .expect("Expected function, got error."))(
1885 filePath,
1886 address,
1887 firstInstall,
1888 startStack,
1889 verify,
1890 )
1891 }
1892 #[doc = " \\brief This routine allows to start the programmed Stack.\n \\return true if the Stack was started successfully, otherwise an error occurred."]
1893 pub unsafe fn startWirelessStack(&self) -> ::std::os::raw::c_int {
1894 (self
1895 .startWirelessStack
1896 .as_ref()
1897 .expect("Expected function, got error."))()
1898 }
1899 #[doc = " \\brief This routine allows to start the programmed Stack.\n \\param filePath : Indicates the full path of the key file.\n \\note This is the public key generated by STM32TrustedPackageCreator when signing the firmware using -sign command.\n \\return true if the update was performed successfully, otherwise an error occurred."]
1900 pub unsafe fn updateAuthKey(&self, filePath: *const u32) -> ::std::os::raw::c_int {
1901 (self
1902 .updateAuthKey
1903 .as_ref()
1904 .expect("Expected function, got error."))(filePath)
1905 }
1906 #[doc = " \\brief This routine allows to lock the authentication key and once locked, it is no longer possible to change it.\n \\return 0 if the lock step was performed successfully, otherwise an error occurred."]
1907 pub unsafe fn authKeyLock(&self) -> ::std::os::raw::c_int {
1908 (self
1909 .authKeyLock
1910 .as_ref()
1911 .expect("Expected function, got error."))()
1912 }
1913 #[doc = " \\brief This routine allows to write a customized user key.\n \\param filePath : Indicates the full path of the key file.\n \\param keyType : String indicating the key type to be used \"Simple\", \"Master\", \"Encrypted\".\n \\return 0 if the write was performed successfully, otherwise an error occurred."]
1914 pub unsafe fn writeUserKey(
1915 &self,
1916 filePath: *const u32,
1917 keyType: ::std::os::raw::c_uchar,
1918 ) -> ::std::os::raw::c_int {
1919 (self
1920 .writeUserKey
1921 .as_ref()
1922 .expect("Expected function, got error."))(filePath, keyType)
1923 }
1924 #[doc = " \\brief This routine allows to activate the AntiRollBack.\n \\return true if the activation was done successfully, otherwise an error occurred."]
1925 pub unsafe fn antiRollBack(&self) -> ::std::os::raw::c_int {
1926 (self
1927 .antiRollBack
1928 .as_ref()
1929 .expect("Expected function, got error."))()
1930 }
1931 #[doc = " \\brief This routine allows to start and establish a communication with the FUS operator.\n \\return true if the FUS operator was started successfully, otherwise an error occurred.\n \\note Availbale only for ST-LINK interfaces."]
1932 pub unsafe fn startFus(&self) -> ::std::os::raw::c_int {
1933 (self
1934 .startFus
1935 .as_ref()
1936 .expect("Expected function, got error."))()
1937 }
1938 #[doc = " \\brief This routine allows to set default option Bytes."]
1939 pub unsafe fn unlockchip(&self) -> ::std::os::raw::c_int {
1940 (self
1941 .unlockchip
1942 .as_ref()
1943 .expect("Expected function, got error."))()
1944 }
1945 #[doc = " \\brief This routine aims to launch the Secure Secret Provisioning.\n \\param sspFile : Indicates the full path of the ssp file [Use STM32TrustedPackageCreator to generate a ssp image].\n \\param licenseFile : Indicates the full path of the license file. If you are trying to start the SSP without HSM, the hsmSlotId should be 0.\n \\param tfaFile : Indicates the full path of the tfa-ssp file.\n \\param hsmSlotId : Indicates the HSM slot ID.\n \\return 0 if the SSP was finished successfully, otherwise an error occurred.\n \\note If you are trying to start the SSP with HSM, the licenseFile parametre should be empty."]
1946 pub unsafe fn programSsp(
1947 &self,
1948 sspFile: *const u32,
1949 licenseFile: *const u32,
1950 tfaFile: *const u32,
1951 hsmSlotId: ::std::os::raw::c_int,
1952 ) -> ::std::os::raw::c_int {
1953 (self
1954 .programSsp
1955 .as_ref()
1956 .expect("Expected function, got error."))(
1957 sspFile, licenseFile, tfaFile, hsmSlotId
1958 )
1959 }
1960 #[doc = " @brief getHsmFirmwareID: this routine aims to get the HSM Firmware Identifier.\n @param hsmSlotId: The slot index of the plugud-in HSM\n @return string that contains the HSM Firmware Identifier."]
1961 pub unsafe fn getHsmFirmwareID(
1962 &self,
1963 hsmSlotId: ::std::os::raw::c_int,
1964 ) -> *const ::std::os::raw::c_char {
1965 (self
1966 .getHsmFirmwareID
1967 .as_ref()
1968 .expect("Expected function, got error."))(hsmSlotId)
1969 }
1970 #[doc = " @brief getHsmCounter: this routine aims to get the current HSM counter.\n @param hsmSlotId: The slot index of the plugud-in HSM\n @return Counter value"]
1971 pub unsafe fn getHsmCounter(
1972 &self,
1973 hsmSlotId: ::std::os::raw::c_int,
1974 ) -> ::std::os::raw::c_ulong {
1975 (self
1976 .getHsmCounter
1977 .as_ref()
1978 .expect("Expected function, got error."))(hsmSlotId)
1979 }
1980 #[doc = " @brief getHsmState: this routine aims to get the HSM State.\n @param hsmSlotId: The slot index of the plugud-in HSM\n @return string with possible values: ST_STATE , OEM_STATE, OPERATIONAL_STATE , UNKNOWN_STATE"]
1981 pub unsafe fn getHsmState(
1982 &self,
1983 hsmSlotId: ::std::os::raw::c_int,
1984 ) -> *const ::std::os::raw::c_char {
1985 (self
1986 .getHsmState
1987 .as_ref()
1988 .expect("Expected function, got error."))(hsmSlotId)
1989 }
1990 #[doc = " @brief getHsmVersion: this routine aims to get the HSM version.\n @param hsmSlotId: The slot index of the plugud-in HSM\n @return string with possible values: 1 , 2"]
1991 pub unsafe fn getHsmVersion(
1992 &self,
1993 hsmSlotId: ::std::os::raw::c_int,
1994 ) -> *const ::std::os::raw::c_char {
1995 (self
1996 .getHsmVersion
1997 .as_ref()
1998 .expect("Expected function, got error."))(hsmSlotId)
1999 }
2000 #[doc = " @brief getHsmType: this routine aims to get the HSM type.\n @param hsmSlotId: The slot index of the plugud-in HSM\n @return string with possible values: SFI. SMU. SSP..."]
2001 pub unsafe fn getHsmType(
2002 &self,
2003 hsmSlotId: ::std::os::raw::c_int,
2004 ) -> *const ::std::os::raw::c_char {
2005 (self
2006 .getHsmType
2007 .as_ref()
2008 .expect("Expected function, got error."))(hsmSlotId)
2009 }
2010 #[doc = " @brief getHsmLicense: this routine aims to get and save the HSM license into a binary file.\n @param hsmSlotId: The slot index of the plugud-in HSM\n @param outLicensePath: path of the output binary file.\n @return 0 if the operation was finished successfully, otherwise an error occurred.\n \\note Connection to target must be established before performing this routine."]
2011 pub unsafe fn getHsmLicense(
2012 &self,
2013 hsmSlotId: ::std::os::raw::c_int,
2014 outLicensePath: *const u32,
2015 ) -> ::std::os::raw::c_int {
2016 (self
2017 .getHsmLicense
2018 .as_ref()
2019 .expect("Expected function, got error."))(hsmSlotId, outLicensePath)
2020 }
2021 #[doc = " \\brief Write a core register.\n \\param reg : The register to write.\n \\param data : The data to write.\n \\return 0 if the writing operation correctly finished, otherwise an error occurred."]
2022 pub unsafe fn writeCortexRegistres(
2023 &self,
2024 reg: ::std::os::raw::c_uint,
2025 data: ::std::os::raw::c_uint,
2026 ) -> ::std::os::raw::c_int {
2027 (self
2028 .writeCortexRegistres
2029 .as_ref()
2030 .expect("Expected function, got error."))(reg, data)
2031 }
2032 #[doc = " \\brief Read a core register.\n \\param reg : The register to read.\n \\param data : The data read.\n \\return 0 if the reading operation correctly finished, otherwise an error occurred."]
2033 pub unsafe fn readCortexReg(
2034 &self,
2035 reg: ::std::os::raw::c_uint,
2036 data: *mut ::std::os::raw::c_uint,
2037 ) -> ::std::os::raw::c_int {
2038 (self
2039 .readCortexReg
2040 .as_ref()
2041 .expect("Expected function, got error."))(reg, data)
2042 }
2043}